Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction To Programmable Logic Controllers

Similar presentations

Presentation on theme: "Introduction To Programmable Logic Controllers"— Presentation transcript:

1 Introduction To Programmable Logic Controllers
[Greetings], this is an introduction to programmable logic controllers - PLCs for short . Here is a picture of a simple one. A programmable logic controller is unit of hardware used to control and automate an industrial processes. They were initially designed to replace hardwired relay-based controls. Nowadays they can even perform PID control action. PLCs are used to solve control problems from simple to complex and over the last 20 years have been very popular in industry. A controls engineer’s responsibilities may be designing PLC systems and troubleshooting and enhancing functionality after installation. -----other notes This picture was taken from here:

2 The concept: a machine that can be started from two remote places
This sketch is the initial concept for a very common situation – an electric machine that can be started and stopped from two separate locations. In this case the machine is …. You may add safety features and interlocking options (e.g., option to prevent remote shutdown) and the logic can become quite complicated -… The diagram shows inputs (push buttons), outputs (the voltages applied to the machine) and a logic – which in thos case it is implemented through the wiring. These are the essential components in a PLC

3 Inputs Program Outputs
Here are three main aspect of a programmable logic controller or PLC. Inputs, outputs and the control program. The inputs are connected to sensor devices that inform the PLC about the environment. The program uses a set of logical instructions that drives the outputs based on the inputs. The outputs are connected to equipment needs to be controlled. Outputs

4 Inputs and Outputs Devices
Push Buttons Proximity switches Photoelectric sensors Temperature sensors Pressure sensors Motors Solenoids Indicator lamps Resistive loads Contactors Some example Input devices for a PLC or Programmable Logic Controllers are push buttons, proximity switches, photoelectric sensors, temperature sensors, etc. Anything that can measure the environment and then transmit a signal to the PLCs input. PLC outputs are anything that would need to be controlled based on the inputs like motors, indicator lights, fans or heating elements. PLCs come in a variety of flavors… Picture sources: Push button Photo sensor Pressure sensor Motor Push button Photo Sensor Pressure Sensor Motor

5 Relays - + A relay is a device that responds to a voltage change by activating a switch. When the input is energized with a voltage a current will flow thought the coil and cause it to become magnetized. Magnetic force will pull the contact close and thus close the circuit. When the input voltage taken away the magnet will de-actiave and the contact will open again. A relay and a contactor basically serve the same function. The name contactor is simply used for high current. + -

6 Programmable Logic Controllers
Box Type Modular or Rack Type Here we show two common types of Programmable Logic Controllers or PLCs a single box type and a modular or rack type. The box type is smaller and used for simpler control situations. It is supplied as an stand alone package that is ready for implementation. That is a box type PLC has everything it needs to control a process. Some of the most basic of theses only have 4 outputs. They typically can have from 4 to 40 inputs and outputs. Depending on size and functionality they can cost between $100 and $1000. The modular type consists of a central rack that house various modules such as power supply, processor, analog or digital input and outputs and communications, and special function modules. The modules are selected based on the control problem. I/O modules can always be added after the unit it installed to suit new needs and the I/O modules can be much more specialized than that of the box type PLCs. It is used for larger and more complex operations. Typically has from 20 to 100 inputs and outputs and up. These units typically start at $500 and can get pretty expensive ---other notes--- Box type picture is from The rack type picture is from

7 Typical PLC Applications
Coin-Operated Carwash Conveyor Diverter Control Greenhouse Irrigation Lumber Mill Operation Oil recovery systems Here some examples of what PLCs are used for. They are implemented in a variety of control operations from large to small. Carwashes are a popular use for PLCs because it involves intricate use sensors and motors, but also has the need for relatively complex logic. Carwashes have several wash types that use or doesn’t use certain features. It is often a unique and involved process, but it is greatly simplified when done in the PLCs software as opposed to a hardware implementation. PLCs are used for sorting packages on a conveyor by operating a diverter. One conveyor can move many types of packages. A sensor can detect a package type and a series of diverters can sort them at the end of the belt. In this way, one conveyor can be used instead of many. But the PLC is flexible, it can be reprogrammed if and when the sorting task changes or if enhanced operation is needed. PLCs are used to operate greenhouse irrigations systems. It can be used to control how often and the amount of water distributed to certain areas. It can control a large amount of valves to certain areas and is flexible as the greenhouse’s needs change. Lumber mills use PLCs to control the main saw and loading of wood while various sensors ensure safe operation so that people and equipment are not harmed. A lumber mill saw is very expensive and many precautions must be taken to ensure that nothing goes wrong when moving lumber through the mill. PLCs can withstand the hash condition desert conditions while controlling an oil recovery process. Temperatures can get higher than 120 degrees Fahrenheit in the desert, yet a plc can read sensors and control the motors necessary for oil extraction. These tiny computers are meant to be rugged. ----other notes---- I think I need add some pictures here -----other notes Ideas taken from [36] A store's automatic sliding doors are controlled during both business and off-hours using Pico. The store also uses Pico to allow off-hour access to employees only. A self-service, coin- operated carwash needs to count the number of quarters inserted, as well as time the wash cycle per car. A Pico controller is programmed to do both.

8 Three Phase Converter A machine requires three phase power to operate but only two phase power is available. A power converter must be built using a three phase converter. Often industrial equipment will use three phase power for various reasons such as cost, size and durability. Suppose some industrial woodworking equipment is installed at a residential home. In order to use the equipment, the normal two phase power into the house needs to be converted into three phase power via a converter. Some of the equipment is located in the garage and some in the basement. The three phase power needs to be available at both locations. Consequently, the converter needs to be able to be activated and deactivated from both locations. Other Notes Source: Picture of converter: Three phase converter

9 The power is switched on
Converter Operation 220 VAC The power is switched on To start the converter’s motor the push button is held for 1 to 2 seconds Power On/Off Switch Momentary push button The converter has three contacts. Two are connected to the 220 VAC source. The other is connected to a starting capacitor and a push button. When the power is switched on nothing immediately happens. The 3-phase converter has a motor that needs to be started via a starting capacitor. After the motor has started only the 220 VAC source is required for continued operation. When 3-phase power is no longer needed, the process is stopped by disconnecting power. However this is just the basic concept of operation. The process should simply have one button for start and one button for stop at each location. This means that a timed relay will take the place of the momentary push button, and a relay latching system is need instead of a the power switch. In this way, the system can operate using push buttons. Starting capacitor 3-Phase converter

10 3-Phase Converter Remote Lamp Remote Stop 2-Pole Contactor Stop
Remote Start Here is a block diagram that shows the manner in which each device is connected to each other. Hopefully the wiring looks a little confusing. The blocks in yellow represent ‘Relay logic’. The light blue are output devices. The wiring would be much simpler with a PLC. Start Relay Timer Relay 1-Pole Contactor Start

11 3-Phase Converter Here is the main control box for the converter with the components labeled. This is how the control mechanism is put together without a PLC. The switch and momentary push button have been replaced with start and stop buttons. Logical operation is supplied by the start relay and a time delay relay.

12 3-Phase Converter PLC 2-Pole Start Contactor Remote Start 1-Pole
Stop Remote Lamp Remote Stop This is the wiring schematic with a PLC. When using a PLC wiring becomes very simple and this helps avoid problems. The inputs are on the left and the output are on the right. Notice how the PLC took the place of two relays, the start relay and the timed relays. By replacing these two components the PLC has already almost paid for itself. And each panel is much simpler One thing that is missing is the program that the PLC must run to control the process correctly. At each point, an input and output are connected to the PLC there is an address. This address is used in the software to keep track of the different devices. Other Notes Timer relay- $47.85 at The allen bradley model is more expensive~ $75 Run relay

13 Example: Process Safety Pressure Emergency Release
Sensor 10 Second Timer Solenoid Pressure Release Valve Counter Suppose there is a process where there could be a pressure build up. A solenoid is powered to keep a valve shut. Every time a pressure sensor is tripped a solenoid is de-activated for 10 seconds that in turn allows a the valve to open and the pressure to be released. After 10 seconds, power is restored to the solenoid and the valve is closed. (A solenoid is another type of relay.) Also suppose that the process needs to count how many times the solenoid is de-activated. Without a PLC the process would follow this diagram. The pressure sensor would feed information in a timer and a counter (two separate unites of hardware). But what if the process included 10 sensors and 10 solenoids? We’d need 10 timers and 10 counters. That’s a lot of hardware. And if an manual release button and other safety sensors were also needed, the situation can become complex and involve a large amount of hardware. If any one unit failed the whole system would have to be shut down, the fault found and then fixed. Before PLCs, however, this is how it was done.

14 Example Process Sensors, Emergency Shut off Solenoids PLC
(programmable logic controller) Instead of a large amount of devices and the resulting complicated wiring, one piece of hardware, a PLC can take the place of all 20 the timers and counters. It can implement all the necessary logic within its programming. And if the PLC breaks, it is easily replaced.

15 The logic implementd through wiring is now a program inside the PLC
A PLC replaces the wiring between input and output devices. Instead of being wired together, all equipment is wired to the PLC. The logic implementd through wiring is now a program inside the PLC All Input Devices All Output Devices PLC PLCs replace all the wiring and individual pieces of hardware like counters, timers and relays. Before PLCs were used the wiring, configuring and troubleshooting all these components would often get very complicated. With a PLC, all wiring is done in software. This adds an additional benefit were if a change needed to be made, no disconnecting of hardware would be required. No one would have to disconnect wires and move around hardware. That can be very time consuming and tedious. Only the PLC’s program would need to be updated and then loaded into the PLC’s memory. -----other notes This point was taken from [30]

16 Programmable Logic Controllers
PLCs (Programmable Logic Controllers) is a miniature industrial computer performs control functions [4] The first PLCs can be traced back to 1968 and became popular in the 1980’s [4] PLCs are rugged and designed to withstand the industrial environment. So in essence, a PLC is a special microprocessor based controller. It has programmable memory that is used to store a program that instructs the PLC on how to control machines or processes. PLCs were invented to replace relay logic hardware. The PLCs program is where this replacement occurs. The PLC was first developed in 1968 and by 1980 was very popular for industrial control. Now if there is industry there are probably PLCs present. Even though PLCs are computers, they are extremely rugged. They are designed to withstand harsh conditions such as vibrations, high temperature, humidity and noise.

17 Components of a PLC Inputs CPU Memory Outputs Inputs CPU Memory
PLC has four major internal components. The CPU which contains the microprocessor, registers, control clock and various other processing units. The memory contains user’s program, program data storage and PLCs operating system. And the input and outputs provides the interface between the system and the outside world. [52] Outputs

18 PLC Inputs and Outputs Analog, Discrete or Digital
Optoisolator Analog, Discrete or Digital Protected by Optoisolators Sourcing and Sinking Communications The inputs and outputs on a PLC can be analog, discrete or digital depending on the specific PLCs and what features it possesses. Common input and outputs voltages are 12 to 24 volts DC, 120 volts AC and 5 volts for TTL logic devices. The PLCs CPU is protected by Optoisolators. That is it is electrically isolated from its inputs and outputs. The Optoisolators uses a LED and photo sensor to convey voltage information. This way if there is a large voltage spike, the PLC and its CPU will not be damaged. TheDC inputs and outputs on a PLC are always specified as sinking or sourcing. An input or output said to be sourcing when it uses a PLC as its power source. An input or output said to be sinking when it provides its own power that produces current thought the PLC. Quite often, sinking inputs are used for sensors and sourcing outputs are used for loads. Some PLC haves communications inputs and outputs. This can be serial or parallel cables or even the ability to communicate on an Ethernet. Is useful in large controls situations where many PLCs in remote locations are controlled by one master PLC.

19 PLC Operation Scanning is the process of running the PLC program
Cycle time is the total time for one loop. Check Input Status Execute Program A PLC works by continuously running a program that checks the inputs and then updates the outputs. First the inputs are checked and saved. The program is executed using the saved inputs values. Output states are updated. The process of the PLC running thought its program is called scanning. The total time for a PLC to complete one loop is called cycle time. Typical scanning times are from 10ms to 100ms. Update Output Status

20 PLC Programming Ladder logic is the main programming method used for PLCs [39] It is a visual and symbolic programming language that resembles relays logic diagrams Ladder logic has been developed to mimic relay logic to reduce amount of retraining needed for engineers and trades people [39] PLC programming is called ladder logic. It’s not the usual type of programming you may have seen before such as BASIC, C or assembly. It is a graphical programming language that uses graphical symbols to provide the PLC with the logical instructions needed to perform control operations. Learning how to use and implement PLCs is basically learning ladder logic. When PLCs first arrived they were made to replace relay hardware. It was preferred that a minimum about of retraining would be necessary for the engineers and trades people to operate and implement the PLCs. As a result ladder logic was developed to mimic relay logic. Ladder logic programs resemble relay logic schematics.

21 Ladder Logic Compare a circuits diagram to a ladder logic diagram
Button Compare a circuits diagram to a ladder logic diagram Relay 24 V DC Input Motor Let’s start the introduction to ladder logic by comparing it to a circuit diagram. Here is a simple circuit for operating an electric motor. When the button is pushed the circuit will close causing the relay to close and the motor to run. When the button is released the circuit will open and the motor will stop. Below is the same operation in ladder logic. Power is said to flow from the left power rail to the right rail. The ladder logic is the program inside the PLC. However, ladder logic is not a circuits schematic and ladder logic doesn’t show the relative positions of components to each other as a circuits diagram does. An important distinction is that a ladder logic program is a set of logical instructions and not a way to physically connect components. Button Motor Power Rails

22 Ladder Logic Rung 1 Rung 2 Rung 3 Rung 4 Power Rails
Ladder logic is so named because the diagram looks like a ladder. Each step in the program is called a rung. The vertical lines on the left and right are the power rails. Each rung defines one operation in the control process. The ladder diagram is read from left to right and from top to bottom. Each rung starts with one or more inputs and ends with at lease one output. Power Rails

23 Ladder Logic Ladder logic uses a variety of programming symbols
Power always flows from left to right Output devices are in the ON state if power flows through them Power rails Normally Closed Contact Normally Open Contact There are quite a few manufacturers of PLCs. Each has its own brand of ladder logic programming. Though they are all very similar and if you can program in one manufacture’s ladder logic language it is easy to use them all. Here are a few standard symbols. The power rails, the open and closed contact and the output device. Power is always said to flow from left to right. Power flows though an open or closed contact depending on input conditions. And if power can get to an output device it turns on. Contacts are always on the left side of the ladder and output devices are always on the right side. The contacts and the output device can either be real input and output connections on the PLCs or they can be special functions in the ladder program. Output Device or Coil

24 Contacts Power flows when the input device is on
Contact programmed normally open Power flows when the input device is off A contact is assigned to a device that is part of the control process. It always follows the state of the device it is assigned too. It can be assigned to a input, an output or even a variable in the PLCs memory. A contact’s assigned device can be a push button, a temperature sensor, a motor or even an bit marker or counter that only exists in the PLCs memory. Power only flows through a normally open contact when the device assigned to the contact is in its ON state. Power only flows through a normally closed contact when the device assigned to the contact is in its OFF state Contact programmed normally closed

25 Lamp for power not applied
Ladder Logic Button Motor Motor output Contacts Motor Off lamp Lamp for power not applied So here is the first example. Consider a motor operated by a button. For as long as the button is held down the motor will be on. When the motor is on an on light must be on. When the motor is off the off light must be on. Here is an example of how contacts can follow the state of an input or output device. The contact labeled button follows the state of a button wired to the PLC. The contact labeled Motor follows the state of the Motor output device. Motor On lamp Lamp for power applied

26 Ladder Logic Latching is the term for a self-maintaining circuit.
Start button Stop button Motor Latching is the term for a self-maintaining circuit. Motor Sometime you need a machine to keep running even after the start button has stopped being depressed. This is latching when needed. When the start button is closed the motor will turn on. The contact labeled motor will follow the state of the output device labeled motor. So by pressing the start button the Motor contact will also activated. When the start button is released, the motor will stay active because of the motor contact on the lower rung will still be in the on state. The stop button must be used to turn the motor off by causing it’s contact to open.

27 PLC ladder logic program
Pressure emergency release Pressure sensor Timer PLC ladder logic program Counter Timer Solenoid Wiring diagram for PLC From the earlier example, here is a very simple ladder logic program and its wiring schematic. A wiring diagram is always needed because the PLC program isn’t a wiring schematic and lacks the information about sensors are wired . Ladder logic looks much like a schematic of physical components but remember it’s just a graphical program. It is desired that when the pressure is too high the pressure sensor is tripped. The PLC detects this and deactivates the solenoids for 10 seconds to open the release valve. Also a count of the event is made. When the pressure is high enough, the sensor will close the contacts and form an electrical connection. Current will flow from the PLC to the ground and this will inform the PLC that the sensor is in it’s ON state. Since the sensor is programmed as normally open according to the programming, power only flows when its assigned device is in its ON state. Once the sensor it in the ON state, the counter will increase and the timer will turn on. The timer will remain in the ON state for 10 seconds regardless of the state of the Pressure Sensor contact. The timer contact is programmed as normally closed, therefore when the output Timer is ON, the timer contact will de-activate. This will cause the Solenoid to de-activate and the pressure release valve will open. Pressure sensor Solenoid - + + - PLC

28 Wiring diagram for PLC - + - + - + - + PLC Pressure Sensor
Safety Sensor Solenoid - + - + PLC As before a Manual shut off can be added to the system as well as a safety sensor. Here is the wiring schematic for the PLC. Notice that the safety sensor and manual shut off are wired such that they are usually in a ON state. When these two devices are activated they cause on open and the PLC detects that these devices are in the OFF state. This is so if there is any problem with these input devices it is more likely that they will fail open and thus de-activate the solenoid and venting pressure. And of course as before the process can become large if more sensor and solenoids were required. The PLC program would have to be repeated for each sensor-solenoid pair and more input and output device would be wired to the PLC. Manual shut off - +

29 PLC ladder logic program
Sensor Timer Counter Safety sensor Manual shut off Timer Solenoid Notice that the manual release and safety sensor are programmed as normally open. This is so if there is any problem with the system or the safety sensor or shut off the solenoid will lose power and the pressure release valve will open causing the process to fail safe. Ladder logic is always draw in the way the device is preferred to fail. Here if the Safety Sensor or Manual shut off components fail or if the PLC fails the Solenoid will be de-activated. This is the safest way for the process to fail because the pressure value will open if there is any problem.

30 Industrial Mixer Filled with liquid Heated Mix for 10 minutes.
As an example, consider an industrial mixer a where a drum is to be filled with liquid. After it is full, a heater is used to heat the liquid until it reaches a certain temperature. Then the drum is to rotated for 10 minutes, then the process stops. Picture from:

31 Sequential Function Chart
State 1 Fill with liquid Level full switch State 2 Heat Temperature Switch Here is the SFC for this process. SFC are useful when the control process involves a series of steps. The process stays in the current state until a condition is satisfied. State 3 Rotate Timer

32 1 1 2 2 PLC 3 3 Start button Pump Level full floater Heater
Mixing Motor Temperature sensor Here is the wiring diagram for the mixer. As always all the inputs and output are wired directly to the PLC. The operating logic is all stored in the PLC as a ladder logic program. So based on the inputs of the start button, the Level full floater and the Temperature sensor the PLC will decide when to turn on the Pump, heater and motor. 3 3

33 State 1 State 2 Level full floater Start button Pump Pump
Temperature Sensor Heater State 2 Here is the ladder logic for the pump and the heater. Once the start button is pressed the pump will stay on until the liquid is at the required level. This is done through latching with the Pump contact. When the floater is activated, it will stop the pump at the required level. Once the level switch is active the pump will be shut off and the heater will be activated. The liquid will be heated until the temperature switch is triggered. There the heater is latched so even if the liquid level goes down it will still be heated until the required temperate is reached. The Temperature reached contact is not assigned to an input or output of the PLC. But instead to an internal output device that only exists in the PLCs memory.

34 State 3 Temperature Sensor 10 minute Timer 10 minute Timer
Mixing motor There is the continuation of the ladder logic program. In total it has four rungs. Here you can see at the top, that once the Temperature sensor is tripped it will activate the Temperature reached output device. This device only exists in the PLCs memory and acts as a variable. Once active it latches its self to the on state. This insures that the timer is only activated once and the heater doesn’t turn back on if the liquid cools. Once the timer is activated it will cause the 10 minutes timer contact to close and the mixing motor to turn on. The motor will operate for 10 minutes and then stop.

35 Ladder Logic Forcing Time checks Simulation Software testing
Since Ladder logic is essentially a computer program it is subject to bugs and faults. Therefore any program needs to be tested for accuracy and robustness. One method of testing is called forcing. This is where input states are forced to certain states in software. Programming errors can sometimes be found by forcing inputs at various stages in the ladder program. Time checks can also be built into the ladder logic program. This is where additional ladder rungs might be includes so that when a function starts a timer is started. If the function does not complete when the timer finishes a fault is signaled. The function might be the moving of a piston or filling a drum with liquid. Many PLCs have a simulate mode where the installed program can be run and inputs and outputs simulated so that they can be checked. PLC ladder logic software can test against programming syntax errors.

36 Ladder Logic Registers and bits Data comparison Arithmetic operations
Functions PID control Ladder logic can do much more than what has been shown so far. It can utilize registers and bits to store and move data. There are data comparison function such as checking for equal to, less than or greater than. There are arithmetic operations such as addition, subtraction and multiplication. There are functions that can transform number to different bases or formats. Some PLCs can provide PID (proportional integral derivative) calculations to control a variable simply by being provided the necessary parameters.

37 PLCs solve problems Flexible Cost effective Computational abilities
Trouble shooting Reliable At this point you should realize how PLCs can solve many problems in industry. PLCS are flexible and can be reapplied to control other systems quickly and easily. They are cost effective for controlling complex systems. They posses high computational abilities that allow more sophisticated control through ladder logic. Trouble shooting aids make programming easier and reduce downtime. Reliable components make PLCs likely to operate for years before failure. [1] You should also realize that right now, if you had a PLC and a enough ladder logic knowledge you could construct a sophisticated machine with little problem as far as operational logic is concerned.

38 Questions?

Download ppt "Introduction To Programmable Logic Controllers"

Similar presentations

Ads by Google