0% found this document useful (0 votes)
39 views59 pages

Industrial Programmable Logic Cont Rollers (PLCS)

- Programmable logic controllers (PLCs) are specialized computers used to automate industrial processes and control machinery. - Modern PLCs have become more sophisticated and can handle complex control tasks beyond their original on/off logic applications. - Ladder logic is the most common programming language for PLCs, inspired by relay-based logic circuits. It represents logic using rungs of connections resembling a ladder.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
39 views59 pages

Industrial Programmable Logic Cont Rollers (PLCS)

- Programmable logic controllers (PLCs) are specialized computers used to automate industrial processes and control machinery. - Modern PLCs have become more sophisticated and can handle complex control tasks beyond their original on/off logic applications. - Ladder logic is the most common programming language for PLCs, inspired by relay-based logic circuits. It represents logic using rungs of connections resembling a ladder.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 59

Industrial Programmable Logic Cont

rollers (PLCs)

1
Programmable Logic Controllers (PLC’
s)

 A programmable logic controller (PLC) is a speci


al purpose computer aimed at implementing cont
rol solutions.
 Historically PLC’s have been used mainly for on-
off or logic type applications.
 However, modern PLC’s have become increasin
gly sophisticated and can now cover quite compl
ex control tasks.
Eng. R. L. Nkumbwa @ CBU 201
2 0
Programmable Logic Controllers

 These notes emphasize the switching capability


of a PLC. However, the reader is urged to think o
f the dynamics of the underlying system.
 For example, we recently heard of a seemingly st
raightforward application of a PLC to a reservoir l
evel control problem.
 The algorithm had many features but in essence
conformed to the rule that if the level was too low
then the pumping rate should Eng.
beR.increased.
L. Nkumbwa @ CBU 201
3 0
Programmable Logic Controllers

 This can be seen as an approximate form of integral cont


rol.
 However, pure integral control when applied to a tank (w
hich is also an integrator) will lead to self sustained oscill
ations.
 The reader is encouraged to verify this by drawing a root
locus plot for the closed loop poles.
 The moral of this story is that when implementing a contr
oller in a PLC one needs to consider the combined dyna
mics of the control law and system.
 In this way a PLC is no different from any other form of co
Eng. R. L. Nkumbwa @ CBU 201
4 ntrol implementation platform. 0
Industrial Robustness of PLC’s

 If you have ever had a personal computer lock-u


p or reset in the middle of something important y
ou will appreciate that a similar failure in a large i
ndustrial application would have severe consequ
ences.
 A PLC is simply an industrial computer designed
to be durable enough to withstand the rigors of in
dustrial applications.
Eng. R. L. Nkumbwa @ CBU 201
5 0
Industrial Robustness of PLC’s

 It is common in the mining industry to have PLC’


s on large mobile equipment to monitor and contr
ol everything from lights to large electrical drives.
 The vibration and operating temperature of this e
nvironment require the use of specialized control
equipment such as PLC’s.

Eng. R. L. Nkumbwa @ CBU 201


6 0
Some Physical Tolerances of leading
PLC brands

Eng. R. L. Nkumbwa @ CBU 201


7 0
Typical Areas of Application

 For past 30 years PLC’s have been in the first lev


el of control because of their ability to run uninter
rupted for extended periods of time (usually mea
sured in months or even years).
 The PLC layer in industrial applications is shown
in figure below

Eng. R. L. Nkumbwa @ CBU 201


8 0
Control hierarchy of PLC’s

Eng. R. L. Nkumbwa @ CBU 201


9 0
Ladder Logic

 The remained of this chapter will look at Ladder


Logic, which is the most common programming
structure used in PLC’s.
 Several examples of common Ladder Logic pro
grams will be demonstrated to show the simple
structure of this coding style.

Eng. R. L. Nkumbwa @ CBU 201


10 0
Relay Ladder Logic

 Ladder logic is possibly the simplest programmin


g language.
 The principle behind the language is illustrated b
y a simple electrical relay. (Electrical relay logic p
receded PLC’s as initially all logic was implement
ed in hard wired panels using actual relays, timer
, Counters etc.)

Eng. R. L. Nkumbwa @ CBU 201


11 0
Simple Relay Circuit

Eng. R. L. Nkumbwa @ CBU 201


12 0
Circuit representation in Ladder Logic

 The above circuit is represented in Ladder lo


gic as shown in figure below (only the low vol
tage circuit is used in ladder logic diagrams):

Eng. R. L. Nkumbwa @ CBU 201


13 0
Boolean Logic

 The above diagram can be expressed in Boolean


logic “Motor Coil = Switch”, ie if the Switch is on t
he Motor coil is energized and Motor is activated.
 All ladder logic takes the form of that shown in Fi
gure above.
 Thus it connects the positive and neutral rail repr
esenting positive and negative power supply to t
he relay.
Eng. R. L. Nkumbwa @ CBU 201
14 0
Ladder Logic Instructions

 The three most common instructions in ladde


r logic are:

Eng. R. L. Nkumbwa @ CBU 201


15 0
PLC Switching

 The majority of simple PLC switching tasks can b


e implemented using these simple instructions.
 However there exists a set of 60 to 100 individual
instructions such as those above which form the
complete PLC language.
 Other functions vary from simple timers and coun
ters to more sophisticated control functions such
as PID controllers and advanced arithmetic functi
ons. Eng. R. L. Nkumbwa @ CBU 201
16 0
Multi Input/Output Rungs

Eng. R. L. Nkumbwa @ CBU 201


17 0
Multi Input/Output Rungs

 Each of the inputs in series such as ‘S2’ and ‘S3’


are equivalent to the Boolean “AND”{.} statement
while a “Bridge” in a rung is seen as an “OR”{+} s
tatement.
 In the case shown in Figure above the Boolean e
xpression for the Coil is:

Eng. R. L. Nkumbwa @ CBU 201


18 0
Multi Output Rungs

 It is also possible to have multi output rungs prov


ided the OTE instructions are never placed is ser
ies, they must always be in parallel and in contac
t with the Neutral (right) rail, as shown in figure b
elow. (While multi output rungs are necessary in
some cases, it is often beneficial to divide the run
g into several smaller rungs for the purpose of pr
ogram clarity)
Eng. R. L. Nkumbwa @ CBU 201
19 0
Multi Output Rungs

Eng. R. L. Nkumbwa @ CBU 201


20 0
Start-Stop Rung

 Any large rung can always be broken down into simple B


oolean expressions such as for the simple rungs shown a
bove.
 Just as common electrical relays have auxiliary outputs,
which are used for feedback and indication, a similar strat
egy is used in ladder logic.
 To demonstrate this point a simple START/STOP rung is
examined.
 Two Push Buttons (PB) are used for the ‘start’ and ‘stop’ i
nputs (Push buttons return a High or Low signal to the PL
C only for the duration during which the button is held do
21 wn), Consider the logic shown in Figure
Eng. R. L.below.
Nkumbwa @ CBU 201
0
Use of Auxiliary Output

Eng. R. L. Nkumbwa @ CBU 201


22 0
Push Button Example

 In this case the push buttons are “normally open” i.e. they
return a low signal in their normal position and a high sig
nal when pressed.
 Initially assume the Coil output is off, and the Push Butto
ns (PB) not activated so they are also off.
 When the ‘Start PB’ is pressed the top path through the r
ung is satisfied with start = 1and stop = 0 so the coil is tur
ned ON.
 Note this also satisfies the bottom path through the rung
on the next scan since coil = 1 and stop = 0.
 When the start button is released the top path through th
e rung becomes false but the rung is still satisfied by the
bottom path, ie the coil remains onEng.
after
R. L.the start
Nkumbwa PB201
@ CBU is rel
23 eased. 0
Push Button Example

 Pressing the ‘stop’ button (stop =1) breaks the ru


ng so the coil is turned OFF and remains off after
the stop button is released.

Eng. R. L. Nkumbwa @ CBU 201


24 0
Other PLC Programming languages

 While Ladder logic is the most common form of P


LC language it is worth noting that other languag
es do exist which where developed in conjunctio
n with Relay Ladder Logic.

Eng. R. L. Nkumbwa @ CBU 201


25 0
Other Languages

 Blocks are built from small ladder logic subroutines and used throug
h the code as user defined ladder logic instructions, the advantages
of this approach is the reduction of repetitive ladder logic code.
 Sequential Function Chart (SFC) programming is similar to progra
mming by computer flow chart. In SFC the program advances step b
y step through various blocks (where action happens such as a moto
r is started).
 Transition conditions determine when the program advances from on
e block to another.
 Both the action blocks and the transition conditions are created using
ladder diagrams.
 Structured text, uses simple instructions common to medium level p
rogramming languages: If , While, Then etc.
Eng. R. L. Nkumbwa @ CBU 201
26 0
Other Languages

 Note: Some programming packages allow the us


er to switch between Relay Ladder Logic and Str
uctured text representations of the code.

Eng. R. L. Nkumbwa @ CBU 201


27 0
PLC Modules

 The modular nature of PLC components makes the desig


n, instillation and maintenance of the first level of control
much simpler.
 Similar to the peripheral devices, which can be obtained f
or a personal computer, there are literally thousands of in
terface modules supported by PLC’s.
 While these modules may be numerous they all have the
same function, obtaining or delivering control signals and
information between the measurement level and the oper
ator interface level.
 The modular nature is possibly the greatest strength of P
LC’s and several common modules will be described belo
w. Eng. R. L. Nkumbwa @ CBU 201
28 0
Digital Inputs/Outputs (I/O)

 By far the most common industrial signals used in PLC’s


are simple digital control signals.
 Referred to as Digital I/O (Digital input/output), they can b
e measured in there thousands for substantial industrial p
lants.
 They are used to measure an amazing verity of events.
 The most common digital signal encountered is a simple
switch, A switch is nothing more than an electrical switch
used to indicate some physical position.
Eng. R. L. Nkumbwa @ CBU 201
29 0
Digital Inputs/Outputs (I/O)

 Digital I/O signals come in many forms from 12 V


olt DC to 240 Volt AC, but the most common indu
strial signals are 24Volt DC and 120V AC.
 There are Digital I/O modules to measure all of t
hese signals, an extra variation is the number of
signals per module ranging from 8, 16 and 32 etc
.
 Most digital modules have electrical protection us
ually in the form of optocoupling to prevent dama
ge to the PLC from standard electrical faults.
Eng. R. L. Nkumbwa @ CBU 201
30 0
Analogue Inputs/Outputs (I/O)

 Analogue signals enter and leave the PLC in volt


age and current form, The resolution of most ana
logue signals is between 11 and 16 bits.
 While voltage is commonly used in practice it can
be sensitive to noise (induced voltages in electric
al equipment rooms can be substantial) This mak
es current control the superior choice.
 The most common analogue signals appear in th
e form of a 4-20mA current signal,
Eng. R. L. i.e.
Nkumbwa @ CBU 201
31 0
Analogue Inputs/Outputs (I/O)

– A signal of 4.0mA equates to zero,


– A signal of 20mA equates to 2048 for an 11 bit input,
 The reason for the 4.0mA starting point is a fail-s
afe feature, if the instrument fails or the signal ca
ble is damaged the current falls to zero and the P
LC can alarm the operating system of the failure i
mmediately.
 This fail-safe feature is not possible for voltage si
gnals which pass through zeroEng.volts.
R. L. Nkumbwa @ CBU 201
32 0
Other interface modules

 Digital I/O and Analogue I/O signals comprise the


vast majority of PLC signals.
 However, not all devices can be controlled by the
se simple signals and it is often required that PL
C’s communicate to foreign instruments using m
any different communications protocols,
 Again in most instances there is simply a module
predesigned to make this interface possible.
 Some examples include RS232, RS485, DH485,
DH+, Modbus, Ethernet etc. Eng. R. L. Nkumbwa @ CBU 201
33 0
Memory
(Addressing , Internal Registers)

 The memory in PLC’s needs to be predefined by


the programmer, similar to defining variables in s
tandard programming.
 The memory is divided into data files, each data f
ile has a unique number and a character prefix w
hich refers to the type of data.
 For example, in the Allen Bradley PLC-5 syste
m, we have;
Eng. R. L. Nkumbwa @ CBU 201
34 0
Allen Bradley PLC-5 System

Eng. R. L. Nkumbwa @ CBU 201


35 0
Allen Bradley PLC-5 System

 The ASCII character (or characters) denotes the data are


a type. Other types of defined words include T-timers, C-
counters and S-status registers etc.
 Note that the Output and Input numbers are dropped fro
m file 0 and 1 respectively, this is because these files are
not programmable.
 Status file 2 (S2:##) is also fixed within Allen Bradley PL
C’s. (Status bits include such information as arithmetic ov
erflow warnings, communication status and processor tim
e and dates etc)
Eng. R. L. Nkumbwa @ CBU 201
36 0
Allen Bradley PLC-5 System

 The internal data areas of Integers and Floating


point addresses simply point to a linear memory r
egion.
 However the Input and Output address actually c
orrespond to a physical address. For example I:1
2/03 has the format, I:{Rack address}{slot numbe
r}/{Input number}.
 Physically this is the 3rd input on the 2nd slot in t
he 1st Rack.
 This input is show below in figure,
Eng. R. L. Nkumbwa @ CBU 201
37 0
Physical I/O Addressing

Eng. R. L. Nkumbwa @ CBU 201


38 0
Physical I/O Addressing

 Note: PLC’s usually start counting from zero and


use the octal counting system. ie an eight slot rac
k will have slots numbered from 0 to 7.
 This is the case for racks, slots and input number
s.
 So the first possible input would be Rack 0, slot 1
input 0 (Slot 0 in Rack 0 is not available for input
s since it is always reserved for the Central Proc
essing Unit, CPU) Eng. R. L. Nkumbwa @ CBU 201
39 0
Addressing Format

 The addressing format has been demonstrated h


ere because in writing a PLC program the addres
s is used by the PLC in the ladder logic.
 For example, if in the Start /Stop logic of figure (6
) the Start PB = I:13/04 and Stop PB = I:13/05 an
d the output Coil = O:12/03 then the ladder logic
would look more like figure below

Eng. R. L. Nkumbwa @ CBU 201


40 0
Start/Stop Addressing Example

Eng. R. L. Nkumbwa @ CBU 201


41 0
PLC Programming Architecture

 A PLC program can be divided into many small subroutin


es. In this respect PLC’s replace function and procedures
with subroutines.
 Each subroutine is executed from top to bottom in a pred
etermined order.
 Once all the subroutines have been scanned it simply be
gins again with the first subroutine.
 The nature of subroutines makes a modular programmin
g structure possible, It is always beneficial to group segm
ents of code which serve similar purposes.
Eng. R. L. Nkumbwa @ CBU 201
42 0
PLC Programming Architecture

 For example a program may be divided in the foll


owing way:
– Subroutine U:20 – Pumps sequencing logic file.
– Subroutine U:21 – Pump No.1 alarming and drive file.
– Subroutine U:22 – Pump No.2 alarming and drive file.
– Subroutine U;23 – Pump No.3 alarming and drive file.

Eng. R. L. Nkumbwa @ CBU 201


43 0
PLC Programming Architecture

 Here subroutine 20 controls the sequencing of 2


1,22 and 23 while the drive files are virtually iden
tical for each pump by starting and stopping the
pump while reporting alarms and the healthy stat
us to file 20.
 Fault finding problems in the code is greatly simp
lified when all the code for a faulty device is liste
d in a single subroutine.
Eng. R. L. Nkumbwa @ CBU 201
44 0
PLC Programming Architecture

 The development of a plant wide PLC standard is an ess


ential step in automating a large control system.
 The benefits are twofold, if the programming standard is
well understood many code developers can work on the c
ode producing a uniform control system.
 The second advantage is that for anyone not involved in t
he code production only needs to learn one standard to h
ave a good understanding of the program structure of all t
he plants PLC’s.

Eng. R. L. Nkumbwa @ CBU 201


45 0
Commercially Available PLC’s

 The next slides give details of some commercial


available PLC’s.
 The purpose of this is to show the variety of PLC’
s available on the market.

Eng. R. L. Nkumbwa @ CBU 201


46 0
Allen-Bradley PLC’s

 Below are AB Plcs


 Note that AB is part of the Rockwell Automa
tion, a global leading Automation giant.

Eng. R. L. Nkumbwa @ CBU 201


47 0
Eng. R. L. Nkumbwa @ CBU 201
48 0
Siemens Simatic PLC’s

 Below are Siemens Simantic PLCs

Eng. R. L. Nkumbwa @ CBU 201


49 0
Eng. R. L. Nkumbwa @ CBU 201
50 0
Modicon TSX PLC’s

 See Modicon TSX PLC below

Eng. R. L. Nkumbwa @ CBU 201


51 0
Eng. R. L. Nkumbwa @ CBU 201
52 0
Other PLC Terminology

 On-line: Refers to the program code currently in the PLC memory.


 Off-line: Refers to the copy of the program code stored on the progr
amming computer.
 Up-Load: Refers to the act of copying the current On-line code from t
he PLC to the programming computer . (Note the previous code on t
he programming computer is lost during this transfer if a copy is not
made)
 Down-Load: Refers to the act of copying the code from the program
ming computer into the PLC’s memory. (note the previous PLC code
is lost during this transfer).
 Note: It is important to realize that changing the On-line program will
not change the Off-line program on the programming computer. Invar
iably at the end of any edit there must follow an Up-load or Down-Lo
ad to make the Online and Off-line programs the
Eng. R. same. @ CBU 201
L. Nkumbwa
53 0
Other PLC Terminology

 Run Mode: The PLC actively scanning the code and


driving outputs.
 Program Mode: The PLC is not being scanned (All
outputs disabled)
 Remote Mode: programming computer can change
the PLC between Run and Program.
 Note: There is a physical key on the front of each PL
C processor module, which allows the PLC to be swi
tched between Run, Remote and Program Mode.
Eng. R. L. Nkumbwa @ CBU 201
54 0
Programming Procedure

 PLC’s are very versatile in the respect that progr


amming changes can be made on-line while the
processor is in Run Mode.
 This is equivalent to making changes in a compil
ed ‘C’ program while it is being executed.
 To introduce programming edits into the existing
code while in Run Mode the following procedure i
s followed.
Eng. R. L. Nkumbwa @ CBU 201
55 0
Programming Procedure

 Insert edit rungs into the On-line PLC code (as many changes as req
uired). These edits are effectively invisible to the processor during thi
s stage.
 Once all edit rungs are entered switch the processor to TEST, during
TEST mode any new inserted code is allowed to be scanned along w
ith existing code, if any code is marked for deletion this code is preve
nted from being scanned at this stage.
 Once you are confident that the edit rungs are correct Assemble the
code which permanently activates new code and permanently remov
es any code marked for deletion.

Eng. R. L. Nkumbwa @ CBU 201


56 0
Programming Example:
Simple start/stop ladder logic.

Eng. R. L. Nkumbwa @ CBU 201


57 0
Programming Example:
Simple start/stop ladder logic.

 This is as it would appear in a windows base


d programming package.
 Text in the Yellow and Green box’s is the Ad
dress Description and Address Symbol respe
ctively.
 The symbols often correspond to SCADA (Sy
stem Control and Data Acquisition) software t
ags.
Eng. R. L. Nkumbwa @ CBU 201
58 0
Alternative Start/Stop using
Latch and Unlatch instructions.

Eng. R. L. Nkumbwa @ CBU 201


59 0

You might also like