Arduino-PID-Library icon indicating copy to clipboard operation
Arduino-PID-Library copied to clipboard

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

Open paynterf opened this issue 4 years ago • 1 comments

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.

paynterf avatar May 15 '21 19:05 paynterf

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/

paynterf avatar May 15 '21 19:05 paynterf