SetSampleTime(...) ********************************************************* * sets the period, in Milliseconds, at which the calculation is performed ******************************************************************************/
| 132 | * sets the period, in Milliseconds, at which the calculation is performed |
| 133 | ******************************************************************************/ |
| 134 | void PID::SetSampleTime(int NewSampleTime) |
| 135 | { |
| 136 | if (NewSampleTime > 0) |
| 137 | { |
| 138 | double ratio = (double)NewSampleTime |
| 139 | / (double)SampleTime; |
| 140 | ki *= ratio; |
| 141 | kd /= ratio; |
| 142 | SampleTime = (unsigned long)NewSampleTime; |
| 143 | } |
| 144 | } |
| 145 | |
| 146 | /* SetOutputLimits(...)**************************************************** |
| 147 | * This function will be used far more often than SetInputLimits. while |
nothing calls this directly
no outgoing calls
no test coverage detected