12.01.2014 Views

Struktury automatizace průmyslového podniku

Struktury automatizace průmyslového podniku

Struktury automatizace průmyslového podniku

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

30.9.2013<br />

Průmyslová informatika a<br />

internet (A0M35PII)<br />

Přednáška 1.10.2013<br />

Přednáška používá některé materiály od:<br />

Prof. Dr. H. Kirrmann: Automation Industrielle,<br />

EPFL / ABB Research Center, Baden, Switzerland 2010<br />

Richard Šusta<br />

PLC coby zdroj dat<br />

Logické adresy<br />

pevné tabulky<br />

modulově orientované tabulky<br />

Systémy používající Tag<br />

1


30.9.2013<br />

PLC - programovatelné logické automaty<br />

Opakování z konce minulé přednášky<br />

Dohlížecí<br />

úroveň<br />

PLC1,…<br />

Automaty<br />

Logické řízení<br />

Výkonné spínače<br />

Ovládací<br />

panely<br />

Snímače<br />

Regulace<br />

pohonů<br />

Pohony<br />

Snímače<br />

Stroje, výrobky<br />

Technologický<br />

objekt<br />

3<br />

Opakování z konce minulé přednášky<br />

• skutečnost<br />

PLC jako zahloubený systém<br />

• schéma<br />

Motory<br />

Inputs<br />

Stroje<br />

Okolní prostředí<br />

PLC<br />

P r o g r a m<br />

Outputs<br />

Čidla<br />

Silový rozvadeč<br />

PLC<br />

Transformátor<br />

Stykače<br />

Jističe<br />

Elektrické silové přívody<br />

4<br />

2


30.9.2013<br />

Klasické PLC<br />

Vzorkování<br />

Vstupy<br />

PLC<br />

Program<br />

Výpočet<br />

nového stavu<br />

Výstupy<br />

Vnitřní<br />

paměť<br />

Paměť stavu<br />

Input scan<br />

Output Scan<br />

PLC scan<br />

while(1) {<br />

Cti_vstupy();<br />

PLC program();<br />

Zapis_výstupy();<br />

}<br />

Pozn. ControlLogix nemá synchronizovaný I/O scan s programem 5<br />

Přesněji PLC Program Scan<br />

Housekeeping<br />

Housekeeping tasks are<br />

special tasks a PLC may<br />

have to perform to get ready<br />

for the next scan of the<br />

program<br />

Output Scan<br />

START<br />

Input Scan<br />

Program Scan<br />

6<br />

3


509 -BOD<br />

24vdc<br />

30.9.2013<br />

Čas PLC scanu<br />

src x 1 x 1<br />

src x 2 x 2<br />

t in<br />

src x m<br />

x m<br />

Program<br />

t prog<br />

t plcscan<br />

dst y 1 y 1<br />

dst y 2 y 2<br />

t out<br />

dst y n<br />

y n<br />

7<br />

Example: Rockwell (Allen-Bradley) NetLinx<br />

Programmabl<br />

e Device<br />

Support PC<br />

Desktop<br />

PC<br />

with excel<br />

EtherNet / IP<br />

Controller and Bridge<br />

Servo<br />

ControlNet<br />

HMI<br />

Linking Device<br />

Drive<br />

Bridge or Linking Device<br />

DeviceNet<br />

HM<br />

I<br />

Modular<br />

I/O<br />

Micro<br />

PLC<br />

Sensor<br />

Block I/O<br />

4


30.9.2013<br />

Lokální / Distribuované moduly<br />

Ale počet I/O bodů zůstává,<br />

energie se dodává mnoha malým zařízením<br />

10<br />

DeviceNet Network Example<br />

Prox switch<br />

and cable<br />

KwikLink cable<br />

Stack light<br />

Cable to open-style<br />

connector on<br />

network PLC scanner<br />

Power<br />

supply<br />

Termination<br />

resistor<br />

RightSight<br />

photo sensor<br />

Insulation<br />

displacement<br />

connector<br />

CompactBlock<br />

I/O module<br />

ArmorBlock<br />

maximum<br />

4 I/O points<br />

Termination<br />

resistor<br />

Open-style connection<br />

for power supply<br />

5


30.9.2013<br />

Sample of Some DeviceNet Media<br />

Components<br />

Thick round<br />

drop line cable<br />

Device port<br />

KwikLink drop<br />

line cable<br />

KwikLink flat trunk<br />

line cable insulation<br />

displacement connector<br />

T-port<br />

KwikLink flat trunk<br />

line cable<br />

DeviceLink<br />

Trunk Line Calculation One<br />

Node number<br />

6


30.9.2013<br />

ControlNet: Key Terms<br />

Local: Component in same chassis as controller.<br />

Remote: Component in different chassis from controller:<br />

ControlLogix Controller with<br />

Configuration Information<br />

Remote 1756-I/O<br />

Local 1756-I/O<br />

14<br />

Scanner - adapter<br />

FlexLogix I/O placed on DIN rail:<br />

• Supports one or two banks<br />

– (up to 8 local I/O modules and 8 extended local I/O modules)<br />

Local I/O Modules<br />

Bank 1<br />

Extended Local I/O Modules<br />

Bank 2<br />

15<br />

7


Ř í z e n á t e c h n o l o g i e<br />

30.9.2013<br />

Příklad interní struktury PLC<br />

Externí I/O moduly<br />

Systémová<br />

kom. linka<br />

Programovací prostředí,<br />

panely operátorů,<br />

vizualizace procesu<br />

Interní I/O<br />

moduly<br />

IO komunikace<br />

(remote IO)<br />

Systémová<br />

komunikace<br />

modul<br />

"Watch dog" časovač<br />

Přerušení<br />

Proces<br />

I/O scanu<br />

Interní operační<br />

systém PLC<br />

Stop / Run<br />

Zápis, edice a monitorování<br />

dat a programu<br />

Systémové<br />

informace<br />

Obraz<br />

vstupů a<br />

výstupů<br />

Proměnné,<br />

konstanty<br />

Program<br />

Proces<br />

provádějící<br />

scan programu<br />

Zálohované<br />

napájení paměti<br />

Paměť - typicky od 8 kB do 256 kB<br />

P L C<br />

16<br />

Adresy dat PLC<br />

• Logické<br />

pevné I/O tabulky, do kterých se mapují<br />

vstupy a výstupy<br />

proměnlivé logické tabulky, podle vstupů a<br />

výstupů<br />

• Systémy používající Tagy<br />

17<br />

8


30.9.2013<br />

Logické I/O adresy<br />

Allen-Bradley – PLC5, SLC500<br />

18<br />

Pevné vstupní a výstupní tabulky<br />

Image courtesy of Allen-Bradley, a Rockwell Automation business 19<br />

9


30.9.2013<br />

Data v pevných tabulkách<br />

20<br />

Single-slot Addressing<br />

Logical Rack 0 Logical Rack 1<br />

000 001 002 003 004 005 006 007 010 011 012 013 014 015 016 017<br />

21<br />

10


30.9.2013<br />

Two-slot Addressing<br />

Logical Rack 0<br />

000 000 001 001 002 002 003 003 004 004 005 005 006 006 007 007<br />

22<br />

Half-slot Addressing<br />

Logical Rack 0 Logical Rack 1 Logical Rack 2 Logical Rack 3<br />

000<br />

001<br />

002<br />

003<br />

004<br />

005<br />

006<br />

007<br />

010<br />

011<br />

012<br />

013<br />

014<br />

015<br />

016<br />

017<br />

020<br />

021<br />

022<br />

023<br />

024<br />

025<br />

026<br />

027<br />

030<br />

031<br />

032<br />

033<br />

034<br />

035<br />

036<br />

037<br />

23<br />

11


30.9.2013<br />

Addressing and Remote I/O<br />

P<br />

r<br />

o<br />

c<br />

e<br />

s<br />

s<br />

o<br />

r<br />

Logical Rack 0 Logical Rack 1<br />

000 001 002 003 004 005 006 007 010 011 012 013<br />

P<br />

o<br />

w<br />

e<br />

r<br />

S<br />

u<br />

p<br />

p<br />

l<br />

y<br />

Rack 2<br />

1336<br />

Plus II<br />

VFD<br />

Remote I/O<br />

24<br />

Modulární PLC SLC 500<br />

Image courtesy of Allen-Bradley, a Rockwell Automation business 25<br />

12


30.9.2013<br />

Tabulka vytvářena modulem<br />

26<br />

Modularní PLC a I/O tabulky<br />

27<br />

13


30.9.2013<br />

Přenosy dat – scanované a nescanované<br />

vstupy<br />

I/O modul<br />

Scanované<br />

vstupní<br />

hodnoty<br />

Scan vstupů<br />

Okamžitý scan<br />

Vstupní force<br />

Obraz vstupů<br />

- | 0 | 1<br />

Vstupní<br />

hodnoty<br />

čtené<br />

povelem<br />

Výstupní<br />

hodnoty<br />

zapisované<br />

povelem<br />

Čtení bloku dat<br />

synchr./asynchr.<br />

Zápis bloku dat<br />

Tabulka proměnných<br />

programu<br />

Force aktivní?<br />

Ano / Ne<br />

Scanované<br />

výstupní<br />

hodnoty<br />

Okamžitý scan<br />

0 | 1<br />

Obraz výstupů<br />

Scan výstupů<br />

- | 0 | 1<br />

Výstupní force<br />

28<br />

Tagově orientovaná PLC<br />

Program<br />

Tagy<br />

vstupních<br />

modulů<br />

Private<br />

Shared Data<br />

Tagy<br />

výstupních<br />

modulů<br />

Tagy<br />

Vstupy<br />

Local bus<br />

I/O moduly<br />

Consumed<br />

tagy<br />

Produced<br />

I/O Update Manager<br />

Remote I/O<br />

moduly<br />

Výstupy<br />

Remote<br />

tagy<br />

T e c h n o l o g i c k ý p r o c e s<br />

29<br />

14


30.9.2013<br />

Klasické PLC / ControlLogix<br />

src x 1 x 1<br />

src x 2 x 2<br />

src x m<br />

x m<br />

dst y 1 y 1<br />

dst y 2 y 2<br />

dst y n<br />

Program<br />

y n<br />

t in<br />

t prog<br />

t out<br />

t plcscan<br />

tx<br />

1<br />

src x 1 x 1<br />

tx<br />

2<br />

src x 2 x 2<br />

src x m<br />

tx<br />

m<br />

P<br />

x m r<br />

o<br />

ty<br />

1<br />

g<br />

dst y 1 y 1 r<br />

ty<br />

2<br />

a<br />

dst y 2 y 2 m<br />

ty<br />

n<br />

dst y n y n<br />

t prog<br />

30<br />

Data Types<br />

Using these definitions . . .<br />

Controller Memory<br />

“Drive_Speed” Data<br />

DINT, or 32 Bits<br />

“Start” Data<br />

BOOL, or 1 Bit<br />

“Sensor”<br />

Data<br />

BOOL or<br />

1 Bit<br />

31<br />

15


30.9.2013<br />

Identifying a Module Type<br />

Several characteristics:<br />

RSLogix 5000<br />

Software I/O<br />

Configuration<br />

Module Slot Number<br />

I or O for Input or Output<br />

A for AC, B for DC, F for Fast Response Analog<br />

1756 - O B 16 D<br />

Number of Points or Channels<br />

Suffix – (Diagnostic, Electronic<br />

Fusing, Individually Isolated,<br />

Voltage Only, Current Only, etc.)<br />

32<br />

Identifying an I/O Module Tag<br />

I/O format:<br />

Location:Slot:Type.Member.Bit<br />

“Local” or Module Name for Remote<br />

I/O Point (Optional)<br />

“Data” (I/O values), “Fault,” etc.<br />

“I” for Input, “O” for Output,<br />

“C” for Configuration<br />

Module Slot Number<br />

33<br />

16


30.9.2013<br />

Example: Digital I/O Tags<br />

Digital output module in slot 0 of local chassis:<br />

1756-OB16D Module – Slot 0<br />

Diagnostic<br />

Data<br />

Data Per Point<br />

34<br />

Types of Scans<br />

• Continues task (spojitá úloha)<br />

PLC scans the program code from top to bottom. When it<br />

completes, it goes back to the top and restarts the process.<br />

I/O scans<br />

program scans<br />

1. A continuous task is how PLC traditionally operates.<br />

2. Continues tasks are performed at irregular intervals.<br />

3. A watchdog monitors the scan time. If it exceeds predefined value, an<br />

execution fault is displayed because PLC could accidentally lose an<br />

input signal.<br />

4. First scan (or first pass) – when the PLC is first powered ON or<br />

whenever the PLC program is started – used for initializations<br />

35<br />

17


30.9.2013<br />

Types of Scans<br />

• Periodic task (periodická úloha)<br />

Like the continuous task, a periodic task executes all of its<br />

code from top to bottom. However, when a periodic task<br />

completes its scan, it waits a preconfigured time interval<br />

before restarting.<br />

program scans<br />

1. A periodic task is always required for all numeric control<br />

algorithms, e.g. PID controller.<br />

2. The periodic task lets you control a process that might occur<br />

at a significantly faster rate than the normal scan of the<br />

continuous task can attain.<br />

3. In a periodic task, we must insert I/O instructions if we need<br />

actual data, otherwise it uses I/O data of the continues task.<br />

36<br />

Types of Scans<br />

• Event task (úloha řízená událostí, přerušeni)<br />

Lets you execute a piece of code based on the detection of<br />

some incident that occurs in the control system.<br />

Events<br />

Program scans<br />

1. The event task either immediately take control at a high priority<br />

2. But interrupts are potentially dangerous sources of errors<br />

37<br />

18


30.9.2013<br />

Continues, Periodic, and Even Tasks<br />

• Picture taken from Rockwell Automation: Using Event Tasks with Logix5000 Controllers,<br />

Publication LOGIX-WP003A-EN-P June, 2003, page 15<br />

38<br />

Přehledné programovací jazyky<br />

Function Block Diagram (FBD)<br />

graphical languages<br />

Sequential Flow Chart (SFC)<br />

AUTO<br />

DI<br />

CALC1<br />

CALC<br />

PUMP<br />

START STEP<br />

V<br />

ACT<br />

IN1 OUT >=1<br />

MAN_ON<br />

IN2<br />

DO<br />

V<br />

T1<br />

STEP A<br />

T2<br />

N<br />

D<br />

ACTION D1 D1_READY<br />

ACTION D2 D2_READY<br />

Ladder Diagram (LD)<br />

CALC1<br />

STEP B<br />

T3<br />

N<br />

D<br />

ACTION D3 D3_READY<br />

ACTION D4 D4_READY<br />

AUTO<br />

CALC<br />

PUMP<br />

ACT<br />

MAN_ON<br />

IN1<br />

IN2<br />

OUT<br />

textual languages<br />

Structured Text (ST)<br />

VAR CONSTANT X : REAL := 53.8 ;<br />

Z : REAL; END_VAR<br />

VAR aFB, bFB : FB_type; END_VAR<br />

Instruction List (IL)<br />

A: LD %IX1 (* PUSH BUTTON *)<br />

ANDN %MX5 (* NOT INHIBITED *)<br />

ST %QX2 (* FAN ON *)<br />

bFB(A:=1, B:=‘OK’);<br />

Z := X - INT_TO_REAL (bFB.OUT1);<br />

IF Z>57.0 THEN aFB(A:=0, B:=“ERR”);<br />

ELSE aFB(A:=1, B:=“Z is OK”);<br />

END_IF<br />

http://www.isagraf.com 39<br />

19


30.9.2013<br />

Průmysl potřebuje informace...<br />

1. spolehlivé přenést<br />

2. spolehlivé zpracovat<br />

3. spolehlivě testovat možné chyby<br />

40<br />

The Millennium Bridge London<br />

Slavnostně<br />

otevřen<br />

v sobotu<br />

10.6.2001<br />

Rychle<br />

zavřený<br />

v pondělí<br />

12.6.2001<br />

Přímo učebnicový příklad špatné informace<br />

41<br />

20


30.9.2013<br />

Therac 25 – těžká chyba v IS<br />

42<br />

Mask of Therac 25<br />

2 deadly errors escaped detection<br />

• during 2 years testing by the manufacture<br />

• during 2 deep inspections<br />

•during deep inspection perform by US government<br />

even if all knew what they should look for<br />

43<br />

21


30.9.2013<br />

Operator sidebar<br />

44<br />

Structure of code<br />

[source: Nancy G. Leveson, Clark S. Turner, An Investigation of the Therac-25 Accidents]<br />

45<br />

22


30.9.2013<br />

1 of 2 errors<br />

Error is clear only if you know its exact location<br />

Magnet:<br />

Set bending magnet flag // ..but the flag is reset after 1st call of Ptime<br />

repeat Set next magnet<br />

Call Ptime<br />

if mode/energy has changed, then exit<br />

until all magnets are set // it takes 8 s to adjust magnets!!!<br />

return<br />

Ptime:<br />

repeat<br />

if bending magnet flag is set then<br />

if editing taking place then // it is tested only if bending magnet flag is set<br />

if mode/energy has changed then exit<br />

until hysteresis delay has expired<br />

Clear bending magnet flag return<br />

2nd more complex error appeared when an operator pressed key in the<br />

46<br />

same moment when a byte circular counter overflowed<br />

Centralizované řízení<br />

Výhody<br />

Všechny programy na jednom místě<br />

Lépe se řeší systémové problémy<br />

Rychlý přístup na I/O<br />

Nevýhody<br />

Velké programy<br />

Výkon závisí na počtu I/O<br />

Závada jednoho PLC znamená zastavení<br />

celého programu<br />

47<br />

23


30.9.2013<br />

Hierarchie jsou jednoduché, tradiční<br />

Centralized (Hierarchical) Control Architecture<br />

Central Computer<br />

(Mainframe)<br />

Group<br />

Control<br />

Group<br />

Control<br />

Group<br />

Control<br />

PLCs<br />

Sensors, Actors<br />

plant<br />

Classical, hierarchical, centralized architecture.<br />

The central computer only monitors and forwards commands to the PLCs<br />

24


30.9.2013<br />

P2P komunikace<br />

communication in a control system is evolving from hierarchical to distributed<br />

central master / slave: hierarchical<br />

“master”<br />

PLC<br />

AP<br />

alternate<br />

master<br />

PLC<br />

AP<br />

peer-to-peer: distributed<br />

input<br />

“slaves”<br />

output<br />

PLC PLC PLC<br />

“masters”<br />

AP<br />

AP<br />

AP<br />

separate bus master from<br />

application master !<br />

input<br />

“slaves”<br />

output<br />

50<br />

Distribuované řízení<br />

ALLEN-BRADLEY ALLEN-BRADLEY ALLEN-BRADLEY<br />

Výhody<br />

Rozdělení programu podle úloh<br />

Snáze se hledají lokální problémy<br />

Zvýšení výkonu na lokální síti<br />

Nevýhody<br />

Dostup na některá I/O přes další PLC<br />

Systémové problémy se hůře hledají<br />

Vyšší cena<br />

Udržujeme několik programů<br />

51<br />

25


30.9.2013<br />

složitější distribuované systémy<br />

vyjadřují složitější svět<br />

Decentralized Control System (DCS)<br />

ALLEN-BRADLEY ALLEN-BRADLEY ALLEN-BRADLEY<br />

hierarchical<br />

(vertical communication)<br />

engineering<br />

workstation<br />

operator<br />

workstation<br />

data logger<br />

plant bus<br />

peer-to-peer (horizontal communication)<br />

field bus<br />

controlle<br />

r<br />

controlle<br />

r<br />

controlle<br />

r<br />

controlle<br />

r<br />

plant<br />

all controllers can communicate as peers (without going through a central<br />

master), restricted only by throughput and modularity considerations.<br />

Note: Honeywell's "DCS" stands for "Distributed Control System", it is not a decentralized control<br />

system, but a control system for the process industry.<br />

26


30.9.2013<br />

Busses and processors in industrial plants<br />

Process pictures<br />

disk<br />

instrument bus<br />

(mimic board)<br />

Operator panel<br />

Mimic board<br />

open network, WAN<br />

Process Data Base<br />

workstation bus<br />

Logging<br />

station<br />

station<br />

plant network (500m .. 3 km) – includes control network<br />

processor pool<br />

P<br />

P P C<br />

I/O MEM I/O<br />

PLC nodes<br />

(multi-processors)<br />

P P C P<br />

MEM BC<br />

node bus<br />

fieldbus (30m..2 km)<br />

directly coupled<br />

input/<br />

output<br />

control<br />

stations<br />

sensor bus<br />

backplane bus<br />

sensor bus (0,5.. 30 m)<br />

transducers<br />

valve thermo-couple<br />

position<br />

M<br />

motor<br />

plant (Werk, usine)<br />

Sítě – to je směs protokolů<br />

control<br />

center<br />

IEC 870-6<br />

SCADA<br />

control<br />

center<br />

Inter-Control Center Protocol<br />

ICCP<br />

control<br />

center<br />

HV<br />

High<br />

Voltage<br />

Modicom<br />

IEC 870-5 DNP 3.0 Conitel RP 570<br />

serial links (telephone)<br />

RTU RTU RTU RTU Remote Terminal Units<br />

Příklad:<br />

Elektrárna<br />

COM<br />

RTU<br />

substation<br />

substation<br />

MV<br />

Medium<br />

Voltage<br />

FSK, radio, DLC, cable, fiber,...<br />

RTU<br />

RTU<br />

houses<br />

RTU<br />

RTU<br />

LV<br />

Low<br />

Voltage<br />

Pro pomalé rychlosti a velké vzdálenosti lze použít silové rozvody nebo telefonní linky<br />

Problem: rozmanitost protokolů, dotových formátů, semantik..<br />

55<br />

27

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!