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

setWindUpLimits Problem with Negative min #5

Open
RLR-NDH opened this issue Nov 15, 2022 · 1 comment
Open

setWindUpLimits Problem with Negative min #5

RLR-NDH opened this issue Nov 15, 2022 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@RLR-NDH
Copy link

RLR-NDH commented Nov 15, 2022

I am using setOutputLimits(-128, 127), setBias(0.0) and setWindUpLimits(-100.0, 100.0). My integral tern was being limited to 0.0 and 100.0 until I changed your code to:

double iMax = constrain(outputMax - outTemp, 0, outputMax); // Maximum allowed integral term before saturating output
double iMin = constrain(outputMin + outTemp, outputMin, 0); // Minimum allowed integral term before saturating output

which appears to function properly for my case. I also added a debug print of the error term which I find useful.

@PowerBroker2 PowerBroker2 self-assigned this Nov 15, 2022
@PowerBroker2 PowerBroker2 added the bug Something isn't working label Nov 15, 2022
@PowerBroker2
Copy link
Owner

Thanks! Could you open a PR for an easy fix?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants