You are on page 1of 44

Control of

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

Module 1
Introduction to Controls

How make mobile robots move in effective, safe,


predictable, and collaborative ways using modern
control theory?

School of Electrical and Computer Engineering

Lecture 1.1 Control of Mobile Robots


Magnus Egerstedt
Professor, School of Electrical
and Computer Engineering,
Georgia Institute of Technology
Two research thrusts:
Control theory
Robotics
Research domains
Swarm robotics
Behavior-based control
Field robotics

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

1.1.1

http://www.youtube.com/user/GRITSlab
Magnus Egerstedt, Control of Mobile Robots, Georgia Ins<tute of Technology

1.1.2

Control of Mobile Robots


Whats in the course?
Control theory
Robot models
Mobility controllers
Applications
Whats not in the course?
AI
Perception
Mechanical engineering

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

1.1.3

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

1.1.4

Course Mechanics
Lectures (8 each week, 7 weeks)
Weekly quizzes + glue lectures
Additional material
Sim.I.am MATLAB robot simulator
Build you own robot

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

1.1.5

A Disclaimer

3(mw + m
b )v

2 sin
d
mb

L(

R
cos

mb d cos 2
+
)
I
2

+ b d si
m
2 sin +
n ( 2 + 2
d
)2 = m 1gd sin =
b
m
2
1 )m w + 2
+ b ( L + R )
s
co
+ mb d sin

)
I
R
d
3
m
2
(
2
b
+

+ s2R
co
d
m
b
L
3
((

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

R)

1.1.6

Lecture 1.2 Whats Control Theory, Anyway?


System = Something that changes over time
Control = Influence that change
Examples:

Robots
Epidemics
Stock markets
Thermostats
Circuits
Engines
Power grids
Autopilots

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

1.2.1

The Basic Building Blocks

State = Representation of what the system is currently doing


Dynamics = Description of how the state changes
Reference = What we want the system to do
Output = Measurement of (some aspects of the) system

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

1.2.2

The Basic Building Blocks

State = Representation of what the system is currently doing


Dynamics = Description of how the state changes
Reference = What we want the system to do
Output = Measurement of (some aspects of the) system
Input = Control signal

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

1.2.2

The Basic Building Blocks

State = Representation of what the system is currently doing


Dynamics = Description of how the state changes
Reference = What we want the system to do
Output = Measurement of (some aspects of the) system
Input = Control signal
Feedback = Mapping from outputs to inputs
+

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

1.2.2

Back to the Examples


Robots
Epidemics
Stock markets
Thermostats
Circuits
Engines
Power grids
Autopilots

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

1.2.3

Lecture 1.3 On the Need for Models


Control Theory = How pick the input signal u?
Objectives:

Stability
Tracking
Robustness
Disturbance rejection
Optimality

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

1.3.1

Dynamical Models
Effective control strategies rely on predictive models
Discrete time:
xk+1 = f (xk , uk )
Difference equation
Example: Clock
xk+1 = xk + 1

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

1.3.2

Discrete Time Clock


10

10

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

1.3.3

Dynamics = Change Over Time


Laws of Physics are all in continuous time: Instead of next
state, we need derivatives with respect to time
Continuous time:
dx
= f (x, u) x = f (x, u)
Differential equation
dt
Clock:
x = 1

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

1.3.4

Continuous Time Clock


10

10

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

1.3.5

From Continuous to Discrete


But in implementation, everything is discrete/sampled!
x = f (x, u)

Sample time: t
xk = x(k t) ) xk+1 = x((k + 1) t) =???
x(k t + t) x(k t) + tx(k

t)
xk+1 = xk + tf (xk , uk )

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

1.3.6

Lecture 1.4 - Cruise-Controllers


Make a car drive at a desired, reference speed (r)
Newtons Second Law:
F = ma

State: velocity (x)


Input: gas/brake (u)
Dynamics:

F = cu

(c=electro-mechanical
transmission coefficient)

c
x = a ) mx = cu ) x = u
m

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

1.4.1

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

1.4.2

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

1.4.3

Control Design
Assume that we measure the velocity (y=x)
The control signal should be a function of r-y (=e)
What properties should the control signal have?
Small e gives small u
u should not be jerky
u should not depend on us knowing c and m exactly

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

1.4.4

Lecture 1.5 Control Design Basics


Car Model:
c
x = u
m
Want
x ! r as t ! 1 (e = r
Attempt 1

8
< umax
umax
u=
:
0

x ! 0)

if e > 0
if e < 0
if e = 0

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

1.5.1

Bang-Bang Control
80

r=70

70

60

50

40

30

20

10

5
t

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

10

1.5.2

Bang-Bang Control
100

80

Bumpy ride
Burns out actuators
.

60

40

20

BAD!

20

40

60

80

100

5
t

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

10

1.5.3

P-Regulators
Problem: The controller over-reacts to small errors
Attempt 2
u = ke
Small error yields small control signals
Nice and smooth
So-called proportional regulation (P-regulator)

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

1.5.4

P-Regulator
60

55

50

Problem: r=70 (and not 60)???

45

40

Nice and smooth!


And STABLE!

35

30

25

20

15

10

0.5

1.5

2.5
t

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

3.5

4.5

1.5.5

Stability But Not Tracking


Caveat: The real model is augmented to include a windresistance term:
c
x = u
x
m
This is the model used for simulating the controller
At steady-state (x does not change any more)
c
c
x = 0 = u
x = k(r x)
x ) (ck + m )x = ckr
m
m
ck
x=
r<r
ck + m

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

1.5.6

Lecture 1.6 Performance Objectives


A controller should:
Stability (BIBO)
Tracking
Robustness

c
x = u
m

Problem: All of a sudden we


have to know all these physical
parameters that we typically do
not know Not robust!

Attempt 3

m
u = ke +
x
c
c
x = 0 = k(r x) + x
m

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

Tracking!

x ) x=r
1.6.1

P-Regulator
60

55

50

Take the integral over the error!

45

40

35

30

25

20

15

10

0.5

1.5

2.5
t

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

3.5

4.5

1.6.2

PI-Regulators
Attempt 4
u(t) = kP e(t) + kI

e( )d
0

Or, why not a PID-Regulator?


Z t
de(t)
u(t) = kP e(t) + kI
e( )d + kD
dt
0

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

1.6.3

PI-Regulator
70

60

50

40

30

20

10

0.5

1.5

2.5
t

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

3.5

4.5

1.6.4

Lecture 1.7 PID Control

de(t)
u(t) = kP e(t) + kI
e( )d + kD
dt
0
P: Contributes to stability, medium-rate responsiveness
I: Tracking and disturbance rejection, slow-rate
responsiveness. May cause oscillations
D: Fast-rate responsiveness. Sensitive to noise
PID: By far the most used low-level controller.
Note: Stability is not guaranteed.
Feedback has a remarkable ability
to fight uncertainty in model parameters!

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

1.7.1

Cruise-Controller (Again)
c
x = u
m

c = 1, m = 1,

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

= 0.1, r = 1

1.7.2

Cruise-Controller (Again)
Step Response
0.5
0.45
0.4

Amplitude

0.35
0.3
0.25
0.2
0.15
0.1
0.05
0

kP = 1, kI = 0, kD = 0

5
Time (sec)

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

10

1.7.3

Cruise-Controller (Again)
Step Response
1
0.9
0.8

Amplitude

0.7
0.6
0.5
0.4
0.3
0.2
0.1
0

5
Time (sec)

10

kP = 1, kI = 1, kD = 0
Magnus Egerstedt, Control of Mobile Robots, Georgia Ins<tute of Technology

1.7.4

Cruise-Controller (Again)
Step Response
1.4

1.2

Amplitude

0.8

0.6

0.4

0.2

5
Time (sec)

10

kP = 1, kI = 10, kD = 0
Magnus Egerstedt, Control of Mobile Robots, Georgia Ins<tute of Technology

1.7.5

Cruise-Controller (Again)
Step Response
1
0.9
0.8

Amplitude

0.7
0.6
0.5
0.4
0.3
0.2
0.1
0

5
Time (sec)

10

kP = 1, kI = 1, kD = 0.1
Magnus Egerstedt, Control of Mobile Robots, Georgia Ins<tute of Technology

1.7.6

Lecture 1.8 Implementation


Z

de(t)
u(t) = kP e(t) + kI
e( )d + kD
dt
0
How turn something as strange as an integral into something
implementable?
enew eold
t (sample time) e
t

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

1.8.1

Lecture 1.8 Implementation


Z

de(t)
u(t) = kP e(t) + kI
e( )d + kD
dt
0
How turn something as strange as an integral into something
implementable?
enew eold
t (sample time) e
t

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

1.8.1

Lecture 1.8 Implementation


Z

de(t)
u(t) = kP e(t) + kI
e( )d + kD
dt
0
How turn something as strange as an integral into something
implementable?
enew eold
t (sample time) e
t
Z t
N
X
e( )d
e(k t) t = tE
0

tEnew =

N
+1
X

k=0

e(k t) =

te((N + 1) t) +

tEold

k=1

Enew = Eold + e
Magnus Egerstedt, Control of Mobile Robots, Georgia Ins<tute of Technology

1.8.1

Implementation
Each time the controller is called
read e;!
!e_dot=e-old_e;!
!E=E+e;!
!u=kP*e+kD*e_dot+kI*E;!
!old_e=e;!
Note: The coefficients now include the sample time
and must be scaled accordingly

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

1.8.2

Module 1: Introduction to Control


That (almost) concludes Module 1
Module 2: Mobile robots
Module 3: What did we really do in Module 1?

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

1.8.3

Example: Quadrotor Altitude Control

x
= cu
u = kP e + kI

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

g
ed + kD e

1.8.4

You might also like