08 Programmable Logic Controllers
08 Programmable Logic Controllers
Relay Logic
− Conventional method of implementing Sequential Control using array of relays
and switches
− Special kind of relays/switches e.g. timer relay (for delays), Limit switches, Level
switch (to detect level), thermal switch (to detect temperature)
Relays /Switches
Relay Logic: OR
Using two switches, a logical “OR” operation can be constructed. An example is
given below:
Switch 1 “OR” Switch 2 = Coil
1/21
8) Programmable Logic Controllers
Motor OFF
Relay OFF
Motor ON
Relay ON
2/21
8) Programmable Logic Controllers
Relay Contact a1
(Normally Open)
+VCC
PLC System
Software solution to Relay Logic.
1. CPU: Central Processing Unit, generally consists of
i) Microprocessor: mathematical and logical operation
ii) Memory: stores data and program. Generally basic PLC programming in
ROM and user program and data in EEPROM (Electrically Erasable
Programmable Read–Only Memory)
iii) Power Supply: DC supply to CPU and modules
2. Programmer/Monitor: device to program and monitor PLC. PC also used.
3. I/O Modules: Interface with process to be controlled. E.g. Digital I/O, Analog I/O,
Encoder interface, PWM output etc.
4. Special Modules: for special purpose. E.g. PID controller module, Interrupt handling
module
5. Racks and Chassis: to enclose CPU and different modules. The CPU and modules
are attached by a bus system within the racks.
Programmer/
Monitor
CPU
Microprocessor
Input Memory Output
Module Module
Power
Supply
3/21
8) Programmable Logic Controllers
Ladder Diagram
− Graphical Programming Language for PLC
− Based on Relay Logic
1
NOT Y=A
&
AND Y= A × B
OR Y= A + B
≥1
Y = A× B = A + B
&
NAND
4/21
8) Programmable Logic Controllers
NOR Y = A + B = A× B
≥1
=1
XOR Y = A× B + A× B
S R Yn Yn+1
0 0 0 0
0 0 1 1
0 1 0 0
0 1 1 0
1 0 0 1
1 0 1 1
1 1 0 X Y=
n +1 R ( S + Yn )
1 1 1 X
Yn SR 00 01 11 10
0 0 0 X 1
1 1 0 X 1 Reset
Y=0
S = 0; R=1 S = 1; R = 0
Set
Y=1
5/21
8) Programmable Logic Controllers
Input Connection
Start Push Button
Program
Connection
Motor
M
Output
6/21
8) Programmable Logic Controllers
LD X1
OR Y1
AND X2
AND X3
OUT Y1
OUT Y2
LDI X2
OUT Y3
ANB Operates on last element in the stack and accumulator and stores result in
ORB accumulator
7/21
8) Programmable Logic Controllers
LD X1
OR X2
LD X3
OR X4
ANB
OUT Y1
LDI X2
AND X4
LD X3
AND X5
ORB
OUT Y2
OUTPUT SCAN
INPUT SCAN
PROGRAM SCAN
INPUT OUTPUT
PROGRAM SCAN
SCAN SCAN
8/21
8) Programmable Logic Controllers
P1 (Pump) Lup
LDown
Timers:
1. Timer Status Bits
• Timer status bit will be on when current value is equal or greater than the preset
value i.e. 3 sec.
• When input X0 turn on, timer T1 will start and when timer reaches the preset
value of 3 sec. (K of 30) timer status contact T1 turns on.
• When T1 is ON o/p Y0 turns on.
9/21
8) Programmable Logic Controllers
Counters:
1. Counter Status Bits
• counter status bit will be on when current value is equal or greater than the preset
value i.e. 10 counts.
• Each time X0 transitions from off to on, the counter increments by one. If X1 is
on counter is reset to 0.
• when counter reaches the preset value of 10 sec. (K of 10) counter status contact
CT3 turns on and o/p Y12 turns on.
10/21
8) Programmable Logic Controllers
11/21
8) Programmable Logic Controllers
• Actuators:
• Apple Convey: Moves the conveyer belt of apples
• Box Convey: Moves the conveyer belt of boxes
Apple Convey
Apple Sense
Box Convey
Box Sense
Closes Opens
Closes Opens
12/21
8) Programmable Logic Controllers
Step Action
13/21
8) Programmable Logic Controllers
Step I
Transitions
Flowlines
Step II
Step I
Step I
14/21
8) Programmable Logic Controllers
Tank filling
do/Pump On
Idle
do/Pump Off
Initial
Step
Tank Filling
1 Action
Pump On
Transition LUp
Idle
2
Pump Off
LDown
Step
Grafcet Diagram Explained
15/21
8) Programmable Logic Controllers
System OFF
Stop Start
1 System OFF
Start
Position New Box
2
Box Convey
Box Sense
Stop & NOT (Stop)
Fill Apple
3
Apple Convey;
Apple Count
Stop
Apple Counter ≥ 10
& NOT (Stop)
16/21
8) Programmable Logic Controllers
17/21
8) Programmable Logic Controllers
Buffer Tank
Level Sensor
bottle_present (BP) bottle_filled (BF)
Motor (M)
Conveyer belt
Conveyer belt is moved by Motor (M), Bottle is filled from a buffer tank by opening
the valve (V). Bottle filled is detected by the level sensor, bottle_filled (BF). Correct
positioning of the bottle is detected by limit switch, bottle_present (BP).
Assume both Normally Open and Normally Closed contacts of the sensors BF and BP
are available.
Assuming the contacts BF and BP closes when bottle is filled and bottle is positioned
respectively i.e. the contacts BF and BP opens when bottle is not filled and bottle is
not positioned respectively.
do/Move Conveyer M ON
Fill Bottle
do/Open Valve V ON
18/21
8) Programmable Logic Controllers
BF
Grafcet diagram for Automation of Product Packaging
19/21
8) Programmable Logic Controllers
• When START button is pushed, the platform should be in the DOWN Position.
• When STOP button is pushed, the platform is halted at whatever position it occupies
at that time.
• When UP or DOWN push buttons are pushed the platform should move accordingly.
Note the platform should move when push button is pushed and halt when the button
is released.
20/21
8) Programmable Logic Controllers
21/21