Upload
lengoc
View
216
Download
0
Embed Size (px)
Citation preview
Automation Systems
12th Lecture
Design of Distributed
Controllers
Automation Systems
Discrete Event Control Systems and
Networked Automation Systems
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.
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
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)
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
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)
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
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
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
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
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
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)
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
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
AS
445SoSe 19 Georg Frey
Informational View of an Automation Device
OS
Hardware
Middleware
Application
Automation Device: Controller, Sensor, Actuator
Communication
Interface
Process
Interface
AS
446SoSe 19 Georg Frey
Informationstechnisches Modell eines verteilten AT-Systems
Communication Network
Process
… …
IPC I/O-Board PLC
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)
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
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
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
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!
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
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)
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
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
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
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