Tuning the Translational PID
Purpose
The translational PID ensures the robot follows a straight path without lateral deviation. It corrects the robot’s position along an imaginary forward line from its starting position.
Setup
- Open FTC Dashboard and go to the Follower tab.
- Enable
useTranslational
and disable all other checkboxes. - Run the
StraightBackAndForth
OpMode. - Ensure the timer for autonomous OpModes is disabled.
Tuning Process
- Push the robot laterally (left or right) to test its correction response.
- Adjust the PID constants (
translationalPIDF
) in the FollowerConstants tab of FTC Dashboard.- Goal: Minimize oscillations while maintaining accuracy.
Feedforward Adjustments
If additional feedforward is needed, use translationalPIDFFeedForward
for corrections in the robot’s movement direction. Avoid modifying the feedforward term directly in the PIDF.
Testing
Test by pushing the robot with varying force and from different directions. Observe its ability to correct smoothly and accurately without oscillations.
Input Tuned Values
- Open the
FConstants
class and navigate to thestatic{}
block. - Then, on a new line, add
FollowerConstants.translationalPIDFCoefficients = new CustomPIDFCoefficients(P,I,D,F);
, withP
,I
,D
, andF
being the values you tuned for and inputted into FTC Dashboard.
Note: In Step 2, you only need to make a new line if you are not using the quickstart, otherwise, you can just modify the line that already does this.
Secondary PIDF Tuning
If you are going to use the secondary PIDF for the translational error, you can tune the secondary PIDF coefficients by following the same process as the primary PIDF coefficients.
Input them into the FollowerConstants.secondaryTranslationalPIDFCoefficients
in the FConstants
class the same way that the primary PIDF coefficients are inputted.
Congratulations, you’ve completed the translational PIDF tuning!
Now, move onto the next section to tune your Heading PIDF(s).