Beruflich Dokumente
Kultur Dokumente
LOGIC CONTROLLERS:
LOW COST AUTOMATION
FOR THE STAGE
OR LEARNING TO LOVE LADDER LOGIC
BY LORE
he LoweU Da\~es Festival Stage was an ideal
place to perform Shakespeare's As YOIl Like It.
Cantilevered above a canyon and overlooking the
San Diego Zoo, the occasional roar of a lion or the plaintive cau of a peacock added to the mystery of the Forest
of Arden. But now the forest-or, rather, the tree that
represented it-teetered on the brink. The graceful span
of its wire and foanl branches a1tel11ately threatened and
beckoned the stagehands scattering in the canyon below.
nder the deck of the outdoor stage, the \~nch operator
carefuUy extracted himself from a chow mein of aircraft
cable and splintered wood. He had been distracted, it
seems, by a spider "as big as a house cat" and had sent
the tree moving in the wrong direction. The Forest of
Arden now rested on the upstage lip of the stage-three
"The Forest of Arden, " in As You Like It, at the Lowell Davies Festival Stage/
Simon Edison Center for the Perf. Arts, 1990. Scenery by David Jenkins,
lighting by Peter Maradudin, costumes by Robert Wojewodski.
18
SPRING
996
1D&1
SCHREIBER
feet beyond its intended stop and but a wafting breeze
from obli\~on. As the production manager, my assistant
and I crouched beside the tree, waiting for our cue to
shove the 'forest' back down-stage, I thought, "There
must be a better way!" The better way turned out to be
the micro version of a programmable logic controUer.
Progranlmable logic controUers (PLCs) are computer-like de\~ces designed specificaUy for the control of
machinery or processes. Prior to the development of the
PLC, most automated machinery was controUed by
electro-mechanical S\\~tches caUed relays. Dozens of relays might be required to pelform even simple machine
control and hundreds might be necessary for complex
operations. Besides being expensive, power-hungry and
prone to breakdowns, the single greatest drawback to relay-based control systems was that they were hardwired.
Making a simple change in a control sequence meant re\lliing the system. For the automotive industry, \\~th
highly automated assembly lines and yearly model
changes, the cost of "reprogran1ffiing" such systems in
both labor and loss of production was staggering. In
1968, in an effort to eliminate relay-based systems, General Motors wrote the design specifications for the first
progranlmable logic controUer. Several control manufacturers responded to the chaUenge and in 1969 the first
generation of PLCs was born.
Although the first generation was designed to fill the
needs of a single industlY, advances in electronics have
increased the capability and reduced the cost of PLCs so
that now nearly evelY induslIy that uses machinelY employs them. They are found in manufacturing, of course,
but also can be found controlling elevators, vending machines, anmsement park rides and stage machinely. Entertainment industly companies like FeUer Precision,
of the output relay and the load to the orller and that is it.
Load limitations vary among brands, but output relays
aI'e typically capable of 2 to 5 amperes at 250VAC or
30VDC for resistive loads.
If the input devices are simple 0 /OFF switches and
the outputs are simple ON/OFF s\\~tches, what good is a
PLC? Why bother witil the middleman? The answer, of
course, is progranlmability. Using only tilese simple 01 /
OFF s\vitches, PLCs can perform quite complex control
sequences based on an internally stored progranl.
For most PLCs, full-size or nlicro, the programming
language is called Relay Ladder Logic, which is a reflection of the PLCs origins. Working with Relay Ladder Logic
(RLL) differs from traditional computer programming.
PLC progranls are not written, rather, tiley are drawn and
tile resulting diagranl resembles a ladder, hence the
nan1e. Software bundled \\~th the starter kits allows the
programmer to build the diagrams on a personal computer by selecting from a menu of elements. Once the
ladder is complete, tile progranl is up-loaded to tile PLC
via a serial cable.
It may be daunting to consider learning yet another
progranlIlling language, but RLL is really quite simple,
consisting of only two primary commands: ON and OFF.
To demonstrate how simple RLL really is, we \\ill build a
progranl to prevent the Forest of Arden (rom wandering
off in the wrong direction using only ON/OFF switches
and ON/OFF commands.
For ilie purposes of tilis demonstration let's assume
tilat ilie Forest of Arden is moved by a standard stage
cable \\~nch powered by a permanent magnet DC motor,
which, in turn, is driven by a regenerative motor drive.
Selecting a direction for the regenerative drive requires
only a light duty, single-pole/double-ilirow toggle switch,
or, for our purposes, a PLC. To complete our system, we
\\ill place a limit s\\~tch at each end o( ilie forest's track
and give the operator a single, large, green push-button
to put tile forest in motion. The PLC will decide wllich direction is appropriate and when to stop.
Figure I shows how each of ilie components are
connected to a typical PLC. One wire from the operator's
push-button is connected to Input I and the oilier wire to
the PLe's common. Likewise, each Unlit switch is connected to an input and to rlle common. Activating a
S\vitch completes ilie circuit and turns its corresponding
input 01 . On rlle output side, the fonvard and reverse
wires from the regenerative drive are connected to Outputs I and 2 respectively. The drive's common \\~re is
connected to ilie common terminal shared by ilie two
outputs. In tllis case, activating an output will connect either the forward or reverse wire to the drive's common
and tile motor will start. Each input and output has a corresponding indicator light on the face of the PLC that
lights when tile input or output is ON.
Figure 2 shows a simple RLL progranl. On tile left
and right are two vertical lines called rails, which are
schematic representations of the actual power rails, were
these electro-mechanical relays. "Power" flows down ilie
TD&T
S P R I. G
19
INPUT TERMINAil
VPP: SUPPUES
1-8
24 VDC
ON CONFIRJ"S
SWITCH: PGM
INPUT OR OUTPUT.
htODEAll.OWS
TRANSFER OF RU
PROGRAM FROh' A
vpp
PERSONAL COMPUTER
TO THE PLC.
I
I
POWER IN
IIOVAC
4
4
TERMINAil FOR
0
5
5
0
6
6
0
7
OK
COMO
OUTPUTS
PORT
'------'---''--J
COM
o
OK: UGHT
ON
INDICATES SELF-
\
\
UNIT HAS
PROPERLY.
MOTOR REVRSE
...J
---J
COMMON
AND
5 AND 6
I,
'":2:
0
I.:>
:2:
::>
'"
INPUT I
INPUT 2
OUTPUT I
(PUSHwrrON)
(ON-STAGE UMIT)
(MOTOR FORWARD)
V1
Figure 2
Rung One reads, "If the operator's push-button is ON and the limit switch is
OFF, then Output 1 will come on and the motor will start forward. "
left rail, across the rung to the right rail, completing the
electrical connection to whatever de\~ce is represented
by the parentheses. Along the rung to the left of the parenthesis are conditions that must be met before power
can flow to the de~ce. These conditions are represented
by the schematic diagram for contacts that are either nOI~
mallyopen (-11-) or normally closed (-Vl-).
This schematic diagram system for progranlming,
20
SPRING
996
TD&T
with its use of the symbols for normally open and nOI~
mally closed contacts, was taken directly from the old relay-based system. However, the terms "normally open"
and "normally closed" are often a source of confusion to
tllOse new to RLL diagrams. To avoid tllis, an easy way to
keep things straight is to read tile -I 1- symbol as meaning ON and the -Vl- symbol as meaning OFF. (T1link of
the international symbol for "no," the circle with a slash
through it. The RLL symbol with a slash means NOT ON.)
Each rung in an RLL program is essentially a truth
table: if all tile conditions specified on the rung are mel,
then the de~ce in the parentheses adjacent tile right
power rail \\~ll switch on and stay on only as long as the
conditions continue to be met.
Figure 2 is our basic program for the Forest of
Arden. The rung is drawn with one ON contact (-I 1-)
and one OFF contact (-Vl-) representing the PLC inputs
to which the operator's push-button and the on-stage
limit switch are connected. The de\~ce represented by tile
parentheses is the PLC's Output 1, wllich is the motor in
forward motion. The program may be read thusly: "If the
operator's push-button is ON and tile linlit switch is OFF,
tilen Output 1 will come on and tile motor will start fOl~
ward." Tote that every condition must be met for the motor to run: if the operator takes his hand off the push-button or the limit switch turns 0\ then the conditions will
not be met and the motor will stop. ~ow there is no danger of the Forest of Arden overrunning its spike; once it
hits the limit switch it will stop.
Of course, it would be nice if the operator could
take his hand off the push-button to swat a spider (or
scratch or whatever) \\~thout the forest coming to a halt.
We can accomplish this by adding an '"OR" branch to the
rung. One of the great benefits of RLL is that the o. /OFF
status of the de~ce in the parentheses may be used as a
condition on the rung as well. Figure 3 shows the OR
branch. The program reads: "If the operator's push-button is ON or the motor is going forward (meaning Output
1 is ON) and the limit switch is OFF, then the motor will
run." This rung represents the typical "latch-on" ability
of RLL. Once the motor starts, the OR branch becomes
true, by-passing the push-button and latching the motor
ON until Arden reaches the limit switch. Once the limit
switch goes 01 , that condition will be false and power
will cease to flow across the rung; the motor will stop and
the OR branch will become false as well.
Act II, scene ii-it is time for the Forest of Arden to
exit. The operator pushes the big green button and nothing happens. Obviously, we need to draw another rung to
reverse the process. Figure 4 shows the new rung. Note
that we have added another limit switch for the off-stage
position, connected to Input 3 and another de\~ce (motor reverse) connected to Output 2. This rung may be
read: "If the operator's push-button and the on-stage
limit switch are ON and the off-stage limit s\\~tch is OFF,
or the motor is OK in reverse and the off-stage limit
s\\~tch is OFF then the motor will run." We have latched
the motor 0(, as in the first rung, until the off-stage limit
switch is reached. In this case, the Forest of Arden will
begin to travel off stage only if it is already on stage
against the on-stage limit switch, but once it starts, that
condition is by-passed by the OR branch.
If our winch operator is slow to remove his hand
from the switch, however, things will get interesting.
Imagine that the forest has begun to travel off-stage; it is
no longer against the on-stage limit s\~tch, which goes
OFF-but the operator still has his hand on the big green
button. Now, suddenly, the conditions in Rung One are
met as well as those in Rung Two: the push-button is 0 I
and on-stage limit switch is OFF. Output 1 (motor forward) switches ON. However, Output 2 (motor reverse)
is still ON too, and the regenerative drive is not happy!
This sort of RLL programming problem is what often frustrates those used to BASIC or other sequentially
executed progran1ming I:mguages. In BASIC, each line of
code is read and then immediately executed. Relay Ladder Logic operates a little differently. First the status of
the inputs is scanned, then the program (ladder) is
scanned and then the outputs are updated. The PLC
makes this scan several times each second and any
change in the status of an input or output is immediately
INPUT I
INPUT 2
OUTPUT I
(PUSHwrrON)
(ON-STAGE UMlT)
(MOTOR fORWARD)
'"oz
\)
OUTPUT I
(MOTOR FORWARD)
'"
Figure 3
Rung One reads, "If the operator's push-button is ON, OR the motor is
going forward (meaning Output 1 is ON) and the limit switch is OFF, then
the motor will run. "
INPUT I
INPUT 2
OUTPUT I
(PUSH-BUTTON)
(ON-STAGE UMIT)
(MOTOR FORWARD)
'"oz
\)
(..
OUTPUT I
IOroFt fORWARD)
'"
INPUT I
IMH.wf_O_N!
INPUT 2
INPUT 3
OUTPUT 2
ION_TG'...U_M'_T!---..,.....-_I_O'-IF-STAGEI-U_M_'T)
I'-I'OTOR REVERSE)
OUTPUT 2
(MOTOR REVfR5E)
Figure 4
Rung Two reads, "If the operator's push-button and the on-stage limit
switch are ON and the off-stage limit switch is OFF, OR the motor is ON in
reverse and the off-stage limit switch is OFF, then the motor will run. " (Rung
One is the same as in Figure 3)
SPRING
996
21
INPUT 3
INPUT I
INPUT 2
OUTPUT I
I_OF-I~rEI-U_MI_T)---,.---_IO_N--t",A ,GEI-U_MI_F)
IPUSH-TI-0_N)
I_M;OTOR FORWARD)
OUTPUT I
(",laTOIl FOR'WARD)
l\)
:z
:::J
INPUT I
INPUT 2
INPUT 3
OUTPUT 2
lPUSH-WTTON)
(ON-STAGE UMlr)
(OFF-STAGE UAur)
(MOTOR REVERSE)
I
OUTPUT 2
("IOTOIl REVERSE)
0::
Figure 5
Rung One reads, Hlf the operator's push-button and the off-stage limit
switch are ON and the on-stage limit switch is OFF, OR the motor is ON in
reverse and the on-stage limit switch is OFF, then the motor will run
forward. HRung Two is unchanged from Figure 4.
INPUT I
INPUT 3
INPUT 2
lPUSH-l_0_N)
INPUT 4
OUTPUT I
UJ
:z
o
\)
:z
:::J
OUTPUT I
(MOTOR FORWARO)
0::
INPUT I
INPUT 2
INPUT 3
INPUT 4
lPUSH-ll-o_N)
OUTPUT 2
IAlO(R REVERSE)
OUTPUT 2
(Al0TOR REVERSE)
Figure 6
The Emergency stop switch on each rung reads, Hlf the E-stop is ON and the
other rung conditions are met, the motor will run. H
22
SPRI NG
996
1D&1
to run the motor off stage until it hits the off-stage limit
switch.)
So, two simple rungs progranlmed into an inexpensive micro PLC have solved the problem of the wayward
Forest of Arden and allowed for a rather sophisticated
stage effect at the push of a single button. By automating
control of the winch, the chance of human error is reduced while maintaining sufficient operator control for
the safety of the performers. This is a vely simple exanlple of the potential for machine control using micro
PLCs, but they are capable of much more.
When the current, Doug Schmidt-designed, revival
of Damn Yankees was being tried out at the Old Globe in
San Diego, a similar motion control problem occurred,
but this time the object in motion was a pallet. The pallet
was designed to travel on and off stage carrying various
bits of scenery. nlike the Forest of Arden, however, the
pallet was required to stop at several intermediate points
between the extreme on- and off- stage positions. One
possible solution was to add a limit switch for each intermediate stop, but that rapidly would have consumed all
the available inputs on the PLC and made adjustments difficult during rehearsals. Asimpler solution was to employ one of the PLC's several hundred counters for each
position. Since PLCs were developed for manufacturing
and processing plants, the ability to count was an impOI~
tant part of the original design specification. Whether
counting bottles on a conveyor, passes by a cutting tool,
or, in tlus case, rotations of a winch drum, PLCs are easily
adapted to the task.
First the PLC needs something to count. There are
several ways to convert the rotation of the winch drum
into the digital signal required by the PLC. An inexpensive
method, suitable for many applications, is to mount a
solid-state proximity switch near the drum sprocket
which senses the passage of the sprocket's teeth. Each
time a tooth passes by, the sensor turns 0 . The PLC
counts the number of times the sensor turns ON and halts
the motor upon reaching a preset number. Proximity sensors are readily available in the voltage and current range
of the PLC's internal power supply, so no additional circuilly is required. Of course tlus method limits the maximum position resolution to the pitch (distance between
the teeth) of the winch sprocket, or between 5/8 and I
inch for typical stage winches.
For this production of Damn Yankees, 1/4 inch
resolution or better was required, since the pallet had a
hole in it through which an actor entered from below,
atop a small elevator trap. Misalignment would result in
the actor scraping a shoulder or worse. So, instead of a
proximity switch, I selected an incremental encoder
driven directly from the drum shaft. An incremental encoder consists of a photo-electric sensor which reads the
light passing through evenly spaced slots cut into a flat
disk rotating on the winch shaft. The selected encoder
provided 250 square wave (digital ON/OFF) pulses per
revolution, increasing the position resolution to a theoretical 118 inch for the winch in use. Like the proximity
switch, the encoder was powered by the PLC and no additional circuitry was needed. However, encoders are precision devices and are priced accordingly.
Once the PLC has something to count, it is a simple
matter to add a counter to an RLL program. Like all elements of an RLL progranl, a counter is selected [rom the
menu and then pasted into the rung. Figure 7 shows a
typical PLC counter lUld a motor control rung similar to
that used for the Forest of Arden. The counter requires
two connections to the left power rail: the upper, which
prO\~des the conditions required to count and the lower
which provides the conditions for a counter reset. Each
time the PLC scans the ladder, it checks to see if the conditions on the upper connection have been met. If so, the
counter increments by one. To prevent false counts for
events of greater duration than the PLC's scan rate, another type of RlL contact is required. This is called a
"one shot" and is similar in operation to the contacts already discussed, with one important difference: this condition is true only for a single ladder scan. The PLC reads
only the transition, from OFF to ON in the case of a "one
shot on" contact and ON to OFF for a "one shot off' contact. For the input to be read again, it must cycle between
its two states. In Figure 7, the counter will increment by
one evelY time Input 8 switches O~. (The
additional condition: CI, will be discussed
in a moment.) Once the count reaches the
preset value, 148 in t11is example, the device in the parentheses will switch 01\.
In this case, the device is one of the
PLC's many internal relays. Internal relays
are solid-state switches embedded in the
PLC's circuitry and are used to augment
ladder programs. Micro PLCs may provide
over a thousand of these internal switches
in order to build more complex programs
thlUl just the inputs and outputs would allow. They do not control external devices
directly, but are used as additional conditions \vithin the program. For example, in
Figure , the internal relay, CIO (at the end
of Rung One), is used to stop the winch
motor when the counter reaches its preset
value, by interrupting the motor latch in
Rung Two. Note that the counter is automatically reset whenever the motor is not
running. In this nllUlner, the pallet may be
slopped at any given location merely. by adjusting the preset number. To stop the pallet at several different locations, separate
counters, each with a different preset number, may be added to the ladder and selected indiVidually.
INPUT B e l
(PROXIMITY
1f-~_ITC_H)
(IN_TM~R_W_Y)---:C"'O~U::-NrrT~I-C-O-U-N-TE-R-I
--,
'"Z
\)
OUTPUT I
(MOTOR fORWARD)
/48
::l
'"
RESET
INPUT I
C 10
OUTPUT I
(PUSff-8UTTON)
(INTERNAL RE.U.Y)
(MOTOR FORWARD)
OUTPUT I
(MOTOR fORWARD)
Figure 7
Rung One reads, "If the proximity switch changes from OFF to ON in one
ladder scan and internal relay CI is ON, then Counter 1 will increment by
one." (When Counter 1 reaches 148, then internal relay CI0 will turn ON.
When the motor stops, the counter resets to zero.) Rung Two reads, "If the
operator's push-button is ON or the motor is ON and internal relay CI0 is
OFF, then the motor will run forward." (When internal relay CIO turns on,
the motor will stop.)
IO'-P"
j~l
Uili:
~
<:l
~1ij'j,tl
~'->&.
\"'P~!:..
~
~~
'~1
0=-=
I
Simon Edison Center for the Performing Arts, 1993. Scenery by Douglas
Schmidt, drafting by Craig Edelblut.
TD&T
SPRING
996
23
I.
" "
TERM/NAL CONNECTED
INPUTS
TO COMMON
'"
<
iJ
UJ
Q
UJ
8\J
,...
'" 7
<i5
B
12
13
I~
15
I
1 I
RESOURCES:
PUSH-SUTTON
---L.
PGMIRl
000 0
RUNI
UI
Figure 8
SPRING
TD&T