Tuning Talon SRX PID values in shuffleboard?

I know that you can get the PIDSubsystem class to show up in shuffleboard in test mode, but is there a way that you can do that with the Talon SRX values? I want to test and tune our system through shuffleboard instead of deploying every time.

You’d have to make a sendable with the type RobotPreferences and would have to listen for when those values are changed. I made something for this that I can post the code to later. There’s nothing in WPIPib right now that allows for this easily.

Try using Phoenix Tuner.
https://phoenix-documentation.readthedocs.io/en/latest/ch03_PrimerPhoenixSoft.html#what-is-phoenix-tuner

1 Like

OK, here’s a general idea of what you’d do:

public void initSendable(SendableBuilder builder){
    builder.setSmartDashboardType("RobotPreferences"); // make values editable
    builder.addDoubleProperty("P", this::getP, this::setP);
}

You would do the same thing for I, D, and any other configurations in the talon. You would, of course, have to define getP() and setP() methods in your class, but that shouldn’t be too difficult. setP and any other set methods would configure that PID value on the talon.

By next year, I hope to create a library that makes messing with talons easier. I hope to include something like this. For now, you’ll have to adjust this to your needs.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.