You are on page 1of 43

Programmable Logic

Controller (PLC)
Prof. Vinay J. Patel
Professor, Mechanical Engineering Department
Birla Vishvakarma Mahavidyalaya (Engineering College)
Vallabh Vidyanagar – 388120. Gujarat, INDIA
Programmable Logic Controller (PLC)
• A programmable logic controller (PLC) or programmable controller is an
industrial computer that has been ruggedized and adapted for the control of manufacturing
processes, such as assembly lines, machines, robotic devices, or any activity that requires high
reliability, ease of programming, and process fault diagnosis.
• Dick Morley is considered as the father of PLC as he had invented the first PLC, the Modicon
084, for General Motors in 1968.
• PLCs can range from small modular devices with tens of inputs and outputs (I/O), in a housing
integral with the processor, to large rack-mounted modular devices with thousands of I/O, and
which are often networked to other PLC and SCADA systems.
• They can be designed for many arrangements of digital and analog I/O, extended temperature
ranges, immunity to electrical noise, and resistance to vibration and impact. Programs to
control machine operation are typically stored in battery-backed-up or non-volatile memory.
• PLCs were first developed in the automobile manufacturing industry to provide flexible, rugged
and easily programmable controllers to replace hard-wired relay logic systems. Since then, they
Introduction

have been widely adopted as high-reliability automation controllers suitable for harsh
environments.
• A PLC is an example of a hard real-time system since output results must be produced in
response to input conditions within a limited time, otherwise unintended operation will result.

22-Sep-21 Programmable Logic Controller (PLC): Prof. Vinay J. Patel 2


Programmable Logic Controller (PLC)

• Less wiring.
• Wiring between devices and relay contacts are done in the PLC
program.
• Easier and faster to make changes.
• Trouble shooting aids make programming easier and reduce
downtime.
• Reliable components make these likely to operate for years
before failure.
Advantages

22-Sep-21 Programmable Logic Controller (PLC): Prof. Vinay J. Patel 3


Programmable Logic Controller (PLC)

Definition according to NEMA standard ICS3-1978


• A digitally operating electronic apparatus which uses a
programming 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 modules, various types of machines or process.
Defination

22-Sep-21 Programmable Logic Controller (PLC): Prof. Vinay J. Patel 4


Programmable Logic Controller (PLC)
AMERICAN 1. Allen Bradley JAPANESE
2. Gould Modicon 1. Toshiba
3. Texas Instruments
4. General Electric 2. Omron
5. Westinghouse 3. Fanuc
6. Cutter Hammer 4. Mitsubishi
7. Square D

EUROPEAN 1. Siemens
2. Klockner & Mouller
3. Festo
4. Telemechanique

22-Sep-21 Programmable Logic Controller (PLC): Prof. Vinay J. Patel 5


Programmable Logic Controller (PLC)

• Manufacturing/Machining
• Food/Beverages
• Metal industries
• Power industries
• Mining
• Petrochemical industries
• Process industries
• Many more…
Applications

22-Sep-21 Programmable Logic Controller (PLC): Prof. Vinay J. Patel 6


Programmable Logic Controller (PLC)

• Tank used to mix two liquids

MOTOR
A
FS FLOAT SWITCH

SOLENOIDS B
Typical application

SOLENOID
C
TIMER

22-Sep-21 Programmable Logic Controller (PLC): Prof. Vinay J. Patel 7


Programmable Logic Controller (PLC)

• The control circuit operates as follows:


1. When the start button is pressed, solenoids A and B energize. This permits
the two liquids to begin filling the tank.
2. When the tank is filled, the float switch trips. This de-energizes solenoids A
and B and starts the motor used to mix the liquids together.
3. The motor is permitted to run for one minute. After one minute has elapsed,
the motor turns off and solenoid C energizes to drain the tank.
Typical application

4. When the tank is empty, the float switch de-energizes solenoid C.


5. A stop button can be used to stop the process at any point.
6. If the motor becomes overloaded, the action of the entire circuit will stop.
7. Once the circuit has been energized it will continue to operate until it is
manually stopped.
22-Sep-21 Programmable Logic Controller (PLC): Prof. Vinay J. Patel 8
Programmable Logic Controller (PLC)

POWER
SUPPLY

I M O M
N O U O
P D T D
U U PROCESSOR P U
T L U L
Major components

From E T E To
SENSORS OUTPUT
Pushbuttons, Solenoids,
contacts, contactors,
limit switches, alarms
etc. etc.
PROGRAMMING
DEVICE

22-Sep-21 Programmable Logic Controller (PLC): Prof. Vinay J. Patel 9


Programmable Logic Controller (PLC)

Power supply
• Provides the voltage needed to run the primary PLC components
I/O MODULES
• Provides signal conversion and isolation between the internal logic- level
signals inside the PLC and the field’s high level signal.
PROCESSOR
Major components

• Provides intelligence to command and govern the activities of the entire


PLC systems.

22-Sep-21 Programmable Logic Controller (PLC): Prof. Vinay J. Patel 10


Programmable Logic Controller (PLC)
PROGRAMMING DEVICE
• used to enter the desired program that will determine the sequence of
operation and control of process equipment or driven machine.
• Also kwon as
• Industrial Terminal (Allen Bradley)
• Program Development Terminal (General Electric)
• Programming Panel (Gould Modicon)
• Programmer (Square D)
Major components

• Program Loader (Idec-Izumi)


• Programming Console (Keyence/Omron)
• Types
• Hand held unit with LED / LCD display
• Desktop type with a CRT display
• Compatible computer terminal

22-Sep-21 Programmable Logic Controller (PLC): Prof. Vinay J. Patel 11


Programmable Logic Controller (PLC)

I/O Module
• The I/O interface section of a PLC connects it to external field devices.
• The main purpose of the I/O interface is to condition the various signals
received from or sent to the external input and output devices.
• Input modules converts signals from discrete or analog input devices to
logic levels acceptable to PLC’s processor.
Major components

• Output modules converts signal from the processor to levels capable of


driving the connected discrete or analog output devices.

22-Sep-21 Programmable Logic Controller (PLC): Prof. Vinay J. Patel 12


Programmable Logic Controller (PLC)

I/O Module
DC INPUT MODULE
IS NEEDED TO:
USE TO  Prevent voltage
DROP THE transients from
VOLTAGE damaging the
TO LOGIC processor.
LEVEL Helps reduce the
effects of electrical
noise
Major components

Current Buffer,
FROM Limiting Filter,
OPTO- TO
INPUT Resistor ISOLATOR hysteresis
PROCESSOR
DEVICE Circuits

22-Sep-21 Programmable Logic Controller (PLC): Prof. Vinay J. Patel 13


Programmable Logic Controller (PLC)

I/O Module
AC INPUT MODULE
IS NEEDED TO:
CONVERTS THE AC  Prevent voltage
INPUT TO DC AND transients from
DROPS THE VOLTAGE damaging the
TO LOGIC LEVEL processor.
Helps reduce the
effects of electrical
noise
Major components

Rectifier, Buffer,
FROM Resistor Filter,
OPTO- TO
INPUT Network ISOLATOR Hysteresis
PROCESSOR
DEVICE Circuits

22-Sep-21 Programmable Logic Controller (PLC): Prof. Vinay J. Patel 14


Programmable Logic Controller (PLC)

I/O Module
DC / AC OUTPUT MODULE
IS NEEDED TO:
 Prevent voltage
transients from
damaging the
processor.
Helps reduce the
effects of electrical
noise
Major components

Amplifier
FROM RELAY
TTL OPTO- TO
PROCESSOR ISOLATOR TRIAC
Circuits OUTPUT
X’SISTOR
DEVICE

22-Sep-21 Programmable Logic Controller (PLC): Prof. Vinay J. Patel 15


Programmable Logic Controller (PLC)
The operation of the PLC is determined by 3
steps.
1. Reading the field status form input devices
2. Execution or solving the logic, and
3. Updating the output devices status.
PLC Program
PLC Program is a Logic that is executed by the
CPU. This logic can be written in the form of
Ladder diagram, Instruction List, Sequential
Function Charts, Structured text or Functional
block diagram. These are the languages used
Operation of PLC

for writing logic as per IEC standard. The


program is then downloaded to the PLC. This is
usually done by temporarily connecting the PC
or HHT to the PLC. Once the program is
downloaded to the CPU, it is usually not
necessary for the PC to remain connected.

22-Sep-21 Programmable Logic Controller (PLC): Prof. Vinay J. Patel 16


Programmable Logic Controller (PLC)
PLC Scan
Once the program is downloaded in the
CPU, the PLC is switched to "run" mode
and the PLC executes the application
program. The CPU regularly reads the
status of the input devices, and sends data
to the output devices as per the logical
results after execution of the program. The
process of Initialization when power is
turned on, Reading inputs, Executing logic,
and modifying outputs is called as PLC Scan
Cycle.
Operation of PLC

• Memory
The logic or application program is stored
in memory. As the PLC executes logic, it
may also read and store values to memory.
The values may be referenced by the
application program.

22-Sep-21 Programmable Logic Controller (PLC): Prof. Vinay J. Patel 17


Implementation of Logic Gates

Digitization is a process where continuous analog signal is converted into a


finite number of discrete states. These states are well separated so that
noise does not create errors.
The resulting digital signal has following advantages:
1. storage over arbitrary periods of time.
2. flawless retrieval and reproduction of the stored information
3. flawless transmission of the information
Prerequisites

Some information is essentially digital. Hence it is natural to process and


manipulate such information using purely digital techniques. Examples are
numbers and words.

22-Sep-21 Programmable Logic Controller (PLC): Prof. Vinay J. Patel 18


Implementation of Logic Gates

Boolean Boolean Voltage State Voltage State


Logic Algebra (Positive True) (Negative True)
True (T) 1 High (H) Low (L)
False (F) 0 Low (L) High (H)
Prerequisites

22-Sep-21 Programmable Logic Controller (PLC): Prof. Vinay J. Patel 19


Truth Tables Implementation of Logic Gates

22-Sep-21 Programmable Logic Controller (PLC): Prof. Vinay J. Patel 20


Implementation of Logic Gates

Commutatitve
𝑋+𝑌 =𝑌+𝑋
𝑋𝑌 = 𝑌𝑋
Associative
𝑋 + 𝑌 + 𝑍 = 𝑋 + 𝑌 + 𝑍 = 𝑋 + (𝑌 + 𝑍)
𝑋𝑌𝑍 = 𝑋𝑌 𝑍 = 𝑋(𝑌𝑍)
Distributive
Boolean Algebra

𝑋 𝑌 + 𝑍 = 𝑋𝑌 + 𝑋𝑍
De Morgan’s
𝑋 + 𝑌 = 𝑋ത 𝑌ത
𝑋𝑌 = 𝑋ത + 𝑌ത

22-Sep-21 Programmable Logic Controller (PLC): Prof. Vinay J. Patel 21


Ladder Programming
• Ladder diagram is popular language of programming the PLCs. Ladder diagram shows the
sequence of the logic execution which is presented diagrammatically. In ladder diagram, There
are two vertical lines generally called as Phase (positive) or neutral. Rungs which show current
flow in horizontal direction are the sequence in which the logic executes. The Analogous to
relay, ladder has two main symbols which are contacts and output coil. Generally each rung has
inputs (contacts) on left hand side and outputs (coil) on the right hand side. These contacts and
coils are called as bits of the relays. Each input and output are individual bit in I/O files. An
instruction in ladder instructs PLCs how to respond to the bits in I/O files which are stored in
the memory. Input contacts are the condition area, the conditions must be fulfilled to change
the status of the output coils.

22-Sep-21 Programmable Logic Controller (PLC): Prof. Vinay J. Patel 22


Symbols Ladder Programming

22-Sep-21 Programmable Logic Controller (PLC): Prof. Vinay J. Patel 23


Ladder Programming

AND gate

Solenoid

A B
Output

Input 1 Input 2
Logic functions

AND Gate

22-Sep-21 Programmable Logic Controller (PLC): Prof. Vinay J. Patel 24


Ladder Programming

OR gate Solenoid

B
Output

Input 1
Logic functions

Input 2

OR Gate

22-Sep-21 Programmable Logic Controller (PLC): Prof. Vinay J. Patel 25


Ladder Programming

NOR gate

Solenoid

A B
Output

Input 1 Input 2
Logic functions

NOR Gate

22-Sep-21 Programmable Logic Controller (PLC): Prof. Vinay J. Patel 26


Ladder Programming

NAND gate Solenoid

B
Output

Input 1
Logic functions

Input 2

NAND Gate

22-Sep-21 Programmable Logic Controller (PLC): Prof. Vinay J. Patel 27


Ladder Programming

XOR gate Solenoid

B
Output

Input 1 Input 2
Logic functions

Input 1 Input 2

XOR Gate

22-Sep-21 Programmable Logic Controller (PLC): Prof. Vinay J. Patel 28


Ladder Programming

There are often situations where it is


necessary to hold a coil energised,
even when the input which
energised it ceases. Output

The term latch circuit is used for the Input 1 Input 2


circuit which carries out such an
operation.
It is a self-maintaining circuit in that, Output
after being energised, it maintains
that state until another input is A Latch Circuit
received.
Latching

It remembers its last state.

22-Sep-21 Programmable Logic Controller (PLC): Prof. Vinay J. Patel 29


Ladder Programming

The term internal relay, auxiliary relay or marker is used for what can be
considered as an internal relay in the PLC.
These behave like relays with their associated contacts, but in reality are not
actual relay but simulations by the software of the PLC.
Some have battery back-up so that they can be used in circuits to ensure a
safe shut-sown of plant in the event of a power failure.
Internal relays can be very useful aids in the implementation of switching
sequences.
Internal Relays

Internal relays are often used when there are programs with multiple input
conditions.

22-Sep-21 Programmable Logic Controller (PLC): Prof. Vinay J. Patel 30


Ladder Programming
IR 1
Consider the situation where the
excitation of an output depends on two Input 1
different input arrangements.
Figure shows how we can draw a ladder
diagram using internal relays. Input 2
IR 2
The first rung shows one input
arrangement being used to control the
Input 3 Input 4
coil of internal relay IR 1.
Output
The second rung shows the other input
arrangement controlling the coil of
Internal Relays

IR 1
internal relay IR 2.
The contacts of the two relays are then
put in an OR situation to control the IR 2
output. END

22-Sep-21 Programmable Logic Controller (PLC): Prof. Vinay J. Patel 31


Ladder Programming

Another use of internal relays is for IR


the starting of multiple outputs.
Start Stop
When the start contacts are closed,
the internal relay is activated and IR
latches the input. Output 1

It also starts Output 1 and makes it IR


possible for Output 2 and 3 to be Output 2
activated.
Internal Relays

IR Input
Output 3

IR Input

END

22-Sep-21 Programmable Logic Controller (PLC): Prof. Vinay J. Patel 32


Ladder Programming

Another example of the use of internal


relays is resetting a latch.
When the contacts of the output are Output
momentarily pressed, the output is
energised. Input 1 IR
The contacts of the output are then
closed and so latch the output, i.e. keep
Output
it on even when the contacts of the
IR
input are no longer closed.
Internal Relays

The output can be unlatched by the Input 2


internal relay contacts opening.
This will occur if Input 2 is closed and
energises the coil of the internal chip.

22-Sep-21 Programmable Logic Controller (PLC): Prof. Vinay J. Patel 33


Ladder Programming

An example of the use of a battery-


backed internal relay is shown in figure.
When the contact of Input 1 close, the Battery-
backed IR
coil of the battery-backed internal relay
is energised.
Input
This closes the internal relay contacts
and so even if contacts of the input
open as a result of power failure, the IR
internal relay contacts remain closed. Output
Internal Relays

This means that the output controlled


IR
by the internal relay remains energised,
even when there is a power failure.

22-Sep-21 Programmable Logic Controller (PLC): Prof. Vinay J. Patel 34


Ladder Programming

There are often control situations where sequences of outputs are required.
Figure in next slide shows a pneumatic system with double-solenoid valves
controlling two double-acting cylinders A and B if limit seiches 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.
Sequencing

22-Sep-21 Programmable Logic Controller (PLC): Prof. Vinay J. Patel 35


Ladder Programming

A+

Start b-
B+

A B
a- a+ b- b+ a+
A-

b+
A+ A- B+ B- B-
Sequencing

a-
END

22-Sep-21 Programmable Logic Controller (PLC): Prof. Vinay J. Patel 36


Ladder Programming
A common approach used by PLC
Timer manufacturer is to consider timers to
Input
behave like relays with coils which
Time delay
before activated
when energised result in to closure
or opening of contacts after some
Output
pre-set time.
Timer The timer is thus treated as an
(a) output for a rung with control being
Timer exercised over pairs of contacts else-
Output where (figure (a)).
Input Others consider a timer as delay
Time delay before input
block in a rung which delays signals
in that rung reaching the output
Timer

signal reaches output

(b) (figure (b)).

22-Sep-21 Programmable Logic Controller (PLC): Prof. Vinay J. Patel 37


Ladder Programming
PLCs are generally provided with only a
delay-on timer (TON), small PLCs
possibly having only this type.
Out 1 Out 1
Such at timer waits for a fixed delay
In 1 In 1
period before turning on, e.g. a period
Timer Timer
which can be set between 0.1s to 999s
in steps of 0.1s.
Output
Out 1
IN Q (Consider figure (a) or (b)) When the
Out 2
Input input In 1 is on, the output Out 1 is
Timer
switched on. The contacts associated
with this output then start the timer.
(a) (b) The contacts of the timer will close
after the pre-set time delay. When this
happens, output Out 2 is switched on.
Timer

22-Sep-21 Programmable Logic Controller (PLC): Prof. Vinay J. Patel 38


Ladder Programming
Counters are used when there is a need to count a specified number of contact
operations, e.g. where items pass along a conveyer into boxes, and when the specified
number of items passed into a box, the next item is diverted into another box.
Counter circuits are supplied as an internal feature of PLCs.
In most cases the counter operates as a down-counter. This means that the counter
counts down from the present value to zero, i.e. events are subtracted from the set
value. When zero is reached the counter’s contact changes state.
An up-counter would count up to the pre-set value, i.e. events are added until the
number reaches the set value. When the set value is reached the counter’s contact
changes state.
Different PLC manufacturers de3al with counters in different ways. Some consider the
counter to consist two basic elements one output coil to count input pulses and one to
reset the counter, the associated contacts of the counter being used in other rungs, e.g.
Mitsubishi and Allen-Bradley.
Counters

Other treat the counter as an intermediate block in a rung from which signals emanate
when the count is attained, e.g. Siemens.

22-Sep-21 Programmable Logic Controller (PLC): Prof. Vinay J. Patel 39


Ladder Programming
Figures illustrates a basic counting Counter
Timer

circuit. RST
RST
In 1
In 1
When there is pulse input to In 1, the Counter
CU
counter is reset. CU In 2
In 2 Out 1
When there is an input to In 2, the Out 1
counter starts counting. If the counter Counter
Counter
is set for, say, 10 pulses, then when 10
pulse inputs have been received at In 2, (a) (b)
Timer
the counter’s contacts will close and CTU Q
Out 1
there will be an output from Out 1. In 2
CU

If at any time during the counting there RST CV


is an input to In 1, the counter will be In 1
Counters

reset and start all over again and count PV


for 10 pulses.
(c)

22-Sep-21 Programmable Logic Controller (PLC): Prof. Vinay J. Patel 40


Ladder Programming
A number of internal relays can be grouped to gather to form a register which can provide are for
a series sequence of individual bits.
A 4-bit register would be formed by using four internal relays, an 8-bit using eight.
The term shift-register is used because the bits can be shifted along by 1 bit when there is a
suitable input to the register.
For example, with an 8-bit register we might initially have: 10110101
Then there is an input of a 0 shift pulse: 01011010
With the result that all the bits shift along one place and last bit overflows.
The grouping together of a number of auxiliary registers to form a shift register is done
automatically by a PLC when the shift register function is selected at the control panel.
With the Mitsubishi PLC, this is done by using the programming function SFT (shift) against the
Shift Registers

auxiliary relay number that is to be the first in the register array.


This then causes the block of relays, starting from that initial number, to be reserved for the shift
register.
Thus, if we select M140 to be first relay then the shift register will consider of M140, M141,
M142, M143, M144, M145, M146 and M147.

22-Sep-21 Programmable Logic Controller (PLC): Prof. Vinay J. Patel 41


Ladder Programming
M140
Shift registers have three inputs: one to OUT
load data into first element of the X400
register (OUT), one as the shift
command (SFT) and one for resetting SFT
(RST). X401

With OUT, a logic level 0 or 1 is loaded RST


into the first element of the shift X402
Y140
register.
With SFT, a pulse moves the contents of M140
the register along 1 bit at a time, the Y141
Shift Registers

final bit overflowing and being lost.


M141
With RST, a pulse of the closure of a Y147
contact resets the register contents to
M147
all zeros.
END

22-Sep-21 Programmable Logic Controller (PLC): Prof. Vinay J. Patel 42


Ladder Programming

A whole block of outputs can be


simultaneously turned off or on by
using the same internal relay
contacts in each output rungs.
An alternate way of programming to
achieve the same effect is to use a
master relay.
Master Control

22-Sep-21 Programmable Logic Controller (PLC): Prof. Vinay J. Patel 43

You might also like