1 ECPS-S2014-Lecture1 (Stefan Resmerita)
Embedded and Cyber-Physical Systems
- Introduction -
Stefan Resmerita Summer 2014
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
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
4 ECPS-S2014-Lecture1 (Stefan Resmerita) Slide from Lee & Seshia
Cyber-Physical Systems
5 ECPS-S2014-Lecture1 (Stefan Resmerita)
When software error is combined with physical modeling error
6 ECPS-S2014-Lecture1 (Stefan Resmerita)
When sensing fails
• https://www.youtube.com/watch?v=O1L-rLZayWQ
7 ECPS-S2014-Lecture1 (Stefan Resmerita)
How can we deal with such complex systems?
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).
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.
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
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
12 ECPS-S2014-Lecture1 (Stefan Resmerita)
Modeling of continuous dynamics
13 ECPS-S2014-Lecture1 (Stefan Resmerita)
The two-tank example
T1 T2
v1 v2
F
x1
x2
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.
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?
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 ?
17 ECPS-S2014-Lecture1 (Stefan Resmerita)
A mathematical model
22
.
11
.
22
.
11
.
2
1
vFx
vx
vx
vFx
18 ECPS-S2014-Lecture1 (Stefan Resmerita)
Solution
2212022
2111011
)(
)(
tvFtvxtx
tvtvFxtx
Does a viable controller exist? Check this:
0
0
2212
2111
tvFtv
tvtvF
19 ECPS-S2014-Lecture1 (Stefan Resmerita) Slide from Lee & Seshia
Another Example: Modeling Helicopter Dynamics
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.
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?
22 ECPS-S2014-Lecture1 (Stefan Resmerita)
Feedback Control
0 ,1
0 ,0)(
t
ttu
23 ECPS-S2014-Lecture1 (Stefan Resmerita)
Helicopter model in Ptolemy II
a Java class !
http://ptolemy.eecs.berkeley.edu/ptolemyII/
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
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:
26 ECPS-S2014-Lecture1 (Stefan Resmerita) Slide from Lee & Seshia
Rotational Version of Newton’s Second Law
27 ECPS-S2014-Lecture1 (Stefan Resmerita) Slide from Lee & Seshia
Simple Example
28 ECPS-S2014-Lecture1 (Stefan Resmerita)
Feedback Control