0% found this document useful (0 votes)
13 views31 pages

Unit Iv Programmable Logic Controller (PLC)

This document provides an overview of Programmable Logic Controllers (PLCs), detailing their structure, features, programming methods, and logic functions. It explains the basic components of a PLC, including the CPU, memory, and I/O processing, as well as the ladder programming technique used for programming. Additionally, it covers various logic functions, timers, and internal relays utilized in PLC operations.

Uploaded by

sec22me038
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views31 pages

Unit Iv Programmable Logic Controller (PLC)

This document provides an overview of Programmable Logic Controllers (PLCs), detailing their structure, features, programming methods, and logic functions. It explains the basic components of a PLC, including the CPU, memory, and I/O processing, as well as the ladder programming technique used for programming. Additionally, it covers various logic functions, timers, and internal relays utilized in PLC operations.

Uploaded by

sec22me038
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 31

UNIT IV PROGRAMMABLE LOGIC CONTROLLER (PLC)

Introduction – Basic Structure – Input/output processing – Ladder


programming – Mnemonics – Timers, Internal relays and counters – Shift
Registers – Master and Jump Controls – Selection of PLC.

PROGRAMMABLE LOGIC CONTROLLER


A programmable Logic Controller (PLC) is defined as a digital
electronic device that uses a programmable memory to store instructions
and to implement functions such as logic, sequencing, timing, counting
and arithmetic in order to control machines and processes

Features of PLC as a Controller


PLC’s are rugged and designed to withstand vibrations, temperature,
humidity and noise. The interfacing for inputs and output is inside the
controller. PLC’s are easily programmable and have an easily
understandable programming language. Programming is primarily
concerned with logic and Switching operations.

BASIC STRUCTURE

The figure below shows the basic internal structure of a PLC. It consists
essentially of a central processing unit (CPU), memory and input/output
(I/0) circuitry. The CPU controls and processes all the operations within
the PLC. It is supplied with a clock of frequency typically between 1 and 8
MHz. This frequency determines the operating speed of the PLC and
provides the timing and synchronization for all elements in the system.
A bus system carries information and data to and from the CPU, memory
and input/output units. There are several memory elements: a system
ROM to give permanent storage for the operating system and fixed
data; RAM for the user's program, and temporary buffer storage for I/0
channels. The programs in RAM can be changed by the user. However,
to prevent the loss of these programs during power failure, a battery is
likely to be used in the PLC to hold the RAM contents for a period of
time.

After a program has been developed in RAM, it may be loaded into an


EPROM memory chip and so made permanent. The I/O unit provides the
interface between the system and the outside world. Programs are
entered into the system through input devices like key pad or sometimes
through Personal Computer (PC) which is loaded with an appropriate
software package. The I/O channels have signal conditioning and
isolation units, so that sensors and actuators can be generally directly
connected to them without the need for any other circuitry. The figure
shows the basic form of an input channel. Common input voltages are
5V and 24VCommon output voltages are 24V and 240V.

There are three types of output


1) Relay type.
2) Transistor type.
3) Triac type

1) Relay 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 few amperes in an external
circuit. The relay isolates the PLC from the external circuit and can be used
for both d.c and a.c switching Relays are relatively slow to operate.
2) Transistor type

The transistor type of output (fig) uses a transistor to switch current through
the external circuit. This provides a faster switching action. Opto isolators are
used with transistor switches to provide isolation between the external circuit
and the PLC. The transistor output is only for D.C. switching.

3) Triac type:
Triac outputs can be used to control external loads which are connected to
the a.c. power supply. Opto isolators are again used to provide isolation.

INPUT / OUTPUT PROCESSING


The programming commonly used with PLC is ladder programming. This
involves each program task being specified as through a rung of a
ladder. This each rung could be specify that the state of switches A&B. The
inputs, be examined and if A&B are both closed then a solenoid, the output is
energized. The sequence followed by a PLC when carrying out a program
can be as follows
1. Scan the inputs associated with one rung of the ladder program.
2. Solve the logic operation involving those inputs.
3. Set/reset the output for that rung.
4. Move on the next rung and repeat the operations 1, 2, 3.
Thus a PLC is continuously running through its program and updating it as a
result of input signal. Each such loop is termed as cycle. This continues until
the program is competed.

There are two methods that can be used for I/0 processing:

1. Continuous updating
In this method, the CPU scans input channels as they occurring the program
instructions. Each input is examined individually and its effect on the program
determined. there involves a time delay, typically about 3 ms, when each
input is scanned in order to ensure that only valid input signals are read by
the microprocessor.
This delay enable CPU to avoid counting an input signal twice, A number
of inputs may have to be scanned, each with a 3 ms delay, before the
program has the instruction for a logic operation to be executed and an
output to occur. The outputs are latched so that they retain their status
until the next update. The 3 ms built-in delay for each input is, for ensuring
the signals read by the CPU is the valid one or more frequently, if there is
contact bounce at a switch.

6
2. Mass I/O Copying
In the above method, with 3 ms delay on each input, the time taken to
examine several hundred I/0 points can become comparatively long. To allow
a more rapid execution of a program, a specific area of RAM is used as a
buffer store between the control logic and I/0 units. Each I/0 have and
address in this memory. At the start of each program is executed the stored
input data is read, as required, from RAM and the logic operations carried
out. The resulting output signals are stored in the reserved I/0 section
RAM. At the end of each program cycle, all the outputs are transferred
from RAM to the output channels. The outputs are latched so that they retain
their status until the next update.

PROGRAMMING Ladder diagram


PLC’s are programmed using ladder diagram techniques. A special standard
schematic representation of the physical components arrangement
(hardware) and its way of connections made between them is called as
ladder diagram. These are line diagram the represent both the system
hardware and the process controller.
A ladder diagram consists of two vertical lines called power power rails are
connected along with I/O devices and other components as horizontal lines
between the two vertical lines known as rungs.

Rules followed in ladder diagram


1. The vertical lines of the diagram represent the power rails, and the
horizontal lines representing the rungs.
2. Each rung on the ladder defines one operation in the control process.
3. A ladder diagram must read from left to right and from top to bottom.
When the scanning of first rung is completed then the second rung starts

7
from left to right.
4. Each rung must start with an input and must end with an output.
5. Each rung must have more than one input but only one output.
6. The input must always located at the rung left and the output at the right
end of the rung.
7. Electrical devices are shown in their normal condition.
Ladder diagram can be entering from a monitor screen by using mouse.
When entered, they translated by the PLC into machine language for
microprocessor to understand it. The nature of input determines whether the
output is to be energized or not.
The Ladder programming is one of the basic forms of programming
commonly used with PLC’s. In this type of programming, each program task
being specified as though a rung of ladder. Circuits are connected between
these two vertical lines as horizontal lines, i.e. the rungs of the ladder. Fig.
shows the basic symbols that are used in the ladder diagram.

8
Ladder Symbols

Precede outputs and depending on, the different PLC manufacturer, different
notations are used. For example, the Mitsubishi F series of PLC’s precedes
inputs elements by an X and output elements by a Y and uses the following
numbers: Numbering schemes are followed for inputs and outputs and
depending on, the different PLC manufacturer, different notations are used.

9
To illustrate the drawing of a ladder diagram, consider a situation where the
output from the PLC is to energies a solenoid when a normally open start
switch connected to the input is activated by being closed (Fig. (a)). the
program required is shown in Fig. (b).

Starting with the input, we have the normally open symbol. This might
have an input addressX400. The line terminates with the output, the
solenoid. This might have the output address Y430. To indicate the end of
the program the end rung is marked. When the switch is closed the
solenoid is activated. This might, for example, be a solenoid valve which
opens to allow water to enter a vessel.

LOGIC FUNCTIONS
Logic functions may be obtained through various combinations of switches.
Also it is explained how one can write ladder program using such
combinations.

7
1. And function

Only when both the switches are closed simultaneously, the lamp will be lit,
otherwise it is put off. Thus, this situation corresponds to an AND logic
function. The ladder diagram representing the AND function is shown in
Fig.(b). The switches A and B are represented as input 1 and input 2 and
lamp is represented as an output.

2. OR function

If either one of the switch A or B is closed, then the lamp will be lit. If
both switches are opened simultaneously, then lamp will be put off. This
situation Corresponds to an OR system. The ladder diagram
representing the OR function is shown in fig.(b) The switches A and B
are represented as output.

8
3. Nor function

When neither A nor B have an input (i.e., neither switch A nor switch B is
opened) the lamp will be lit. When there is input to A or B (i.e., if switch A
or B is opened) the lamp will be put off. This situation corresponds to a
NOR system. The ladder diagram representing NOR function is shown in
Fig. (b) Switch A and B are represented as input 1 and input 2; and
lamp is represented as output. In this case the switches A and B are
normally closed. When input occurs, the corresponding switch is opened.
There will be output if neither of the input occurs. There will not be output
if any of the input occurs.

4. NAND Function

The lamp will not be lit, when both A and B have input simultaneously (i.e.,
when both are opened simultaneously the lamp will be lit if both inputs did

9
not occur simultaneously (i.e., when both are not opened simultaneously).
The ladder diagram is shown in Fig. (b)

5. EXCLUSIVE-OR (XOR) function


Consider a situation shown in Fig. (a) In this system, there will be output
(i.e., the lamp will be lit) if any one of the input occurs. There will not be
output if both inputs occur or if both do not occur. The ladder diagram is
shown in Fig (b) Note that, it is represented, each input by two sets of
contacts, one normally open and one normally closed.

LATCHING

There are often situation where it is necessary to hold a coil energized,


even when the input which energized it ceases. The term latch circuit is
used for the circuit used to carry out such and operation. It is a self-
maintaining circuit in that, after being energized, it maintains that state until
another input is received. It remembers its last state.

1
0
An example of a latch circuit is shown in Figure above when input 1 is
energized and closes, there is an output. However, when there is an
output, a set of contacts associated with the output is energized and closes.
These contact OR the input 1 contacts. Thus, even if input 1 contact open,
the circuit will still maintain the output energized. The only way to release
the output is by operating the normally closed contact input 2.As an example
of the use of a latching circuit, consider the requirement for a PLC to

control a motor so that when the start signal button is momentarily pressed
the motor starts and when the stop switch is used the motor switches
off, signal lamps indicating when the motor is off and when on. Figure B
shows a possible program. With no inputs, the signal lamp for the motor
indicates that it is off.

The motor contacts which are normally closed have the off lamp on. When
the start button is pressed, the normally open contacts are closed and the
motor switched on. This is latched on by the motors contact in parallel with
the start contacts. Also, other motor contacts which are normally closed

1
1
opens and the off lamp goes off and motor contacts which are normally
open closes and the on lamp goes on. The motor is stopped by the stop
switch which opens the previously closed contacts.

SEQUENCING
There are often control situations where sequences of outputs are required,
with the switch from one output to another being controlled by sensors.

Consider the requirement for a ladder program for a pneumatic system


with double solenoid valves controlling two double-acting cylinders A and
B if limit
switches a-, a+, b-, b+ are used to detect the limits of the piston rod
movements in the cylinders and the cylinder activation sequence A+, B+,
A-, B- is required.

Figure below shows a possible program. A start switch input has been
included in the first rung. Thus cylinder extension for A, i.e., the solenoid
A+ energized, only occurs when the start switch is closed and the b-
switch is closed, this switch indicating that the B cylinder is retracted.
When cylinder A is extended, the switch a+, which indicates the
extension of A, is activated. This then leads to an output to solenoid B+
which results in B extending. This closes the switch indicating the
extension of B, i.e. the b+ switch, and leads to the output to solenoid A-
and the retraction of cylinder A.

This retraction closes limit switch a- and so gives the output to solenoid
B- which results in B retracting. This concludes the program cycle and
leads to the first rung again, which await the closure of the start switch
before being repeated.

MNEMONICS

Each horizontal rug on the ladder in a ladder program represents


a line in the program and the entire ladder gives the complete program
in 'ladder language'. The programmer can enter the program into the
PLC using a keyboard with the graphic symbols for the ladder elements,
or using a computer screen and a mouse to select symbols, and the
program panel or computer then translates these symbols into
machine language that can be stored in the PLC memory.
There is an alternative way of entering a program and that is to translate
the ladder program into mnemonics, each code corresponding to a
ladder element, and then enter these into the programming panel or
computer. These are then translated into machine language. The
mnemonics used by different PLC manufacturers differ. For the
Mitsubishi F series PLCs, mnemonics use are:
LD Start a rung with an open contact

OUT An output

AND A series element and so an AND logic instruction

OR Parallel elements and so an OR logic instruction

I A NOT logic instruction

OR1 An OR NOT logic function

AN1 An AND NOT logic function

LDI Start a rung with a closed contact

ANB AND used with two sub circuits

ORB OR used with two sub circuits

RST Reset shift register/counter

SHF Shift

K Insert a constant

END end ladder

The following examples show how individual rungs on a ladder are


entered.

An AND System

An OR System

An NAND System

An NOR System
An XOR System

TIMERS

When timer circuits are activated, they result in closing or opening of


input contacts after some preset time. Fig. shows part of a program
involving a delay-on timer. When input occurs, the timer is activated,
and after some preset time, the contacts associated with timers close
and output occurs. When we want to introduce larger time delays, it
may not be possible with one timer circuit, hence we may cascade
more timers as shown in Fig.

When input contacts close, timer 1 is activated; after its time delay, its
contacts close and timer 2 is activated; after its time delay, its contacts
close and output occurs.

ON-OFF CYCLIC TIMER

Normally PLC’s are provided with delay-on timer. The diagram shown in
figure explains how a delay-off timer can be devised. When the input
contacts are momentarily closed, the output is energized and the timer is
activated. The outputs contacts and latch the input and keep the output on.
After the reset time of the timer, the timer contact breaks the latch circuits
and hence the output is put off.

INTERNAL RELAYS
The terms internal relay, auxiliary relay and marker is considered as internal
relay in the PLC. In reality they are not Relays. How ever they are simulated
by the software within the PLC. They are useful in implementing switching
sequences. Internal relays are used in a situation where occurrence of output
depends on two different input arrangements. Fig. shows the ladder diagram
for such an arrangement. In the diagram, first rung shows one input
arrangement used to control the internal relay IR1. The second rung
shows the other input arrangement used to control the internal

relay IR2. The contacts of the two relays are to control the output. Another
use of internal relays is for the starting of multiple outputs.

When start contacts are closed, the internal relay is activated and latches the
input. It also starts output 1 and makes it possible for outputs2 and 3 to be
activated.
Another example of use of internal relay is resetting a latch. Fig. shows the
ladder diagram. When the input 1 is momentarily pressed, the output
occurs. Then the output is latched. The output can be unlatched by opening
the internal relay contact. This can happen by the close of input 2 contacts.

COUNTERS
As the name implies, counters are used for counting operations. It is an in-
built operation in any PLC. For example, in a packaging section of an
industry, assume that the finished products are passing along a conveyor
into boxes. The counters can be used to count how many products have
passed into one box, so that the next box can be replaced after a particular
count. Two types of counters are possible, namely, up-counter and down-
counter. In the down counter the counter counts down a preset value to zero,
whereas in the up counter the counter starts from zero and count up to a
preset value. In both the cases, as tie counter operation comes to an
end, its 'contact' changes state, i.e., it may close or open.
The counter is basically represented by a rectangle spanning two lines.
(Refer fig.) One line is used to reset the counter. The other line is used as
'OUT' line and the symbol K10indicates that the counter contact will

change state on the 10th count. When the input 1 closes momentarily, the
counter is reset to the set value, in this case '10'. Now the counter starts
counting as the input 2 closes and opens. When the input 2closes and opens
for 10 times, then the counter contact close and the output is switched on. In
case, before 10 pulses are received from input 2, if input 1
momentarily closes, then the counter will reset back to 10.
Example: Draw a ladder diagram to direct 6 items along path 1 for packaging
in a box and then 12 items along path 2for packaging in another box.
Two counters are used. One counter is used to count six and another to
count twelve. When input 1 momentarily closes, both counters are reset and
preset to their respective counts 6and 12. As items pass up to to the
junction in the paths, input2 contacts can be made to close and open. After
6 items pass into one box, counter 1 contact closes and activates the output
which in turn closes one path and opens another. Counter 1also has contacts
which close and enables counter 2 to start counting. When counter 2 has
counted 12 items it resets both counters and opens counter 1 contacts which
deactivates the output and the items will start falling into 6 items box.

SHIFT REGISTERS:

A number of internal relays can be grouped together to form a register which


can provide a storage area for a series of sequence of individual bits.
Registers are used to store a bit sequence, for example a4-bit sequence
1101 can be stored using 4 internal registers. Similarly an eight-bit sequence
can be stored using eight internal registers. A number of internal relays can
be grouped together to form a register array.
In shift registers the bits are shifted along the register array by one bit when
there is a suitable input fed to the register. Consider a 4 bit shift register with
its bit sequence as

Assume. a 0 is fed to this shift register, then the bits are shifted along the
register by one bit and the last bit overflows:

When the 'shift register' function is selected at the control panel of a PLC,
then a number of auxiliary registers are automatically grouped together to
form a shift register. In Mitsubishi PLC a programming function 'SFT' is to be
used against the auxiliary relay number, which is the first in the register
array. For example if it is a 4- bit register to be formed, and if we select M
140 to be the first relay number then automatically, the 4 consecutive relays
from M140 will be assigned to form a 4-bit shift register, ie M140, MI41, MI42
andMI43. A shift register has three inputs, namely OUT SFT1 and RST.
OUT is used to load data into the first element of the shift register. SFT in
used to shift the bits by one bit and RST (Reset) in used to clear all the bits
of the shift register to 0.

MASTER AND JUMP CONTROLS:

Master Relay:

More than one output or a block outputs arranged in each output rung
can be simultaneously turn off or on by using one internal relay contact. If
this single relay contact is switched on or off, then it affects every one of the
rungs. When the contact input 1 close then master relay MC1 is
activated and simultaneously the block program rungs controlled by the
relay MC1 follows. In the ladder shown, OUTI, OUT2 & OUT3 also
simultaneously activated. The end of master relay controller section is
indicated by the reset MCR.
When contact input 2 closes then master relay MC2 is activated and
simultaneously the block program rungs controlled by the relay MC2 follows.
If there are no inputs to input 1 &2, then the next input to be checked is for
input 9 whose controlled output is OUT 6. Therefore this branching program
operates as -there is input I, then branch to follow MC1 controlled path,
input 2, then branch to follow MC2 controlled path, otherwise neither
input occurs follow the rest of the program & ignore the branches.

Jumps

Conditional Jump is a function provided in PLCs. If a certain condition exists,


then a section of the program is ignored and the program control is jumped.
In the ladder diagram shown, program A is followed by input1 and the
conditional jump relay CJP. If input 1 is OFF, the program B follows. The end
of program B is indicated by EJP end of jump relay coil. If input 1 is ON, then
the program jumps to the program 'C' skipping program B.
DATA HANDLING:

In some cases, it may be required to deal with related group of bits, i.e. a
block of eight inputs and operate on them as data word. The operations
that may be carried out with a PLC on data words normally include.
1. Data movement
2. Data comparison
3. Arithmetic operations
4. Conversions between BCD, binary & octal.
We know that the individual bits are stored in memory locations specified by
unique addresses. These addresses are preceded by the letter 'A'. The PLC
memory locations allocate for data storage are called data registers. Each
data register can store either 8 bits or 16 bits & its address may be specified
as DO, Dl, D2 etc. Every instruction has three parts-one specify the source
data register, second to specify the destination data register and third to
specify the 'operation' to be performed on the data.

Data movement

Data movement instruction has move instruction, source address of the data
and destination address of the data. For example, to move from Dl to D2,
Data Comparison:

Data comparisons include less than (<or LES), equal to (=orEQU), less than
or equal to (or LEQ), greater than (> or GRT), greater than or equal to ( or
GEQ) and not equal to (# or <> or NEQ)

For example to compare the data available in Dl & D2, the ladder program
rung would be of the form shown in fig.
Example: Draw a ladder diagram that the alarm keeps sounding when the
sensor temperature is above 80°C and stops sounding when the
temperature falls below 70°C.

The sensor temperature is fed as input data to the source address. The
destination address has the set value, here it80°C. When the input
temperature rises to 80°C or above, the source data becomes greater than
or equal to destination data and output alarm sound which in turn is latched
in the input. When the temperature falls to 70°C or lower, the source data is
less than or equal to destination data (shown in second rung of the ladder)
and IR output occurs. Now in the first line (the ladder, the IR contact
opens and alarm is switched off.

Arithmetic Operations:

Addition and subtraction operations are commonly found in all PLCs. Even
more arithmetic operations are possible in some PLCs. ADDISUB instruction
contains address of the addend, augend and the result registers along with
the arithmetic operation to be performed. These operations may be used
to change the preset values of the timers or counters.

Code Conversions:

In a PLC, all the internal operations are carried out in binary form only.
However, it may be required to handle decimal or octal numbers at the input
or output in which case a conversion from binary to decimal to octal or a
conversion from decimal/octal to binary is required. For example to convert
a BCD number in the source register to a binary number and store the result
in destination register, refer the fig.

ANALOG INPUT/OUTPUT:
In PLCs, analog signals might be given as inputs and the actuators at
the output might also require analogue signals. in such cases, an analog-to-
digital converters & digital-to-analog converters may be used at the input &
output channel respectively.
Example 1: Draw a ladder diagram to show the speed of motor
increasing at a steady rate from zero to its maximum value:

An on/off switch is used at the input. When the switch is in OFF position, the
data register has 'OO', as its contents and hence DAC output is zero & so
the motor is at zero speed. But as the switch closes, the data register is
incremented. As the program loops through these two rungs of the ladder,
the data register keeps incrementing by one, &the DAC output increases
steadily and hence the motor speeds up at a steady rate. The motor
reaches its full speed when the data register contents has the word
11111111.
SELECTION OF A PLC:

The factors to be considered in selecting a PLC for a particular task are:


1. Input/output capacity and its expansion capability for future needs.
2. Types of inputs/outputs required, i.e. isolation, on-board power supply for
I/O, signal conditioning, etc.
3. The size of memory required.
4. The speed and power of the CPU. This is related to the number of
instructions that can be handled by a PLC.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy