Spring CS 599. Instructor: Jyo Deshmukh

Slides:



Advertisements
Similar presentations
Reactive and Potential Field Planners
Advertisements

Sensor Based Planners Bug algorithms.
Timed Automata.
INTRODUCTION & RECTILINEAR KINEMATICS: CONTINUOUS MOTION (Sections 12
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
Lecture #1 Hybrid systems are everywhere: Examples João P. Hespanha University of California at Santa Barbara Hybrid Control and Switched Systems.
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
A De-coupled Sliding Mode Controller and Observer for Satellite Attitude Control Ronald Fenton.
עקיבה אחר מטרה נעה Stable tracking control method for a mobile robot מנחה : ולדיסלב זסלבסקי מציגים : רונן ניסים מרק גרינברג.
Some Fundamentals of Stability Theory
Kinematics of Particles Lecture II. Subjects Covered in Kinematics of Particles Rectilinear motion Curvilinear motion Rectangular coords n-t coords Polar.
Free Fall Lecture 3.
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
October 8, 2013Computer Vision Lecture 11: The Hough Transform 1 Fitting Curve Models to Edges Most contours can be well described by combining several.
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
Lecture #11 Stability of switched system: Arbitrary switching João P. Hespanha University of California at Santa Barbara Hybrid Control and Switched Systems.
Kinematics of Particles Lecture II. Subjects Covered in Kinematics of Particles Rectilinear motion Curvilinear motion Rectangular coords n-t coords Polar.
AUTOMATIC CONTROL THEORY II Slovak University of Technology Faculty of Material Science and Technology in Trnava.
Lecture #14 Computational methods to construct multiple Lyapunov functions & Applications João P. Hespanha University of California at Santa Barbara Hybrid.
City College of New York 1 John (Jizhong) Xiao Department of Electrical Engineering City College of New York Mobile Robot Control G3300:
Optimal Path Planning Using the Minimum-Time Criterion by James Bobrow Guha Jayachandran April 29, 2002.
Chapter 2-OPTIMIZATION G.Anuradha. Contents Derivative-based Optimization –Descent Methods –The Method of Steepest Descent –Classical Newton’s Method.
Lecture #7 Stability and convergence of ODEs João P. Hespanha University of California at Santa Barbara Hybrid Control and Switched Systems NO CLASSES.
Kinematics of Particles Lecture II. Subjects Covered in Kinematics of Particles Rectilinear motion Curvilinear motion Rectangular coords n-t coords Polar.
Ch 9.6: Liapunov’s Second Method In Section 9.3 we showed how the stability of a critical point of an almost linear system can usually be determined from.
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
APPLICATIONS OF DIFFERENTIATION Antiderivatives In this section, we will learn about: Antiderivatives and how they are useful in solving certain.
Understanding Complex Systems May 15, 2007 Javier Alcazar, Ph.D.
ConcepTest 2.1 Walking the Dog
Trajectory Generation
12 Vector-Valued Functions
Introduction & Rectilinear Kinematics:
Boyce/DiPrima 9th ed, Ch 9.6: Liapunov’s Second Method Elementary Differential Equations and Boundary Value Problems, 9th edition, by William E. Boyce.
Control Design and Analysis of Chained Systems
Instructor: Rajeev Alur
Chapter 3 Kinetics in Two or Three Dimensions, Vectors (1 week)
§7-4 Lyapunov Direct Method
Autonomous Cyber-Physical Systems: Basics of Verification
Autonomous Cyber-Physical Systems: Basics of Control
Fitting Curve Models to Edges
Autonomous Cyber-Physical Systems: Synchronous Components: II
Rotation As you come in, please set clicker to channel 44 and then answer the following question (before the lecture starts). Quiz – You are building.
Spring CS 599. Instructor: Jyo Deshmukh
Autonomous Cyber-Physical Systems: Dynamical Systems
Physics 111: Mechanics Lecture 2
Unit 5: Conservation of Angular Momentum
Motion in One Dimension
PHYS 1443 – Section 003 Lecture #19
Physics 11a.
Spring CS 599. Instructor: Jyo Deshmukh
Inverse Kinematics 12/30/2018.
Modern Control Systems (MCS)
Kinematics of Particles
RECTILINEAR KINEMATICS: CONTINUOUS MOTION
Lecture #10 Switched systems
Probabilistic Map Based Localization
Stability Analysis of Linear Systems
Vectors & Equilibrium Sara sultan 07/04/2019.
Physics 111: Mechanics Lecture 2
Autonomous Cyber-Physical Systems: Probabilistic Models
Chapter 4 . Trajectory planning and Inverse kinematics
Motion Planning for a Point Robot (1/2)
Introduction to Artificial Intelligence Lecture 22: Computer Vision II
Chapter 7 Inverse Dynamics Control
ECE 576 POWER SYSTEM DYNAMICS AND STABILITY
Presentation transcript:

Spring 2018. CS 599. Instructor: Jyo Deshmukh Autonomous Cyber-Physical Systems: Stability, Modeling with Hybrid Systems Spring 2018. CS 599. Instructor: Jyo Deshmukh Acknowledgment: Some of the material in these slides is based on the lecture slides for CIS 540: Principles of Embedded Computation taught by Rajeev Alur at the University of Pennsylvania. http://www.seas.upenn.edu/~cis540/ This lecture also uses some other sources, full bibliography is included at the end of the slides.

Layout Stability Analysis Hybrid Dynamical Systems Probabilistic Models

Nonlinear Dynamical System Simple Pendulum Arc length 𝑠=ℓ𝜃 Linear velocity: 𝑣= 𝑑𝑠 𝑑𝑡 =ℓ 𝑑𝜃 𝑑𝑡 Linear acceleration: 𝑎= 𝑑𝑣 𝑑𝑡 =ℓ 𝑑 2 𝜃 𝑑 𝑡 2 𝐹=𝑚𝑎=−𝑚𝑔 sin 𝜃 −𝑏 𝜃 ℓ 𝑑 2 𝜃 𝑑 𝑡 2 =−𝑔 sin 𝜃 − 𝑏 𝑚 𝑑𝜃 𝑑𝑡 𝜃 ℓ 𝑚𝑔 sin 𝜃 Friction 𝑚𝑔 cos 𝜃 𝑚𝑔

Simple Pendulum Dynamics Let 𝑥 1 =𝜃, 𝑥 2 = 𝜃 , and let ℓ=𝑔, and 𝑏 𝑚ℓ =𝑘 Rewriting previous equation: 𝑥 1 = 𝑥 2 𝑥 2 =− sin 𝑥 1 −𝑘 𝑥 2 For small angles, the above equation is almost linear (replace sin 𝑥 1 by 𝑥 1 ), and we can use techniques for linear systems to show stability But, for any larger angle (less than 𝜋 𝑐 ), we know the pendulum eventually stops How do we show pendulum system is stable? Use my method!!

Lyapunov’s first method Given 𝐱 =𝑓 𝐱 = 𝑓 1 𝐱 ⋮ 𝑓 𝑛 (𝐱) , Step 1: find the Jacobian matrix for 𝑓(𝐱) 𝐽 𝑓 = 𝜕 𝑓 1 𝜕 𝑥 1 … 𝜕 𝑓 1 𝜕 𝑥 𝑛 ⋮ ⋱ ⋮ 𝜕 𝑓 𝑛 𝜕 𝑥 1 … 𝜕 𝑓 𝑛 𝜕 𝑥 𝑛 Step 2: Set 𝐱= 𝐱 ∗ in 𝐽(𝑓) to get a matrix in ℝ 𝑛×𝑛 (say 𝐴) If linear system 𝐱 =𝐴𝐱, is stable, original nonlinear system is stable locally at the equilibrium point. (Local = exists some neighborhood of equilibrium point)

Lyapunov’s first method for pendulum Dynamics: 𝑥 1 = 𝑥 2 ; 𝑥 2 =− sin 𝑥 1 −𝑘 𝑥 2 𝑓= 𝑥 2 −sin 𝑥 1 −𝑘 𝑥 2 Step 1: 𝐽 𝑓 = 0 1 −cos 𝑥 1 −𝑘 Step 2: 𝐽 𝑓 ​ 𝐱=(0,0) = 0 1 −1 −𝑘 =𝐴 Step 3: Eigenvalues 𝜆 of 𝐴 satisfy 𝜆 2 +𝑘𝜆+1=0 ⇒ both eigenvalues have negative real parts Pendulum is locally stable

Lyapunov’s second method Method to prove global stability Relies on notion of Lyapunov Functions Intuition: Find Lyapunov function 𝑉(𝐱) that could be interpreted as the energy of the system Stable systems eventually lose their energy and return to the quiescent state Prove that the energy of the system (as encoded by the Lyapunov function) decreases over time

Lyapunov’s Second Method: the math Assume w.l.o.g., that equilibrium point 𝐱* is at the origin, i.e. 0 𝑉(𝐱) is a Lyapunov function over the domain 𝐷 iff: ∀𝐱∈𝐷−{𝟎} : 𝑉 𝐱 >0 [Positivity condition] ∀𝐱∈𝐷− 𝟎 : 𝑑 𝑑𝑡 𝑉 𝐱 ≤0 [Derivative negativity condition] if 𝐱=𝟎: 𝑉 𝐱 =0, 𝑑 𝑑𝑡 𝑉 𝐱 =0 System 𝐱 =𝑓(𝐱) is stable in the sense of Lyapunov if such a 𝑉(𝐱) exists

Illustration and Lie-derivative 𝑉(𝐱) decreases as system evolves, i.e. for every pair of points 𝐚,𝐛 along a system trajectory, 𝑉 𝐚 ≥𝑉 𝐛 In other words, 𝑉(𝐱 t ) is a decreasing function in time, or its derivative is negative semi-definite 𝑉 𝐱 is called Lie derivative of 𝑉 By chain-rule, 𝑉 𝐱 = 𝜕𝑉 𝜕𝑥 𝑑𝐱 𝑑𝑡 = 𝜕𝑉 𝜕𝑥 𝑓(𝐱) 𝑥 2 𝐱(0) 𝟎 𝑥 1 𝐚 𝑉(𝐚) ≥ 𝐛 𝑉(𝐛)

Lyapunov’s second method for pendulum Choose Lyapunov function 𝑉 𝐱 =(1−cos 𝑥 1 ) + 1 2 𝑥 2 2 Consider 𝐷= − 𝜋 2 , 𝜋 2 × −1,1 ; recall, 𝑓= 𝑥 2 −sin 𝑥 1 −𝑘 𝑥 2 By observation, 𝑉 𝐱 >0, except at 𝟎, where it is 0 Let’s look at the Lie derivative 𝜕𝑉 𝜕𝑥 𝑓 𝐱 = sin 𝑥 1 𝑥 2 𝑥 2 −sin 𝑥 1 −𝑘 𝑥 2 = 𝑥 2 sin 𝑥 1 − 𝑥 2 sin 𝑥 1 −𝑘 𝑥 2 2 = 𝑥 2 sin 𝑥 1 − 𝑥 2 sin 𝑥 1 −𝑘 𝑥 2 2 =−𝑘 𝑥 2 2 ≤0

Second method for asymptotic/exponential stability 𝑉(𝐱) is a Lyapunov function over the domain 𝐷 iff: ∀𝐱∈𝐷−{𝟎} : 𝑉 𝐱 >0 [Positivity condition] ∀𝐱∈𝐷− 𝟎 : 𝑑 𝑑𝑡 𝑉 𝐱 ≤0 [Derivative negativity condition] if 𝐱=𝟎: 𝑉 𝐱 =0, 𝑑 𝑑𝑡 𝑉 𝐱 =0 System 𝐱 =𝑓(𝐱) is stable in the sense of Lyapunov if such a 𝑉(𝐱) exists Asymptotic stability: Change second condition to: ∀𝐱∈𝐷− 𝟎 : 𝑑 𝑑𝑡 𝑉 𝐱 <0 [Derivative negativity condition] Exponential stability: Change second condition to: ∀𝐱∈𝐷− 𝟎 : 𝑑 𝑑𝑡 𝑉 𝐱 <−𝛼‖𝐱‖ or ∀𝐱∈𝐷− 𝟎 : 𝑑 𝑑𝑡 𝑉 𝐱 <−𝛼𝑉(𝐱)

Challenges with Lyapunov’s second method How do we find a Lyapunov function? Maybe use the physics of the system to understand what encodes “energy” For certain nonlinear systems (those with polynomial dynamics), can some algorithmic methods In general a hard problem Yet, is a powerful approach to prove global stability

Bounded signals ‖𝑥‖ A signal 𝐱 is bounded if there is a constant 𝑐, s.t. ∀𝑡: 𝐱 t <c Bounded signals: Constant signal : 𝑥 𝑡 =1 Exponential signal: 𝑥 𝑡 =𝑎 𝑒 𝑏𝑡 , for 𝑏≤0 Sinusoidal signals: 𝑥 𝑡 =𝑎sin 𝜔𝑡 Not bounded: 𝑥 𝑡 =𝑎+𝑏𝑡 for any 𝑏≠0 Exponential signal: 𝑥 𝑡 =𝑎 𝑒 𝑏𝑡 , for 𝑏>0 𝑡 ‖𝑥‖ 𝑡 𝑡 ‖𝑥‖ 𝑡 ‖𝑥‖ 𝑡 ‖𝑥‖ This Photo by Unknown Author is licensed under CC BY-SA

BIBO stability A system with Lipschitz-continuous dynamics is BIBO-stable if: For every bounded input 𝐮 𝑡 , the output 𝐲(𝑡) from initial state 𝐱 0 =0 is bounded Asymptotic stability ⇒ BIBO stability! Simple helicopter model: Two rotors: Main rotor gives lift, tail rotor prevents helicopter from spinning Torque produced by tail rotor must perfectly counterbalance friction with main rotor, or the helicopter spins Image credit: From Lee & Seshia: Introduction to Embedded Systems - A Cyber-Physical Systems Approach, http://leeseshia.org/

Helicopter Model continued 𝑢: net torque on tail of the helicopter – difference between frictional torque exerted by main rotor shaft and counteracting torque by the tail rotor 𝑦: rotational velocity of the body Torque = Moment of inertia × Rotational acceleration 𝑢 𝑡 =𝐼 𝑦 (𝑡) 𝑦 𝑡 = 1 𝐼 0 𝑡 𝑢 𝜏 𝑑𝜏 What happens when 𝑢 𝑡 is a constant input? 𝑦(𝑡) is not bounded ⇒ helicopter model is not BIBO-stable!

Hybrid Dynamical Systems

Hybrid Process Generalization of a timed process Instead of timed transitions, we can have arbitrary evolution of state/output variables, typically specified using differential equations on off 𝜃≤62? 𝑑𝜃 𝑑𝑡 =− 𝑘 2 𝜃≥60 𝑑𝜃 𝑑𝑡 = 𝑘 1 70−𝜃 𝜃≤70 𝜃≥68? 60≤ 𝜃 init ≤70

Hybrid System: Thermostat 𝜃 =− 𝑘 2 𝜃≥60 𝜃 = 𝑘 1 70−𝜃 𝜃≤70 𝜃≤62? 𝜃≥68? 60≤ 𝜃 init ≤70 off on State machine with two modes (on / off) State variable 𝜃 models temperature 𝜃 can be tested and updated during discrete mode transitions 𝜃 changes continuously in a mode according to specified differential equation Mode invariants constrain how long machine can stay in any given mode

Executions of Thermostat 𝜃 =− 𝑘 2 𝜃≥60 𝜃 = 𝑘 1 70−𝜃 𝜃≤70 𝜃≤62? 𝜃≥68? 60≤ 𝜃 init ≤70 off on Initial state of the machine: (off, 𝜃 0 ), 𝜃 0 ∈[60,70] If machine enters mode off at time 𝜏, during continuous transition in mode off, 𝜃 decreases according to: 𝜃(𝑡)=𝜃 𝜏 − 𝑘 2 (𝑡) Mode switch enabled when 𝜃≤62, and must happen before 𝜃<60 If machine enters mode on at time 𝜏, during continuous transition in mode on, 𝜃 increases according to: 𝜃 𝑡 = 70−𝜃 𝜏 𝑒 − 𝑘 1 (𝑡−𝜏) Mode switch to off enabled when 𝜃≥68, and must happen before 𝜃>70

Modeling a bouncing ball Ball dropped from an initial height of ℎ 0 with an initial velocity of 𝑣 0 Velocity changes according to 𝑣 =−𝑔 When ball hits the ground, i.e. when ℎ 𝑡 =0, velocity changes discretely from negative (downward) to positive (upward) I.e. 𝑣 𝑡 + ≔−𝑎𝑣(𝑡) , where 𝑡 + is just after 𝑡, and 𝑎 is a damping constant Can model as a hybrid system!

Hybrid Process for Bouncing ball 𝑣 =−𝑔, ℎ =𝑣 ℎ≥0 ℎ=0→sound!𝑏𝑜𝑖𝑛𝑘 ;𝑣≔−𝑎𝑣 ℎ∈ 10,20 , 𝑣∈[0,5] What happens as ℎ→0?

Zeno’s Paradox Described by Greek philosopher Zeno in context of a race between Achilles and a tortoise Tortoise has a head start over Achilles, but is much slower In each discrete round, suppose Achilles is d meters behind at the beginning of the round During the round, Achilles runs d meters, but by then, tortoise has moved a little bit further At the beginning of the next round, Achilles is still behind, by a distance of 𝑎×𝑑 meters, where 𝑎 is a fraction 0<𝑎<1 By induction, if we repeat this for infinitely many rounds, Achilles will never catch up! If the sum of durations between successive discrete actions converges to a constant 𝐾, then an execution with infinitely many discrete actions describes behavior only up to time 𝐾 (and does not tell us the state of the system at time 𝐾 and beyond)

How to deal with Zeno An infinite execution is called Zeno if infinite sum of all the durations is bounded by a constant, and non-Zeno if the sum diverges Any state in a hybrid process is called Zeno if: If every execution starting in state is Zeno Non-Zeno if there exists some non-Zeno starting in that state Hybrid process is non-Zeno if any state that you can reach from the initial state is non-Zeno Thermostat: non-Zeno, Bouncing ball: Zeno Dealing with Zeno: remove Zeno-ness through better modeling

Non-Zeno hybrid process for bouncing ball 𝑣 =−𝑔, ℎ =𝑣 ℎ≥0 bounce ℎ=0→sound!𝑏𝑜𝑖𝑛𝑘 ;𝑣≔−𝑎𝑣 ℎ∈ 10,20 , 𝑣∈[0,5] ℎ=0∧𝑣<𝜖→sound!𝑠𝑝𝑙𝑎𝑡 ;𝑣≔0 𝑣 =0, ℎ =0 ℎ≥0 halt

Hybrid Process Inputs, Outputs, States (both continuous and discrete), Internal actions, input and output actions exactly like the asynchronous model Continuous action/transition: (𝑚, 𝐱 𝜏 ) 𝑚,𝐱 t+𝛿 𝛿 𝐮(𝑡)/𝐲(𝑡) Discrete mode 𝑚 does not change 𝐱(0) = 𝐱 𝝉 𝑑𝐱 𝑡 𝑑𝑡 satisfies the given dynamical equation for mode 𝑚 Output 𝐲 satisfies the output equation for mode 𝑚: 𝐲 𝑡 = ℎ 𝑚 (𝐱 𝑡 ,𝐮 𝑡 ) At all times 𝑡∈ 0,𝛿 , the state 𝐱 𝑡 satisfies the invariant for mode 𝑚

Hybrid Process Discrete action/transition: 𝑚′,𝑟 𝐱 𝜏 (𝑚, 𝐱 𝜏 ) (𝑚, 𝐱 𝜏 ) 𝑚′,𝑟 𝐱 𝜏 𝑔(𝐱)/𝐱≔𝑟 𝐱 Discrete action/transition: Happens instantaneously Changes discrete mode 𝑚 to 𝑚 ′ Can execute only if 𝑔( 𝐱 𝜏 ) evaluates to true Changes state variable value from 𝐱 𝜏 to 𝑟 𝐱 𝜏 𝑟 𝐱 𝜏 should satisfy mode invariant of 𝑚′ Some definitions make 𝑔 a function of 𝐱 and 𝐮 Output will change from ℎ 𝑚 𝐱 𝜏 to ℎ 𝑚 ′ 𝑟 𝐱 𝜏

Executions of a hybrid process (0,3) 𝑚 4 At each cell boundary, assume that the guard is the equation of the boundary, and the reset is 𝑥≔𝑥+𝜖, 𝑦≔𝑦+𝜖, where 𝜖=0.01 Invariant for each cell/mode is the open set enclosed by its boundaries Suppose initial state is (0,0.9) 𝑚 3 𝑚 9 𝑥 =1 𝑦 =0.5 𝑦 =−1 𝑥 =0 𝑦 =0 𝑦 =1 𝑥 =−1 𝑥 =0.5 (0,2) 𝑚 2 𝑚 5 𝑚 8 (0,1) 𝑚 1 𝑚 6 𝑚 7 𝑦=1? 𝑥,𝑦 +=𝜖 ( 𝑚 1 ,0,0.9) 𝑚 1 ,0.1,1 𝑚 𝟐 ,0.11,1.01 0.1 2 (0,0) 𝑦=2? 𝑥,𝑦 +=𝜖 (1,0) (2,0) (3,0) 0.99 𝑚 𝟑 ,0.12,2.01 𝑚 𝟐 ,0.11,2

Stability of hybrid systems Hybrid systems can have surprising results with respect to stability No uniform method like Lyapunov analysis for analyzing all hybrid systems Example: Piecewise Linear (PWL) Dynamical System Special class of hybrid system, in which each mode has linear dynamics, guards, resets are all linear/affine Each mode in the PWL system can have stable dynamics (by doing eigen- value analysis), but resulting hybrid system may be unstable!

Example Dynamics in each mode are stable! 𝑥 2 =−0.2 𝑥 1 ? 𝑥 2 =−0.2 𝑥 1 ? 𝐱 = −1 −100 10 −1 𝐱 𝐱 = −1 10 −100 −1 𝐱 𝑥 2 =5 𝑥 1 ? Dynamics in each mode are stable!

Simulation results 𝑥 2 𝑥 2 =5 𝑥 1 𝑥 2 =−0.2 𝑥 1 Initial State 𝑥 1

Stability analysis for hybrid systems Two main approaches1,2: Find a common Lyapunov function that works for all modes I.e. for each mode 𝑚, dynamics are 𝐱 = 𝑓 𝑚 𝐱 , find 𝑉 𝐱 such that: ∀𝑚∀ 𝐱 ≠𝟎 : 𝜕𝑉 𝜕𝐱 𝑓 𝑚 𝐱 <0, and ∀ 𝐱 ≠𝟎 𝑉 𝐱 >0 Usually hard to find a “one-size-fits-all” Lyapunov function Find multiple Lyapunov functions, one for each mode In each mode its Lyapunov function value decreases, and at the switching instant the destination mode’s Lyapunov function value does not increase 𝑉 𝑚 (𝐱) value decreases every time mode 𝑚 is entered Finding Lyapunov functions satisfying these conditions is again hard

Design Application: Autonomous Guided Vehicle Objective: Steer vehicle to follow a given track Control inputs: linear vehicle speed 𝑣 , vehicle angular velocity (𝜔), start/stop Constraints on control inputs: 𝑣∈ 𝑣 max , 𝑣 max /2,0 𝜔∈{−𝜋,0,𝜋} Designer choice: 𝑣= 𝑣 max only if 𝜔=0, otherwise 𝑣= 𝑣 max 2

On/Off control for Path following 𝑦 Turn right Go straight 𝑥 =( 𝑣 max /2) cos 𝜃 𝑦 = 𝑣 max 2 sin 𝜃 𝜃 =−𝜋 𝑑≥𝜖 𝑥 = 𝑣 max cos 𝜃 𝑦 = 𝑣 max sin 𝜃 𝜃 =0 −𝜖≤𝑑≤𝜖 𝑑≤𝜖? 𝜃 𝑥 𝑑≥𝜖? 𝑑 𝑠𝑠?𝑠𝑡𝑜𝑝 𝑠𝑠?𝑠𝑡𝑎𝑟𝑡∧ 𝑑≥𝜖? Track 𝑠𝑠?𝑠𝑡𝑜𝑝 𝑑≤−𝜖? 𝑑≥−𝜖? 𝑠𝑠?𝑠𝑡𝑎𝑟𝑡∧ −𝜖≤𝑑≤𝜖? 𝑥 =0 𝑦 =0 𝜃 =0 𝑥 =( 𝑣 max /2) cos 𝜃 𝑦 = 𝑣 max 2 sin 𝜃 𝜃 =𝜋 𝑑≤−𝜖 When 𝑑∈ −𝜖,+𝜖 , controller decides that vehicle goes straight, otherwise executes a turn command to bring error back in the interval 𝑠𝑠?𝑠𝑡𝑜𝑝 𝑥≔ 𝑥 0 𝑦≔ 𝑦 0 𝜃≔ 𝜃 0 𝑠𝑠?𝑠𝑡𝑎𝑟𝑡∧ 𝑑≤−𝜖? Stationary Turn left

Design Application: Robot Coordination Autonomous mobile robots in a room, goal for each robot: Reach a target at a known location Avoid obstacles (positions not known in advance) Minimize distance travelled Design Problems: Cameras/vision systems can provide estimates of obstacle positions When should a robot update its estimate of the obstacle position? Robots can communicate with each other How often and what information can they communicate? High-level motion planning What path in the speed/direction-space should the robots traverse?

Path planning with obstacle avoidance 𝑦 Assumptions: Two-dimensional world Robots are just points Each robot travels with a fixed speed Dynamics for Robot 𝑅 𝑖 : 𝑥 𝑖 =𝑣 cos 𝜃 𝑖 ; 𝑦 𝑖 =𝑣 sin 𝜃 𝑖 Design objectives: Eventually reach 𝑥 𝑓 , 𝑦 𝑓 Always avoid Obstacle1 and Obstacle 2 Minimize distance travelled 𝑅 2 𝑣, 𝜃 2 Obstacle 2 𝑝 𝑜2 = 𝑥 𝑜2 , 𝑦 𝑜2 𝑝 2 = 𝑥 2 , 𝑦 2 𝑥 𝑓 , 𝑦 𝑓 Goal Obstacle 1 𝑝 𝑜1 = 𝑥 𝑜1 , 𝑦 𝑜1 𝑅 1 𝑣, 𝜃 1 𝑝 1 = 𝑥 1 , 𝑦 1 𝑥

Divide path/motion planning into two parts Computer vision tasks Actual path planning task Assume computer vision algorithm identifies obstacles, and labels them with some easy-to-represent geometric shape (such as a bounding boxes) In this example, we will assume a sonar-based sensor, so we will use circles Assuming the vision algorithm is correct, do path planning based on the estimated shapes of obstacles Design challenge: Estimate of obstacle shape is not the smallest shape containing the obstacle Shape estimate varies based on distance from obstacle

Estimation error Robot 𝑅 1 maintains radii 𝑒 1 and 𝑒 2 that are estimates of obstacle sizes Every 𝜏 seconds, 𝑅 1 executes following update to get estimates of shapes of each obstacle: 𝑒 1 ≔ min 𝑒 1 , 𝑟 1 +𝑎 𝑝 1 − 𝑝 𝑜1 − 𝑟 1 𝑒 2 ≔ min 𝑒 2 , 𝑟 2 +𝑎 𝑝 1 − 𝑝 𝑜2 − 𝑟 2 Computation of 𝑅 2 is symmetric 𝑝 𝑜1 = 𝑥 𝑜1 , 𝑦 𝑜1 𝑒 𝑒 ′ 𝑟 1 Estimated shape from distance 𝑑′ from distance 𝑑 Smallest shape bounding obstacle Estimated radius (from distance d) 𝑒=𝑟+𝑎(𝑑−𝑟), where 𝑎∈[0,1] is a constant

Path planning Choose shortest path 𝜌 3 to target (to minimize time) If estimate of obstacle 1 intersects 𝜌 3 , calculate two paths that are tangent to obstacle 1 estimate If estimate of obstacle 2 intersects 𝜌 3 , or obstacle 1, calculate tangent paths Plausible paths: 𝜌 1 and 𝜌 2 Calculate shorter one as the planned path 𝑦 𝜌 1 ( 𝑥 𝑓 , 𝑦 𝑓 ) 𝑝 𝑜1 𝜌 4 𝜌 3 𝜌 2 𝑝 𝑜2 𝑝 1 𝑥

Dynamic path planning Path planning inputs: Current position of robot Target position Position of obstacles and estimates Output: Direction for motion assuming obstacle estimates are correct May be useful to execute planning algorithm again as robot moves! Because estimates will improve closer to the obstacles Invoke planning algorithm every 𝜏 seconds

Communication improves planning Every robot has its own estimate of the obstacle 𝑅 2 ’s estimate of obstacle might be better than 𝑅 1 ’s Strategy: every 𝜏 seconds, send estimates to other robot, and receive estimates For estimate 𝑒 𝑖 , use final estimate = min 𝑒 𝑖 , 𝑒 𝑖 𝑟𝑒𝑐𝑣 Re-run path planner

Improved path planning through communication 𝜌 1 𝜌 2 𝜌 3 𝜌 4 𝑥 𝑦 𝑝 1 𝑝 𝑜1 𝑝 𝑜2 ( 𝑥 𝑓 , 𝑦 𝑓 ) 𝑦 New path available because estimate of obstacle 1 improved after receiving estimate from 𝑅 2 𝜌 1 ( 𝑥 𝑓 , 𝑦 𝑓 ) 𝜌 4 ′ 𝑝 𝑜1 𝑝 1 (0) 𝜌 3 𝜌 2 𝑝 𝑜2 𝑝 1 (𝜏) Old path 𝑥

Hybrid State Machine for Communicating Robot

Advantage of using hybrid processes Hybrid process combines computation, communication and control Elegant machine that exemplifies the basic operation of a cyber-physical system Allows design-space exploration through simulations and reachability analysis We can check effect of parameter choices on the behavior of the system

Bibliography Alur, Rajeev. Principles of cyber-physical systems. MIT Press, 2015. H. Lin and P. J. Antsaklis, "Stability and Stabilizability of Switched Linear Systems: A Survey of Recent Results," in IEEE Transactions on Automatic Control, vol. 54, no. 2, pp. 308-322, Feb. 2009. Branicky, Michael S. "Multiple Lyapunov functions and other analysis tools for switched and hybrid systems." IEEE Transactions on automatic control 43.4 (1998): 475-482. Slotine, Jean-Jacques E., and Weiping Li. Applied nonlinear control. Vol. 199. No. 1. Englewood Cliffs, NJ: Prentice hall, 1991.