MECHAT - UNIT - 4 Final
MECHAT - UNIT - 4 Final
4.1 INTRODUCTION
DEFINITION OF PLC:
A programmable logic controller (PLC) Program is a specially designed digital operating
microprocessor-based controller that uses a programmable memory for internal storage of
instructions and for implementing function such as logic, sequencing, timing, counting and
arithmetic in order to control machines and processes.
Need of PLC :
The programmable logic controller (PLC) device is widely used in industry to automate event
based control, interlocking of operations and sequencing of operations.
PLC is used in almost all process industries, where there is requirement of process safety and
interlocks e.g. thermal power stations, steel industry, cement industry, pharmaceutical industry,
petrochemical industry, fertilizer industry etc.
Features of PLC
Page. No: 1
4.2 ARCHITECTURE OF PLC
1. Processor:
It is the heart of PLC
He processor processes the signals from input module and generates controlling
signals for the system
It also scans and solve the logic of the user program
It consists of ALU, microprocessor unit, memory unit and system powersupply
2. Memory:
The memory unit contains the program stored in it
The programs were written with control actions to be executed by the microprocessor for
the input given.
RAM is a temporary storage device used to store ladder diagram and for testing and
evaluation
Page. No: 2
Then it is stored in ROM where changes cannot done.
3. Power Supply:
The purpose of a power supply unit is to convert the main A.C voltage into a low – level D.C
voltage (5V).
The D.C. voltage is supplied to the processor and the circuits in the input and output
interface modules.
The power supply should be free from heavy loads, noises and voltage fluctuations.
Page. No: 3
Fig.4.2.2 Internal Architecture of a PLC System
This unit performs data manipulation and arithmetic and logical operations on input I
variable data and determines the proper state of the output variables.
The arithmetic operation includes addition, subtraction etc., and logic operations include
AND, OR, AND, EXCLUSIVE - OR.
ii. Control Unit:
A control unit is used to control the timing of operations.
The processor functions under a permanent supervisory operating system that directs the
overall operations from data input and output to execution of user programs.
The controller can perform only one operation at a time. So, it scans each of the inputs
sequentially, evaluates the ladder diagram program, provide each output(s), and then
repeat the whole process.
Hence, the timing control's necessary for a PLC system.
iii. Memory Unit:
There are several memory elements in a PLC system.
System Read-only Memory (ROM) gives permanent storage for the operating system and
fixed data by the CPU.
Page. No: 4
RAM for the user to develop program and acts a temporary memory.
In addition, temporary buffer stores for the I/O channels.
The sequence of instructions to be executed, programs are stored in the memory unit.
During entering and editing including Debugging, the program is stored in the temporary
storages called RAM (Random Access memory).
Once the program is completely finished (free & from errors).
It may be 'burned' into ROM
When the ROM is plugged into the PLC, the device is ready to be placed into service in the
industrial environment.
For network programmed PLCs, the final PLCs program is downloaded into a special
reprogrammable
ROM (EPROM, PROM, and EEPROM) in the PLC.
Memory may be either volatile type or Non-volatile type.
Volatile Memory:
Volatile memory or temporary memory or Application memory is the user memory, where
the user can enter and edit the program.
Volatile memory will lose all its programmed contents if operating power is removed or
lost.
here for necessary to provide a battery backup power to all times.
Non Volatile Memory:
Non-volatile memory or permanent memory or system memory is (used) a system memory
that stores the monitor a booting programs, lookup tables etc.,
This is usually programmed and supplied by the manufacturer.
This controls the operation of PLC.
It does not lose its content during power failure.
It does not require any battery.
The ROM memory offers the CPU to use only fixed amount of data.
Buses:
A set of parallel lines that provides communication between various devices of a system is
termed as a Bus.
The bus system carries information and data’s to and from the CPU, Memory and I/O units.
The information is transmitted in binary form as 0 or 1
Digital signals or electrical signals are flowing inside the bus.
It might be tracks on a printed circuit board (PCB) or wires in a ribbon cable.
The PLC system contains four buses.
They are namely Data Bus, Address Bus, Control bus and system bus.
Data Bus:
The data bus contains 8, 16 or 32 parallel signal lines for sending data between the various
devices of a system.
An 8-bit microprocessor has an internal data bus which can handle 8-bit numbers.
Address Bus:
The Address bus contains 16, 20, 24 or 32 parallel signal lines to carry the Address of the
memory locations for accessing stored data.
Every memory location is given a distinct unique address to locate easily and accessed by
the CPU either to read or write data.
Page. No: 6
Control Bus:
The Control bus contains 4 to 10 parallel signal lines to carry the signals used by the
CPU that are related to internal Control actions. Typical control bus signals are Memory
read Memory write, I/O Read and I/O write.
I/O System Bus:
The I/O system bus provide the communication between the I/O ports and I/O units
Input / Output Unit:
The I/O units provide the interface between the system and the outside world, allowing for
connections to be made through I/O channels to input / output devices.
Programs are entered from a program panel through I/O unit.
Disadvantages of PLC
1. There's too much work required in connecting wires.
2. There's difficulty with changes or replacements.
3. It's always difficult to find errors; And require skillful work force.
4. When a problem occurs, hold-up time is indefinite, usually long.
Application of PLC
There are many applications that you can find PLCs are use in the various industries.
Material Handling Electrical/Electronic Appliance
Conveyor System Manufacturing / Packaging Machine
Pick and Place Robot Control Disk Drive Manufacturing
Pump Control Petrol/Chemical Plant
Swimming Pool / Water Treatment Traffic Light System
Chemical Processing Plant Plastic Manufacturing Industries
Paper and Pulp Industries Train Control Station system
Power Station Plant Process Monitoring Control
Page. No: 7
4.3 INPUT / OUTPUT PROCESSING
Input Channel of PLC
Sensors like proximity sensors, rotary encoders, optical sensors, limit switches are
interfaced to PLC through it's input / output modules.
The I/O modules provide signal conditioning and isolation so that the sensors can be
connected directly.
For input channel usually an optocoupler is used for isolation purpose and for protection of
input module voltage divider circuit and a protection diode is used as shown in Fig. 4.3.1.
1) Relay output
In relay type output the signal from PLC is used to operate a relay. Relay can switch currents
of few milli amperes to few amperes to external circuit.
Relay can switch both AC and DC signals.
Relays can withstand high surge currents and voltage transients. Because of mechanical
switching in relays, they are relatively slow to operate.
2) Transistor output
In transistor type output, a transistor is used to switch current through external circuit.
Transistors can switch faster than the relay.
Transistors can be used for switching of DC signals only and can be destroyed by
overcurrent and high reverse voltage.
Hence proper protection circuits are to be provided.
Page. No: 8
Also for switching higher current higher current capacity of transistor is needed.
3) Triac output
Triac type outputs are used specially for switching of DC signals.
Triacs may damage due to overcurrent.
Hence for protecting triacs optoisolater and fuses are used.
Page. No: 9
Current Sinking:
Here, the input device supplies current to the input module. For the PLC input unit, hence
the input module is the sink for the current. Sinking input units are used for interfacing with
electronic equipment.
So, if a switch is connected to the negative of the battery and current flows from positive to
negative, by conventional current flow direction, it is said to be the sinking for Current. For
the PLC output unit, the current flows from output device to the output module then the
output module is the sink for current.
The following figure 4.4.1 shows a ladder rung, starting with the input, normally open symbol
for input contact is shown by | |.
Page. No: 11
Input(A) Input(B) Output
A.B
0 0 0
0 1 0
1 0 0
1 1 1
1 AND X401 X401 AND Logic Open contact AND logic function
2. OR Logic Function:
OR logic circuit represents the parallel circuit.
OR Gate is composed of two or more inputs and one output.
OR operation is like addition of binary numbers.
OR gate produce output when any one input are HIGH state.
Page. No: 12
Step Instruction Address Parameter Description
Input(A) Output
A’
0 1
1 0
Page. No: 13
Input(A) Input(B) Output
AB
0 0 1
0 1 1
1 0 1
1 1 0
Page. No: 14
Step Instruction Address Parameter Description
When both the inputs are at LOW state the output will be at LOW state
When both the inputs are at HIGH state the output will be at LOW state
When any one input is HIGH state the output will be at HIGH state
1 ANI X401 X401 NAND Logic Add a closed contact in series with Input.
2 LDI X 400 X 400 Input Start a new rung with a closed contacts.
3 AND X401 X401 AND Logic Add a open contact in series with input
Page. No: 15
(i). PROGRAMMING WITH TIMERS:
A timer is a special counter ladder function that allows the PLC to perform timing operations
based on a precise internal clock.
Types of Timers:
1. Delay ON Timers or ON delay timers
2. Delay OFF Timers or OFF delay timers
3. Pulse Timers
4. Cascaded Timers
5. ON-OFF Cycle Timers
6. One Shot Timers
1. Delay ON Timers:
The term delay is used to indicate that this timer burns on, after waiting for a fixed time delay
period.
When there is an input, the timer is energized and starts timing, after some pre-set value, the
timer contacts are closed to output.
TON is used to denote ON-delay.
OFF delay timers are maintained as ON for a fixed time of delay period before turning off.
TOF is used to denote OFF-delay.
Page. No: 16
3. Pulse Timers:
Pulse timer switches is another type of Timer which comes either ON or OFF for a fixed period of
time as a function of pulses.
TP is used to denote Pulse Timers.
4. Cascaded Timers:
Cascading means more elements are linked together to form a system.
The cascading timers are linked together to give longer delay times which is easily achieved than
just one timer.
Page. No: 17
ii. PROGRAMMING WITH COUNTERS:
A counter is a PLC instruction that either increment or decrements an integer number value when
prompted by the transition of a bit from 0 to 1.
Counters are used to count a specified number of contact operations.
1. Up Counters:
Up counters count up from the zero to pre – set value
The events are added until the pre – set value is reached
When the counter reaches the set value, its contacts change state
Up counter is an increment counter. which means it counts "up" with each off-to-on transition
input to its "CU" input.
Whenever there is a true value entry in the CU input, the counter will turn on and CV will display
the count.
Page. No: 18
preset value (Q is active if CV ≥ PV).
The counter output instruction will increase by 1 each time the counted event occurs.
Down Counters:
The down-counter instruction will count down or decrease by 1 each time the counted event
occurs.
Page. No: 19
Figure 4.4.4 (a) shows how we can draw a ladder diagram using internal relays.
LATCHING:
There are often situations where it is necessary to hold an output energized, even when the input
ceases. e.g. a motor started by pressing a switch.
Though the switch contacts do not remain closed, the motor is required to continue running until
a stop push button is pressed.
Latch circuit is used to implement such situation. Fig. 4.4.5 shows latched circuit.
Page. No: 20
Fig. 4.4.5 latched circuit
When the input A contacts close, there is an output. However, when there is an output another set
of contacts associated with the output closes.
The contacts form an OR logic gate system with the input contacts. Thus, even if the input A
opens, the circuit will still maintain the output energized.
The only way to release the output is by operating the normally closed contact B.
Solved Example:
As an illustration of application of a latching circuit, consider a motor controlled by stop and start
push button.
Switches and for which one signal must be illuminated when the power is applied to the motor
and another when it is not applied.
Fig. 4.4.6 shows ladder diagram with mitsubishi make PLC notations.
When X400 is momentarily closed, Y430 is energised and it's contacts close. This results in
latching and also the switching off of Y431 and the switching on off Y432.
To switch the motor off, X401 is pressed and opens. Y430 contacts open in the top rung and third
rung, but close in the second rung. Thus Y431 comes on and Y432 off.
Page. No: 21
4.5 DATA HANDLING
The steps involved in data handling with a PLC system are :
1. Data Movement:
Instruction: MOV
Function: To copy a value from one address to another
Program:
LD X400
MOV
D1
D2
When there is an input to X400,
The data moves from the designated source address to the designated destination address.
The data transfer might move a constant into a data register
2. Data Comparison:
The data comparison instruction gets the PLC to compare two data values.
It compare a preset value (1) to the input values (2)
Instruction :
< or LES
= or EQU
> or GRT
< or LEQ
≠ or <> or NEQ
> or GEQ
For data comparison the typical instruction will contain the data transfer instruction to
compare the data from source address and designation address
Page. No: 22
Example:
It is required to sound an alarm if a sensor indicates a temperature above 90˚C and remain
sounding until the temperature falls below 75˚C.
For this, the ladder diagram is shown above.
The input temperature data is inputted to the source address and the destination address
contains the set value.
When the temperature rises 90˚C or higher, the data value in the source address becomes >
the destination address value and there is an output to the alarm which latches the input
When the temperature falls to 75˚C or lower, the data value in the source address becomes <
the destination address value and there is an output to the relay which then opens the
contacts and so switches the alarm off.
Page.No. 23
4.6 SELECTION OF PLC.
PLC selection criteria consists of:
1. System (task) requirements
2. Application requirements
3. Electrical requirements
4. Speed of operation
5. Communication requirements
6. Operator interface
7. Physical environments
8. What input/output capacity is required?
9. What type of inputs/outputs are required?
10. What size of memory is required?
11. What speed is required of the CPU?
12. Software
1. System requirements:
The starting point in determining any solution must be to understand what is to be achieved.
The program design starts with breaking down the task into a number of simple understandable
elements, each of which can be easily described.
2. Application requirements
Input and output device requirements. After determining the operation of the system, the next
step is to determine what input and output devices the system requires.
List the function required and identify a specific type of device.
The need for special operations in addition to discrete (On/Off) logic APP
List the advanced functions required beside simple discrete logic.
3. Electrical Requirements
The electrical requirements for inputs, outputs, and system power; When determining the
electrical requirements of a system, consider three items:
i. Incoming power (power for the control system);
ii. Input device voltage; and
iii. Output voltage and current.
4. Speed of Operation
How fast the control system must operate (speed of operation)?
When determining speed of operation, consider these points:
Page.No. 24
How fast does the process occur or machine operate ?
Are there Time critical operations or events that must be detected?
In what time frame must the fastest action occur (input device detection to output device
activation.
Does the control system need to count pulses from an encoder or flow-meter and respond
quickly?
5. Communication requirements
Communication requires sharing data outside the process, ie. communication.
Communication involves sharing application data or status with another electronic device, such
as a computer or a monitor in an operator's station.
Communication can take place locally through a twisted-pair wire, or remotely via telephone or
radio modem.
6. Operator Interface
If the system needs operator control or interaction. In order to convey information about machine
or process status, or to allow an operator to input data, many applications require operator
interfaces.
Traditional operator interfaces include pushbuttons, pilot lights and LED numeric display.
Electronic operator interface devices display messages about machine status in descriptive text,
display part count and track alarms.
Also, they can be used for data input.
7. Physical Environment
The physical environment in which the control system will be located. Consider the environment
where the control system will be located.
In harsh environments, house the control system in an appropriate IP-rated enclosure.
Remember to consider accessibility for maintenance, troubleshooting reprogramming.
*********************************************
Page.No. 25