09 reactions delays
play

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


  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.5 0.4 0.3 0.2 1.0 0.1 0.8 0.6 0.4 0.2 Andr´ e Platzer (CMU) FCPS / 09: Reactions & Delays 1 / 21

  2. Outline Learning Objectives 1 Delays in Control 2 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 Proof 3 Summary 4 Zeno’s Quantum Turtles A Note on Assignments Andr´ e Platzer (CMU) FCPS / 09: Reactions & Delays 2 / 21

  3. Outline Learning Objectives 1 Delays in Control 2 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 Proof 3 Summary 4 Zeno’s Quantum Turtles A Note on Assignments Andr´ e Platzer (CMU) FCPS / 09: Reactions & Delays 2 / 21

  4. Learning Objectives Reactions & Delays using loop invariants design time-triggered control design-by-invariant CT M&C CPS modeling CPS semantics of time-triggered control designing controls operational effect time-triggered control finding control constraints reaction delays model-predictive control discrete sensing Andr´ e Platzer (CMU) FCPS / 09: Reactions & Delays 3 / 21

  5. Outline Learning Objectives 1 Delays in Control 2 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 Proof 3 Summary 4 Zeno’s Quantum Turtles A Note on Assignments Andr´ e Platzer (CMU) FCPS / 09: Reactions & Delays 3 / 21

  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) @invariant (0 ≤ x ≤ 5 ∧ ( x = 5 → v ≤ 0)) Proof Andr´ e Platzer (CMU) FCPS / 09: Reactions & Delays 4 / 21

  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) @invariant (0 ≤ x ≤ 5 ∧ ( x = 5 → v ≤ 0)) Proof Just can’t implement . . . Andr´ e Platzer (CMU) FCPS / 09: Reactions & Delays 4 / 21

  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

  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) Ask Ren´ e Descartes Proof? Andr´ e Platzer (CMU) FCPS / 09: Reactions & Delays 6 / 21

  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) Ask Ren´ e Descartes who says no! Proof? Could miss if-then event Andr´ e Platzer (CMU) FCPS / 09: Reactions & Delays 6 / 21

  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

  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

  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) Ask Ren´ e Descartes Proof? Andr´ e Platzer (CMU) FCPS / 09: Reactions & Delays 6 / 21

  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) Ask Ren´ e Descartes Proof? Control before physics Andr´ e Platzer (CMU) FCPS / 09: Reactions & Delays 7 / 21

  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) Ask Ren´ e Descartes Proof? Could act early or late Andr´ e Platzer (CMU) FCPS / 09: Reactions & Delays 8 / 21

  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) Ask Ren´ e Descartes who says no! Proof? Could miss event off cycle Andr´ e Platzer (CMU) FCPS / 09: Reactions & Delays 8 / 21

  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

  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

  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) Ask Ren´ e Descartes who says no! Proof? Could miss event off cycle Andr´ e Platzer (CMU) FCPS / 09: Reactions & Delays 11 / 21

  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 > 5 1 �� 2 − v ∧ v ≥ 0) v := − fv ; t := 0; { x ′ = v , v ′ = − g , t ′ = 1 & x ≥ 0 ∧ t ≤ 1 } � ∗ � (0 ≤ x ≤ 5) Ask Ren´ e Descartes Proof? predict: x + v − g 2 > 5 Andr´ e Platzer (CMU) FCPS / 09: Reactions & Delays 11 / 21

  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 > 5 1 �� 2 − v ∧ v ≥ 0) v := − fv ; t := 0; { x ′ = v , v ′ = − g , t ′ = 1 & x ≥ 0 ∧ t ≤ 1 } � ∗ � (0 ≤ x ≤ 5) Ask Ren´ e Descartes who says no! Proof? Safe after 1 s but not until then All depends on sampling Andr´ e Platzer (CMU) FCPS / 09: Reactions & Delays 11 / 21

Recommend


More recommend