You are on page 1of 29

Department Of Mechatronics Engineering

Faculty Of Engineering And Information Technology

An-Najah National University

Programmable
Logic Controllers
(10651572)

Dr. Mohammad Abuabiah


m.abuabiah@najah.edu

Office: 11-4-130 1
Chapter 5*

Programming
Timers
* Chapter 7 in the book (Petruzella 2016) 2
Chapter Objectives 3
Dr. Mohammad Abuabiah

• Describe the operation of pneumatic on-delay and off-delay timers.


• Describe PLC timer instruction and differentiate between a non-
retentive and retentive timer.
• Convert fundamental timer relay schematic diagrams to PLC ladder
logic programs.
• Analyze and interpret typical PLC timer ladder logic programs.
An-Najah National University

• Program the control of outputs using the timer instruction control bits.
5.1 Mechanical Timing Relays 4

• There are very few industrial control systems that do not need at least
Dr. Mohammad Abuabiah

one or two timed functions. Mechanical timing relays are used to delay
the opening or closing of contacts for circuit control. The operation of a
mechanical timing relay is similar to that of a control relay, except that
certain of its contacts are designed to operate at a preset time interval,
after the coil is energized or de-energized.
An-Najah National University
5.1 Mechanical Timing Relays 5

• Mechanical timing relays provide time delay through two


Dr. Mohammad Abuabiah

arrangements. The first arrangement, on delay, provides time delay


when the relay coil is energized. The second arrangement, off delay,
provides time delay when the relay coil is de-energized.
An-Najah National University
5.1 Mechanical Timing Relays 6

• Figure below shows an on-delay timer circuit that uses a normally


Dr. Mohammad Abuabiah

open, timed closed (NOTC) contact.


An-Najah National University
5.1 Mechanical Timing Relays 7

• Figure below shows an on-delay timer circuit that uses a normally


Dr. Mohammad Abuabiah

closed, timed open (NCTO) contact.


An-Najah National University
5.1 Mechanical Timing Relays 8

• Figure below shows an off-delay timer circuit that uses a normally


Dr. Mohammad Abuabiah

open, timed open (NOTO) contact.


An-Najah National University
5.1 Mechanical Timing Relays 9

• Figure 7-7 shows an off-delay timer circuit that uses a normally closed,
Dr. Mohammad Abuabiah

timed closed (NCTC) contact.


An-Najah National University
5.2 Timer Instructions 10

• PLC timers are instructions that provide the same


Dr. Mohammad Abuabiah

functions as on-delay and off-delay mechanical


and electronic timing relays. All PLC timers are
output instructions. PLC timers offer several
advantages over their mechanical and
electronic counterparts. These include the fact
that:
– The entire timing function occurs inside the controller.
– Time settings can be easily changed.
An-Najah National University

– The number of timers used in a circuit can be


increased or decreased through the use of
programming changes rather than wiring changes.
– Timer accuracy and repeatability are extremely high
because time delays are generated in the PLC
processor.
5.2 Timer Instructions 11

• PLC timers are instructions that provide the same


Dr. Mohammad Abuabiah

functions as on-delay and off-delay mechanical


and electronic timing relays. All PLC timers are IEC
output instructions. Timers

• There are five different timer types in Siemens PLC:


1) on-delay timer (S_ODT / SD) OR (TON),
2) off-delay timer (S_OFFDT / SF) OR (TOF),
3) retentive timer on (S_ODTS / SS),
An-Najah National University

4) pulse timer (S_PULSE / SP), OR (TP), Main


Timers
5) extended pulse timer (S_PEXT / SE)

• Figure shows the timer selection toolbar for the


SIMATIC S7 PLC.
5.2 Timer Instructions 12

• Each main timer block has bits like S, R, Q and


Dr. Mohammad Abuabiah

words like TV, BI, and BCD.


– S ⇒ Set bit to trigger the timer block
– R ⇒ Reset bit to reset the timer block.
– Q ⇒ Status bit of a Timer block.
– TV ⇒ Preset Time Value of Timer block.
– BI ⇒ Remaining Time Value in an Integer format.
An-Najah National University

– BCD ⇒ Remaining Time Value in BCD format.


5.2 Timer Instructions 13

• TV (Time Value) accept the following time format:


Dr. Mohammad Abuabiah

S5T#XY
– where X is the time number and Y is the time type (Houser: H, Minute: M, Second: S).

• For example, if you want a time to be 4 second, the instruction for TV will be:
❑ S5T#4S

• Another example, if you want a time to be 1 Hour 10 Minute 10 Second, the instruction
for TV will be:
An-Najah National University

❑ S5T#1H10M10S
5.2.1 S_PULSE (Pulse Timer) 14

• This timer starts when there is a positive change from 0 to 1 at the set bit(S). The timer runs
Dr. Mohammad Abuabiah

for the preset time as long as the signal at the set bit is 1.

• When the timer is running and the signal at the set bit(S) changes from 1 to 0, the timer will
be stopped and the status at the output will be 0.

• A timer is reset when there is a change from 0 to 1 at the Reset bit(R) while the timer is
running. The remaining value also sets to 0 in both BI and BCD.

• A positive change at the set bit(S) is always necessary to activate the timer again.
An-Najah National University
5.2.2 S_PEXT (Pulse Extended Timer) 15

• This timer starts running when there is a positive change from 0 to 1 at the set
Dr. Mohammad Abuabiah

bit(S). The timer runs for the preset time even if the signal state at the set bit(S)
changes to 0 before the preset time is elapsed.
• The status of the timer block is 1 as long as the timer is running. A positive
change at the set bit(S) is always necessary to activate the timer again.
• A timer is reset when there is a change from 0 to 1 at the Reset bit(R) while the
timer is running. The remaining value also sets to 0 in both BI and BCD.
An-Najah National University
Example 5.1 Running 3 Motors 16

• Write a ladder program to run three motors using single start/stop push
Dr. Mohammad Abuabiah

button such that:


– Motor one stop after 3 seconds,
– Motor two stop after 5 seconds,
– Motor three stop after 7 seconds.
An-Najah National University
Example 5.1 Running 3 Motors 17

• SOLUTION 1: Using Pule Timer


Dr. Mohammad Abuabiah
An-Najah National University
Example 5.1 Running 3 Motors 18

• SOLUTION 2: Using Extended Pule Timer


Dr. Mohammad Abuabiah
An-Najah National University
HW 5.1 Automatic Industrial Dryer 19

• Write a ladder program for an


Dr. Mohammad Abuabiah

industrial dryer system that


convert wet gas to dry gas such
that:
dry gas Wet gas
1) When the start switched is pressed
→ the gas valve will be open for 5
seconds.
2) After the gas valve closes → the
liquid valve will be open for 3
An-Najah National University

seconds.
3) This process repeats as long as the
stop switch isn’t pressed.
Water
4) The gas and liquid valves do not
open when the other valve is open .
Example 5.2 CW and CCW with Delay 21

• Write a PLC ladder program that if


Dr. Mohammad Abuabiah

you pressed the push button the


motor should run in a clockwise (CW)
direction and if pressed push button
it runs in counter-clockwise (CCW)
direction and so on until the NC stop
push button is pressed.
• When the motor reverse it’s direction
An-Najah National University

it should be stopped for few seconds


(3 sec.) before rotating in the
opposite the direction.
5.2.3 S_ODT (On-Delay Timer) 23

• The ODT timer starts running when there is a positive change from 0 to 1 at the set bit(S). A
Dr. Mohammad Abuabiah

positive change is always necessary to start the timer again.

• The timer runs for the preset time value(TV) as long as the signal at the set bit(S) is 1. The
status bit(Q) is 1 after the timer has completed its preset time without any error until the
signal state of set bit(S) is positive.

• When the signal at the set bit(S) changes from 1 to 0 while the timer is running or stopped,
in this case, the status at the output will be 0.

• A timer is reset when there is a change from 0 to 1 at the Reset bit(R) while the timer is
running. The remaining value also sets to 0 in both BI and BCD.
An-Najah National University
Example 5.3 Two Hands Control 24

• The purpose of this program is about


Dr. Mohammad Abuabiah

safety to prevent fatal accidents.


The two pushbuttons must be
pressed at the same time to
operate the press machine.
• When the operator uses his one
hand to press the button and use his
second hand when plate pushing
An-Najah National University

against the surface, he can injure


himself.
• If the operator tight one push button
(as shown in the figure) the machine
should not start.
HW 5.2 Single Switch Both as Start and Stop Switch
26

• Write a PLC ladder program such that:


Dr. Mohammad Abuabiah

1) When the switch is pressed, the motor


is going to run in the momentary
mode.
2) When the switch is pressed for more
than 3 seconds, the motor is going to
run in the latched mode.
An-Najah National University

3) When the motor is running in the


latched mode, if the switch is pressed
again, the motor is going to run off.
5.2.4 S_ODTS (Retentive On-Delay Timer) 28

• The ODTS timer starts running when there is a positive change from 0 to 1 at the set bit(S).
Dr. Mohammad Abuabiah

The timer runs for the preset time value(TV) even if the signal state at the set bit(S) changes
to 0 before the preset time value(TV) is completed.

• The status bit(Q) is 1 after the timer has completed its preset time without regard to the
signal state at the set bit(S). The timer will be re-triggered with the preset time value(TV)
when there is a change at the set bit(S) while the timer is running.

• A timer is reset when there is a change from 0 to 1 at the Reset bit(R) while the timer is
running. The remaining value also sets to 0 in both BI and BCD.
An-Najah National University
5.2.5 S_OFFDT (Off-Delay Timer) 29

• The OFFDT timer block starts running when there is a negative edge at the set bit(S). A
Dr. Mohammad Abuabiah

signal change at the set bit(S) is always necessary to start the timer again.

• The status bit(Q) is 1 as soon as the signal state at the set bit(S) is positive and while the
timer is running.

• The timer is reset when the signal state at the set bit(S) goes from 1 to 0 while the timer
is running. A timer is reset when there is a change from 0 to 1 at the Reset bit(R) while
the timer is running. The remaining value also sets to 0 in both BI and BCD.
An-Najah National University
HW 5.3 Boxes Handling 30

Diffuse
• Write a PLC ladder program such that: Emitter Sensor Emergency
Dr. Mohammad Abuabiah

1) When the start switch (I0.0) is pressed, and Start BP Stop


both the Pusher Back Limit (I0.1 & I0.2) are Pusher
energized the conveyor belt (Q4.0) is going
to run.
2) When the sensor (I0.3) sees the pipe, the
conveyer belt will stop, and the Pusher
(Q4.1 & Q4.2) will energize.
3) After 2 seconds the light indicator (Q4.3)
will turn on.
An-Najah National University

4) After 3 seconds has elapsed, the light


indicator and Pusher will be deenergized.
5) When both Pusher Back limits are
energized the conveyor belt will run again.
6) When the Emergency stop (I0.4) pressed all
outputs will be deenergized Light
Conveyer Belt
Remover Indicator
31
HW 5.3 Boxes Handling
Dr. Mohammad Abuabiah An-Najah National University
Example 5.4 Instantaneous and timed contacts
33

• Figure shows a hardwired off-delay timer relay circuit with both


Dr. Mohammad Abuabiah

instantaneous and timed contacts. The operation of the circuit can


be summarized as follows:
– When power is first applied (limit switch LS open), motor starter coil M1 is
energized and the green pilot light is on.
– At the same time, motor starter coil M2 is deenergized, and the red pilot light is
off.
– When limit switch LS closes, off-delay timer coil TD energizes.
– As a result, timed contact TD-1 opens to deenergize motor starter coil M1,
timed contact TD-2 closes to energize motor starter coil M2, instantaneous
contact TD-3 opens to switch the green light off, and instantaneous contact
TD-4 closes to switch the red light on. The circuit remains in this state as long as
An-Najah National University

limit switch LS1 is closed.


– When limit switch LS1 is opened, the off-delay timer coil TD de-energizes and
the time-delay period is started. Instantaneous contact TD-3 closes to switch
the green light on, and instantaneous contact TD-4 opens to switch the red
light off.
– After a 5-s time-delay period, timed contact TD-1 closes to energize motor
starter M1, and timed contact TD-2 opens to de-energize motor starter M2.
Example 5.4 Instantaneous and timed contacts
34

• SOLUTION: Ladder Program:


Dr. Mohammad Abuabiah
An-Najah National University

You might also like