Pedro Pathing 1.1.0 has released! If you haven't already, migrate now.
Pedro Pathing LogoPedro Pathing

Translational

The translational PIDF ensures the robot follows a straight path without lateral deviation.

Setup

  1. Open Panels. If you haven't used Panels before, you can read the documentation on the Panels tab of this website (You can switch on the Top Left of the Website).
  2. On your Driver Hub or Driver Station, and connect a gamepad to it. Make sure to press "start" + "a" on the gamepad.
  3. Select the Tuning Opmode. Use your gamepad to select the Manual folder. Then, select Translational Tuner.
  4. Run the run the OpMode.

Note that while running the Translational Tuner OpMode, the robot will stay in place. This is intentional.

Tuning Process

Follow this video to help you tune the PIDF:

  1. Push the robot left or right at varying amounts and observe how the robot corrects back to its starting position.
  2. Adjust the PIDF constants (translationalPIDFCoefficients) in the FollowerConstants tab of Panels to ensure that the robot can accurately correct back to its starting position with minimal oscillations. For example, if the robot has too many oscillations while correcting back to its starting position, lower the P value. On the other hand, if the robot corrects back to its starting location too slowly, increase the P value. If you do not have prior experience with tuning PIDFs, we reccommend that you check out the resources provided at the bottom of the PIDF Tuners page to learn more about tuning PIDFs.

If you have a dual PIDF system enabled, it is recommended to first tune the main PIDF, translationalPIDFCoefficients, to ensure that the robot can smoothly correct from large errors. Then, tune the secondary PIDF, secondaryTranslationalPIDFCoefficients, so the robot can smoothly correct from smaller errors.

Note: Don't worry if the robot doesn't correct its heading. We are only tuning for the translational PIDF: whether the robot corrects left/right appropriately.

Warning: After adjusting a value in Panels, hit "enter" in order to save it and cause the robot to correct differently. However, any values you modify through Panels are not saved into your code! In order to transfer the values you just tuned on Panels into your code, go to the Update Tuned Values section to learn more.

Feedforward Adjustments (Optional)

If additional feedforward is needed, use the feedforward term directly in the translationalPIDFCoefficients and/or secondaryTranslationalPIDFCoefficients if you are using dual PID.

Update Tuned values Into Your Code

  1. Once you are satisfied with your translationalPIDF values, head over to the Constants file.
  2. Navigate to the line .translationalPIDFCoefficients(new PIDFCoefficients(0.1, 0, 0.01, 0))
  3. Update the parameters in new PIDFCoefficients(0.1, 0, 0.01, 0) with the translationalPIDFCoefficients values, P, I, D, F, you tuned on Panels in that order.
  4. If you are using the dual PIDF system, add the line .secondaryTranslationalPIDFCoefficients(new PIDFCoefficients(0.1,0,0.01,0)) and update the secondaryTranslationalPIDF values you tuned on Panels.

Troubleshooting

If you encounter a problem while tuning the translational PIDF, check out the troubleshooting page.

Last updated on