Open camlost2 opened 6 years ago
Yes, that is known, but this was the easiest approach that still worked. The integral can add up to a certain threshold when the controls are not saturated. The idea in the future is to analyze the rate at which the error changes proportionally to how far it is from the target point, and apply the integral factor proportionally, so that it's active only as the error remains high and is not shrinking. If you have any suggestions for such implementation, please feel free to file a PR, I promise I won't take too long to check it out :)
My implementation using a FIFO queue, N being the length of queue
https://github.com/KSP-RO/AJE/blob/master/Source/PIDController.cs
Simply clamping the integral part is not enough to cure integral windup
suppose the variable rises up to the setpoint but still lower than it, the integral would stay negatively saturated. It only cancels when the variable stays higher than the setpoint for a while.
A FIFO queue is needed to store the integral values of each update