Selected Functions
5-6
PID Algorithms (continued)
5.2.3
The
dynamic PID algorithm is a variation of the implementation suggested
for use with the DSP chip applications. As is suggested
by its name, this
algorithm is faster
-reacting and consequently does not require that the
setpoint be forced into the output upon change.
The basic equation for the dynamic PID algorithm is as follows:
k
c
+ gain
t
d
+ rate
t
i
+ reset
t
s
+ scantime
vsf + velocity scaling factor
setpoint + setpoint from table
prevpos + previous position
currpos + current position
input from V memory table
″
″
″
″
″
inputfromańd
″
Calculate integral constant term:
k
i
+
gainscantime
reset
Calculate derivative constant term:
k
d
+
gainrate
scantime
Calculate process variable:
PVnew +
[prev pos - curr pos]
vsf
Calculate new error term:
curr err + setpoint * PVnew
Calculate new bias term:
trialm
x
+ k
i
currerr ) prevoutput
Calculate new output value:
trialm
n
+
k
c
currerr
* k
d
PVnew * PVold ) trialm
x
newoutput + trialm
n
Dynamic PID
Algorithm