PID Loop Operation
Maintenance
and Troubleshooting
8–50
PID Loop Operation
The following ladder segment provides a time proportioned on/off control output. It
converts the continuous output in V2005 to on/off control using the output coil, Y0.
PV
Loop
Calculation
S
+
–
V2005SP
Time
Proportioning
Process
Y0
P
V
continuous
on/off
The example program uses two timers to generate On/Off control. It makes the
following assumptions, which you can alter to fit your application:
S The loop table starts at V2000, so the control output is at V2005.
S The data format of the control output is 12-bit, unipolar (0 – FFF).
S The time base (one full cycle) for the On/Off waveform is 10 seconds.
We use a fast timer (0.01 sec/tick), counting to 1000 ticks (10 seconds).
S The On/Off control output is Y0.
The time proportioning program must match the resolution of the output (1 part in
1000) to the resolution of the time base of T0 (also 1 part in 1000).
NOTE: Some processes change too fast for time proportioning control. Consider the
speed of your process when you choose this control method. Use continuous control
for processes that change too fast for time proportioning control.
T0
LD
V2005
At the end of the 10 second period, T0 turns on, and
loads the control output value (binary) from the loop table
V+05 location, V2005.
Convert the number in the accumulator to BCD
format, to satisfy the MUL, DIV, and TMRF format
requirement.
OUT
V1400
Output our result to V1400. This is our arbitrary location
for the second timer’s preset value.
DirectSOFT32
END
END coil marks the end of the main program.
T1
OUT
Y0
Using the N.C. T1 contact, invert the T1 timer output, so
the On/Off control output is on at the beginning of the
10-second timebase. Y0 turns off when T1 turns on. The
STRNE contact prevents Y0 from energizing during the
scan when T1 is resetting. Y0 goes to the actuator, heater,
etc. for the loop.
DIV
K4095
Divide the product of the previous step by 4095. This
completes the conversion of the output range from
0 – 4095 to 0 – 1000, which matches the number of
ticks in our 10 second timer range.
T0
TMRF
V1400
The second fast timer also counts in increments of
.01 seconds, so its range is also 0 – 1000. This timer’s
output, T1, turns the output coil, Y0, off when the preset
is reached.
T1
T0
TMRF
K1000
Use a fast timer (0.01 sec. resolution) for the main time
base. The K1000 provides a preset of 10 seconds. The
N.C. T0 contact makes this self-resetting. T0 is on for
one scan each 10 seconds.
T0
TA1
K0
MUL
K1000
BCD
Multiply the Control Output (BCD) by 1,000. This step
combined with the following DIV function converts the
range to 0 – 1000.
On/Off Control
Program Example