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

IA Module4 Rev21

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

IA Module4 Rev21

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 23

Industrial Automation – Module IV

INDUSTRIAL AUTOMATION
COURSE CODE: 5042 (REV 2021)
PROGRAMMABLE LOGIC CONTROLLER
MODULE IV NOTES

1
Industrial Automation – Module IV

Introduction to PLC (Programmable Logic Controller)


Programmable logic controllers are microcomputers (computer based) that perform control
functions in a variety of processing plant and factory environments. This was originally intended as
replacement equipment for relays in automotive industries. Now PLCs are important part of
automation equipment in many industries. PLCs are similar to computers, but they are designed for
control and industrial applications.
A Programmable Logic Controller (PLC) is an industrial computer control system that
continuously monitors the state of input devices and makes decisions based upon a program
to control the state of output devices.
A PLC produces ON/OFF voltage outputs and can actuate elements such as electric motors,
solenoids (and thus pneumatic and hydraulic valves), fans, heaters and light switches.

Some PLC manufacturers


• Allen Bradley
• ABB
• Siemens
• Hitachi
• Mitsubishi
• General Electric (GE)
• Honeywell

Architecture of PLC

2
Industrial Automation – Module IV

A PLC architecture consists of the following main units:


1. Power supply
It provides the isolation necessary to protect the solid state components from high voltage
spikes. It converts power line voltages to those required by the solid state components. It is rated
for heat dissipation requirements for plant operations. It drives other units of PLC such as I/O
unit, CPU, memory unit and peripheral devices.
2. Input/Output (I/O) system
Inputs are defined as the real world signals giving the controller, the status of the process.
They can be analog or digital or having high or low frequency. Signals from thermocouples and
RTDs (Resistance Temperature Detectors) are common examples of analog signals. Push
buttons, relay contacts etc can give digital inputs.
Input module is used to interface between the input device to CPU. The function of this interface
is to receive and convert field signals (push button, limit switch, proximity switch , circuit breaker,
relay etc.) into a form that can be used by the CPU.
Output module is used to interface between CPU and output device. The output interface performs
the opposite function of the input interface. It connects CPU to several output devices like solenoid
valves, lamp box, panel meters and displays or motor speed drives.
3. Central Processing Unit
It is also called the central control unit. It performs tasks necessary to fulfil the PLC function
such as scanning, I/O bus traffic control, program execution, external device communication and
self diagnostics.
4. Memory Unit
It is the unit where the program containing the control actions to be exercised by the
processor is stored. The data from input modules and the data for output modules are also
temporarily stored in the memory unit
5. Programmer Unit
It provides an interface between the PLC and user during the program development, start up
and trouble shooting. The instructions to be performed during each scan are coded and inserted
into the memory with the programmer unit. It can be small hand held units (size of a large
calculator) to desktop standalone units. Nowadays computers are used which can be interfaced
with the PLC using a serial module. Programming can be done offline (programming unit not
connected to the PLC while editing) or online (editing of program while the PLC is working)

3
Industrial Automation – Module IV

6. Peripheral devices
They are divided into several categories like programming aids, operational aids, I/O
enhancements and computer interface devices.
Programming aids provide documentation and program recording capabilities- can be done
using PC compatible software.
Operational aids include variety of resources like color graphics CRTs or other equipment
which can be used to monitor specific process variables
I/O enhancement group are special hardware modules that can be plugged into the PLC, which
provides intelligence and remote I/O capabilities.
Computer interface group provides PLC to PLC communication or network interaction with
various computer systems.

Modes of operation of PLC (Not important in exam point of view)


There are two modes of operation in a Programmable Logic Controller. One is the I/O scan
mode and the other is the execution mode
I/O Scan Mode
• This consists of Input scan and output scan
• During Input Scan, the input channels are scanned one
at a time (not all the channels together)
• The processor looks at each input channel to see if it
is ON or OFF
• The information from the input channels is stored in a
data table inside the processor for use in the next step
• Based on the inputs scanned and program execution,
output values are stored in a temporary memory inside
processor.
• During output scan, outputs are updated using temporary values stored in the memory
Execution Mode
• This mode evaluates each rung of the ladder diagram program
• The execution is sequential, which means, it happens one after another. It begins from the
first rung and ends at the last rung.
• Execution is done using the memory copy of inputs (Stored in the data table during input
scan)
• Based on the execution of program, the outputs are either energized or de-energized
This process repeats: Input Scan → Execution → Output Scan

4
Industrial Automation – Module IV

Advantages of PLCs
1. Ease of programming and reprogramming in the plant
2. A programming language that is based on relay wiring symbols familiar to most plant
electric personnel.
3. High reliability and minimum maintenance
4. Ability to communicate with computer systems in the plant
5. Moderate to low initial investment cost
6. Rugged construction
7. Modular design

Applications of PLCs
1. They are used in glass manufacturing, for controlling the material ratio
2. They are used to control machines used for paper manufacturing
3. They are used to mix raw materials in the correct quantity, in cement manufacturing industry
4. They are used to control the wind turbines
5. They are used in boilers in thermal power plants
6. In process automation plants (mining, oil and gas)

5
Industrial Automation – Module IV

PLC Ladder Programming


• Ladder logic is a programming language that is used to program a PLC. It is a graphical
PLC programming language which expresses logic operations with symbolic notation using
ladder diagrams.
• Writing a program is equivalent to drawing a switching circuit. Ladder logic was originally
designed to replace the use of hard wired relay logic circuits for machine control. The ladder
logic programming code actual looks like an electrical schematic drawing.
• The diagram looks like a ladder. The vertical lines are
for power supply and are known as vertical rails.
• The rails in a ladder diagram represent the supply
wires of a relay logic control circuit. There is a positive
voltage supply rail on the left hand side and a zero
voltage rail on the right hand side.
• The horizontal lines are known as rung. Each rung on
the ladder defines one operation in the control
process. The processor scans the ladder rungs from top
to bottom and left to right.
• The inputs are arranged on the left side and outputs are
arranged on the right side of the ladder diagram.
• The end rung might be indicated by a block with the word END or RET for return, since the
program promptly returns to its beginning.
• Inputs – The inputs are external control actions such as a push button being pressed or a
limit switch being triggered. The inputs are actually hardwired to the PLC terminals and
represented in the ladder diagram by a normally open (NO) or normally closed (NC) contact
symbol.
• Outputs – The outputs are external devices that being are turned on and off such as an
electric motor or a solenoid valve. The outputs are also hardwired to the PLC terminals and
are represented in the ladder diagram by a relay coil symbol.
• Logic Expressions – The logic expressions are used in combination with the inputs and
outputs to formulate the desired control operations
• Address Notation & Tag Names – The address notation describes the input, output and
logic expression or memory addressing structure of the PLC. The tag names are the
descriptions allocated to the addresses.

6
Industrial Automation – Module IV

• Comments –Comments are displayed at the start of each rung and are used to describe the
logical expressions and control operations that the rung, or groups of rungs, are executing.
Understanding ladder diagrams is made a lot easier by using comments.
• Electrical devices are shown in their normal condition. Thus a switch, which is normally
open until some object closes it, is shown as open on the ladder diagram. A switch that is
normally closed is shown closed.
• A particular device can appear in more than one rung of a ladder. The same letters and/or
numbers are used to label the device in each situation.
• The inputs and outputs are all identified by their addresses, the notation used depending on
the PLC manufacturer. This is the address of the input or output in the memory of the PLC.
• When the PLC is in its run mode, it goes through the entire ladder program to the end, the
end rung of the program being clearly denoted, and then promptly resumes at the start.

Basic Ladder logic symbols

7
Industrial Automation – Module IV

Examples
Ladder logic to switch a bulb ON/OFF
In the ladder logic diagram we can see there is an input contact (N-O) “I0.0” which is a toggle
switch in the physical connections to the plc. There is also an output coil addressed as “Q0.0” which
can be a Motor, Bulb or any signaling device in the physical connection.

Now, as soon as toggle switch is pressed the NO contact


of I0.0 becomes NC and the corresponding rung logic
goes true. As a result output coil Q0.0 gets energized and
the bulb will ON.

Logic gates implementation using ladder diagram


1. NOT GATE
NOT gate works as inversion. It takes one input and gives one output. When the input is high then
the output is low and vice-versa.

2. AND GATE
In AND Gate, when both inputs (I1 and I2) are high then the output (Q1) will be high. For all other
inputs, output (Q1) will be the low.

Using Ladder diagram programming, we are connecting two


switches (I1 and I2) as input and coil/lamp (Q1) as output. In the
case of both switches (I1 and I2) are closed, the lamp (Q1) will
glow. In another case, if any of the switches (I1 or I2) are open then
lamp (Q1) will not glow.

8
Industrial Automation – Module IV

3. OR GATE
Working: If both inputs are low in the OR gate, then the output will be low. For all other cases, the
output will be high.

In case both or anyone inputs (I1 and I2) are closed then coil (Q1) will on.

4. NAND GATE
NAND gate is operated as an AND gate and followed by the inverter. In NAND Gate, the output
will be low when both inputs are high. For all other
cases, the output will be high.

𝑄1 = ¯¯
𝐼1 .̄¯𝐼¯2¯ = 𝐼¯1 + 𝐼¯2
If both switches (I1 and I2) or anyone switch (I1 or I2) are closed, the lamp will be glow. In the
case, both switches are open then the lamp will not be glow.

5. NOR GATE
NOR Gate is operated OR Gate followed by the NOT
Gate. When both inputs are low then the output will be
high.

The Coil (Q1) will be activated if both inputs are closed. Coil (Q1) will be deactivated if any one
or both the inputs are open.
𝑄1 = ¯𝐼1¯¯+̄¯¯𝐼¯2¯ = 𝐼¯1 . 𝐼¯2

9
Industrial Automation – Module IV

6. EX-OR GATE
Working: If both inputs are same, the output will become low. For any other input condition, the
output will be high.
𝑄1 = 𝐼1 𝐼¯2 + 𝐼¯1 𝐼2

7. EX-NOR GATE
Working: When both inputs (I1 and I2) are same then the output will high.
𝑄1 = 𝐼¯1 𝐼¯2 + 𝐼1 𝐼2

10
Industrial Automation – Module IV

Half-Adder
A half adder can add two binary bits A and B. It has two outputs. One is sum and the other is carry.
The expression for sum is same as the EXOR gate expression and that of carry is same as AND
gate. The expressions are as given:
𝑆 = 𝐴̅𝐵 + 𝐴𝐵
¯

𝐶 = 𝐴𝐵

Half subtractor
This circuit is used to subtract one binary bit from another. There are two inputs A and B
and there are two outputs. One output is the difference and the other one is borrow. The expressions
are as given:
𝐷 = 𝐴̅𝐵 + 𝐴𝐵
¯

𝐵o = 𝐴̅𝐵

11
Industrial Automation – Module IV

INSTRUCTIONS IN LADDER DIAGRAM


Math Instructions in PLC ladder diagram
The important arithmetic instructions used in the ladder diagram are discussed here:
There are three parameters in each block,
Source A –Address of the first Value
Source B –Address of the second value
Destination (Dest) – Address where result of the function will store.

ADD:

Add block is used to do the Addition of the two values stored


in source A and source B and store the output in destination
address. Values stored in N7:0 and N7:1 gets added and
result is stored in N7:3.

SUB:
SUB block is used to do the Subtraction of the two values
stored in source A and source B and store the output in
destination address. Value stored in N7:1 is subtracted from
the value stored in N7:0 and result is stored in N7:3.

12
Industrial Automation – Module IV

MUL:

MUL block is used to do the Multiplication of the two values


stored in source A and source B and store the output in
destination address. Values stored in N7:0 and N7:1 gets
multiplied and result is stored in N7:3.

DIV:
DIV block is used to do the Division of the two values stored in
source A and source B and store the output in destination address.
Value stored in N7:0 is divided by the value stored in N7:1 and result
is stored in the destination address.

SQR

SQR block is used to find the square root of the value stored
in source address and results the value in destination address.
The number whose square root is to be found is to be stored
in N7:0. The result of operation will be available at the
destination address N7:1.

NEQ:
NEQ block is used to negate the value stored in source
address and results the value in destination. The value
which is to be negated can be stored in N7:0. Result will be
available at the destination address N7:1.

13
Industrial Automation – Module IV

Compare Instructions in PLC ladder diagram


Comparison instructions in PLC are used to test pairs of values to condition the logical continuity
of a rung. The important comparison instructions used in the ladder diagram are discussed here:

Equal (EQU) Instruction


The EQU instruction is used to test whether two values
are equal. If source A and source B are equal, the
instruction is logically true. If these values are not equal,
the instruction is logically false.
Source A must be an address.
Source B can be either a program constant or an address.

Not Equal (NEQ) Instruction

The NEQ instruction can be used to test whether


two values are not equal. If source A and source B
are not equal, the instruction is logically true.
Source A must be an address. Source B can be
either a program constant or an address.

14
Industrial Automation – Module IV

Less Than (LES) Instruction


The LES instruction can be used to test whether one value
(source A) is less than another (source B). If source A is less
than the value at source B, the instruction is logically true.
Source A must be an address. Source B can be either a
program constant or an address.

Less Than or Equal (LEQ) Instruction


The LEQ instruction can be used to test whether one value
(source A) is less than or equal to another (source B). If the
value at source A is less than or equal to the value at source
B, the instruction is logically true.
Source A must be an address.
Source B can be either a program constant or an address.

Greater Than (GRT) Instruction

The GRT instruction can be used to test whether one value


(source A) is greater than another (source B).
If the value at source A is greater than the value at source B, the
instruction is logically true.

Greater Than Or Equal (GEQ) Instruction

The GEQ instruction can be used to test whether one value (source
A) is greater than or equal to another (source B).
If the value at source A is greater than or equal to the value at source
B, the instruction is logically true.

15
Industrial Automation – Module IV

Masked Comparison for Equal (MEQ)

The MEQ instruction can be used to compare data at a source address


with data at a compare address. The Use of this instruction allows
portions of the data to be masked by a separate word. Source is the
address of the value you want to compare. Mask is the address of the
mask through which the instruction moves data.

Limit Test (LIM) Instruction

The LIM instruction can be used to test for values within or outside a
specified range, depending on how you set the limits.

16
Industrial Automation – Module IV

Timer instructions in PLC ladder diagram


A timer is a PLC instruction measuring the amount of time elapsed following an event.
Timer instructions come in two types: on-delay timers and off-delay timers. Both “on-delay” and
“off-delay” timer instructions have single inputs triggering the timer function.
ON Delay Timer
In the On-delay timer instruction, there are totally four
parameters.
TIMER: T4:0 – Timer File name (Timer T4:0, T4:1,
T4:2…)
TIMER BASE – Decides how the timer needs to
count, in Seconds, Milli Seconds…
PRESET – Decides until what time should the timer run.
ACCUMULATOR – Running Value of timer when it is in ON condition.
There are 3 bits associated with On delay timer:
EN: This bit goes high when the timer is energized.
TT: This bit will be high when the timer’s running is in progress.
DN: This bit goes high when the timer has finished running.

OFF Delay timer

Timer OFF delay block is used to delay the turning


OFF of any output. Example-Setting timer to turn
off Induction Stove, TV remote settings to turn OFF
TV after certain time. In the OFF-delay timer
instruction, there are totally four parameters.
TIMER: T4:0 – Timer File name (Timer T4:0, T4:1, T4:2…)
TIMER BASE – Decides how the timer needs to count, in Seconds, Milli Seconds…
PRESET – Decides until what time should the timer run.
ACCUMULATOR – Running Value of timer when it is in ON condition.
There are 3 bits associated with On delay timer:
EN: This bit goes high when the timer is energized, TT: This bit will be high when the timer’s
running is in progress.
DN: This bit will be high when the timer is running and it goes low once the timer has finished
running.

17
Industrial Automation – Module IV

Counter instructions in PLC ladder diagram


Counters are used to count the number of occurrences of an event. Counter can be an up counter
that counts up or a down counter that counts down.
Up Counter

In the above picture, there are three parameters


COUNTER: C5:0 – Counter File name (Counter C5:0,
C5:1, C5:2…)
PRESET –PRE: Limit value of COUNT-Up to how
much it should count.
ACCUMULATOR –ACC: it shows the status of counting.
From the data file, along with preset and accumulator, some other bits are also there:
CU: Count up Bit-whenever the counter is enabled this bit goes high
DN: Done Bit-When accumulator value reaches preset value, done bit goes high.
OV: Over Flow Bit-When accumulator value reaches the limit value (32767), it rolls back to-32767
for the upcoming counter operation. Overflow bit turns ON, when this condition occurs.

Down counter

The down counter block in the PLC ladder diagram


works just like the UP counter. Counter name, Preset
and Accum parameters have the same functions as in
Up counter. The counting starts from the Preset value
and counts down up to 0. CU, DN and OV bits has the
same purposes as in the Up counter.

18
Industrial Automation – Module IV

Program Flow Control Instructions


Program Flow Control Instructions are used to control the sequence in which the program is
executed. They allow to change the order in which the processor scans a ladder program.
Typically, these instructions are used to
• Minimize scan time
• Create a more efficient program
• Troubleshoot a ladder program.
Program Flow Control Instructions

Jump (JMP) and Label (LBL) Instructions


Labels have the format Q:NNN. NNN is a numeric value from 000-255.
Jumping forward to a label saves program scan time by omitting a program segment until needed.
Jumping backward lets the controller execute program segments repeatedly.
JMP Instruction
The JMP instruction causes the controller to skip rungs. You can jump to the same label from one
or more JMP instruction.
LBL Instruction

This input instruction is the target of JMP instructions having the same label number. This
instruction must be programmed as the first instruction of a rung. You can program multiple jumps
to the same label by assigning the same label number to multiple JMP instructions. However, label
numbers must be unique. Do not jump (JMP) into an MCR zone.

19
Industrial Automation – Module IV

SBR Instruction
Use a subroutine to store recurring sections of program logic that must be executed from
several points within your application program. A subroutine saves memory because you program
it only once.
Update critical I/O within subroutines using immediate input and/or output instructions
(IIM, IOM), especially if your application calls for relatively long subroutines. Otherwise, the
controller does not update I/O until it reaches the end of the main program (after executing all
subroutines).
Master Control Reset (MCR)
MCR zones let you enable or disable segments of the program.
When you program MCR instructions, note that:
• You must end the zone with an unconditional MCR instruction.
• You cannot nest one MCR zone within another.
• Do not jump into an MCR zone. If the zone is false, jumping into it activates the zone.
• Always place the MCR instruction as the last instruction in a rung.
Do not jump (JMP) into an MCR zone.
• Instructions that are programmed within the MCR zone starting at the LBL instruction and
ending at the ‘END MCR’ instruction are always evaluated as though the MCR zone is true,
regardless of the true state of the “Start MCR” instruction. If the zone is false, jumping into it
activates the zone from the LBL to the end of the zone.
Temporary End (TND) Instruction
The TND instruction, when its rung is true:
• Stops the processor from scanning the rest of the program file
• Updates the I/O, and
• Resumes scanning at rung 0 of the main program
If this instruction’s rung is false, the processor continues the scan until the next TND instruction
or the END statement. Use this instruction to progressively debug a program, or conditionally omit
the balance of your current program file or subroutines
Suspend (SUS) Instruction
When the SUS instruction is executed, it causes the processor to enter the Suspend Idle mode and
stores the Suspend ID in the status file.
All outputs are de-energized. The SUS instruction can be
used to trap and identify specific conditions for program
debugging.

20
Industrial Automation – Module IV

Move Instructions
Move (MOV) Instruction
This instruction moves the source value to the destination location. As long as the rung remains
true, the instruction moves the data on each scan.

Source is the address or constant of the data you want to move.


Destination is the address where the instruction moves the data.

Masked Move (MVM) Instruction


The MVM instruction is a word instruction that moves data from a source
location to a destination and allows portions of the destination data to be
masked by a separate word. As long as the rung remains true, the
instruction moves the data on each scan.

Entering Parameters
Source is the address of the data you want to move.
Mask is the address of the mask through which the instruction moves data; the mask can be a
hexadecimal value (constant).
Destination is the address where the instruction moves the data.

21
Industrial Automation – Module IV

Bitwise instructions in PLC


Block Name: Bitwise AND

In the picture, there are totally three parameters,


SOURCE A – Address of First Binary Value
SOURCE B – Address of Second Binary Value
DESTINATION –AND operation result of Source A & B stored in this
address

Block Name: Bitwise OR

In the picture, there are totally three parameters,


SOURCE A –Address of First Binary Value
SOURCE B –Address of Second Binary Value
DESTINATION –OR operation result of Source A & B stored in this
address

Block Name: Bitwise XOR

In the picture, there are totally three parameters,


SOURCE A –Address of First Binary Value
SOURCE B –Address of Second Binary Value
DESTINATION –XOR operation result of Source A & B stored in this address

Block Name: Bitwise NOT

In the picture, there are totally two parameters,


SOURCE -Address of Binary Value
DESTINATION –NOT operation result of Source stored in this
address

22
Industrial Automation – Module IV

Real time applications of PLC


1. PLCs are used in manufacturing plants to control and monitor robotic arms, conveyor belts and
various other processes.
2. PLCs automate various industrial processes such as material handling, packaging, labelling,
and quality control.
3. PLCs help manage energy consumption by controlling lighting, heating, ventilation, and air
conditioning
4. PLCs monitor and control water treatment processes, such as filtering, disinfection, and
chemical dosing systems in buildings, leading to energy savings and cost efficiency.
5. PLCs control conveyor systems, robotic pick-and-place operations, and automated guided
vehicles (AGVs) in warehouses and distribution centers.
6. PLCs control lighting, security systems, elevators, and HVAC systems in commercial and
residential buildings, enhancing comfort, security, and energy efficiency.
7. PLCs are essential in pharmaceutical manufacturing, ensuring precise dosing, mixing, and
packaging of medications.
8. PLCs regulate various stages of food production, from mixing and cooking to packaging and
labelling.
9. PLCs control automotive assembly lines, managing tasks like welding, painting, and quality
testing.
10. PLCs manage operations in solar power plants, wind farms, and hydroelectric facilities.

23

You might also like