Module5 PDF
Module5 PDF
Mobile Robots
Module 5
Dr. Magnus Egerstedt
Professor
School of Electrical and
Hybrid Systems
Computer Engineering
Magnus
Egerstedt,
Control
of
Mobile
Robots,
Georgia
Ins<tute
of
Technology
5.1.1
Switches by Necessity
Magnus
Egerstedt,
Control
of
Mobile
Robots,
Georgia
Ins<tute
of
Technology
5.1.2
Switches by Design
Magnus
Egerstedt,
Control
of
Mobile
Robots,
Georgia
Ins<tute
of
Technology
5.1.3
Switches by Design
Magnus
Egerstedt,
Control
of
Mobile
Robots,
Georgia
Ins<tute
of
Technology
5.1.4
Issues
• Models?
• Stability and Performance? (t �→ ∞)
• Compositionality?
• Traps?
Magnus
Egerstedt,
Control
of
Mobile
Robots,
Georgia
Ins<tute
of
Technology
5.1.5
Lecture 5.2 – Hybrid Automata
• We need to be able to describe systems that contain both the
continuous dynamics and the discrete switch logic
• Hybrid Automata = Finite state machines (discrete logic) on
steroids (continuous dynamics)
Magnus
Egerstedt,
Control
of
Mobile
Robots,
Georgia
Ins<tute
of
Technology
5.2.1
Modes, Transitions, Guards, and Resets
• Let, as before, the (continuous) state of the system be x
• As we will be switching between different modes of operation,
let’s add an additional discrete state q
• Dynamics:
ẋ = fq (x, u)
• The transitions between different discrete modes can be
encoded in a state machine:
q q�
Magnus
Egerstedt,
Control
of
Mobile
Robots,
Georgia
Ins<tute
of
Technology
5.2.2
Modes, Transitions, Guards, and Resets
• The conditions under which a transition occurs are called
guard conditions, i.e., a transition occurs from q to q’ if
x ∈ Gq,q�
Magnus
Egerstedt,
Control
of
Mobile
Robots,
Georgia
Ins<tute
of
Technology
5.2.3
The Hybrid Automata Model
• Putting all of this together yields a very rich model known as a
hybrid automata (HA) model:
x := R1,2 (x)
x := x0 q=1 q=2
x ∈ G1,2
ẋ = f1 (x, u) ẋ = f2 (x, u)
x ∈ G2,1
q=3
Magnus
Egerstedt,
Control
of
Mobile
Robots,
Georgia
Ins<tute
of
Technology
5.2.4
HA Example 1 - Thermostat
T ≥ Td + �
Ṫ = Fheat (T ) Ṫ = Fcool (T )
T ≤ Td − �
Magnus
Egerstedt,
Control
of
Mobile
Robots,
Georgia
Ins<tute
of
Technology
5.2.5
HA Example 2 – Gear Shift
v̇ = f1 (v, u)
RP M (v) ≥ c1
Magnus
Egerstedt,
Control
of
Mobile
Robots,
Georgia
Ins<tute
of
Technology
5.2.6
HA Example 3 – Behaviors
�x − xO � ≤ d
�x − xO � ≥ d�
Magnus
Egerstedt,
Control
of
Mobile
Robots,
Georgia
Ins<tute
of
Technology
5.2.7
Lecture 5.3 – A Counter Example
• What can possibly go wrong when you start switching
between different controllers?
Magnus
Egerstedt,
Control
of
Mobile
Robots,
Georgia
Ins<tute
of
Technology
5.3.1
A Simple 2-Mode System
• Two modes:
� �
−� 1
ẋ = A1 x = x
−2 −�
� � eig(Ai ) = −� ± 1.41j
−� 2
ẋ = A2 x = x
−1 −�
Magnus
Egerstedt,
Control
of
Mobile
Robots,
Georgia
Ins<tute
of
Technology
5.3.2
Mode 1
ẋ = A1 x
1
0.5
ï0.5
ï1
ï1.5
Magnus
Egerstedt,
Control
of
Mobile
Robots,
Georgia
Ins<tute
of
Technology
5.3.3
Mode 2
ẋ = A2 x
1
0.5
ï0.5
ï1
Magnus
Egerstedt,
Control
of
Mobile
Robots,
Georgia
Ins<tute
of
Technology
5.3.4
HA 1
� �
0 1 x=0
ẋ = A1 x ẋ = A2 x
� �
1 0 x=0
1
ASYMPTOTICALLY STABLE
0.8
0.6
0.4
0.2
ï0.2
ï0.4
ï0.6
ï0.8
ï1 ï0.5 0 0.5 1 1.5 2
Magnus
Egerstedt,
Control
of
Mobile
Robots,
Georgia
Ins<tute
of
Technology
5.3.5
HA 2
� �
1 0 x=0
ẋ = A1 x ẋ = A2 x
� �
0 1 x=0
50
UNSTABLE
0
ï50
ï100
ï150
Magnus
Egerstedt,
Control
of
Mobile
Robots,
Georgia
Ins<tute
of
Technology
5.3.6
Punchlines
• By combining stable modes, the resulting hybrid system may
be unstable!
• By combining unstable modes, the resulting hybrid system
may be stable!
• Design stable modes but be aware that this is a risk one may
face!
Magnus
Egerstedt,
Control
of
Mobile
Robots,
Georgia
Ins<tute
of
Technology
5.3.7
Lecture 5.4 – Danger, Beware!
• Stable subsystems do not guarantee a stable hybrid system
Magnus
Egerstedt,
Control
of
Mobile
Robots,
Georgia
Ins<tute
of
Technology
5.4.1
Switched Systems
• We saw last time that it was possible to destabilize stable
subsystems by an unfortunate series of switches
• Ignoring resets, we can write the hybrid system as a switched
system:
ẋ = fσ (x, u)
switch signal
• The switch signal dictates which discrete mode the system is
in
σ(t) ∈ Σ = {1, . . . , p}
Magnus
Egerstedt,
Control
of
Mobile
Robots,
Georgia
Ins<tute
of
Technology
5.4.2
Different Kinds of Stability
• Given a switched system ẋ = fσ (x)
– universal, asymptotic stability:
x → 0, ∀σ
– existential, asymptotic stability:
∃σ s.t. x → 0
• If the switch signal is generated by an underlying hybrid
automaton:
– hybrid, asymptotic stability:
x→0
Magnus
Egerstedt,
Control
of
Mobile
Robots,
Georgia
Ins<tute
of
Technology
5.4.3
Some Results
Existentially A.S.
• Why? Simply pick a mode and never switch!
Magnus
Egerstedt,
Control
of
Mobile
Robots,
Georgia
Ins<tute
of
Technology
5.4.4
Practically Speaking
Magnus
Egerstedt,
Control
of
Mobile
Robots,
Georgia
Ins<tute
of
Technology
5.4.5
Lecture 5.5 – The Bouncing Ball
• Let’s model a ball bouncing on a surface:
• Bounces:
� �
1 0
ḣ := −γ ḣ ⇒ x := x
0 −γ
Magnus
Egerstedt,
Control
of
Mobile
Robots,
Georgia
Ins<tute
of
Technology
5.5.1
The Ball HA
x∈G
Guards?
ẋ = Ax + b � �
h≤0 ⇒ 1 0 x≤0
x := Rx h ≤ 0 and ḣ ≤ 0 ⇒ x ≤ 0
� � � �
0 1 0
A= , b=
0 0 −g
� �
1 0
R=
0 −γ
Magnus
Egerstedt,
Control
of
Mobile
Robots,
Georgia
Ins<tute
of
Technology
5.5.2
The Ball HA
x∈G
ẋ = Ax + b
x := Rx
• Is this any good?
• To answer that we need to figure out how the
system actually behaves!
Magnus
Egerstedt,
Control
of
Mobile
Robots,
Georgia
Ins<tute
of
Technology
5.5.3
Solving for the Output
� � � �
0 1 0 � �
ḧ = −g ⇒ ẋ = x+ , y= 1 0 x
0 0 −g
� t
y = CΦ(t, t0 )x(t0 ) + C Φ(t, τ )Bu(τ )dτ
t0
Φ(t, τ ) = eA(t−τ )
A2 = A3 = . . . = 0
�∞ k � �
At At 1 t
e = = I + At + 0 =
k! 0 1
k=0
Magnus
Egerstedt,
Control
of
Mobile
Robots,
Georgia
Ins<tute
of
Technology
5.5.4
Solving for the Output
� � � �
0 1 0 � �
ḧ = −g ⇒ ẋ = x+ , y= 1 0 x
0 0 −g
� t
y = CΦ(t, t0 )x(t0 ) + C Φ(t, τ )Bu(τ )dτ
t0
� �� �
� � 1 t − t0 h0
y= 1 0
0 1 ḣ0
� � �� �
� � t 1 t−τ 0
+ 1 0 dτ
t0 0 1 −g
g
= h0 + ḣ0 (t − t0 ) − (t − t0 )2
2
Magnus
Egerstedt,
Control
of
Mobile
Robots,
Georgia
Ins<tute
of
Technology
5.5.4
Time In-Between Bounces?
g
y = h0 + ḣ0 (t − t0 ) − (t − t0 )2
2
h0 = 0, t0 = 0
g 2
y(T ) = 0 = ḣ0 T − T = T (ḣ0 − g/2T )
2
2ḣ0
T = 0, T =
g
Magnus
Egerstedt,
Control
of
Mobile
Robots,
Georgia
Ins<tute
of
Technology
5.5.5
Accumulated Bounce Times
2ḣ0
T = (time in-between bounces)
velocity at the beginning
g
time of first bounce
ḣ0,0 = v 2v time of second bounce
velocity after first bounce T1 = 2v 2v
g T2 = +γ
ḣ0,1 = γv g g
.. N −1
. 2v � 2v 1
k
TN = γ →
ḣ0,k = γ k v g g 1−γ
k=0
γ<1
Magnus
Egerstedt,
Control
of
Mobile
Robots,
Georgia
Ins<tute
of
Technology
5.5.6
So What?
2v 1
T∞ = <∞
g 1−γ
Magnus
Egerstedt,
Control
of
Mobile
Robots,
Georgia
Ins<tute
of
Technology
5.5.7
Lecture 5.6 – The Zeno Phenomenon
• Problem with the bouncing ball: Infinitely many switches in
finite time
• This is bad:
– Simulations crash
– Model is not accurate
– System behavior fundamentally ill-defined beyond “Zeno
point”
Magnus
Egerstedt,
Control
of
Mobile
Robots,
Georgia
Ins<tute
of
Technology
5.6.1
The Zeno Phenomenon
The hare
The tortoise
Magnus
Egerstedt,
Control
of
Mobile
Robots,
Georgia
Ins<tute
of
Technology
5.6.2
The Zeno Phenomenon
Magnus
Egerstedt,
Control
of
Mobile
Robots,
Georgia
Ins<tute
of
Technology
5.6.2
The Zeno Phenomenon
Magnus
Egerstedt,
Control
of
Mobile
Robots,
Georgia
Ins<tute
of
Technology
5.6.2
The Zeno Phenomenon
Magnus
Egerstedt,
Control
of
Mobile
Robots,
Georgia
Ins<tute
of
Technology
5.6.2
Example
�
−1 x≥0
ẋ =
+1 x<0
ẋ = −1
x≥0 x<0
ẋ = +1
Magnus
Egerstedt,
Control
of
Mobile
Robots,
Georgia
Ins<tute
of
Technology
5.6.3
Super-Zeno?
� • This system switches infinitely
−1 x≥0
ẋ = many times in a single time-
+1 x<0
instant
• Zeno: Infinitely many switches in
ẋ = −1 finite time
– Type 1: In a single time-
x≥0 x<0 instant
– Type 2: Not Type 1 (bouncing
ẋ = +1
ball)
Magnus
Egerstedt,
Control
of
Mobile
Robots,
Georgia
Ins<tute
of
Technology
5.6.4
Good News and Bad News
• Zeno is a problem
• Type 1 is not only detectable, but one can deal with it in a
rather straightforward manner
• Type 2 is overall hard to handle!
Magnus
Egerstedt,
Control
of
Mobile
Robots,
Georgia
Ins<tute
of
Technology
5.6.5
Lecture 5.7 – Sliding Mode Control
ẋ = −1
x≥0 x<0
ẋ = +1
Magnus
Egerstedt,
Control
of
Mobile
Robots,
Georgia
Ins<tute
of
Technology
5.7.1
Switching Surfaces
switching surface
ẋ = f1 (x)
g(x) ≥ 0 g(x) < 0 g(x) > 0
ẋ = f2 (x) g(x) = 0
g(x) < 0
• Both vector fields point “inwards” = bad!
• We should keep sliding along the switching surface
• Sliding Mode Control
Magnus
Egerstedt,
Control
of
Mobile
Robots,
Georgia
Ins<tute
of
Technology
5.7.2
Sliding?
∂g T
∂x f2
g(x) > 0
f1
g(x) = 0
Sliding occurs if g(x) < 0
∂g ∂g
f1 < 0 AND f2 > 0
∂x ∂x
derivative of g in direction f = Lf g = Lie derivative
Magnus
Egerstedt,
Control
of
Mobile
Robots,
Georgia
Ins<tute
of
Technology
5.7.3
Sliding?
∂g T
∂x f2
g(x) > 0
f1
g(x) = 0
g(x) < 0
Sliding occurs if
Lf1 g < 0 AND Lf2 g > 0
Magnus
Egerstedt,
Control
of
Mobile
Robots,
Georgia
Ins<tute
of
Technology
5.7.3
A Test For Type 1 Zeno
Sliding occurs if
Lf1 g < 0 AND Lf2 g > 0
Magnus
Egerstedt,
Control
of
Mobile
Robots,
Georgia
Ins<tute
of
Technology
5.7.4
Lecture 5.8 – Regularizations
f2
ẋ = f1 (x)
g(x) ≥ 0 g(x) < 0 g(x) > 0
f1
ẋ = f2 (x) g(x) = 0
g(x) < 0
Sliding occurs if
Lf1 g < 0 AND Lf2 g > 0
Magnus
Egerstedt,
Control
of
Mobile
Robots,
Georgia
Ins<tute
of
Technology
5.8.1
The Sliding “Mode”
f2 dg
=0
dt
f1
g=0
dg ∂g ∂g
= ẋ = (σ1 f1 + σ2 f2 ) = σ1 Lf1 g + σ2 Lf2 g
dt ∂x ∂x
L f1 g
= 0 ⇒ σ2 = −σ1
L f2 g
σ1 , σ2 ≥ 0, σ1 + σ2 = 1
Magnus
Egerstedt,
Control
of
Mobile
Robots,
Georgia
Ins<tute
of
Technology
5.8.2
Back to the Example
�
−1 x≥0 g(x) = x = 0
ẋ =
+1 x<0
L f1 g
σ2 = −
L f2 g − L f1 g
1 � �
ẋ = Lf2 gf1 − Lf1 gf2
L f2 g − L f1 g
Magnus
Egerstedt,
Control
of
Mobile
Robots,
Georgia
Ins<tute
of
Technology
5.8.4
Regularizations of Type 1 Zeno HA
ẋ = f1 (x)
ẋ = f2 (x)
Magnus
Egerstedt,
Control
of
Mobile
Robots,
Georgia
Ins<tute
of
Technology
5.8.5
Regularizations of Type 1 Zeno HA
g>0 � �
1
g>0 g<0 ẋ = Lf2 gf1 − Lf1 gf2
L f2 g − L f1 g
g<0
Magnus
Egerstedt,
Control
of
Mobile
Robots,
Georgia
Ins<tute
of
Technology
5.8.5
Hybrid Systems: In Summary
• We have
– Models
– Stability Awareness
– Zeno
– Regularizations
• Next Module: Back to ROBOTICS!
Magnus
Egerstedt,
Control
of
Mobile
Robots,
Georgia
Ins<tute
of
Technology
5.8.6