BAHIR DAR UNIVERSITY
BAHIR DAR INSTITUTE OF TECHNOLOGY
Faculty of Electrical and Computer Engineering
Industrial Control focus
Process control fundamentals -EEng4181
Chapter four
Programmable Logic Controller
By Gerbaw Y.
Programmable Logic Controller(PLC)
What does mean .Programmable ?
• Logic ?
• Controller ?
• What is PLC?
What is PLC?
• PLC is a digital computer used for the automation of various
electro-mechanical processes in industries such as control of
machinery on factory assembly lines.
Purpose of Programmable Logic
Controllers (PLCs)
 Initially designed to replace relay logic boards
 Sequence device actuation
 Coordinate activities
 Accepts input from a series of switches
 Sends output to devices or relays
Areas of applications
 Manufacturing / Machining
 Food / Beverage
 Metals
 Power
 Mining
 Petrochemical / Chemical
Areas of Application
Why PLC ?
PLC
• Invented in 1968as a substitute for hardwired relay panels. "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. "
• National Electrical Manufacturing Association (NEMA)
Vendors
 Various PLC vendors exist:
 Siemens AG
 Rockwell
 Mitsubishi
 Schneider
 Omron
 Allen-Bradley
…etc
Vendors
Typical Mitsubishi PLC module
Typical Omron PLC module
Typical Siemens PLC module
PLCs are:-
 Similar to a Microcontroller:
 Microprocessor Based
 Onboard Memory for Storing Programs
 Special Programming Language: example:-Ladder Logic, …
 Input/output Ports
PLCs are:-
 Dissimilar to Microcontrollers:
 Intended for Industrial Applications
 I/O Designed to interface with Control Relays
 Emphasis on Maximum Reliability
 Rugged design; suitable for harsh industrial environments against high
temperature variations, dust, and vibrations.
 Industry standard I/O interfaces; capable of communicating with other PLCs,
computers and intelligent devices.
 Industry standard programming languages; easily learned and understood.
Programming is primarily concerned with logic, timing, counting and
switching operations.
 Reduces hard wiring and wiring cost.
 Monitoring, error checking and diagnostics capability. Competitive in both
cost and space requirements.
PLC and related components
 PLC is essentially a microcomputer, tailored specifically for certain
control tasks.
 Hardware: consists of the actual device technology, i.e. the PCBs,
integrated modules, wires, battery, housing etc.
 Firmware: is the software part, known as executive software, that is
permanently installed and supplied by the PLC manufacturer.
Programs are usually stored in ROM or EPROM.
 Software: is the user program. User programs are usually stored in
the RAM.
 PLC hardware does not differ significantly from computers.
What makes the PLC special is the executive software. It is
the internal program, provided by the manufacturer, which
executes the user’s program.
 The executive software determines
 What functions are available to the user’s program,
 How the program is solved,
 How the I/O is serviced,
 What the PLC does during power up and down and fault
conditions
MULTI-TASKING CAPABILITY
 Some PLCs are capable of executing multiple tasks with a single
processor. User program assigns I/O for each task separately.
 Multitasking may take several forms:
 Time driven -it is possible to configure the processor to run each task
on periodic time intervals. Hence, the time-critical job, such as the
portion of that controls high-speed motions or machine fault detection,
to run faster than the noncritical portions, such as servicing indicator
lights.
 Event driven or Interrupt driven -user defines a particular event,
such as an input changing state or an output turning off, that causes
each tasks to run.
PLC packaging
 The manner in which a PLC & its I/O are packaged is critical in determining its
suitability for an application.
 Heat Removal -appropriate means must be provided for generated heat removal
to ensure low internal temperature. Commonly used methods include air venting,
forced air circulation & heat sinking.
 Mounting -to be mounted inside NEMA rated enclosure.
Considerations in choosing PLC
 Number and Types of input & output points required
 Size and type of memory required
 Speed and power required of CPU and instruction set
 Manufacturer’s support and backup
PLC consists of five major sections
 Power Supply
 Memory
 Central Processing Unit (CPU)/ Logic Solver
 I/O Interface
 Programming Section
Major PLC COMPONENTS
Major PLC components
 Power Supply-PLCs are generally powered from AC mains and power supply
system converts ac voltages to required dc voltages.
 Memory-Program memory receives and holds program instructions. Data memory
is used to temporarily hold data generated from processes or acquired through I/O
devices.
 Processor-is a micro-processor based CPU and is the part of PLC that is capable
of reading and executing program instructions and data.
 Program loader-is used to enter/change the user program into the memory and
to monitor the program execution.
Power supply
 Provides voltage levels required for internal operations (typically
 +5 V dc or ±12 V dc).
 Provides power for I/O modules. Provides constant voltages.
 Packaged properly to prevent overheat. Separate or built into the processing
unit.
 It is one of the most critical components of a PLC –
 It is typically non-redundant. Hence a failure of the power supply can cause
the control system to fail.
It usually contains high-voltage components. Hence, an isolation failure can
create the potential for serious injury and fire.
Memory
The memory function of the CPU stores programs and data that the CPU
needs to perform various operations. The memory is organized into several
sections according to the functions they perform.
Executive Memory -collection of system programs stored in ROM.
Scratch Pad -is the work area used to temporarily store the binary
information used by the processor. These are volatile memory as RAM-type
chips are usually used. Battery backed-up CMOS RAM are also used which
may last up to 10 years.
Processor File -the memory block in which programmer stores and
manipulates the software. The processor file is made up of program files,
and data files.
Central Processing Unit
 CPU executes a program stored in the executive memory which is set by the manufacturer.
 It organizes all control activity by receiving inputs, performing logical decisions according
to the program, and control the outputs.
 CPU does not operate on the I/O directly. Rather, it works with the I/O image stored in
the I/O image memory. The I/O interface is responsible for transferring the image outputs
to the I/O system, reading the inputs from the I/O system, and writing them into I/O
image memory.
 A ‘watchdog’ timer is provided to time the CPU to execute the user’s program. If this time
exceeds a predetermined value, watchdog timer will indicate fault and execute subsequent
predefined procedure.
Input/output ( I/O) System
I/O system acts as the eyes, ears and hands of PLCs.
Discrete I/O -signal is discrete, such as ON/OFF, OPEN/CLOSE, energized/de-
energized etc.
Data I/O -complex system needs data, requires ADC/DAC.
Input Module functions:
Reliable signal detection
Voltage adjustment of control voltage to logic voltage
Protection of sensitive electronics from external voltages
Screening of signals.
I/O system
Output Modules functions:
Voltage adjustment of logic voltages to control voltage
Protection of sensitive electronics from spurious voltages from the controller
Power amplification for actuation of control elements
Short-circuit and overload protection of output modules
I/O system
 Discrete I/O Inputs -push-buttons, selector switches, joy sticks, relay contacts, pressure
switches, level switches, starter contacts, temperature switches, flow switches, limit switches,
photo-electric switches, and proximity switches.
 Discrete I/O Outputs -light, relays, solenoids, starters, alarms, valves, heating elements, and
motors.
 Data I/O Inputs -potentiometers, temperature transducers, level transducers, pressure
transducers, humidity transducers, encoders, bar code readers, wind speed transducers.
 Data I/O Outputs –analog meters, digital meters, stepper motors (signals), variable voltage
outputs, and variable current outputs.
I/O Capacity
A factor that determines the size of a programmable controller is the controller’s I/O and
capacity.
 Mini-Micro–usually 32 or less I/O, but may have up to 64.
 Small –usually 64 to 128 I/O, but may have up to 256.
 Medium –usually 256 to 512 I/O, but may have up to 1024.
 Large –usually 1024 to 2048 I/O, but may have many thousands more on very large units.
The I/Os may be directly connected to the PLC or may be in a remote location.
I/O sin a remote location from the processor section can be hard wired back to the controller,
multiplexed over a pair of wires, or sent by a fiberoptic cable.
Relays can be Designed to Perform Many
Functions:-
 Detect Out of Limit Conditions on Voltages and Currents
 Start Motors
 Prevent Motors from Over Heating
 Control Assembly Lines
 Adjust Lighting
LIFE CYCLE OF PLC
Interface
Programming PLC
Cont.…
• If the self diagnostic check determine that the system is operating properly, PLC
start scanning operation.
Update the Input Image Table
Scan Program Instructions
Update Output Terminals
• Three-step scanning process is continuous and is repeated many times each second.
The time it takes to complete one scan depends on the size of the program and the
microprocessor clock speed.
Programming device
• Programming a PLC involves 3 categories:
• Handheld Programmers -are small inexpensive devices. These typically have
membrane keys for entering data and LCD displays to show one line of a ladder
program.
• Dedicated Terminals -are designed for one particular brand of PLC. These
provides troubleshooting operation while the PLC is running.
• Micro-Computers / PCs -are widely used to program and simulate the program.
Tested programs are downloaded to the PLC using serial communications.
Cont...
PLC scan cycle
• While the PLC is running, the scanning process includes the following four
phases, which are repeated continuously as individual cycles of operation:
PLC Programming Languages
 EN 61131-3 defines five PLC programming languages
 Ladder Diagram (LD): graphic language derived from circuit diagram of directly wired
relay controls.
 Function Block Diagram (FBD): functions & function blocks are represented graphically
and interconnected into networks.
 Instruction List (IL): textual assembler-type language consisting of an operator and an
operand.
 Structured Text (ST): high level language based on Pascal.
 Sequential Function Chart (SFC): a language resource for the structuring of sequence-
oriented control programs.
PLC programming language
Instruction list
1. Allen-Bradley –Rockwell
Software RSLogix500
2. Modicon-Modsoft
3. Omron –Syswin
4. GE-Fanuc Series 6 –
LogicMaster6
5. Square D-Power Logic
6. Texas Instruments –Simatic
7. Telemecanique–Modicon TSX
Micro
8. Siemens –Step 7
9. Mitsubishi-MELSOFT
Ladder Diagram (LD)
The use of ladder programming involves writing a program in a manner to drawing a
switching circuit. The ladder diagram consists of two vertical lines representing the
power rails, and circuits are connected as horizontal lines.
Advantages of Ladder Language -
• It is readily understood and maintained.
• It provides graphic display of program flow.
• Programming is fast.
• Generates more readable programs for sequence control.
Ladder logic
Ladder
• Normally Open Contact -| |-
• Enables the rung to the right of the instruction if the rung to the left is enabled and
underlining bit is set (1)
• Normally Closed Contact -|/|-
• Enables the rung to the right of the instruction if the rung to the left is enabled and
underlining bit is reset (0)
• Positive transition contact -|P|-
• Enables the right side of the rung for one scan when the rung on left side of the
instruction is true
• Allen Bradley PLC5 uses -[ONS]-
• Negative transition contact -|N|-
• Enables the right side of the rung for one scan when the rung on left side of the
instruction is false
Ladder
• Coil -( )-
• Sets a bit when the rung is true(1) and resets the bit when the rung is false (0)
• PLC5 calls this an OTE Output Enable
• Negative coil -( / )-
• Sets a bit when the rung is false(0) and resets the bit when the rung is True(1)
• Not commonly supported because of potential for confusion
• Set (Latch) coil -(S)-
• Sets a bit (1) when the rung is true and does nothing when the rung is false
• Reset (Unlatch) Coil -(R)-
• Resets a bit (0) when the rung is true and does nothing when the rung is false
Retentive and Non-retentive operation
• Definitions
• Retentive values or instructions maintain their last state during a power cycle.
• Non-retentive values or instructions are reset to some default state (usually 0) after a
power cycle.
• IEC1131 permits values to be defined as retentive
• A contradiction to this is ladder diagram where 3 instructions are classified as
retentive.
• In most PLCs only timer and coil instructions operate as non-retentive.
Retentive coils
• The referenced bit is unchanged when processor power is cycled
• Retentive coil -(M)-
• Sets a bit when the rung is true(1) and resets the bit when the rung is false
(0)
• Set Retentive (Latch) coil -(SM)-
• Sets a bit (1) when the rung is true and does nothing when the rung is
false.
• Reset Retentive (Unlatch) Coil -(RM)-
• Resets a bit (0) when the rung is true and does nothing when the rung is
false.
Transition sensing coils
• Positive transition-sensing coil -(P)-
• Sets the bit (1) when rung to the left of the instruction transitions from
off(0) to on(1)
• The bit is left in this state
• Negative transition-sensing coil -(N)-
• Resets the bit (0) when rung to the left of the instruction transitions from
on(1) to off(0)
• The bit is left in this state
PLC Ladder Programming Conventions
• The vertical lines of the diagram represent the power rails
between which the circuits are constructed.
• Each rung on the ladder defines one operation in the control
process.
• A LD is read from left to right and from top to bottom.
• Each rung must start with an input/s and must end with at least
one output.
PLC Ladder Programming Conventions
• Electrical devices are shown in their normal conditions, e.g. a
normally closed switch is shown closed.
• A device can appear in more than one rung of a ladder.
• The inputs and outputs are all identified by their addresses, the
notation used depending on the PLC manufacturers.
Cont.…
Example
Example
Latch
More on Ladder diagram elements
• Timers/counters
• Timers/counters instructions results in internal outputs that provides the same
functions as hardware timers/counters.
• These are used to activate or deactivate a device after an expired intervals/counts.
• Both of these require an accumulator resistor to store the elapsed count/time
and a register to store the preset value.
• Timers can be linked together, the term is cascade, to give larger delay times than
is possible with just one timer.
More on Ladder diagram elements
• Timers
• Timers are output instructions that are internal to the PLC. These are capable of
providing timed control of devices that they activate or deactivate.
• EN 61131-3 defines 3 types of timer function blocks:
• TP: Pulse Timing
• TON: On-delay timing
• TOF: Off-delay timing
• The length of the time delay is determined by specifying a Preset value. Timer is
enabled when the rung conditions become TRUE. Once enabled, it automatically
counts up until it reaches the preset value and then goes TRUE.
More on Ladder diagram elements
More on Ladder diagram elements
• There are 3 types of timers: On-delay timer, Off-delay timer, and retentive timer.
• On delay timer Use this instruction to program a time delay after instructions become true. On –
delay timers are used when an action is to begin a specified time after the input becomes true. For
example, a certain step in the manufacturing is to begin 45 seconds after a signal is received from
a limit switch. The 45-seconds delay is the on-delay timers preset Value.
• Off-delay timer Off-delay timer instructions is used to program a time delay to begin after rung
input goes false.
• As an example, when an external cooling fan on a motor is provided, the fan has to run all the
time the motor is running and also for certain time (say 10min) after the motor is turned off. This
is a ten minute off-delay timer. The ten-minute timing period begins as soon as the motor is
turned off.
More on Ladder diagram elements
• Retentive timer
• Retentive timer is a timer which retains the accumulated value in case of
power loss, change of processor mode or rung state going from true to false
(rung state transition).
• Retentive timer can be used to track the running time of a motor for its
maintenance purpose. Each time the motor is turned off, the timer will
remember the motor’s elapsed running time. The next time the motor is
turned on, the time will increase from there. This timer can be reset by using
a reset instruction.
• Reset
• This instruction is used to reset the accumulated value of counter or timer.
• It is used to reset a retentive timer’s accumulated value to zero.
Timer Instruction Parameters
• T : 1 -timer address, where 1st address holds the status bits EN, TT, & DN;
2nd address holds preset value and the 3rd address holds accumulator to
hold the current value.
• EN-bit is TRUE as long as the timer rung is TRUE. TT -bit is TRUE as
long as the timer is counting DN -bit is TRUE when the timer is done.
Timer example
• A batch process–which involves filling a container with a liquid, mixing the
liquid, and draining the container –is automated with a PLC. The sequence
of events is as follows:
• A fill valve opens and lets the liquid into the container until it is full. liquid in
the container is mixed for 3 minutes.
• A drain valve opens and drains the tank.
Example
Counters
• Counters are used to detect and count piece members and events. Counter
instruction is placed in a rung and will increment (or decrement) every time
the rung makes a FALSE-to-TRUE transition. The count is retained until a
RESET instruction is enabled. The counter has a preset value associated
with it. When the count gets up to the preset value, the output goes TRUE.
• EN 61131-3 differentiates 3 different counter modules:
• CTU: Incremental counter
• CTD: Decremental counter
• CTUD: Incremental/Decremental counter
•Examples
Write the ladder logic for DOL manual starting
of motor ?
LOGO wiring diagram
Write the ladder logic diagram for DOL
Starting of motor with inductor lamps
for forward reverse starting
Wiring diagram for R-f
MANUAL star delta starting
Wiring diagram
Automatic star delta
Wiring diagram auto
Example 2
• Problem Description When a Car enters the hall, a certain sequence is to be
followed automatically. Steps are, 1) Soaping, 2) Washing, 3) Rinsing and 4) Drying.
Implement this process sequence in PLC using Ladder Diagram programming
language. Problem Solution To detect the car automatically, load cells can be used,
or any other sensor such as Infrared Sensor can also be used. Soaping, Washing,
Rinsing and Drying are performed for a particular time, hence to generate time
delay for these outputs become mandatory. To operate this process, for soaping,
washing, and drying, four different timers are used.IR sensor detects everything
whatever restricts the signal but in load cell, particular Low Level and High Level
can be set to detect heavily weighted cars only. Load Cell can be here more effective
here than IR sensors.
Example 2
(a)Car wash
• Car arrives limit switch ON
• Limit switch ON Washer ON
• Washer ON:
(i) Soapy water SPRAY ON for (30 secs)
(ii) Rinse: clean water SPRAY ON for (30 secs)
(iii) Automatic scrubber brushes car for (15 secs)
(iv) After washing 50 cars, the scrubber brush Auto-change
Solution
 List of Inputs and Outputs I:1/0 = Master Start
 (Input) I:1/1 = Car Detection
 (Input) I:1/2 = Limit Switch,
 Conveyor (Input) I:1/3 = Master Stop
 (Input) O:2/0 = Master Coil
 (Output) O:2/1 = Soap Sprinkler
 (Output) O:2/2 = Washer
 (Output) O:2/3 = Conveyor
 (Output) O:2/4 = Dryer
 (Output) T4:0 = Soaping Time
 (Timer) T4:1 = Washing Time
 (Timer) T4:2 = Drying Time (Timer)
Beverage bottles are moving on a conveyor belt. Capping of these bottles is performed. Crown cork caps are used for
these bottles. Implement automation of this process in PLC using Ladder Diagram programming language.
Problem Solution
 To sense the bottle, proximity sensor is used.
 Timer is used to stop the conveyor for 1sec for capping
procedure.
 Bit Shift register is also used to perform this operation.
 Count the number of steps capping machine is placed from
the sensor and set bit position to operate capping machine
accordingly.
 In this example as you can see, bottle is 8 steps away from
the proximity switch, so if Bit register B3:0 is used, then
capping machine should be operated when B3:0/0 is shifted
to B3:0/7.
 Capping machine is operated by pneumatic system.
 It is activated by air supply when energized.
 Similarly we can even make an arrangement where two
 List of Inputs and Outputs I:1/0 = Start
(Input) I:1/1 = Stop
(Input) I:1/2 = Proximity
(Input) O:2/0 = Master coil / Run
(Output) O:2/1 = Conveyor motor
(Output) O:2/2 = Capping machine
(Output) BSL = Bit shift left instruction
(Logical) B3:0 = Bit shift Register
(Register) B3:0/7 = Bit to energize capping machine
(Bit) R6:0 = Control register
(Register) T4:0 = Timer to stop conveyor for capping
(Timer) LIM = Limit output to perform capping
before conveyor starts again (Compare)
 Bottle filling has a constant speed of filling 20 bottles per minute. This speed
depends on level of the tank due to its head pressure. To maintain this speed,
pressure head of the filling tank has to be maintained at a particular. Implement
this automation in PLC using Ladder Diagram programming language.
 Solid state level switches cannot be used here since level has to be continuously monitored.
 Pressure is proportional to level.
 As level of a tank increases, pressure also increases.
 Level gauges are highly sensitive to very small variations.
 Many companies such as Rockwall Automation and Endress+Hauser manufacture pressure gauges to
measure liquid level of a tank.
 Output of this gauge is terms of pressure so we have to convert pressure into equivalent current
output. But let us assume here that maximum pressure that means when tank is full, it gives 20mA
output and when tank is empty, it gives 4mA output which is in standard form 4-20mA.Use conversion
instructions to convert this 4-20mA data into registers. To do this, Analog modules for PLCs are used.
 These modules convert 4-20mA into equivalent digital level signals.
 Output of this Analog modules are stored in Hex form which are then processed by the processor and
hex output is generated again.
 Just like Analog input modules, Analog output modules are used convert digital output data into
equivalent current signals to operate power supply circuit which varies output accordingly, to drive the
final control element, here control valve.
 List of Inputs and Outputs I:1/14 = Start
(Input) I:1/15 = Stop
(Input) B3:0/0 = Master Coil Bit (Bit)
DIV = To divide total height of the tank (Compute) MUL
= To multiply with the tank level to be maintained (Compute) N7:0
= Input from Level Gauge (Register) N7:1
= Result (Variation per cm) (Register) N7:2 =
Result of multiplication (Register) O:6 = I-P
Converter (Output)
Advantages of PLCs :
• Less wiring.
• Wiring between devices and relay contacts are
done in the PLC program.
• Easier and faster to make changes.
• Trouble shooting aids make programming easier
and reduce downtime.
• Reliable components make these likely to operate
for years before failure.
• They are cost-effective
• They are flexible, reliable and compact
• They have significant advantages over traditional control systems based
on relay or pneumatics
Comparison of Relay and PLC circuits
Relay
• Simple relay layouts
Modern control systems still include
relays, but these are rarely used for
logic. A relay is a simple device that
uses a magnetic field to control a
switch
When a voltage is applied to the
input coil, the resulting current
creates a magnetic field. The
magnetic field pulls a metal switch
(or reed) towards it and the contacts
touch, closing the switch.
Thank you !!
Question?

Chapter 4 plc programing(1) by m

  • 1.
    BAHIR DAR UNIVERSITY BAHIRDAR INSTITUTE OF TECHNOLOGY Faculty of Electrical and Computer Engineering Industrial Control focus Process control fundamentals -EEng4181 Chapter four Programmable Logic Controller By Gerbaw Y.
  • 2.
    Programmable Logic Controller(PLC) Whatdoes mean .Programmable ? • Logic ? • Controller ? • What is PLC?
  • 3.
    What is PLC? •PLC is a digital computer used for the automation of various electro-mechanical processes in industries such as control of machinery on factory assembly lines.
  • 4.
    Purpose of ProgrammableLogic Controllers (PLCs)  Initially designed to replace relay logic boards  Sequence device actuation  Coordinate activities  Accepts input from a series of switches  Sends output to devices or relays
  • 5.
    Areas of applications Manufacturing / Machining  Food / Beverage  Metals  Power  Mining  Petrochemical / Chemical
  • 6.
  • 7.
  • 8.
    PLC • Invented in1968as a substitute for hardwired relay panels. "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. " • National Electrical Manufacturing Association (NEMA)
  • 9.
    Vendors  Various PLCvendors exist:  Siemens AG  Rockwell  Mitsubishi  Schneider  Omron  Allen-Bradley …etc
  • 10.
    Vendors Typical Mitsubishi PLCmodule Typical Omron PLC module Typical Siemens PLC module
  • 11.
    PLCs are:-  Similarto a Microcontroller:  Microprocessor Based  Onboard Memory for Storing Programs  Special Programming Language: example:-Ladder Logic, …  Input/output Ports
  • 12.
    PLCs are:-  Dissimilarto Microcontrollers:  Intended for Industrial Applications  I/O Designed to interface with Control Relays  Emphasis on Maximum Reliability
  • 13.
     Rugged design;suitable for harsh industrial environments against high temperature variations, dust, and vibrations.  Industry standard I/O interfaces; capable of communicating with other PLCs, computers and intelligent devices.  Industry standard programming languages; easily learned and understood. Programming is primarily concerned with logic, timing, counting and switching operations.  Reduces hard wiring and wiring cost.  Monitoring, error checking and diagnostics capability. Competitive in both cost and space requirements.
  • 15.
    PLC and relatedcomponents
  • 16.
     PLC isessentially a microcomputer, tailored specifically for certain control tasks.  Hardware: consists of the actual device technology, i.e. the PCBs, integrated modules, wires, battery, housing etc.  Firmware: is the software part, known as executive software, that is permanently installed and supplied by the PLC manufacturer. Programs are usually stored in ROM or EPROM.  Software: is the user program. User programs are usually stored in the RAM.
  • 17.
     PLC hardwaredoes not differ significantly from computers. What makes the PLC special is the executive software. It is the internal program, provided by the manufacturer, which executes the user’s program.  The executive software determines  What functions are available to the user’s program,  How the program is solved,  How the I/O is serviced,  What the PLC does during power up and down and fault conditions
  • 18.
    MULTI-TASKING CAPABILITY  SomePLCs are capable of executing multiple tasks with a single processor. User program assigns I/O for each task separately.  Multitasking may take several forms:  Time driven -it is possible to configure the processor to run each task on periodic time intervals. Hence, the time-critical job, such as the portion of that controls high-speed motions or machine fault detection, to run faster than the noncritical portions, such as servicing indicator lights.  Event driven or Interrupt driven -user defines a particular event, such as an input changing state or an output turning off, that causes each tasks to run.
  • 19.
    PLC packaging  Themanner in which a PLC & its I/O are packaged is critical in determining its suitability for an application.  Heat Removal -appropriate means must be provided for generated heat removal to ensure low internal temperature. Commonly used methods include air venting, forced air circulation & heat sinking.  Mounting -to be mounted inside NEMA rated enclosure.
  • 20.
    Considerations in choosingPLC  Number and Types of input & output points required  Size and type of memory required  Speed and power required of CPU and instruction set  Manufacturer’s support and backup
  • 21.
    PLC consists offive major sections  Power Supply  Memory  Central Processing Unit (CPU)/ Logic Solver  I/O Interface  Programming Section
  • 22.
  • 23.
    Major PLC components Power Supply-PLCs are generally powered from AC mains and power supply system converts ac voltages to required dc voltages.  Memory-Program memory receives and holds program instructions. Data memory is used to temporarily hold data generated from processes or acquired through I/O devices.  Processor-is a micro-processor based CPU and is the part of PLC that is capable of reading and executing program instructions and data.  Program loader-is used to enter/change the user program into the memory and to monitor the program execution.
  • 25.
    Power supply  Providesvoltage levels required for internal operations (typically  +5 V dc or ±12 V dc).  Provides power for I/O modules. Provides constant voltages.  Packaged properly to prevent overheat. Separate or built into the processing unit.  It is one of the most critical components of a PLC –  It is typically non-redundant. Hence a failure of the power supply can cause the control system to fail. It usually contains high-voltage components. Hence, an isolation failure can create the potential for serious injury and fire.
  • 26.
    Memory The memory functionof the CPU stores programs and data that the CPU needs to perform various operations. The memory is organized into several sections according to the functions they perform. Executive Memory -collection of system programs stored in ROM. Scratch Pad -is the work area used to temporarily store the binary information used by the processor. These are volatile memory as RAM-type chips are usually used. Battery backed-up CMOS RAM are also used which may last up to 10 years. Processor File -the memory block in which programmer stores and manipulates the software. The processor file is made up of program files, and data files.
  • 27.
    Central Processing Unit CPU executes a program stored in the executive memory which is set by the manufacturer.  It organizes all control activity by receiving inputs, performing logical decisions according to the program, and control the outputs.  CPU does not operate on the I/O directly. Rather, it works with the I/O image stored in the I/O image memory. The I/O interface is responsible for transferring the image outputs to the I/O system, reading the inputs from the I/O system, and writing them into I/O image memory.  A ‘watchdog’ timer is provided to time the CPU to execute the user’s program. If this time exceeds a predetermined value, watchdog timer will indicate fault and execute subsequent predefined procedure.
  • 28.
    Input/output ( I/O)System I/O system acts as the eyes, ears and hands of PLCs. Discrete I/O -signal is discrete, such as ON/OFF, OPEN/CLOSE, energized/de- energized etc. Data I/O -complex system needs data, requires ADC/DAC. Input Module functions: Reliable signal detection Voltage adjustment of control voltage to logic voltage Protection of sensitive electronics from external voltages Screening of signals.
  • 29.
    I/O system Output Modulesfunctions: Voltage adjustment of logic voltages to control voltage Protection of sensitive electronics from spurious voltages from the controller Power amplification for actuation of control elements Short-circuit and overload protection of output modules
  • 30.
    I/O system  DiscreteI/O Inputs -push-buttons, selector switches, joy sticks, relay contacts, pressure switches, level switches, starter contacts, temperature switches, flow switches, limit switches, photo-electric switches, and proximity switches.  Discrete I/O Outputs -light, relays, solenoids, starters, alarms, valves, heating elements, and motors.  Data I/O Inputs -potentiometers, temperature transducers, level transducers, pressure transducers, humidity transducers, encoders, bar code readers, wind speed transducers.  Data I/O Outputs –analog meters, digital meters, stepper motors (signals), variable voltage outputs, and variable current outputs.
  • 31.
    I/O Capacity A factorthat determines the size of a programmable controller is the controller’s I/O and capacity.  Mini-Micro–usually 32 or less I/O, but may have up to 64.  Small –usually 64 to 128 I/O, but may have up to 256.  Medium –usually 256 to 512 I/O, but may have up to 1024.  Large –usually 1024 to 2048 I/O, but may have many thousands more on very large units. The I/Os may be directly connected to the PLC or may be in a remote location. I/O sin a remote location from the processor section can be hard wired back to the controller, multiplexed over a pair of wires, or sent by a fiberoptic cable.
  • 34.
    Relays can beDesigned to Perform Many Functions:-  Detect Out of Limit Conditions on Voltages and Currents  Start Motors  Prevent Motors from Over Heating  Control Assembly Lines  Adjust Lighting
  • 35.
  • 36.
  • 37.
  • 40.
    Cont.… • If theself diagnostic check determine that the system is operating properly, PLC start scanning operation. Update the Input Image Table Scan Program Instructions Update Output Terminals • Three-step scanning process is continuous and is repeated many times each second. The time it takes to complete one scan depends on the size of the program and the microprocessor clock speed.
  • 41.
    Programming device • Programminga PLC involves 3 categories: • Handheld Programmers -are small inexpensive devices. These typically have membrane keys for entering data and LCD displays to show one line of a ladder program. • Dedicated Terminals -are designed for one particular brand of PLC. These provides troubleshooting operation while the PLC is running. • Micro-Computers / PCs -are widely used to program and simulate the program. Tested programs are downloaded to the PLC using serial communications.
  • 42.
  • 43.
    PLC scan cycle •While the PLC is running, the scanning process includes the following four phases, which are repeated continuously as individual cycles of operation:
  • 44.
    PLC Programming Languages EN 61131-3 defines five PLC programming languages  Ladder Diagram (LD): graphic language derived from circuit diagram of directly wired relay controls.  Function Block Diagram (FBD): functions & function blocks are represented graphically and interconnected into networks.  Instruction List (IL): textual assembler-type language consisting of an operator and an operand.  Structured Text (ST): high level language based on Pascal.  Sequential Function Chart (SFC): a language resource for the structuring of sequence- oriented control programs.
  • 45.
  • 46.
  • 47.
    1. Allen-Bradley –Rockwell SoftwareRSLogix500 2. Modicon-Modsoft 3. Omron –Syswin 4. GE-Fanuc Series 6 – LogicMaster6 5. Square D-Power Logic 6. Texas Instruments –Simatic 7. Telemecanique–Modicon TSX Micro 8. Siemens –Step 7 9. Mitsubishi-MELSOFT
  • 48.
    Ladder Diagram (LD) Theuse of ladder programming involves writing a program in a manner to drawing a switching circuit. The ladder diagram consists of two vertical lines representing the power rails, and circuits are connected as horizontal lines. Advantages of Ladder Language - • It is readily understood and maintained. • It provides graphic display of program flow. • Programming is fast. • Generates more readable programs for sequence control.
  • 49.
  • 50.
    Ladder • Normally OpenContact -| |- • Enables the rung to the right of the instruction if the rung to the left is enabled and underlining bit is set (1) • Normally Closed Contact -|/|- • Enables the rung to the right of the instruction if the rung to the left is enabled and underlining bit is reset (0) • Positive transition contact -|P|- • Enables the right side of the rung for one scan when the rung on left side of the instruction is true • Allen Bradley PLC5 uses -[ONS]- • Negative transition contact -|N|- • Enables the right side of the rung for one scan when the rung on left side of the instruction is false
  • 51.
    Ladder • Coil -()- • Sets a bit when the rung is true(1) and resets the bit when the rung is false (0) • PLC5 calls this an OTE Output Enable • Negative coil -( / )- • Sets a bit when the rung is false(0) and resets the bit when the rung is True(1) • Not commonly supported because of potential for confusion • Set (Latch) coil -(S)- • Sets a bit (1) when the rung is true and does nothing when the rung is false • Reset (Unlatch) Coil -(R)- • Resets a bit (0) when the rung is true and does nothing when the rung is false
  • 52.
    Retentive and Non-retentiveoperation • Definitions • Retentive values or instructions maintain their last state during a power cycle. • Non-retentive values or instructions are reset to some default state (usually 0) after a power cycle. • IEC1131 permits values to be defined as retentive • A contradiction to this is ladder diagram where 3 instructions are classified as retentive. • In most PLCs only timer and coil instructions operate as non-retentive.
  • 53.
    Retentive coils • Thereferenced bit is unchanged when processor power is cycled • Retentive coil -(M)- • Sets a bit when the rung is true(1) and resets the bit when the rung is false (0) • Set Retentive (Latch) coil -(SM)- • Sets a bit (1) when the rung is true and does nothing when the rung is false. • Reset Retentive (Unlatch) Coil -(RM)- • Resets a bit (0) when the rung is true and does nothing when the rung is false.
  • 54.
    Transition sensing coils •Positive transition-sensing coil -(P)- • Sets the bit (1) when rung to the left of the instruction transitions from off(0) to on(1) • The bit is left in this state • Negative transition-sensing coil -(N)- • Resets the bit (0) when rung to the left of the instruction transitions from on(1) to off(0) • The bit is left in this state
  • 55.
    PLC Ladder ProgrammingConventions • The vertical lines of the diagram represent the power rails between which the circuits are constructed. • Each rung on the ladder defines one operation in the control process. • A LD is read from left to right and from top to bottom. • Each rung must start with an input/s and must end with at least one output.
  • 56.
    PLC Ladder ProgrammingConventions • Electrical devices are shown in their normal conditions, e.g. a normally closed switch is shown closed. • A device can appear in more than one rung of a ladder. • The inputs and outputs are all identified by their addresses, the notation used depending on the PLC manufacturers.
  • 57.
  • 58.
  • 59.
  • 60.
  • 61.
    More on Ladderdiagram elements • Timers/counters • Timers/counters instructions results in internal outputs that provides the same functions as hardware timers/counters. • These are used to activate or deactivate a device after an expired intervals/counts. • Both of these require an accumulator resistor to store the elapsed count/time and a register to store the preset value. • Timers can be linked together, the term is cascade, to give larger delay times than is possible with just one timer.
  • 62.
    More on Ladderdiagram elements • Timers • Timers are output instructions that are internal to the PLC. These are capable of providing timed control of devices that they activate or deactivate. • EN 61131-3 defines 3 types of timer function blocks: • TP: Pulse Timing • TON: On-delay timing • TOF: Off-delay timing • The length of the time delay is determined by specifying a Preset value. Timer is enabled when the rung conditions become TRUE. Once enabled, it automatically counts up until it reaches the preset value and then goes TRUE.
  • 63.
    More on Ladderdiagram elements
  • 64.
    More on Ladderdiagram elements • There are 3 types of timers: On-delay timer, Off-delay timer, and retentive timer. • On delay timer Use this instruction to program a time delay after instructions become true. On – delay timers are used when an action is to begin a specified time after the input becomes true. For example, a certain step in the manufacturing is to begin 45 seconds after a signal is received from a limit switch. The 45-seconds delay is the on-delay timers preset Value. • Off-delay timer Off-delay timer instructions is used to program a time delay to begin after rung input goes false. • As an example, when an external cooling fan on a motor is provided, the fan has to run all the time the motor is running and also for certain time (say 10min) after the motor is turned off. This is a ten minute off-delay timer. The ten-minute timing period begins as soon as the motor is turned off.
  • 65.
    More on Ladderdiagram elements • Retentive timer • Retentive timer is a timer which retains the accumulated value in case of power loss, change of processor mode or rung state going from true to false (rung state transition). • Retentive timer can be used to track the running time of a motor for its maintenance purpose. Each time the motor is turned off, the timer will remember the motor’s elapsed running time. The next time the motor is turned on, the time will increase from there. This timer can be reset by using a reset instruction. • Reset • This instruction is used to reset the accumulated value of counter or timer. • It is used to reset a retentive timer’s accumulated value to zero.
  • 66.
    Timer Instruction Parameters •T : 1 -timer address, where 1st address holds the status bits EN, TT, & DN; 2nd address holds preset value and the 3rd address holds accumulator to hold the current value. • EN-bit is TRUE as long as the timer rung is TRUE. TT -bit is TRUE as long as the timer is counting DN -bit is TRUE when the timer is done.
  • 67.
    Timer example • Abatch process–which involves filling a container with a liquid, mixing the liquid, and draining the container –is automated with a PLC. The sequence of events is as follows: • A fill valve opens and lets the liquid into the container until it is full. liquid in the container is mixed for 3 minutes. • A drain valve opens and drains the tank.
  • 68.
  • 69.
    Counters • Counters areused to detect and count piece members and events. Counter instruction is placed in a rung and will increment (or decrement) every time the rung makes a FALSE-to-TRUE transition. The count is retained until a RESET instruction is enabled. The counter has a preset value associated with it. When the count gets up to the preset value, the output goes TRUE. • EN 61131-3 differentiates 3 different counter modules: • CTU: Incremental counter • CTD: Decremental counter • CTUD: Incremental/Decremental counter
  • 70.
  • 71.
    Write the ladderlogic for DOL manual starting of motor ?
  • 72.
  • 73.
    Write the ladderlogic diagram for DOL Starting of motor with inductor lamps
  • 74.
  • 75.
  • 76.
  • 77.
  • 78.
  • 79.
  • 80.
    Example 2 • ProblemDescription When a Car enters the hall, a certain sequence is to be followed automatically. Steps are, 1) Soaping, 2) Washing, 3) Rinsing and 4) Drying. Implement this process sequence in PLC using Ladder Diagram programming language. Problem Solution To detect the car automatically, load cells can be used, or any other sensor such as Infrared Sensor can also be used. Soaping, Washing, Rinsing and Drying are performed for a particular time, hence to generate time delay for these outputs become mandatory. To operate this process, for soaping, washing, and drying, four different timers are used.IR sensor detects everything whatever restricts the signal but in load cell, particular Low Level and High Level can be set to detect heavily weighted cars only. Load Cell can be here more effective here than IR sensors.
  • 81.
    Example 2 (a)Car wash •Car arrives limit switch ON • Limit switch ON Washer ON • Washer ON: (i) Soapy water SPRAY ON for (30 secs) (ii) Rinse: clean water SPRAY ON for (30 secs) (iii) Automatic scrubber brushes car for (15 secs) (iv) After washing 50 cars, the scrubber brush Auto-change
  • 82.
  • 83.
     List ofInputs and Outputs I:1/0 = Master Start  (Input) I:1/1 = Car Detection  (Input) I:1/2 = Limit Switch,  Conveyor (Input) I:1/3 = Master Stop  (Input) O:2/0 = Master Coil  (Output) O:2/1 = Soap Sprinkler  (Output) O:2/2 = Washer  (Output) O:2/3 = Conveyor  (Output) O:2/4 = Dryer  (Output) T4:0 = Soaping Time  (Timer) T4:1 = Washing Time  (Timer) T4:2 = Drying Time (Timer)
  • 85.
    Beverage bottles aremoving on a conveyor belt. Capping of these bottles is performed. Crown cork caps are used for these bottles. Implement automation of this process in PLC using Ladder Diagram programming language.
  • 86.
    Problem Solution  Tosense the bottle, proximity sensor is used.  Timer is used to stop the conveyor for 1sec for capping procedure.  Bit Shift register is also used to perform this operation.  Count the number of steps capping machine is placed from the sensor and set bit position to operate capping machine accordingly.  In this example as you can see, bottle is 8 steps away from the proximity switch, so if Bit register B3:0 is used, then capping machine should be operated when B3:0/0 is shifted to B3:0/7.  Capping machine is operated by pneumatic system.  It is activated by air supply when energized.  Similarly we can even make an arrangement where two
  • 87.
     List ofInputs and Outputs I:1/0 = Start (Input) I:1/1 = Stop (Input) I:1/2 = Proximity (Input) O:2/0 = Master coil / Run (Output) O:2/1 = Conveyor motor (Output) O:2/2 = Capping machine (Output) BSL = Bit shift left instruction (Logical) B3:0 = Bit shift Register (Register) B3:0/7 = Bit to energize capping machine (Bit) R6:0 = Control register (Register) T4:0 = Timer to stop conveyor for capping (Timer) LIM = Limit output to perform capping before conveyor starts again (Compare)
  • 89.
     Bottle fillinghas a constant speed of filling 20 bottles per minute. This speed depends on level of the tank due to its head pressure. To maintain this speed, pressure head of the filling tank has to be maintained at a particular. Implement this automation in PLC using Ladder Diagram programming language.
  • 90.
     Solid statelevel switches cannot be used here since level has to be continuously monitored.  Pressure is proportional to level.  As level of a tank increases, pressure also increases.  Level gauges are highly sensitive to very small variations.  Many companies such as Rockwall Automation and Endress+Hauser manufacture pressure gauges to measure liquid level of a tank.  Output of this gauge is terms of pressure so we have to convert pressure into equivalent current output. But let us assume here that maximum pressure that means when tank is full, it gives 20mA output and when tank is empty, it gives 4mA output which is in standard form 4-20mA.Use conversion instructions to convert this 4-20mA data into registers. To do this, Analog modules for PLCs are used.  These modules convert 4-20mA into equivalent digital level signals.  Output of this Analog modules are stored in Hex form which are then processed by the processor and hex output is generated again.  Just like Analog input modules, Analog output modules are used convert digital output data into equivalent current signals to operate power supply circuit which varies output accordingly, to drive the final control element, here control valve.
  • 91.
     List ofInputs and Outputs I:1/14 = Start (Input) I:1/15 = Stop (Input) B3:0/0 = Master Coil Bit (Bit) DIV = To divide total height of the tank (Compute) MUL = To multiply with the tank level to be maintained (Compute) N7:0 = Input from Level Gauge (Register) N7:1 = Result (Variation per cm) (Register) N7:2 = Result of multiplication (Register) O:6 = I-P Converter (Output)
  • 93.
    Advantages of PLCs: • Less wiring. • Wiring between devices and relay contacts are done in the PLC program. • Easier and faster to make changes. • Trouble shooting aids make programming easier and reduce downtime. • Reliable components make these likely to operate for years before failure. • They are cost-effective • They are flexible, reliable and compact • They have significant advantages over traditional control systems based on relay or pneumatics
  • 95.
    Comparison of Relayand PLC circuits
  • 96.
    Relay • Simple relaylayouts Modern control systems still include relays, but these are rarely used for logic. A relay is a simple device that uses a magnetic field to control a switch When a voltage is applied to the input coil, the resulting current creates a magnetic field. The magnetic field pulls a metal switch (or reed) towards it and the contacts touch, closing the switch.
  • 97.