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

modified SetSampleTime() to allow PID::Compute() synch to external timing source #111

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

paynterf
Copy link

I modified SetSampleTime() to set the internal SampleTime variable to zero for an input argument of zero, without modifying ki or kd. This forces Compute() to generate a new output value each time it is called, and allows the PID engine to be synchronized with an external timing source.

This modification does not change the normal behavior in any way, but allows a knowledgeable user to synchronize the PID engine to an external timing source.

…ero for an input argument of zero, without modifying ki or kd. This forces Compute() to generate a new output value each time it is called, and allows the PID engine to be synchronized with an external timing source
@paynterf
Copy link
Author

For some additional details in support of this modification, see my blog post https://www.fpaynter.com/2021/05/turn-rate-pid-tuning-part-ii/

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.

None yet

1 participant