Programmable Logic Controllers 2.3 Automates Programmables

Transcription

Programmable Logic Controllers 2.3 Automates Programmables
Industrial Automation
Automation Industrielle
Industrielle Automation
K_TIT
POST_START_TIMER_MOD
TIT_RATE_LIM_UP
TIT_REF_MAX_START
MAX_INT
N_GT
100
0
FAULT_STATE[tit1_oor]
TIT_ERROR
lim
TIT_REF_TAB
I P
PID
D
WFD_TIT
TD_TIT
TIT_RATE_LIM_DN
OR
FAULT_STATE[tit2_oor]
17.3
TIT
2.3
Programmable Logic Controllers
Automates Programmables
Speicherprogrammierbare Steuerungen
Prof. Dr. H. Kirrmann
ABB Research Center, Baden, Switzerland
2010 March, HK
2.3.1 PLCs: Definition and Market
2.1 Instrumentation
2.2 Control
2.3 Programmable Logic Controllers
2.3.1
PLCs: Definition and Market
2.3.2
PLCs: Kinds
2.3.3
PLCs: Functions and construction
2.3.4
Continuous and Discrete Control
2.3.5
PLC Programming Languages
2.3.5.1
IEC 61131 Languages
2.3.5.2 Function blocks
2.3.5.3 Program Execution
2.3.5.4 Input / Output
2.3.5.5 Structured Text
2.3.5.6 Sequential Function Charts
2.3.5.7 Ladder Logic
2.3.5.8 Instruction Lists
2.3.5.9 Programming environment
Industrial Automation
Programmable Logic Controllers 2.3 - 2
PLC = Programmable Logic Controller: Definition
AP = Automates Programmables industriels
SPS = Speicherprogrammierbare Steuerungen
Definition:
“small computers, dedicated to automation tasks in an industrial environment"
Formerly:
cabled relay control (hence 'logic'), analog (pneumatic, hydraulic) “governors”
Today:
real-time (embedded) computer with extensive input/output
Function:
Measure, Control, Protect
Distinguish
Instrumentation
flow meter, temperature, position,…. but also actors (pump, …)
Control
programmable logic controllers with digital peripherals & field bus
Visualization
*Human Machine Interface
HMI* in PLCs (when it exists) is limited to service help and
control of operator displays
Industrial Automation
Programmable Logic Controllers 2.3 - 3
Simple PLC
network
binary inputs
analog inputs / outputs
binary outputs
Industrial Automation
Programmable Logic Controllers 2.3 - 4
PLC in a cabinet
CPU1
CPU2
serial connections
redundant field
bus connection
inputs/outputs
Industrial Automation
Programmable Logic Controllers 2.3 - 5
example: turbine control (in the test lab)
Industrial Automation
Programmable Logic Controllers 2.3 - 6
PLC: functions
(Messen, Schützen, Regeln = MSR)
PLC = PMC: Protection, Measurement and Control
• Measure
• Control (Command and Regulation)
• Protection
•Communication
•Event Logging
•Human interface
Industrial Automation
Programmable Logic Controllers 2.3 - 7
PLC: Characteristics
• large number of peripherals: 20..100 I/O per CPU, high density of wiring, easy assembly.
• binary and analog Input/Output with standard levels
• located near the plant (field level), require robust construction, protection against dirt,
water and mechanical threats (IP00 to IP68), electro-magnetic noise, vibration,
extreme temperature range (-30C..85C)
• programming: either very primitive with hand-help terminals on the target machine
itself, or with a lap-top able to down-load programs.
• network connection allowing programming on workstations and connection to SCADA
• field bus connection for remote I/Os
• primitive Man-Machine interface, either through LCD-display or connection of a laptop
over serial lines (RS232 in terminal mode e.g. VT100).
• economical - €1000.- .. €15'000.- for a full crate.
• the value is in the application software (licenses €20'000 ..€50'000)
Industrial Automation
Programmable Logic Controllers 2.3 - 8
PLC: Location in the control architecture
Enterprise Network
Engineer
station
Operator
station
Supervisor
Station
gateway
direct I/O
Industrial Automation
Field Stations
COM 2
CPU
I/O
gateway
COM
COM
CPU
I/O
I/O
COM
I/O
COM
CPU
I/O
I/O
I/O
I/O
CPU
PLC
Field Bus
FB
gateway
small PLC
data concentrators,
not programmable,
but configurable
COM1
I/O
I/O
Control Station
with Field Bus
Field Bus
COM
directly connected
I/O
I/O
I/O
PLC
COM 2
CPU
COM1
I/O
I/O
I/O
I/O
I/O
COM1
large
PLCs
CPU
Control Bus
(e.g. Ethernet)
Field Devices
Sensor Bus (e.g. ASI)
Programmable Logic Controllers 2.3 - 9
2.3.3 PLCs: Kinds
2.1 Instrumentation
2.2 Control
2.3 Programmable Logic Controllers
2.3.1
PLCs: Definition and Market
2.3.2
PLCs: Kinds
2.3.3
PLCs: Functions and construction
2.3.4
Continuous and Discrete Control
2.3.5
PLC Programming Languages
2.3.5.1
IEC 61131 Languages
2.3.5.2 Function blocks
2.3.5.3 Program Execution
2.3.5.4 Input / Output
2.3.5.5 Structured Text
2.3.5.6 Sequential Function Charts
2.3.5.7 Ladder Logic
2.3.5.8 Instruction Lists
2.3.5.9 Programming environment
Industrial Automation
Programmable Logic Controllers 2.3 - 10
Kinds of PLC
(1)
Compact
Monolithic construction
Monoprocessor
Fieldbus connection
Fixed casing
Fixed number of I/O (most of them binary)
No process computer capabilities (no MMC)
Typical product: Mitsubishi MELSEC F, ABB AC31, SIMATIC S7
(2)
Modular PLC
Modular construction (backplane)
One- or multiprocessor system
Fieldbus and LAN connection
3U or 6U rack, sometimes DIN-rail
Large variety of input/output boards
Connection to serial bus
Small MMC function possible
Typical products: SIMATIC S5-115, Hitachi H-Serie, ABB AC110
(3)
Soft-PLC
Windows NT or CE-based automation products
Direct use of CPU or co-processors
Remote I/O by Real-Time Ethernet
Industrial Automation
Programmable Logic Controllers 2.3 - 11
Global players
Total sales in 2004: 7’000 Mio € (Mil €)
Industrial Automation
Source: ARC Research, 2005-10
Programmable Logic Controllers 2.3 - 12
Modular PLC
• tailored to the needs of an application
development
environment
RS232
• housed in a 19" (42 cm) rack
(height 6U ( = 233 mm) or 3U (=100mm)
• high processing power (several CPU)
LAN
• large choice of I/O boards
backplane
parallel bus
• concentration of a large number of I/O
courtesy ABB
• interface boards to field busses
fieldbus
• requires marshalling of signals (visual ID)
Power Supply
• primitive or no HMI
CPU CPU
• cost effective if the rack can be filled
Analog I/O
Binary I/O
fieldbus
• supply 115-230V~ , 24V= or 48V= (redundant)
• cost ~ €10’000 for a filled crate
Industrial Automation
Programmable Logic Controllers 2.3 - 13
Small modular PLC
courtesy ABB
courtesy Backmann
mounted on DIN-rail, 24V supply
cheaper (€1000)
not water-proof,
no ventilator
extensible by a parallel bus (flat cable or rail)
Small modular PLC are also called “peripherals”
Industrial Automation
Programmable Logic Controllers 2.3 - 14
Specific controller (railways)
data bus
three PLCs networked by a data bus.
special construction: no fans, large temperature range, vibrations
Industrial Automation
Programmable Logic Controllers 2.3 - 15
Compact or modular ?
field bus
extension
€
compact PLC
(fixed number of I/Os)
modular PLC (variable number of I/Os
Limit of local I/O
…often it depends on supplier
Industrial Automation
# I/O modules
Programmable Logic Controllers 2.3 - 16
Industry- PC
courtesy INOVA
courtesy MPI
Wintel architecture
(but also: Motorola, PowerPC),
MMI offered (LCD..)
Limited modularity through mezzanine boards
(PC104, PC-Cards, IndustryPack)
Backplane-mounted versions with PCI or Compact-PCI
Industrial Automation
Competes with modular PLC
no local I/O,
fieldbus connection instead,
costs: € 2000.-
Programmable Logic Controllers 2.3 - 17
Soft-PLC (PC as PLC)
23
4
3
3
2
12
2
• PC as engineering workstation
• PC as human interface (Visual Basic, Intellution, Wonderware)
• PC as real-time processor (Soft-PLC)
• PC assisted by a Co-Processor (ISA- or PC104 board)
• PC as field bus gateway to a distributed I/O system
I/O modules
Industrial Automation
Programmable Logic Controllers 2.3 - 18
Soft-PLC (PC as PLC)
• Il SOFT-PLC è un software che virtualmente gira su qualunque piattaforma HW
- ambiente di programmazione e sviluppo
- piattaforma di emulazione del PLC per l’esecuzione dei programmi sviluppati
- esistono piattaforme per PC e sistemi embedded anche a 8 bit e senza OS
- migliora la portabilità dei programmi ma “fatica” a tenere il passo con gli OS
• Esiste un’organizzazione PLCOPEN (www.plcopen.org) per i “Soft-PLC”
basata sulla tecnologia IEC61131-3
• Le differenze con un PLC riguardano l’I/O e l’esecuzione “Real-time” delle applicazioni
- I/O remoto e distribuito mediante bus di campo o Real Time Ethernet
- sistemi operativi real-time (es. WxWorks by WindRiver) o “patch”
• Es. Codesys by AutomatawebPC (www.automataweb.com/ -> software)
- Royalties in funzione della piattaforma, supporto di Win2000/XP e di soft-motion
- limiti al porting a proposito del bus di campo e della programmazione grafica
• Es. SoftPLC Corporation (www.softplc.com buon tutorial a www.tex-el.com/splcdata.htm )
- SoftPLC è una piattaforma caricata da DOS che si sostituisce all’OS (real-time kernel)
- compatibile con PLC tradizionali Allen Bradley
Industrial Automation
Programmable Logic Controllers 2.3 - 19
Compact PLC
courtesy ABB
courtesy ABB
courtesy ABB
Monolithic (one-piece) construction
Fixed casing
Fixed number of I/O (most of them binary)
No process computer capabilities (no MMC –Multi Media Card-)
Can be extended and networked by an extension (field) bus
Sometimes LAN connection (Ethernet, Arcnet)
Monoprocessor
Typical product: Mitsubishi MELSEC F, ABB AC31, SIMATIC S7
costs: € 1000-2000
Industrial Automation
Programmable Logic Controllers 2.3 - 20
Specific Controller (example: Turbine)
tailored for a specific application, produced in large series
Programming port
Relays and fuses
Thermocouple
inputs
binary I/Os,
CAN field bus
RS232 to HMI
courtesy Turbec
cost: € 1000.-
Industrial Automation
Programmable Logic Controllers 2.3 - 21
Protection devices
substation
measurement
transformers
communication to operator
Ir
Is
It
Ur
Us
UT
Human interface
for status
and
settings
Programming
interface
trip relay
Protection devices are highly specialized PLCs that measure the current and voltages in an electrical
substation, along with other statuses (position of the switches,…) to detect situations that could
endanger the equipment (over-current, short circuit, overheat) and triggers the circuit breaker (“trip”) to
protect the substation.
In addition, it records disturbances and sends the reports to the substation’s SCADA.
Sampling: 4.8 kHz, reaction time: < 5 ms.
costs: € 5000
Industrial Automation
Programmable Logic Controllers 2.3 - 22
2.3.3 PLCs: Function and construction
2.1 Instrumentation
2.2 Control
2.3 Programmable Logic Controllers
2.3.1
PLCs: Definition and Market
2.3.2
PLCs: Kinds
2.3.3
PLCs: Functions and construction
2.3.4
Continuous and Discrete Control
2.3.5
PLC Programming Languages
2.3.5.1
IEC 61131 Languages
2.3.5.2 Function blocks
2.3.5.3 Program Execution
2.3.5.4 Input / Output
2.3.5.5 Structured Text
2.3.5.6 Sequential Function Charts
2.3.5.7 Ladder Logic
2.3.5.8 Instruction Lists
2.3.5.9 Programming environment
Industrial Automation
Programmable Logic Controllers 2.3 - 23
General PLC architecture
RS 232
CPU
Real-Time
Clock
ROM
flash
EPROM
serial port
controller
Ethernet
ethernet
controller
extension
bus
parallel bus
fieldbus
controller
buffers
analogdigital
converters
digitalanalog
converters
Digital Output
Digital
Input
signal
conditioning
power
amplifiers
relays
signal
conditioning
direct Inputs and Outputs (I/O)
field bus
Industrial Automation
external
modules*
* I/Os, functions
communications
Programmable Logic Controllers 2.3 - 24
The signal chain within a PLC
y(i)
y
time
analog
variable
(e.g. 4..20mA)
time
filtering
&
scaling
sampling
analogdigital
converter
1
binary
variable
y(i)
filtering
time
011011001111
counter
e.g. -10V..10V
transistor
or
relay
0001111
y
amplifier
analog
variable
processing
sampling
(e.g. 0..24V)
digitalanalog
converter
binary
variable
non-volatile
memory
time
Industrial Automation
Programmable Logic Controllers 2.3 - 25
Example: Signal chain in a protection device
Input
Anti aliasing Sample and hold
transformer
filter
A/D conversion
∼
∼
∼
U/I
A/D
Digital Protection Output
filter algorithm driver
∼
∼
∼
Trip
CPU
reaction < 10 ms
f = 300 -1200 Hz
f = 200 kHz
f = 100 kHz
f = 1 MHz
Industrial Automation
Programmable Logic Controllers 2.3 - 26
2.3.4 Continuous and discrete control
2.1 Instrumentation
2.2 Control
2.3 Programmable Logic Controllers
2.3.1
PLCs: Definition and Market
2.3.2
PLCs: Kinds
2.3.3
PLCs: Functions and construction
2.3.4
Continuous and Discrete Control
2.3.5
PLC Programming Languages
2.3.5.1
IEC 61131 Languages
2.3.5.2 Function blocks
2.3.5.3 Program Execution
2.3.5.4 Input / Output
2.3.5.5 Structured Text
2.3.5.6 Sequential Function Charts
2.3.5.7 Ladder Logic
2.3.5.8 Instruction Lists
2.3.5.9 Programming environment
Industrial Automation
Programmable Logic Controllers 2.3 - 27
Matching the analog and binary world
discrete control
Industrial Automation
analog regulation
Programmable Logic Controllers 2.3 - 28
PLC evolution
Binary World
relay controls,
Relay control
pneumatic sequencer
Analog World
Pneumatic and electromechanical
controllers
I1
A
B
C
P1
P2
combinatorial
sequential
discrete processes
Regulation, controllers
continuous processes
Programmable Logic Controllers
(Speicherprogrammierbare Steuerungen, Automates Programmables)
Industrial Automation
Programmable Logic Controllers 2.3 - 29
Continuous Plant (reminder)
Example: traction motors, ovens, pressure vessel,...
The state of continuous plants is described by continuous (analog) state
variables like temperature, voltage, speed, etc.
There exist a fixed relationship between input and output, described by a continuous model
in form of a transfer function F.
This transfer function can be expressed by a set of differential equations.
If equations are linear, the transfer function may expressed as Laplace or Z-transform.
y
x
F(s) =
(1+Ts)
y
time
(1+T1s + T2 s2)
Continuous plants are normally reversible and monotone.
This is the condition to allow their regulation.
The time constant of the control system must be at least one order of
magnitude smaller than the smallest time constant of the plant.
the principal task of the control system for a continuous plant is its regulation.
Industrial Automation
Programmable Logic Controllers 2.3 - 30
Discrete Plant (reminder)
b
init
Examples: Elevators,
traffic signaling,
warehouses, etc.
a
2
c+d
3
4
e
c + ¬d
e
1
7
6
5
The plant is described by variables which take well-defined, non-overlapping values.
The transition from one state to another is abrupt, it is caused by an external event.
Discrete plants are normally reversible, but not monotone, i.e. negating the
event which caused a transition will not revert the plant to the previous state.
Example: an elevator doesn't return to the previous floor when the button is released.
Discrete plants are described e.g. by finite state machines or Petri nets.
the main task of a control system with discrete plants is its sequential control.
Industrial Automation
Programmable Logic Controllers 2.3 - 31
Continuous and Discrete Control (comparison)
"sequential"
"combinatorial"1)
e.g. ladder logic, CMOS logic
A
e.g. GRAFCET, Petri Nets
B
Out = A · B
A
NOT C
ladder
logic
B
Out = (A + B) · C
I1
analog
building
blocs
P1
P2
1) not really combinatorial: blocks may have memory
Industrial Automation
Programmable Logic Controllers 2.3 - 32
2.3.5 Programming languages
2.1 Instrumentation
2.2 Control
2.3 Programmable Logic Controllers
2.3.1
PLCs: Definition and Market
2.3.2
PLCs: Kinds
2.3.3
PLCs: Functions and construction
2.3.4
Continuous and Discrete Control
2.3.5
Programming languages
2.3.5.1
IEC 61131 Languages
2.3.5.2 Function blocks
2.3.5.3 Program Execution
2.3.5.4 Input / Output
2.3.5.5 Structured Text
2.3.5.6 Sequential Function Charts
2.3.5.7 Ladder Logic
2.3.5.8 Instruction Lists
2.3.5.9 Programming environment
Industrial Automation
Programmable Logic Controllers 2.3 - 33
"Real-Time" languages
languages developed for cyclic
execution and real-time
("application-oriented languages")
Extend procedural languages to
express time
(“introduce programming constructs to
influence scheduling and control flow”)
• ADA
•
ladder logic
• Real-Time Java
•
function block language
• MARS (TU Wien)
•
instruction lists
• Forth
•
GRAFCET
• “C” with real-time features
•
SDL
• etc…
could not impose themselves
Industrial Automation
etc...
wide-spread in the control industry.
Now standardized as IEC 61131
Programmable Logic Controllers 2.3 - 34
The long march to IEC 61131
NEMA Programmable Controllers Committee formed (USA)
GRAFCET (France)
DIN 40719, Function Charts (Germany)
NEMA ICS-3-304, Programmable Controllers (USA)
IEC SC65A/WG6 formed
DIN 19 239, Programmable Controller (Germany)
IEC 65A(Sec)38, Programmable Controllers
MIL-STD-1815 Ada (USA)
IEC SC65A(Sec)49, PC Languages
IEC SC65A(Sec)67
IEC 848, Function Charts
IEC 64A(Sec)90
IEC 1131-3
Type 3 report
recommendation
IEC 61131-3
name change
70
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
Source: Dr. J. Christensen
it took 20 years to make that standard…
Industrial Automation
Programmable Logic Controllers 2.3 - 35
The five IEC 61131-3 Programming languages
graphical languages
Function Block Diagram (FBD)
AUTO
CALC1
DI
CALC
PUMP
>=1
IN1 OUT
V
DO
Sequential Flow Chart (SFC)
START STEP
T1
V
MAN_ON
STEP A
IN2
ACT
http://www.isagraf.com
N
ACTION D1
D1_READY
D
ACTION D2
D2_READY
N
ACTION D3
D3_READY
D
ACTION D4
D4_READY
T2
STEP B
Ladder Diagram (LD)
T3
CALC1
AUTO
CALC
IN1
PUMP
OUT
ACT
IN2
MAN_ON
Instruction List (IL)
A: LD
%IX1 (* PUSH BUTTON *)
ANDN %MX5 (* NOT INHIBITED *)
ST
%QX2 (* FAN ON *)
Industrial Automation
textual languages
Structured Text (ST)
VAR CONSTANT X : REAL := 53.8 ;
Z : REAL; END_VAR
VAR aFB, bFB : FB_type; END_VAR
bFB(A:=1, B:=‘OK’);
Z := X - INT_TO_REAL (bFB.OUT1);
IF Z>57.0 THEN aFB(A:=0, B:=“ERR”);
ELSE aFB(A:=1, B:=“Z is OK”);
END_IF
Programmable Logic Controllers 2.3 - 36
Importance of IEC 61131 (not only IEC61131-3)
IEC 61131-3 is the most important automation language in industry.
80% of all PLCs support it, all new developments base on it.
Depending on the country, some languages are more popular.
Configuration
Resource
Task
Resource
Task
Task
Task
FB
Function
Block
Program
Program
FB
Program
FB
Program
FB
FB
Execution
control path
Access path
Industrial Automation
Programmable Logic Controllers 2.3 - 37
Importance of IEC 61131
Configuration. A configuration is specific to a particular type of control system, including the
arrangement of the hardware, i.c. processing resources, memory addresses for I/O channels and
system capabilities.
Within a configuration one can define one or more Resources. One can look at a resource as a
processing facility that is able to execute IEC programs.
Within a resource, one or more Tasks can be defined. Tasks control the execution of a set of
programs and/or function blocks. These can either be executed periodically or upon the occurrence
of a specified trigger, such as the change of a variable.
Programs are built from a number of different software elements written in any of the IEC defined
languages. Typically, a program consists of a network of Functions and Function Blocks, which are
able to exchange data. Function and Function Blocks are the basic building blocks, containing a data
structure (FB) and an algorithm.
Let’s compare this to a conventional PLC: this contains one resource, running one task, controlling
one program, running in a closed loop.
IEC 61131-3 adds much to this, making it open to the future. A future that includes multi-processing
and event driven programs. And this future is not so far: just look at distributed systems or real-time
control systems.
IEC 61131-3 is suitable for a broad range of applications, without having to learn additional
programming languages.
http://www.plcopen.org/pages/pc2_training/downloads/index.htm
Industrial Automation
Programmable Logic Controllers 2.3 - 38