Marcus Völp
Constructing and Verifying Cyber Physical Systems
Coordinating Networked CPS
So far …
control
more stable driving
cruise control
navigation / autonomous driving
autonomous drivingSource: ardupilot.com
Now …
distance keeping
driving
Now…
Summer 2015 Constructing and Verifying Cyber Physical Systems - Marcus Völp 212
Summer 2015 Constructing and Verifying Cyber Physical Systems - Marcus Völp 213
Overview
Math
FeedbackControl
RTOS
Verification
Physics
Introduction
Mathematical Foundations (Differential Equations and Laplace Transformation)
Control and Feedback
Transfer Functions and State Space Models
Poles, Zeros / PID Control
Stability, Root Locust Method, Digital Control
Mixed-Criticality Scheduling and Real-Time Operating Systems (RTOS)
Coordinating Networked Cyber-Physical Systems
Program Verification
Differential Dynamic Logic and KeYmaera X
Differential Invariants
CPS
Summer 2015 Constructing and Verifying Cyber Physical Systems - Marcus Völp 214
Overview
Driving Maneuvers
Swarm Models
A Flock of Cars - Intersection Crossing
A Simple Swarm
Summer 2015 Constructing and Verifying Cyber Physical Systems - Marcus Völp 215
A simple swarm
𝑢𝑖 = 𝐹𝑖𝑣𝑖
𝑥𝑖 = 𝑣𝑖
𝑣𝑖 = 𝑢𝑖
Summer 2015 Constructing and Verifying Cyber Physical Systems - Marcus Völp 216
A simple swarm
𝑙𝑖0, 𝐷𝑖
Summer 2015 Constructing and Verifying Cyber Physical Systems - Marcus Völp 217
A simple swarm
𝑙𝑖 , 𝐷𝑖
𝐹𝑧 = 𝐷𝑖∆𝑙𝑖
Summer 2015 Constructing and Verifying Cyber Physical Systems - Marcus Völp 218
A simple swarm
𝑙𝑖 , 𝐷𝑖
𝐹𝑧 = 𝐷𝑖∆𝑙𝑖
Summer 2015 Constructing and Verifying Cyber Physical Systems - Marcus Völp 219
A simple swarm
𝑙𝑖 , 𝐷𝑖
𝐹𝑧 = 𝐷𝑖∆𝑙𝑖
Summer 2015 Constructing and Verifying Cyber Physical Systems - Marcus Völp 220
Driving Maneuvers
distance keeping
driving
rigit platoon leader
Summer 2015 Constructing and Verifying Cyber Physical Systems - Marcus Völp 221
Driving Maneuvers
leader
Intersection crossing
Summer 2015 Constructing and Verifying Cyber Physical Systems - Marcus Völp 222
Driving ManeuversIntersection crossing
leader
split
join
Summer 2015 Constructing and Verifying Cyber Physical Systems - Marcus Völp 223
Driving Maneuvers
leader
Intersection crossing
split
rejoin
Summer 2015 Constructing and Verifying Cyber Physical Systems - Marcus Völp 224
Driving Maneuvers
leader
Obstacle avoidance
Summer 2015 Constructing and Verifying Cyber Physical Systems - Marcus Völp 225
Driving Maneuvers
leader
Obstacle avoidance
Summer 2015 Constructing and Verifying Cyber Physical Systems - Marcus Völp 226
Driving Maneuvers
leader
Obstacle avoidance
Summer 2015 Constructing and Verifying Cyber Physical Systems - Marcus Völp 227
Driving Maneuvers
leader
Obstacle avoidance
Summer 2015 Constructing and Verifying Cyber Physical Systems - Marcus Völp 228
Driving Maneuvers
leader
Diverging goals
Summer 2015 Constructing and Verifying Cyber Physical Systems - Marcus Völp 229
Modeling TrafficLighthill, Whitham ‘55: On Kinematic Waves. II. A Theory of Traffic Flow on Long Crowded Roads
time to pass: 𝜕𝑡𝑖measure passing cars over long time 𝜏
Flow: 𝑞 =𝑛
𝜏
𝜕𝑥
Concentration: 𝑘 = 𝑖=1𝑚 𝜕𝑡𝑖
𝜏𝜕𝑥
Fluid Model
Concentration: 𝑘
flo
w: 𝑞
radius vector: slope give average vehicle velocity
tangent: slope gives wave velocity
Summer 2015 Constructing and Verifying Cyber Physical Systems - Marcus Völp 230
Swarm ModelsParticle swarm optimization
Source: blog.globalforestwatch.org
Summer 2015 Constructing and Verifying Cyber Physical Systems - Marcus Völp 231
Swarm ModelsParticle swarm optimization
Source: blog.globalforestwatch.org
Summer 2015 Constructing and Verifying Cyber Physical Systems - Marcus Völp 232
Swarm ModelsParticle swarm optimization
Source: blog.globalforestwatch.org
Summer 2015 Constructing and Verifying Cyber Physical Systems - Marcus Völp 233
Swarm ModelsParticle swarm optimization
Source: blog.globalforestwatch.org
Summer 2015 Constructing and Verifying Cyber Physical Systems - Marcus Völp 234
Swarm ModelsParticle swarm optimization
Initialize swarm by placing particles uniformly distributed in the search space: 𝑥𝑖~𝑈(𝑏𝑙𝑜, 𝑏ℎ𝑖)Initialize particle’s best known position to its own position: 𝑝𝑖 ← 𝑥𝑖Evaluate particle fitness and assign best swarm position to best known particle position: 𝑔 ← 𝑝𝑖where 𝑓(𝑝𝑖) > 𝑓(𝑝𝑗), 𝑖 ≠ 𝑗
Initialize partible velocity to some random value: 𝑥𝑖~𝑈 − 𝑏ℎ𝑖 − 𝑏𝑙𝑜 , 𝑏ℎ𝑖 − 𝑏𝑙𝑜
Until the termination criterion is met:update particle velocity: 𝑣𝑖 ← 𝜔 𝑣𝑖 + 𝜑𝑝 𝑟𝑝 𝑝𝑖 − 𝑥𝑖 + 𝜑𝑔 𝑟𝑔 𝑔 − 𝑥𝑖
update particle position: 𝑥𝑖 ← 𝑥𝑖 + 𝑣𝑖update particle’s and swarm’s best known position
g holds the best found solution.
parameters for tuning
random influence (between 0,1)
Summer 2015 Constructing and Verifying Cyber Physical Systems - Marcus Völp 235
Swarm ModelsAnt Colony Optimization
Ants move randomly unless they find pheromones on the routeFollow pheromones with certain probability
If they are sucessfull, mark path taken with pheromones
*
*
*
Summer 2015 Constructing and Verifying Cyber Physical Systems - Marcus Völp 236
Flock of Birds called <add favorite Car>Lamia Iftekhar, Reza Olfati-Saber: Autonomous Driving for Vehicular Networks with Nonlinear Dynamics
(if you read the paper: we use qi=xi, pi=vi)
𝑥𝑖 = 𝑣𝑖
𝑣𝑖 = 𝑢𝑖
𝛼-Agent
dynamic graph: 𝐺 𝑥1, 𝑥2, … , 𝑥𝑛 = 𝐺 𝑥 = 𝑉, 𝐸 𝑥
𝐸(𝑥) = 𝑖, 𝑗 𝑥𝑗 − 𝑥𝑖 < 𝑟}
Summer 2015 Constructing and Verifying Cyber Physical Systems - Marcus Völp 237
Flock of Birds called <add favorite Car>
Source: Walter Baxter (CC-BY-SA 2.0)
share common objective
avoid collisions
separation / rejoin
approximately same distance
Summer 2015 Constructing and Verifying Cyber Physical Systems - Marcus Völp 238
Flock of Birds called <add favorite Car>
Definition Flocking:A group of 𝛼–agents with trajectory (𝑥(. ), 𝑣(. )) performflocking behavior over a time interval [𝑡0, 𝑡𝑓 ) with 𝑛𝑐 ≥ 1
components of 𝐺(𝑥(𝑡)), if every agent 𝑖 only communicateswith its neighbors 𝑁𝑖 on the component it belongs to andthe trajectories of the agents satisfy the following propertiesover the period [𝑡0, 𝑡𝑓 ) :
1) Cohesion: ∃𝜌 > 0. 𝑥𝑖 𝑡 −1
𝑛𝑘 𝑗=1𝑛𝑘 𝑥𝑗 𝑡 < 𝜌,
for the kth component with 𝑛𝑘 neighboring agents;
2) Self-assembly: into a quasi alpha-lattice after some finite time;
3) Self-alignment: a relatively small velocity mismatch.
∃ 0 < 𝜖 ≪ 1. 𝐾 𝑣 =1
2
𝑖,𝑗 ∈𝐸 𝑥
𝑣𝑗 𝑡 − 𝑣𝑖 𝑡2< 𝜖
x
𝛾-Agent
𝛼-Agents
Summer 2015 Constructing and Verifying Cyber Physical Systems - Marcus Völp 239
Flock of Birds called <add favorite Car>
Definition Flocking:A group of 𝛼–agents with trajectory (𝑥(. ), 𝑣(. )) performflocking behavior over a time interval [𝑡0, 𝑡𝑓 ) with 𝑛𝑐 ≥ 1
components of 𝐺(𝑥(𝑡)), if every agent 𝑖 only communicateswith its neighbors 𝑁𝑖 on the component it belongs to andthe trajectories of the agents satisfy the following propertiesover the period [𝑡0, 𝑡𝑓 ) :
1) Cohesion: ∃𝜌 > 0. 𝑥𝑖 𝑡 −1
𝑛𝑘 𝑗=1𝑛𝑘 𝑥𝑗 𝑡 < 𝜌,
for the kth component with 𝑛𝑘 neighboring agents;
2) Self-assembly: into a quasi alpha-lattice after some finite time;
3) Self-alignment: a relatively small velocity mismatch.
∃ 0 < 𝜖 ≪ 1. 𝐾 𝑣 =1
2
𝑖,𝑗 ∈𝐸 𝑥
𝑣𝑗 𝑡 − 𝑣𝑖 𝑡2< 𝜖
d
∃ 𝜖, 𝑑. −𝜖 ≤ 𝑥𝑗 𝑡 − 𝑥𝑖 𝑡 − 𝑑 ≤ 𝜖, ∀𝑗 ∈ 𝑁𝑖 𝑥
approximately the same distance to all neighbors
𝛼-Agents
𝛾-Agent
𝛾-Agent
Summer 2015 Constructing and Verifying Cyber Physical Systems - Marcus Völp 240
Flock of Birds called <add favorite Car>
Definition Flocking:A group of 𝛼–agents with trajectory (𝑥(. ), 𝑣(. )) performflocking behavior over a time interval [𝑡0, 𝑡𝑓 ) with 𝑛𝑐 ≥ 1
components of 𝐺(𝑥(𝑡)), if every agent 𝑖 only communicateswith its neighbors 𝑁𝑖 on the component it belongs to andthe trajectories of the agents satisfy the following propertiesover the period [𝑡0, 𝑡𝑓 ) :
1) Cohesion: ∃𝜌 > 0. 𝑥𝑖 𝑡 −1
𝑛𝑘 𝑗=1𝑛𝑘 𝑥𝑗 𝑡 < 𝜌,
for the kth component with 𝑛𝑘 neighboring agents;
2) Self-assembly: into a quasi alpha-lattice after some finite time;
3) Self-alignment: a relatively small velocity mismatch.
∃ 0 < 𝜖 ≪ 1. 𝐾 𝑣 =1
2
𝑖,𝑗 ∈𝐸 𝑥
𝑣𝑗 𝑡 − 𝑣𝑖 𝑡2< 𝜖
d
𝛼-Agents
Summer 2015 Constructing and Verifying Cyber Physical Systems - Marcus Völp 241
Flock of Cars
Summer 2015 Constructing and Verifying Cyber Physical Systems - Marcus Völp 242
Flock of Cars – Lane Change
discrete jump 𝜑-agent1. 𝛾-agent jumps to second lane2. 𝜑-agent follows 𝛾-agent
(using aggressive maneuvers)3. 𝛼-agent follows 𝜑 -agent
Summer 2015 Constructing and Verifying Cyber Physical Systems - Marcus Völp 243
Flock of Cars – Lane Change
Summer 2015 Constructing and Verifying Cyber Physical Systems - Marcus Völp 244
Overview
Driving Maneuvers
Swarm Models
A Flock of Cars - Intersection Crossing
A Simple Swarm
Summer 2015 Constructing and Verifying Cyber Physical Systems - Marcus Völp 245
Overview
Math
FeedbackControl
RTOS
Verification
Physics
Introduction
Mathematical Foundations (Differential Equations and Laplace Transformation)
Control and Feedback
Transfer Functions and State Space Models
Poles, Zeros / PID Control
Stability, Root Locust Method, Digital Control
Mixed-Criticality Scheduling and Real-Time Operating Systems (RTOS)
Coordinating Networked Cyber-Physical Systems
Program Verification
Differential Dynamic Logic and KeYmaera X
Differential Invariants
CPS