programable logic controller
TRANSCRIPT
-
8/12/2019 Programable Logic Controller
1/48
PROGRAMMABLELOGIC
CONTROLLER
-
8/12/2019 Programable Logic Controller
2/48
Control Systems Types
Programmable Logic Controllers
Distributed Control System PC- Based Controls
-
8/12/2019 Programable Logic Controller
3/48
PROGRAMMABLELOGIC
CONTROLLER
Aprogrammable logic controller
(PLC), orprogrammablecontrolleris a digital computerusedfor automationof industrial
processes, such as control ofmachinery on factory assembly lines.
http://en.wikipedia.org/wiki/Digital_computerhttp://en.wikipedia.org/wiki/Automationhttp://en.wikipedia.org/wiki/Assembly_linehttp://en.wikipedia.org/wiki/Assembly_linehttp://en.wikipedia.org/wiki/Automationhttp://en.wikipedia.org/wiki/Digital_computer -
8/12/2019 Programable Logic Controller
4/48
Programmable Logic Controllers
PLC
Sequential logic solver
PID Calculations.Advanced Subroutines
BIT Operations.
Data Transfer.
Text Handling.
-
8/12/2019 Programable Logic Controller
5/48
Applications : Machine controls, Packaging, Palletizing, Material handling, similar
Sequential task as well as Process control
Advantages of PLC :
They are fast and designed for the rugged industrial environment. They are attractive on Cost-Per-Point Basis.
These Devices are less Proprietary ( E.g.. Using Open Bus Interface.)
These Systems are upgraded to add more Intelligence and Capabilitieswith dedicated PID and Ethernet Modules.
Disadvantages of PLC : PLC were Designed for Relay Logic Ladder and have Difficulty with
some Smart Devices.
To maximize PLC performance and Flexibility, a number of OptionalModules must be added
Programmable Logic Controllers
-
8/12/2019 Programable Logic Controller
6/48
PLC Types Nano (Small)
Micro (Medium)
Large
Basic criteria for PLC Types
Memory Capacity I/O Range
Packaging and Cost per Point
Programmable Logic Controllers
-
8/12/2019 Programable Logic Controller
7/48
Components
Central Processing Unit (CPU)
Input Output Modules
Power Supply
Bus system
Programmable Logic Controllers
-
8/12/2019 Programable Logic Controller
8/48
Central Processing Unit
It is a micro-controller based circuitry. The CPU consists offollowing blocks :
Arithmetic Logic Unit (ALU), Program memoryProcess image memory (Internal memory of CPU)
Internal timers and counters & Flags
CPU performs the task necessary to fulfill the PLCfunctions. These tasks include Scanning, I/O bus trafficcontrol, Program execution, Peripheral and External devicecommunication, special functions or data handlingexecution and self diagnostics.
Programmable Logic Controllers
-
8/12/2019 Programable Logic Controller
9/48
Input module
These modules act as interface between real-time status ofprocess variable and the CPU.
Analog input module : Typical input to these modules is
4-20 mA, 0-10 V
Ex : Pressure, Flow, Level Tx , RTD (Ohm), Thermocouple(mV)
Digital input module : Typical input to these modules is 24 VDC, 115 V AC, 230 V AC
Ex. : Switches, Pushbuttons, Relays, pump valve on offstatus
Programmable Logic Controllers
-
8/12/2019 Programable Logic Controller
10/48
Output module
These modules act as link between the CPU and the outputdevices in the field.
Analog output module : Typical output from thesemodules is 4-20 mA, 0-10 V
Ex : Control Valve, Speed, Vibration
Digital output module : Typical output from these modulesis 24 V DC, 115 V AC, 230 V AC
Ex. : Solenoid Valves, lamps, Actuators, dampers, Pumpvalve on off control
Programmable Logic Controllers
-
8/12/2019 Programable Logic Controller
11/48
Power Supply
The power supply gives the voltage required forelectronics module (I/O Logic signals, CPU, memoryunit and peripheral devices) of the PLC from the linesupply.
The power supply provides isolation necessary toprotect the solid state devices from most high voltageline spikes.
As I/O is expanded, some PLC may require additionalpower supplies in order to maintain proper powerlevels.
Programmable Logic Controllers
-
8/12/2019 Programable Logic Controller
12/48
Bus System
It is path for the transmission of the signal . Bu system isresponsible for the signal exchange between processorand I/O modules
The bus system comprise of several single line ie wires /tracks
Programmable Logic Controllers
-
8/12/2019 Programable Logic Controller
13/48
PLC Cycle
Outputs
Machine
or
Process
Programmable
controller
Inputs
Sense the Input
Process the Logic
Give Output
-
8/12/2019 Programable Logic Controller
14/48
PLC Signal Flow
Programming Terminal
O:0/7
O:0/7
O:1/5
Output Devices
Output ModulesProcessor MemoryInput Module
Input Devices
Ladder Program
O:0/7
O:1/5
I:0/6
I:1/4
O:1/5
I:0/6
I:1/4
I:0/6
I:1/4
DataInput
Image Table
Output
Image Table
-
8/12/2019 Programable Logic Controller
15/48
PLC Architecture Evolution
Mid - 1970s : Discrete Machine Control
Programming Language :
- Relay ladder logic- Flexibility in altering
Control system operation
Programming
Terminal
PLC
I/O
Connection is Point to Point
Connection is Point to Point
-
8/12/2019 Programable Logic Controller
16/48
Early - to - Mid 1980 : Discrete and Process Control
PLC Architecture Evolution
Programming Language :
- Ladder Program
- PID
- Data Storage
Reasonable Computer
Running PLC
Programming Software
PLC
I/O
MS - DOS
-
8/12/2019 Programable Logic Controller
17/48
PLC Architecture Evolution
Late 1980s to early 1990s : Discrete and ProcessControl
PLC became a part of the
developing enterprise resource
system
PC running
PLC Programming Software
PLC
I/O
Connection in networked allowing
Multiple PLC
Windows
PLC
-
8/12/2019 Programable Logic Controller
18/48
Today: Distributed I/O Modules
Distributed I/O modules
PLC
Distributed I/O scanner
Data Communication Bus
PLC Architecture Evolution
-
8/12/2019 Programable Logic Controller
19/48
Remote
I/O Network
SPLITTERS
FIBER OPTIC LINK
TAPS
Today : Hot Redundant System
PLC Architecture Evolution
-
8/12/2019 Programable Logic Controller
20/48
Controller Controller
Controller
Controller
Workstation Workstation Workstation Workstation
Switched Hub
PLC Architecture Evolution
Today : Ethernet Technology in PLCs
-
8/12/2019 Programable Logic Controller
21/48
Remote
Platform
Wireless Modem
Wireless Modem
PLC
H M IDisplay PC
PLC Architecture Evolution
Today : Wireless communication
PLC
-
8/12/2019 Programable Logic Controller
22/48
PLC Systems of various vendors
Siemens S5 -110U, 115U, 135U
S7 - 200, 300, 400
Allen Bradley Micrologix 1000, 1200, 1500
SLC 5/01, 5/02, 5/03
PLC 5/10, 5/25 and 5/40
Modicon Nano Micro
Premium
Quantum
-
8/12/2019 Programable Logic Controller
23/48
8 Analog Inputs 1Analog Output
Up/Down FastCounter
Up Counter
Programming Terminal PC Connection
Unitelway Port for connectionof up to 5 Slaves
PCMCIA memory expansion port
PCMCIA communications port
TSX37-22
Built in display for I/O(in-rack, AS-i) and Diag
I/O Modules
Configuration of PLC : Modicon
-
8/12/2019 Programable Logic Controller
24/48
Configuration of PLC : Siemens
CPU
External Power
Supply
I/O Modules
-
8/12/2019 Programable Logic Controller
25/48
Configuration of PLC : Allen Bradley
CPU
Power SupplyI/O Modules
-
8/12/2019 Programable Logic Controller
26/48
Configuration of PLC : GE FANUC
CPU
I/O Modules Back plane
-
8/12/2019 Programable Logic Controller
27/48
PLC Programming Standards
The open, manufacturer-independent programmingstandard for automation is IEC 61131-3. You can thus choosewhat configuration interface you wish to use when writing your
application :
Ladder Diagram
Instruction List
Function Block Diagram Sequential Function Chart
Structured Text
-
8/12/2019 Programable Logic Controller
28/48
Cost of hardware, software, Integration Engineering,Design, Installation, Start-up and Commissioning,Validation documentation and Execution, Training, Spareparts, Maintenance, System service contract and system life
cycle. Reliability, Flexibility, Scalability and Validatability.
Ease of Database configuration, Graphics development,Interlocks and Batch processing.
Integration of High-level Application. Control Philosophy for Centralized versus Remote
Operator Console or both.
Compliance with an Industry batch standard such as ISA
SP88 and new Communication Protocol.
PLC DCS Selection Criteria
-
8/12/2019 Programable Logic Controller
29/48
Introduction to
IEC1131-3 Ladder Diagram
-
8/12/2019 Programable Logic Controller
30/48
CPU
Origins of Ladder Diagram The Ladder Diagram (LD) programming
language originated from the graphicalrepresentation used to design an electricalcontrol system Control decisions were made using relays
After a while Relays were replaced by logiccircuits Logic gates used to make control decisions
Finally CPUs were added to take over thefunction of the logic circuits I/O Devices wired to buffer transistors
Control decisions accomplished through
programming Relay Logic representation (or LD) was
developed to make program creation andmaintenance easier Computer based graphical representation of
wiring diag. that was easy to understand
Reduced training and support cost
ORAND
-
8/12/2019 Programable Logic Controller
31/48
What is a Rung?
A rung of ladder diagram code can containboth input and output instructions Input instructions perform a comparison or test
and set the rung state based on the outcome Normally left justified on the rung
Output instructions examine the rung state andexecute some operation or function
In some cases output instructions can set the rung state Normally right justified on the rung
Input Instruction Output Instruction
-
8/12/2019 Programable Logic Controller
32/48
Series Vs Parallel Operations Ladder Diagram input instructions perform logical AND and OR
operations in and easy to understand format
If all Input Instructions in series must all be true for outputs toexecute (AND)
If any input instruction in parallel is true, the outputs will execute
(OR) Paralleling outputs allows multiple operations to occur based on the
same input criteria
OR
AND
A
B
C D
IF ((A OR B) AND (NOT C) AND D) THEN E=1; F=1 END_IF
E
F
Branches
-
8/12/2019 Programable Logic Controller
33/48
Ladder Logic Execution
Rungs of Ladder diagram are solved fromLeft to right and top to bottom
Branches within rungs are solved top left to
bottom right
A D
B
F
G
I J
Left Power Rail
R
K
P S
E
H
Branch
Right Power Rail
Ladder Rung
-
8/12/2019 Programable Logic Controller
34/48
Non Retentive Coils The referenced bit is reset when processor power is
cycledCoil -( )-
Sets a bit when the rung is true(1) and resets the bit when therung 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
-
8/12/2019 Programable Logic Controller
35/48
Contacts
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
-
8/12/2019 Programable Logic Controller
36/48
Retentive Vs Non-retentive
OperationDefinitions
Retentive values or instructions maintain their laststate during a power cycle
Non-retentive values or instructions are reset tosome default state (usually 0) after a power cycle
IEC1131 permits values to be defined asretentiveA contradiction to this is ladder diagram where 3
instructions are classified as retentive
In most PLCs only timer and coil instructionsoperate as non-retentive
-
8/12/2019 Programable Logic Controller
37/48
Retentive Coils
The referenced bit is unchanged whenprocessor power is cycledRetentive coil -(M)-
Sets a bit when the rung is true(1) and resets the bit whenthe 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
PLC5 uses OTL Output Latch
Reset Retentive (Unlatch) Coil -(RM)- Resets a bit (0) when the rung is true and does nothing
when the rung is false
PLC5 uses OUT Output Unlatch
-
8/12/2019 Programable Logic Controller
38/48
Transition Sensing Coils
Positive transition-sensing coil -(P)- Sets the bit bit (1) when rung to the left of the
instruction transitions from off(0) to on(1)
The bit is left in this state PLC5 use OSR (One Shot Rising)
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
PLC5 uses OSF (One Shot Falling)
-
8/12/2019 Programable Logic Controller
39/48
IEC Comparison Instructions in Ladder
If the rung input (EN) is enabled, the instructionperforms the operation and sets the rung output(ENO) based on the comparison
Example: when EN is true, EQ (=) function
compares In1 and to In2 and sets ENO
Comprehensive instruction set
EQ(=), GT (>), GE (>=), LT (
-
8/12/2019 Programable Logic Controller
40/48
Timers in Ladder Diagram There three timer instructions
in IEC1131 TP - Pulse timer
TON - Timer On Delay
TOF - Timer Off Delay
Time values
Time base is 1msec (1/1000 ofa sec)
Values entered using durationliteral format
Two possible visualizationsDepending on use of EN/ENO
1st method requires extraprogramming if timer donestatus needs to be referencedon other rungs
2nd method sets a bit with Qwhich can be referenced by
other logic, ENO=EN
TON
T#200ms
Pump_Tmr
PT ET 178
Q
IN ENO
Pump_Tmr_DN
TONIN
T#200ms
Pump_Tmr
PT ET 178
Q
-
8/12/2019 Programable Logic Controller
41/48
Timer Operation
IN
Q
ETPT
|
0
Pulse (TP) Timing
IN
Q
ETPT
|
0
On-Delay (TON) Timing
IN
Q
ETPT
|
0
Off-Delay (TOF) Timing
IN = Rung inputcondition
Q = Comparison
output results Varies with timer types
PT = Preset Time
ET = Elapse Time
-
8/12/2019 Programable Logic Controller
42/48
Counters in Ladder Diagram
There three counter instructionsin IEC1131 CTU - Count Up Counter
CTD - Count Down Counter
CTUD - Count Up/DownCounter
All three count rung transitions
Two possible visualizationsDepending on use of EN/ENO 1st method requires extra
programming if timer donestatus needs to be referenced onother rungs
2nd method sets a bit with Qwhich can be referenced byother logic, ENO=EN
CTU
200
Load_Cnt
PV CV 178
Q
IN ENO
Load_Cnt_DNR
CTU
200
Load_Cnt
PV CV 178
QIN
R
-
8/12/2019 Programable Logic Controller
43/48
Counter Operation
Parameters CU/CD = Count up/Down
Q/QU/QD = Comparison Output
R = Reset to Zero
LD = Load CV with PV
PV = Preset Value
CV = Count Value
...
...
CVPV
|
0
CU
QUCD
QD
LD
R
Count Up/Down (CTUD) Counter
...IN
Q
CVPV|0
LD
...Count Down (CTD) Counter
...IN
Q
CVPV
|
0
R
Count Up (CTU) Counter
...
-
8/12/2019 Programable Logic Controller
44/48
CAL
RET RET
CAL
Execution Control Elements Jump / Label
Instructions Jump to a label skips a
block of code without it
being scanned LBL - Named target for a
jump operation
JMP - Performs a jumpwhen the rung
conditions are true
CALL / RETURNInstructions Used to encapsulate logic
and call it as a subroutine
Causes execution to change
between functions orsubroutines
CAL - Passes control toanother named function
PLC5 uses JSR
RET - Exits a function and
returns control back to thecalling routine
| Skip_Calc |
|-| |-------------(JMP)--|
| ... |
| Skip_Calc |
|---[LBL]---...
-
8/12/2019 Programable Logic Controller
45/48
The look and feel of IEC 1131-3 is somewhatdifferent from the 1Million+ PLCs that AllenBradley has running in factories throughoutthe world
IEC places the input parameters on theoutside of the instruction block vs the PLC5where they are presented inside of the block
TON
Timer
Preset
Pump_Tmr
200.000
Accum 178.251
(EN)
(DN)
ADD
Source A
Source B
Tank1_In
Offsetr
Destination Tank_Level
178.251
78.251
100.000
+EN
100.000 178.251
ENO
78.251Offsetr
Tank1_In Tank_Level
Different Instruction Presentations
TON
T#200ms
Pump_Tmr
PT ET 178
Q
IN ENO
Pump_Tmr_DN
Extending the IEC1131-3 Instruction Set
-
8/12/2019 Programable Logic Controller
46/48
Extending the IEC1131 3 Instruction Set
IEC1131-3 Provides a very basic set of instructions to do simple operations (81Ladder Diagram Instructions)
Data Type Conversion - Trunc, Int_to_Sint, Dint_to_Real, Bcd_To_Int
Boolean Operations - Bit Test, Bit Set, One Shot, Semaphores Timers / Counters - Ton, Tp, Ctu, Ctd, Ctud
Simple Math - Add, Sub, Mul, Div, Mod, Move, Expt
Misc. Math - Abs, Sqrt, Ln, Log, Exp, Sin, Cos, Tan, Asin, Acos, Atan
Bit Shift - Shl, Shr, Ror, Rol
Logic - And, Or, Xor, Not Selection - Sel, Max, Min, Limit, Mux
Compare - GT, GE, EQ, LE, LT, NE
String - Len, Left, Right, Mid, Connect, Insert, Delete, Replace, Find
Control - JMP, LBL, JSR, RET
All complex operations are left to the user or vendor to define File Operations, PID, Diagnostic, For/Nxt Loop, Search, Sort are not in
IEC1131-3
Extensions to the instruction set are permitted so that vendors can addinstructions that their customers need
All vendors have defined their own set of extensions
Rockwell Automation controllers have significantly more capabilitywith over 130 Ladder Instructions
Extensions to IEC provide code
-
8/12/2019 Programable Logic Controller
47/48
=
Rockwell Automation FIFO Load Instruction
IEC1131-3 Load FIFO Logic
1 Rung of Logic
1 InstructionMinutes to code and debug11 Rungs of Logic
17 Instructions
Hours to code and debug
Extensions to IEC provide codeoptimization and ease of use
-
8/12/2019 Programable Logic Controller
48/48
Instruction Extension to
IEC1131-3 FIFO & LIFO - FFL, FFU, LFL, LFU File math and search - FAL, FSC
Table operations - SRT, STD, AVE
Sequencers - SQI, SQL, SQO, SDS
Diagnostics - DDT, DFA, FBC
Compare - CMP, MEQ
Compute - CPT, NEG
Data moves - MVM, COP, BTD
Program Control - AFI, NOP, MCR, TND Interrupt Services - UID, UIE
Retentive Timer - RTO
Ladder Loop Instruction - FOR, NXT
Process - PID