Setting PID Controller values in shuffleboard

Hello, I’m trying to change PID values for an instance of PIDController I created in my code, but for some reason this is happening:

pid_test

I can change the PID values in the code and the new values will show up in NetworkTables/the shuffleboard widget, but when I try to change the value in the widget or OutlineViewer the value switches back. Is there a simple way of making this editable?

The robot should be in test mode when you modify the PID values.

I also recommend updating shuffleboard to 2019.2.1

1 Like

How do you get the PIDController in the network table though? So far we have only been able to adjust PIDSubsystems in test mode

1 Like

I was able to add it to NetworkTables by giving the PID Controller instance a name and adding it to LiveWindow:

self.pid = wpilib.PIDController(1, 0, 0, self.navx.getAngle, self.pid_output)
self.pid.setName('PID Controller')
wpilib.LiveWindow.add(self.pid)

This is python code, but the Java/C++ version of this should look pretty much the same.

Ok makes sense. And are you using a PID command or PID subsystem, or just a PID controller by itself?

Are you able to separate the pid values into independent variables and then just use SmartDashboard.putNumber/getNumber? My team has been using this method since last year and it works in both smartdashboard and shuffleboard.

Just the PID Controller by itself.

Unfortunately, no. When you try setting the values directly it just switches back, although this probably won’t be an issue in test mode as SamCarlberg mentioned, although I haven’t tried it yet.