Transcript Control

IVR:Control Theory
OVERVIEW

Control problems

Kinematics

Examples of control in a physical system

A simple approach to kinematic control
20/10/2009
IVR
Herrmann
The control problem
Goal
Motor
command
Action
Robot in
environment
Outcome
• For given motor commands, what is the
outcome?
→ Forward model
• For a desired outcome, what are the motor
commands?
→ Inverse model
• From observing the outcome, how should we
adjust the motor commands to achieve a goal?
→ Feedback control
20/10/2009
IVR
Herrmann
The control problem
command
V(t)
T(t)
C(t)
A(t)
X(t)
voltage
torque
force
angle
position
• Forward kinematics is not trivial but usually
possible
• Forward dynamics is hard and at best will
be approximate
• But what we actually need is backwards
kinematics and dynamics
Difficult!
20/10/2009
IVR
Herrmann
camera
Inverse model
V(t)
T(t)
C(t)
A(t)
X(t)
Find motor command given desired outcome
Solution might not exist
Non-linearity of the forward transform
Ill-posed problems in redundant systems
Robustness, stability, efficiency, ...
Partial solution and their composition
20/10/2009
IVR
Herrmann
Problem: Non-linearity
• In general, we have good formal methods for
linear systems
• Reminder:
F(x)
Linear function:
F ( x)  a bx
x
F ( x1  x2 )  F ( x1 )  F ( x2 )
• In general, most robot systems are non-linear
20/10/2009
IVR
Herrmann
Kinematic (motion) models
• Differentiating the
geometric model provides
a motion model (hence
sometimes these terms are
used interchangeably)
• This may sometimes be a
method for obtaining
linearity (i.e. by looking at
position change in the limit
of very small changes)
20/10/2009
IVR
Herrmann
Example:
A simple arm model
r = (x,y)
y
l
φ
x
0
x = l cos φ
y = l sin φ
φ = atan2(x,y)
Differential Equations
Using known relations between quantities and their rate of
change in order to find out how these quantities change
• Mathematics:
Equation that is to be solved
for an unknown function
• Physics:
Description of processes in
nature
• Engineering:
Realizability of a goal by a
plant by including control
terms
• Informatics:
Tool for realistic modeling
20/10/2009
IVR
Herrmann
dx t 
 f  x t 
dt
xt0   x0
Differential Equations
dx (t )
x (t )  a  x(t )
dt
t

t0
t
1 1 dxdx
(t ' )(t )
dt 'a a dt '
x (tx' )(t ) dt 'dt
t0
x
t
1 x
t
a
dt0' 0 a(t  t0 )
xx(dx
log
log
'
|
log x log
log
x't|0x)0' at

t0xat

x'
x 0  x ( t0 )
t0
x(t )  x0  expa(t  t0 )
a0
a0
20/10/2009
IVR
fast growth starting from initial value x(t0)=x0
decay with time scale -1/a=τ
Herrmann
Dynamic models
• Kinematic models neglect forces: motor torques,
inertia, friction, gravity…
• To control a system, we need to understand the
continuous process
• Now:
An Example for control of a physically realistic model
• Next: A simple example of control
20/10/2009
IVR
Herrmann
Dynamic models
• Kinematic models neglect forces: motor torques,
inertia, friction, gravity…
• To control a system, we need to understand the
continuous process
• Start with simple linear example:
IR
Battery
voltage
Vehicle
speed
?
VB
20/10/2009
IVR
Herrmann
VB
s
e
Example: Electric motor
• Ohm’s law & Kirchhoff's law
• Motor generates voltage:
proportional to speed
• Vehicle acceleration:
(M is a motor constant)
• Torque t is proportional to current:
• Putting together:
M ds
VB 
R  k1s
k2 dt
20/10/2009
IVR
Herrmann
VB  I R  e
e  k1s
ds t

dt M
t  k2 I
General form
M ds
VB  k1s 
R
k2 dt
ds
V
B
B As
dt
VB
– Control variable
– input
s
– State variable
– output
A+Bd/dt – Process dynamics
Dynamics determines the process, given an initial
state s(t0)=s0.
• State variable s(t) separates past and future
• Continuous process models are often
differential equations!
•
•
•
•
20/10/2009
IVR
Herrmann
Process Characteristics
Given the process, how to describe the behaviour?
M ds
VB  k1s 
R
k2 dt
Concise, complete, implicit, obscure…
Characteristics:
Steady-state: What happens if we wait for the
system to settle, given a fixed input?
Transient behaviour: What happens if we suddenly
change the input?
Frequency response: What if we smoothly/regularly
change the inputs?
20/10/2009
IVR
Herrmann
Control theory
Control theory provides tools:
M ds
VB  k1s 
R
k2 dt
• Steady-state: ds/dt = 0,
VB
VB  k1s so s 
k1
• Transient behaviour
(e.g. change in voltage from 0 to 7V)
exponential decay towards steady state
VB
using z  s )
(Solve for z  s 
k1
• Half-life of decay:
20/10/2009
IVR
Herrmann
MR
t1 0.7
2
k1k2
Steady - state: t  ,
VB
so s 
k1
VB  k1s
1 VB
Halflife: solvefor t when s 
2 k1

1 

 1  e
2 

k1k2
1
t   ln 
MR
2
MR
t  0.7 
k1k2

20/10/2009
IVR
k1k 2
t
MR
Herrmann
VB
s
k1
kk
 1 2t 

1  e MR 


Example
Suppose:
ds
V
7s20
B
dt
k1 MR
M: vehicle mass
R: setting
k2
• If robot starts at rest, and apply 7 volts:
VB
1
s


1
m
s
• Steady state speed
k1
• Half-life:
MR
20
t 1  0.7
 0.7 
 2s
2
k1k2
7
Time taken to cover half the gap between current and
steady-state speed
20/10/2009
IVR
Herrmann
Motor with gears
Battery
voltage
VB
?
smotor
Gear ratio g where
more gear-teeth near
output means g > 1
sout
smotor= g sout : for g > 1, output velocity is slower
torquemotor= g -1 torqueout : for g > 1, output torque is higher
Thus:
MR ds
VB 
 g k1 s
g k2 dt
Same form, different steady-state, time-constant etc.
20/10/2009
IVR
Herrmann
Motor with gears
• Steady-state:
• Half-life:
VB
s
g k1
MR
t1 0.7 2
2
g k1k2
i.e. for γ > 1, reach lower speed in faster time, robot is
more responsive, though slower.
N.B. we have modified the dynamics by altering the
robot morphology.
20/10/2009
IVR
Herrmann
Electric Motor Over Time
Simple dynamic example –
We have a process model:
Battery
voltage
MR
ds
V
k
s
B
1
k
2 dt
Solve to get forward model:
• Derivation of this and
more general cases using
e.g. Laplace transformation
Herrmann
v
IR
VB
IVR
?
VB
V

k
k

B
1
2 
s

1

exp(
t
)

k
MR

1
20/10/2009
Vehicle
speed
e
A fairly simple control algorithm
Compensator
High-frequency
oscillator
Control of the
compensator characteristics
Addition
Compensator in order
to determine the effector
characteristics
Effector
High pass
filter
N. Wiener: Cybernetics, 1948
20/10/2009
IVR
Herrmann
A Simple Controller
dx
 f (x )
System: x 
dt
System + Controller:
a simple choice
for the controller:
K ( x, c)   ci xi
i
a simple choice
for prediction:
xpred = xold
What if there is no analytical description of the system?
Stabilizing controller for box pushing or wall-following
more complex behaviors for more complex predictors
20/10/2009
IVR
Herrmann
A Simple Controller
How to find better parameters ci in K = Σ ci xi ?
cexpl= c + a sin(w t)
Δc = < E(t) sin (w t) >
short-term average
Perform “test actions” at both sides of the trajectory
works best in 1D (e.g. for steering)
20/10/2009
IVR
Herrmann
Summary
Forward and inverse models
Calculating control is hard
… but not impossible for many control problems
Controlling by probing
Feed back control (next time)
20/10/2009
IVR
Herrmann
Beyond Inverse Models
Feed-back control
Dynamical systems
Adaptive control
Learning control
1788 by James Watt following a
suggestion from Matthew Boulton
20/10/2009
IVR
Herrmann