cds 101: lecture 8.2 tools for pid & loop shapingmurray/courses/cds101/fa04/lectures/l... ·...
TRANSCRIPT
CDS 101: Lecture 8.2Tools for PID & Loop Shaping
Richard M. Murray17 November 2004
Goals:Show how to use “loop shaping” to achieve a performance specificationIntroduce new tools for loop shaping design: Ziegler-Nichols, root locus, lead compensationWork through some example control design problems
Reading: Åström and Murray, Analysis and Design of Feedback Systems, Ch 8
17 Nov 04 R. M. Murray, Caltech CDS 2
Tools for Designing PID controllers
Zeigler-Nichols tuningDesign PID gains based on step responseWorks OK for many plants (but underdamped)Good way to get a first cut controllerFrequency domain version also exists
Caution: PID amplifies high frequency noiseSol’n: pole at high frequency
Caution: Integrator windupProlonged error causes large integrated errorEffect: large undershoot (to reset integrator)Sol’n: move pole at zero to very small valueFancier sol’n: anti-windup compensation
C(s) ++-
d
r ye uP(s)
1( ) (1 )DI
C s K T sT s
= + +
1.2 /K a= 2*IT L= / 2DT L=
Point of maximumslope
L
a
Step response
Bode Diagrams
Frequency (rad/sec)
Mag
nitu
de (d
B)
0
20
40
60
80
10-4 10-2 100 102 104
17 Nov 04 R. M. Murray, Caltech CDS 3
Example: PID cruise control
Ziegler-Nichols design for cruise controllerPlot step response, extract L and a, compute gains
Result: sluggish ⇒ increase loop gain Frequency (rad/sec)
Phas
e (d
eg);
Mag
nitu
de (d
B)
Bode Diagrams
-100
-50
0
50
100
10-3 10-2 10-1 100 101-200
-100
0
100
Time (sec.)
Ampl
itude
Step Response
0 10 20 30 40 50 600
0.5
1
1.5
1/( )/
m rP ss b m s a
= ⋅+ +
0 10 20 30 40 50-0.1
0
0.1
0.2
0.3
0.4
0.5
2.490.039
La== step
slope
1.2 /K a= 2*IT L= / 2DT L=
1( ) (1 )DI
C s K T sT s
= + +
( )L s( )P s
( )C s
( )L s( )C s( )P s
17 Nov 04 R. M. Murray, Caltech CDS 4
Pole Zero Diagrams and Root Locus Plots
Pole zero diagram verifies stability
Roots of 1 + PC give closed loop polesCan trace the poles as a parameter is changed:
Root locus = locus of roots as parameter value is changedCan plot pole location versus any parameter; just repeatedly solve for rootsCommon choice in control is to vary the loop gain (K)
C(s)+-
r ye uP(s)
-7 -6 -5 -4 -3 -2 -1 0 1 2 3-8
-6
-4
-2
0
2
4
6
8
Real AxisIm
agAx
is1( ) (1 )DI
C s K T sT s
= + +
α
α
Original polelocation (α = 0)
Pole goesto ∞
Pole goesunstable for some α
Pole goesto terminalvalue
Poles mergeand split
17 Nov 04 R. M. Murray, Caltech CDS 5
One Parameter Root LocusBasic idea: convert to “standard problem”:
Look at location of roots as α is varied over positive real numbersIf “phase” of a(s)/b(s) = 180°, we can always choose a real α to solve eqnCan compute the phase from the pole/zero diagram
Trace out positions in plane where phase = 180°
At each of these points, there exists gain α to satisfy a(s) + αb(s) = 0All such points are on root locus
( ) ( ) 0a s b sα+ =
1 2
1 2
( ) ( )( ) ( )( )( ) ( )( ) ( )
m
n
a s s z s z s zG s kb s s p s p s p
+ + += =
+ + +L
L
0 0 1 0
0 1 0
( ) ( ) ( )( ) ( )
m
n
G s s z s zs p s p
∠ = ∠ + + +∠ + −∠ + − −∠ +
L
L
φi = phase contribution from s0 to -pi
ψI = phase contribution from s0 to -zi
17 Nov 04 R. M. Murray, Caltech CDS 6
Root Locus for Loop Gain
Loop gain as root locus parameterCommon choice for control designSpecial properties for loop gain
Roots go from poles of PC to zeros of PCExcess poles go to infinityCan compute asymptotes, break points, etc
Very useful tool for control designMATLAB: rlocus
Additional commentsAlthough loop gain is the most common parameter, don’t forget that you can plot roots versus any parameterNeed to link root location to performance…
-7 -6 -5 -4 -3 -2 -1 0 1 2 3-8
-6
-4
-2
0
2
4
6
8
Real AxisIm
agAx
is
C(s)+-
r ye uP(s)α
Open loop polelocation (α = 0)
Closed pole goes to openloop zeros
Asymptotes for excess poles at
(360˚/(P-Z))
Real axis to theleft of odd # of real poles & zeros is on root locus( )1 ( ) ( ) 0
( )n s d s n sd s
α α+ → + =
17 Nov 04 R. M. Murray, Caltech CDS 7
Second Order System Response
Second order system responseSpring mass dynamics, written in canonical form
Performance specifications
Guidelines for pole placementDamping ratio gives Re/Im ratioSetting time determined by –Re(λ)
-20 -18 -16 -14 -12 -10 -8 -6 -4 -2 0-10
-8
-6
-4
-2
0
2
4
6
8
10
Imag
Axis
Real Axis
Root Locus Editor (C)
2 2
2 2( )2 ( )( )
n n
n n n d n d
H ss s s j s j
ω ωςω ω ςω ω ςω ω
= =+ + + + + −
1.8 /3.9 /
r n
s n
TT
ωςω
≈≈
21d nω ω ς= −
2/ 1
SS 0pM e
e
πς ς− −≈
=
44%16%4%Mp
-3.9-1.7-1
Slope
0.250.5
0.707ζ
Ts < x
Mp < yDesired regionfor closed loop poles
17 Nov 04 R. M. Murray, Caltech CDS 8
Effect of pole location on performance
Idea: look at “dominant poles”Poles nearest the imaginary axis (nearest to instability)Analyze using analogy to second order system
PZmap complements informa-tion on Bode/Nyquist plots
Similar to gain and phase calculationsShows performance in terms of the closed loop polesParticularly useful for choosing system gainAlso useful for deciding where to put controller poles and zeros (with practice [and SISOtool])
Time (sec.)
Am
plitu
de
Step Response
0 1 2 3 4 5 6 7 8 9 100
0.2
0.4
0.6
0.8
1
1.2
1.4From: U(1)
To: Y
(1)
Real Axis
Imag
Axi
s
Pole-zero map
-5 -4 -3 -2 -1 0 1-1.5
-1
-0.5
0
0.5
1
1.5
Time (sec.)
Am
plitu
de
Step Response
0 1 2 3 4 5 6 7 8 9 100
0.2
0.4
0.6
0.8
1
1.2
1.4From: U(1)
To: Y
(1)
Real Axis
Imag
Axi
s
Pole-zero map
-5 -4 -3 -2 -1 0 1-1.5
-1
-0.5
0
0.5
1
1.5
Time (sec.)
Am
plitu
de
Step Response
0 1 2 3 4 5 6 7 8 9 100
0.5
1
1.5
2
2.5
3
3.5From: U(1)
To: Y
(1)
Real Axis
Imag
Axi
s
Pole-zero map
-5 -4 -3 -2 -1 0 1-1.5
-1
-0.5
0
0.5
1
1.5
x
x
x
x
x
x
x
x
x
x
x
x
x
17 Nov 04 R. M. Murray, Caltech CDS 9
Example: PID cruise controlStart with PID control design: Modify gain to improve performance
Use MATLAB sisotoolAdjust loop gain (K) to reduce overshoot and decrease settling time
ζ ≈ 1 ⇒ less than 5% overshootRe(p) < -0.5 ⇒ Ts less than 2 sec
1/( )/
m rP ss b m s a
= ⋅+ +
1( ) (1 )DI
C s K T sT s
= + +
17 Nov 04 R. M. Murray, Caltech CDS 10
Example: Pitch Control for Caltech Ducted Fan
System descriptionVector thrust engine attached to wingInputs: fan thrust, thrust angle (vectored)Outputs: position and orientationStates: x, y, θ + derivativesDynamics: flight aerodynamics
Control approachDesign “inner loop” control law to regulate pitch (θ ) using thrust vectoringSecond “outer loop” controller regulates the position and altitude by commanding the pitch and thrustBasically the same approach as aircraft control laws
17 Nov 04 R. M. Murray, Caltech CDS 11
Performance Specification and Design Approach
Design approachOpen loop plant has poor phase marginAdd phase lead in 5-50 rad/sec rangeIncrease the gain to achieve steady state and tracking performance specsAvoid integrator to minimize phase
Performance Specification≤ 1% steady state error
Zero frequency gain > 100≤ 10% tracking error up to 10 rad/sec
Gain > 10 from 0-10 rad/sec≥ 45˚ phase margin
Gives good relative stabilityProvides robustness to uncertaintyFrequency (rad/sec)
Phas
e (d
eg);
Mag
nitu
de (d
B)
-50
0
50
100 101-200
-150
-100
-50
0
2( ) rP sJs ds mgl
=+ +
( ) s aC s Ks b+
=+
2530015 300
ab
K
=== ⋅
17 Nov 04 R. M. Murray, Caltech CDS 12
Summary: PID and Root Locus
PID control designVery common (and classical) control techniqueGood tools for choosing gains
Root locusShow closed loop poles as function of a free parameter
Performance limitsRHP poles and zeros place limits on achievable performanceWaterbed effect
p I Du K e K e K e= + +∫ &
Frequency (rad/sec)
Phas
e (d
eg);
Mag
nitu
de (d
B)
Bode Diagrams
0
10
20
30
40
50
10-3 10-2 10-1 100 101 102 103-100
-50
0
50
100
11
ITω = 2
1
DTω =
-7 -6 -5 -4 -3 -2 -1 0 1 2 3-8
-6
-4
-2
0
2
4
6
8
Real Axis
Imag
Axis