Ias 3
Ias 3
Figure 1 PLC
Introduction
PLC Background
A programmable logic controller is unit of hardware used to control and automate
industrial processes. Programmable Logic Controllers (PLCs) are often defined as miniature
industrial computers that contain hardware and software that is used to perform control
functions. The first PLC was developed to help General Motors eliminate traditional relay-based
machine control systems. In large applications where thousands of relays exist, wiring and
troubleshooting could be quite complicated.
In 1968 Bedford Associates, a company in Bedford, MA, developed a device called a
Modular Digital Controller for General Motors. The MODICON, as it was known, was an
electronic device, not a mechanical one, it was perfect for GM's requirements, as well as for
many other manufacturers and users of control equipment. With less wiring, simpler
troubleshooting, and easy programming, PLC technology caught on quickly.
There are two basic types of Programmable Logic Controllers: 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 integral compact package, compete with power supply, processor, memory and
input output units. Some of the most
basic of theses only have 4 outputs.
They typically can have from 4 to
40 inputs and outputs. Box types
PLCs have limited expansion
capabilities.
Control processes need devices to monitor events or measure needed values. These
devices are generically called inputs to the PLC. For example, input devices can be proximity
switches, photoelectric sensors, temperature sensors, push buttons, or pressure sensors. An input
is anything that can sense the status of the environment and then convert that information in to a
signal. Often the signal can simply be a voltage that is either on or off. Outputs are anything that
would need to be controlled based on the inputs like motors, indicator lights, and fans, warning
sirens or heating elements.
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. Therefore, the three phase power needs to be available at both
locations. Consequently, the converter needs to have start and stop controls at both locations.
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 only 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.
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-activate 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.
Below is a picture of the main control box for the converter with the components labeled.
This is how the control mechanism is put together without a PLC. The power switch and
momentary push button have been replaced with start and stop buttons. The operational logic is
performed by the start relay and a time delay relay.
Below is a block diagram that shows the manner in which each device is connected to
each other. The wiring should look a little complex and confusing. The blocks in yellow
represent ‘Relay logic’. The light blue blocks are output devices. The wiring would be much
simpler with a PLC. The 2-pole contactor controls the power supply to the converter. The 1-pole
contactor controls the starting capacitor. The Remote lamp is a indicator light at the remote
location. When lit it indicate that the converter is operating
Below is a schematic of how devices would be connected if a PLC was used for control.
Note how simple the wiring becomes. When using a PLC, physical wiring poses much less
difficulty. Consequently, this helps avoid problems and speeds installation. The inputs are on the
left and the outputs are on the right. Notice how the PLC took the place of two relays, the start
relay and the timed relay. By replacing these two components the PLC has already almost paid
for itself. Furthermore, by using a PLC additional timers, relays and other devices can be added
for logical control at no cost.
One aspect that is not shown here 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.
PLC Process Example
Suppose there is a process where there is 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 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 the diagram above. 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 large
amount of hardware that takes up room on the factory floor. Moreover, if a 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.
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 timers and counters. It can simulate all the
necessary logic within its programming. And if the PLC breaks, it is easily replaced.
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 where it is drawn clearly
and much easier to understand. This adds an additional benefit were if a change was 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.
PLCs are implemented in a variety of control operations from large to small. Carwashes
are a popular use for PLCs because it involves intricate use of 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. Each car wash can be a very unique and involved process, but it is greatly
simplified when done in the PLC’s 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.
There are many trade-offs when deciding which type of input cards to use.
Outputs are often specified as being of relay type, transistor type or triac type. With relay
type, the signal from the PLC output is used to operate a relay and so is able to switch currents of
the order of a few amperes in an external circuit. Relay outputs are suitable for AC and DC
switching. They can withstand high surge currents and voltage transients. The transistor type of
output uses a transistor to switch current through the external circuit. This gives a considerable
faster switching action. Triac outputs can be used to control external loads which are connected
to the AC power supply. It is strictly for AC. operation.
Typical output voltages are listed below, and roughly ordered by popularity:
120 Vac
24 Vdc
12-48 Vac
12-48 Vdc
5Vdc (TTL)
230 Vac
The terms sourcing and sinking are used to describe the way in which DC devices are
connected to a PLC. An input or output said to be sourcing when it uses a PLC as its power
source. PLCs often provide power for the output devices connected to it. An input or output said
to be sinking when it provides its own power for operation. Often sensors are used as sinking
inputs. When discussing sourcing and sinking we are usually referring to the output of the sensor
that is acting like a switch. In fact, the output of the sensor is normally a transistor that will act
like a switch (with some voltage loss). A PNP transistor is used for the sourcing output, and an
NPN transistor is used for the sinking input. When discussing these sensors the term sourcing is
often interchanged with PNP, and sinking with NPN.
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.
PLC Programming
Programming Introduction
The main method for PLC programming is called ladder logic. It’s not the usual type of
programming 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.
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 and cause
the relay to activate to the motor. When the button is released, the
circuit will open and the motor will stop. In the lower part of the
figure is the same operation in ladder logic. Power is said to flow
from the left power rail to the right rail. This small diagram is
actually a very small ladder logic program where ‘Button’ is
assigned a PLCs input and ‘Motor’ is assigned to the PLCs output.
It is important to note that ladder logic is not a circuit’s schematic and ladder logic does not 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.
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. A contact is assigned to a device
that is part of the control process through an address. It always follows the state of the device it is
assigned too. It can be assigned to an 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 a bit
marker or counter that only exists in the PLCs memory.
When programming in ladder logic, the syntax for the address of contacts and output
devices depends on the particular brand of ladder logic being used. In the figure bellow are some
example of addressing schemes for various PLC brands and models. Further examples will
either use words for addresses or the Siemens (b) addressing scheme where ‘I’ are used for
inputs and ‘Q’ are used for outputs.
A contact is assigned to either an input of the PLC or some other element that is part of
the control program. A contact always follows the state of the device it is assigned to. It can be
assigned to an input, an output or even a variable in the PLCs memory. For example, a contact’s
assigned device can be a push button, a temperature sensor, a motor or even a 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.
As an 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 off a lamp indicating that the motor is off must be
lit. When the motor is on, an on light must be activated. This is an example of how contacts can
follow the state of an input as well as an 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.
In the ladder logic, the ‘I1’ is the address to the input 1 on the PLC. ‘Q1’, ‘Q2’, ‘Q3’ are
the addresses to output 1, 2, 3, respectively. The words below each element such as ‘motor’ or
‘on lamp’ are comments and only on function to explain the diagram.
Basic Logic
Below is a ladder logic rung called a seal-in-circuit. When A is activated it will cause the
output B to turn on. B will remain on regardless of any further input, thus it is “sealed-in”.
Sometimes you need a machine to keep running even after the start button has stopped
being depressed. This required a method called latching. Consider a PLC with two buttons wired
to its inputs and a motor wired to on of its outputs. If the PLC is programmed with the ladder
logic in the figure on the right it will work as
follows. When the start button is pressed the
motor will turn on and will stay on if the
button is released. The contact labeled motor
will follow the state of the output device
labeled motor. Therefore by pressing the start
button, the Motor contact will also activate. 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 its contact to open. This is very similar to a
seal-in-circuit but with the additional option of deactivating the circuit. Note that if both buttons
are pressed simultaneously the motor will not turn on.
Latching an also be done by using
more advanced ladder logic commands.
The figure to the right is a ladder logic
program that uses the set and reset
commands to achieve latching. This
ladder logic is equivalent to the previous
figure. When the on button is press it will
all power flow through the motor device with the ‘S’ in the center. The ‘S’ stands for set. This
will cause the motor to stay active unless power is allowed to flow though the motor device with
the ‘R’ in the center. The ‘R’ stands for reset. As before, in the event that both buttons are
pressed simultaneously the motor will not be active.
There are many control situations requiring outputs to be activated based on certain
conditions. For example a conveyor belt may only need to be run if it is loaded AND there is
capacity to receive its load at the end of the belt. This is an example when a logic AND is
needed. The truth table and the ladder logic for an AND gate is below. A and B are the inputs
and X is the output. The truth table is a method for showing all possible outputs based on any
possible inputs.
AND Gate
Other gates such as OR, NOT and XOR can also be constructed. Using these Boolean
algebra can be calculated in ladder logic.
OR Gate
NOT Gate
XOR Gate
The following figure shows a conveyor belt that can be activated electrically. There are
two push button switches at the beginning of the belt: S1 for START and S2 for STOP. There are
also two push button switches at the end of the belt: S3 for START and S4 for STOP. It is
possible to start or stop the belt from either end.
Also, sensor S5 stops the belt when an item on the belt reaches the end.
The following is the ladder logic need to control the belt from either end. The ladder logic is in
shorthand notation where the right power rail is implied but not drawn. The two ladder logic
sections can be joined together for the complete program. Notice OR gates are being used.