Hi Bruce,
Thinking about this a little more I think there are advantages of the EPID formulation versus the classical one in terms of scale-independence of the KI and KD terms.
There are input units for the error (let's use degrees for example) and output units for the control variable (let's use volts for example).
The dimensions of the KP, KI and KD terms in the classical formulation are:
KP = volts/deg
KI = volts/deg/sec
KD = volts*sec/deg
In the EPID formation the units are:
KP = volts/deg
KI = 1/sec = Hz
KD = sec
So KI and KD are independent of the input and output units, they are in pure units of Hz and time. This means that if, for example, I change the input units from degrees C to degrees F, or the output units from volts to millivolts I don't need to change KI or KD, I only need to change KP.
Mark
________________________________
From: Bruce Hill [[email protected]]
Sent: Wednesday, February 27, 2013 12:36 AM
To: Mark Rivers
Cc: [email protected]
Subject: Question about epid record
Hi Mark,
I'm in the process of replacing a genSub based PID controller with
the epid record that you and Bob developed, and I'm puzzled by a difference
in how the two compute the I and D terms.
In the classical PID algorithm, the value of M(n), the manipulated variable is
M(n) = KP*(E(n) + KI*SUMi(E(i)*dT(i)) + KD*(E(n) -E(n-1))/dT(n)
In fact, the above is from line 33 of devEpidSoft.c, and agrees with
other descriptions I've found of the PID calculation.
However, in the do_pid() function, and in epidRecord.html, the
calculation includes the KP gain in the integral and derivative terms.
M(n) = KP*(E(n) + KP*KI*SUMi(E(i)*dT(i)) + KP*KD*(E(n) -E(n-1))/dT(n)
I can scale my KI and KD gain factors by KP to get the equivalent result,
but I don't see why the effective integral gain should be affected when
the proportional gain is tweaked. Ditto for KD.
Any comments or clarification would be appreciated.
Thanks,
- Bruce
--
Bruce Hill
Member Technical Staff
SLAC National Accelerator Laboratory