0% found this document useful (0 votes)
89 views

Xee Oe1 Unit 4

Programmable logic controllers (PLCs) were developed to simplify the implementation of control automation systems in industrial plants and assembly lines. PLCs use ladder logic programming to minimize control relays and maximize their usage. A PLC consists of a processor, input/output modules, power supply, and communication components. It interfaces between field devices and control systems using digital and analog I/O signals.
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)
89 views

Xee Oe1 Unit 4

Programmable logic controllers (PLCs) were developed to simplify the implementation of control automation systems in industrial plants and assembly lines. PLCs use ladder logic programming to minimize control relays and maximize their usage. A PLC consists of a processor, input/output modules, power supply, and communication components. It interfaces between field devices and control systems using digital and analog I/O signals.
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/ 160

XEE OE1

INDUSTRIAL AUTOMATION
UNIT 4 PROGRAMMABLE LOGIC CONTROLLERS

1
TOPICS COVERED

Evolution of PLC – Sequential and Programmable

controllers – Architecture – Programming of PLC –

Relay logic and Ladder logic – Functional blocks – PLC

interface to pneumatics.
2
PLC
• PLC is a digital computer designed for multiple
inputs and output arrangements, extended
temperature ranges, immunity to electrical noise,
and resistance to vibration and impact.
• A PLC is an example of a real time system.
• PLC implements logic control functions by means of
a program

3
PROGRAMMABLE LOGIC CONTROLLERS

4
Process control & Automation

Recognizing Process the Actuate the


the status Information control elements

Rules &
guidelines
WHY
Advantages ofAUTOMATION
using PLC ?

Higher productivity

Superior quality of end product

Efficient usage of energy and raw materials

Improved safety in working condition


HISTORY OF PROCESS CONTROL & AUTOMATION

PLC Control

Electronics Control

Hard-Wire Control

Manual Control
PROGRAM LOGIC CONTROLLERS (PLC)
(DEFINITION ACCORDING TO NEMA STANDARD ICS3-1978)

A digitally operating electronic apparatus which uses


a programmable memory for the internal storage of
instructions by 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.
PLCs ARE ...

• Similar to a Microcontroller:
• Microprocessor Based
• Onboard Memory for Storing Programs
• Special Programming Language:
Ladder Logic
• Input / Output Ports
9
PLCs ARE...

Dissimilar to Microcontrollers:
• Intended for Industrial Applications
• I/O Designed to interface with Control Relays
• Emphasis on Maximum Reliability

10
1. PLC - INTRODUCTION

How does a PLC differ from a computer?

• A computer is optimized for calculation and display tasks

• A computer is programmed by specialists

• A PLC is designed for (logic) control and regulation tasks

• A PLC is programmed by non-specialists

• A PLC is well adapted to industrial environment


PLCs
• Widely Applied in Every Industry
• Were Developed to Simplify the Implementation of Control
Automation Systems in Plants and Assembly Lines

• Designed to Minimize the Number of Control Relays in a


Process and Maximize the Ways Relays can be Used

• First Applied to Automobile Industry in the Late 1960’s


• Flexible, Reliable and Low Cost
12
HISTORY OF PLC
• PLC was introduced in late 1960’s

• First commercial & successful Programmable Logic


Controllers was designed and developed by Modicon as a
relay replacer for General Motors.

• Earlier, it was a machine with thousands of electronic parts.

• Later, in late 1970’s,the microprocessor became reality &


greatly enhanced the role of PLC permitting it to evolve form
simply relay to the sophisticated system as it is today.
ARCHITECTURE OF PLCs

 PROCESSOR :
• Provides intelligence to command and govern the activities of
the entire PLC systems.
PROGRAMMING LOGIC CONTROLLER
All PLC contain both RAM and ROM memory
 Executive Memory: ROM memory. The operating system is a special machine
language program that runs the PLC
 System Memory: ROM memory. This area is allotted for use of the operating
system only and is not available to the user for programming

 IO Status Memory: RAM memory. This portion of RAM is allocated for the
storage of current I/O status
 DATA Memory: RAM memory -This portion of RAM is allocated timers, counters,
mathematics and process parameters are required, an are of memory must be set
aside for data storage
 User Memory: RAM/EPROM/EEPROM memory - The final area of memory in a PLC
is allocated to the storage of the user program
PROGRAMMING LOGIC CONTROLLER
Programming Langauges
Ladder Langauge
 Scanning of the each rung
 Easy and simple for programming
 Easy for diagnosis
PLC COMPONENTS

17
COMPONENTS OF PLC

18
COMPONENTS OF PLC – A REAL SET UP

19
I/O MODULES

• Input Modules: Input Signals can be AC or DC, Analog or


Digital

• Output Modules: Outputs are either AC or DC Analog Signals


(Although it is possible to ‘Construct’ Digital Outputs)

• Modern PLC’s have Expansion Ports to Increase the Number


of Available Inputs and Outputs
20
EXAMPLES OF I/O SIGNALS
• Inputs:
• Pushbutton (Energizing or Grounding an Input)
• Relay Contact Output
• DC Voltage Level
• Digital Logic Signal (+5V or 0V, etc.)
• Outputs:
• 24 V AC
• 120 V AC
• 120 VDC 21

• etcetera
COMPONENTS OF PLC
• Recommended controller for SCADA systems is
Programmable Logic Controller (PLC).

• PLCs are general-purpose microprocessor based controllers


that provide logic, timing, counting, and analog control with network
communications capability.

• A PLC consists of the required quantities of the following types of


modules or cards, mounted on a common physical support and
electrical interconnection structure known as a rack. 22
COMPONENTS OF PLC
1. Power supply :

Power supply converts facility electrical distribution voltage,


such as 230 VAC, 120 VAC or 125 VDC to signal level voltage
used by the PLC processor and other modules.

2. Processor :

Processor module contains the microprocessor that performs


control functions and computations, as well as the memory
23
required to store the program.
COMPONENTS OF PLC
3. Input / Output (I/O) :

• These modules provide the means of connecting the


processor to the field devices.

• Examples of these modules are Analog Input Module, Analog


output module, Digital input module, Digital output module etc.

• These are used to connect devices between PLC and field


devices like flow transmitters, pressure transmitters, control
valves, analysers, substation feeders for motor control etc. 24
COMPONENTS OF PLC
4. Communication :

• Communications modules are available for a wide range of


industry-standard communication network connections.
• These allow digital data transfer between PLCs and to other
systems within the facility.
• Most commonly used modules are Modbus communication
cards or Serial communication.

• Some PLCs have communications capability built-in to the


25

processor, rather than using separate modules.


COMPONENTS OF PLC
5. Communication Media and Protocols :

• Most common communication media used are copper-wire, coaxial,


fiber-optics, and wireless.

• The most common “open” communication protocols are Ethernet,


Ethernet/IP, and DeviceNet.

• “Open” systems generally provide “plug and play” features in which


the system software automatically recognizes and communicates to
any compatible device that is connected to it.

• Other widely accepted open protocols are Modbus, Profibus, and


26

ControlNet.
COMPONENTS OF PLC
6. Redundancy :

• Many PLCs are capable of being configured for redundant


operation in which one processor backs up another.

• This arrangement often requires the addition of a redundancy


modula, which provides status confirmation and control
assertion between the processors.
• In addition, signal wiring to redundant racks is an option. 27
PLCs USE LADDER LOGIC

• Ladder Logic Diagrams Provide a Method to Symbolically


Show How Relay Control Schemes are Implemented

• Relay Contacts and Coils, Inputs and Outputs lie on


“Rungs” Between the Positive and Ground Rails

28
EXAMPLE OF LADDER DIAGRAM

29
RELAYS
• In General, Relays Transform a Control Signal into a Control Action
• Relays Provide:
Isolation Between Input and Output
Leverage (Small Signal Can Control Large Action)
Automation (Minimize Human Interaction with a Control Process)

30
RELAY COMPONENTS

31
BASIC RELAY SYMBOLS

32
RELAY APPLICATIONS
Relays can be Designed to Perform Many Functions
1. Detect Out of Limit Conditions on Voltages and
Currents
2. Start Motors
3. Prevent Motors from Over Heating
4. Control Assembly Lines
5. Adjust Lighting
33
34
35
PROGRAMMABLE LOGIC CONTROLLERS

36
PROGRAMMABLE LOGIC CONTROLLERS

37
PLC PROGRAMMING LANGUAGES

PLC PROGRAMMING
LANGUAGES

SEQUENTIAL FUNCTIONAL
LADDER STRUCTURED
FUNCTION CHARTS BLOCK DIAGRAM INSTRUCTION LIST (IL)
DIAGRAM(LD) TEXT (ST)
(SFC) (FBD)

38
CONTROLLERS

What type of task might a control system have?


It might be required to control a sequence of events or maintain some
variables and constant or follow some prescribed change.

For example, control system for an automatic drilling machine

39
CONTROLLERS
Requirements

1. To start lowering the drill when the workpiece is in position

2. Start drilling when the drill reaches the workpiece

3. Stop drilling when the drill has produced required depth of hole

4. Retract the drill and

5. Then switch off and

6. Wait for the next workpiece to be put in position before repeating the
operation.
40
CONTROLLERS CONT.…
Control system is used to control the number of items moving along a
conveyor belt and direct them into a packing case.

• Inputs to such control systems might be from switches being closed or


opened,

• e.g. the presence of the workpiece might be indicated by it moving against


a switch and closing it, or

• Other sensors such as those used for temperature or flow rates.

• Controller might be required to run a motor to move an object to some


position, or to turn a valve, or perhaps a heater, on or off. 41
CONTROLLER - EXAMPLES

42
WHAT FORM MIGHT A CONTROLLER HAVE?

• For the automatic drilling machine, we could wire up electrical circuits


in which the closing or opening of switches would result in motors
being switched ON or valves being actuated.

• Thus we might have the closing of a switch activating a relay which,


in turn, switches on the current to a motor and causes the drill to
rotate.

• Another switch might be used to activate a relay and switch on the


current to a pneumatic or hydraulic valve.
WHAT FORM MIGHT A CONTROLLER HAVE?
• This results in pressure being switched to drive a piston in a
cylinder and so results in the workpiece being pushed into the
required position.

• Such electrical circuits would have to be specific to the automatic


drilling machine.

• For controlling the number of items packed into a packing case we


could likewise wire up electrical circuits involving sensors and
motors.

• However, the controller circuits we devised for these two situations


would be different.
CONTROLLER CONTD…

• For controlling the number of items packed into a packing case we could
likewise wire up electrical circuits involving sensors and motors.

• However, the controller circuits we devised for these two situations would
be different.

• In the ‘traditional’ form of control system, the rules governing the control
system and when actions are initiated are determined by the wiring.

• When the rules used for the control actions are changed, the wiring has to
be changed.
45
CONTROL CIRCUIT

46
PLC SYSTEM

47
TYPICAL PLC RACK CONFIGURATION

48
MAJOR COMPONENTS OF A COMMON 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.
MAJOR COMPONENTS OF A COMMON PLC

Processor :
• Provides intelligence to command and govern the activities of the entire PLC
systems.

Programming Device

• Used to enter the desired program that will determine the sequence of
operation and control of process equipment or driven machine.
I/O MODULE OF PLC

 The I/O interface section of a PLC connects it to external field devices.

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

 Output modules converts signal from the processor to levels capable of driving
the connected discrete or analog output devices.
I/O MODULE
DC Input Module
IS NEEDED TO:
USE TO  Prevent voltage
DROP THE transients from damaging
VOLTAGE the processor.
TO LOGIC  Helps reduce the effects of
electrical noise
LEVEL

Current Buffer,
FROM Limiting Filter,
OPTO- TO
INPUT Resistor hysteresis
ISOLAT Circuits PROCESSOR
DEVICE OR
I/O MODULE
AC Input Module
IS NEEDED TO:
CONVERTS THE  Prevent voltage transients from
AC INPUT TO DC damaging the processor.
AND DROPS THE  Helps reduce the effects of electrical
VOLTAGE TO noise
LOGIC LEVEL

Rectifier, Buffer,
FROM Resistor OPTO- Filter, TO
INPUT Network ISOLAT Hysteres PROCESSOR
DEVICE OR is
Circuits
OPOCOUPLER AND INPUT CIRCUIT
29
I/O MODULE IS NEEDED TO:
 Prevent voltage transients from
damaging the processor.
 Helps reduce the effects of
DC/AC Output Module
electrical

noise

Amplifier
FROM RELAY TO
TTL OPTO-
PROCESSOR TRIAC OUTPUT
Circuits ISOLA
X’SISTOR DEVICE
TOR
Output Wiring
I/O CIRCUITS

DIFFERENT TYPES OF I/O CIRCUITS


1. Pilot Duty Outputs :

• Outputs of this type typically are used to drive high-current electromagnetic


loads such as solenoids, relays, valves, and motor starters.

• These loads are highly inductive and exhibit a large inrush current.

• Pilot duty outputs should be capable of withstanding an inrush current of 10


times the rated load for a short period of time without failure.
I/O CIRCUITS

2. General Purpose Outputs :


• These are usually low- voltage and low-current and are used
to drive indicating lights and other non-inductive loads. Noise
suppression may or may not be included on this types of
modules.

3. Discrete Inputs :
• Circuits of this type are used to sense the status of limit
switches, push buttons, and other discrete sensors. Noise
suppression is of great importance in preventing false
indication of inputs turning on or off because of noise.
I/O CIRCUITS
4. Analog I/O :

• Circuits of this type sense or drive analog signals.

• Analog inputs come from devices, such as thermocouples,


strain gages, or pressure sensors, that provide a signal
voltage or current that is derived from the process variable.

• Standard Analog Input signals: 4-20 mA; 0-10V

• Analog outputs can be used to drive devices such as


voltmeters, X-Y recorders, servomotor drives, and valves
through the use of transducers.

• Standard Analog Output signals: 4-20 mA; 0-5V; 0-10V


I/O CIRCUITS

5. Special Purpose I/O :


• Circuits of this type are used to interface PLCs to very specific
types of circuits such as servomotors, stepping motors PID
(proportional plus integral plus derivative) loops, high-speed
pulse counting, resolver and decoder inputs, multiplexed
displays, and keyboards.

• This module allows for limited access to timer and counter


presets and other PLC variables without requiring a program
loader.
INPUT D E V I C E S :

Push Button

Limit Switch

Thumbwheel SW

Level SW

Flow SW
OUTPUT D E V I C E S :
Motor

Solenoid

LED Display

Heater Coil

Lamp
ALLEN-BRADLEY 1746-1A16
L2 I= Input
L1
Module
I:2 slot # in rack

0
P. B. Module
SWITCH Terminal #
Address I:2.0/0
LADDER
PROGRAM
INPUT MODULE
WIRING
DIAGRAM
CONTACTOR
L2 L1 N.O.

MOTOR
L2
C •S OLENOI D
L1 • VALVES
FIELD • LAMP
WIRING • BUZZER

OUTPUT MODULE
WIRING
L1 O:4
L2

CONTACTOR 0
LADDER
PROGRAM
Discrete Input
Discrete input also referred as digital input is an input that is either ON or
OFF are connected to the PLC digital input. In the ON condition it is referred
to as logic 1 or a logic high and in the OFF condition maybe referred to as
logic 0 or logic low.

Normally Open Pushbutton

Normally Closed Pushbutton

Normally Open switch

Normally Closed switch

Normally Open contact

Normally closed contact


IN

OFF PLC
Logic 0
Input
Module
24 V dc

IN

OFF PLC
Logic 1
Input
Module
24 V dc
ANALOG INPUT

An analog input is an input signal that has a continuous signal. Typical inputs
may vary from 0 to 20mA, 4 to 20mA or 0 to10V. Below, a level transmitter
monitors the level of
liquid in the tank. Depending on the level Tx, the signal to the PLC can either
increase or decrease as the level increases or decreases.

Level Transmitter IN

PLC
Analog
Tank Input
Module
DIGITAL
OUTPUT

A discrete output is either in an ON or OFF condition. Solenoids,


contactors coils, lamps are example of devices connected to the
Discrete or digital outputs. Below, the lamp can be turned ON or OFF by
the PLC output it is connected to.

OUT
PLC
Lamp
Digital
Output
Module
PROGRAMMABLE LOGIC CONTROLLER
• Is a special form of microprocessor-based controller
• That uses programmable memory to store instructions and to implement
functions such as
Logic, sequencing, timing, counting, and arithmetic in order to control
machines and processes
• It is designed to be operated by engineers with perhaps a limited
knowledge of computers and computing languages.

71
PROGRAMMABLE LOGIC CONTROLLER
• They are not designed so that only computer programmers can set up or
change the programs.
• Thus, the designers of the PLC have preprogrammed it so that the control
program can be entered using a simple, rather intuitive form of language

72
PLC SYSTEM

73
INTERNAL ARCHITECTURE
• Consists of a Central Processing Unit (CPU)
containing system microprocessor, memory
and input/output circuitry.
• CPU controls and processes all operations
within the PLC.
• PLC is supplied with a clock that has a
frequency of typically between 1 and 8 MHz
• Clock frequency determines the operating
speed of the PLC and provides the timing and
synchronization for all elements in the
system.
74
INTERNAL ARCHITECTURE OF A PLC

75
INTERNAL ARCHITECTURE
• Information within the PLC is carried by means of digital signals.
• Internal paths along which digital signals flow are called buses.
• In the physical sense, a bus is just a number of conductors along which electrical
signals can flow.

• It might be tracks on a printed circuit board or wires in a ribbon cable.


CPU uses data bus for sending data between the constituent elements,

- address bus to send addresses of locations for accessing stored data

- control bus for signals relating to internal control actions.

- system bus is used for communications between input/output ports and


76

input/output unit actions. (Study from Reference Notes)


MEMORY
• To operate the PLC system there is a need for it to access the data to be
processed and instructions, that is, the program, which informs it how the
data is to be processed.
• Both are stored in the PLC memory for access during processing.
• There are several memory elements in a PLC system:
1. System read-only-memory (ROM) gives permanent storage for the
operating system and fixed data used by the CPU.
2. Random-access memory (RAM) is used for the user’s program.
3. Random-access memory (RAM) is used for data.
77
MEMORY
Information is stored on the status of input and output devices and the
values of timers and counters and other internal devices.
The data RAM is sometimes referred to as a data table or register table.
• Part of this memory, that is, a block of addresses, will be set aside for
input and output addresses and the states of those inputs and outputs.
• Part will be set aside for preset data and part for storing counter
values, timer values, and the like.

78
PLC SOFTWARE AND PROGRAMMING
• All software and programming required for the PLC to operate as a
standalone controller is maintained on-board in the processor.

• PLCs are programmed with one of the following standard programming


languages:
1. Ladder Diagrams :

• Used primarily for logic (Boolean) operations and is easily understood by


electricians and control technicians.

• This is the most commonly used language in the USA and is supported by all
PLC suppliers. 79
LOGIC

• The term logic is used because programming is primarily concerned with


implementing logic and switching operations;

for eg., if A or B occurs, switch on C; if A and B occurs, switch on D.

• Input devices (i.e., sensors such as switches) and output devices (motors,
valves, etc.) in the system being controlled are connected to the PLC.

• Operator then enters a sequence of instructions, a program, into the


memory of the PLC.

• Controller then monitors the inputs and outputs according to this program and
carries out the control rules for which it has been programmed. 80
PLC SOFTWARE AND PROGRAMMING
2. Function Block Diagrams :

• Used primarily for intensive analog control (PID) operations and is available
only in “high-end” PLC’s. It is more commonly used outside the United States.

3. Sequential Function Chart :

• Used primarily for batch control operations and is available only in “high-end”
PLC’s.
4. Structured Text :
• It is Used primarily by PLC programmers with a computer language
background and is supported only in “high-end” PLCs.
81
SCADA (Supervisory Control And Data Acquisition)

• SCADA PLCs should be specified to be programmed using ladder diagrams.

• This language is very common, and duplicates in format traditional electrical


schematics, making it largely understandable by electricians and technicians
without specific PLC training.

• Ladder logic functions are the same and equivalent as in hard-wired


relays.
• PLCs in a SCADA system will be networked to one or more central personal
computer (PC) workstations, which provide the normal means of Human
Machine Interface (HMI) to the system. 82
SCADA (Supervisory Control And Data Acquisition)
• These PCs will be provided with Windows-based HMI software that
provides a graphical user interface (GUI) to the control system in which
information is presented to the operator on graphic screens that are
custom-configured to match the facility systems.
For example,
• the electrical system status may be shown on a one-line diagram graphic
in which open circuit breakers are coloured green, closed breakers are
coloured red, and voltage and current values are displayed adjacent to
each bus or circuit breaker.
83
PLCs are recommended for the following reasons :

1. They were developed for the factory floor and have demonstrated high reliability
and tolerance for heat, vibration and electromagnetic interference.

2. Their widespread market penetration means that parts are readily available and
programming and technical support services are available from a large number of
control system integrators.

3. They provide high speed processing, which is important in generator and


switchgear control applications.
4. They support hot standby and triple-redundant configurations for high reliability
applications.

84
(3) Electromechanical relays may be connected together to perform logic
and control functions, acting as logic elements much like digital gates (AND,
OR, etc.).
• A very common form of schematic diagram showing the interconnection
of relays to perform these functions is called a ladder diagram.

85
Ladder Diagrams
• In a “ladder” diagram, the two poles of the power source are drawn as vertical
rails of a ladder, with horizontal “rungs” showing the switch contacts, relay
contacts, relay coils, and final control elements (lamps, solenoid coils, motors)
drawn in between the power rails.

• Ladder diagrams differ from regular schematic diagrams of the sort common to
electronics technicians primarily in the strict orientation of the wiring: vertical
power “rails” and horizontal control “rungs.”
• Symbols also differ a bit from common electronics notation: relay coils are
drawn as circles, with relay contacts drawn in a way resembling capacitors:
86
87
• Unlike schematic diagrams where the association between relay coils and
relay contacts is represented by dashed lines, ladder diagrams associate
coils and contacts by label.

• Sometimes you will find relay contacts labelled identically to the coil (e.g.
coil labelled CR5 and all contacts for that relay also labelled CR5) while
other times you will find suffix numbers used to distinguish
individual contacts within each relay from each other (e.g. coil labelled CR5
and its three contacts labelled CR5-1, CR5-2, and CR5-3).

• Another notable convention in relay circuits and their ladder diagrams is


that each and every wire in the circuit is labelled with a number
88

corresponding to common connection points.


• That is, wires connected together always bear the same number: the
common number designates a condition of electrical commonality (all
points bearing the same number are equipotential to each other).

• Wire numbers only change when the connection passes through a switch
or other device capable of dropping voltage.

• Perhaps the most confusing aspect of relay control circuits is to grasp is


the meaning of normal as it applies to the status of relay contacts. As
discussed previously, the word “normal” in this context – whether it be
the status of hand switches, process switches, or the switch
contacts inside control relays – means “in a condition of rest” or no
89
stimulation.
• In other words, a “normally open” relay contact is open when the relay coil
is unpowered and closed when the relay coil is powered.
• Likewise, a “normally-closed” relay contact is closed when the relay coil is
unpowered and open when the relay coil is powered.
• To illustrate this concept, let us examine a relay control circuit where a
pressure switch activates an alarm light:

90
• Here, both the pressure switch and the relay contact (CR1-1) are drawn as
normally-closed switch contacts.

• This means the pressure switch contact will be closed when the applied
pressure is less than its trip point (50 PSI), and the relay switch contact will
be closed when the relay coil is de-energized.

• When analysing the operation of a relay control system, it is helpful to have


some way to temporarily denote the conductive status of switch contacts
and the energization status of relay coils (i.e. a notation we might sketch
using pencil on a diagram to help us follow the operation of the circuit).

• Use of arrow and “X” symbols to represent power flow and no power flow
91

(respectively).
• These symbols clearly denote component status while
avoiding confusion with the symbols used to denote normal status of
switch contacts.

• In this next diagram, we assume the applied pressure is less than 50 PSI,
leaving the pressure switch in its “normal” (closed) state:

92
• Since the pressure is insufficient to actuate the pressure switch, its contact
remains in the “normal” state (closed).

• This sends power to relay coil CR1, thus actuating contact CR1-1
and holding it in the open state. With CR1-1 contact open, the alarm lamp
receives no power.

• In this example we see the pressure switch in its “normal” state but the
relay in the actuated state.

• Using arrow and “X” symbols again to represent the presence or absence of
power in this circuit, we will now analyze its status with an applied switch
pressure greater than 50 PSI: 93
• Now that there is sufficient fluid pressure applied to the switch to
actuate it, its contact is forced into the actuated state which for this
“normally-closed” switch is open.

• This open condition de-energizes relay coil CR1, allowing relay contact
CR1-1 to spring-return to its normal status (closed), thus sending power
to the alarm lamp.

• From this analysis we see that the lamp fulfils the function of a high
pressure alarm, energizing when the applied pressure exceeds the trip
point.

• Where we typically find themselves confused is assuming the switch


contact will be in the same state it is drawn in. This is not necessarily
94

true.
• The way switch contacts are drawn merely reflects their normal status as defined
by the switch manufacturer, which means the status of the switch when there is no
(or insufficient) actuating stimulus present.
• Whether or not the switch will actually be in its normal state at any given time is a
question of whether or not a sufficient stimulus is present to actuate that switch.
• Just because a switch is drawn normally-closed does not necessarily mean it will be
closed when you go to analyze it.
• All it means is that the switch will be closed when nothing actuates it.
• This exact same principle applies to relay ladder-logic programming in electronic
control systems called PLCs (Programmable Logic Controllers).
95
• In a PLC, a digital microprocessor performs the logic functions traditionally provided
by electromechanical relays, with the programming for this microprocessor taking the
form of a relay diagram (also called a “ladder-logic” diagram).

96
ELEVATOR PLC LADDER LOGIC
• Design a PLC program to execute elevator system in a 2 floor
apartment using Allen Bradley PLC programming.
• Elevator PLC Logic
There are totally two floors.
There are two user panels.
One is inside the lift and other is outside
the lift.
Limit switches are used to locate and
stop the lift at each floor.
Priority is given to the first input.

97
ELEVATOR LOGIC INPUTS AND OUTPUTS

98
ELEVATOR PLC LOGIC

99
100
101
102
103
104
ELEVATOR LOGIC DESCRIPTION
RUNG 0000
• Latching rung to operate the system through Master Start and Stop PB.
RUNG 0001
• Starting the Operation using start latch, Ground floor PB is pushed to turn on
latch coil to store the output of status when ground limit switch is off.
RUNG 0002
• First floor PB is pushed to turn on latch coil to store the output of status when
First limit switch is off.
RUNG 0003
• Secondfloor PB is pushed to turn on latch coil to store the output of status
105

when Second limit switch is off.


RUNG 0004, 0005, 0006
• In some case ,if someone pressed ground floor PB/First floor PB , program will check
where the lift is, if it is in second floor or first floor, Down Motor will turn ON to get the lift to
respective floor.

• For interlocking, normally closed switch of ground limit switch and first floor switch is used
in Rung 0006

RUNG 0007, 0008, 0009


• In some case, if someone pressed second floor PB/First floor Push buttons (PB), program
will check where the lift is, if it is in ground floor or first floor, UP Motor will turn ON to get
the lift to respective floor.

• For interlocking, normally closed switch of second floor limit switch and first floor switch
106 is
used in Rung 0009
RUNG 0010, 0011
• To open the lift door when it reaching floor
Binary bits are used to store
the status of ground floor PB and ground Limit switch.
RUNG 0012, 0013
• To open the lift door when it reaching floor ,Binary bits are used to store
the status of First floor PB and First Limit switch.
RUNG 0014, 0015
• To open the lift door when it reaching floor ,Binary bits are used to store
the status of Third floor PB and third floor Limit switch.
RUNG 0016
• From the previous rungs memories, Open door motor is turned ON with 107

three interlocking like closed door motor, Timer enable, UP/DOWN motor.
RUNG 0017
• When open door limit switch is turned to on, Open motor door should
stop and timer need to turn on to give time delay of 5s to close door
motor.
RUNG 0018
• When timer done turned on, close door motor should ON until closed
limit switch is turned ON.
RUNG 0019
• If no PB is turned on after getting into lift takes 10secs delay to open
lift door again. If any PB is pressed, it will perform the respective
operations.
Program runs continuously until STOP PB is pressed 108
BLOCK DIAGRAM OF A PLC

LEDs Outputs

Inputs
PROGRAMMING EXAMPLE
LOGIC PROGRAM FOR START/STOP OF MOTOR :

X1 X2 Y1

Y1
PROGRAMMING PLC
STARTING OF MOTOR
CONTINUOUS RUNNING OF MOTOR WHEN
START BUTTON IS RELEASED:
TO STOP THE MOTOR
ADVANTAGES OF PLCs

 Reliability.
 Flexibility in programming and reprogramming.
 Cost effective for controlling complex systems.
 Small physical size, shorter project time.
 High speed of operation.
 Ability to communicate with computer systems in the plant.
 Ease of maintenance /troubleshooting.
 Reduced space.
 Energy saving.
DISADVANTAGES OF PLCS

• PLC devices are proprietary it means that part or


software of one manufacturer can’t be used in
combination with parts of another manufacturer.

• Limited design and cost option

• Fixed Circuit Operations.


• PLCs manufacturers offer only closed architectures.
APPLICATIONS
• Wherever automation is desired the PLCs are best suited to meet the task.

• Few examples of industries where PLCs are used :

1. Robots manufacturing and control

2. Car park control

3. Train control station system

4. Food processing
5. Materials handling
6. Machine tools
7. Conveyer system etc.
APPLICATIONS

8. Manufacturing / Machining

9. Food / Beverage

10. Metals

11. Power

12. Mining

13. Petrochemical / Chemical


118
PROGRAMMING LANGUAGES
&
BASIC INSTRUCTIONS
CONTENTS
• PLC Set/Reset Instructions
• What is PLC Programming • Basic Instructions
Language? • Other PLC Instructions
• How PLC Programming • Ladder Diagram
Languages were formed?
• Functional Block Diagram
• Which PLC Programming
Language to choose?
• Structured Text
• Basic Instructions • Instruction List
Load / Input instructions • Sequential Function Chart
Store/Output Instructions
Timer/Counter Instruction 26-10-2022 120
PLC
• A programmable logic controller (PLC) or programmable controller is
an industrial digital computer that has been used for the control
of manufacturing processes or any activity that requires high
reliability, ease of programming, and process fault diagnosis.

• 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.
• A programming language is a formal language comprising a
set of instructions that produce various kinds of output.
• Programming languages are used in computer programming to
implement algorithms.
• Most programming languages consist of instructions for
26-10-2022 121
computers.
WHAT IS PLC PROGRAMMING LANGUAGE?
•A programming language (instructions for computers) is a
formal language comprising a set of instructions that produce
various kinds of output and for updating the system.
• Programs that allow for such updates are often written on a PC,
and then transferred via cable or USB to the PLC itself.
• These programs are stored in non-volatile memory (or battery
backed-up) to ensure that the processes they are designed to
control continue to run smoothly.

26-10-2022 122
HOW PLC PROGRAMMING LANGUAGES
WERE FORMED?
• IEC 61131 (earlier as IEC 1131) is an International Electrotechnical
Commission (IEC) standard for programmable controllers.
• IEC 61131-3 i.e, the third part (out of 10) of the IEC 61131, deals with basic
software architecture and programming languages of the control program
within PLC. It defines three graphical and two textual programming language
standards.

26-10-2022 123
PROGRAMMING LANGUAGES

Ladder diagram (LD), graphical


Function block diagram (FBD), graphical
Structured text (ST), textual
Instruction list (IL), textual
Sequential function chart (SFC), graphical.

124
WHICH PLC PROGRAMMING LANGUAGE TO
CHOOSE?
The choice of a specific PLC programming language can depend on
the following factors:
• Industry/workplace requirement
• Application specific
• PLC specifications and available software packages
• Complexity of the task
• Programmer’s interest

26-10-2022 125
BASIC INSTRUCTIONS
Load / Input instructions
• Examine if Closed (XIC) Relay Logic Instructions
• Examine if Open (XIO)
• Positive Transition Sense (PTS) Input transition
sensing Instructions
• Negative Transition Sense (NTS)

26-10-2022 126
Store / Output instructions
• Output Energize (OTE)
• Negative Output Energize (NOE)
• Output Latch/Set and Output Unlatch/Reset (OTL), (OTU)
Timer instructions
• TON, TOFF, RTO
Counter instructions
• CTU, CTD
Set/Reset Instructions
• RES

127
LOAD/INPUT INSTRUCTIONS

26-10-2022 128
LOAD-RELAY LOGIC INSTRUCTIONS
• Examine if Closed (XIC)
If the input device is ON or Closed, then
the corresponding bit in the data memory
is set to true, thus allowing (conceptually)
the energy to flow from its left side to its
right-hand side. Otherwise, it is set to
false, thus blocking the energy.

• Examine if Open (XIO)


If the input device is OFF or Open, then
the corresponding bit in the data memory
is set to true, thus allowing (conceptually)
the energy to flow from its left side to its
right-hand side. Otherwise, it is set to
false, thus blocking the energy. 26-10-2022 129
LOAD-INPUT TRANSITION SENSING
INSTRUCTIONS
• Positive Transition Sense (PTS)
The condition of the right link is ON
for one ladder rung evaluation
when a change from OFF to ON at
the specified input is sensed.

• Negative Transition Sense (NTS)


The condition of the right link is ON
for one ladder rung evaluation
when a change from ON to OFF at
the specified input is sensed
26-10-2022 130
STORE/OUTPUT INSTRUCTIONS

26-10-2022 131
STORE/OUTPUT INSTRUCTIONS
• Output Energize (OTE)
If the condition of the left link of
the OTE is ON then the
corresponding bit in the output data
memory is set. The device wired to
this output is also energized.

• Negative Output Energize (NOE)


If the condition of the left link of the
OTE is OFF then the corresponding
bit in the output data memory is set.
The device wired to this output is 26-10-2022 132
also energized.
• Output Latch/Set and Output Unlatch/Reset (OTL),
(OTU)
If the condition of the left link of the OTL is momentary
ON then the corresponding bit in the output data memory
is set, and remains set even if the condition switches to
the OFF state. The output will remain set until the
condition of the left link of the OTU is momentary ON.

133
TIMER INSTRUCTIONS
Timer Instructions are output instructions used to provide time
intervals for which the rung conditions are true (TON), or false (TOF).
These are software timers. Their resolution and accuracy depend on
a tick timer maintained by the microprocessor.
Each timer instruction has
2 integer values:
• Accumulated Value (ACC): The current number of ticks (time-base
intervals) that have been counted from the moment that the timer has
been energized.
• Preset Value (PR): A predetermined value set by the programmer.
When the accumulated value is equal to, or greater than the preset
value, a status bit is set.
26-10-2022 134
2 Status bits:
• Timer Enable Bit (EN): This bit is set when the rung condition to the left of the
timer instruction is true. When this bit is set, the accumulated value is
incremented on each time-base interval, until it reaches the preset value.
• Done Bit (DN): This bit is set when the accumulated value is equal to the preset
value. It is reset when the rung condition becomes false.

135
TIMER ON-DELAY (TON) INSTRUCTION

The TON instruction begins to


count when its input rung
conditions are true. The
accumulated value is reset when
the input rung conditions
become false.

26-10-2022 136
TIMER OFF-DELAY (TOF) INSTRUCTION
• The TOF instruction
begins to count when its
input rung makes a true-
to-false transition, and
continues counting for as
long as the input rung
remains false.
• The accumulated value is
reset when the input rung
conditions become false.
26-10-2022 137
RETENTIVE TIMER (RTO) INSTRUCTION
• The RTO instruction begins
to count when its input rung
conditions are true.
• The accumulated value is
retained when the input rung
conditions become false, and
continues counting after the
input rung conditions
become true.

26-10-2022 138
COUNTER INSTRUCTIONS
Counter Instructions are output instructions used to count
false-to-true rung transitions. These transitions are usually
caused by events occurring at an input.

• These counters can be UP (incrementing) or DOWN


(decrementing).
2 integer values:
• Accumulated Value (ACC): This is the current number of the
counter. The initial value is zero.
• Preset Value (PR): This is a predetermined value set by the
programmer. When the accumulated value is equal to, or
greater than the preset value, a status bit is set.

26-10-2022 139
2 status bits:
• Counter Enable Bit (EN): This bit is set when a false-to-true rung condition
to the left of the counter instruction is detected.
• Done Bit (DN): This bit is set when the accumulated value is equal to the
preset value. It is reset when the rung condition becomes false.

NOTE: The maximum count value is 9999*. After a maximum count is


reached, the counters reset and start counting from zero.

140
COUNT-UP (CTU) INSTRUCTION
The CTU
instruction increments
its accumulated value
on each false-to-true
transition at its input,
starting from 0.

26-10-2022 141
COUNT-DOWN (CTD) INSTRUCTION
• The CTD
instruction decrements
its accumulated value
on each false-to-true
transition at its input,
starting from 0.

26-10-2022 142
THE RESET (RES) INSTRUCTION
• The RES instruction resets timing and
counting instructions.
• When the RES instruction is enabled it
resets the following:
Counter’s:
• Accumulated value
• Counter Done Bit
• Counter Enabled Bit
Timer’s:
• Accumulated value
• Timer Done Bit
• Timer Timing Bit
• Timer Enable Bit 26-10-2022 143
OTHER PLC INSTRUCTIONS
• Relay-type (Basic) instructions: I, O, OSR, SET, RES, T,
C
• Data Handling Instructions.
• Data move Instructions: MOV, COP, FLL, TOD, FRD,
DEG, RAD (degrees to radian).
• Comparisoninstructions: EQU (equal), NEQ (not equal),
GEQ (greater than or equal), GRT (greater than).
• Mathematical instructions.
• Continuous Control Instructions ( PID instructions ).
26-10-2022 144
• Program flow control instructions: MCR (master control reset), JMP, LBL,
JSR, SBR, RET, SUS, REF
• Specific instructions:
• BSL, BSR (bit shift justify/right), SQO (sequencer output), SQC
(sequencer compare), SQL (sequencer load).
• High-speed counter instructions: HSC, HSL, RES, HSE
• Communication instructions: MSQ, SVC
• ASCII instructions: ABL, ACB, ACI, ACL, CAN

145
LADDER DIAGRAM -BRIEF
•A Ladder Diagram is one of the oldest, simplest and
universally practiced method used to program a PLC.
• It is a graphical programming language that evolved from
electrical relay circuits.
• Each program statement is represented with a horizontal
line, called the rung, that has all relevant inputs to the
left and the output to the right.

26-10-2022 146
• The output device of a rung is energized if electric power can
conceptually flow from the left side of the rung to the right side.
• Input devices are assumed to block the flow of power if they are not
activated.
• During the execution of a ladder diagram, the PLC reads the states of all
inputs, then determines the states of all outputs starting from the rung at the
top side, going down to the last rung, and finally updates the state of the
output devices.

147
PARTS OF A LADDER PROGRAM

• Rungs
• Branches
• Inputs and Outputs for PLC programming
• Addressing Inputs and Outputs
• Instructions

26-10-2022 148
LADDER DIAGRAM(LD)
(RAIL AND RUNGS IN PLC LD)

26-10-2022 149
LADDER DIAGRAM(LD)

NOTE:
Difference between a switch and a push button
•A push button need to be activated whereas a toggle switch is
where it was left last time.
•Power down and power up means re-activating your PB but the
toggle switch will remains in place.
•So function like (Ex: auto/man) are best with Selector switches 26-10-2022 150
BUT actions need PB (Ex: Start/Stop)
NAMING CONVENTION : ADDRESSING
• During the development of a PLC program, we must use specific
names to identify the inputs, outputs, memory flags, timers, and
counters.
• A typical naming convention is to identify inputs with the letter “I” and
outputs with the letter “O”, followed by a 1-digit number that identifies
the slot number and a 2-digit number that identifies the position of the
input or output in the slot.
• For example:
• I1:00 refers to the first input of slot 1
• O2:00 refers to the first output of slot 2.
• Some manufactures number the inputs or outputs starting from 00,
while others use the number 01 to identify the first input or output. It
26-10-2022 151
is also common to use numbers like 400 e.t.c.
NAMING CONVENTION : ADDRESSING
1. ABB PLC
• Input Address: I0, I1, I2,…………, In.
• Output Address: Q0, Q1, Q2, Q3, …, Qn.
2. Siemens PLC
• File types Byte Number.Bit Number
• Input Address: I0.0, I0.1, I0.2, I0.3,……. I0.7.
• Output Address: Q0.0, Q0.1, Q0.2, Q0.3,…….
Q0.7.
26-10-2022 152
3. AB PLC
• File type: Slot Number. Word Number/ Bit Number
• Input Address: I:0.0/0, I:0.0/1, I:0.0/2, I:0.0/3, ………..,
I:0.0/7.
• Output Address: O:0.0/0, O:0.0/1, O:0.0/2, O:0.0/3, ………..,
O:0.0/7.
4. Delta PLC & Mitsubishi PLC
• Input Address: X0, X1, X2, X3……….., Xn.
• Output Address: Y0, Y1, Y2, Y3, ……….., Yn.

153
RULES FOR PLC LADDER DIAGRAM
PROGRAMMING

1.Inputs can be used in Series as well as Parallel to form a


connection
2. Outputs (or coil) can be used only in Parallel
3. One Input can be used in multiple times in one program
4. One Output cannot be used multiple times in one program,
except in Set/Reset and Latch/ Unlatch functions
5. Input Address cannot be used as an Output Address
6. Outputs Address can be used as Inputs Address

26-10-2022 154
PROGRAM (ONLY CONTACTS)
• Write a program to develop
motor start/stop control
station with a pilot lights i.e.,
start switch is normally open
pushbutton and stop switch
is normally closed
pushbutton.
• When motor is ON, Green
pilot light should be ON and
when motor is OFF, Red
pilot light should be ON. 26-10-2022 155
PROGRAM (TIMERS)
The process involves pumping fluid from
tank A to tank B. The operation of the
process can be summarized as
follows:

• Before starting, PS1 must be closed.


• When the start button is pushed, the
pump starts. The button can then be
released and the pump continues to
operate.
26-10-2022 156

When the stop button is pushed, the pump stops.
• PS2 and PS3 must be closed 5 s after the pump starts. If
either PS2 or PS3 opens, the pump will shut off and will not
be able to start again for another14s.

157
PROGRAM (COUNTERS)
Figure shows an up/down-counter program that will
increase the counter’s accumulated value when
Pushbutton PB1 is pressed and will decrease the
counter’s accumulated value when pushbutton PB2is
pressed.

The operation of the program can be summarized as


follows:

26-10-2022 158
• When the CTU instruction is true, C5:2/CU will be
true, causing output A to be true.
• When the CTD instruction is true, C5:2/CD will be
true, causing output B to be true.
• When the accumulated value is greater than or equal
to the preset value, C5:2/DN will be true, causing
output C to be true.
• Input C going true will cause both counter
Instructions to reset. When reset by the RES
instruction, the accumulated value will be reset to 0
159
and the done bit will be reset.
PROS & CONS OF LADDER DIAGRAM (LD)

 
• Most popular PLC Language • Limited instruction.
• Online debugging and editing i.e., difficult to model motion or
• Easy to read and comment batching, because ladder logic
strictly adheres to the on/off logic
of hard-wired relays.

26-10-2022 160

You might also like