Arduino PID Library

how would one best invoke a reverse action control function, as required in industrial controllers for working with fail open and fail close control valves?

change the sign of the P_Param. (I know you know what this means Lefty, but for the benefit of others reading...)

if your P_Param is 3.2 say, and the controller seems to be going in the wrong direction,( i.e. opening when it should be closing,) you would want to change that to a -3.2.

usually it is really obvious that this needs to be changed. the output starts to go the wrong way, which makes your input get farther from setpoint, which makes your output go FARTHER in the wrong direction. the cycle continues until your output is pegged at one of the limits.

I was teaching a class on pid and asked "what happens if you set this wrong?" expecting the answer above. the answer I got was much better: "you get a nickname"

Brett