component-based design of embedded control systems luca dealfaro chamberlain fong tom henzinger...

28
Component-Based Design of Embedded Control Systems Luca Dealfaro Chamberlain Fong Tom Henzinger Christopher Hylands John Koo Edward A. Lee Jie Liu Xiaojun Liu Steve Neuendorffer Sonia Sachs Shankar Sastry Win Williams UC Berkeley

Post on 20-Dec-2015

215 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Component-Based Design of Embedded Control Systems Luca Dealfaro Chamberlain Fong Tom Henzinger Christopher Hylands John Koo Edward A. Lee Jie Liu Xiaojun

Component-Based Design of Embedded Control Systems

Luca Dealfaro

Chamberlain Fong

Tom Henzinger

Christopher Hylands

John Koo

Edward A. Lee

Jie Liu

Xiaojun Liu

Steve Neuendorffer

Sonia Sachs

Shankar Sastry

Win Williams

UC Berkeley

Page 2: Component-Based Design of Embedded Control Systems Luca Dealfaro Chamberlain Fong Tom Henzinger Christopher Hylands John Koo Edward A. Lee Jie Liu Xiaojun

Hierarchical, Heterogeneous Modeling and Design

A model of computation governs the interaction of components at each level of the hierarchy. A submodel exposes a domain-polymorphic interface that governs the inter-domain semantics.

sensors

leader

Br Acc

Ba

bang-bang PID

follower

controller actuators

S

Page 3: Component-Based Design of Embedded Control Systems Luca Dealfaro Chamberlain Fong Tom Henzinger Christopher Hylands John Koo Edward A. Lee Jie Liu Xiaojun

Ptolemy II

Ptolemy II –– Java based, network integrated– Many domains implemented– Multi-domain modeling– XML syntax for persistent data– Block-diagram GUI– Extensible type system– Code generator on the way

http://ptolemy.eecs.berkeley.edu

Page 4: Component-Based Design of Embedded Control Systems Luca Dealfaro Chamberlain Fong Tom Henzinger Christopher Hylands John Koo Edward A. Lee Jie Liu Xiaojun

Domains Status

Domains we understand well:– Dataflow– Process networks– CSP– Discrete events– Continuous time– Synchronous reactive– Finite state machines

Domains we are working on:– Publish & subscribe– Time triggered

Our focus is particularly on how these domains support real-time QOS

Page 5: Component-Based Design of Embedded Control Systems Luca Dealfaro Chamberlain Fong Tom Henzinger Christopher Hylands John Koo Edward A. Lee Jie Liu Xiaojun

Concept Demonstration

Networked sensors and actuators Multiple, networked controllers, controllees Hierarchical, heterogeneous design Domain polymorphic components Discovery Mutable systems

Page 6: Component-Based Design of Embedded Control Systems Luca Dealfaro Chamberlain Fong Tom Henzinger Christopher Hylands John Koo Edward A. Lee Jie Liu Xiaojun

Experimental Setup

Ethernet Hub

Agilent

NCAP

Telemonitor

Tilt sensor

1451.2

Page 7: Component-Based Design of Embedded Control Systems Luca Dealfaro Chamberlain Fong Tom Henzinger Christopher Hylands John Koo Edward A. Lee Jie Liu Xiaojun

Networked Smart Sensors

Ethernet

Agilent

NCAP

Telemonitor

Tilt sensor

1451.2

HTTP interface

HTTP queries

Page 8: Component-Based Design of Embedded Control Systems Luca Dealfaro Chamberlain Fong Tom Henzinger Christopher Hylands John Koo Edward A. Lee Jie Liu Xiaojun

Abstraction of the Sensoras a Software Component

Ethernet

Agilent

NCAP

Telemonitor

Tilt sensor

1451.2

HTTP queries

Page 9: Component-Based Design of Embedded Control Systems Luca Dealfaro Chamberlain Fong Tom Henzinger Christopher Hylands John Koo Edward A. Lee Jie Liu Xiaojun

Smart Sensor + Ptolemy II

Tilt sensor connected to a plotter.

Page 10: Component-Based Design of Embedded Control Systems Luca Dealfaro Chamberlain Fong Tom Henzinger Christopher Hylands John Koo Edward A. Lee Jie Liu Xiaojun

Issues Raised

Concurrency management with I/O– Separate thread handles communication– Rendezvous with computational thread– How to maintain time consistency?– How to ensure no deadlock?

Page 11: Component-Based Design of Embedded Control Systems Luca Dealfaro Chamberlain Fong Tom Henzinger Christopher Hylands John Koo Edward A. Lee Jie Liu Xiaojun

Planned - Discovery

Ethernet

Agilent

NCAP

Telemonitor

Tilt sensor

Hub

JINI

1451.2

Register a Service

Page 12: Component-Based Design of Embedded Control Systems Luca Dealfaro Chamberlain Fong Tom Henzinger Christopher Hylands John Koo Edward A. Lee Jie Liu Xiaojun

Planned - Discovery

Ethernet

Agilent

NCAP

Telemonitor

Tilt sensor

Hub

JINI

1451.2

Discover a Service

Page 13: Component-Based Design of Embedded Control Systems Luca Dealfaro Chamberlain Fong Tom Henzinger Christopher Hylands John Koo Edward A. Lee Jie Liu Xiaojun

Planned - Discovery

Ethernet

Agilent

NCAP

Telemonitor

Tilt sensor

Hub

JINI

1451.2

Download Interface Software

Page 14: Component-Based Design of Embedded Control Systems Luca Dealfaro Chamberlain Fong Tom Henzinger Christopher Hylands John Koo Edward A. Lee Jie Liu Xiaojun

Planned - Discovery

Ethernet

Agilent

NCAP

Telemonitor

Tilt sensor

Hub

JINI

1451.2

Communicate

This would provide a vendor-neutral software component.

Page 15: Component-Based Design of Embedded Control Systems Luca Dealfaro Chamberlain Fong Tom Henzinger Christopher Hylands John Koo Edward A. Lee Jie Liu Xiaojun

Actuator Setup

Proxy

serial port

IR tower

Lego Mindstorm

Page 16: Component-Based Design of Embedded Control Systems Luca Dealfaro Chamberlain Fong Tom Henzinger Christopher Hylands John Koo Edward A. Lee Jie Liu Xiaojun

Linking the Tilt Sensor and Actuators

Page 17: Component-Based Design of Embedded Control Systems Luca Dealfaro Chamberlain Fong Tom Henzinger Christopher Hylands John Koo Edward A. Lee Jie Liu Xiaojun

Mutations – Dynamic Structural Changes to the Model

Thread-safe Ptolemy II kernel– Mutual exclusion protocol in the Workspace object.

Domains control when mutations are committed.– Mutations are queued with the Manager object.– Manager executes mutations between iterations.– Meaning of “iteration” is domain-dependent.

In this example:– The event thread in the UI queues mutation requests– The executing model commits the mutations at safe points.

Page 18: Component-Based Design of Embedded Control Systems Luca Dealfaro Chamberlain Fong Tom Henzinger Christopher Hylands John Koo Edward A. Lee Jie Liu Xiaojun

Publish and Subscribe

Use Jini to discover the publish/subscribe fabric.– Our current realization returns a JavaSpaces interface.– Future realization will use OCP

Real time– Prioritized delivery, handling– QOS is not part of JavaSpaces.

Page 19: Component-Based Design of Embedded Control Systems Luca Dealfaro Chamberlain Fong Tom Henzinger Christopher Hylands John Koo Edward A. Lee Jie Liu Xiaojun

Clock Publisher/Subscriber

Page 20: Component-Based Design of Embedded Control Systems Luca Dealfaro Chamberlain Fong Tom Henzinger Christopher Hylands John Koo Edward A. Lee Jie Liu Xiaojun

Distributed Lego Controller

Tilt sensor data published, controller subscribes.

left = 4 * xTilt - 2 * yTilt

right = 4 * xTilt + 2 * yTilt

Page 21: Component-Based Design of Embedded Control Systems Luca Dealfaro Chamberlain Fong Tom Henzinger Christopher Hylands John Koo Edward A. Lee Jie Liu Xiaojun

Other Examples We Have Implemented

Other Lego models:– Modal controller for navigation– Feedback of sensor data

Hybrid systems:– Car tracking example– Helicopter multi-modal controller

Pioneer robot control– Multi-agent coordination– Jini discovery of robots– Publish-and-subscribe task distribution

Page 22: Component-Based Design of Embedded Control Systems Luca Dealfaro Chamberlain Fong Tom Henzinger Christopher Hylands John Koo Edward A. Lee Jie Liu Xiaojun

Styles of Publish and Subscribe Interactions

time stamped events? globally time stamped? reliable delivery? ordered delivery? signal coordination? synchronous delivery? blending of multiple publishers? dynamic redirection/resourcing? persistence? history?

Page 23: Component-Based Design of Embedded Control Systems Luca Dealfaro Chamberlain Fong Tom Henzinger Christopher Hylands John Koo Edward A. Lee Jie Liu Xiaojun

A Key Idea

We need a variety of interaction mechanisms. In the prototype,

– Jini delivers an interaction mechanism service by delivering code that realizes that interaction mechanism.

A "meta OCP" could similarly deliver any of several interaction mechanisms.

Page 24: Component-Based Design of Embedded Control Systems Luca Dealfaro Chamberlain Fong Tom Henzinger Christopher Hylands John Koo Edward A. Lee Jie Liu Xiaojun

Example 1

Component says:– "I need a reliable stream-based delivery mechanism

to get sampled data from here to there." Meta-OCP says:

– "OK, here's some code for you and the recipient of your data."

Delivered code uses TCP/IP and sockets, bypassing any central infrastructure.– E.g., Transporting audio data.

Page 25: Component-Based Design of Embedded Control Systems Luca Dealfaro Chamberlain Fong Tom Henzinger Christopher Hylands John Koo Edward A. Lee Jie Liu Xiaojun

Example 2

Component says:– "I need a shared data repository visible to a number

of components." Meta-OCP says:

– "OK, here's some code for you and the recipient of your data."

Delivered code interacts with a Linda-style tuple space.– E.g., reading the current temperature from a sensor.

Page 26: Component-Based Design of Embedded Control Systems Luca Dealfaro Chamberlain Fong Tom Henzinger Christopher Hylands John Koo Edward A. Lee Jie Liu Xiaojun

Example 3

Component says:– "I need to send time-stamped data that must be

delivered and dealt with within 3 msec."

Meta-OCP says:– "OK, here's some code for you and the recipient of

your data."

Delivered code interacts with TAO.– E.g., deliver motion control data.

Page 27: Component-Based Design of Embedded Control Systems Luca Dealfaro Chamberlain Fong Tom Henzinger Christopher Hylands John Koo Edward A. Lee Jie Liu Xiaojun

Next Steps

OCP integration Define publish and subscribe semantics Discovery of sensor/actuator services Abstraction of sensor/actuator services Real-time QOS Time-driven domain (Masaccio) Multi-robot coordination Improved UI (particularly to help debugging)

Page 28: Component-Based Design of Embedded Control Systems Luca Dealfaro Chamberlain Fong Tom Henzinger Christopher Hylands John Koo Edward A. Lee Jie Liu Xiaojun

The Demo Builders…

Chamberlain Fong Christopher Hylands Jie Liu Xiaojun Liu Steve Neuendorffer Sonia Sachs Win Williams