Click here to load reader

Basic Programmable Controllers

  • View
    235

  • Download
    5

Embed Size (px)

DESCRIPTION

Programmable Controllers

Text of Basic Programmable Controllers

  • MICRO PROGRAMMABLELOGIC CONTROLLERS:

    LOW COST AUTOMATIONFOR THE STAGE

    OR LEARNING TO LOVE LADDER LOGICBY LORE

    The LoweU Da\~es Festival Stage was an idealplace to perform Shakespeare's As YOIl Like It.Cantilevered above a canyon and overlooking theSan Diego Zoo, the occasional roar of a lion or the plain-tive cau of a peacock added to the mystery of the Forestof Arden. But now the forest-or, rather, the tree thatrepresented it-teetered on the brink. The graceful spanof its wire and foanl branches a1tel11ately threatened andbeckoned the stagehands scattering in the canyon below.

    nder the deck of the outdoor stage, the \~nch operatorcarefuUy extracted himself from a chow mein of aircraftcable and splintered wood. He had been distracted, itseems, by a spider "as big as a house cat" and had sentthe tree moving in the wrong direction. The Forest ofArden now rested on the upstage lip of the stage-three

    "The Forest ofArden, " 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.

    SCHREIBER

    feet beyond its intended stop and but a wafting breezefrom obli\~on. As the production manager, my assistantand I crouched beside the tree, waiting for our cue toshove the 'forest' back down-stage, I thought, "Theremust be a better way!" The better way turned out to bethe micro version of a programmable logic controUer.

    Progranlmable logic controUers (PLCs) are com-puter-like de\~ces designed specificaUy for the control ofmachinery or processes. Prior to the development of thePLC, most automated machinery was controUed byelectro-mechanical S\\~tches caUed relays. Dozens of re-lays might be required to pelform even simple machinecontrol and hundreds might be necessary for complexoperations. Besides being expensive, power-hungry andprone to breakdowns, the single greatest drawback to re-lay-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, \\~thhighly automated assembly lines and yearly modelchanges, the cost of "reprogran1ffiing" such systems inboth labor and loss of production was staggering. In1968, in an effort to eliminate relay-based systems, Gen-eral Motors wrote the design specifications for the firstprogranlmable logic controUer. Several control manufac-turers responded to the chaUenge and in 1969 the firstgeneration of PLCs was born.

    Although the first generation was designed to fill theneeds of a single industlY, advances in electronics haveincreased the capability and reduced the cost of PLCs sothat now nearly evelY induslIy that uses machinelY em-ploys them. They are found in manufacturing, of course,but also can be found controlling elevators, vending ma-chines, anmsement park rides and stage machinely. En-tertainment industly companies like FeUer Precision,

    18 SPRING I 996 1D&1

  • Scenic Technologies and Show Tech depend on PLCs tocontrol the specialized machines in shows like Dam//Yankees, Sunset Bou/evard and HolV To Succeed InBusiness. The increasingly high-tech spectacle of Las Ve-gas shows like Buccaneer Bay and EFX would be impos-sible without these devices.

    PLCs come in a \\~de vaIiety of brands and models.On the high-end are modulaI' systems featuring a centralprocessing core with an open back-plane onto whichspecialized control or sensor modules are mounted. De-pending on the modules selected, these systems may costseveral thousand dollars. On the other end of the scale isthe "micro" PLC. Several manufacturers, GEIFanuc,Allen-Bradley and Aromat among otilers, offer a microPLC which lacks tile modular design of its more-expen-sive cousins, but still provides the solid-state equivalentof more than a thousand relays, and hundreds ofcounters and timers. These units run about $350.00 for a"starter kit" which usually includes the PLC, program-ming software and a serial cable for downloading pro-grams from a personal computer.

    Physical differences among brands are minor. Ingeneral, tile micro PLC consists of a plastic housing thatis a bit smaller tilan a brick or a paperback copy ofAt/asShrugged and considerably lighter than eitiler one. Screwterminals are provided for all inputs, outputs and powerconnections. Generally, the input terminals are arrayedalong one side of tile unit and tile output terminals alongtile opposite side. These terminals are called VO (input!output) points and tile size of the unit is specified by iliecombined number of points. The smallest of tile microPLCs are commonly 14 point units with 8 inputs and 6outputs, but they are often provided witil a port to add anexpander unit which usually doubles tile available VO.

    Micro PLCs are furtiler specified by tile type of in-puts available: digital or analog. Analog PLCs are used tocontrol de\~ces tilat supply or require continuously vari-able data such as temperature or pressure and are not asuseful for controlling stage machinery. Digital units, ontile otiler hand, use simple ON/OFF devices like push-buttons or toggle switches for input. Connecting an inputdevice to a digital micro PLC is simply a matter of con-necting one wire from a switch to an input terminal andthe otiler wire to tile common temlinal. For tiuee-\vire,solid state sensors like proxinlity or photo-electricswitches, most micro PLCs prO\~de a 24 VDC ternlinal ad-jacent to the input ternlinals (VPP in Figure I) to providepower for the sensor. In tllis case, one wire connects tothe common, one to tile power supply and the load \\~reto one of the inputs. In either case, closing tile switchturns the input ON. Most micro PLCs are capable of sup-plying 75 to 100 ma for external sensors and the indi-vidual inputs typically draw less than 10 mao

    Outputs are either single-pole, single-throw relays(simple 0 /OFF switches) or the transistorized equiva-lent. Of the two, the relay output is the easiest to imple-ment and requires little or no additional circuitry; onemerely hooks a source of power to one side (terminal)

    of the output relay and the load to the orller and that is it.Load limitations vary among brands, but output relaysaI'e typically capable of 2 to 5 amperes at 250VAC or30VDC for resistive loads.

    If the input devices are simple 0 /OFF switches andthe outputs are simple ON/OFF s\\~tches, what good is aPLC? Why bother witil the middleman? The answer, ofcourse, is progranlmability. Using only tilese simple 01 /OFF s\vitches, PLCs can perform quite complex controlsequences based on an internally stored progranl.

    For most PLCs, full-size or nlicro, the programminglanguage is called Relay Ladder Logic, which is a reflec-tion of the PLCs origins. Working with Relay Ladder Logic(RLL) differs from traditional computer programming.PLC progranls are not written, rather, tiley are drawn andtile resulting diagranl resembles a ladder, hence thenan1e. Software bundled \\~th the starter kits allows theprogrammer to build the diagrams on a personal com-puter by selecting from a menu of elements. Once theladder is complete, tile progranl is up-loaded to tile PLCvia a serial cable.

    It may be daunting to consider learning yet anotherprogranlIlling 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 aprogranl to prevent the Forest of Arden (rom wanderingoff in the wrong direction using only ON/OFF switchesand ON/OFF commands.

    For ilie purposes of tilis demonstration let's assumetilat ilie Forest of Arden is moved by a standard stagecable \\~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 requiresonly 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 trackand give the operator a single, large, green push-buttonto put tile forest in motion. The PLC will decide wllich di-rection is appropriate and when to stop.

    Figure I shows how each of ilie components areconnected to a typical PLC. One wire from the operator'spush-button is connected to Input I and the oilier wire tothe PLe's common. Likewise, each Unlit switch is con-nected to an input and to rlle common. Activating aS\vitch completes ilie circuit and turns its correspondinginput 01 . On rlle output side, the fonvard and reversewires from the regenerative drive are connected to Out-puts I and 2 respectively. The drive's common \\~re isconnected to ilie common terminal shared by ilie twooutputs. In tllis case, activating an output will connect ei-ther the forward or reverse wire to the drive's commonand tile motor will start. Each input and output has a cor-responding indicator light on the face of the PLC thatlights when tile input or output is ON.

    Figure 2 shows a simple RLL progranl. On tile leftand right are two vertical lines called rails, which areschematic representations of the actual power rails, werethese electro-mechanical relays. "Power" flows down ilie

    TD&T S P R I. G I 9 9 6 19

  • Figure 1 - Micro PLC Connections

    Most input devices connected to the PLC are either "normally open" or "normally closed" type switches. The programming symbols usedin RLL are called "normallyopen contact" (-I I-) and "normally closed contact" (-1/1-), but it's important to not confuse the logicalconditions (ON/OFF) represented by the programming language with the physical devices connected to the PLC.

    MOTOR REVRSE ...J

    SWITCH: PGMhtODEAll.OWSTRANSFER OF RUPROGRAM FROh' APERSONAL COMPUTERTO THE PLC.

    COM PORT: SERIALPORT USED TO UPLOADTHE Rll PROGRM'.

    COM: COhV,'ON FOR INPUTS

    COMOPORT

    '------'---''--J

    \ \ PWR: UGHT ON INDICATES THAT\ UNIT HAS I 10 VAC COMING IN.

    OUTPUT TERhllNALS: OUTPUT DEVICES CONNECTED TO I,2 AND 3 MUST SHARE COM/.tON VOLTAGE. OUTPUTS 4.5 AND 6 CAN HAVE DIFFERENT VOLTAGES

    OK: UGHT ON INDICATES SELF-DIAGNOSTIC FUNCTION CONFIRI.1S All.INTERNAL ORCUITS FUNCTIONINGPROPERLY.

    OFF-STAGE Uh"T SWITCH/ (NORlMllY OPEN TYPE)

    ON-STAGE UMIT SWITCH/ (NORIMllY OPEN TYPE)

    OPERATOR PUSH-WTTON (NORMAllY OPEN TYPE SWITCH)~

    I0 0 0 0 0 0

    I 2 3 4 5 6 7I 2 3 4 5 6 OK

    0 0 0 0 0

    OUTPUTS

    2 3 COM

    0 vpp

    o

    o

    POWER INTERMINAil FORIIOVAC

    MOTOR FORWARD

    VPP: SUPPUES 24 VDC

    COMMON ---J

    INPUT TERMINAil 1-8

    LED PANEL: A UGHT FOR.I.CH INPUT AND OUTPUT.A UGHT ON CONFIRJ"S ACLOSED ORCUIT FOR THATINPUT OR OUTPUT.

    Rung One reads, "If the operator's push-button is ON and the limit switch isOFF, then Output 1 will come on and the motor will start forward. "

    INPUT I INPUT 2 OUTPUT I

    '"(PUSHwrrON) (ON-STAGE UMIT) (MOTOR FORWARD)

    :2: I V1 (0I.:>:2:::>'"

    left rail, across the rung to the right rail, completing theelectrical connection to whatever de\~ce is representedby the parentheses. Along the rung to the left of the pa-renthesis are conditions that must be met before powercan flow to the de~ce. These conditions are representedby the schematic diagram for contacts that are either nOI~mallyopen (-11-) or normally closed (-Vl-).

    This schematic diagram system for progranlming,

    with its use of the symbols for normally open and nOI~mally closed contacts, was taken directly from the old re-lay-based system. However, the terms "normally open"and "normally closed" are often a source of confusion totllOse new to RLL diagrams. To avoid tllis, an easy way tokeep things straight is to read tile -I 1- symbol as mean-ing ON and the -Vl- symbol as meaning OFF. (T1link ofthe international symbol for "no," the circle with a slashthrough it. The RLL symbol with a slash means NOT ON.)

    Each rung in an RLL program is essentially a truthtable: if all tile conditions specified on the rung are mel,then the de~ce in the parentheses adjacent tile rightpower rail \\~ll switch on and stay on only as long as theconditions continue to be met.

    Figure 2 is our basic program for the Forest ofArden. The rung is drawn with one ON contact (-I 1-)and one OFF contact (-Vl-) representing the PLC inputsto which the operator's push-button and the on-stagelimit switch are connected. The de\~ce represented by tileparentheses is the PLC's Output 1, wllich is the motor inforward motion. The program may be read thusly: "If theoperator's push-button is ON and tile linlit switch is OFF,tilen Output 1 will come on and tile motor will start fOl~

    RIGHT POWER RAILFigure 2

    LEFT POWER RAIL

    20 SPRING 996 TD&T

  • Rung One reads, "If the operator's push-button is ON, OR the motor isgoing forward (meaning Output 1 is ON) and the limit switch is OFF, thenthe motor will run. "

    RIGHT POWER RAIL

    OUTPUT I(MOTOR FORWARD)

    OUTPUT I(MOTOR fORWARD)

    RIGHT POWER RAIL

    Figure 4

    Figure 3

    INPUT 2(ON-STAGE UMlT)

    INPUT 2(ON-STAGE UMIT)

    OUTPUT 2(MOTOR REVfR5E)

    LEFT POWER RAIL

    INPUT I(PUSHwrrON)

    LEFT POWER RAIL

    '"zo\) OUTPUT I5 (MOTOR FORWARD)'"

    INPUT I(PUSH-BUTTON)

    '"zo\) OUTPUT I5 (...IOroFt fORWARD)'"

    Rung Two reads, "If the operator's push-button and the on-stage limitswitch are ON and the off-stage limit switch is OFF, OR the motor is ON inreverse and the off-stage limit switch is OFF, then the motor will run. " (RungOne is the same as in Figure 3)

    INPUT I INPUT 2 INPUT 3 OUTPUT 2

    IMH.wf_O_N! ION_TG'...U_M'_T!---..,.....-_I_O'-IF-STAGEI-U_M_'T) I'-I'OTOR REVERSE)

    available to the entire progran1. (That is why it is possiblefor the motor outputs to latch themselves ON.) If oneimagines the power rails and rungs to be pipes full of wa-ter and the conditions to be simple valves, it may beeasier to ~suaJjze how RLL works. Pressure is appliedcontinuously through the left power rail to each rung;whenever a valve opens on a rung, water will flow, re-gardless if that rung is on the top or the bottom of theladder.

    The solution to the unhappy regenerative driveabove is simply to add another condition to the first rungthat will prevent it operating at the same time as the sec-ond. There are several possible ways to do this, but thesimplest is to add the off-stage Limit s\~lch to Rung Onemaking it a mirror of Rung Two. (See Figure 5) Now theforest will begin to move only as long it is at one end ofthe track or the other, against one of the Limit switches.The operator's push-button is by-passed once the motorstarts in either direction.

    ward." Tote that every condition must be met for the mo-tor to run: if the operator takes his hand off the push-but-ton or the limit switch turns 0\ then the conditions willnot be met and the motor will stop. ~ow there is no dan-ger of the Forest of Arden overrunning its spike; once ithits the limit switch it will stop.

    Of course, it would be nice if the operator couldtake his hand off the push-button to swat a spider (orscratch or whatever) \\~thout the forest coming to a halt.We can accomplish this by adding an '"OR" branch to therung. One of the great benefits of RLL is that the o. /OFFstatus of the de~ce in the parentheses may be used as acondition on the rung as well. Figure 3 shows the ORbranch. The program reads: "If the operator's push-but-ton is ON or the motor is going forward (meaning Output1 is ON) and the limit switch is OFF, then the motor willrun." This rung represents the typical "latch-on" abilityof RLL. Once the motor starts, the OR branch becomestrue, by-passing the push-button and latching the motorON until Arden reaches the limit switch. Once the limitswitch goes 01 , that condition will be false and powerwill cease to flow across the rung; the motor will stop andthe OR branch will become false as well.

    Act II, scene ii-it is time for the Forest of Arden toexit. The operator pushes the big green button and noth-ing happens. Obviously, we need to draw another rung toreverse the process. Figure 4 shows the new rung. Notethat we have added another limit switch for the off-stageposition, connected to Input 3 and another de\~ce (mo-tor reverse) connected to Output 2. This rung may beread: "If the operator's push-button and the on-stagelimit 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 latchedthe motor 0(, as in the first rung, until the off-stage limitswitch is reached. In this case, the Forest of Arden willbegin to travel off stage only if it is already on stageagainst the on-stage limit switch, but once it starts, thatcondition is by-passed by the OR branch.

    If our winch operator is slow to remove his handfrom the switch, however, things will get interesting.Imagine that the forest has begun to travel off-stage; it isno longer against the on-stage limit s\~tch, which goesOFF-but the operator still has his hand on the big greenbutton. Now, suddenly, the conditions in Rung One aremet as well as those in Rung Two: the push-button is 0 Iand on-stage limit switch is OFF. Output 1 (motor for-ward) 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 of-ten frustrates those used to BASIC or other sequentiallyexecuted progran1ming I:mguages. In BASIC, each line ofcode is read and then immediately executed. Relay Lad-der Logic operates a little differently. First the status ofthe inputs is scanned, then the program (ladder) isscanned and then the outputs are updated. The PLCmakes this scan several times each second and anychange in the status of an input or output is immediately

    TD&T SPRING I 996 21

  • to run the motor off stage until it hits the off-stage limitswitch.)

    So, two simple rungs progranlmed into an inexpen-sive micro PLC have solved the problem of the waywardForest of Arden and allowed for a rather sophisticatedstage effect at the push of a single button. By automatingcontrol of the winch, the chance of human error is re-duced while maintaining sufficient operator control forthe safety of the performers. This is a vely simple ex-anlple of the potential for machine control using microPLCs, but they are capable of much more.

    When the current, Doug Schmidt-designed, revivalof Damn Yankees was being tried out at the Old Globe inSan Diego, a similar motion control problem occurred,but this time the object in motion was a pallet. The palletwas designed to travel on and off stage carrying variousbits of scenery. nlike the Forest of Arden, however, thepallet was required to stop at several intermediate pointsbetween the extreme on- and off- stage positions. Onepossible solution was to add a limit switch for each inter-mediate stop, but that rapidly would have consumed allthe available inputs on the PLC and made adjustments dif-ficult during rehearsals. Asimpler solution was to em-ploy one of the PLC's several hundred counters for eachposition. Since PLCs were developed for manufacturingand processing plants, the ability to count was an impOI~tant part of the original design specification. Whethercounting bottles on a conveyor, passes by a cutting tool,or, in tlus case, rotations of a winch drum, PLCs are easilyadapted to the task.

    First the PLC needs something to count. There areseveral ways to convert the rotation of the winch druminto the digital signal required by the PLC. An inexpensivemethod, suitable for many applications, is to mount asolid-state proximity switch near the drum sprocketwhich senses the passage of the sprocket's teeth. Eachtime a tooth passes by, the sensor turns 0 . The PLCcounts the number of times the sensor turns ON and haltsthe motor upon reaching a preset number. Proximity sen-sors are readily available in the voltage and current rangeof the PLC's internal power supply, so no additional cir-cuilly is required. Of course tlus method limits the maxi-mum position resolution to the pitch (distance betweenthe teeth) of the winch sprocket, or between 5/8 and Iinch for typical stage winches.

    For this production of Damn Yankees, 1/4 inchresolution or better was required, since the pallet had ahole in it through which an actor entered from below,atop a small elevator trap. Misalignment would result inthe actor scraping a shoulder or worse. So, instead of aproximity switch, I selected an incremental encoderdriven directly from the drum shaft. An incremental en-coder consists of a photo-electric sensor which reads thelight passing through evenly spaced slots cut into a flatdisk rotating on the winch shaft. The selected encoderprovided 250 square wave (digital ON/OFF) pulses perrevolution, increasing the position resolution to a theo-retical 118 inch for the winch in use. Like the proximity

    RIGHT POWER RAILFigure 6

    Of course, the operator is now removed from theloop. What happens if the Forest of Arden needs to bestopped for an emergency, to prevent, say, a Rosalindrun-over? Simple-we add a big red button to theoperator's control, attach it to Input 4 and add it to eachrung as in Figure 6. Tote that, in this case, we're using anormally closed switch. The emergency stop switch mustbe ON for the motor to run; hitting the button opens thecircuit, turning Input 4 OPE This is the safest arrange-ment, since any interruption of the emergency stopswitch circuit-a broken wire, for exanlple-will stopthe motor.

    Restarting the motor after an emergency stop can bea problem. If we assume that the forest was stopped mid-travel and that it is no longer against one of the limitswitches, none of the conditions required to start the mo-tor are met. The solution is to either manually activateone of the limit switches or add another rung that allowsthe operator to take manual control. (One method mightbe to draw a rung that requires that the start button andthe emergency stop button be depressed simultaneously

    INPUT I INPUT 3 INPUT 2 OUTPUT I

    IPUSH-TI-0_N) I_OF-I~rEI-U_MI_T)---,.---_IO_N--t",A ,GEI-U_MI_F) I_M;OTOR FORWARD)

    OUTPUT 2(Al0TOR REVERSE)

    INPUT I INPUT 2 INPUT 3 INPUT 4 OUTPUT 2

    lPUSH-ll-o_N) I_ON--IfEI-UA_"T_)_r-_IO_F~-tSTAGEt-UA_"T_) _1

  • OUTPUT I(MOTOR FORWARD)

    RIGHT POWER RAIL

    t

    /48

    RESET

    Figure 7

    IO'-P"

    C 10(INTERNAL RE.U.Y)

    INPUT I(PUSff-8UTTON)

    OUTPUT I(MOTOR fORWARD)

    OUTPUT I(MOTOR fORWARD)

    INPUTBel

    (PROXIMITY 1f-~_ITC_H) (IN_TM~R_W_Y)---:C"'O~U::-NrrT~I-C-O-U-N-TE-R-I --,

    LEFT POWER RAIL

    j~l r rUili: ~ ~1ij'j,tl

  • PLC INPUTS

    12 13 I~ 15

    TERM/NAL CONNECTEDTO COMMON

    B 4 2

    I

    I

    I I1

    B

    9

    o

    ~

    '"< 4iJUJQ 5QUJ

    8 6\J,...

    '" 7~