From 775e7ffbc8ececc68755292c0a80a23e2d12395d Mon Sep 17 00:00:00 2001 From: Marley Reeves <79887575+Marlstar@users.noreply.github.com> Date: Sun, 17 Nov 2024 14:42:31 +1100 Subject: [PATCH] Clarify translational PIDF tuning process Some quirks in both the process of tuning the translational PIDF and the documentation of it led to confusion for myself and others. - Noted that the telemetry message that the robot will move forward and backward can be ignored for the moment - Noted that the robot should only move when pushed - Noted that the robot will only correct to a line in the original forward direction, not to the starting point --- .../ftc/teamcode/pedroPathing/TUNING.md | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/pedroPathing/TUNING.md b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/pedroPathing/TUNING.md index bd22f46..e76196f 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/pedroPathing/TUNING.md +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/pedroPathing/TUNING.md @@ -47,12 +47,19 @@ measurements will be in centimeters. `lateralZeroPowerAcceleration`, respectively. * After this, we will want to tune the translational PID. Go to FTC Dashboard and disable all but - the `useTranslational` checkboxes under the `Follower` tab. Then, run `StraightBackAndForth`. Make - sure you disable the timer on autonomous OpModes. The PID for the translational error is called - `translationalPIDF`. If you need to add a feedforward value, use the `translationalPIDFFeedForward` - since that will add the feedforward in the direction the robot is trying to move, rather than the - feedforward in the PIDF itself, since those will only add the feedforward one way. You can change - the PIDF constants and feedforward values, under the `FollowerConstants` tab in FTC Dashboard. + the `useTranslational` checkboxes under the `Follower` tab. Then, run `StraightBackAndForth`. + Make sure you disable the timer on autonomous OpModes. You will notice in telemetry a message saying + that the robot will travel a distance forward and backward, this will not happen until later, so for + now you can ignore this message. The robot should not move when you run the opmode initally. Instead, + it should correct when you push it away from its starting position. Note that this correction should + happen regardless of the robot's rotation, and that the robot should not rotate itself (if it does, + disable `useHeading` as mentioned prior). Also note that the robot will only correct to an imaginary line + that runs straight forward from the robot's starting position, meaning that it will not correct in the + (original) forward direction. The PID for the translational error is called `translationalPIDF`. + If you need to add a feedforward value, use the `translationalPIDFFeedForward` since that will add + the feedforward in the direction the robot is trying to move, rather than the feedforward in the + PIDF itself, since those will only add the feedforward one way. You can change the PIDF constants + and feedforward values, under the `FollowerConstants` tab in FTC Dashboard. To tune the PID, push the robot off the path and see how corrects. You will want to alternate sides you push to reduce field wear and tear as well as push with varying power and distance. I would recommend tuning the PID so that it is capable of correcting while minimizing oscillations and still @@ -116,4 +123,4 @@ down and all the values pertaining to the secondary PIDs will be there. The two a PID that handles larger errors (the main PID) and a second PID to handle smaller errors (the secondary PID). The main PID should be tuned to move the error within the secondary PID's range without providing too much momentum that could cause an overshoot. The secondary PID should be tuned -to correct within its range quickly and accurately while minimizing oscillations. \ No newline at end of file +to correct within its range quickly and accurately while minimizing oscillations.