+ All Categories
Home > Documents > Control 3 Keypoints: PID control

Control 3 Keypoints: PID control

Date post: 08-Jan-2018
Category:
Upload: ruby-greene
View: 276 times
Download: 4 times
Share this document with a friend
Description:
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
25
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
Transcript
Page 1: Control 3 Keypoints: PID control

Control 3Keypoints:• 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

Page 2: Control 3 Keypoints: PID control

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

Page 3: Control 3 Keypoints: PID control

Motor command

Robot in environment

Control Law

DisturbancesMeasurement

Proportional error control

• 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

Desired

output

Actual

output

Page 4: Control 3 Keypoints: PID control

Steady state errorServo control law:

New process:

Battery voltage

VB

Vehicle speed

s?

ssgoal

)( goal ssKV pB

dtds

kMRskKKs

21goal )(

gain=K

1

goalkK

Kss With steady state (ds/dt=0):Steady state error:

goal1

1

1

goalgoal1goal

1

goalgoalgoal

skK

k

kKsKsksK

kKsKsss

p

p

pp

p

p

Page 5: Control 3 Keypoints: PID control

Steady state error

k1 is determined by the motor physics: e= k1 s

Can choose Kp: to reach target want

But we can’t put an infinite voltage into our motor!

Battery voltage

VB

Vehicle speed

s?

ssgoal

gain=K

goal1

1goal s

kKkss

p

pK

Page 6: Control 3 Keypoints: PID control

Steady state errorFor any sensible Kp the system will undershoot

the target velocity.

t

s

sgoal

Page 7: Control 3 Keypoints: PID control

Proportional Integral (PI) ControlIf we could estimate this error we could add it to the control signal:

The best way to estimate it is to integrate the error over time:

Obtain new control law:

Basically, this sums some fraction of the error until the error is reduced to zero.With careful choice of Kp and Ki this can eliminate the steady state error.

)( goal ssKV pB

dtss )( goal

dtssKssKV ipB )()( goalgoal

Page 8: Control 3 Keypoints: PID control

Motor command

Robot in environment

Control Law

DisturbancesMeasurement

Feedback with time delays

• Imagine trying to move a robot to some zero position with the simple control law:– If xt < -δ move forward at 1cm/second,

– If xt > δ move backward at 1cm/second,

– If -δ < xt < δ stop

• What happens if there is a 1 second delay in feedback?

Desired

output

Actual

output

Page 9: Control 3 Keypoints: PID control

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

Page 10: Control 3 Keypoints: PID control

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

Page 11: Control 3 Keypoints: PID control
Page 12: Control 3 Keypoints: PID control

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.

Page 13: Control 3 Keypoints: PID control

Second order system

Want to move to desired postion θgoal

For a dc motor on a robot joint where J = joint inertia, F = joint frictionProportional control:

θgoal AmplificationK of current I

Output torque T

θerror

θ

dtdF

dtdJT

2

)( goal pKT

Need more sophisticated model for oscillations

Page 14: Control 3 Keypoints: PID control

Second order system solution

For simplicity let

Then the system process is• The solution to this equation has the form

The system behaviour depends on J,F,Kp as follows:

dtdF

dtdJK gp

2

)(

2

22

12 tttJ

Fecece

where

JK

JF p4

2

2

0g

[May be complex]

Page 15: Control 3 Keypoints: PID control

Over and Under Damping

22

21

2tttJ

Fecece

JK

JF p4

2

2

The system returns to the goalJKF

p4

2 tJF

e 2

JKF

p4

2 The system returns to the goal with over-damping

JKF

p4

2 The system returns to the goal with under-damped, sinusoidal behaviour

Page 16: Control 3 Keypoints: PID control

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

• But in practice this is not often possible

pKLT

Page 17: Control 3 Keypoints: PID control

Proportional integral (PI) control

• As before, we integrate the error over time, i.e.

• Effectively this gradually increases L until it produces enough torque to compensate for the load

• PI copes with Load Droop

dttKLt

i 0

goal

Page 18: Control 3 Keypoints: PID control

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

• MakedtdF

dtdJ

dtdKKT dgp

2

)(

dtdKF

dtdJK dgp

2

)(Artificial friction:

Page 19: Control 3 Keypoints: PID control

Combine as PID control

t

tgidgp dttK

dttdKtKtT

0

)()(

Kp

θ

errorθg

Ki

Kdd/dt

Torque

Page 20: Control 3 Keypoints: PID control

PID control demo

dtdF

dtdJtT

dttKdt

tdKtKtTt

tgidgp

2

2

)(

)()(0

Rearranging becomes (almost) solveable as:

JKdtKd

JKcJKFbdcb

t

gpgi

pd

/])([

,/ ,/)( where0

0

Page 21: Control 3 Keypoints: PID control

PID control demo IIPure proportional control with friction & inertiaOverdamped, overshoot, oscillateChoosing Kp, Kd, Ki a bit tricky

5.5g

Page 22: Control 3 Keypoints: PID control

PID control demo IIIUse Kp=0.003Add integral controlLess overdamped, overshoot, oscillate

Page 23: Control 3 Keypoints: PID control

PID control demo IVAdd derivative controlLess overdamped, overshoot, oscillate

Page 24: Control 3 Keypoints: PID control

PID control demo VGoal: track oscillating goal position (red)Original Kp=0.003 gain lags, undershootsKp=0.006 ok, but lags.Kp=0.03 tracks better but overshoots

Page 25: Control 3 Keypoints: PID control

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.


Recommended