Вы находитесь на странице: 1из 13

Notes-PLC

Programmable Logic Controller (PLC)


Defination of Programmable Logic Controller (PLC) as defined by The National Electrical
Manufacturers Association (NEMA) is as follows:
A digitally operating electronic apparatus which uses a programmable memory for the internal
storage of instructions for implementing specific functions such as logic, sequencing, timing,
counting, and arithmetic to control, through digital or analog input/output modules, various
types of machines or processes.
In essence, the programmable logic controller consists of computer hardware, which is
programmed to simulate the operation of the individual logic and sequence elements that might be
contained in a bank of relays, timers, counters, and other hard-wired components.
What is PLC?
A plc is a digitally operated electronic system, designed for use in an industrial environment.
It uses programmable memory for internal storage for user oriented instructions for
implementing specific functions such as logic, sequencing, timing, arithmetic and control
through digital or analog inputs of various machines or processes.
In simple terms PLC is a solid state, digital, industrial computer.
PLC Introduction:
A PLC is a device invented to replace sequential relay circuits for machine control.
The PLC works by looking at its inputs and depending upon their state turning ON/OFF its
outputs. The user enters a program via software, that give desired results.
PLC used in many real world applications which involves machining, packaging, material
handling, automated assembly.
PLC broadly consists of
I/O interface
Processor
Memory
Power supply
Programmable devices
PLC Basic Block Diagram
A Programmable Controller is a specialized computer. Since it is a computer, it has all the basic
component parts that any other computer has.
A programmable logic controller consists of the following components:
Central Processing Unit (CPU)
Memory
Input modules
Output modules and
Power supply.
A PLC hardware block diagram is shown in Figure 1. The programming terminal in the
diagram is not a part of the PLC, but it is essential to have a terminal for programming or monitoring a
PLC. In the diagram, the arrows between blocks indicate the information and power flowing
directions.

Central Processing Unit (CPU)

Like other computerized devices, there is a Central Processing Unit (CPU) in a PLC. The CPU, which is
the brain of a PLC, does the following operations:
Updating inputs and outputs. This function allows a PLC to read the status of its input
terminals and energize or de-energize its output terminals.
Performing logic and arithmetic operations. A CPU conducts all the mathematic and logic
operations involved in a PLC.
Communicating with memory. The PLCs programs and data are stored in memory. When a
PLC is operating, its CPU may read or change the contents of memory locations.

Page 1 of 13

Notes-PLC

Scanning application programs. An application program, which is called a ladder logic


program, is a set of instructions written by a PLC programmer. The scanning function allows
the PLC to execute the application program as specified by the programmer.
Communicating with a programming terminal. The CPU transfers program and data between
itself and the programming terminal/device.
A PLCs CPU is controlled by operating system software. The operating system software is a group of
supervisory programs that are loaded and stored permanently in the PLCs memory by the PLC
manufacturer.

Memory
Memory is the component that
stores information, programs, and data in a
PLC. The process of putting new
information into a memory location is
called writing. The process of retrieving
information from a memory location is
called reading.
The common types of memory used
in PLCs are Read Only Memory (ROM) and
Random Access Memory (RAM). A ROM
location can be read, but not written. ROM
is used to store programs and data that
should not be altered. For example, the
PLCs operating programs are stored in
ROM.
A RAM location can be read or
written. This means the information stored
in a RAM location can be retrieved and/or
altered. Ladder logic programs are stored
in RAM. When a new ladder logic program is loaded into a PLCs memory, the old program that was
stored in the same locations is over-written and essentially erased.
The memory capacities of PLCs vary. Memory capacities are often expressed in terms of kilo-bytes (K).
One byte is a group of 8 bits. One bit is a memory location that may store one binary number that has
the value of either 1 or 0. 1K memory means that there are 1024 bytes of RAM. 16K memory means
there are 16 x 1024 =16384 bytes of RAM.

Input modules and output modules

A PLC is a control device. It takes information from inputs and makes decisions to energize or
de-energize outputs. The decisions are made based on the statuses of inputs and outputs and the
ladder logic program that is being executed.
The input devices used with a PLC include pushbuttons, limit switches, relay contacts, photo
sensors, proximity switches, temperature sensors, and the like. These input devices can be AC
(alternating current) or DC (direct current). The input voltages can be high or low. The input signals
can be digital or analog. Differing inputs require different input modules. An input module provides an
interface between input devices and a PLCs CPU, which uses only a low DC voltage. The input
modules function is to convert the input signals to DC voltages that are acceptable to the CPU.
Standard discrete input modules include 24 V AC, 48 V AC, 120 V AC, 220 V AC, 24 V DC, 48 V DC, 120
V DC, 220 V DC, and transistor-transistor logic (TTL) level.
The devices controlled by a PLC include relays, alarms, solenoids, fans, lights, and motor
starters. These devices may require different levels of AC or DC voltages. Since the signals processed
in a PLC are low DC voltages, it is the function of the output module to convert PLC control signals to
the voltages required by the controlled circuits or devices. Standard discrete output modules include
24 V AC, 48 V AC, 120 V AC, 220 V AC, 24 V DC, 48 V DC, 120 V DC, 220 V DC, and TTL level.

Page 2 of 13

Notes-PLC

Power Supply
PLCs are powered by standard commercial AC power lines. However, many PLC components,
such as the CPU and memory, utilize 5 volts or another level of DC power. The PLC power supply
converts AC power into DC power to support those components of the PLC.
Programming Terminal
A PLC requires a programming terminal and programming software for operation. The
programming terminal can be a dedicated terminal or a generic computer purchased anywhere. The
programming terminal is used for programming the PLC and monitoring the PLCs operation. It may
also download a ladder logic program (the sending of a program from the programming terminal to
the PLC) or upload a ladder logic program (the sending of a program from the PLC to the
programming terminal). The terminal uses programming software for programming and talking to
a PLC.

Advantages of using a programmable logic controller over conventional relays, timers,


counters, and other hardware elements.
Programming the PLC is easier than wiring the relay control panel.
The PLC can be reprogrammed. Conventional controls must be rewired and are often
scrapped instead.
PLCs take less floor space then relay control panels.
Maintenance of the PLC is easier, and reliability is greater.
The PLC can be connected to the plant computer systems more easily than relays can.
PLCs require shorter installation and commissioning times than do hard-wired systems.
Why PLC's are preferred for industrial control?
Although PLCs are similar to 'conventional' computers in term of hardware technology,
they have specific features suited for industrial control: _
1) Rugged, noise immune equipment;
2) Modular plug-in construction, allowing easy replacement or addition of units (e.g.
input/output);
3) Standard input/output connections and signal levels;
4) Easily understood programming language;
5) Ease of programming and reprogramming in-plant;
6) Capable of communicating with other PLCs, computers and intelligent devices;
7) Competitive in both cost and space occupied with relay and solid-state logic systems;
8) Consistency in manufacturing can be easily achieved.
9) Complete control of the manufacturing process can be achieved.
10) Accuracy and quality can be improved.
11) Productivity can be improved.
12) Makes it easy to work in difficult or hazardous environment.
These features make programmable controllers highly desirable in a wide variety of industrialplant and process-control situations.

PLC in comparison with other control systems


Relay Control System
By connecting the input and output contacts in series and/or parallel, any desired logic
functions may be produced. Combinations of various logic elements may be used to create fairly
complex control plans. For a simple task, the number of control relays required could be so
numerous that it can result in a large control panel. A typical relay system may consist of several
hundred or thousand switching contacts, which presents the design engineer with a considerable
task. It is also extremely difficult to change the control function of a panel once it has been wired
up, and is likely to involve a complete re-wiring of the system. Together with the other
disadvantages of cost, speed and reliability, the above drawbacks for relay control system have
led to the replacement of relay control systems by modern alternatives based on electronics and
microprocessors. Relay continues to be used extensively as output devices (actuators) on other
Page 3 of 13

Notes-PLC

types of control system, being ideal for the conversion of small control signals to highercurrent/higher-voltage driving signals.
Digital Logic Control Systems
Digital ICs, which deal exclusively with binary signals, process this information through
various logic 'gates'. Logic gates operate at much higher speeds and consume considerably less
power than an equivalent relay circuit. Although digital ICs have the advantage of small size, it
cannot switch higher power signal. Relay is used to convert small control signals to higher power
driving signals.
Electronic Continuous Control System
The operational amplifier (op-amp) available for analog computing operations, which
involve the performance of mathematical operations such as integration, differentiation, etc.,
were quickly adopted into the field of continuous control (Closed-loop feedback systems) and
provided a much simplified solution to complex control functions compare with existing discrete
electronic systems. Analog control is now heavily based on linear integrated circuits, and remains
the fastest form of control available.
However, the 'fine tuning' of feedback systems during design and commissioning remains
a difficult task. This, coupled with the fixed nature of electronic circuit construction, results in a
control medium that cannot easily have its function changed - the complete electronic system
may have to be replaced if this proves necessary.
Computer Control System
Today, powerful low-cost micro- and mini- computers are available, and are often used in
both sequence and continuous control systems. Microprocessor-based control panels are small
enough to locate at (or near) the point of final control, simplifying connection requirements.
In large processes it is now common for several microcontrollers to be used instead of a
single large mainframe control computer, with resulting benefits in performance, cost and
reliability. Each micro can provide optimal local control, as well as being able to send or receive
control data via other microcontrollers or a host supervisory computer (mini or micro). This is
termed distributed control and allows for greater sophistication of control than was with a
centralized strategy using a single large computer, since the control function is divided between
several dedicated processors.
A distributed control hierarchy need not consist exclusively of mini- and microcomputers,
but can include other intelligent devices such as CNC machines, robots and programmable logic
controllers.

Current trends in computer control


The availability of powerful, low-cost personal and industrial microcomputers based on
the IBM PC standard has led to the development of a wide range of add-on interface boards that
equip the PC to act as an effective industrial controller. This has resulted in increased use of such
systems for many control applications.
Page 4 of 13

Notes-PLC

The range of interfaces includes multi-point digital I/O cards, analog I/O and
communications cards. These are fitted to the chosen personal computer or to a 'ruggedized'
industrial version, both machines having several expansion slots that are use to hold up to six
interface cards.
Appropriate software applications packages are then loaded and run on the system. This
software handles the configuring of the I/O cards, together with data processing required to carry
out the control plan. There is frequently a very 'friendly' operator interface via a dynamic
graphics display. This presents process data to the operator, including system status and
exception conditions. It may allow limited operator intervention in certain circumstances.
The following table provides a general comparison between various control media in
terms of the capabilities. Any further technical information should be obtained from the
respective manufacturers data sheets on each specific system.
Digital/Analog
Characteristic
Relay systems
Computers
PLC systems
logic
Price per function
Physical size
Operating speed
Electrical noise
immunity
Installation
Capable of
complicated
operations
Ease of changing
functions
Ease of maintenance

Fairly low
Bulky
Slow

Low
Very compact
Very fast

High
Fairly compact
Fairly fast

Low
Very compact
Fast

Excellent

Good

Quite good

Good

Time-consuming:
design and
installation

Design and test for


tuning timeconsuming

Programming
extremely timeconsuming

Simple to
program and
install

No

Yes

Yes

Yes

Very difficult

Difficult

Quite simple

Very simple

Poor- large number


of contacts

Poor if ICs soldered

Poor- several custom


boards

Good- few
standard cards

Page 5 of 13

Notes-PLC

LADDER DIAGRAM
Ladder logic program or the ladder diagram is the application program used in PLCs. Different
brands of PLCs may have different formats for ladder logic programs and instructions, but the formats
are similar. This method of writing programs became adopted by most PLC manufacturers, however
each tended to have developed their own versions and so an international standard has been adopted
for ladder programming and indeed all the methods used for programming PLCs. The standard,
published in 1993, is IEC 1131-3 (International Electrotechnical Commission). The IEC 1131-3
programming languages are ladder diagrams (LAD), instruction list (IL), sequential function charts
(SFC), structured text (ST), and function block diagrams (FBD).
There are two power rails in a ladder logic program. These are the two vertical lines in the
program, one on the left, and the other on the right, as shown in Figure 3.1. Each component in a
ladder logic program is called an instruction. The instruction or instructions connected in parallel with
other instruction(s) create a branch. Each part of the ladder logic program, which is a complete
horizontal line and its branch(es) between the two power rails, is called a rung. In Figure L1, there is
one rung (rung 0000), two branches, and four instructions.

Figure L1: A Simple PLC Ladder Logic Program


In drawing a ladder diagram, certain conventions are adopted:
1. The vertical lines of the diagram represent the power rails between which circuits are connected.
The power flow is taken to be from the left-hand vertical across a rung.
2. Each rung on the ladder defines one operation in the control process.
3. A ladder diagram is read from left to right and from top to bottom, Figure L2 showing the scanning
motion employed by the PLC. The top rung is read from left to right. Then the second rung down is
read from left to right and so on. When the PLC is in its run mode, it goes through the entire ladder
program to the end, the end rung of the program being clearly denoted, and then promptly
resumes at the start. This procedure of going through all the rungs of the program is termed a
cycle. The end rung might be indicated by a block with the word END or RET for return, since the
program promptly returns to its beginning.

4. Each rung must start with an input or inputs and must end with at least one output. The term
input is used for a control action, such as closing the contacts of a switch, used as an input to the
PLC. The term output is used for a device connected to the output of a PLC, e.g., a motor.
5. Electrical devices are shown in their normal condition. Thus a switch, which is normally open until
some object closes it, is shown as open on the ladder diagram. A switch that is normally closed is
shown closed.
Page 6 of 13

Notes-PLC

6. A particular device can appear in more than one rung of a ladder. For example, we might have a
relay that switches on one or more devices. The same letters and/or numbers are used to label the
device in each situation.
7. The inputs and outputs are all identified by their addresses, the notation used depending on the
PLC manufacturer. This is the address of the input or output in the memory of the PLC.
Symbols that are used for input and output devices in a ladder diagram are as follows ( according to standard
IEC 1131-3):
Sl. No.
Function
Symbol (Full graphic form)
1
A horizontal link along which
power can flow
2
Interconnection of horizontal and
vertical power flows
3

Left-hand power connection of a


ladder rung

Right hand power connection of a


ladder rung

Normally open contact

Normally closed contact

Output coil: if the power flow to it


is on then the coil state is on

To illustrate the drawing of the rung of a ladder diagram, consider a situation where the
energizing of an output device, such as a motor, depends on a normally open start switch being
activated by being closed. The input is thus the switch and the output the motor. Figure L3(a) shows
the ladder diagram.
Starting with the input, we have the normally open symbol | | for the input contacts. There are
no other input devices and the line terminates with the output, denoted by the symbol ( ). When the
switch is closed, i.e., there is an input, the output of the motor is activated.
Only while there is an input to the contacts is there an output. If there had been a normally closed
switch |/| with the output (Figure L3(b)), then there would have been an output until that switch was
opened. Only while there is no input to the contacts is there an output.

In drawing ladder diagrams the names of the associated variable or addresses of each element are
appended to its symbol. Thus Figure L4 shows how the ladder diagram of Figure L3(a) would appear using
(a) Mitsubishi, (b) Siemens, (c) Allen-Bradley, (d) Telemecanique notations for the addresses. Thus, Figure
L4(a) indicates that this rung of the ladder program has an input from address X400 and an output to address
Y430. When wiring up the inputs and outputs to the PLC, the relevant ones must be connected to the input
and output terminals with these addresses.
Page 7 of 13

Notes-PLC

(b) Siemens

(a) Mitsubishi

(c) Allen-Bradley
Figure L4

(d) Telemecanique

REALIZATION OF LOGIC FUNCTIONS (GATES) USING LADDER DIAGRAM

1) Logical AND operation


Truth Table
Input
A
0
0
1
1

B
0
1
0
1

AND circuit

AND logic gate

Output
A AND B
0
0
0
1

On a ladder diagram contacts in a horizontal rung, i.e., contacts in series, represent the
logical AND operations.

2) Logical OR operation
Truth Table
Input
A
0
0
1
1

B
0
1
0
1

OR circuit

OR logic gate

Output
A OR B
0
1
1
1

Alternative paths provided by vertical paths from the main rung of a ladder diagram, i.e., paths
in parallel represent logical OR operations.

3) Logical NOT operation


Truth Table
Input
Output
A
NOT A
0
1
1
0

NOT circuit

NOT logic gate

With no input to input A, the contacts are closed and so there is an output. When there is an
input to input A, it opens and there is then no output.
Page 8 of 13

Notes-PLC

4) Logical NAND operation


Truth Table
Input
A
B
0
0
0
1
1
0
1
1

NAND circuit

NAND logic gate

NOR circuit

NOR logic gate

Output
A NAND B

1
1
1
0

5) Logical NOR operation


Truth Table
Input
A
B
0
0
0
1
1
0
1
1

Output
A NOR B

1
0
0
0

NOT gate on each input and then an AND gate for the resulting inverted inputs will result NOR function.

5) Logical Exclusive-OR (XOR) operation


Truth Table
Input
A
B
0
0
0
1
1
0
1
1

XOR circuit

XOR logic gate

Output
A NOR B

0
1
1
0

Page 9 of 13

Notes-PLC

TIMERS & COUNTER


TIMERS
Three types of timers are used in PLC ladder logic programs. They are ON-delay timers, OFFdelay timers, and retentive timers. Figures 2 shows the timer instructions used in the Allen-Bradley
PLC.

Retentive Timer Instruction


OFF-Delay Timer Instruction
Figure 2
When programming a timer instruction, the programmer must specify the Timer address, the
Time Base, and the Preset value, which are listed in the instruction.
The format of the Timer address is T4:N, where N is a positive integer. Each timer instruction
should have a unique number that distinguishes its timer instruction from other timer instructions.
The Time Base value is an interval that the timer is going to use. This value can be set to 1
second, 0.01 second, or 0.001 second.
The Preset value specifies how many intervals a timer should count before the timing is
complete, also known as done. A timers setting time equals its Preset value multiplied by its Time
Base.
For example, if a timers Time Base is 0.01 and Preset is 500, the timers setting time is 500 x
0.01 second = 5 seconds. That means this timer will be done 5 seconds after the timer instruction is
enabled.
A timer instruction must be located next to the right rail in a rung. An ON-delay timer is
enabled when its rung is true. A rung is true when there is at least one path made by the instructions
that are true from the left rail to the timer instruction. An OFF-delay timer is enabled when its rung is
false. When a timer is enabled, its Accumulate value shows how many Time Base intervals have
elapsed since the timer was activated. A timer is done when its Accumulate value reaches its Preset
value. When an ON-delay timer or an OFF-delay timer is timing, its rung condition change, i.e. a rung
changes from true to false for an ON-delay timer or a rung changes from false to true for an OFF-delay
timer, will cause the timer to stop and its Accumulate value to be reset to zero.
ON-Delay Timer Instruction

A retentive timer works like an ON-delay timer with one difference. That is, when its rung
condition changes from true to false, the timer simply stops timing, but its Accumulate value is not
reset to zero. When its rung condition goes from false to true again, the retentive timers Accumulate
value counts up from where it stopped the last time. To reset a retentive timers Accumulate value to
zero, a reset instruction with the same timer address must be used. A reset instruction is a controlled
instruction, which means it must be located next to the right rail in a rung. When its rung is true, the
reset instruction becomes enabled and resets the timer according to the address that is assigned to
the reset instruction.
Each timer instruction has three very useful status bits. These bits are Timer Enable (TE), Timer
Timing (TT) and Timer Done (TN). Each of these bits has one bit of memory and the memory is
affected by the corresponding bit status. For an ON-delay timer and a retentive timer,
The Timer Enable bit is high when the timers rung is true; it is low when the rung is false.
The Timer Timing bit is high when the timers rung is true and the Accumulate value is less
than the Preset value. This bit is low when the rung is false or after the Accumulate value
equals the Preset value.
The Timer Done bit is high when the rung is true and the timer is done. It is low when the rung
is false or before the timer is done.
Page 10 of 13

Notes-PLC

For an OFF-delay timer,


The Timer Enable bit is high when the timers rung is false; it is low when the rung is true.
The Timer Timing bit is high when the timers rung is false and the Accumulate value is less
than the Preset value. This bit is low when the rung is true or after the Accumulate value
equals the Preset value.
The Timer Done bit is high when the rung is false and the timer is done. It is low when the
rung is true or before the timer is done.
Figure 3 is a timing diagram of an ON-delay timers control bits. In this diagram, the timer is disabled
after its Accumulate value reaches its Preset value.

Figure 4.5 is another timing diagram of an ON-delay timer. This timer is disabled before its
Accumulate value reaches its Preset value. The Timer Done bit in this diagram is always low because
the timer never reaches a done status.

Figure 5 is a PLC ladder logic program that uses timer instructions to alternately turn-on two
output devices. A start button is connected to the input terminal I:2/1 and a stop button is connected
to the input terminal I:2/2. When the start button is pushed, it energizes the instruction B3:1/1 in the
first rung. This instruction latches itself by using the Exam-if-Closed instruction B3:1/1 in the same
rung. That allows the push button to be released and the B3:1/1 stays in HIGH status. When B3:1/1 is
HIGH, it enables the timer instruction T4:1 in the second rung. Timer T4:1 is preset to 2 minutes (120
seconds). When this timer is timing, the T4:1/TT instruction in rung 4 is true. It energizes the output
O:3/4. When this timer reaches 2 minutes, T4:1/TT goes to false and de-energizes O:3/4. However,
the T4:1/DN bit goes to HIGH at this moment. That enables the timer T4:2 that is preset to 3 minutes.
When T4:2 is timing, the T4:2/TT instruction in rung 5 turns on the output O:3/5. When timer T4:2
reaches 3 minutes, T4:2/TT goes to LOW and O:3/5 is de-energized. Meantime, the T4:2/DN bit goes
to HIGH. That causes the second rungs condition to be false and the timer T4:1 to be reset. When
timer T4:1 is reset, the T4:1/DN bit goes to low and timer T4:2 in the third rung is reset. This causes
T4:2/DN to be low. In the next scan cycle, the second rung turns to true and the timer T4:1 is timing
again. This starts another cycle of energizing the outputs. These two outputs alternate between ON
and OFF until the stop button is pushed. Pushing the stop button de-energizes B3:1/1 in the first rung.
That breaks the latch in the first rung. It also stops and resets the timers T4:1 and T4:2.
Page 11 of 13

Notes-PLC

Figure 5: A Program Using Timers to Control Outputs

COUNTERS
A PLC counter instruction can be a count-up instruction or a count-down instruction. These
are shown in Figure 6. When a counter instruction is used in a program, the programmer must specify
the counter address. A counter address has the format of C5:N, where N is a positive integer to
distinguish it from other counters. The programmer must also specify the Preset value, which is a
signed (positive or negative) integer.

Count-up Counter Instruction

Count-down Counter Instruction


Figure 6
A counter instruction counts false-to-true rung transitions. These rung transitions could be
caused by events monitored by the program or by something else. Each time a rung condition is
changing from false to true, a count-up instruction in the rung increases its Accumulate value by 1 and
a count-down instruction in the rung decreases its Accumulate value by 1.
There are several status bits associated with each counter instruction. Three of these bits are used
frequently in PLC ladder logic programs. These bits are the counter-up enable bit (CU), the counterdown enable bit (CD), and the done bit (DN).
When a count-up counter is counting, its CU bit is high.
When a count-down counter is counting, its CD bit is high.
A DN bit is high when its counters Accumulate value is greater or equal to the counters Preset
value.
A counter retains its Accumulate value when its rung condition is true, false, or changing from true
to false. A counters Accumulate value can be reset to zero by using a reset instruction that has the
same counter address. The counter is reset when the reset instruction is enabled.
The program in Figure 7 is used for counting parts and controlling box packaging in a
manufacturing company. One hundred parts are packed into a box. A sensor, which is connected to
input terminal I:2/1, detects the parts coming down from a conveyer. When a part passes in front of it,
the sensor has a high output. This high output causes counter C5:1 to count. When this counter is
counting up to 100, its DN bit goes to high. That causes the output O:3/1 in rung 2 to be energized,
which initiates a box packaging process that is not included in this example program. The switching of
DN bit of counter C5:1 to high also causes the counter C5:2 in rung 3 to count. This counter counts the
Page 12 of 13

Notes-PLC

number of boxes packed. When C5:2 is counting, its CU bit is high. That enables the reset instruction in
rung 4 to reset counter C5:1s Accumulate value to 0. The C5:1 will count up from 0 again.

Figure 7: A Program Using Counters to Count Parts

Page 13 of 13

Вам также может понравиться