PID Loop Operation
Maintenance
8–15
PID Loop Operation
Since PID loop calculations are a task within the CPU scan activities, the use of PID
loops will increase the average scan time. The amount of scan time increase is
proportional to the number of loops used and the sample rate of each loop.
The execution time for a single loop
calculation depends on the number of
options selected, such as alarms, error
squared, etc. The chart to the right gives
the range of times you can expect.
PID Calculation Time
150 mS
250 mS
350 mS
Minimum
Typical
Maximum
To calculate scan time increase, we also must know (or estimate) the scan time of
the ladder (without loops). A fast scan time will increase by a smaller percentage
than a slow scan time will, when adding the same PID loop calculation load in each
case. The formula for average scan time calculation is:
Avg. Scan Time with PID loop =
Scan time without loop
Sample rate of loop
X PID calculation time
+ Scan time without loop
For example, suppose the estimated scan time without loop calculations is 50 mS,
and the loop sample time is 3 seconds. Now, calculate the new scan time:
Average Scan time with PID loop =
50 mS
3 sec.
X
250 mS
+ 50 mS = 50.004 mS
As the calculation shows, the addition of only one loop with a slow sample rate has a
very small effect on scan time. Next, expand the equation above to show the effect of
adding any number of loops:
Avg. Scan Time with PID loops =
Scan time without loop
Sample rate of nth loop
X PID calculation time
+
Scan time
without loops
S
n=1
n=L
In the new equation above, you calculate the summation term (inside the brackets)
for each loop from 1 to L (last loop), and add the right-most term “scan time without
loops” only once at the end. Suppose you have a DL05 PLC controlling four loops.
The table below shows the data and summation term values for each loop.
Loop Number Description Sample Rate Summation Term
1 Steam Flow, Inlet valve 0.25 sec
50 mS
2 Water bath temperature 30 sec
0.42 mS
3 Dye level, main tank 10 sec
1.25 mS
4 Steam Pressure, Autoclave 1.5 sec
8.3 mS
Now adding the summation terms, plus the original scan time value, we have:
Avg. Scan Time with PID loops = + 50 mS = 50.06 mS
50 mS + 0.42 mS + 1.25 mS + 8.3 mS
PID Loop Effect
on CPU Scan Time