Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drive PID Auto Tuner #92

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

Drive PID Auto Tuner #92

wants to merge 2 commits into from

Conversation

CodingPotatoes
Copy link

@CodingPotatoes CodingPotatoes commented Dec 6, 2024

Description
AutoTuner for DrivePID with a WIP AutoTuner for TurnPID

Usage

How to use this feature:
Create a Tuner Config and pass it to a AutoTuningTools, then run the appropriate void method on a buton press

// A code sample for how to use the feature
in opcontrol:
static DriveTuningConfig tuningConfig{
        .startspeed = 0.5
    ,.endspeed = 0
    ,.dir = vex::forward
    ,.distance = 24
    ,.pidConfig = &drive_pid_cfg
    ,.right_motors = &right_motors
    ,.odom = odom
    };
    static AutoTuningTools autoTuner(&driveSus, tuningConfig);
    con.ButtonX.pressed([](){
        autoTuner.TuneDrivePID();
    });
    con.ButtonB.pressed([](){
        autoTuner.driveWithError();
});

make sure the robot has a little more than enough (roughly 1.2x) distance to reach the target distance for the tuner
Testing

Many attempts run on the software bot to get the correct max p and period of oscillation needed to get the PID values using the Zeigler-Nichols Method

References
https://en.wikipedia.org/wiki/Ziegler%E2%80%93Nichols_method

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant