29
12 th Lecture Design of Distributed Controllers Automation Systems Discrete Event Control Systems and Networked Automation Systems

Networked Automation Systems (NAS) (Bussysteme in der ... · Distributed Application and System Model Event flow Data flow Communication network Device 1 Device 2 Device 3 Device

  • Upload
    lengoc

  • View
    216

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Networked Automation Systems (NAS) (Bussysteme in der ... · Distributed Application and System Model Event flow Data flow Communication network Device 1 Device 2 Device 3 Device

Automation Systems

12th Lecture

Design of Distributed

Controllers

Automation Systems

Discrete Event Control Systems and

Networked Automation Systems

Page 2: Networked Automation Systems (NAS) (Bussysteme in der ... · Distributed Application and System Model Event flow Data flow Communication network Device 1 Device 2 Device 3 Device

AS

430SoSe 19 Georg Frey

What's the Problem with Distributed Control anyway?

Centralized control means scan-based execution

• All input data is scanned at the same time

• All algorithms are executed in a sequence

• All output data is written at the same time

• Main Features:

1. The scan-cycle assures that all the algorithms work on the same process data

2. The sequential execution is used to assure that algorithms work on current data

In a distributed system (networked intelligent devices) there are several

asynchronous scan-cycles

• Input data may be read at different instants in time

• Algorithms may be executed concurrently

• Output data may be written at different instants in time

• Resulting Problems

1. Several algorithms may work on different samples of the process data

2. The execution order of algorithms is no longer clear. Algorithms may work on old

results of other algorithms.

Page 3: Networked Automation Systems (NAS) (Bussysteme in der ... · Distributed Application and System Model Event flow Data flow Communication network Device 1 Device 2 Device 3 Device

AS

431SoSe 19 Georg Frey

Why not use the known Approaches to do it?

Problems can be fixed by message exchange between algorithms

• Algorithm A informs Algorithm B that he has now finished calculating

the data B needs

• Now the execution order is no longer relevant for the result of the

calculation (but still for efficiency)

Problems with inconsistent I/O is fixed by an additional I/O-image

• Input reading and output writing is modeled as an algorithm (additional

internal I/O image)

• Based on message exchange (as above) validity is assured

Why not implement this in IEC 61131

• Large overhead because it is not a feature of the standard

• Error-prone if built manually

IEC 61499

Page 4: Networked Automation Systems (NAS) (Bussysteme in der ... · Distributed Application and System Model Event flow Data flow Communication network Device 1 Device 2 Device 3 Device

AS

432SoSe 19 Georg Frey

IEC 61499

Network of Function Blocks

• Two ways of information flow

• Data flow for user/process data

• Control flow controlling the validity of the user data by events

Model with several hierarchical layers

• System

• Device

• Resource (extension to IEC61131)

• Application (distributed over several resources)

• Function Blocks (extension to IEC61131)

Page 5: Networked Automation Systems (NAS) (Bussysteme in der ... · Distributed Application and System Model Event flow Data flow Communication network Device 1 Device 2 Device 3 Device

AS

433SoSe 19 Georg Frey

Expected advantages from Application of IEC 61499

• Abstraction from

Controller hardware

Automation infrastructure

Communication

Process interfacing

• Goal

Less effort for implementation (increased usability)

• Possible Realization

Implementation of IEC 61499 runtime as middleware

Page 6: Networked Automation Systems (NAS) (Bussysteme in der ... · Distributed Application and System Model Event flow Data flow Communication network Device 1 Device 2 Device 3 Device

AS

434SoSe 19 Georg Frey

IEC 61499 Funktion Block Model

• Funktions Blocks are the smallest funvctional units of an application

(like POUs in 61131)

• Execution Control: Generation and Processing of Events at Event

Inputs and Event Outputs (Control Flow)

• Algorithms with Data Inputs and Data Outputs as wall as internal Data

(Data Flow)

• Programming of the Algorithms like the POE body in IEC 61131-3

(using the same languages)

• Programming of the Execution Control using a state diagram (ECC

execution control chart)

Page 7: Networked Automation Systems (NAS) (Bussysteme in der ... · Distributed Application and System Model Event flow Data flow Communication network Device 1 Device 2 Device 3 Device

AS

435SoSe 19 Georg Frey

Basic Function Block

Page 8: Networked Automation Systems (NAS) (Bussysteme in der ... · Distributed Application and System Model Event flow Data flow Communication network Device 1 Device 2 Device 3 Device

AS

436SoSe 19 Georg Frey

Event/Data Associations

• Events may be associated with data

• Data is read by the block when the associated event occors

Data outputsData inputs

Event outputsEvent inputs

Data flow

Event flow

Event/DataAssociations

Event flow

Data flow

Page 9: Networked Automation Systems (NAS) (Bussysteme in der ... · Distributed Application and System Model Event flow Data flow Communication network Device 1 Device 2 Device 3 Device

AS

437SoSe 19 Georg Frey

Execution Control Chart (ECC)

START

EX 1

EXOINIT

INIT

1

INIT MAININITO MAIN

EC Initial State

EC Transition

EC State Algorithm

Output

Event

EC Action

Input

Event

• Separation of Control Flow (Events) and Data Flow

• Local Execution Control in each FB

• Algorithms are implemented using IEC 61131-3 languages or others

like C or JAVA

Page 10: Networked Automation Systems (NAS) (Bussysteme in der ... · Distributed Application and System Model Event flow Data flow Communication network Device 1 Device 2 Device 3 Device

AS

438SoSe 19 Georg Frey

Algorithms

Type identifier

(IEC 61131-3) and/or JAVA

Internalvariables

ExecutionControlChart

Execution of an IEC 61499 FB

Output variablesInput variables

Event inputs Event outputs

Scheduling-Function (OS)

START

EX&IN_1 1

EXOINIT

INIT

1

INIT MAININITO MAIN

EC initial state

EC transition

EC state algorithm

event

EC action

EX EXO

IN_1 OUT_1

Page 11: Networked Automation Systems (NAS) (Bussysteme in der ... · Distributed Application and System Model Event flow Data flow Communication network Device 1 Device 2 Device 3 Device

AS

440SoSe 19 Georg Frey

Scan-based (time-triggered, cyclic) Execution in IEC 61499

• Scan-based execution is a special case of event-based execution

Page 12: Networked Automation Systems (NAS) (Bussysteme in der ... · Distributed Application and System Model Event flow Data flow Communication network Device 1 Device 2 Device 3 Device

AS

441SoSe 19 Georg Frey

Distributed Application and System Model

Event flow

Data flow

Communication network

Device 2 Device 3 Device 4Device 1

Application A

App. C Application B

Controlled Process

Application=

Function Block Network

System=

Communication Networkk+

Devices+

Process / Machines

Page 13: Networked Automation Systems (NAS) (Bussysteme in der ... · Distributed Application and System Model Event flow Data flow Communication network Device 1 Device 2 Device 3 Device

AS

442SoSe 19 Georg Frey

IEC 61499 Device-Modell

Device contains

• Application program

• A interface connected to communication network

• A interface connected to process

• the device hardware, on which the resources run

Communication link(s)

Resource x

Controlled process

Resource zResource y

Application BApplication C

Application A

Device boundary

Communication interface(s)

Process interface(s)

Page 14: Networked Automation Systems (NAS) (Bussysteme in der ... · Distributed Application and System Model Event flow Data flow Communication network Device 1 Device 2 Device 3 Device

AS

443SoSe 19 Georg Frey

IEC 61499 Resource Model

• A resource represents an independent executable and parameterizable

unit (Task in general sense). There may be several resources run on one

device, which realize the same or different applications.

• Resource is in charge of scheduling and execution of FB-Algorithms

• Resource represent the communication- and I/O-function on the service-

interface-function block.

FunctionBlock

Local application

(or local part of distributed application)Communication mapping

Communication functions

Process I/O functions

Process mapping

Data

Events

Service

Scheduling Function

InterfaceFunction

Block

ServiceInterface

Algorithms

Page 15: Networked Automation Systems (NAS) (Bussysteme in der ... · Distributed Application and System Model Event flow Data flow Communication network Device 1 Device 2 Device 3 Device

AS

444SoSe 19 Georg Frey

Application design is independent of the actual

implementation!

Development Process covered by IEC 61499

specification

non-distributed design

non-distributed

application

deployment

distributed

application

Not covered by IEC 61499 at all

design time aspects

of IEC 61499

runtime aspects

of IEC 61499

design

Page 16: Networked Automation Systems (NAS) (Bussysteme in der ... · Distributed Application and System Model Event flow Data flow Communication network Device 1 Device 2 Device 3 Device

AS

445SoSe 19 Georg Frey

Informational View of an Automation Device

OS

Hardware

Middleware

Application

Automation Device: Controller, Sensor, Actuator

Communication

Interface

Process

Interface

Page 17: Networked Automation Systems (NAS) (Bussysteme in der ... · Distributed Application and System Model Event flow Data flow Communication network Device 1 Device 2 Device 3 Device

AS

446SoSe 19 Georg Frey

Informationstechnisches Modell eines verteilten AT-Systems

Communication Network

Process

… …

IPC I/O-Board PLC

Page 18: Networked Automation Systems (NAS) (Bussysteme in der ... · Distributed Application and System Model Event flow Data flow Communication network Device 1 Device 2 Device 3 Device

AS

447SoSe 19 Georg Frey

Middleware Systems: Level of Abstraction

Abstraction of Computing Hardware

Abstraction der Automation Structure

(Communication Hardware)

Abstraction of Processing Details

IEC 61131

IEC 61499

Agent Systems

OPC UA

SOA

High

Low

Level of Abstraction

(Distance to Technical Process)

Page 19: Networked Automation Systems (NAS) (Bussysteme in der ... · Distributed Application and System Model Event flow Data flow Communication network Device 1 Device 2 Device 3 Device

AS

448SoSe 19 Georg Frey

IEC 61499 as Middleware: Design Process

• IEC 61499 can be seen as a Component oriented Framework für

Design and Implementtation of distributed controllers

• Application Development in two distinct Steps

specification

monolithic application

distributed application

monolithic design

deployment

des

ign

tim

e as

pe

cts

of

IEC

61

49

9

run

tim

eas

pe

cts

of

IEC

61

49

9 IEC

61

49

9

Page 20: Networked Automation Systems (NAS) (Bussysteme in der ... · Distributed Application and System Model Event flow Data flow Communication network Device 1 Device 2 Device 3 Device

AS

449SoSe 19 Georg Frey

Sample application of the development process

• Non-distributed Application

• Distributed Application

Automatically inserted!

Definition of semantics!

Influence on runtime behavior!

E

T

H

E

R

N

E

T

Page 21: Networked Automation Systems (NAS) (Bussysteme in der ... · Distributed Application and System Model Event flow Data flow Communication network Device 1 Device 2 Device 3 Device

AS

450SoSe 19 Georg Frey

Event and data transport

• Event transport

Publish-Subscriber mechanism

Multiple sources and multiple targets for events possible

• Data transport

Client-Server mechanism

One source and multiple targets for data possible

Page 22: Networked Automation Systems (NAS) (Bussysteme in der ... · Distributed Application and System Model Event flow Data flow Communication network Device 1 Device 2 Device 3 Device

AS

451SoSe 19 Georg Frey

Event and Data Transport in Distributed Applications

Event flow is based on the Publish-Subscriber model while

data flow uses a Client-Server mechanism. The IEC 61499

runtime environment is in charge of delivering data and

events on time!

NO EVENTS GET LOST!

Page 23: Networked Automation Systems (NAS) (Bussysteme in der ... · Distributed Application and System Model Event flow Data flow Communication network Device 1 Device 2 Device 3 Device

AS

452SoSe 19 Georg Frey

• Function block networks define a partial order of execution

• Some interpretations of IEC 61499 try to convert the partial order

to a fully specified order

Only works on resource level

FBNs specify a partial order of FB execution.

Synchronization between FBs has to be explicitly specified

in the design!

Execution Order of Function Blocks

Page 24: Networked Automation Systems (NAS) (Bussysteme in der ... · Distributed Application and System Model Event flow Data flow Communication network Device 1 Device 2 Device 3 Device

AS

453SoSe 19 Georg Frey

Prototypical Implementation: 61499.NET

• IEC 61499 runtime implementation based on .NET

• Features of .NET implementation

Free choice of programming language: C#, Visual Basic, C++,…

.NET software library

Visual Studio as development environment

Can be run on Windows and Linux (with project Mono)

Not necessarily in combination with 61131!

• Framework specifics

Clear distinction between definition of interface and algorithms

Automatic insertion of communication SIFBs

No compilation of interface and ECC of FBs

XML-File:

Interface + ECC

.NET-File:

Algorithms

+ FB Instance

interpretation (no compilation)

Page 25: Networked Automation Systems (NAS) (Bussysteme in der ... · Distributed Application and System Model Event flow Data flow Communication network Device 1 Device 2 Device 3 Device

AS

454SoSe 19 Georg Frey

Su

b-p

rob

lem

Maste

r p

rob

lem

Deployment Formulation

• Finding the optimal deployment:

The problem is divided into two parts

• One where the constraints are static

Residence : need of specific hardware or software facility

Co-residence: close dependence of certain artifacts so that those are to be on the

same hardware

Exclusion: redundant elements created for the sake of fault-tolerance should be on

different hardware (also need of specific hardware e.g. timer)

Utilization: for the sake of scheduling utilization should not exceed a pre-defined limit

Memory capacity

Network use

• One where the constraints are dependent upon the dynamics

Time constraints (WCET)

Schedulability: the deployed tasks should have to be schedulable

Page 26: Networked Automation Systems (NAS) (Bussysteme in der ... · Distributed Application and System Model Event flow Data flow Communication network Device 1 Device 2 Device 3 Device

AS

455SoSe 19 Georg Frey

Deployment Solution

• The master problem can be solved using simple constraint solving

algorithm (i.e., backtracking search)

• Multiple solutions of the master problem are needed since they need to

be compared with respect to its suitability to sub-problems

• For solving sub-problems response time analysis or schedulability

analysis is needed.

• Master problem and sub-problems are inter-related and the inter-

dependence can be learned through explanation-based learning

• Prototypical Implementation works

Page 27: Networked Automation Systems (NAS) (Bussysteme in der ... · Distributed Application and System Model Event flow Data flow Communication network Device 1 Device 2 Device 3 Device

AS

456SoSe 19 Georg Frey

Conclusions and Outlook

• Utilization of IEC 61499 as middleware

Abstraction

Simplification of design and implementation

• Interpretation of standard’s text focused on usability

Clear distinction between design and deployment

Clarification of ambiguities (with focus on usability)

• Prototypical Implementation in .NET

Free choice of programming language

Visual Studio as development environment

Can be run on Windows and Linux (with project Mono)

Not necessarily in combination with 61131!

• Automatic Deployment is possible

Page 28: Networked Automation Systems (NAS) (Bussysteme in der ... · Distributed Application and System Model Event flow Data flow Communication network Device 1 Device 2 Device 3 Device

AS

457SoSe 19 Georg Frey

Summary

This lecture gave an introduction to

Controller Design for Distributed Systems

What you should know now:

Concept of IEC 61499

Execution model and ECC

Connection by Data and Events

Page 29: Networked Automation Systems (NAS) (Bussysteme in der ... · Distributed Application and System Model Event flow Data flow Communication network Device 1 Device 2 Device 3 Device

AS

458SoSe 19 Georg Frey

Closing Remark

Thank You