allwpilib icon indicating copy to clipboard operation
allwpilib copied to clipboard

[wpimath] Add PIDController::GetTotalError and ProfiledPIDController::GetTotalError

Open itsmeft24 opened this issue 4 months ago • 1 comments

Adds the ability to retrieve the accumulated error from both PIDController and ProfiledPIDController to allow for the user to monitor the outputs of each individual term.

itsmeft24 avatar Apr 13 '24 17:04 itsmeft24

Keep in mind you should avoid the I term. The most common cause of steady-state error is modeled disturbances. Feedforward can compensate for that immediately, whereas pure integral control has to wind up and down. Integral control should only be used for unmodeled/unmodelable disturbances, and even then, it should only integrate the difference between the expected and actual plant state, not the difference between the setpoint and plant state.

calcmogul avatar Apr 13 '24 17:04 calcmogul