I’m trying to run PID on our drive train using a motion magic control loop. I’m working with phoenix tuner to set my PID and F gains. I initialized my F gain to .1042, after seeing that our max velocity was roughly 9816. But I noticed that the plotter always shows that the closed-loop error is 0, no matter what my F gain is.
How can I find my error? It’d be helpful if anyone can clarify the steps I need to take to tune PID after finding the F gain.
The error will depend on the setpoint of the controller, once set you can view the error using Tuner either with the Plot tab (live) or Self Test tab (instantaneous).
I’m not particularly familiar with motion magic, however when using position or velocity control (which I believe motion magic uses) the error is the difference between where the mechanism should be and where it currently is.
I believe motion magic dynmically changes the setpoint as time goes on, if you run the talon using this mode, I would expect you to see the error changing.
Essentially, you don’t set the error, the PID loop is tuned to minimise it.