plc_intro.pdf

(220 KB) Pobierz
plcs.book(plc_intro.fm)
5
2. PROGRAMMABLE LOGIC CONTROLLERS
Topics:
• PLC History
• Ladder Logic and Relays
• PLC Programming
• PLC Operation
• An Example
Objectives:
• Know general PLC issues
• To be able to write simple ladder logic programs
• Understand the operation of a PLC
2.1 INTRODUCTION
Control engineering has evolved over time. In the past humans were the main method for con-
trolling a system. More recently electricity has been used for control and early electrical control was
based on relays. These relays allow power to be switched on and off without a mechanical switch. It is
common to use relays to make simple logical control decisions. The development of low cost computer
has brought the most recent revolution, the Programmable Logic Controller (PLC). The advent of the
PLC began in the 1970s, and has become the most common choice for manufacturing controls.
PLCs have been gaining popularity on the factory floor and will probably remain predominant
for some time to come. Most of this is because of the advantages they offer.
• Cost effective for controlling complex systems.
• Flexible and can be reapplied to control other systems quickly and easily.
• Computational abilities allow more sophisticated control.
• Trouble shooting aids make programming easier and reduce downtime.
• Reliable components make these likely to operate for years before failure.
2.1.1 Ladder Logic
Ladder logic is the main programming method used for PLCs. As mentioned before, ladder
logic has been developed to mimic relay logic. The decision to use the relay logic diagrams was a stra-
tegic one. By selecting ladder logic as the main programming method, the amount of retraining needed
for engineers and tradespeople was greatly reduced.
Modern control systems still include relays, but these are rarely used for logic. A relay is a sim-
ple device that uses a magnetic field to control a switch, as pictured in Figure 2. When a voltage is
6
applied to the input coil, the resulting current creates a magnetic field. The magnetic field pulls a metal
switch (or reed) towards it and the contacts touch, closing the switch. The contact that closes when the
coil is energized is called normally open. The normally closed contacts touch when the input coil is not
energized. Relays are normally drawn in schematic form using a circle to represent the input coil. The
output contacts are shown with two parallel lines. Normally open contacts are shown as two lines, and
will be open (non-conducting) when the input is not energized. Normally closed contacts are shown
with two lines with a diagonal line through them. When the input coil is not energized the normally
closed contacts will be closed (conducting).
input coil
OR
normally
closed
normally
open
OR
Figure 2
Simple Relay Layouts and Schematics
Relays are used to let one power source close a switch for another (often high current) power
source, while keeping them isolated. An example of a relay in a simple control application is shown in
Figure 3. In this system the first relay on the left is used as normally closed, and will allow current to
flow until a voltage is applied to the input A. The second relay is normally open and will not allow cur-
rent to flow until a voltage is applied to the input B. If current is flowing through the first two relays
671469680.030.png 671469680.031.png 671469680.032.png 671469680.033.png
7
then current will flow through the coil in the third relay, and close the switch for output C. This circuit
would normally be drawn in the ladder logic form. This can be read logically as C will be on if A is off
and B is on.
115VAC
wall plug
relay logic
input A
(normally closed)
input B
(normally open)
output C
(normally open)
A
B
C
ladder logic
Figure 3
A Simple Relay Controller
The example in Figure 3 does not show the entire control system, but only the logic. When we
consider a PLC there are inputs, outputs, and the logic. Figure 4 shows a more complete representation
of the PLC. Here there are two inputs from push buttons. We can imagine the inputs as activating 24V
DC relay coils in the PLC. This in turn drives an output relay that switches 115V AC, that will turn on a
light. Note, in actual PLCs inputs are never relays, but outputs are often relays. The ladder logic in the
PLC is actually a computer program that the user can enter and change. Notice that both of the input
push buttons are normally open, but the ladder logic inside the PLC has one normally open contact, and
one normally closed contact. Do not think that the ladder logic in the PLC needs to match the inputs or
outputs. Many beginners will get caught trying to make the ladder logic match the input types.
671469680.001.png 671469680.002.png 671469680.003.png 671469680.004.png 671469680.005.png 671469680.006.png 671469680.007.png 671469680.008.png 671469680.009.png 671469680.010.png 671469680.011.png 671469680.012.png 671469680.013.png 671469680.014.png
8
push buttons
power
supply
+24V
com.
PLC
inputs
ladder
logic
A
B
C
outputs
115Vac
light
AC power
neut.
Figure 4
A PLC Illustrated With Relays
Many relays also have multiple outputs (throws) and this allows an output relay to also be an
input simultaneously. The circuit shown in Figure 5 is an example of this, it is called a seal in circuit. In
this circuit the current can flow through either branch of the circuit, through the contacts labelled A or
B. The input B will only be on when the output B is on. If B is off, and A is energized, then B will turn
on. If B turns on then the input B will turn on, and keep output B on even if input A goes off. After B is
turned on the output B will not turn off.
671469680.015.png 671469680.016.png 671469680.017.png 671469680.018.png 671469680.019.png 671469680.020.png 671469680.021.png 671469680.022.png 671469680.023.png 671469680.024.png 671469680.025.png 671469680.026.png 671469680.027.png 671469680.028.png
9
A
B
B
Note: When A is pushed, the output B will turn on, and
the input B will also turn on and keep B on perma-
nently - until power is removed.
Note: The line on the right is being left off intentionally
and is implied in these diagrams.
Figure 5
A Seal-in Circuit
2.1.2 Programming
The first PLCs were programmed with a technique that was based on relay logic wiring sche-
matics. This eliminated the need to teach the electricians, technicians and engineers how to program a
computer - but, this method has stuck and it is the most common technique for programming PLCs
today. An example of ladder logic can be seen in Figure 6. To interpret this diagram imagine that the
power is on the vertical line on the left hand side, we call this the hot rail. On the right hand side is the
neutral rail. In the figure there are two rungs, and on each rung there are combinations of inputs (two
vertical lines) and outputs (circles). If the inputs are opened or closed in the right combination the
power can flow from the hot rail, through the inputs, to power the outputs, and finally to the neutral rail.
An input can come from a sensor, switch, or any other type of sensor. An output will be some device
outside the PLC that is switched on or off, such as lights or motors. In the top rung the contacts are nor-
mally open and normally closed. Which means if input A is on and input B is off, then power will flow
through the output and activate it. Any other combination of input values will result in the output X
being off.
671469680.029.png
Zgłoś jeśli naruszono regulamin