Omron CP1E-NA@@D@-@ Computer Hardware User Manual


 
2-263
2 Instructions
CP1E CPU Unit Instructions Reference Manual(W483)
Data Control Instructions
2
PIDAT
Sampling Period and Cycle Time
The sampling period can be designated in units of 10 ms (0.01 to 99.99 s), but the actual PID action is
determined by a combination of the sampling period and the time of PID instruction execution (with
each cycle). The relationship between the sampling period and the cycle time is as follows:
If the sampling period is less than the cycle time, PID control is executed with each cycle and not with
each sampling period.
If the sampling period is greater than or equal to the cycle time, PID control is not executed with each
cycle, but PID(190) is executed when the cumulative value of the cycle time (the time between PID
instructions) is greater than or equal to the sampling period. The surplus portion of the cumulative
value (i.e., the cycle time’s cumulative value minus the sampling period) is carried forward to the next
cumulative value.
For example, suppose that the sampling period is 100 ms and that the cycle time is consistently 60
ms. For the first cycle after the initial execution, PID(190) will not be executed because 60 ms is less
than 100 ms. For the second cycle, 60 ms + 60 ms is greater than 100 ms, so PID(190) will be
executed. The surplus of 20 ms (i.e., 120 ms – 100 ms = 20 ms) will be carried forward.
For the third cycle, the surplus 20 ms is added to 60 ms. Because the sum of 80 ms is less than 100
ms, PID(190) will not be executed. For the fourth cycle, the 80 ms is added to 60 ms. Because the
sum of 140 ms is greater than 100 ms, PID(190) will be executed and the surplus of 40 ms (i.e.,
120 ms – 100 ms = 20 ms) will be carried forward. This procedure is repeated for subsequent cycles.
1 cycle 1 cycle 1 cycle 1 cycle 1 cycle
Processing
Initial processing (60 ms) (60 ms + 60 ms = 120 ms)
(20 ms + 60 ms = 80 ms)
(80 ms + 60 ms = 140 ms)
(PID processing
with initial values)
Reading of
measurement
time
Less than 100 ms, so
PID is not executed.
Greater than 100 ms,
so PID is executed
and 20 ms is carried
forward.
Less than 100 ms, so
PID is not executed.
Not executed. Executed Not executed. Executed
Greater than 100 ms,
so PID is executed and
40 ms is carried forward.
60ms
PID
60ms
PID
60ms
PID
60ms
PID
PID