Sie sind auf Seite 1von 43

Introduction to Programmable Logic

Controllers

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. TheThe first PLC was developed to help General Motors eliminate
traditional relay-based machine control systems. In large applications where thousands of
realyrelays may exist, wiring and troubleshooting could be quite complicated [4].
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 [4].

A PLC has three main


aspects: the inputs and outputs and
the control program. The inputs are
connected to sensors 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 the devices
that need to be controlled. In

Figure 2

figure 2 above, the PLC has


eight inputs and four outputs.
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. [54] 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.
Box type PLCs have
limited expansion
capabilities.
The modular type consists of a central rack that house various hand picked
modules that are appropriate for each control situation. A large variety of modules exist
that satisfy many needs such as power supplies, processors, analog input and outputs,
digital input and outputs, and communications. I/O modules can always be added after
the unit it installed to suit new needs. Power supplies can be upgrade to meet new power

requirements. Also the I/O modules can be much more specialized than that of the box
type PLCs. For example, there are modules that serve as PID control or TTL logic inputs.
Modular PLCs are used for larger and more complex operations. Typically they have
from 20 to 100 inputs and outputs and up. Typical configurations of modular controllers
can cost from $500 to $10,000. The cost, however, can sometimes be much more.(weak
phrase. Can you find an upper bound?)

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, fans, warning sirens or heating elements.

Relay Control Example

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. Above is a picture of
a popular phase converter: the Phase-O-Matic. 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.

PLS relate this figure to the previous one


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.

(Should this example be deleted? Moved to appendix?)

PLC Process Example

So why are PLCs so useful? Well for example, sSuppose 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 solenoid is a magnetic switch that closes a circuit. It is often used as a 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 diagramthe 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? Wed need
10 timers and 10 counters. Thats a lota large amount of hardware that takes up room on
the factory floor. And 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 the 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 PLCs program would need to be updated and
then loaded into the PLCs memory.

Typical PLC Applications


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 doesnt use certain features. Each car wash can be a very 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 greenhouses 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. References to more application??? Yes

Basic PLC Structure


A PLC has four major internal
components. The CPU contains the
microprocessor, registers, control clock and
various other processing units. The memory
contains users program, program data storage
and PLCs operating system. Some memory is
ROM (read only memory) wish gives permanent
storage for the operations system and fixed data for the CPU. Other memory is RAM
(random access memory) which stores data for the users program and values of timers,
counters and other internal devices. Often some of the PLCs RAM has battery backups
so that if the PLCs power is unexpectedly turned off it can resume normal operation
when the power is restored by referring to the battery backed bits. The input and outputs
provides the interface between the system and the outside world. [52] The PLCs
program is stored on EEPROM (electrically erasable programmable read-only memory)
that is a permanent part of the PLC. As memory costs drop new types of memory such as
flash are being used. [1]
Inputs to, and outputs from, a PLC are necessary to monitor and control a process.
Both inputs and outputs can be categorized into two basic types: logical or continuous.

Consider the example of a light bulb. If it can only be turned on or off, it is logical
control. If the light can be dimmed to different levels, it is continuous. Continuous values
seem more intuitive, but logical values are preferred because they allow more certainty,
and simplify control. As a result most controls applications (and PLCs) use logical inputs
and outputs for most applications [1].
Here are some typical input voltage values for PLCs [1]:

12-24 Vdc
100-120 Vac
10-60 Vdc
12-24 Vac/dc
5 Vdc (TTL)
200-240 Vac
48 Vdc
24 Vac

There are many trade-offs when deciding which type of input cards to use [1].
DC voltages are usually lower and therefore safer (i.e., 12-24V).
DC inputs are very fast, AC inputs require a longer on-time. For example, a
60Hz wave may require up to 1/60sec for reasonable recognition.
DC voltages can be connected to larger variety of electrical systems.
AC signals are more immune to noise than DC, so they are suited to long
distances, and noisy (magnetic) environments.
AC power is easier and less expensive to supply to equipment.
AC signals are very common in many existing automation devices.
Outputs are often specified as being of relay type, transistor type or triac type
[52]. 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 [52]. Relay
outputs are suitable for AC. and DC switching. They can withstand high surge currents
and voltage transients [52]. The transistor type of output uses a transistor to switch
current through the external circuit. This gives a considerable faster switching action
[52]. Triac outputs can be used to control external loads which are connected to the AC
power supply. It is strictly for AC. operation [52].
Typical output voltages are listed below, and roughly ordered by popularity: [1]
120 Vac
24 Vdc
12-48 Vac

12-48 Vdc
5Vdc (TTL)
230 Vac

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. When

digital pulse passes through the


LED, a pulse of infrared radiation

is

produced [52]. This pulse is detected by the phototransistor and gives rise to a voltage in
that circuit. The gap between the LED and the phototransistor give electrical isolation
[52]. This way if there is a large voltage spike, the PLC will not be damaged.
The terms sourcing and sinking are used to describe the way in which DC devices
are connected to a PLC [52]. 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 [1]. 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 [1]. When discussing these sensors the term sourcing is often interchanged
with PNP, and sinking with NPN [1].
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.

Basic PLC Operation maybe a subsubsection


A PLC works by continuously running a
program that checks the inputs and then updates
the outputs. The process of the PLC running
thought its program is called scanning. Scanning
speed depends on the program size and execution
time. The total time for a PLC to check the inputs,
run the program and update the outputs is called
the cycle time. Typical cycle times are 10 ms to
100 ms. Every cycle the inputs are check and
saved to memory. Then the program is run using
the status of the saved inputs. After the program is done the outputs are updated and the
cycle starts again.

PLC Programming
Programming Introduction
The main method for PLC programming is called ladder logic. Its 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. Below is the relay logic diagram for the 3-phase controller. (Should I redraw
this with Autoshapes as Ive done in the PowerPoint presentation?) No. Leave it as is. It
is the perfect example of how ideas get started

Below is the ladder logic for the PLC implementation of the 3 phase converter
controller. The two diagrams have many similarities.

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.
Lets 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
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

is

Motor is assigned to the PLCs output. It is important to note that ladder logic is not a
circuits 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.

Terms and Symbols


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.
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
manufactures 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. 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 contacts 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 contacts 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.

The example above was written using PicoSoft, a Microsoft Windows ladder logic
development tool by Allen-Bradley. This specific software was made for a brand of PLCs
called Pico Controller. PicoSoft is a free tool that can be used to write and simulate ladder
logic. PicoSoft can be found at http://www.ab.com/plclogic/pico/picosoft.html. 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
game 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.

Internal Relays
Relay logic was so named because instead of relays being used for remote
switching of large current devices, they were used for logical operations. A PLC replaces
these logical relays with internal relays that exist only in the PLC software. A variety of
other terms are often used to describe these elements, e.g. auxiliary relays, markers,
flags, coils, bit storage [24]. In the Allen Bradley Pico Controllers, the term marker is
used and its address uses the notation M1, M2, etc. Internal relays addressed differently
to distinguish them from external relays or any other element in the ladder logic program.

Consider the ladder logic program below. A system is to activated when two
different sets of input conditions are realized. This could be programmed as an AND
logic gate system; however, if a
number of inputs have to be
checked in order that each of the
inputs conditions can be realized,

it

may be simpler to use an internal


relay. Also if the result of M1
needs to be used more than once
in the ladder program, an internal
relays would be more succinct.
Internal relays can also be used with the set and reset commands.
If the power supply is cut off from a PLC while it is being used, all the output
relays and internal relays will be turned off. Thus when power is restored, all the
contacts associated with those relays will be set differently from when the power was on.
Thus, if the PLC was in the middle of some sequence of controls action, it would resume
at a different point in the sequence. To overcome this problem, some internal relays have
battery back-up so that they can be used in circuits to ensure a safe shutdown of plant in
the even of a power failure and so enable it to restart in an appropriate manner. Such
battery-backed relays retain tier state of activation, even when the power supply of off.
The relays is said to have been made retentive. Such a feature on a PLC will be in its
documentation where it will specify that battery backed internal relays lie in a certain
address range, i.e. M10-M15, etc [24].
The following figure shows a conveyor belt that is equipped with two
photoelectric barriers (PEB1 and PEB2) that are designed to detect the direction in which
a package is moving on the belt. Each photoelectric light barrier functions like a normally
open contact.

Timers
As part of its CPU, a PLC has a control clock that can be used to time events and
deliver output when certain timer parameters are met. The timers can be represented in
ladder logic as output devices with corresponding contacts or as block functions. Notice
that the ladder logic programs on the left and rightbelow are them same perform the same

function. The left one uses output devices or coils and the right one uses block functions.
The exactly style of timer will depend on the manufacturer and brand of the PLC that the
ladder logic development program is used for.

In PicoSoft, the output device and contact method is employed. There are many
types of timers for PLCs. The two most basic types are the on-delay and the off-delay
timer. With an on-delay timer, once the timer coil gains power, its corresponding contact
will not turn on immediately. Instead a timer will start and once it is complete only then
will the timer contact be in its active state. Anytime the timer coil looses power, the timer
is reset and the timer contact also loose power.
For example,
consider a motor control
process where a motor is
controlled by a button, but
the motor only starts after a
warning siren has sounded
for 5 seconds.when a

button is pressed and held a 5 second on-delay timer will start. 5 seconds later the motor
will then activate. As soon asAny time the button is released the motor will stop. The
ladder logic for this operation is below. An on-delay timer is used because it delays motor
from turning on.

An off-delay timer works


by delaying the deactivation of a
device. Consider a motor that is
activated by a button. While the
button is held the motor starts
immediately and runs until the
button is released,. when it is
released the motor stops. It is
required that two lamps
indicating the status of the motor
be lit. However it takes a few
seconds for the motor to stop
spinning so the on lamp should
remain lit for a set amount of time after the button is released. One lamp indicates the
motor is off, the other indicates it is on. However, when the button is released the motor

still spins for a few seconds. The on-lamp should stay on during this time. Therefore, an
off-delay is needed for the on lamp so that it stays illuminated a few seconds after the
on button is releasedis delayed in turning off. The ladder logic for this operation is above.
Notice in rung 4, the off lamp is programmed to simply do the opposite of the on lamp. In
this example, as soon as the timer output device, T1, has power flow, its associated
contact goes into the on state. When the output device T1 loose power however, the T1
contact remains in the on state for a few second while the timer is counting down.
In addition to these two basic types of timers there are others. A retentive timer
retains its timer even after its coil loose power flow. For example, a button controls a
motor and a retentive timer such that when ever the button is pressed the motor and the
timer are active. Thus, the retentive timer will keep track of the total time the motor has
been powered. Pulse timers or one-shot timers produce an output for a fixed duration not
dependent on any other input. As soon as a pulse timer gains power, its associated contact
will become active for a set time after which it will deactivate. This occurs regardless of
what happens to the pulse timer coil.
You can use a clock pulse generator or flasher relay when you need to produce a
signal that repeats periodically. A clock pulse generator is common in a signaling system
that controls the flashing of indicator lamps. The example shown in the following ladder
logic program, however, illustrates the use of timer functions to generate a clock pulse.
The sample program shows how to implement a freewheeling clock pulse generator by
using a timer.

Counters
A counter is
used to count and store
the number of
occurrences of an input
signal. Like a timer, a
counter can be
represented by an
output device and contact pair or a block function. A counter is set to some preset
number value and when this value of input pulses has been received it will operate its
associated contacts. There are two types of counters: up-counters and down-counters. An
up-counter starts a zero and count up to a preset limit. A down-counter starts a preset

limit and counts down to zero. When the counter reaches the set value, its contacts are
activated. Counters also have a reset coil that when activated re-initialized the current
count value. For up-counters it is set to zero. For down counters a reset would set the
current count value to the preset limit.
In the picture below there is a process where a counters counts 10 pulses then
activates an output. A pulse is the action of the counter output device going from the
powered state to the un-powered state. In 1 controls the counter reset and In 2 supplies
the counter with impulse to count. The plot on the right indicates the status of the
elements with respect to time. After ten pulses the counter reaches its limit and activates
it contacts thereby activating Out 1.

Consider the problem of the control of a machine which is required to direct 6 tins
along one path for packaging in a box and then 12 tins along another pat the packaging in
another box. A deflector plate might be controlled by a photocell sensor which gives an
output every time a tin passes it. Thus the numb rod pulse from the sensor has to be
counted and used to control the deflector. On rung 1, each time the photo sensor is
triggered it causes C1s count to increase. When C1, the six tin counter, reaches six it
causes the deflector to activate. On rung 3, while the deflector is activated C2, the 12 tin
counter, and starts counting tins. On rung 4, after 12 tins are counted the counters are
reset and the process starts again. The process can also be reset at anytime using the start
button.

Comparison Instructions
Ladder logic for PLCs often includes instructions that can compare two values
and operate a contact based on the result. If the two values are IN1 and IN2 they can be
compared as follows:

== IN1 is equal to IN2

<> IN1 is not equal to IN2

>

IN1 is greater than IN2

<

IN1 is less than IN2

>= IN1 is greater than or equal to IN2

<= IN1 is less than or equal to IN2

In this case, function blocks are used as the graphical symbol in the ladder logic.

The input values IN1 and IN2 can be programmed directly in to the comparer or they
can be taken form other elements in the ladder program such as timers and counters.
The following figure shows a system with two conveyor belts and a temporary
storage area in between them. Conveyor belt 1 delivers packages to the storage area. A
photoelectric barrier at the end of conveyor belt 1 near the storage area determines how
many packages are delivered to the storage area. Conveyor belt 2 transports packages
from the temporary storage area to a loading dock where trucks take the packages away
for delivery to customers. A photoelectric barrier at the end of conveyor belt 2 near the
storage area determines how many packages leave the storage area to go to the loading
dock. A display panel with five lamps indicates the fill level of the temporary storage
area.

Notice in this example a block counter, C1, is used. When the counter has reached its
limit the output Q on the block will activate. A comparer can use values from CV and
BCD from the counter to compare values. CV is the values of the counter and BCD is the
counter value in binary coded decimal.

PLC Example
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 isnt a
wiring schematic and lacks the
information about how sensors are
wired. It is important to know under
what circumstances a sensor forms a
closed circuit or an open circuit.
Ladder logic looks much like a
schematic of physical components
but remember its just a graphical
program.
From the preceding example, 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 its 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 delayoff timer will remain in the ON state for 10 seconds regardless of the state of theafter
Pressure Sensor contact opens again. 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.

As before a Mmanual shut off can


be added to the system as well as a safety
sensor. 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 drawn in the
way the device is preferred to fail. Here if the
Ssafety Ssensor or Mmanual shut off
components fail or if the PLC fails the
Ssolenoid 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. Here is theOn the right is the wiring
schematic for the PLC. Notice that the safety
sensor and manual shut off are wired such that they are usually in an on state. When these
two devices are activated they cause an 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 vent pressure. When
programming a PLC, contacts should always be programmed to be normally in the state
you want them to fail in.
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 sensorsolenoid pair and more input and output device would be wired to the PLC.

Mixer Example
As an example, cConsider 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
Here Below is the sequential function
chart for this process. SFCs are useful when the
control process involves a series of steps. The
process stays in the current state until a
condition is satisfied.

Here isOn the right 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.
Here On the right 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 devicerelay that only exists
in the PLCs memory. In total, the ladder logic program has five rungs. Notice for State 3,
at the top, 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 doesnt 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.

Program Design
Since Ladder ladder logic is essentially a computer program it is subject to bugs
and faults. In the industrial environment process and operator safety are primary conerns.
Therefore any program needs to be tested for accuracy and robustness. When writing
programs a fail-safe design should be employed. Programs should be designed so that
they check for problems, and shut down in safe ways. Most PLCs also have imminent
power failure sensors. These sensors should be used to shut down the system safely
whenever danger is present. Proper programming techniques and modular programming
will help detect possible problems on paper instead of in operation. Careful effort should
be taken to write modular well designed programs that are predictable. The program
should also be inaccessible to unauthorized persons. Programs should also check for
system OK at start-up. PLCs have built in functions for error and failure detection that
should be used to keep the system safe. [1]
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.
Status lamps can be used to indicate the last output that has been set during a
process which has come to a halt. This technique is called last output set. Such lamps are
built into the program so that as each output occurs a lamp comes on. The lamps on thus
indicate which outputs are occurring. The program has to be designed to turn off previous
status lamps and turn on a new status lamp as each new output is turned on. [52]

Where there is concern regarding safety in the case of a fault developing, checks
may be constantly used to detect faults. One technique is replication checks which
involves duplicating, i.e. replicating, the PLC system. This could mean that the system
just repeats every operation twice and if it gets the same result it is assumed there is no
fault. This procedure can detect transient faults. A more expensive alternative is to have
duplicate PLC systems and compare the results given by the two systems. In the absence
of a fault the two results would be the same, a fault showing up as a difference. [52]
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. Most PLCs will allow a user to force inputs and
outputs. This means that they can be turned on, regardless of the physical inputs and
program results. This can be convenient for debugging programs, and, it makes it easy to
break and destroy things! When forces are used they can make the program perform
erratically. They can also make outputs occur out of sequence. If there is a logic problem,
then these dont help a programmer identify these problems. [1] Forcing can be used to
test the safety checks in the software to see if they work when unexpected conditions
arise.
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.After a program has been written it is important to verify that it works as intended,
before it is used in production. In a simple application this might involve running the
program on the machine, and looking for improper operation. In a complex application
this approach is not suitable. A good approach to software development involves the
following steps in approximate order:
1. Structured design - design and write the software to meet a clear set of objectives.

2. Modular testing - small segments of the program can be written, and then tested
individually. It is much easier to debug and verify the operation of a small
program.
3. Code review - review the code modules for compliance to the design. This should
be done by others, but at least you should review your own code.
4. Modular building - the software modules can then be added one at a time, and the
system tested again. Any problems that arise can then be attributed to interactions
with the new module.
5. Design confirmation - verify that the system works as the design requires.
6. Error proofing - the system can be tested by trying expected and unexpected
failures. When doing this testing, irrational things should also be considered. This
might include unplugging sensors, jamming actuators, operator errors, etc.
7. Burn-in - a test that last a long period of time. Some errors wont appear until a
machine has run for a few thousand cycles, or over a period of days. [1]
Program testing can be done on machines, but this is not always possible or desirable.
In these cases simulators allow the programs to be tested without the actual machine.
The use of a simulator typically follows the basic steps below.
1. The machine inputs and outputs are identified.
2. A basic model of the system is developed in terms of the inputs and outputs. This
might include items such as when sensor changes are expected, what effects
actuators should have, and expected operator inputs.
3. A system simulator is constructed with some combination of specialized software
and hardware.
4.

The system is verified for the expect operation of the system.

5.

The system is then used for testing software and verifying the operation. [1]

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 functions 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.

Conclusion
At this point (make it impersonal) 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 ability that allows 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 enough ladder logic
knowledge you could construct a sophisticated machine with little problem as far as
operational logic is concerned.

Sources
Source
Number
1
2
3
4

Description
PLC book
PLC website
PLC tutorial
Quick PLC description

http://claymore.engineer.gvsu.edu/~jackh/books/plcs
http://www.plcs.net/
http://www.plcs.net/chapters/whatis1.htm
http://support.automationdirect.com/docs/whatisaplc.html

PLC History

http://www.softplc.com/history.php

6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23

Online Encyclopedia
PLC online Forum
Course example
Course example
Course example
Course example
Course example
PLC simulation software
PLC simulation software
Mitsubishi
Toshiba
Siemens
Sprecher & Schuh
Allen Bradley
PLC book
PLC application website
Verification of PLC Applications
PLC Applications

http://en.wikipedia.org/wiki/Programmable_logic_controller
http://www.plctalk.net/qanda/
http://claymore.engineer.gvsu.edu/~jackh/eod/egr450.html
http://www.pueblocc.edu/tec/auto_023.htm
http://www.cede.psu.edu/StudentGuide/EET220.htm
http://www.tech.mtu.edu/courses/eet3370/EET3370%20Clas
http://www.utexas.edu/cee/petex/training/courses/iplc.html
http://www.tri-plc.com/trilogi.htm
http://www.ab.com/plclogic/pico/picosoft.html
http://www.meau.com/eprise/main/sites/public/PRODUCTS/d
http://www.tic.toshiba.com/productgroups.php?family=PLCs
https://pia.khe.siemens.com/index.asp?Nr=2140
http://www.ssusa.cc/pages/mainpg/prodmainall.html
http://www.ab.com/plclogic/
Programmable Logic Controllers An Introduction Third Editio
http://www.fbk.com/control-instrumentation/plctran.asp?menu
http://wwwhome.cs.utwente.nl/~mader/DEMOS/IPA2001.ppt
http://www.entertron.com/application.htm

24

PLC help thread

http://www.plctalk.net/qanda/showthread.php?s=&threadid=1

25
26
27
28

PLC Tutorial site


PLC Tutorial site
PLC info and tutorial
Modicon

http://www.freestudy.co.uk/plc.htm
http://www.mikroelektronika.co.yu/english/product/books/PLC
http://www.mrplc.com/kb/
http://www.modicon.com/Default.htm

29

PLC history

http://www.barn.org/FILES/historyofplc.html

30
31
32
33
34

PLC primer
PLC information
PLC example
Siemens PLC primer
AB Pico Solutions

http://www.industrialtext.com/freestuff.htm
http://www.control.com/links_page#PLCs%20and%20related
http://www.htservices.com/Tutorials/plc_tutorial_2.htm
http://www.sea.siemens.com/step/templates/lesson.mason?p
http://www.ab.com/plclogic/pico/picosolutions.html

35

Applications examples

http://public.modicon.com/nRepository/index.nsf/aa_getdocs?

36
37
38

TSX PLC manual


BORS oil application
PLC overview

http://www.modicon.com/nRepository/index.nsf/aa_getdocs?O
http://www.modicon.com/85256AE8006D78AB/all/AFB0118D
http://www.mavrinac.com/technical/howto_plc_programming_

39

PLC intro

http://www.canadu.com/hjhtml/plcs1-4.html

40

RTU vs PLC

http://www.tetragenics.com/Articles/RTUvsPLC.htm

41
42
43
44
45
46

Ladder Logic Ideas


Ladder Logic editor
Ladder Logic examples
PLC tutorial site
Intro to IEC 61131
IEC 61131-3 FAQ

http://xtronics.com/toshiba/Ladder_logic.htm
http://home.scarlet.be/~dc11cd/dciplc.html
http://www.ibiblio.org/obp/electricCircuits/Digital/DIGI_6.html
http://www.plcman.co.uk/
http://www.plcopen.org/TC1/intro_iec_61131-8.htm
http://www.holobloc.com/stds/iec/sc65bwg7tf3/html/faq.htm

47

Thread on PLC Scan time

http://www.plctalk.net/qanda/showthread.php?t=8220&highlig

48

Seamans on scan time

http://www.sea.siemens.com/step/templates/lesson.mason?p

49

PLC operation

www.crakker.com/PLC_Primer.PDF

50
51

http://www.lurpa.ens-cachan.fr/grafcet/generalites/presentatio
http://www.processwest.ca/Past_Issues.htm?ID=354

53
54
55
56
57
58
59
60

Info on Grafcet
PLC failure info
Programmable Logic Controllers Third
Edition
picture of industrial mixer
PicoSoft
GX-Developer
picture of relay timer
picture of relay counter
picture of box PLC
picture of optoisolator
plc shipment article

61

Honeywell contactor

62
63
64
65
66
67

Price on start relay/mounting $20


Price on timed relay-$48-$70
3 phase power converter example
ladder logic manual
3 phase converter data sheet
PLC presentation

52

W. Bolton Linacre House, Jordan Hill Oxford 2003

http://www.monoequip.com/images/Equipment/ind_cake_mix
http://www.ab.com/plclogic/pico/PicoSoftWeb6L.exe
http://www.meau.com/eprise/main/sites/public/DOWNLOADS
http://web.mit.edu/cjoye/www/ebay/RelayTimer/
http://www.icc-gb.com/lc4h.html
http://www.controltech.cz/images/clanky/image30.jpg
http://searchnetworking.techtarget.com/WhatIs/images/optois
http://www.drives.co.uk/news/worldnews/news_worldnews35
http://customer.honeywell.com/Honeywell/CatalogNavigator.a
CCFB4218DD64}#LiteratureDownload
http://www.mstores.umich.edu/catalog/grainger/electrical/rela
http://www.mstores.umich.edu/catalog/grainger/electrical/rela
http://www.metalwebnews.com/howto/phase-converter/phase
http://www.iu.hio.no/~georgm/pls/doc/s7kop__b.pdf
http://www.phase-a-matic.com/PDF/RPL-2005-C.pdf
http://www.kwandong.ac.kr/~sylee/cadcam_s/chap5Plc.ppt

Das könnte Ihnen auch gefallen