[ODE] Servo to reach a target position
Royce3
royce3 at ev1.net
Fri Apr 11 08:18:02 2003
I got a chance to look at my PID algos at work here, and here are
the algos...
These are PID algos were in use by "Think & Do" ( now www.entivity.com )
back in 1999.
Control Error
CE = SP - (PV + Bias)
Gains
Kc = ProportionalGain * OutputSpan / InputSpan
Ki = Kc / Ti
Kd = Kc * Td
Proportional Output
Position: Op = Kc * CEt0
Velocity: dOp = Kc * ( CEt0 - CEt1 )
Integral Output
Position: Oi = Oi1 + ( Ki * CEt0 * dT )
Velocity: dOi = Ki * CEt0 * dT
Derivative Output
Position: Od = Kd ( CEt0 - CEt1 ) / dT
Velocity: dOd = Kd ( ( CEt0-CEt1 ) / dT0 - ( CEt1 - CEt2 ) / dT1 )
Output Variable
Position: OV = Op + Oi + Od
Velocity: OV = OV1 + dOp + dOi + dOd
So, they do use dT in integral and derivative terms. Typing this
in I realized another mistake in my PID code. The speed loop should
not be accumulating the D term like it is.