FTC Moving 202008

From wikidb
Jump to: navigation, search

Encoder Notes

Documentation and tutorials

issues with pidf

Issue reported and solved

Firmware https://www.revrobotics.com/software/#exphubpreviousfirmware

api

PID


pid api

PIDCoefficients DcMotorEx

Code snipets

 DcMotorEx motorExLeft;
 motorExLeft = (DcMotorEx)hardwareMap.get(DcMotor.class, "left_drive”);
 PIDCoefficients pidOrig = motorExLeft.getPIDCoefficients(DcMotor.RunMode.RUN_USING_ENCODER);
 pidOrig.
 PIDCoefficients pidNew = new PIDCoefficients(NEW_P, NEW_I, NEW_D);
 motorExLeft.setPIDCoefficients(DcMotor.RunMode.RUN_USING_ENCODER, pidNew);
  • getVelocity in ticks per second
  • f is the tolerance

Moving the Distance

  • Core Hex Motor
    • Output Shaft: 5mm Female Hex
    • Weight: 7 oz
    • Free Speed: 125 RPM
    • Stall Torque: 3.2 N-m
    • Stall Current: 4.4 A
    • Gear Ratio: 72:1
    • Encoder Counts per Revolution
      • At the motor - 4 counts/revolution
      • At the output - 288 counts/revolution
 90 mm * 3.1416 = 282.7 mm / rotation = / 25.4 mm 11.13 inches / rotation
 288 couts / rotation   divided  11.13  inches / rotation   =  25.76 counts / inch
 max is 125 rev / minute   divide 60 seconds / minute = 2.08 rev /second
 2.08 rev / sec time 288 counts/  rev = 600 counts / sec   = max speed