Vous êtes sur la page 1sur 15

Manufacturing Automation using PLCs

CHAPTER 2 Programmable Logic Controller (PLC) and Relay Ladder Logic (RLL)

Chapter 2: Programmable Logic Controller (PLC) and Relay Ladder Logic (RLL).
2.1 PLC Operation using scanning technique.
2.2 Understanding Relay Ladder Diagram (RLL).
2.3 Basic Instructions of RLL.
2.4 Motor control using PLC, to push !uttons and motor starter.
2.5 "dding to indicators for the de#eloped RLL.
2.6 PLC $rogramming.
% 2 .
Manufacturing Automation using PLCs
CHAPTER 2 Programmable Logic Controller (PLC) and Relay Ladder Logic (RLL)

Programmable Logic Controller (PLC)
nd Relay Ladder Logic(RLL)

PLC stands for programma!le logic controller. PLCs are electronic control de#ices that are
used in #ariety of industries, ranging from manufacturing plants to processing plants. " PLC
is a de#ice that as in#ented to replace the necessary sequential relay circuits for machine
control and to replace analog controller. &he PLC or's !y loo'ing at its inputs (!oth logic
and continues types( and depending upon their state, turning on)off its outputs. *+amples,
PLCs used in automoti#e assem!ly plants, automoti#e parts manufacturing plants, mineral
processing plants, semi-conductor manufacturing plants, steel mills ..etc. &he user enters a
program, usually #ia softare, that gi#es the desired results.
&he PLC has three components/
%( 0entral $rocessing Unit 0$U,
1( Inputs,
2( Outputs.
3e could consider the PLC to !e a !o+ of hundreds of separate relays, counters, timers and
data storage locations. Do these counters, timers, etc. really e+ist4 5o, they 6physically6
don7t e+ist !ut rather they are simulated and can !e considered softare counters, timers, etc.
&he internal relays are simulated through !it locations in registers, as shon in 8ig. 1.%.
&he functions of these modules are gi#en as follos,
I5$U& R*L"9:-(contacts(, &hese are connected to the outside orld. &hey
physically e+ist and recei#e signals from sitches, sensors, etc. &ypically they are not
relays !ut rather they are transistors. &hese inputs are called discrete or logic inputs.
I5&*R5"L U&ILI&9 R*L"9:-(contacts(, &hese relays do not recei#e signals from
the outside orld nor do they physically e+ist. &hey are simulated relays and are hat
ena!les a PLC to eliminate e+ternal relays. &here are also some special relays that are
dedicated to performing only one tas'. :ome are alays on hile some are alays off.
:ome are on only once during poer-on and are typically used for initiali;ing data that
as stored.
1 2 .
golanA
tupn
golanA
tupu!
gni"ro#te$
eludom
medoM
a !o er"tc"rt# lanretn$ 1.2 .gi% CLP .
Manufacturing Automation using PLCs
CHAPTER 2 Programmable Logic Controller (PLC) and Relay Ladder Logic (RLL)

0OU5&*R:, &hese again do not physically e+ist. &hey are simulated counters and
they can !e programmed to count pulses. &ypically these counters can count up, don or
!oth up and don. :ince they are simulated they are limited in their counting speed.
:ome manufacturers also include high-speed counters that are hardare !ased. 3e can
thin' of these as physically e+isting. Most of the time these counters can count up, don
or up)don.
&IM*R:, &hese also do not physically e+ist. &hey come in many #arieties and
increments. &he most common type is an on-delay type. Others include off-delay and
!oth retenti#e and non-retenti#e types. Increments #ary from %ms through %s.
OU&$U& R*L"9:-(coils(, &hese are connected to the outside orld. &hey physically
e+ist and send on)off signals to solenoids, lights, etc. &hey can !e transistors, relays, or
triacs depending upon the model chosen.
D"&" :&OR"<*, &ypically there are registers assigned to simply store the data.
&hey are usually used as temporary storage for math or data manipulation. &hey can also
typically !e used to store data hen poer is remo#ed from the PLC. Upon poer-on
they ill still ha#e the same contents as !efore hen poer has !een remo#ed.
"5"LO< MOD*L:, &his co#ers analog inputs and outputs. &he analog models
co#er reading analog signals from sensor, pro#ides analog signal such as thermocouples,
strain gauges, thermistor, pressure sensor..etc. &he analog output signals can !e used to
command e+ternal controller e.g. ser#omotors amplifier, solenoid amplifier .etc.
U:*R I5&*R8"0* I5$U&, 3hich contains e+tra push-!ottoms that can !e
configured !y the user to set)reset logic output de#ices e.g. relays outputs, or can !e used
as a storage of messages that can !e displayed on liquid crystal display. 8urthermore,
some of these interfaces has led hich can !e configured !y the user.
NETWORKING MODULES: Larger PLCs could ha#e serial port that can !e used for
netor'ing a multiple of PLCs that are to !e programmed from one main computer or
sending)recei#ing data !eteen PLC netor'. 8urthermore, some of the PLCs are
equipped ith remote control module (modem( to program the PLC from long distance
computer.

&he CPU of the PLC contains a microprocessor, hich means that a PLC is !asically a
speciali;ed computer that has !een designed to control the operation of machines and
processes ithin the harsh en#ironment of the plant.
&he language used to program the PLC to perform the logic required to connect the filed
input to its outputs is called Relay Ladder Logic (RLL). &he RLL language is programmed !y
means of special softare using personal computer (connected to the PLC using serial port(
or hand-held programmer hich has led or liquid-crystal display and 'ey!oard as illustrated
in 8ig. 1.1.
2 2 .
0$U = Memory
Input
Module
(logic or
continuous(
>1?@ D0
User
interface
:erial port
Output
module
(logic or
continuous
modules(
$oer :upply
M
:
5
%ig. 2.2 PLC #tr"ct"re& "#er comm"nication and inter!ace# mod"le#
interconnections.
Aand-held programmer or $0 communication
Manufacturing Automation using PLCs
CHAPTER 2 Programmable Logic Controller (PLC) and Relay Ladder Logic (RLL)

R"M and *$ROM memory are used to store the program instructions in the PLC. &he
computer or hand-held programmer can !e used to load and sa#e the RLL programs into the
PLC.
&he physical input and output modules can !e discrete or analog I)O modules and can !e
selected and specified hen purchasing the PLC, and depend on the num!er of the required
I)O lines.
&he discrete I)O modules connects field inputs de#ices of the O5)O88 nature li'e limit
sitches, push !utton sitches, solenoids, solenoid #al#e or electro-mechanical relay ..etc.
*ach discrete I)O module supply #oltage source. :ince these #oltages can !e of different
magnitude or types, I)O modules are a#aila!le at #arious "0 = D0 #oltages ratings as
shon in &a!le 1.%. 8urthermore, the inputs and outputs are connected to L*DBs to indicate
the operation of the I)O module
'able 2.1: common rating# !or di#crete $() inter!ace mod"le#.
Interface input module Interface output modules
1? @ "0)D0 %1-?C @ "0
?C @ "0)D0 %1D @ "0
12D @ "0)D0 12D @ D0
E @ (&&L( E @ D0 (&&L(
2.1 PLC )peration "#ing #canning techni*"e
" PLC or's !y continually scanning a program. 3e can thin' of this scan cycle as
consisting of 2 important steps, as shon in 8ig. 1.2. &here are typically more than three
steps !ut e can focus on the important parts and ignore the others. &ypically the others are
chec'ing the system and updating the current internal counter and timer #alues.
? 2 .
%ig. 2.3 +canning techni*"e in PLC.
Manufacturing Automation using PLCs
CHAPTER 2 Programmable Logic Controller (PLC) and Relay Ladder Logic (RLL)

+tep 1: C,-C. $/P0' +''0+,
8irst the PLC ta'es a loo' at each input to determine if it is on or off. In other ords, is the
sensor connected to the first input on4 Ao a!out the second input4 Ao a!out the third. It
records this data into its memory to !e used during the ne+t step.
+tep 2, -1-C0'- PR)2R3,
5e+t the PLC e+ecutes your program one instruction at a time. May!e your program said
that if the first input as on then it should turn on the first output. :ince it already 'nos
hich inputs are on)off from the pre#ious step it, ill !e a!le to decide hether the first
output should !e turned on !ased on the state of the first input. It ill store the e+ecution
results for use later during the ne+t step.
+tep 3: 0P4'- )0'P0' +''0+,
8inally the PLC updates the status of the outputs. It updates the outputs !ased on hich
inputs ere on during the first step and the results of e+ecuting your program during the
second step. Based on the e+ample in step 1, it ould no turn on the first output !ecause
the first input as on and your program said to turn on the first output hen this condition is
true.
"fter the third step the PLC goes !ac' to step one and repeats the steps continuously. One
scan time is defined as te time it ta!es t" e#ec$te te % ste&s 'isted a(")e.
&he total response time of the PLC is a fact that e ha#e to consider hen shopping for a
PLC. &he PLC ta'es a certain amount of time to react to changes. In many applications
speed is not a concern, in others though. &he PLC can only see an input turn on)off hen it7s
loo'ing. In other ords, it only loo's at its inputs during the chec' input status part of the
scan.
In 8ig. 1.? the input % is not seen until scan 1. &his is !ecause hen input % turned on, scan %
had already finished loo'ing at the inputs. Input 1 is not seen until scan 2. &his is also
!ecause hen the input turned on scan 1 had already finished loo'ing at the inputs.
Input 2 is ne#er seen. &his is !ecause hen scan 2 as loo'ing at the inputs, signal 2 as not
E 2 .
%ig. 2.4 5ariation o! #canning time on detecting the high6#peed inp"t#.
Manufacturing Automation using PLCs
CHAPTER 2 Programmable Logic Controller (PLC) and Relay Ladder Logic (RLL)

on yet. It turns off !efore scan ? loo's at the inputs. &herefore signal 2 is ne#er seen !y the
PLC. &his illustrates the importance of scanning time of the PLC.
2.2 0nder#tanding Relay Ladder 4iagram ( RLL)
&o understand the programming of PLC relay ladder diagram, let us start ith simple case of
relay control system. 3e can thin' of a relay as an electromagnetic sitch. "pply a #oltage
to the coil results in a magnetic field is generated. &his magnetic field suc's the contacts of
the relay in, causing them to ma'e a connection. &hese contacts can !e considered to !e a
sitch. &hey allo current to flo !eteen 1 points there!y closing the circuit.
Let7s consider the folloing e+ample. Aere e simply turn on a !ell hene#er a sitch is
closed, as shon in 8ig. 1.E. 3e ha#e 2 real-orld parts/ " sitch, a relay and a !ell.
3hene#er the sitch closes e apply a current to the !ell causing it to sound. &he !ottom
circuit indicates the D0 control circuit. &he top circuit indicates the "0 control circuit. Aere
e are using a D0 relay to control an "0 circuit. &hatBs the !enefit of using relay. 3hen the
sitch is open no current can flo through the coil of the relay. "s soon as the sitch is
closed, hoe#er, current runs through the coil cause a magnetic field to !uild up. &his
magnetic field causes the contacts of the relay to close. 5o "0 current flos through the
!ell and e hear it. 8ig. 1.F shos a typical industrial relay.

F 2 .
%ig. 2.5 +imple control circ"it o! a bell
Po7er circ"it
Control circ"it

%ig. 2.6 typical ind"#trial relay.
Manufacturing Automation using PLCs
CHAPTER 2 Programmable Logic Controller (PLC) and Relay Ladder Logic (RLL)

5e+t, e ould li'e to replace the relay control system ith PLC control system using relay
ladder logic. "fter seeing a fe of these it ill !ecome o!#ious hy its called a ladder
diagram. 3e ha#e to create one of these !ecause, unfortunately, a PLC doesn7t understand a
schematic diagram. It only recogni;es code. 8ortunately most PLCs ha#e softare, hich
con#ert ladder diagrams into code. &his shields us from actually learning the PLC*s code.
&he PLC doesn7t understand terms li'e sitch, relay, !ell, etc. It prefers input, output, coil,
contact, etc. It doesn7t care hat the actual input or output de#ice actually is. It only cares
that its an input or an output.
8irst e replace the !attery ith a sym!ol. &his sym!ol is common to all ladder diagrams.
3e dra hat are called !us !ars. &hese simply loo' li'e to #ertical !ars. One on each
side of the diagram. &hin' of the left one as !eing > #oltage and the right one as !eing
ground. 8urther thin' of the current (logic( flo as !eing from left to right. 5e+t e gi#e the
inputs a sym!ol. In this !asic e+ample e ha#e one real orld input. (i.e. the sitch( 3e

gi#e the input that the sitch ill !e connected to, the sym!ol shon !elo. 8ig. 1.G shos
the sym!ol for contact of sitch or relay.
5e+t e gi#e the outputs a sym!ol. In this e+ample e use one output (i.e. the !ell(. 3e gi#e
the output that the !ell ill !e physically connected to the sym!ol shon !elo. 8ig. 1.C
shos the sym!ol used as the output coil or relay.

&he "0 supply is an e+ternal supply so e don7t put it in our ladder. &he PLC only cares
a!out hich output it turns on and not hat7s physically connected to it.
:econd, e must tell the PLC here e#erything is located. In other ords e ha#e to gi#e all
the de#ices an address. 3here is the sitch going to !e physically connected to the PLC 4
Ao a!out the !ell4 3e start ith a !lan' road map in the PLCs ton and gi#e each item an
address. 0ould you find your friends if you didn7t 'no their address4 9ou 'no they li#e in
the same ton !ut hich house4 &he PLC ton has a lot of houses (inputs and outputs( !ut
e ha#e to figure out ho li#es here (hat de#ice is connected here(. 3e7ll get further
into the addressing scheme later. &he PLC manufacturers each do it a different ayH 8or no
let7s say that our input ill !e called 6DDDD6. &he output ill !e called 6EDD6, as shon in
8ig. 1.I.
8inally, e ha#e to con#ert the schematic into a logical sequence of e#ents. &his is much
easier than it sounds. &he program e7re going to rite tells the PLC hat to do hen
certain e#ents ta'e place. In our e+ample e ha#e to tell the PLC hat to do hen the
G 2 .
%ig. 2.8 Contact relay #ymbol.
%ig. 2.9 )"tp"t relay #ymbol.
Manufacturing Automation using PLCs
CHAPTER 2 Programmable Logic Controller (PLC) and Relay Ladder Logic (RLL)

operator turns on the sitch. O!#iously e ant the !ell to sound !ut the PLC doesn7t 'no
that.
&he 8ig. 1.I shos the final con#erted diagram (RLL) for !ell control system. 5otice that e
eliminated the real orld relay from needing a sym!ol.
2.3 :a#ic $n#tr"ction# o! RLL
E#am&'e +:
Dra ladder logic for the control circuit shon in 8ig. 1.%%,
C 2 .
%ig. 2.; RLL !or bell control circ"it.
Main input instructions
5ormally open contact ,
5ormally closed contact ,
Main output instructions
5ormally open relay
5ormally closed relay
%ig. 2.1< 3ain in#tr"ction# in RLL.
%ig.2.11 Control and RLL !or /4 :oolean operation.
Manufacturing Automation using PLCs
CHAPTER 2 Programmable Logic Controller (PLC) and Relay Ladder Logic (RLL)

&he Boolean logic equation for this control circuit, C"i' , SW+ . SW-
E#am&'e -:
Redra the relay ladder logic of *+ample %, using normally closed sitch for SW- 4
&he amended RLL is shon in 8ig. 1.%1,
2.4 3otor control "#ing PLC & t7o p"#h b"tton# and motor #tarter
I 2 .
%ig. 2.12 mended RLL "#ing /ormally clo#ed #7itch !or #7itch +=2.
&he Boolean logic equation ill !e , C"i' , SW+ . SW-
1 2
3
4
<o to
step %
%ig. 2.14 4e>eloped RLL !or motor control.
Aere to push !uttons sitches
(:tart):top( are used to sitch
the motor on)off. &hese
sitches are connected to the
to PLC inputs discrete type(,
as shon in 8ig. 1.%2.
One of the output ports
(discrete outputs( of the PLC
used to sitch motor starter
on)off, hich ill start)stop the
electric motor.
&he control steps of the electric
motor using RLL is shon in
8ig. 1.%?.
%ig. 2.13 3otor control "#ing
PLC, motor #tarter and t7o
p"#h bottom#.
3otor
#tarter
'7o b"#h bottom
#7itche#
3otor
$np"t
)"tp"t
PLC
Manufacturing Automation using PLCs
CHAPTER 2 Programmable Logic Controller (PLC) and Relay Ladder Logic (RLL)

2.5 dding t7o indicator# !or the de>eloped RLL
Aere to indicators to !e added to the de#eloped circuits. Red color to indicates that the
motor is off, and green color to indicates that the motor is running. &he amended RLL is
shon in 8ig. 1.%E.
&he modified RLL is gi#en as follos,
%D 2
.
%ig. 2.15 (a)RLL 7hen +tart p"#h b"tton "ndre##ed& (b)RLL 7hen +tart p"#h b"tton
pre##ed
%ig. 2.15 mended RLL !or motor control a!ter adding t7o indicator#.
$np"t
3otor #tarter
'7o indicator#
)"tp"t
'7o p"#h bottom #7itche#
PLC
Input
Motor
Manufacturing Automation using PLCs
CHAPTER 2 Programmable Logic Controller (PLC) and Relay Ladder Logic (RLL)

2.6 PLC Programming
&he programming technique through serial port #ia $0 and using special softare pro#ided
!y the manufacturer, as shon in 8ig. 1.%F or using hand programmer.
In case of $0 program, a special softare program must !e installed in the $0 hich is
pro#ided !y the manufacturer to rite and edit user Relay Ladder Logic (RLL(. &his also
transfers the program !eteen PLC and PC computer and #ise #ersa. &he program
de#eloped to !e friendlier ith user during RLL de#elopment, as shon in 8ig. 1.%G.
Because the PLC uses Relay Ladder Logic diagrams, the con#ention from any e+isting relay
ladder to programmed relay ladder logic is simple. *ach rung is a com!ination of input
conditions (sym!ols( connected from left to right, ith the sym!ol that represents the output
at the far right. &he sym!ols that represent the inputs are connected in series, parallel, or
some com!ination to o!tain the desired logic. &he folloing e+amples sho ho PLC can
!e used to carry out different control logics, as shon in 8ig. 1.%C. 5ote, any com!ination
logic called Boolean equation.
E#am&'e %:
De#elop a relay-ladder logic that allos four sitches in a room to control a single light4
&he RLL is shon in 8ig. 1.%I.
%% 2
.
%ig. 2.18 -?ample o! RLL de>eloped "#ing TPDS #o!t7are !or 'o#hiba PLC.
%ig. 2.16 PLC Programming techni*"e "#ing PC comp"ter thro"gh #erial port.
Light
:3%
:31
:32
:3?
L$2,'@+=1A+=2A+=3A+=4
%ig. 2.1; 4e>eloped RLL !or e?ample 3.
Manufacturing Automation using PLCs
CHAPTER 2 Programmable Logic Controller (PLC) and Relay Ladder Logic (RLL)

%1 2
.
Lamp
:3%
:31
:32
:3?
:3E
B Relay Ladder Logic C

L3P@ (+=1.+=3) A(+=2.+=4)A+=5
91D
:3%
:31
:32
:3? 91D
Lamp

D2<@(+=1A +=2) . +=3
L3P@ +=4 . D2<
)r
L3P@(+=1A +=2) . +=3 . +=4
:3%
:31
B Relay Ladder 4iagramC
L3P @+=1 and +=2
L3P@ +=1 . +=2
B Relay Ladder Logic C
Lamp
:3% :31
L"M$
:3%
:31
L"M$
Lamp
:3%
:31
B Relay Ladder 4iagramC
L3P @+=1 )R +=2
L3P@ +=1 A +=2
B Relay Ladder Logic C
Lamp
:3%
:31
:32
B Relay Ladder Logic C
L3P @(+=1 )R +=2) /4 +=3
L3P@ (+=1 A +=2) . +=3
Boolean or Logic 8unction
%ig. 2.19 4e>elopment o! RLL !or di!!erent control logic#.
Manufacturing Automation using PLCs
CHAPTER 2 Programmable Logic Controller (PLC) and Relay Ladder Logic (RLL)

E#am&'e .:
Modify the de#eloped relay-ladder logic gi#en in e#am&'e % such that these sitches are
ena!led)disa!led using e+ternal super#isor through sitch (:3E( 4
%2 2
.
91D
:3%
:31
:32
:3? 91D
Lamp

D2<@(+=1A +=2) . +=3
L3P@ +=4 . D2<
)r
L3P@(+=1A +=2) . +=3 . +=4
91D
:3%
:31
:32
:3? 91D
Lamp

D2<@(+=1.+=3)A(+=1.+=4)
A(+=2.+=3)A(+=2.+=4)
L3P@ +=4 . D2<
)r
L3P@ ((+=1.+=3)A(+=1.+=4)
A(+=2.+=3)A(+=2.+=4)) . +=4
:3?
:3? 91D
Lamp

D2<@+=1. +=3AD2<.+=3
L3P@ +=4 . D2<

5ote, %
st
Boolean equation is memory or
filp-flop.
91D
:3%
91D
:32
%ig. 2.19 De#elopment of RLL for different control logics
Light
:3%
:31
:32
:3?
L$2,'@(+=1A+=2A+=3A+=4) . +=5
:3E
%ig. 2.2< 3odi!ied RLL by adding e?ternal #7itch +=5& re!er e?ample 4.
Manufacturing Automation using PLCs
CHAPTER 2 Programmable Logic Controller (PLC) and Relay Ladder Logic (RLL)

PR):L-3+
1.%( De#elop the RLL diagrams for the folloing Boolean equations ,
/+ , 0 . 1 2 0 . 1
/- , s3+ . s3- . s3% . s3.
/% , ( s3+ . s3- . s3%) 2 s3.
4 , (0.1.C 2 D ) . (E./)
1.1( Dri#e the Boolean equations for the folloing relay ladder logics
(a(
(!(
1.2( De#elop a relay ladder logic that ill sitch on the motor on)off in automatic and
manual (called Jog( modes4
(ans, :3%, :&"R& push !ottom, :32 :&O$ push !ottom, :31 KO< or Manual
operating mode, and 91D memory that ill run the relay that ill sitch the motor on(
%? 2
.
:3? 91D
Lamp
91D
:3%
91D
:32 :3?
91D
:3%
:31
:32 :3?
:3E :3F :3%
91D
:3%
:31
:32
91D
motor
91D
91D
Manufacturing Automation using PLCs
CHAPTER 2 Programmable Logic Controller (PLC) and Relay Ladder Logic (RLL)

1.?( <i#e e+amples of here a PLC could !e used4
1.E( 3hy ould relays !e used in place of PLC4
(ans, for some cases is simple and cost effecti#e(
1.F( List the ad#antages of a PLC o#er relay control4
%E 2
.

Vous aimerez peut-être aussi