FTC Moving 202008
From wikidb
Contents
Encoder Notes
Documentation and tutorials
- Lesson: Exercise: Using Encoders on PDX STEM
- [https://docs.revrobotics.com/docs/first-tech-challenge FIRST Tech Challenge - REV Documentation}
- Motor PIDF Tuning Guide
- Motor Encoder Guide
- Control Hub and Expansion Hub Firmware Update Guide
- DcMotorEx
issues with pidf
Issue reported and solved
- [https://github.com/ftctechnh/ftc_app/issues/287 DC motor running too slow in RUN_USING_ENCODER run mode #287}
- Robot getting stuck with RUN_TO_POSITION
- DcMotor - Run to position not working
- Drive Straight
- Not going straight
- Straight line driving
- App Update 5.3-64b: PID vs PIDF
Firmware https://www.revrobotics.com/software/#exphubpreviousfirmware
api
PID
- isPIDMode
- https://stemrobotics.cs.pdx.edu/node/7268
- https://github.com/ftctechnh/ftc_app/wiki/Changing-PID-Coefficients Changing PID Coefficients]
- https://github.com/ftctechnh/ftc_app/wiki
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
- FTC_State also ramp up motors
- 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