Вы находитесь на странице: 1из 12

CDS 101: Lecture 8.

2 Tools for PID & Loop Shaping


Richard M. Murray 17 November 2004 Goals: Show how to use loop shaping to achieve a performance specification Introduce new tools for loop shaping design: Ziegler-Nichols, root locus, lead compensation Work through some example control design problems Reading: strm and Murray, Analysis and Design of Feedback Systems, Ch 8

Tools for Designing PID controllers


d r + e C(s) + u P(s) y

C ( s ) = K (1 +

1 + TD s ) TI s

Step response Zeigler-Nichols tuning Design PID gains based on step response L Point of maximum Works OK for many plants (but underdamped) slope Good way to get a first cut controller a Frequency domain version also exists K = 1.2 / a TI = 2 * L TD = L / 2 Caution: PID amplifies high frequency noise Soln: pole at high frequency Bode Diagrams 80 Caution: Integrator windup 60 Prolonged error causes large integrated error 40 Effect: large undershoot (to reset integrator) 20 Soln: move pole at zero to very small value 0 Fancier soln: anti-windup compensation 10 10 10 10 10
Magnitude (dB)
-4 -2 0 2

Frequency (rad/sec)

17 Nov 04

R. M. Murray, Caltech CDS

Example: PID cruise control


0.5

P( s) =

1/ m r s +b/m s + a

0.4

0.3

L = 2.49 a = 0.039

step

0.2

Ziegler-Nichols design for cruise controller Plot step response, extract L and a, compute gains
Bode Diagrams
100 50

0.1

slope

-0.1

10

20

30

40

50

Step Response

C ( s)
Amplitude

1.5

Phase (deg); Magnitude (dB)

0 -50 -100 100

P( s)

L( s )
1

C ( s ) = K (1 +
0.5

P( s)

C ( s) L( s )
10
-2

1 + TD s ) TI s

K = 1.2 / a
0 0 10 20

TI = 2 * L
30 40

TD = L / 2
50 60

-100

Time (sec.)
-1 0 1

-200 -3 10

Result: sluggish increase loop gain


3

10

10

10

Frequency (rad/sec)

17 Nov 04

R. M. Murray, Caltech CDS

Pole Zero Diagrams and Root Locus Plots

r + e C(s) u P(s) y
8 6 4 2

Original pole location ( = 0)

Pole goes unstable for some

Pole zero diagram verifies stability Roots of 1 + PC give closed loop poles Can trace the poles as a parameter is changed:

Imag Axis

0 -2 -4 -6 -8 -7

Pole goes to Poles merge and split

Pole goes to terminal value

1 C ( s ) = K (1 + + TD s ) TI s

-6

-5

-4

-3

-2 -1 Real Axis

Root locus = locus of roots as parameter value is changed Can plot pole location versus any parameter; just repeatedly solve for roots Common choice in control is to vary the loop gain (K)
17 Nov 04 R. M. Murray, Caltech CDS 4

One Parameter Root Locus


Basic idea: convert to standard problem: a ( s ) + b( s ) = 0 Look at location of roots as is varied over positive real numbers If phase of a(s)/b(s) = 180, we can always choose a real to solve eqn Can compute the phase from the pole/zero diagram

G( s) =

a( s) ( s + z1 )( s + z2 ) L ( s + zm ) =k b( s ) ( s + p1 )( s + p2 ) L ( s + pn )

G ( s0 ) = ( s0 + z1 ) + L + ( s0 + zm ) ( s0 + p1 ) L ( s0 + pn )
Trace out positions in plane where phase = 180 At each of these points, there exists gain to satisfy a(s) + b(s) = 0 All such points are on root locus

i = phase contribution from s0 to -pi I = phase contribution from s0 to -zi

17 Nov 04

R. M. Murray, Caltech CDS

Root Locus for Loop Gain


8

e -

C(s)

P(s)

6 4 2 Imag Axis 0

1+

n( s) d ( s) + n( s) = 0 d ( s)

Open loop pole location ( = 0)

Real axis to the left of odd # of real poles & zeros is on root locus

Loop gain as root locus parameter -2 Closed pole Common choice for control design -4 Asymptotes for goes to open excess poles at loop zeros Special properties for loop gain (360/(P-Z)) -6 Roots go from poles of PC to -8 zeros of PC -7 -6 -5 -4 -3 -2 -1 0 1 2 3 Real Axis Excess poles go to infinity Additional comments Can compute asymptotes, break points, etc Although loop gain is the most common parameter, dont forget that you can plot Very useful tool for control design roots versus any parameter MATLAB: rlocus Need to link root location to performance
17 Nov 04 R. M. Murray, Caltech CDS 6

Second Order System Response


Second order system response Spring mass dynamics, written in canonical form Guidelines for pole placement Damping ratio gives Re/Im ratio Setting time determined by Re()

2 2 n n H ( s) = 2 = 2 s + 2n s + n ( s + n + jd )( s + n jd )

d = n 1 2

Performance specifications
Root Locus Editor (C)

Tr 1.8 / n Ts 3.9 / n

0.707 0.5 0.25

M p e / eSS = 0

10

2
8

Ts < x

Imag Axis

Mp 4% 16% 44%

Slope -1 -1.7 -3.9

Desired region for closed loop poles

Mp < y

-2

-4

-6

-8

-10 -20

-18

-16

-14

-12

-10

-8

-6

-4

-2

17 Nov 04

R. M. Murray, Caltech CDS

Real Axis

Effect of pole location on performance


Pole-zero map Step Response
From: U(1) 1.4

Idea: look at dominant poles Poles nearest the imaginary axis (nearest to instability) Analyze using analogy to second order system PZmap complements information on Bode/Nyquist plots Similar to gain and phase calculations Shows performance in terms of the closed loop poles Particularly useful for choosing system gain Also useful for deciding where to put controller poles and zeros (with practice [and SISOtool])
17 Nov 04

1.5

x
Amplitude

1.2

1 0.5

Imag Axis

x x
-4 -3 -2 -1 0 1

To: Y(1)

0.8

0.6

-0.5 0.4

-1

0.2

-1.5 -5

0 0 1 2 3 4 5 6 7 8 9 10

Real Axis Pole-zero map


1.5

Time (sec.) Step Response


From: U(1) 1.4

x x
Amplitude
To: Y(1)

1.2

1 0.5

Imag Axis

x x
-4 -3

0.8

0.6

-0.5 0.4

-1

0.2

-1.5 -5

x
-2

0 -1 0 1 0 1 2 3 4 5 6 7 8 9 10

Real Axis Pole-zero map


1.5

Time (sec.) Step Response


From: U(1)

x x
Amplitude
To: Y(1)

3.5

2.5 0.5

Imag Axis

x x
-4 -3 -2 -1

1.5

-0.5 1

-1

0.5

-1.5 -5

0 0 1 0 1 2 3 4 5 6 7 8 9 10

Real Axis

Time (sec.)

R. M. Murray, Caltech CDS

Example: PID cruise control


Start with PID control design:

P( s) =

1/ m r s +b/m s + a

C ( s ) = K (1 +

1 + TD s ) TI s

Modify gain to improve performance Use MATLAB sisotool Adjust loop gain (K) to reduce overshoot and decrease settling time 1 less than 5% overshoot Re(p) < -0.5 Ts less than 2 sec

17 Nov 04

R. M. Murray, Caltech CDS

Example: Pitch Control for Caltech Ducted Fan


System description Vector thrust engine attached to wing Inputs: fan thrust, thrust angle (vectored) Outputs: position and orientation States: x, y, + derivatives Dynamics: flight aerodynamics Control approach Design inner loop control law to regulate pitch ( ) using thrust vectoring Second outer loop controller regulates the position and altitude by commanding the pitch and thrust Basically the same approach as aircraft control laws
17 Nov 04 R. M. Murray, Caltech CDS 10

Performance Specification and Design Approach


50

-50 0 -50 -100 -150 -200

10

10

Frequency (rad/sec)

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 stability Provides robustness to uncertainty

Phase (deg); Magnitude (dB)

Design approach Open loop plant has poor phase margin Add phase lead in 5-50 rad/sec range Increase the gain to achieve steady state and tracking performance specs Avoid integrator to minimize phase
17 Nov 04

P( s) =

r Js 2 + ds + mgl a = 25 b = 300 K = 15 300


11

C ( s) = K

s+a s+b

R. M. Murray, Caltech CDS

Summary: PID and Root Locus


PID control design Very common (and classical) control technique Good tools for choosing gains Root locus Show closed loop poles as function of a free parameter Performance limits RHP poles and zeros place limits on achievable performance Waterbed effect
8 6 4 Imag Axis
10
-2

& u = K pe + K I e + K De
Bode Diagrams
50 40

1 =

Phase (deg); Magnitude (dB)

30 20 10 0 100 50 0 -50 -100 -3 10

1 TI

2 =

1 TD

2 0 -2 -4 -6

10

-1

10

10

10

10

-8 -7

-6

-5

-4

-3

17 Nov 04

Frequency (rad/sec)

-2 -1 Real Axis

R. M. Murray, Caltech CDS

12

Вам также может понравиться