Transcript Control 1
Control 3
Keypoints:
• PID control • Steady-state error and the integral method • Overshoot and ringing in system with time delay • Overshoot and ringing in second order systems • The derivative method
PID control
• P = Proportional error • I = Integral • D = Derivative • A standard and very useful method for augmenting simple feedback control – E.g. used in wheel position/speed control in the Khepera
Proportional error control
Desired output Control Law Motor command Robot in environment Disturbances Actual Measurement output • Same as servo, i.e. using a control signal proportional to the difference between the actual (measured) output and the desired (target) output. • I.e. want to make large change when error is large, small change if error is small
Steady state error
Servo control law:
V B
K p
(
s
goal
s
) New process:
Ks
goal (
K
k
1 )
s
MR k
2
ds dt s goal
Battery voltage V B
gain=K s
?
With steady state (ds/dt=0):
s
Ks
goal
K
k
1 Steady state error:
s
goal
s
s
goal
K p s
goal
K p
k
1
K p s
goal
K k
1
s
goal
p
k
1
K p s
goal
K p k
1
k
1
s
goal Vehicle speed
s
Steady state error
s
goal
s
K p k
1
k
1
s
goal
s goal
Battery voltage V B
gain=K s
?
Vehicle speed
s k 1
is determined by the motor physics:
e= k 1
Can choose
K p
: to reach target want
K p
s
But we can’t put an infinite voltage into our motor!
Steady state error
For any sensible
K p
the system will
undershoot
the target velocity.
s s goal t
Proportional Integral (PI) Control
If we could estimate this error we could add it to the control signal:
V B
K p
(
s
goal
s
) The best way to estimate it is to integrate the error over time: (
s
goal
s
)
dt
Obtain new control law:
V B
K p
(
s
goal
s
)
K i
(
s
goal
s
)
dt
Basically, this sums some fraction of the error until the error is reduced to zero.
With careful choice of
K p
the steady state error.
and
K i
this can eliminate
Feedback with time delays
Desired output Control Actual output Law Motor command Disturbances Robot in environment Measurement • Imagine trying to move a robot to some zero position with the simple control law: – If x t – If x t < -δ move forward at 1cm/second, > δ move backward at 1cm/second, – If -δ < x t < δ stop • What happens if there is a 1 second delay in feedback?
Feedback with time delays
• In general, a time-lag in a feedback loop will result in overshoot and oscillation.
• Depending on the dynamics, the oscillation could fade out, continue or increase.
• Sometimes we want oscillation, e.g. CPG
Central Pattern Generators
• Many movements in animals, and robots, are rhythmic, e.g. walking • Rather than explicitly controlling position, can exploit an oscillatory process, e.g.
A
B If A is tonically active, it will excite B When B becomes active it inhibits A When A is inhibited, it stops exciting B When B is inactive it stops inhibiting A
Feedback with time delays
• In general, a time-lag in a feedback loop will result in overshoot and oscillation.
• Depending on the dynamics, the oscillation could fade out, continue or increase.
• Sometimes we want oscillation, e.g. CPG • Note that integration introduces a time delay.
• Time delays are equivalent to energy storage e.g. inertia will cause similar effects.
Second order system
θ Need more sophisticated model for oscillations goal error Amplification K of current I Output torque T θ θ Want to move to desired postion θ goal For a dc motor on a robot joint where
J
= joint inertia,
F T
J d
2
dt
= joint friction Proportional control:
T
K p
( goal )
F d
dt
Second order system solution
For simplicity let g Then the system process is 0
K p
(
g
)
J d
2
F d
F
2
J
2 4
K p dt dt
• The solution to this equation has the form
e
2
J t
c
1
e
t
2
c
2
e
t
2 where
J
[May be complex] The system behaviour depends on
J,F,K p
as follows:
Over and Under Damping
e
2
J t c
1
e
t
2
c
2
e
t
2
F
2
J
2 4
K p J
F
2 4
K p
J
The system returns to the goal
F
2 4
K p
J
The system returns to the goal with over-damping
e
2
J t F
2 4
K p
J
The system returns to the goal with under-damped, sinusoidal behaviour
Steady state error – Load Droop
• If the system has to hold a load against gravity, it requires a constant torque • But PE controller cannot do this without error, as torque is proportional to error (so, needs some error) • If we knew the load L could use
T
L
K p
• But in practice this is not often possible
Proportional integral (PI) control
• As before, we integrate the error over time, i.e.
L
K i
0
t
goal
dt
• Effectively this gradually increases L until it produces enough torque to compensate for the load • PI copes with Load Droop
Proportional derivative (PD) control
• Commonly, inertia is large and friction small • Consequently the system overshoots, reverses the error and control signal, overshoots again… • To actively brake the motion, we want to apply negative torque when error is small and velocity high • Make
T
K p
(
g
)
K d d
dt
J d
2
dt
F d
dt
Artificial friction:
K p
(
g
)
J d
2
dt
F
K d
d
dt
Combine as PID control
θ g
T
(
t
)
K p
g
error K p
K d d
(
t
)
dt
K i t
0
t
g
K i Torque
dt
θ K d d/dt
T
(
t
)
T
(
t
)
J K p
g
PID control demo
K d d
(
t
)
dt
K i t
0
t
g d
2
d
dt
2
F dt
Rearranging becomes (almost) solveable as:
b
c
d
0 where
b
(
F
K d
) /
J
,
c
K p
/
J
,
d
[
K i t
0 (
g
)
dt
K p
g
] /
J
dt
PID control demo II
Pure proportional control with friction & inertia
g
5 .
Overdamped, overshoot, oscillate Choosing Kp, Kd, Ki a bit tricky
PID control demo III
Use Kp=0.003
Add integral control Less overdamped, overshoot, oscillate
PID control demo IV
Add derivative control Less overdamped, overshoot, oscillate
PID control demo V
Goal: track oscillating goal position (red) Original Kp=0.003 gain lags, undershoots Kp=0.006 ok, but lags.
Kp=0.03 tracks better but overshoots
Further reading
: Most standard control textbooks discuss PID control. For the research on robot juggling see: Rizzi, A.A. & Koditschek, D.E. (1994) Further progress in robot juggling: Solvable mirror laws. IEEE International Conference on Robotics and Automation 2935-2940 S. Schaal and C.G. Atkeson.
Open Loop Stable Control Strategies for Robot Juggling
. In Proc. IEEE Conf. Robotics and Automation, pages 913 -- 918, Atlanta, Georgia, 1993. CPGs are used in many more recent examples of walking robots.