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

PID controller logic #1

Open
camlost2 opened this issue Apr 4, 2018 · 2 comments
Open

PID controller logic #1

camlost2 opened this issue Apr 4, 2018 · 2 comments

Comments

@camlost2
Copy link

camlost2 commented Apr 4, 2018

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

@tetryds
Copy link
Contributor

tetryds commented Jun 1, 2018

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 :)

@camlost2
Copy link
Author

camlost2 commented Jun 8, 2018

My implementation using a FIFO queue, N being the length of queue

https://github.com/KSP-RO/AJE/blob/master/Source/PIDController.cs

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

No branches or pull requests

2 participants