Chapter Two: Programmable Logic Controllers (PLC)
Chapter Two: Programmable Logic Controllers (PLC)
PROGRAMMABLE LOGIC
CONTROLLERS(PLC)
Prep. by Natnael.M
Objectives
• To define the basic components of a PLC
• To understand about counter ,timer and relay
• To program a PLC
• To implement a PLC control program and
hardware
Introduction to PLC
PLC stands for Programmable Logic Controller.
They are industrial computers used to control
different electro-mechanical processes for use in
manufacturing, plants, or other automation
environments
It continuously monitors the input values from
various input sensing devices (e.g. accelerometer,
potentiometer ….. etc.) and
it produces corresponding output depending on
the nature of production and industry.
Parts of PLC
A typical block diagram of PLC consists of five
parts namely:
1.Rack or chassis
2.Power Supply Module
3.Central Processing Unit (CPU)
4.Input & Output Module
5.Communication Interface Module
1. Rack or chassis
• In all PLC systems, the PLC rack or chassis
forms the most important module and acts as a
backbone to the system.
• PLCs are available in different shapes and sizes.
• When more complex control systems are
involved, it requires larger PLC racks.
• All I/O modules will be residing inside this
rack/chassis.
2.Power Supply Module
• This module is used to provide the required
power to the whole PLC system.
• It converts the available AC power to DC power
which is required by the CPU and I/O module.
• It generally works on a 24V DC supply.
• Few PLC uses an isolated power supply
3. CPU Module and Memory
• CPU is the brain of PLC
• CPU module has a central processor, ROM &
RAM memory.
• ROM memory includes an operating system,
drivers, and application programs.
• RAM memory is used to store programs and
data.
• CPU reads the input data from sensors,
processes it, and finally sends the command to
controlling devices
3. Input and Output Module
• PLC has an exclusive module for interfacing
inputs and output, which is called an input &
output module.
• Input devices can be either start and stop
pushbuttons, switches, etc and output devices can
be an electric heater, valves, relays, etc.
• I/O module helps to interface input and output
devices with a microprocessor.
Continued..
The input module of PLC is explained in the below
figure
CONTINUIED …
Continued..
The operating of the circuit diagram as shown
in above can be explained as
•Input module interface receives the signal from
process devices at 220 V AC
•Then it converts the input signal to 5 V DC
that can be used by PLC
•The isolator block also prevent a PLC from
undergoing fluctuation
•Then the signal is sent to the output
Continued..
There are two main sections in the input module
namely the power section and the logical section.
Both sections are electrically isolated from each
other.
Initially push button is closed. So, 220 V AC
supply is given to the bridge circuit through the
resistors R1 and R2.
A bridge rectifier is used to convert the AC signal
into DC and Zener diode is used to provide a low
voltage supply to LED.
Out put module
The output module of PLC works similarly to the
input module but in the reverse process.
It interfaces the output load and processor.
So here the first section would be logic session
and the power section comes next.
The working of the output module is shown in the
below figure
Continued..
4. Communication Interface
Module
• To transfer information between CPU and
communication networks, intelligent I/O modules
are used.
• These communication modules help to connect
with other PLCs and computers which are placed
at a remote location
PURPOSE OF Programmable
Logic Controllers (PLCs)
• Initially designed to replace relay logic
boards
– Sequence device actuation
– Coordinate activities
• Accepts input from a series of switches
• Sends output to devices or relays
FUNCTIONS OF
CONTROLLERS
1) on-off control,
2) sequential control,
3) feedback control, and
4) motion control.
CONTROL
1) mechanicalDEVICES
control - cam, governor, etc.,
2) pneumatic control - compressed air,
valves, etc.
3) electromechanical control - switches,
relays, a timer, counters, etc,
4) electronics control - similar to
electromechanical control, except uses
electronic switches.
5) computer control.
Continued…
What type of device/instruction is interacting
with PLC?
1. SWITCHES
Non-locking Locking
SPDT
P1
DPST
P2
Break-before-make Make-before-break
TERM
Throw - number of states S
Pole - number of connecting moving parts (number of individual circuits).
SPDT
DPST
TYPES OF
SWITCHES
1. Basic switch, operated by a mechanical level,
2. Push-button switch,
3. Slide switch,
4. Thumbwheel switch,
5. Limit switch,
6. Proximity switch, and
7. Photoelectric switch.
contact
coil
input
a. Normally open -| |-
b. Normally closed -|/|-
c. Off-on transitional -||-
d. On-off transitional -| |-
Coil:
a. Energize Coil -( )-
b. De-energize -(/)-
c. Latch -(L)-
d. Unlatch -(U)-
3. COUNTER
A counter is a PLC instruction that either
increments (counts up) or decrements (counts
down) an integer number value when prompted
by the transition of a bit from 0 to 1 (“false” to
“true”).
Counter instructions come in three basic types: up
counters, down counters, and. up/down counters
3.1 UP counters:
• Up counter is an increment counter which
means it counts “up” with each off-to-on
transition input to its “CU” input.
CONTINUED…
Whenever there is a true value entry in the CU
input, the counter will turn on and CV will display
the count.
This counter output must be activated whenever
the current value is equal to or greater than the pre-
set value (Q is active if CV ≥ PV).
The counter output instruction will increase by 1
each time the counted event occurs
Example program for UP
counter
CONTINUED…
• Operating pushbutton PB1 provides the off-to-on
transition pulses that are counted by the counter.
• The pre-set value of the counter is set to 7.
• Each false-to-true transition of rung 1 increases
the counter’s accumulated value by 1.
• After 7 pulses, or counts, when the pre-set
counter value equals the accumulated counter
value, output DN is energized.
• As a result, rung 2 becomes true and energizes
output O:2/0 to switch the red pilot light on.
CONTINUED…
• At the same time, rung 3 becomes false and de-
energizes output O:2/1 to switch the green pilot
light off.
• The counter is reset by closing pushbutton PB2,
which makes rung 4 true and resets the
accumulated count to zero.
• Counting can resume when rung 4 goes false
again
3.2 Down counter:
CONTINUED…
The down-counter instruction will count down or
decrease by 1 each time the counted event occurs.
Each time the countdown event occurs, the
accumulated value decreases.
Normally, the down counter is used together with
the ascending counter to form an up / down
counter
Example for Down counter:
• One application for an up/down-counter is to keep
count of the cars that enter and leave a parking
garage. A typical PLC program that could be used
to implement this.
• The operation of the program can be summarized
as follows:
• As a car enters, the enter switch triggers the up
counter output instruction and increments the
accumulated count by 1.
CONTINUED…
• As a car leaves, the exit switch triggers the down
counter output instruction and decrements the
accumulated count by 1.
• Because both the up- and down-counters have the
same address, C5:1, the accumulated value will be
the same in both instructions as well as the pre-
set.
CONTINUED…
CONTINUED…
• Whenever the accumulated value of 150 equals
the pre-set value of 150, the counter output is
energized by the done bit to light up the Lot Full
sign.
• A reset button has been provided to reset the
accumulated count
3.3 Up-Down counter
the function of Up and
Up-Down counter do both
Down counters
CONTINUED…
• The counter will increase (count up) when sensor
B de-energizes only if sensor A is already in the
deactivated state (ie beam A breaks before B).
• The counter will decrease (countdown) when
sensor A is de-energized only if sensor B is
already in the de-energized state (ie, beam B
breaks before A).
CONTINUED…
The up / down counter has a “reset” input (R) and
a “load” (“LD”) input to force the current value.
Activating the reset pin forces the counter to set
zero, activating the load input forces the current
value of the counter to the pre-set value (PV)
4. TIMER
PLC timer is an element in ladder logic
programming taken from electrical systems.
Timers are devices that count time increments. ...
Simply, when the input is activated the timer starts
its operation keeping track of the time. When this
time exceeds the programmed time then the timer
activates its output.
On Delay Timer (TON)
This is the most used timer in PLC programming.
The functionality of the on delay timer (TON) can
be described like this:
Output is turned ON after a delay
When you turn on the input (IN) the timer will
start timing (turning on the timer).
Elapsed time (ET) is the current time of the
timer.
Continued…
Off Delay Timer (TOF)
The second standard PLC timer is the off delay
timer.
Output is turned OFF after a delay
As soon as you turn on the input of this timer, the
output is also turned on.
As shown below the Off Delay timer diagram the
timer will not be activated before you turn the input
off again.
When you do that the timer will start counting and
after the delay, the output will be turned off.
Continued…
LADDER
A ladder diagram (also called contact symbology) is a
DIAGRAM
means of graphically representing the logic required in a
relay logic system.
Rail
start emergency stop
PB1 PB2
R1
Rung R1
R1
A
Ladder Representation
LOGIC
STATES
ON : TRUE, contact closure, energize, etc.
OFF: FALSE, contact open , de-energize,
etc.
Do not confuse the internal relay and program with the external
switch and relay. Internal symbols are used for programming.
External devices provide actual interface.
R1 = PB1.AND.PB2
PB1 R1
PB2
OR
COMBINED AND & OR
R1 = PB1 .OR. (PB2 .AND. PB3)
PB1 R1
pb3
PB2
SEQUENCE
R can be segmented into steps.
Sequencers are used with machines or processes involving
repeating operating cycles which
Output
Step A B C Dwell time
1 ON OFF OFF 5 sec.
2 ON ON OFF 10 sec.
3 OFF OFF ON 3 sec.
4 OFF ON OFF 9 sec.
Programming a PLC Assignment
Submitting day 10/03/2022
1. Oil is consumed randomly. The tank needs to be
refilled by turning on a pump. Two hydrostatic
switches are used to detect a high and low level.
Continued..
A .Write a program using ladder diagram
B. Explain the working principles by listing each
component and
2.Write a ladder logic program for a traffic lighting
Main street
Jefferson street
Cycle time
Main 3 1 4
Jefferson 5 1 2