Skip to content
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

add separate windup limits #16

Closed
wants to merge 1 commit into from
Closed

Conversation

aseelye
Copy link

@aseelye aseelye commented Mar 15, 2020

One's carried integral value doesn't necessarily need to limit at the output value, but rather could be higher or lower. Separating these from one another can allow for quicker convergence to the set point.

@m-lundberg m-lundberg linked an issue Mar 15, 2020 that may be closed by this pull request
Copy link
Owner

@m-lundberg m-lundberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I considered adding this feature at one point but in the end I decided to follow Brett Beauregards example of only having one set of limits, mostly because it makes the API simpler. I might consider adding separate limits if it has an actual use though.

I'm not entirely convinced it adds that much though to be honest. You probably wouldn't want to set wider limits for the integral than the output anyway, since that would lead back to the original problem of the integral growing larger than what the PID can actually handle and when the setpoint is finally reached, there will be a windup lag due to the large integral term. Could you give some example of when separate limits might be useful? Which situation did you run into where you needed it?

@aseelye
Copy link
Author

aseelye commented Mar 16, 2020

Answered most of this in the other PR. I'll have to play with the math to see the differences. I know the separation led to a lot easier understanding on my side, and tuning was much easier as well.

@aseelye
Copy link
Author

aseelye commented Mar 17, 2020

Agreed on the other PR being closed. Doing some modeling in my head yesterday, I still think separate windup limits are important, but if you don't like the complexity, I'm perfectly fine with my fork.

@m-lundberg
Copy link
Owner

Hello,

Sorry for the slow response, I've been quite busy. I will hold off on merging this PR for now since I need to think through a bit more how I want to do this.

@m-lundberg
Copy link
Owner

Sorry for the delay. I have thought about this a bit and decided not to include separate windup limits at this time since I feel it would make the API too complex. I've also seen that Simulink for example uses the output limits to clamp the integral, not to mention the Arduino PID library that this library was inspired by. I hope you are fine with this decision.

@m-lundberg m-lundberg closed this Sep 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Preferred contribution method? Augmentation and error found
2 participants