• Page 1

    PROGRAMMABLE LOGIC CONTROLLERS Richard A. Wysk IE450 - Manufacturing Systems

  • Page 2

    Agenda • Review brief history of PLCs and manufacturing control systems • Introduce the concepts of discrete control of manufacturing • Review the various kinds of instrumentation used for control. • Overview ladder logic programming

  • Page 3

    Readings • Chapter 10 of Computer Aided Manufacturing, Chang, Chang, T.C. and Wysk, R. A. and Wang, H.P., 3rd Edition, 2006.

  • Page 4

    Exercise What are some common examples of control? Washing machine, sump pump, microwave, …. Others?

  • Page 5

    Types of control • Temporal -- control based in time • State -- control based in state level • Hybrid – both temporal and state

  • Page 6

    Objectives • To define the basic components of a PLC • To apply PLC based control to a manufacturing system • To be identify instrumentation required to implement a PLC control system • To program a PLC • To implement a PLC control program and hardware

  • Page 7

    PURPOSE OF Programmable Logic Controllers (PLCs) • Initially designed to replace relay logic boards – Sequence device actuation – Coordinate activities • Accepts input from a series of switches • Sends output to devices or relays

  • Page 8

    FUNCTIONS OF CONTROLLERS • 1) on-off control, • 2) sequential control, • 3) feedback control, and • 4) motion control.

  • Page 9

    CONTROL DEVICES 1) mechanical control - cam, governor, etc., 2) pneumatic control - compressed air, valves, etc. 3) electromechanical control - switches, relays, a timer, counters, etc, 4) electronics control - similar to electromechanical control, except uses electronic switches. 5) computer con...

  • Page 10

    PLC CPU System User Ladder Diagram Working memory registers Input Flag Output Input Module Output Module

  • Page 11

    PLC Configuration

  • Page 12

    What devices does a PLC interact with? •INPUT RELAYS-(contacts)These are connected to the outside world. They physically exist and receive signals from switches, sensors, etc. Typically they are not relays but rather they are transistors. •INTERNAL UTILITY RELAYS-(contacts) These do not rece...

  • Page 13

    What devices does a PLC interact with? Continued • TIMERS-These also do not physically exist. They come in many varieties and increments. The most common type is an on-delay type. Others include off-delay and both retentive and non-retentive types. Increments vary from 1ms through 1s. • OUT...

  • Page 14

    SWITCHES DPST SPDT Non-lockingLockingNormally OpenNormally ClosedMultiple ThrowP1P2Multiple PoleBreak-before-makeMake-before-break

  • Page 15

    TERMS Throw - number of states Pole - number of connecting moving parts (number of individual circuits). SPDT DPST A serial switch box (A-B box) has two 25 pin serial ports to switch from. Input Output A B Knob How is this switch classified?

  • Page 16

    TYPES OF SWITCHES 1. Basic switch, operated by a mechanical level, 2. Push-button switch, 3. Slide switch, 4. Thumbwheel switch, 5. Limit switch, 6. Proximity switch, and 7. Photoelectric switch. RATING: voltage, current

  • Page 17

    RELAYS A switch whose operation is activated by an electromagnet is called a "relay" contactcoilinputRelay coil Output contact

  • Page 18

    COUNTER Digital counters output in the form of a relay contact when a preassigned count value is reached. RegisterAccumulatorcontactinputresetoutputInputResetOutputCount01 2345015

  • Page 19

    TIMER A timer consists of an internal clock, a count value register, and an accumulator. It is used for or some timing purpose. ClockAccumulatorcontactresetoutputRegisterContactTime 5 seconds. ClockResetOutputCount123405

  • Page 20

    AN EXAMPLE OF RELAY LOGIC L1LS1PB1LS2R1R1R1TIMERR2PR=5For process control, it is desired to have the process start (by turning on a motor) five seconds after a part touches a limit switch. The process is terminated automatically when the finished part touches a second limit switch. An emergency...

  • Page 21

    PLC ARCHITECTURE Programmable controllers replace most of the relay panel wiring by software programming. ProcessorI/O ModulesMemoryPower SupplyProgram LoaderPrinterCassette LoaderEPROM LoaderSwitchesMachinesPeripheralsExternal D evicesPCA typical PLC

  • Page 22

    PLC COMPONENTS 1. Processor Microprocessor based, may allow arithmetic operations, logic operators, block memory moves, computer interface, local area network, functions, etc. 2. Memory Measured in words. ROM (Read Only Memory), RAM (Random Access Memory), PROM (Programmab...

  • Page 23

    PLC COMPONENTS 3. I/O Modular plug-in periphery AC voltage input and output, DC voltage input and output, Low level analog input, High level analog input and output, Special purpose modules, e.g.., high speed timers, Stepping motor controllers, etc....

  • Page 24

    LADDER DIAGRAM A ladder diagram (also called contact symbology) is a means of graphically representing the logic required in a relay logic system. AR1PB1PB2R1R1startemergency stopRail Rung

  • Page 25

    Ladder Representation

  • Page 26

    PLC WIRING DIAGRAM 0102202020110102031112APLCInputOutputExternal switches Stored program

  • Page 27

    SCAN begin Input Output Resolve logic Idle A PLC resolves the logic of a ladder diagram (program) rung by rung, from the top to the bottom. Usually, all the outputs are updated based on the status of the internal registers. Then the input states are checked and the corresponding input registers...

  • Page 28

    PLC INSTRUCTIONS 1) Relay, 2) Timer and counter, 3) Program control, 4) Arithmetic, 5) Data manipulation, 6) Data transfer, and 7) Others, such as sequencers.

  • Page 29

    LOGIC STATES ON : TRUE, contact closure, energize, etc. OFF: FALSE, contact open , de-energize, etc. (In the notes we use the symbol "~" to represent negation. AND and OR are logic operators. ) Do not confuse the internal relay and program with the external switch and relay. Inter...

  • Page 30


  • Page 31

    COMBINED AND & OR R1 = PB1 .OR. (PB2 .AND. PB3) PB1R1PB2pb3

  • Page 32

    RELAY A Relay consists of two parts, the coil and the contact(s). Contacts: a. Normally open -| |- b. Normally closed -|/|- c. Off-on transitional -||- d. On-off transitional -| |- Coil: a. Energize Coil -( )- b. De-energize -(/)- c. Latch -(L)- d. Unlatch -(U)- ( )

  • Page 33

    TIMERS AND COUNTERS Timers: a. Retentive on delay -(RTO)- b. Retentive off delay -(RTF)- c. Reset -(RST)- Counter: a. Counter up -(CTU)- b. Counter down -(CTD)- c. Counter reset -(CTR)- RTO counting stop counting ...

  • Page 34

    SEQUENCER Sequencers are used with machines or processes involving repeating operating cycles which can be segmented into steps. Output Step A B C Dwell time 1 ON OFF OFF 5 sec. 2 ...

  • Page 35

    Rockwell/ Allen Bradley PLC I/O points are numbered, they correspond to the I/O slot on the PLC. For A-B controller used in our lab I/O uses 1-32 Internal relays use 033 - 098 Internal timers/counters/sequencers use 901-932 Status 951-982

  • Page 36

    Programming a PLC Oil is consumed randomly. The tank needs to be refilled by turning on a pump. Two hydrostatic switches are used to detect a high and low level.

  • Page 37

    Ladder Logic for Tank

  • Page 38

    Logic for Ladder Solution

  • Page 39

    How does it work?

  • Page 40

    PROGRAMMING EXAMPLE 1 PartmicroswitchBar code readerStopperConveyorMachineRobotid description state explanation MSI microswitch 1 part arrive R1 output to bar code reader 1 scan the part C1 input from bar code reader 1 right part R2 output robot 1 loading cycle R3 output robot 1 unlo...

  • Page 41

    SOLUTION 01020304051112131415InputOutputProgrammable Controller PLCMS1C1C2C3C4R1R2R3R4011411021404031412130503Rung 1. If part arrives and no part is stopped, trigger the bar code reader. Rung 2. If it is a right part, activate the stopper. Rung 3. If the stopper is up, the machine is...

  • Page 42

  • Page 43

  • Page 44

  • Page 45

  • Page 46

    EXAMPLE 2 TRAFFIC LIGHTS Cycle time Street Red Yellow Green Main 3 1 4 Jefferson 5 1 2 Main street Jefferson street

  • Page 47

    WIRING DIAGRAM 646566677071Programmable ControllerinputoutputJefferson RedJefferson YellowJefferson GreenMain GreenMain YellowMain Red

  • Page 48

    PROGRAM (1) RUNG1RUNG2RUNG3RUNG4RUNG5RUNG6RUNG7RUNG8RUNG9 RUNG10 RUNG11 RUNG1220 67RTO 903 66RTO90180RTO90230 901 902 67M. Red 901 903 66J. Green 902 904 71M. Green 904 905 70M. YellowRSTRST901904RTO 9044071RST901903RST901902901901

  • Page 49

    PROGRAM (2) RUNG13 64RTO90750 65RTO90610 70RTO90510903 906 65J. Yellow 902 64 907J. RedRST901907RST901906RST901905 RUNG14 RUNG15 RUNG16 RUNG17 RUNG18 RUNG19 RUNG 20