-
Notifications
You must be signed in to change notification settings - Fork 616
improve anti-windup #59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
small change, huge effect The controller stability can be improved by limiting the charge level of the accumulator to the value needed to reach "output=limit". While the output is limited, the controller is not able to react. But when the system will be release, the integrator will start to discharge at a lower value. Considering the proportional part for limitation will enable the controller to return quicker into contentious mode. There are several ways to realize anti-windup schemes, but this small improvement is quite easy to implement.
Thanks for the pull request, finally some control theory talks! :D But are you sure that this is a good approach, I am not sure that it will produce the same effect. I mean it will work but i have a feeling that it will not be a good solution in all the cases. In this case the proportional value can easily "restart" the integrator just because of a small spike of an error (depending on the P gain). Maybe we should limit the output only and instead of keeping the previous value of the integrator error use the previous output value? Or maybe we should just writhe the pid as a one differential equation and make discretise it with tustin and limit only the output? What are your takes on this? |
The derivative part will be zero in short term. So avoid discharging integrator by derivative component just reacting on noise
Thank you for your fast response!
I prefer the easy readable code. You can clearly understand what happened step by step. And also it's possible to evaluate the behavior in a spreadsheet (like I did to to check my answer, since I currently have no working dev system / hardware). So lets avoid using a complicated diff-equation, but understand whats happen inside the current code.
In this case the integrator would also sum up the proportional share in the accumulator, so the continuous mode will be affected. But lets stay at this thought: A common approach is back calculation. The accumulator will be dynamically limited to the value, just needed to fulfill "output=limit". This is archived by I did that in a different way in my second commit. You're question started me to think about it, again. :-) But to answer your main question: You're right, but see this form the perspective of control stability. I mean: It's better to operate near to the limit, but not to be clamped on the limit. Good thought: I removed the derivative part for BTW: Usually the derivative part of a controller is rarely used, since it decreases stability and won't improves step response behavior. This is cause there are rarely systems with relevant dead-time to be controlled. |
Since the integrator is a huge filter (accumulator), there is no advantage to filter the input signal of it. To use this type filtering may improves control stability when applied on the proportional part. But this will delay the response time by 1/2 (?) control step (may you don't care in your use case).
Hey @mestrode, Please do not close this PR. I'd like to come back to it very soon. Give me a few days to come back to you about the anti-windup. |
Improving the Beginner’s PID: Reset Windup |
Thanks for the link @IhorNehrutsa , I am really planning to come back to this topic soon, at the moment it is a bit out of scope. My big concerns for anti-windup is for the current control, because we have two axis of the current control d and q and each of them will set the voltage d and q. And sum of these vectors should never exceed the maximum power supply dc voltage magnitude. |
small change, huge effect
The controller stability can be improved by limiting the charge level of the accumulator to the value needed to reach "output=limit".
While the output is limited, the controller is not able to react. But when the system will be release, the integrator will start to discharge at a lower value.
Considering the proportional part for limitation will enable the controller to return quicker into contentious mode.
There are several ways to realize anti-windup schemes, but this small improvement is quite easy to implement.