Professional Documents
Culture Documents
Introduction to PLCs
This is the first part of the Industrial Controls course. In this part we will discuss
the architecture and use of Prtogrammable Logic Controllers (PLCs).
Allen Bradley has donated several PLC-5 and SLC-500 systems to the University of
Akron. Allen Bradley is a very popular architecture and widely used in industry.
For these two reasons we will center all of the lectures and laboratories around the
Allen Bradley architecture and instruction set.
Overview
Boolean Logic
Logic in C
Meaning of Programmable
Alternate Forms used by PLC
History
Modern PLC
Introduction to PLCs
Example
There are two pumps referred to as pump1 and pump2 in a control
system. Between the two pumps is a tank. The tank has a
normally closed float switch at the top of the tank called below1.
The tank has a normally open switch at the bottom of the tank
called below2.
Control the level in the tank so that is remains between the
bottom and the top by controlling the two pumps
Introduction to PLCs
Boolean Logic
was = between
between = below1 AND NOT below2
turn1 = ( NOT turn1 AND was AND NOT between ) OR
( turn1 AND ( NOT was OR ( was AND between) ) )
pump1 = NOT was OR ( between AND turn1 )
pump2 = NOT was OR ( between AND NOT turn1 )
Introduction to PLCs
One why to represent the logic that solves the twin-pump problem is in the form of
Boolean equations. These equations can then be used to construct a dedicated
circuit in discreet gates, programmable logic device (PEEL), or a VLSI circuit.
This logic can be translated to configuration files using WinPLACE or VHDL if this
device is to be implement in a programmable logic device such as a PEEL or a Field
programmable Gate Array.
There is a history implied in this set of statements. After the second statement is
executed, was is the previous value of between and between is the present value. In
a hardware device this would be accomplished using some form of memory element
such as a flip flop. In a PLC this would be accomplished with an internal contact
and internal coil. The coil would only change after each scan of the logic is
completed. More about this in a future lecture.
Meaning of Programmable
Introduction to PLCs
C Language
Logic In C
Operation
Logical
&
|
~
^
AND
OR
NOT
XOR
&&
||
!
None
Introduction to PLCs
Alternate Forms
Introduction to PLCs
Graphical representations of these alternate forms are shown in the above slide. The
meaning of these forms will be discussed latter on in the course. We will also
concern ourselves with how to enter these forms using the software tool RSLogix.
At one time each vendor of PLCs would develop their own set of languages that
could be used to program the device. To allow some uniformity between platforms
the International Electrotechnical Commission (IEC) developed and published the
IEC 1131-3 standard. Most PLCs adhere to this standard in that they support one or
more of the representations. As an example Allen Bradley supports three out of the
five languages. We will learn a little about all three of these languages. The
laboratory exercises will use two of the languages (Ladder Diagram and Sequential
Function Charts).
Structured Text
was := between;
between := below1 AND NOT below2;
turn1 := ( NOT turn1 AND was AND NOT between ) OR
( turn1 AND ( NOT was OR ( was AND between)));
pump1 := NOT was OR ( between AND turn1 );
pump2 = NOT was OR ( between AND NOT turn1 );
Introduction to PLCs
10
The above is an example of structured text. Structured text comes the closes to the
PLDs hardware description language and the C language example. This form is the
most natural for students without ladder diagram experience. This is because they
have had experience with PLDs and C language.
10
11
The above example is sequential function charts. This form is easy for those that
like flowcharts and Algorithmic State Machine (ASM) charts. You most likely have
had experience with both of these.
11
Ladder Logic
was
between
below1
below2
turn1
was
turn1
between
between
turn1
was
was
between
Introduction to PLCs
12
Ladder diagrams are the most alien to electrical engineering and computer
engineering students. Because we have yet to use ladder diagrams to represent
programmable logic. But ladder diagrams are the most popular among practicing
engineers for historic reasons. The lectures will present ladder diagrams first and
then structured text and sequential function charts will be discussed.
It is my contention that most of the problems with PLC programs are because of the
limited capabilities of ladder diagrams. I will try to make you a user of the more
advanced languages of structured text and sequential function charts.
12
History
13
Originally all logic was implemented using electromechanical relays. The relays
predate electronics. Once solid state electronics was developed many vendors tried
unsuccessfully to migrate systems from relays to solid state relays. The problem
with solid state relays were:
The technology was unproven
Not enough of the high in the slide above were reduced to low with the
use of solid state relays
The industrial control industry is a mature field that does not except change
without over whelming benefit
Following solid state relays came the PC or programmable controllers.
When IBM introduced the IBM PC the PC term for programmable
controllers was often confused with personal computer. Programmable
Controllers were changed in name only to Programmable Logic Controllers
or PLCs. PLC is just the modern name for PC.
13
Modern PLC
14
The modern PLC has several components in the system. The power supply only
supplies power to the processor and the electronics in the I/O modules. The
external components such as heaters, position sensors, and the like need their own
external supply
The processor module contains the brains or the embedded controller. The
processor contains the logic and the ability to evaluate the logic.
The I/O rack holds the power supply, processor, and I/O modules. The rack is a
chassis with a backplane.
There are a large number of I/O modules available for any given PLC. We will use
several different type in the laboratory exercises. The I/O modules translate the real
world voltages and currents in the voltages and current suitable for the VLSI
processor chips in the processor module
14
I/O Modules
Input
Output
N.O.
Device
N.C.
Introduction to PLCs
15
The power supply for the PLC only supplies power to the electronics. It is the
responsibility of the user to provide power from an external source for the input and
output modules. Lets assume that the input module is for AC power and the output
is for AC power. The normally opern (N.O.) and normally closed (N.C.) switches
would be connected between the HOT bus and the input module node. The input
module would then have a common node connected to the NEUTRAL: bus. If
the input module senses a voltage relative to the neutral that is above a specified
threshold the input is sensed as a logic 1 or is on. Else the input voltage is below
the threshold voltage the input is a logic 0 or is off.
For the AC output module the node acts as an AC switch. If a logic 1 is written to
the node, the switch is closed and hot bus is connected to one side of the device, i.e.
lamp. The other side of the device is connected to the neutral bus. This applied hot
to neutral voltage across the device.
The hot bus could be replaced with a positive DC voltage and the neural with DC
ground, if the modules are DC input and DC output modules. If both AC and DC
modules are used, two external supplies at a minimum are needed.
15
16
The memory in an AB PLC are grouped in to block of memory called files. The
first 8 files (file 0 through file 7) are assigned by default. You will be exposed to
some of these file types in the laboratory exercises. Others you will only read
about.
O is for the outputs
I is for the inputs
S is for the processor status bits
B is for internal inputs and outputs, those not associated with an Input or
Output module
T is for timers
C is for counters
R is for control registers used with some instructions
16
17
The size and number of files is limited by the memory size in the processor.
These may be changed from there default size using programming tools. In
fact the file types may be associated with other file numbers if you so desire.
17
Program Files
System File 0
System File 1
Program File 2
Program Files 3 to 255
Introduction to PLCs
18
18
I/O Address
O:rg/00 to 17
r = rack number
g=group number (position in rack)
Node number in octal (PLC-5)
Terminal number in decimal (SLC 500)
I:rg/00 to 17
S:e/b
e element number
b bit number 0 to 15 in decimal
Introduction to PLCs
19
Each node of each input or output module must be numbered or have an address.
For the PLC-5 family the numbers are expressed in octal. For the SLC 500 family
the numbers are expressed in decimal. The rack number is the chassis number. The
group number relates to the modules position in the rack (chassis). The node
number related to the relative position of a terminal within a module.
19
Xf:n
Introduction to PLCs
20
The address for the other files is of the form Xf:n. X is a letter that is unique to the
file type such as F for floating-point numbers. The f is the file type which is 8 for
floating-point numbers bt default. The n is a unique number starting at 0. Each
n uses a given number of bytes in memory. If n numbers are skipped, that
block of memory is wasted, that is not used.
20
Introduction to PLCs
21
Allen Bradley has several different families of PLC. For small dedicated
application there are the Picologix and Micrologix family of devices. With these
devices the power supply, processor and input output modules are all integrated into
one systems. If you run out of inputs or outputs you must buy another Pico
Controller or Micrologix device. The devices themselves are not expandable.
21
Introduction to PLCs
22
For larger applications, the SLC 500 family can be used. The SLC 500 chassis
allows one to place a processor in the first slot and various input and output modules
in the other slots. You can pick and choose which module goes into which of the
remaining slots. This flexibility comes at the higher cost per node over the
Micrologix of Picologix cost per node.
22
SLC-500 Modules
Introduction to PLCs
23
The above slide shows a typical SLC 500 system with the power supply to the far
left. The processor is to the right of the power supply. Five modules of either the
input type or the output type are to the processors right. There are larger chassis
for the SLC 500 family that allow more modules.
23
PLC-5
Introduction to PLCs
24
The PLC-5 family is older and more mature then the SLC-500 family. It also uses a
power supply, chassis, processor and I/O module architecture.
24
PLC-5 Processors
Introduction to PLCs
25
As the processor number increases several things change in the processor. The
memory size increases. The communication capabilities increase. The processor
speed increases.
25