SetControllerDirection(...)************************************************* * The PID will either be connected to a DIRECT acting process (+Output leads * to +Input) or a REVERSE acting process(+Output leads to -Input.) we need to * know which one, because otherwise we may increase the output when we should * be decreasing. This is called from the constructor. *****************************
| 201 | * be decreasing. This is called from the constructor. |
| 202 | ******************************************************************************/ |
| 203 | void PID::SetControllerDirection(int Direction) |
| 204 | { |
| 205 | if(inAuto && Direction !=controllerDirection) |
| 206 | { |
| 207 | kp = (0 - kp); |
| 208 | ki = (0 - ki); |
| 209 | kd = (0 - kd); |
| 210 | } |
| 211 | controllerDirection = Direction; |
| 212 | } |
| 213 | |
| 214 | /* Status Funcions************************************************************* |
| 215 | * Just because you set the Kp=-1 doesn't mean it actually happened. these |
nothing calls this directly
no outgoing calls
no test coverage detected