On/Off Control Program Example
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.
SP
Loop
Calculation
+
–
PV
The example program uses two timers to generate On/Off control. It makes the following
assumptions, which you can alter to fit your application:
• The loop table starts at V2000, so the control output is at V2005.
• The data format of the control output is 12-bit, unipolar (0 – FFF).
• 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).
• The On/Off control output is Y0.
The time proportioning program must match the resolution of the PID 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. Also, consider using a solid state switch for a longer switch life instead of a relay.
T0
T0
T0
T1
V2005
Proportioning
continuous
TMRF
T0
K1000
LD
V2005
BTOR
DIVR
R4.095
RTOB
BCD
OUT
V1400
TMRF
T1
V1400
TA1
K0
Y0
OUT
END
DL05 Micro PLC User Manual, 6th Edition, Rev. A
Chapter 8: PID Loop Operation
Time
Y0
on/off
A fast timer (0.01 sec. timebase) establishes the primary
time interval. The constant, K1000, sets the preset at 10
seconds (1,000 ticks). The N.C. enabling contact, T0,
makes the timer self-resetting. T0 is on for one scan
each 10 seconds, when it resets itself and T1.
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).
The BTOR instruction changes the number in the
accumulator to a real number.
Dividing the control output by 4.095, converts the
0 – 4095 range to 0 – 1000, which "matchs" the preset
time for TMRF T0.
This instruction converts the real number back to
binary. This step prepares the number for conversion
to BCD. There is no real-to-BCD instruction.
Convert the number in the accumulator to BCD format.
This satisfies the timer preset format requirement.
Output the result to V1400. In our example, this is the
location of the timer preset for the second timer.
The second fast timer also counts in increments of .01
seconds, so its range is variable from 0 to a maximum
of 1000 ticks, or 10 seconds. This timer's output, T1,
turns off the output coil, Y0, when the preset is reached.
The N.C. T1 contact, inverts the T1 timer output. The
control output is on at the beginning of the 10-second time
interval. Y0 turns off when T1 times out. The STRNE
contact prevents Y0 from energizing during the one scan
when T0 resets T1. Y0 is the actual control output.
END coil marks the end of the main program.
1
2
P
Process
3
V
4
5
6
7
8
9
10
11
12
13
14
A
B
C
D
8–67
Need help?
Do you have a question about the DL05 and is the answer not in the manual?