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.
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.