News for hackers. Stuff that matters.
Re:Tune Your PID Controller by hatsunearu on Wednesday May 26, 2021 @12:06PM (#27292290)
You generally need some sort of state space/optimal controls theory to robustly solve problems like that.
Re:Tune Your PID Controller by dognotdog on Wednesday May 26, 2021 @12:23PM (#27292485)
"anti-windup" is usually implemented for PID controllers to avoid increasing the I part infinitely, and linear state-space controls do suffer from the same problem in naive implementations.
Re:Tune Your PID Controller by elcritch on Wednesday May 26, 2021 @02:48PM (#27294508)
Isn’t the windup normally just a min/max type function? Any suggestions for testing an anti-windup code in an implementation?
Re:Tune Your PID Controller by dognotdog on Wednesday May 26, 2021 @03:26PM (#27294955)
Yes, usually just clamp the integrator's accumulator value so that when the actuator is outside the linear control regime (eg. maxing out motor current because we're in the end-stop), the output of the controller doesn't continue increasing to infinity.

(Another way is stopping integration when control output is at its physical limit, usually in addition to a numeric limit.)

As with all other PID parameters, this is something you'd have to figure out more-or-less empirically.

Testing with hardware would be checking that controller outputs stop increasing while the actuator is blocked away from its target value, usually running with much reduced speed/current etc limits. Ideally, of course, run unit tests and SIL, before trying it on actual hardware.

Re:Tune Your PID Controller by gugagore on Wednesday May 26, 2021 @03:31PM (#27295011)
It's a bit more subtle than that.

What saturates is the actuator. You could choose a single minimum/maximum value for the integrator, but it could be better ye to have a value that depends dynamically on how much room there is left in the actuator output.

For example, if the actuator is saturated, the integral term should not be increasing. That could happen at different values of the integral, so there is not a single min/max.

Re:Tune Your PID Controller by pidtuner on Thursday May 27, 2021 @03:55AM (#27300455)
I suggest to take a look to the canonical PID implementation of the Arduino library. It includes a simple but effective anti-windup mechanism:

http://brettbeauregard.com/blog/2011/04/improving-the-beginn...

Re:Tune Your PID Controller by pidtuner on Wednesday May 26, 2021 @12:45PM (#27292836)
The tuning rules from Skoge provide very decent robustness margins. (https://folk.ntnu.no/skoge/publications/2001/tuningpaper_ren...)