embedded and cyber-physical systems -selected topics-€¦ · 2 courtesy of kuka robotics...

28
1 ECPS-S2014-Lecture1 (Stefan Resmerita) Embedded and Cyber-Physical Systems - Introduction - Stefan Resmerita Summer 2014

Upload: others

Post on 11-Jul-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Embedded and Cyber-Physical Systems -selected topics-€¦ · 2 Courtesy of Kuka Robotics Corp.ECPS-S2014 -Lecture1 (Stefan Resmerita) Cyber-Physical Systems (CPS): Orchestrating

1 ECPS-S2014-Lecture1 (Stefan Resmerita)

Embedded and Cyber-Physical Systems

- Introduction -

Stefan Resmerita Summer 2014

Page 2: Embedded and Cyber-Physical Systems -selected topics-€¦ · 2 Courtesy of Kuka Robotics Corp.ECPS-S2014 -Lecture1 (Stefan Resmerita) Cyber-Physical Systems (CPS): Orchestrating

2 ECPS-S2014-Lecture1 (Stefan Resmerita) Courtesy of Kuka Robotics Corp.

Cyber-Physical Systems (CPS): Orchestrating networked computational

resources with physical systems

Courtesy of Doug Schmidt

Power generation and distribution

Courtesy of General Electric

Military systems:

E-Corner, Siemens

Transportation (Air traffic control at SFO)

Avionics

Telecommunications

Factory automation

Instrumentation (Soleil Synchrotron)

Daimler-Chrysler

Automotive

Building Systems

Slide from Lee & Seshia

Page 3: Embedded and Cyber-Physical Systems -selected topics-€¦ · 2 Courtesy of Kuka Robotics Corp.ECPS-S2014 -Lecture1 (Stefan Resmerita) Cyber-Physical Systems (CPS): Orchestrating

3 ECPS-S2014-Lecture1 (Stefan Resmerita) Slide from Ken Butts

Toyota’s Direction

Infrastructure integration

Vehicle technologies

Our sustainable mobility strategy includes products, partnerships, the urban environment and energy solutions.*

*Toyota 2010 North American Environmental Report Highlights

Connections

Page 4: Embedded and Cyber-Physical Systems -selected topics-€¦ · 2 Courtesy of Kuka Robotics Corp.ECPS-S2014 -Lecture1 (Stefan Resmerita) Cyber-Physical Systems (CPS): Orchestrating

4 ECPS-S2014-Lecture1 (Stefan Resmerita) Slide from Lee & Seshia

Cyber-Physical Systems

Page 5: Embedded and Cyber-Physical Systems -selected topics-€¦ · 2 Courtesy of Kuka Robotics Corp.ECPS-S2014 -Lecture1 (Stefan Resmerita) Cyber-Physical Systems (CPS): Orchestrating

5 ECPS-S2014-Lecture1 (Stefan Resmerita)

When software error is combined with physical modeling error

Page 6: Embedded and Cyber-Physical Systems -selected topics-€¦ · 2 Courtesy of Kuka Robotics Corp.ECPS-S2014 -Lecture1 (Stefan Resmerita) Cyber-Physical Systems (CPS): Orchestrating

6 ECPS-S2014-Lecture1 (Stefan Resmerita)

When sensing fails

• https://www.youtube.com/watch?v=O1L-rLZayWQ

Page 7: Embedded and Cyber-Physical Systems -selected topics-€¦ · 2 Courtesy of Kuka Robotics Corp.ECPS-S2014 -Lecture1 (Stefan Resmerita) Cyber-Physical Systems (CPS): Orchestrating

7 ECPS-S2014-Lecture1 (Stefan Resmerita)

How can we deal with such complex systems?

Page 8: Embedded and Cyber-Physical Systems -selected topics-€¦ · 2 Courtesy of Kuka Robotics Corp.ECPS-S2014 -Lecture1 (Stefan Resmerita) Cyber-Physical Systems (CPS): Orchestrating

8 ECPS-S2014-Lecture1 (Stefan Resmerita) Slide from Lee & Seshia

Modeling, Design, Analysis

•Modeling is the process of gaining a deeper understanding of a system through imitation. Models specify what a system does.

•Design is the structured creation of artifacts. It specifies how a system does what it does. This includes optimization.

•Analysis is the process of gaining a deeper understanding of a system through dissection. It specifies why a system does what it does (or fails to do what a model says it should do).

Page 9: Embedded and Cyber-Physical Systems -selected topics-€¦ · 2 Courtesy of Kuka Robotics Corp.ECPS-S2014 -Lecture1 (Stefan Resmerita) Cyber-Physical Systems (CPS): Orchestrating

9 ECPS-S2014-Lecture1 (Stefan Resmerita) Slide from Lee & Seshia

Modeling

•Developing insight about a system, process, or artifact through imitation.

•A model is an artifact that imitates the system, process, or artifact of interest.

•A mathematical model is model in the form of a set of definitions and mathematical formulas.

Page 10: Embedded and Cyber-Physical Systems -selected topics-€¦ · 2 Courtesy of Kuka Robotics Corp.ECPS-S2014 -Lecture1 (Stefan Resmerita) Cyber-Physical Systems (CPS): Orchestrating

10 ECPS-S2014-Lecture1 (Stefan Resmerita) Slide from Lee & Seshia

Model-Based Design

1. Create a model of all the parts of the embedded system Physical world Control system Software environment Hardware platform Network Sensors and actuators

2. Construct an implementation from the model Construction may be automated, like a compiler More commonly, portions are automatically

constructed

Page 11: Embedded and Cyber-Physical Systems -selected topics-€¦ · 2 Courtesy of Kuka Robotics Corp.ECPS-S2014 -Lecture1 (Stefan Resmerita) Cyber-Physical Systems (CPS): Orchestrating

11 ECPS-S2014-Lecture1 (Stefan Resmerita) Slide from Lee & Seshia

Contents

• Modeling techniques

• Controller design (discrete event systems)

• System analysis (discrete event systems)

• Code generation and integration

• Practical projects: system modeling in Ptolemy II

Page 12: Embedded and Cyber-Physical Systems -selected topics-€¦ · 2 Courtesy of Kuka Robotics Corp.ECPS-S2014 -Lecture1 (Stefan Resmerita) Cyber-Physical Systems (CPS): Orchestrating

12 ECPS-S2014-Lecture1 (Stefan Resmerita)

Modeling of continuous dynamics

Page 13: Embedded and Cyber-Physical Systems -selected topics-€¦ · 2 Courtesy of Kuka Robotics Corp.ECPS-S2014 -Lecture1 (Stefan Resmerita) Cyber-Physical Systems (CPS): Orchestrating

13 ECPS-S2014-Lecture1 (Stefan Resmerita)

The two-tank example

T1 T2

v1 v2

F

x1

x2

Page 14: Embedded and Cyber-Physical Systems -selected topics-€¦ · 2 Courtesy of Kuka Robotics Corp.ECPS-S2014 -Lecture1 (Stefan Resmerita) Cyber-Physical Systems (CPS): Orchestrating

14 ECPS-S2014-Lecture1 (Stefan Resmerita)

The problem

• Setting: – F(t)= c (constant)

– v1(0) = v2(0) = 0

– x1(0) > 0, x2(0) > 0

– v1(t) = c1 , v2(t) = c2 for t > 0

– c1 < c and c2 < c

– F can be switched either to T1 or to T2

• Requirement: find a suitable switching to keep both levels above zero.

Page 15: Embedded and Cyber-Physical Systems -selected topics-€¦ · 2 Courtesy of Kuka Robotics Corp.ECPS-S2014 -Lecture1 (Stefan Resmerita) Cyber-Physical Systems (CPS): Orchestrating

15 ECPS-S2014-Lecture1 (Stefan Resmerita)

The Cyber Part

• Possible solution: a discrete controller

– if (when) xi == 0, switch to Ti (i=1,2)

• Advantage: Minimally interventive

• Is this a viable controller?

Page 16: Embedded and Cyber-Physical Systems -selected topics-€¦ · 2 Courtesy of Kuka Robotics Corp.ECPS-S2014 -Lecture1 (Stefan Resmerita) Cyber-Physical Systems (CPS): Orchestrating

16 ECPS-S2014-Lecture1 (Stefan Resmerita)

The Physical Part

• Principle of mass conservation (assume isolated system, no work) Input mass = stored mass + output mass

F·t = M1(t) + M2(t) + (v1+v2)·t

M1(t) + M2(t) = (F-v1-v2)·t

What if (F-v1-v2) < 0 ?

Page 17: Embedded and Cyber-Physical Systems -selected topics-€¦ · 2 Courtesy of Kuka Robotics Corp.ECPS-S2014 -Lecture1 (Stefan Resmerita) Cyber-Physical Systems (CPS): Orchestrating

17 ECPS-S2014-Lecture1 (Stefan Resmerita)

A mathematical model

22

.

11

.

22

.

11

.

2

1

vFx

vx

vx

vFx

Page 18: Embedded and Cyber-Physical Systems -selected topics-€¦ · 2 Courtesy of Kuka Robotics Corp.ECPS-S2014 -Lecture1 (Stefan Resmerita) Cyber-Physical Systems (CPS): Orchestrating

18 ECPS-S2014-Lecture1 (Stefan Resmerita)

Solution

2212022

2111011

)(

)(

tvFtvxtx

tvtvFxtx

Does a viable controller exist? Check this:

0

0

2212

2111

tvFtv

tvtvF

Page 19: Embedded and Cyber-Physical Systems -selected topics-€¦ · 2 Courtesy of Kuka Robotics Corp.ECPS-S2014 -Lecture1 (Stefan Resmerita) Cyber-Physical Systems (CPS): Orchestrating

19 ECPS-S2014-Lecture1 (Stefan Resmerita) Slide from Lee & Seshia

Another Example: Modeling Helicopter Dynamics

Page 20: Embedded and Cyber-Physical Systems -selected topics-€¦ · 2 Courtesy of Kuka Robotics Corp.ECPS-S2014 -Lecture1 (Stefan Resmerita) Cyber-Physical Systems (CPS): Orchestrating

20 ECPS-S2014-Lecture1 (Stefan Resmerita)

Feedback Control Problem

A helicopter without a tail rotor, like the one below, will spin uncontrollably. Why?

Control system problem: Apply torque using the tail rotor.

Page 21: Embedded and Cyber-Physical Systems -selected topics-€¦ · 2 Courtesy of Kuka Robotics Corp.ECPS-S2014 -Lecture1 (Stefan Resmerita) Cyber-Physical Systems (CPS): Orchestrating

21 ECPS-S2014-Lecture1 (Stefan Resmerita)

Physics teaser: helicopter spin

• Watch the two videos, with helicopters that are similar in construction.

http://www.youtube.com/watch?v=MhEXXgiIVuY http://www.youtube.com/watch?v=ijErOpjx_Ws • Why do they behave differently after loosing the

tail rotor control?

Page 22: Embedded and Cyber-Physical Systems -selected topics-€¦ · 2 Courtesy of Kuka Robotics Corp.ECPS-S2014 -Lecture1 (Stefan Resmerita) Cyber-Physical Systems (CPS): Orchestrating

22 ECPS-S2014-Lecture1 (Stefan Resmerita)

Feedback Control

0 ,1

0 ,0)(

t

ttu

Page 23: Embedded and Cyber-Physical Systems -selected topics-€¦ · 2 Courtesy of Kuka Robotics Corp.ECPS-S2014 -Lecture1 (Stefan Resmerita) Cyber-Physical Systems (CPS): Orchestrating

23 ECPS-S2014-Lecture1 (Stefan Resmerita)

Helicopter model in Ptolemy II

a Java class !

http://ptolemy.eecs.berkeley.edu/ptolemyII/

Page 24: Embedded and Cyber-Physical Systems -selected topics-€¦ · 2 Courtesy of Kuka Robotics Corp.ECPS-S2014 -Lecture1 (Stefan Resmerita) Cyber-Physical Systems (CPS): Orchestrating

24 ECPS-S2014-Lecture1 (Stefan Resmerita) Slide from Lee & Seshia

Modeling Physical Motion

• Six degrees of freedom:

Position: x, y, z

Orientation: pitch, yaw, roll

Page 25: Embedded and Cyber-Physical Systems -selected topics-€¦ · 2 Courtesy of Kuka Robotics Corp.ECPS-S2014 -Lecture1 (Stefan Resmerita) Cyber-Physical Systems (CPS): Orchestrating

25 ECPS-S2014-Lecture1 (Stefan Resmerita) Slide from Lee & Seshia

Torque

• Just as force is a push or a pull, a torque is a twist.

• Units: newton-meters/radian, Joules/radian

Ty(t ) = r f (t )

For a point mass rotating around a fixed axis:

Page 26: Embedded and Cyber-Physical Systems -selected topics-€¦ · 2 Courtesy of Kuka Robotics Corp.ECPS-S2014 -Lecture1 (Stefan Resmerita) Cyber-Physical Systems (CPS): Orchestrating

26 ECPS-S2014-Lecture1 (Stefan Resmerita) Slide from Lee & Seshia

Rotational Version of Newton’s Second Law

Page 27: Embedded and Cyber-Physical Systems -selected topics-€¦ · 2 Courtesy of Kuka Robotics Corp.ECPS-S2014 -Lecture1 (Stefan Resmerita) Cyber-Physical Systems (CPS): Orchestrating

27 ECPS-S2014-Lecture1 (Stefan Resmerita) Slide from Lee & Seshia

Simple Example

Page 28: Embedded and Cyber-Physical Systems -selected topics-€¦ · 2 Courtesy of Kuka Robotics Corp.ECPS-S2014 -Lecture1 (Stefan Resmerita) Cyber-Physical Systems (CPS): Orchestrating

28 ECPS-S2014-Lecture1 (Stefan Resmerita)

Feedback Control