0% found this document useful (0 votes)
60 views15 pages

PLC Programming for Industrial Automation

This is another slide for industrial automation subject.

Uploaded by

Sheeraz
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
60 views15 pages

PLC Programming for Industrial Automation

This is another slide for industrial automation subject.

Uploaded by

Sheeraz
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

9/15/2023

INDUSTRIAL
AUTOMATION
PLC

1
1

EXAMPLE:
Consider the application shown in Figure. An electric motor is being used to drive a Conveyor that
moves and dumps a product into a bin. An optical proximity switch (O1) is used to detect the product
and a Panel light will be switched ON. A PLC located inside the control panel controls the process.
Develop the work cycle program and corresponding PLC ladder logic program to control this process.

SEQUENCE / STEPS
The process steps can be summarized as:
• Press the START button to turn ON the conveyor motor and control panel light.
• The conveyor runs until proximity sensor detect part, after which the conveyor and panel light
are turned ON.
• The STOP button can be pressed at any time to turn OFF the conveyor.
• The PLC inputs and corresponding addresses are as follows:
• START button – S1
• STOP button – S2
• optical proximity switch – O1.
• The PLC outputs and corresponding addresses are:
• conveyor motor – M
• control panel light – L

1
9/15/2023

EXAMPLE‐2:
Consider the typical washing machine process, the figure is a cutaway view of a typical washing machine with process
steps labeled. The fill solenoid is shown outside the machine. The program of instructions or process steps for such a
process is:
• Fill washtub with water
• Agitate clothes to wash
• Drain tub of dirty soapy water
• Refill tub to rinse residual dirt and soap from clothes
• Agitate clothes to rinse thoroughly
• Drain tub again
• Spin tub to remove excess water.

Solution:
Step # 1: Understand the process from the controller’s perspective.
Step # 2: Break‐up the process steps down into a work cycle program.
Step # 3: Make Timing diagram if necessary.
Step # 4: Make ladder diagram to control the system

EXAMPLE‐2:
Solution:
Step # 1: Understand the process from the controller’s perspective.
Step # 2: Break‐up the process steps down into a work cycle program.

2
9/15/2023

EXAMPLE‐2:
Solution:
Step # 3: Make Timing diagram if necessary.

Step # 4:
Make ladder diagram.

TIMERS
The most commonly used PLC
instruction,
After coils and contacts, is the
timer.

3
9/15/2023

Mechanical Timing
Relays
• Mechanical Timing Relays also
known as external timers, as they
are not used in controller body.
• There are very few industrial control
systems that do not need at least 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 Typical types of mechanical and electronic timing relays are shown in
contacts are designed to operate at a this Figure
preset time interval, after the coil is
energized or de‐energized.

TIMER TYPES

• There are 2 types of Timers.


• 1‐ On delay timer:

• 2‐ Off delay timer:

Typical types of mechanical and electronic timing relays are shown in


this Figure

4
9/15/2023

On/Off Delay Timer


• Mechanical Timing Relays also known as
external timers, as they are not used in
controller body.
• There are very few industrial control systems
that do not need at least 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.

PLC Timer Instructions


• PLC timers are instructions that provide the
same 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.
• The entire timing function occurs
inside the controller.
• Time settings can be easily changed.
• 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.

10

5
9/15/2023

PLC Timer Instructions


• There are three different PLC timer types:
• 1‐ on‐delay timer (TON),
• 2‐ off‐delay timer (TOF), and
• 3‐ retentive timer on (RTO).
• The most common is the on‐delay timer, which
is the basic function of PLC.

• TON (Timer On Delay): Counts time‐


based intervals when the instruction
is TRUE / ON.
• TOF (Timer Off Delay): Counts time‐
based intervals when the instruction
transitions from a true to false
condition.
• Timer accuracy and repeatability are
extremely high because time delays
are generated in the PLC processor.

11

PLC Block type Timer


• Many PLCs use block‐type timers .
• Each timer is composed of three 16‐bit words,
collectively called a timer element.
• There can be up to 256 timer elements. Operand Type Format Description
Addresses for timer file 4, timer element Timer TIMER tag timer structure
number 0 (T4:0), are listed below.
Preset DINT immediate how long to delay (accumulate
• T4 = timer file 4 time)
• :0 = timer element number 0 (0–255 Accumulated DINT immediate total msec the timer has
timer elements per file) counted
• T4:0/DN is the address for the done initial value is typically 0
bit of the timer.
• T4:0/TT is the address for the timer‐ Base ‐‐ immediate It is the unit of time Preset and
timing bit of the timer. Accumulated.
• T4:0/EN is the address for the enable 1.0 = 1 second
bit of the timer. 0.1 = 1 Deci‐second
0.01 = 1 Centi‐second
0.001 = 1 Milli‐second

12

6
9/15/2023

PLC Block type Timer


Mnemonic Data Type Values Description
.EN BOOL TRUE/1/ON. The enable bit indicates that the TON instruction is enabled.
It means it is receiving signal TRUE/1/ON.
FALSE/0/OFF
If signal is FALSE/0/OFF then timer will be shutoff and reset.
.TT BOOL TRUE/1/ON. The timing bit indicates that a timing operation is in process.
It will generate the signal (TRUE/1/ON) during timer is running.
FALSE/0/OFF
.DN BOOL TRUE/1/ON. The done bit is set when .ACC ≥ .PRE.
It will generate the signal (TRUE/1/ON) after completing timer.
FALSE/0/OFF
.PRE DINT 0 through Time set.
32,767. The preset value specifies the value (1 msec units) which the
accumulated value must reach before the instruction sets the .DN bit.
.ACC DINT 0 through After enabling timer it will count the time.
32,767 The accumulated value specifies the number of milliseconds that have
elapsed since the TON instruction was enabled.

13

PLC Block type Timer

14

7
9/15/2023

PLC Block type Timer

Table showing how each bit is effected during the


program operation.

15

PLC Block type Timer

16

8
9/15/2023

PLC Block type Timer

A practical application that uses the on-delay, off-delay, and


retentive on-delay instructions in the same program.

• To start the machine, the operator turns SW on.


• Before the motor shaft starts to turn, the bearings are
supplied with oil by the pump for 10 seconds.
• The bearings also receive oil when the machine is running.
• When the operator turns SW off to stop the machine, the oil
pump continues to supply oil for 15 s.
• A retentive timer is used to track the total running time of
the pump. When the total running time is 3 hours, the motor
is shut down and a pilot light is turned on to indicate that the
filter and oil need to be changed.
• A reset button is provided to reset the process after the filter
and oil have been changed.

17

Counter
A counter is a function which
stores the number of times a
particular event or process has
occurred.
It counts the number of ON/OFF
signals input from an input
device, such as a switch or
sensor.

18

9
9/15/2023

Mechanical
Counter
Programmed counters can serve the
same function as mechanical counters.
Every time the actuating lever is
moved over, the counter adds one
number; the actuating lever then
returns automatically to its original
position.
Resetting to zero is done with a
pushbutton located on the side of the
unit.

Typical types of mechanical and electronic Counters are shown in


these Figure

19

Electronic Counter
Electronic counters can count up,
count down, or be combined to count
up and down.
The majority of counters used in
industry are up‐counters, numerous
applications require the
implementation of down‐counters or
of combination up/down‐counters.

Typical types of mechanical and electronic Counters are shown in


these Figure

20

10
9/15/2023

Program Counter
All PLC manufacturers offer some form
of counter instruction as part of their
instruction set.
One common counter application is
keeping track of the number of items
moving past a given point as illustrated
in Figure.
Counters are similar to timers except
that they do not operate on an internal
clock but are dependent on external or
program sources for counting.
PLC counters can be designed to count
up to a preset value or to count down
to a preset value.

21

COUNTER TYPES
There are 2 types of Timers.
1‐ Up‐ Counter:
The up‐counter is incremented
by 1 each time the rung
containing the counter goes from
false to true.
Up‐counters are always reset to
zero.
2‐ Down Counter:
The down‐counter decrements by 1
each time the rung containing the
counter is energized.
Down‐counters may be reset to
zero or to some preset value.

22

11
9/15/2023

PLC Block type


Counter
Each timer is composed of three 16‐bit words,
collectively called a timer element. There can be up to
256 Counter elements. Addresses for Counter file 5,
Counter element number 3 (C4:3), are listed below.
• C5 = counter file 4
• :3 = timer element number 0 (0–255
timer elements per file) Operand Type Format Description
• C5:3/DN is the address for the done Counter COUN tag timer structure
bit of the timer. TER
• C5:3/CU is the address for the count‐
Preset DINT immediate how long to Count.
up bit of the counter.
• C5:3/CD is the address for the count‐ Accumulated DINT immediate total numbers to count.
down bit of the counter. initial value is typically 0
• C5:3/OV is the address for the over
flow bit of the counter.
• C5:3/UN is the address for the under
flow bit of the counter.
• C5:3/UA is the address for the update
accumulator bit of the counter.
23

PLC Block type Counter


Mnemonic Data Type Values Description
.CU BOOL TRUE/1/ON. The count‐up enable bit is used with the count‐up counter and is true
whenever the count‐up counter instruction is true. If the count‐up
FALSE/0/OFF
counter instruction is false, the CU bit is false.
.CD BOOL TRUE/1/ON. The count‐down enable bit is used with the count‐down counter and is
true whenever the count‐down counter instruction is true. If the count‐
FALSE/0/OFF
down counter instruction is false, the CD bit is false.
.DN BOOL TRUE/1/ON. The done bit is set when .ACC ≥ .PRE.
The done bit is true whenever the accumulated value is equal to or
FALSE/0/OFF
greater than the preset value of the counter, for either the count‐up or
the count‐down counter.
.OV BOOL TRUE/1/ON. The overflow bit is true whenever the counter counts past its maximum
value, which is 32,767. On the next count, the counter will wrap around
FALSE/0/OFF
to –32,768 and will continue counting from there toward 0 on successive
false‐to‐true transitions of the count‐up counter.

24

12
9/15/2023

PLC Block type Counter


Mnemonic Data Type Values Description
.UN BOOL TRUE/1/ON. The underflow bit will go true when the counter counts below –32,768. The
counter will wrap around to +32,767 and continue counting down toward 0
FALSE/0/OFF
on successive false‐to‐true rung transitions of the count‐down counter.
.UA BOOL TRUE/1/ON. The update accumulator bit.
FALSE/0/OFF
.PRE DINT –32,768 The preset value (PRE) word specifies the value that the counter must count
through to before it changes the state of the done bit. The preset value is the set
32,767. point of the counter and ranges from –32,768 to +32,767. The number is
stored in binary form, with any negative numbers being stored in 2’s
complement binary.
.ACC DINT –32,768 The accumulated value (ACC) word is the current count based on the
through number of times the rung goes from false to true.
32,767. The accumulated value either increments or decrements.
The accumulated value will continue to count past the preset value instead
of stopping at the preset like a timer does..

25

PLC Block
type Counter

26

13
9/15/2023

By using a counter to count, correct length for cutting can be


determined.

27

By using a counter to count, we could


tell how far the shaft had rotated.

determine the correct length for


cutting.

28

14
9/15/2023

29

BOOKS

1- Introduction to Industrial Automation


By Stamatios and George,

2- Cad / Cam Principles And Applications,


By P. N. Rao,

3- Programmable controllers_ an engineer's guide-


By Newnes E. A. Parr,

4- Automation, Production Systems, and Computer-


Integrated Manufacturing, By Mikell P. Groover,

5- Programmable Logic Controllers


By Frank Petruzella,

30
30

15

You might also like