comparing models of computation for real-time, distributed control systems

29
Comparing Models of Computation for Real- time, Distributed Control Systems Shawn Schaffert Bruno Sinopoli

Upload: haig

Post on 19-Jan-2016

30 views

Category:

Documents


0 download

DESCRIPTION

Comparing Models of Computation for Real-time, Distributed Control Systems. Shawn Schaffert Bruno Sinopoli. Outline. The real-time, distributed control problem The two car example Analysis of different models Implementation Conclusion. The real-time, distributed control problem. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Comparing Models of Computation for Real-time, Distributed Control Systems

Comparing Models of Computation for Real-time, Distributed Control Systems

Shawn SchaffertBruno Sinopoli

Page 2: Comparing Models of Computation for Real-time, Distributed Control Systems

Outline The real-time, distributed control

problem The two car example Analysis of different models Implementation Conclusion

Page 3: Comparing Models of Computation for Real-time, Distributed Control Systems

The real-time, distributed control problem

Page 4: Comparing Models of Computation for Real-time, Distributed Control Systems

The Real-time, Distributed Control Dream Model for classical control Model for discrete world

High level: networking, synchronization

Low level: task scheduling Verification tools Code-generation -> implementation

Page 5: Comparing Models of Computation for Real-time, Distributed Control Systems

Key Ideas

Applications Environmental monitoring

(distributed sensing) Rocket vibration damping

(distributed actuation) Two car example

(distributed sensing and actuation)

Algorithms Routing Localization Synchronization Control Scheduling

Mechanisms Communication network Local & global clocks Distributed dynamical

environment Local shared resources Dynamic node

creation/destruction

Properties Controller stability Fault tolerance Task deadlines Network reliability Synchronization error

Page 6: Comparing Models of Computation for Real-time, Distributed Control Systems

The two car example

Page 7: Comparing Models of Computation for Real-time, Distributed Control Systems

System Structure

Cluster1

TURN!

Cluster2

TURN!

Ext_Node1

sensor

RF

Int_Node1

sensor

RF

Int_Node2

sensor

RF

Ext_Node2

sensor

RF

Distributed wireless sensor nodes detect the coming cars and their directions, communicate with neighbor nodes, and control the cars to avoid collision

Page 8: Comparing Models of Computation for Real-time, Distributed Control Systems

Analysis of different models

Page 9: Comparing Models of Computation for Real-time, Distributed Control Systems

Models Continuous Time Timed Multitasking Continuous Time with Discrete Event Globally Asynchronous Locally

Synchronous (GALS) Other models

Giotto SDF SR

Page 10: Comparing Models of Computation for Real-time, Distributed Control Systems

Continuous Time (CT) This model captures:

Control stability This model doesn’t capture:

Synchronization Scheduling Network

Page 11: Comparing Models of Computation for Real-time, Distributed Control Systems

Timed Multitasking (TM) One purpose: analysis of scheduling of

shared resources Isn’t interesting for the two car

example Could be useful for general problems

Higher level provides bounds on event inter-arrival time

This level guarantees task deadlines are met

Page 12: Comparing Models of Computation for Real-time, Distributed Control Systems

Continuous Time with Discrete Event (CT-DE) Our models captures

Radio communication Broadcast channel Radio delay Radio collision

Distributed environment Nodes are separate entities Communication only via radio channel Distributed sensor readings

Page 13: Comparing Models of Computation for Real-time, Distributed Control Systems

Continuous Time with Discrete Event (CT-DE)

Our model could be extended to capture: Improved radio model

Radio noise Low radio bandwidth – collision window based on packet

size Local and global clocks Nodes query environment individually Hardware-in-the-loop

Problems with the CT-DE model: Dynamic node creation/destruction seems

cumbersome Does not model task level Scale to 100 or 1000 nodes

Page 14: Comparing Models of Computation for Real-time, Distributed Control Systems

Esterel

Synchronous language Control-dominated software or

hardware reactive system High-level programming using

functional models C code is automatically generated

Page 15: Comparing Models of Computation for Real-time, Distributed Control Systems

Design Flow Implement functional

specification using high-level language (Esterel)

Directly generate function modules(C code) through compiling

Build interfaces and wrappers needed by the execution platform

Target Execution Platform

CodeGeneration

Performance evaluation

Design Concepts

Functional Specification

Compiler

Page 16: Comparing Models of Computation for Real-time, Distributed Control Systems

High-Level Description

module extnode:Loop await CAR;

emit TO_Nend loop

module Cluster:loop await FROM_NC; await E;

emit CAR_TURN each L||loop await E;

emit TO_NCeach L||loop await T;

emit CAR_TURN;emit TO_NC

each L

module intnode:loop await [CAR or FROM_N]; present CAR then present FROM_N then emit T else [await FROM_N; emit L] end present else present FROM_N then [await CAR; emit E] end present end presentend loop

Cluster1

TURN!

Cluster2

TURN!

Ext_Node1

sensor

RF

Int_Node1

sensor

RF

Int_Node2

sensor

RF

Ext_Node2

sensor

RF

Page 17: Comparing Models of Computation for Real-time, Distributed Control Systems

The real World

Esterel –A <modulename>.strl

Page 18: Comparing Models of Computation for Real-time, Distributed Control Systems

Synch vs Asynch In Synchronous models

“Reaction based” Absence () can be sensed and used in the

specification of behaviors A global tick exists

In Asynchronous models “Signal based” No global tick Reaction cannot be observed anymore cannot be sensed

Page 19: Comparing Models of Computation for Real-time, Distributed Control Systems

Endochronicity define

desynchronization of P This map is unique but not invertible

a aPP

“If P satisfies a special condition called endochrony, then there exists a unique such that holds”

aa PP a

Page 20: Comparing Models of Computation for Real-time, Distributed Control Systems

Endochronicity: Meaning STS Set of variables W’ clock inference of W ( ) if

knowing presence/absence of allows deriving the presence absence of

If then the process is endochronous

,, V

VWW 'WW '

'Wv

Wv

VVVV )...2()1()0(0

Page 21: Comparing Models of Computation for Real-time, Distributed Control Systems

Isochronicity In general

WE want the equality to hold (no spurious behavior due to asynchronous communication)

)||()||( aa

aa QPQP

“If (P,Q) satisfies a special condition called isochrony then the equality indeed holds”

Page 22: Comparing Models of Computation for Real-time, Distributed Control Systems

Isochronicity: Meaningif b = T emit u(false)TTTT FFFF

if b == T emit u(false)

TFTT

FFF

TFTT

if a==T if b == T emit u(false)TFTT

FFF TFFTFTT

Page 23: Comparing Models of Computation for Real-time, Distributed Control Systems

Our Casemodule extnode:Loop await CAR;

emit TO_Nend loop

This is endochronous:}_,{)2(}{)1( NTOCARVCARV

module intnode:loop await [CAR or FROM_N]; present CAR then present FROM_N then emit T else [await FROM_N; emit L] end present else present FROM_N then [await CAR; emit E] end present end presentend loop

This is not endochronous since CAR and FROM_N are not related:if (messagePayload_ptr->sourceNodeID == DUMB_NODE) {

internal_I_FROM_N()}

else if (messagePayload_ptr->sourceNodeID == OTHER_SMART_NODE) {

internal_I_FROM_NC()}

internal()

Page 24: Comparing Models of Computation for Real-time, Distributed Control Systems

Make it Endochronous Simple solution: add signaling

For each signal add a boolean flag which indicates presence/absence

During the execution the functions will wait for all the flags and then will react

Very expensive in general: If (flag==T) { set_input;set_arrived} If (all_flag) {react;reset_arrived}

Page 25: Comparing Models of Computation for Real-time, Distributed Control Systems

Some discussion External node:

Code size overhead 7% Internal node

Code size overhead 18% The external node is already

endochronous Internal node needs some extra

signaling

Page 26: Comparing Models of Computation for Real-time, Distributed Control Systems

Implementation

Page 27: Comparing Models of Computation for Real-time, Distributed Control Systems

Conclusion Ptolemy

Allows accurate model for entire system Network, dynamics, scheduling

User friendly (intuitive) Scalability issues Code generation for sensor networks?

Esterel Limited modeling (only behavioral level) Verifiability Code generation

Page 28: Comparing Models of Computation for Real-time, Distributed Control Systems

Proposed Design Methodology

Controller

CT

DE

Synchronization

Routing

Task & Resource Scheduling

TM

Hardware

Page 29: Comparing Models of Computation for Real-time, Distributed Control Systems

END

Acknowledgements:Professor Lee for stimulating discussionAlessandro Pinto, Yanmei Li for their contribution in the Esterel implementation