MCPcopy Create free account
hub / github.com/br3ttb/Arduino-PID-Library / SetControllerDirection

Method SetControllerDirection

PID_v1.cpp:203–212  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

201 * be decreasing. This is called from the constructor.
202 ******************************************************************************/
203void 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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected