09: Reactions & Delays 15-424: Foundations of Cyber-Physical - - PowerPoint PPT Presentation

09 reactions delays
SMART_READER_LITE
LIVE PREVIEW

09: Reactions & Delays 15-424: Foundations of Cyber-Physical - - PowerPoint PPT Presentation

09: Reactions & Delays 15-424: Foundations of Cyber-Physical Systems Andr e Platzer aplatzer@cs.cmu.edu Computer Science Department Carnegie Mellon University, Pittsburgh, PA 0.5 0.4 0.3 0.2 1.0 0.1 0.8 0.6 0.4 0.2 Andr e


slide-1
SLIDE 1

09: Reactions & Delays

15-424: Foundations of Cyber-Physical Systems Andr´ e Platzer

aplatzer@cs.cmu.edu Computer Science Department Carnegie Mellon University, Pittsburgh, PA

0.2 0.4 0.6 0.8 1.0

0.1 0.2 0.3 0.4 0.5

Andr´ e Platzer (CMU) FCPS / 09: Reactions & Delays 1 / 21

slide-2
SLIDE 2

Outline

1

Learning Objectives

2

Delays in Control Back to the Drawing Desk: Quantum the Ping Pong Ball Quantum the Time-triggered Ping Pong Ball The Impact of Delays on Events Cartesian Demon Predictive Control Design-by-Invariant Controlling the Control Points Short Invariants

3

Proof

4

Summary Zeno’s Quantum Turtles A Note on Assignments

Andr´ e Platzer (CMU) FCPS / 09: Reactions & Delays 2 / 21

slide-3
SLIDE 3

Outline

1

Learning Objectives

2

Delays in Control Back to the Drawing Desk: Quantum the Ping Pong Ball Quantum the Time-triggered Ping Pong Ball The Impact of Delays on Events Cartesian Demon Predictive Control Design-by-Invariant Controlling the Control Points Short Invariants

3

Proof

4

Summary Zeno’s Quantum Turtles A Note on Assignments

Andr´ e Platzer (CMU) FCPS / 09: Reactions & Delays 2 / 21

slide-4
SLIDE 4

Learning Objectives

Reactions & Delays

CT M&C CPS using loop invariants design time-triggered control design-by-invariant modeling CPS designing controls time-triggered control reaction delays discrete sensing semantics of time-triggered control

  • perational effect

finding control constraints model-predictive control

Andr´ e Platzer (CMU) FCPS / 09: Reactions & Delays 3 / 21

slide-5
SLIDE 5

Outline

1

Learning Objectives

2

Delays in Control Back to the Drawing Desk: Quantum the Ping Pong Ball Quantum the Time-triggered Ping Pong Ball The Impact of Delays on Events Cartesian Demon Predictive Control Design-by-Invariant Controlling the Control Points Short Invariants

3

Proof

4

Summary Zeno’s Quantum Turtles A Note on Assignments

Andr´ e Platzer (CMU) FCPS / 09: Reactions & Delays 3 / 21

slide-6
SLIDE 6

Quantum’s Ping Pong Proof Invariants

Proposition (Quantum can play ping pong safely)

0 ≤ x ∧ x ≤ 5 ∧ v ≤ 0 ∧ g > 0 ∧ 1 ≥ c ≥ 0 ∧ f ≥ 0 →

  • ((x′ = v, v′ = −g & x ≥ 0 ∧ x≤5) ∪ (x′ = v, v′ = −g & x≥5));

if(x=0) v := −cv else if(4≤x≤5∧v≥0) v := −fv ∗ (0≤x≤5) Proof @invariant(0≤x≤5 ∧ (x = 5 → v≤0))

Andr´ e Platzer (CMU) FCPS / 09: Reactions & Delays 4 / 21

slide-7
SLIDE 7

Quantum’s Ping Pong Proof Invariants

Proposition (Quantum can play ping pong safely)

0 ≤ x ∧ x ≤ 5 ∧ v ≤ 0 ∧ g > 0 ∧ 1 ≥ c ≥ 0 ∧ f ≥ 0 →

  • ((x′ = v, v′ = −g & x ≥ 0 ∧ x≤5) ∪ (x′ = v, v′ = −g & x≥5));

if(x=0) v := −cv else if(4≤x≤5∧v≥0) v := −fv ∗ (0≤x≤5) Proof @invariant(0≤x≤5 ∧ (x = 5 → v≤0)) Just can’t implement . . .

Andr´ e Platzer (CMU) FCPS / 09: Reactions & Delays 4 / 21

slide-8
SLIDE 8

Physical vs. Controller Events

Physical vs. Controller Events

1 Justifiable: Physical events (on ground x = 0) 2 Justifiable: Physical evolution domains (above ground x ≥ 0) 3 Questionable: Controller evolution domain (x ≤ 5) 4 Unlike physics, controllers won’t run all the time. Just often. Andr´ e Platzer (CMU) FCPS / 09: Reactions & Delays 5 / 21

slide-9
SLIDE 9

Back to the Drawing Desk: Quantum the Ping Pong Ball

Conjecture (Quantum can play ping pong safely)

0 ≤ x ∧ x ≤ 5 ∧ v ≤ 0 ∧ g > 0 ∧ 1 ≥ c ≥ 0 ∧ f ≥ 0 →

  • {x′ = v, v′ = −g & x ≥ 0};

if(x=0) v := −cv else if(4≤x≤5∧v≥0) v := −fv ∗ (0≤x≤5) Proof? Ask Ren´ e Descartes

Andr´ e Platzer (CMU) FCPS / 09: Reactions & Delays 6 / 21

slide-10
SLIDE 10

Back to the Drawing Desk: Quantum the Ping Pong Ball

Conjecture (Quantum can play ping pong safely)

0 ≤ x ∧ x ≤ 5 ∧ v ≤ 0 ∧ g > 0 ∧ 1 ≥ c ≥ 0 ∧ f ≥ 0 →

  • {x′ = v, v′ = −g & x ≥ 0};

if(x=0) v := −cv else if(4≤x≤5∧v≥0) v := −fv ∗ (0≤x≤5) Proof? Ask Ren´ e Descartes who says no! Could miss if-then event

Andr´ e Platzer (CMU) FCPS / 09: Reactions & Delays 6 / 21

slide-11
SLIDE 11

Back to the Drawing Desk: Quantum the Ping Pong Ball

Conjecture (Quantum can play ping pong safely)

0 ≤ x ∧ x ≤ 5 ∧ v ≤ 0 ∧ g > 0 ∧ 1 ≥ c ≥ 0 ∧ f ≥ 0 →

  • {x′ = v, v′ = −g & x ≥ 0 ∧ t≤1};

if(x=0) v := −cv else if(4≤x≤5∧v≥0) v := −fv ∗ (0≤x≤5) Proof?

Andr´ e Platzer (CMU) FCPS / 09: Reactions & Delays 6 / 21

slide-12
SLIDE 12

Back to the Drawing Desk: Quantum the Ping Pong Ball

Conjecture (Quantum can play ping pong safely)

0 ≤ x ∧ x ≤ 5 ∧ v ≤ 0 ∧ g > 0 ∧ 1 ≥ c ≥ 0 ∧ f ≥ 0 →

  • {x′ = v, v′ = −g, t′ = 1 & x ≥ 0 ∧ t≤1};

if(x=0) v := −cv else if(4≤x≤5∧v≥0) v := −fv ∗ (0≤x≤5) Proof?

Andr´ e Platzer (CMU) FCPS / 09: Reactions & Delays 6 / 21

slide-13
SLIDE 13

Back to the Drawing Desk: Quantum the Ping Pong Ball

Conjecture (Quantum can play ping pong safely)

0 ≤ x ∧ x ≤ 5 ∧ v ≤ 0 ∧ g > 0 ∧ 1 ≥ c ≥ 0 ∧ f ≥ 0 →

  • t := 0; {x′ = v, v′ = −g, t′ = 1 & x ≥ 0 ∧ t≤1};

if(x=0) v := −cv else if(4≤x≤5∧v≥0) v := −fv ∗ (0≤x≤5) Proof? Ask Ren´ e Descartes

Andr´ e Platzer (CMU) FCPS / 09: Reactions & Delays 6 / 21

slide-14
SLIDE 14

Quantum the Time-triggered Ping Pong Ball

Conjecture (Quantum can play ping pong safely)

0 ≤ x ∧ x ≤ 5 ∧ v ≤ 0 ∧ g > 0 ∧ 1 ≥ c ≥ 0 ∧ f ≥ 0 →

  • if(x=0) v := −cv else if(4≤x≤5∧v≥0) v := −fv;

t := 0; {x′ = v, v′ = −g, t′ = 1 & x ≥ 0 ∧ t≤1} ∗ (0≤x≤5) Proof? Ask Ren´ e Descartes Control before physics

Andr´ e Platzer (CMU) FCPS / 09: Reactions & Delays 7 / 21

slide-15
SLIDE 15

Quantum the Time-triggered Ping Pong Ball

Conjecture (Quantum can play ping pong safely)

0 ≤ x ∧ x ≤ 5 ∧ v ≤ 0 ∧ g > 0 ∧ 1 ≥ c ≥ 0 ∧ f ≥ 0 →

  • if(x=0) v := −cv else if(4≤x≤5∧v≥0) v := −fv;

t := 0; {x′ = v, v′ = −g, t′ = 1 & x ≥ 0 ∧ t≤1} ∗ (0≤x≤5) Proof? Ask Ren´ e Descartes Could act early or late

Andr´ e Platzer (CMU) FCPS / 09: Reactions & Delays 8 / 21

slide-16
SLIDE 16

Quantum the Time-triggered Ping Pong Ball

Conjecture (Quantum can play ping pong safely)

0 ≤ x ∧ x ≤ 5 ∧ v ≤ 0 ∧ g > 0 ∧ 1 ≥ c ≥ 0 ∧ f ≥ 0 →

  • if(x=0) v := −cv else if(4≤x≤5∧v≥0) v := −fv;

t := 0; {x′ = v, v′ = −g, t′ = 1 & x ≥ 0 ∧ t≤1} ∗ (0≤x≤5) Proof? Ask Ren´ e Descartes who says no! Could miss event off cycle

Andr´ e Platzer (CMU) FCPS / 09: Reactions & Delays 8 / 21

slide-17
SLIDE 17

Delays May Miss Events

Delays vs. Events

1 Periodically/frequently monitoring for an event with a polling

frequency / reaction time

2 Delays may make the controller miss events. 3 Discrepancy event-driven idea vs. real time-triggered implementation. 4 Slow controllers monitoring small regions of a fast moving system. 5 Issues indicate poor event abstraction 6 Controller need to be aware of its own delay Andr´ e Platzer (CMU) FCPS / 09: Reactions & Delays 9 / 21

slide-18
SLIDE 18

Cartesian Doubt: Ren´ e Descartes’s Cartesian Demon 1641

Outwit the Cartesian Demon

Skeptical about the truth of all beliefs until justification has been found.

Andr´ e Platzer (CMU) FCPS / 09: Reactions & Delays 10 / 21

slide-19
SLIDE 19

Quantum the Time-triggered Ping Pong Ball

Conjecture (Quantum can play ping pong safely)

0 ≤ x ∧ x ≤ 5 ∧ v ≤ 0 ∧ g > 0 ∧ 1 ≥ c ≥ 0 ∧ f ≥ 0 →

  • if(x=0) v := −cv else if(4≤x≤5∧v≥0) v := −fv;

t := 0; {x′ = v, v′ = −g, t′ = 1 & x ≥ 0 ∧ t≤1} ∗ (0≤x≤5) Proof? Ask Ren´ e Descartes who says no! Could miss event off cycle

Andr´ e Platzer (CMU) FCPS / 09: Reactions & Delays 11 / 21

slide-20
SLIDE 20

Quantum the Time-triggered Ping Pong Ball

Conjecture (Quantum can play ping pong safely)

0 ≤ x ∧ x ≤ 5 ∧ v ≤ 0 ∧ g = 1 ∧ 1 ≥ c ≥ 0 ∧ f ≥ 0 →

  • if(x=0) v := −cv else if(x>51

2−v∧v≥0) v := −fv;

t := 0; {x′ = v, v′ = −g, t′ = 1 & x ≥ 0 ∧ t≤1} ∗ (0≤x≤5) Proof? Ask Ren´ e Descartes predict: x + v − g

2 > 5

Andr´ e Platzer (CMU) FCPS / 09: Reactions & Delays 11 / 21

slide-21
SLIDE 21

Quantum the Time-triggered Ping Pong Ball

Conjecture (Quantum can play ping pong safely)

0 ≤ x ∧ x ≤ 5 ∧ v ≤ 0 ∧ g = 1 ∧ 1 ≥ c ≥ 0 ∧ f ≥ 0 →

  • if(x=0) v := −cv else if(x>51

2−v∧v≥0) v := −fv;

t := 0; {x′ = v, v′ = −g, t′ = 1 & x ≥ 0 ∧ t≤1} ∗ (0≤x≤5) Proof? Ask Ren´ e Descartes who says no! Safe after 1 s but not until then All depends on sampling

Andr´ e Platzer (CMU) FCPS / 09: Reactions & Delays 11 / 21

slide-22
SLIDE 22

Quantum the Time-triggered Ping Pong Ball

Conjecture (Quantum can play ping pong safely)

0 ≤ x ∧ x ≤ 5 ∧ v ≤ 0 ∧ g = 1 ∧ 1 ≥ c ≥ 0 ∧ f ≥ 0 →

  • if(x=0) v := −cv else if(x>51

2−v∧v≥0) v := −fv;

t := 0; {x′ = v, v′ = −g, t′ = 1 & x ≥ 0 ∧ t≤1} ∗ (0≤x≤5) Proof? Ask Ren´ e Descartes who says no! Safe after 1 s but not until then All depends on sampling

Andr´ e Platzer (CMU) FCPS / 09: Reactions & Delays 11 / 21

slide-23
SLIDE 23

Quantum Discovers Design-by-Invariant

Design-by-Invariant

2gx = 2gH − v2 ∧ x ≥ 0 ∧c = 1 ∧ g > 0 bouncing ball invariant

Andr´ e Platzer (CMU) FCPS / 09: Reactions & Delays 12 / 21

slide-24
SLIDE 24

Quantum Discovers Design-by-Invariant

Design-by-Invariant

2gx = 2gH − v2 ∧ x ≥ 0 ∧c = 1 ∧ g = 1 simplify arithmetic

Andr´ e Platzer (CMU) FCPS / 09: Reactions & Delays 12 / 21

slide-25
SLIDE 25

Quantum Discovers Design-by-Invariant

Design-by-Invariant

2x = 2H − v2 ∧ x ≥ 0

Andr´ e Platzer (CMU) FCPS / 09: Reactions & Delays 12 / 21

slide-26
SLIDE 26

Quantum Discovers Design-by-Invariant

Design-by-Invariant

2x = 2 · H − v2 ∧ x ≥ 0

Andr´ e Platzer (CMU) FCPS / 09: Reactions & Delays 12 / 21

slide-27
SLIDE 27

Quantum Discovers Design-by-Invariant

Design-by-Invariant

2x = 2 · 5 − v2 ∧ x ≥ 0 critical height

Andr´ e Platzer (CMU) FCPS / 09: Reactions & Delays 12 / 21

slide-28
SLIDE 28

Quantum Discovers Design-by-Invariant

Design-by-Invariant

2x > 2 · 5 − v2 ∧ x ≥ 0 potential exceeds safe height

Andr´ e Platzer (CMU) FCPS / 09: Reactions & Delays 12 / 21

slide-29
SLIDE 29

Quantum Discovers Design-by-Invariant

Design-by-Invariant

2x > 2 · 5 − v2 ∧ x ≥ 0 use invariant for control

Andr´ e Platzer (CMU) FCPS / 09: Reactions & Delays 12 / 21

slide-30
SLIDE 30

Quantum the Time-triggered Ping Pong Ball

Conjecture (Quantum can play ping pong safely)

0 ≤ x ∧ x ≤ 5 ∧ v ≤ 0 ∧ g = 1 ∧ 1 ≥ c ≥ 0 ∧ f ≥ 0 →

  • if(x=0) v := −cv else if((x>51

2−v ∨ 2x>2·5−v2)∧v≥0) v := −fv;

t := 0; {x′ = v, v′ = −g, t′ = 1 & x ≥ 0 ∧ t≤1} ∗ (0≤x≤5) Proof? Ask Ren´ e Descartes

Andr´ e Platzer (CMU) FCPS / 09: Reactions & Delays 13 / 21

slide-31
SLIDE 31

Quantum the Time-triggered Ping Pong Ball

Conjecture (Quantum can play ping pong safely)

0 ≤ x ∧ x ≤ 5 ∧ v ≤ 0 ∧ g = 1 ∧ 1 = c ∧ f = 1 →

  • if(x=0) v := −cv else if((x>51

2−v ∨ 2x>2·5−v2)∧v≥0) v := −fv;

t := 0; {x′ = v, v′ = −g, t′ = 1 & x ≥ 0 ∧ t≤1} ∗ (0≤x≤5) Proof? Ask Ren´ e Descartes

Andr´ e Platzer (CMU) FCPS / 09: Reactions & Delays 13 / 21

slide-32
SLIDE 32

Quantum the Time-triggered Ping Pong Ball

Conjecture (Quantum can play ping pong safely)

0 ≤ x ∧ x ≤ 5 ∧ v ≤ 0 ∧ g = 1 ∧ 1 = c ∧ f = 1 →

  • if(x=0) v := −cv else if((x>51

2−v ∨ 2x>2·5−v2)∧v≥0) v := −fv;

t := 0; {x′ = v, v′ = −g, t′ = 1 & x ≥ 0 ∧ t≤1} ∗ (0≤x≤5) Proof? Ask Ren´ e Descartes who says no! No control near ground

Andr´ e Platzer (CMU) FCPS / 09: Reactions & Delays 13 / 21

slide-33
SLIDE 33

Quantum the Time-triggered Ping Pong Ball

Conjecture (Quantum can play ping pong safely)

0 ≤ x ∧ x ≤ 5 ∧ v ≤ 0 ∧ g = 1 ∧ 1 = c ∧ f = 1 →

  • if(x=0) v := −cv; if((x>51

2−v ∨ 2x>2·5−v2)∧v≥0) v := −fv;

t := 0; {x′ = v, v′ = −g, t′ = 1 & x ≥ 0 ∧ t≤1} ∗ (0≤x≤5) Proof? Ask Ren´ e Descartes Control despite ground

Andr´ e Platzer (CMU) FCPS / 09: Reactions & Delays 14 / 21

slide-34
SLIDE 34

Quantum the Time-triggered Ping Pong Ball

Conjecture (Quantum can play ping pong safely)

0 ≤ x ∧ x ≤ 5 ∧ v ≤ 0 ∧ g = 1 ∧ 1 = c ∧ f = 1 →

  • if(x=0) v := −cv; if((x>51

2−v ∨ 2x>2·5−v2)∧v≥0) v := −fv;

t := 0; {x′ = v, v′ = −g, t′ = 1 & x ≥ 0 ∧ t≤1} ∗ (0≤x≤5) Proof? Ask Ren´ e Descartes who says yes

Andr´ e Platzer (CMU) FCPS / 09: Reactions & Delays 15 / 21

slide-35
SLIDE 35

Quantum the Time-triggered Ping Pong Ball

Conjecture (Quantum can play ping pong safely)

0 ≤ x ∧ x ≤ 5 ∧ v ≤ 0 ∧ g = 1 ∧ 1 = c ∧ f = 1 →

  • if(x=0) v := −cv; if((x>51

2−v ∨ 2x>2·5−v2)∧v≥0) v := −fv;

t := 0; {x′ = v, v′ = −g, t′ = 1 & x ≥ 0 ∧ t≤1} ∗ (0≤x≤5) Proof? Ask Ren´ e Descartes who says yes but should have said no!

Andr´ e Platzer (CMU) FCPS / 09: Reactions & Delays 15 / 21

slide-36
SLIDE 36

Quantum the Time-triggered Ping Pong Ball

Conjecture (Quantum can play ping pong safely)

0 ≤ x ∧ x ≤ 5 ∧ v ≤ 0 ∧ g = 1 ∧ 1 = c ∧ f = 1 →

  • if(x=0) v := −cv; if((x>51

2−v ∨ 2x>2·5−v2)∧v≥0) v := −fv;

t := 0; {x′ = v, v′ = −g, t′ = 1 & x ≥ 0 ∧ t≤1} ∗ (0≤x≤5) Proof? Ask Ren´ e Descartes who says yes but should have said no! Invariants are invariants! True ever ❀ true initially

Andr´ e Platzer (CMU) FCPS / 09: Reactions & Delays 15 / 21

slide-37
SLIDE 37

Quantum the Time-triggered Ping Pong Ball

Conjecture (Quantum can play ping pong safely)

0 ≤ x ∧ x ≤ 5 ∧ v ≤ 0 ∧ g = 1 ∧ 1 = c ∧ f = 1 →

  • if(x=0) v := −cv; if((x>51

2−v ∨ 2x>2·5−v2∧v<1)∧v≥0) v := −fv;

t := 0; {x′ = v, v′ = −g, t′ = 1 & x ≥ 0 ∧ t≤1} ∗ (0≤x≤5) Proof? Ask Ren´ e Descartes Slow turn around v(t) = v−gt = v−t < 0

Andr´ e Platzer (CMU) FCPS / 09: Reactions & Delays 15 / 21

slide-38
SLIDE 38

Quantum the Time-triggered Ping Pong Ball

Conjecture (Quantum can play ping pong safely)

0 ≤ x ∧ x ≤ 5 ∧ v ≤ 0 ∧ g = 1 ∧ 1 = c ∧ f = 1 →

  • if(x=0) v := −cv; if((x>51

2−v ∨ 2x>2·5−v2∧v<1)∧v≥0) v := −fv;

t := 0; {x′ = v, v′ = −g, t′ = 1 & x ≥ 0 ∧ t≤1} ∗ (0≤x≤5) Proof? Ask Ren´ e Descartes who says yes

Andr´ e Platzer (CMU) FCPS / 09: Reactions & Delays 15 / 21

slide-39
SLIDE 39

Outline

1

Learning Objectives

2

Delays in Control Back to the Drawing Desk: Quantum the Ping Pong Ball Quantum the Time-triggered Ping Pong Ball The Impact of Delays on Events Cartesian Demon Predictive Control Design-by-Invariant Controlling the Control Points Short Invariants

3

Proof

4

Summary Zeno’s Quantum Turtles A Note on Assignments

Andr´ e Platzer (CMU) FCPS / 09: Reactions & Delays 15 / 21

slide-40
SLIDE 40

Quantum’s Time-triggered Ping Pong Proof Invariants

Proposition (Quantum can play ping pong safely in real-time)

0 ≤ x ∧ x ≤ 5 ∧ v ≤ 0 ∧ g=1>0 ∧ 1=c≥0 ∧ 1=f ≥0 →

  • if(x=0) v := −cv; if((x>51

2−v ∨ 2x>2·5−v2∧v<1)∧v≥0) v := −fv;

t := 0; (x′ = v, v′ = −g, t′ = 1 & x ≥ 0 ∧ t ≤ 1) ∗ (0≤x≤5) Proof

Andr´ e Platzer (CMU) FCPS / 09: Reactions & Delays 16 / 21

slide-41
SLIDE 41

Quantum’s Time-triggered Ping Pong Proof Invariants

Proposition (Quantum can play ping pong safely in real-time)

0 ≤ x ∧ x ≤ 5 ∧ v ≤ 0 ∧ g=1>0 ∧ 1=c≥0 ∧ 1=f ≥0 →

  • if(x=0) v := −cv; if((x>51

2−v ∨ 2x>2·5−v2∧v<1)∧v≥0) v := −fv;

t := 0; (x′ = v, v′ = −g, t′ = 1 & x ≥ 0 ∧ t ≤ 1) ∗ (0≤x≤5) Proof @invariant(2x = 2H − v2 ∧ x ≥ 0 ∧ x≤5)

Andr´ e Platzer (CMU) FCPS / 09: Reactions & Delays 16 / 21

slide-42
SLIDE 42

Quantum’s Time-triggered Ping Pong Proof Invariants

Proposition (Quantum can play ping pong safely in real-time)

2x = 2H − v2 ∧ 0 ≤ x ∧ x ≤ 5 ∧ v ≤ 0 ∧ g=1>0 ∧ 1=c≥0 ∧ 1=f ≥0 →

  • if(x=0) v := −cv; if((x>51

2−v ∨ 2x>2·5−v2∧v<1)∧v≥0) v := −fv;

t := 0; (x′ = v, v′ = −g, t′ = 1 & x ≥ 0 ∧ t ≤ 1) ∗ (0≤x≤5) Proof @invariant(2x = 2H − v2 ∧ x ≥ 0 ∧ x≤5)

Andr´ e Platzer (CMU) FCPS / 09: Reactions & Delays 16 / 21

slide-43
SLIDE 43

Outline

1

Learning Objectives

2

Delays in Control Back to the Drawing Desk: Quantum the Ping Pong Ball Quantum the Time-triggered Ping Pong Ball The Impact of Delays on Events Cartesian Demon Predictive Control Design-by-Invariant Controlling the Control Points Short Invariants

3

Proof

4

Summary Zeno’s Quantum Turtles A Note on Assignments

Andr´ e Platzer (CMU) FCPS / 09: Reactions & Delays 16 / 21

slide-44
SLIDE 44

Summary: Time-triggered Control

1 Common paradigm for designing real controllers 2 Periodical or pseudo-periodical control (jitter) 3 Expects delays, expects inertia 4 Implementation: discrete-time sensing 5 Predict events, not just if(eventnow(x)) . . . 6 Safe controllers know their own reaction delays 7 Burden of event detection brought to attention of CPS programmer 8 Time-triggered controls are implementable and more robust,

but make design and verification more challenging!

9 Use knowledge gained from verified event-triggered model as a basis

for designing a time-triggered controller

Andr´ e Platzer (CMU) FCPS / 09: Reactions & Delays 17 / 21

slide-45
SLIDE 45

How Quantum Met Achilles and His Tortoise

Example (Quantum the Bouncing Ball)

  • x′ = v, v′ = −g & x ≥ 0;

if(x = 0) v := −cv ∗

Andr´ e Platzer (CMU) FCPS / 09: Reactions & Delays 18 / 21

slide-46
SLIDE 46

How Quantum Met Achilles and His Tortoise

t x j 2 4 6 8 10 12 t0 t1 t2 t3 t4 t5 t6

Example (Quantum the Bouncing Ball)

  • x′ = v, v′ = −g & x ≥ 0;

if(x = 0) v := −cv ∗

Andr´ e Platzer (CMU) FCPS / 09: Reactions & Delays 18 / 21

slide-47
SLIDE 47

How Quantum Met Achilles and His Tortoise

t x j 2 4 6 8 10 12 t0 t1 t2 t3 t4 t5 t6

t j 1 2 3 4 5 6 7 8 9 10 11 12 t0 t1 t2 t3 t4 t5 t6

Example (Quantum the Bouncing Ball)

  • x′ = v, v′ = −g & x ≥ 0;

if(x = 0) v := −cv ∗

Andr´ e Platzer (CMU) FCPS / 09: Reactions & Delays 18 / 21

slide-48
SLIDE 48

How Quantum Met Achilles and His Tortoise

t x j 2 4 6 8 10 12 t0 t1 t2 t3 t4 t5 t6

t j 1 2 3 4 5 6 7 8 9 10 11 12 t0 t1 t2 t3 t4 t5 t6

Example (Quantum the Bouncing Ball experiences time)

1 + 1 2 + 1 4 + 1 8 + . . .

Andr´ e Platzer (CMU) FCPS / 09: Reactions & Delays 18 / 21

slide-49
SLIDE 49

How Quantum Met Achilles and His Tortoise

t x j 2 4 6 8 10 12 t0 t1 t2 t3 t4 t5 t6

t j 1 2 3 4 5 6 7 8 9 10 11 12 t0 t1 t2 t3 t4 t5 t6

Example (Quantum the Bouncing Ball experiences time)

1 + 1 2 + 1 4 + 1 8 + . . . =

  • i=0

1 2i

Andr´ e Platzer (CMU) FCPS / 09: Reactions & Delays 18 / 21

slide-50
SLIDE 50

How Quantum Met Achilles and His Tortoise

t x j 2 4 6 8 10 12 t0 t1 t2 t3 t4 t5 t6

t j 1 2 3 4 5 6 7 8 9 10 11 12 t0 t1 t2 t3 t4 t5 t6

Example (Quantum the Bouncing Ball experiences time)

1 + 1 2 + 1 4 + 1 8 + . . . =

  • i=0

1 2i = 1 1 − 1

2

Andr´ e Platzer (CMU) FCPS / 09: Reactions & Delays 18 / 21

slide-51
SLIDE 51

How Quantum Met Achilles and His Tortoise

t x j 2 4 6 8 10 12 t0 t1 t2 t3 t4 t5 t6

t j 1 2 3 4 5 6 7 8 9 10 11 12 t0 t1 t2 t3 t4 t5 t6

Example (Quantum the Bouncing Ball experiences time)

1 + 1 2 + 1 4 + 1 8 + . . . =

  • i=0

1 2i = 1 1 − 1

2

= 2

Andr´ e Platzer (CMU) FCPS / 09: Reactions & Delays 18 / 21

slide-52
SLIDE 52

How Quantum Met Achilles and His Tortoise

t x j 2 4 6 8 10 12 t0 t1 t2 t3 t4 t5 t6

t j 1 2 3 4 5 6 7 8 9 10 11 12 t0 t1 t2 t3 t4 t5 t6

Example (Quantum the Bouncing Ball experiences time)

1 + 1 2 + 1 4 + 1 8 + . . . =

  • i=0

1 2i = 1 1 − 1

2

= 2 < ∞

Andr´ e Platzer (CMU) FCPS / 09: Reactions & Delays 18 / 21

slide-53
SLIDE 53

How Quantum Met Achilles and His Tortoise

t x j 2 4 6 8 10 12 t0 t1 t2 t3 t4 t5 t6

t j 1 2 3 4 5 6 7 8 9 10 11 12 t0 t1 t2 t3 t4 t5 t6

Example (Quantum the Bouncing Ball experiences time)

1 + 1 2 + 1 4 + 1 8 + . . . =

  • i=0

1 2i = 1 1 − 1

2

= 2 < ∞

Andr´ e Platzer (CMU) FCPS / 09: Reactions & Delays 18 / 21

slide-54
SLIDE 54

How Quantum Met Achilles and His Tortoise

t x j 2 4 6 8 10 12 t0 t1 t2 t3 t4 t5 t6

Example (Quantum the Bouncing Ball experiences time)

1 + 1 2 + 1 4 + 1 8 + . . . =

  • i=0

1 2i = 1 1 − 1

2

= 2 < ∞

Andr´ e Platzer (CMU) FCPS / 09: Reactions & Delays 18 / 21

slide-55
SLIDE 55

How Quantum Met Achilles and His Tortoise

t x j 2 4 6 8 10 12 t0 t1 t2 t3 t4 t5 t6

I don’t exist

Example (Quantum the Bouncing Ball experiences time)

1 + 1 2 + 1 4 + 1 8 + . . . =

  • i=0

1 2i = 1 1 − 1

2

= 2 < ∞

Andr´ e Platzer (CMU) FCPS / 09: Reactions & Delays 18 / 21

slide-56
SLIDE 56

How Quantum Met Achilles and His Tortoise

t x j 2 4 6 8 10 12 t0 t1 t2 t3 t4 t5 t6

I don’t exist

Example (Quantum the Bouncing Ball experiences time)

1 + 1 2 + 1 4 + 1 8 + . . . =

  • i=0

1 2i = 1 1 − 1

2

= 2 < ∞

Andr´ e Platzer (CMU) FCPS / 09: Reactions & Delays 19 / 21

slide-57
SLIDE 57

How Quantum Met Achilles and His Tortoise

t x j 2 4 6 8 10 12 t0 t1 t2 t3 t4 t5 t6

t j 1 2 3 4 5 6 7 8 9 10 11 12 t0 t1 t2 t3 t4 t5 t6

Example (Quantum the Bouncing Ball experiences time)

1 + 1 2 + 1 4 + 1 8 + . . . =

  • i=0

1 2i = 1 1 − 1

2

= 2 < ∞ Zeno Paradox Quantum’s model causes a time freeze

Andr´ e Platzer (CMU) FCPS / 09: Reactions & Delays 19 / 21

slide-58
SLIDE 58

What to do with assignments

[x:=e]p(x) ↔ p(e) [x:=x2]x = 0 ↔ x2 = 0 e❀x2, p(·)❀· = 0 [x:=e]p(x) ↔ p(e) [x:=x2][y:=2x]x>0 ↔ [y:=2x2]x2>0 e❀x2, p(·)❀[y:=2·](·>0) [x:=e]p(x) ↔ p(e) [x:=x2]x = x ↔ x2 = x e❀x2, p(·)❀· = x [x:=e]p(x) ↔ p(e) [x:=5y][y:=2x](x>0) ↔ [y:=2(5y)](5y>0) e❀5y, p(·)❀[y:=2·](·>0) [x:=e]p(x) ↔ p(e) [x:=x2][x′ = 2x]x>0 ↔ [x′ = 2x2]x2>0 e❀x2, p(·)❀[·′ = 2·] · >0 [x:=e]p(x) ↔ p(e) [x:=x2][(x:=x+1)∗]x≥0 ↔ [(x:=x2+1)∗]x2≥0 e❀x2, p(·)❀[(x:= · +1)∗] ·

Andr´ e Platzer (CMU) FCPS / 09: Reactions & Delays 20 / 21

slide-59
SLIDE 59

What to do with assignments and what not to do!

[x:=e]p(x) ↔ p(e) [x:=x2]x = 0 ↔ x2 = 0 e❀x2, p(·)❀· = 0 [x:=e]p(x) ↔ p(e) [x:=x2][y:=2x]x>0 ↔ [y:=2x2]x2>0 e❀x2, p(·)❀[y:=2·](·>0) [x:=e]p(x) ↔ p(e) [x:=x2]x = x ↔ x2 = x e❀x2, p(·)❀· = x [x:=e]p(x) ↔ p(e) [x:=5y][y:=2x](x>0) ↔ [y:=2(5y)](5y>0) e❀5y, p(·)❀[y:=2·](·>0) [x:=e]p(x) ↔ p(e) [x:=x2][x′ = 2x]x>0 ↔ [x′ = 2x2]x2>0 e❀x2, p(·)❀[·′ = 2·] · >0 [x:=e]p(x) ↔ p(e) [x:=x2][(x:=x+1)∗]x≥0 ↔ [(x:=x2+1)∗]x2≥0 e❀x2, p(·)❀[(x:= · +1)∗] ·

Andr´ e Platzer (CMU) FCPS / 09: Reactions & Delays 20 / 21

slide-60
SLIDE 60

What else to do with assignments

[:=] [x := e]p(x) ↔ p(e) Γ, x = e ⊢ P, ∆ Γ ⊢ [x:=e]P, ∆

Andr´ e Platzer (CMU) FCPS / 09: Reactions & Delays 21 / 21

slide-61
SLIDE 61

What else to do with assignments and what not to do!

[:=] [x := e]p(x) ↔ p(e) Γ, x = e ⊢ P, ∆ Γ ⊢ [x:=e]P, ∆ if x ∈ Γ, ∆

Andr´ e Platzer (CMU) FCPS / 09: Reactions & Delays 21 / 21

slide-62
SLIDE 62

Andr´ e Platzer. Foundations of cyber-physical systems. Lecture Notes 15-424/624, Carnegie Mellon University, 2016. URL: http://www.cs.cmu.edu/~aplatzer/course/fcps16.html. Andr´ e Platzer. Logical Analysis of Hybrid Systems: Proving Theorems for Complex Dynamics. Springer, Heidelberg, 2010. doi:10.1007/978-3-642-14509-4.

Andr´ e Platzer (CMU) FCPS / 09: Reactions & Delays 21 / 21