Вы находитесь на странице: 1из 53

Control of

Mobile Robots
Dr. Magnus Egerstedt
Professor
School of Electrical and
Computer Engineering

Module 5
Hybrid Systems

How make mobile robots move in effective, safe,


predictable, and collaborative ways using modern
control theory?

School of Electrical and Computer Engineering

Lecture 5.1 Switches Everywhere


So far, the models stay the same over time
- NOT ALWAYS TRUE!

We have a designed one-size-fits-all controllers


- NEVER TRUE IN ROBOTICS!

Recall the behavior-based control


paradigm
We need to be able to deal with
these types of phenomena

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,
lets add an additional discrete state q
Dynamics:

x = fq (x, u)

The transitions between different discrete modes can be


encoded in a state machine:

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
As a final component, we would like to allow for abrupt
changes in the continuous state as the transitions occur, which
we will call resets:

x := Rq,q (x)

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 := x0

x := R1,2 (x)

q=1

x = f1 (x, u)
x := R3,1 (x)

x G1,2
x G2,1

x := R2,1 (x)

x G3,1

x = f3 (x, u)

q=2

x = f2 (x, u)
x G2,3

x := R2,3 (x)

q=3
Magnus Egerstedt, Control of Mobile Robots, Georgia Ins<tute of Technology

5.2.4

HA Example 1 - Thermostat
T Td +
T = Fheat (T )

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

RP M (v) c1
v = f2 (v, u)

RP M (v) c2

Magnus Egerstedt, Control of Mobile Robots, Georgia Ins<tute of Technology

RP M (v) c2
v = f3 (v, u)

5.2.6

HA Example 3 Behaviors
x xO d
x = fGT G (x)

x = fAO (x)

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:

x = A1 x =
x = A2 x =

x
x

eig(Ai ) = 1.41j

Both modes are asymptotically stable!

Magnus Egerstedt, Control of Mobile Robots, Georgia Ins<tute of Technology

5.3.2

Mode 1
x = A1 x
1

0.5

0.5

1.5
1.5

0.5

0.5

Magnus Egerstedt, Control of Mobile Robots, Georgia Ins<tute of Technology

1.5

5.3.3

Mode 2
x = A2 x
1

0.5

0.5

1.5

0.5

0.5

Magnus Egerstedt, Control of Mobile Robots, Georgia Ins<tute of Technology

1.5

5.3.4

HA 1

x = A1 x

0 1

1 0

x=0
x = A2 x
x=0

ASYMPTOTICALLY STABLE
0.8
0.6
0.4
0.2
0
0.2
0.4
0.6
0.8
1

0.5

0.5

Magnus Egerstedt, Control of Mobile Robots, Georgia Ins<tute of Technology

1.5

5.3.5

x = A1 x

50

HA 2
1 0

0 1

UNSTABLE

x=0
x = A2 x
x=0

50

100

150
250

200

150

100

50

Magnus Egerstedt, Control of Mobile Robots, Georgia Ins<tute of Technology

50

100

150

200

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:

x = 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 x = 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:

x0

Magnus Egerstedt, Control of Mobile Robots, Georgia Ins<tute of Technology

5.4.3

Some Results
If all the individual modes are A.S., then
Existentially A.S.
Why? Simply pick a mode and never switch!
Not always universally A.S.
Why? See the counter example
What to do? (common Lyapunov function)

Magnus Egerstedt, Control of Mobile Robots, Georgia Ins<tute of Technology

5.4.4

Practically Speaking

Design stabilizing controllers for the subsystems


Design the switching logic in the HA
(Find common Lyapunov function)
Be aware of the potential danger here and test, test, test!

Magnus Egerstedt, Control of Mobile Robots, Georgia Ins<tute of Technology

5.4.5

Lecture 5.5 The Bouncing Ball


Lets model a ball bouncing on a surface:

h
Equations of motion in-between bounces:

= g x =
h

0 1
0 0

Bounces:

h := h x :=

1
0

x+

Magnus Egerstedt, Control of Mobile Robots, Georgia Ins<tute of Technology

0
g

, y=

x
5.5.1

The Ball HA
xG
Guards?

x = Ax + b
x := Rx

0 1
0
A=
, b=
0 0
g

1 0
R=
0
Magnus Egerstedt, Control of Mobile Robots, Georgia Ins<tute of Technology

h0

x0

h 0 and h 0 x 0

5.5.2

The Ball HA
xG
x = 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


= g x =
h

0 1
0 0

x+

y = C(t, t0 )x(t0 ) + C
(t, ) = eA(t )

0
g
t

, y=

(t, )Bu( )d
t0

A2 = A3 = . . . = 0

At
1 t
At
e =
= I + At + 0 =
0 1
k!
k=0

Magnus Egerstedt, Control of Mobile Robots, Georgia Ins<tute of Technology

5.5.4

Solving for the Output


= g x =
h

0 1
0 0

x+

0
g
t

, y=

y = C(t, t0 )x(t0 ) + C
(t, )Bu( )d
t0

1 t t0
h0
y= 1 0
0
1
h 0

t 1 t
0
+ 1 0
d
0
1
g
t0
g

= h0 + h0 (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 + h0 (t t0 ) (t t0 )2
2
h0 = 0, t0 = 0
g 2

y(T ) = 0 = h0 T T = T (h 0 g/2T )
2
2h 0
T = 0, T =
g

Magnus Egerstedt, Control of Mobile Robots, Georgia Ins<tute of Technology

5.5.5

Accumulated Bounce Times


velocity at the beginning

h 0,0 = v
velocity after first bounce

h 0,1 = v
..
.
h 0,k = k v

TN

2h 0
T =
g

(time in-between bounces)

time of first bounce

2v
T1 =
g
2v
=
g

N
1

k=0

time of second bounce

2v
2v
T2 =
+
g
g
2v 1

g 1
k

<1

Magnus Egerstedt, Control of Mobile Robots, Georgia Ins<tute of Technology

5.5.6

So What?
T

2v 1
=
<
g 1

The ball bounces an infinite number of times in finite time.


More than just a mathematical curiosity
Simulations crash!
Hybrid system is undefined beyond this time!
This is known as the Zeno Phenomenon next lecture

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

Zeno of Elea: 490 BC-430 BC

Magnus Egerstedt, Control of Mobile Robots, Georgia Ins<tute of Technology

5.6.2

The Zeno Phenomenon

Zeno of Elea: 490 BC-430 BC

Magnus Egerstedt, Control of Mobile Robots, Georgia Ins<tute of Technology

5.6.2

The Zeno Phenomenon

Zeno of Elea: 490 BC-430 BC

Magnus Egerstedt, Control of Mobile Robots, Georgia Ins<tute of Technology

5.6.2

The Zeno Phenomenon

Zeno of Elea: 490 BC-430 BC

The Paradox: The hare never catches up with the tortoise


The Solution: Convergent series
The Problem: Infinitely many switches in finite time
Magnus Egerstedt, Control of Mobile Robots, Georgia Ins<tute of Technology

5.6.2

Example
x =

1
+1

x0
x<0

x = 1
x<0

x0
x = +1

Magnus Egerstedt, Control of Mobile Robots, Georgia Ins<tute of Technology

5.6.3

Super-Zeno?
x =

1
+1

x0
x<0

x = 1
x<0

x0
x = +1

This system switches infinitely


many times in a single timeinstant
Zeno: Infinitely many switches in
finite time
Type 1: In a single timeinstant
Type 2: Not Type 1 (bouncing
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


x = 1
x<0

x0
x = +1

It is clear what should happen!


How do we make that mathematically sound?
Sliding Mode Control

Magnus Egerstedt, Control of Mobile Robots, Georgia Ins<tute of Technology

5.7.1

Switching Surfaces
switching surface

x = f1 (x)
g(x) 0

g(x) < 0

g(x) > 0
g(x) = 0

x = f2 (x)

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
f1

Sliding occurs if

g(x) > 0
g(x) = 0
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
f1

Sliding occurs if

g(x) > 0
g(x) = 0
g(x) < 0

Lf1 g < 0 AND Lf2 g > 0


derivative of g in direction f = Lf g = Lie derivative
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


Next time: But what happens beyond the Zeno point?

Magnus Egerstedt, Control of Mobile Robots, Georgia Ins<tute of Technology

5.7.4

Lecture 5.8 Regularizations


f2

x = f1 (x)
g(x) 0

g(x) < 0
x = f2 (x)

f1

Sliding occurs if

g(x) > 0
g(x) = 0
g(x) < 0

Lf1 g < 0 AND Lf2 g > 0


How do we move beyond the Zeno point?

Magnus Egerstedt, Control of Mobile Robots, Georgia Ins<tute of Technology

5.8.1

The Sliding Mode


f2
f1

dg
=0
dt
g=0

dg
g
g
=
x =
(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


x =

1
+1

x0
x<0

g(x) = x = 0

g
L f1 g =
f1 = 1(1) = 1
x
g
L f1 g =
f2 = 1 1 = 1
x

The Induced Mode

x = 0.5f1 + 0.5f2 = 0

L f1 g
1
2 = 1
= 1
= 1
L f2 g
1
1 = 2 = 0.5
Magnus Egerstedt, Control of Mobile Robots, Georgia Ins<tute of Technology

5.8.3

The Induced Mode

Lf1 g
L f1 g
1 + 2 = 1 1
2 = 1
Lf2 g
L f2 g
1
L f2 g
1 =
=
Lf1 g
L f2 g L f1 g
1 Lf g

=1

L f1 g
2 =
L f2 g L f1 g

1
x =
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


x = f1 (x)

g(x) < 0

g(x) > 0

x = f2 (x)

Magnus Egerstedt, Control of Mobile Robots, Georgia Ins<tute of Technology

5.8.5

Regularizations of Type 1 Zeno HA


x = f1 (x)

g = 0 and Lf1 g < 0 and Lf2 g > 0


g>0

g>0 g<0
g<0
x = f2 (x)

1
x =
Lf2 gf1 Lf1 gf2
L f2 g L f1 g

g = 0 and Lf1 g < 0 and Lf2 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