You are on page 1of 4

ic controllers

The workhorse of factory automation keeps things on track

Programmable Logic Controllers are


at the forefront of manufacturing
automation. Many factories use Pro-
grammable Logic Controllers to cut pro-
duction costs andor increase quality.
Since its predecessor was hard-wired
relay panels, the Programmable Logic
Controller uses a unique language
called ladder logic. Although other lan-
guages are used, ladder logic presently
remains the dominant language of
automation. The Programmable Logic
Controller (PLC) is sometimes called a
Programmable Controller (PC), but the
abbreviation PLC is preferred to distin-
guish it from the Personal Computer.
PLCs developed out of the need to
replace the hard-wired relay panels. In
the 1960s, a typical automated assem-
bly or other manufacturing line had a PLC in late 1969 and early 1970. The and 256K words program memory,
cabinet of relays wired to control the fKst PLCs just basically replaced hard- enhanced math and data handling
operation. As one might expect, debug- wired relay logic. instructions, PID control.
ging relay failures could be time-con- Today, PLCs are available in a wide Very Large PLCs: Expandable I/O
suming, and changing functionality by range of capabilities and cost. There are of up to about 8192 points and 4M
modifying the sequence of operations five general categories of PLCs avail- words program memory.
was time-consuming and costly able. The general capabilities of each
because of the required rewiring. category are: PLC architecture
In 1968, the Hydramatic Division of Micro PLCs: Generally have the The architecture of a general PLC is
General Motors Corporation (GM) spec- basic relay instructions, counters, and shown in Fig. 1. The main parts of a
ified design criteria for the first PLC. timers with up to 32 digital input/output PLC are its processor, power supply,
(They had to rewire many relay panels (UO) points (fined number of each) and and input/output (I/O) modules. In a
annually for car model year changes.) 2K words of program memory built micro PLC, all three main parts are
Some major specificationswere: into a compact unit.
1. Easily programmed and repro- Small PLCs: Added capabil-
grammed, preferably in-plant to alter its ities of analog YO, expandable
sequence of operations. I/O of up to 128 points, 4K
2. Easily maintained and repaired- words program memory, shift
preferably with plug-in modules. register and sequencer instruc-
3. Capable of operation in a plant tions, and primitive communi-
environment. cations with other PLCs.
4. Smaller than relay equivalent. Medium PLCs: Expand-
5. Capable of communicating with able U 0 of up to about 1024
central data collection system. points and 32K words pro-
6. Cost-competitive with solid-state gram memory, remote I/O,
and relay logic systems then in use. basic math and data handling
A handful of companies responded instructions, subroutines,
to develop the device we now call a interrupts, functional block or
high-level language, local
area network connection.
Large PLCs: Expandable
YO of up to about 2648 points Fig. 1 Architecture of typical PLC

14 0278-6648/96/$5.000 1996 IEEE IEEE POTENTIALS


enclosed in a single unit. For larger
PLCs, these three parts are separately
purchased (depending on desired func-
tionality), and combined to form a PLC.
The programming device, often a per-
sonal computer, connects directly to the
processor through a serial port or
remotely through a local area network.
Depending on the manufacturer, the
local area network interface may be
built into the processor, or may be a
separate module. Many of the PLC local
area networks are proprietary to one
manufacturer. However, interfaces to
standard networks, such as Ethernet,
have recently been introduced.
The architecture of the PLC is basi- circuit, d) equivalent ladder logic
cally the same as a general purpose
computer. In fact, some of the early nect to the light directly. Instead, control left to right. One would interpret the rung
PLCs were computers with special I/O. relay coils, whose contacts are normally symbology as: “When input (switch) A
However, some important characteris- open, control the light, Fig. 2(c). The is ON and input (switch) B is ON then
tics distinguish PLCs from general pur- switches appear as inputs to the circuit. the lamp is ON.” If the example is
pose computers. They can be placed in The output (lamp in this case) is not changed to turn on a lamp when either
an industrial environment that has driven directly, but driven by another switch A or B is closed, then the two
extreme temperatures (typically up to relay to provide voltage isolation from contacts are placed in parallel.
160”F), high humidity (up to 9 5 % ) , the relays implementing the logic. The Now consider the implementation of
electrical noise, electromagnetic inter- switches control relay coils so that the a logical NOT function. Suppose one
ference, and mechanical vibration. They inputs are isolated from the logic. Also, wants to turn on a lamp when switch A
are easy to use by plant technicians. this way one input can be used multiple is on (closed) and switch B is off (open).
Hardware interfaces are easily connect- times by using the multiple poles (con- Figure 3 shows the truth table, relay
ed. Modular and self-diagnosing inter-
face circuits pinpoint malfunctions and
are easily replaced. They are pro-
grammed using ladder logic, which is
easy to learn. The PLC executes a sin-
gle program in an orderly and sequen-
tial fashion. However, most medium to
large PLCs have instructions that allow
subroutine calling, interrupt routines,
and the bypass of certain instructions.
Also, many PLCs have modules that
implement higher-level languages, such
as C and BASIC.

Ladder logic Fig. 3 Implementation of logical NOT in ladder logic: U) truth tuble, b) equiva-
The IEC 1131 international standard lent-reluy circuitry, c) equivalent ladder logic
defines four PLC languages: ladder
logic, sequential function charts, func- tacts) on the relay for that input. The implementation and ladder logic for this
tion blocks, and a text language. By far, ladder logic symbology is in Fig. 2(d). example. The logical NOT is accom-
ladder logic is the most prevalent lan- Notice how the notation is shortened plished with the normally closed (NC)
guage. The ladder logic symbology was to show only the relay contacts and the contact in the ladder. One would inter-
developed from the relay ladder logic coil of the output relay. It is assumed pret the rung symbology in Figure 3(c)
wiring diagram. In order to explain the that the inputs (switches in this example) as: “When input (switch) A is ON and
symbology, simple switch circuits will are connected to relay coils; that the input (switch) B is OFF then the lamp is
be converted to relay logic and then to actual output is connected to a set of ON.” This particular example is impos-
PLC ladder logic. normally open contacts controlled by the sible to implement with only two nor-
Consider the simple problem of turn- rightmost coil. The label shown above mally open switches.
ing on a lamp when both switches A and the contact symbol is not the contact A more complicated ladder logic dia-
B are closed, Fig. 2(a). Fig. 2(b) is a truth label. It is the control for the coil that gram is shown in Fig. 4. This figure
table of all possible combinations of the controls the contact.
two switches and the consequent lamp Also note that the output for the rung
action. To implement this function using occurs on the extreme right side of the
relays, the switches A and B do not con- rung and power is assumed to flow from

FEBRUARY/MARCH 1996
shows more obviously why it is called a instructions are box input instructions der logic. It does not read input chan-
ladder logic diagram. Each rung has a and timers, counters and computation nels or write output channels. However,
connection to the left (power) rail and a instructions are box output instructions. some manufacturers do allow that
connection to the right (neutral) rail. In During operation, the PLC repeated- option, which is useful in critical or
reality, the ladder logic diagram is only a ly executes a scan, during which the emergency situations.
symbolic representation of the computer input channels from all of the input The previous examples used external
program. So, power does not really flow modules are copied into the internal (switch) discrete inputs and an external
through any actual contacts; however, memory; the ladder logic is scanned, (lamp) discrete output. However, it is not
the concept of power flowing through updating the outputs being held in inter- required that all contacts be controlled by
contacts is useful when explaining the nal memory, and then the internal out- external discrete input devices. The con-
program operation. The three basic lad- puts are copied to the actual output tacts can also refer to an output (such
der logic symbols are: modules. After the actual outputs have reading the current state of an output).
Normally open (NO) contact -I I- been updated, the scan is repeated. The Many PLCs provide internal one-bit
Normally closed (NC) contact -I / t- time to execute a scan, depending on memory locations, often called internal
or+-
Output (relay coil) -( )- or -0-
the number of I/O channels and the
length of the ladder logic program, is on
coils, to store information that is not con-
nected to any external output channel.
The output is energized whenever the order of 1 - 10 milliseconds. Nor- One aspect of ladder logic that is
any left-to-right path of input contacts is mally, the processor uses only the inter- often confusing is the use of the NC con-
closed. For example, in Fig. 4, the out- nal copy of I/O when executing the lad- tact. The contact symbol in the ladder
put, OUT 1 is on whenever A and B does not necessarily correspond to the
and C are simultaneously on or D is actual switch type used in the field.
off and E is on. Symbols are being After all, the PLC does not know how
used to avoid having to deal with VO the switch is wired in the field, only
addressing, which is generally differ- whether the switch is open (off) or
ent for each PLC manufacturer. closed (on). So, a NO switch does not
There are two classes of ladder require a -I t in the ladder logic and
logic instructions: input instructions a NC switch does not require a -$-in
and output instructions. Input instruc- the ladder logic. Regardless of the
tions are the contact instructions, or type of switch in the field, when one
any instruction that can replace a wants “action” (something to be logi-
contact instruction. These instruc- cally true, or on) when the switch is
tions are the conditions to turn on the closed (on), use the -I I- symbol.
output. In contrast, an output instruc- When one wants “action” (something
tion always occurs on the extreme to be logically true, or on) when the
right side of the rung. switch is open (off), use the -$- sym-
In the examples used so far, the bol. One must eveutually learn to
only output instruction is ---( )--. read a ladder logic diagram as sym-
Depending on the particular PLC bols and not as relay contacts.
manufacturer, the other types of out- One common application uses two
put instructions that may be available momentary switches to control a
are: inverted output coil (output is device, for example, a motor. One
deenergized if any left-to-right path switch, called START-SW, is a
of contacts is closed), latch output momentary normally-open switch
coil, unlatch output coil. that when pressed, starts the motor.
Not all instructions are contacts or The motor must continue to run after
coils. All other types of instructions STmT-SW is released. The second
are often called “box instructions” switch, STOP-SW, is a momentary
because that is how they appear in Fig. 4 General ladder logic diagram normally-closed switch, that when
the symbology. Timers, counters, pressed, stops the motor. The switch-
comparison, and computation are the es are specified this way for safety
most common box instructions, but reasons.
sequencers, shift registers, and data If there is any faulty wiring to
move instructions are also box START-SW, the motor cannot be
instructions. A generic rung with one started. In addition, the motor will
box input instruction and a box out- automatically stop when there is any
put instruction is shown as the last faulty wiring connected to STOP-SW.
rung in Fig. 4. The ladder logic diagram that will
Depending on the manufacturer, accomplish the above function is
box instructions may be classified as shown in Fig. 5. Note the contact sym-
input or output instructions. For bol used for STOP-SW. It is the NO
example, the Siemens TI505 PLC has contact even though STOP-SW is
only box input instructions. On the wired normally-closed. Remember,
Allen-Bradley PLC-5’s, comparison Fig. 5 Statf/stop applicafion the PLC does not know how the

16 IEEE POTENTIALS
switch is wired in the field, only whether logic that will fulfill the specifications the 10 second interval has elapsed,
the switch is open (off) or closed (on). for an Allen-Bradley PLC-5 is shown in SPEED-1 is turned off and SPEED-2 is
When START-SW is on and Fig. 6. RUN and VIB-OCCUR are turned on. The last rung implements a
STOP-SW is on (not pressed) the motor internal coils (one-bit memory locations) latchhnlatch for the vibration sensor
is turned on. The contact labeled and are not output channels. The TON (VIB-SENSE). It is different from the
“MOTOR” in parallel with the instruction is an on-delay timer instruc- start/stop rung for safety reasons.
START-SW contact ensures that the tion and is an output instruction. The If the RESET-PB NC contact is
motor remains on, even after timing interval is the product of the base placed in series with VIB-SENSE on
START-SW is released and the PLC and the preset values. When the input the upper part of the rung (in the same
reads it as off. When STOP-SW is conditions to the left of the timer position as the STOP SW in the first
pressed (turns off), the motor is turned off become logically true (continuity rung), then holding the reset switch on
and remains off until START-SW is through contact), the timer accumulator (pushing the NO push-button) will over-
pressed again. This type of ladder logic is counted up once for each time base ride the vibration sensor. This will
rung is often called a “seal circuit” or interval. When the accumulator equals allow the motor to run even when vibra-
“latching circuit.” Often, in a real applica- the preset value, the timer “done” bit tion continues to occur. Obviously, a
tion, there will be multiple conditions that (addressed as TIMERA.DN) is set to situation one would want to prevent for
will have to be satisfied before the motor true (ON). If the input condition to the safety reasons.
can be turned on. There will also be a timer becomes logically false at any
multitude of conditions, any one of which time, the timer is reset and the accumu- Conclusion
will cause the motor to be turned off. lator is set to zero. It does not retain the Programmable logic controllers and
For the last example, consider an accumulator value. Since the timer is an their unique language, ladder logic, are
application where one wants to control output instruction, the timer done bit the workhorses of factory automation.
a two speed motor. The specifications must be used on another rung to turn on Higher-level languages, such as sequen-
for the application are: the SPEED-2 output. The first rung is tial function charts and function blocks,
a) The motor can only be started in the normal s t d s t o p rung with an addi- ease the programming task for large
Speed 1. tional condition for stopping. systems. However, ladder logic remains
b) The motor is then switched from The RUN internal coil is used the dominant language at present. Any
Speed 1 to Speed 2 after a 10 second because there is not a single output that engineer working in a manufacturing
delay. defines the motor operation. When vibra- environment will at least encounter
c) The motor cannot be switched tion occurs (VIB-OCCUR turns on), PLCs and ladder logic, if not use them
from Speed 2 to Speed 1. RUN turns off. The second rung defines on a regular basis.
d) Speed 1 and Speed 2 cannot be the delay timer operation. The third and
ON simultaneously. fourth rungs drive the outputs that con- Read more about it
e) If excessive vibration occurs, the trol the motor. As long as RUN is on and Filer, Robert and Leinonen,
motor must stop and cannot be restarted the timer has not finished the 10 second George. Programmable Controllers and
(is locked out) until a reset button is timing interval, SPEED-1 is on. When Designing Sequential Logic, Saunders
pressed. College Pub., 1992.
f) If the stop button is pressed when Bryan, L.A. and Bryan, E.A. Pro-
the motor is running in either speed, the grammable Controllers: Theory and
motor will stop, but will not lock out. Implementation, Industrial Text,
Assume the following input and output Chicago, IL, 1988.
assignments (only symbols are used Simpson, Colin D. Programmable
here to avoid explaining the I/O Logic Controllers, Regentsh’rentice-
addressing scheme): Hall, Englewood Cliffs, NJ, 1994.
Inputs: Warnock, Ian G. Programmable
START-PB Start push-button, Controllers: Operation and Applica-
NO, ON when starting tion, Prentice-Hall, Englewood Cliffs,
STOP-PB Stop push-button, NJ, 1988.
NC, OFF when stopping Webb, John W. and Reis, Ronald A.
RESET-PB Reset push-button, Programmable Logic Controllers: Prin-
NO, ON (closed) when resetting ciples and Applications, 3rd Ed., ben-
VIB-SENSE Vibration sensor, tice-Hall, Englewocd Cliffs, NJ, 1995.
NC, OFF when vibration occurs International Electrotechnical
outputs: Commission. “Part 3: Programming
SPEED-1 Motor speed 1 Languages,” IEC Standard 1131 -3,
SPEED-2 Motor speed 2 Programmable Controllers. American
The two outputs are assumed to be National Standards Institute, Ref. No.
inputs to a motor controller that direct- CEI/IEC 1131-3,1993.
ly controls the motor.
Unfortunately, it is hard to show a About the author
generic ladder for any application that Kelvin Erickson is an Associate
uses timers, since their implementation Fig. 6 Ladder /ogk for two speed Professor of Electrical Engineering at
varies among PLC vendors. One ladder motor application the University of Missouri-Rolla.

FEBRUARY/MARCH 1996 17

You might also like