Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

CDS 101, Lecture 9.

R. M. Murray, Caltech

CDS 101: Lecture 9.2 PID and Root Locus


Richard M. Murray 26 November 2003 Goals: Define PID controllers and describe how to use them Describe root locus diagram and show how to use it to choose loop gain Reading: Astrom, Sec 6.1-6.4, 6.6 Optional: PPH, Sec 13 Advanced: Lewis, Chapter 12 + Sec 13.1

Overview: PID control


r + e PID u P(s) y

& u = K pe + K I e + KDe

Intuition Proportional term: provides inputs that correct for current errors Integral term: insures steady state error goes to zero Derivative term: provides anticipation of upcoming changes A bit of history on three term control First appeared in 1922 paper by Minorsky: Directional stability of automatically steered bodies under the name three term control Also realized that small deviations (linearization) could be used to understand the (nonlinear) system dynamics under control Utility of PID PID control is most common feedback structure in engineering systems For many systems, only need PI or PD (special case) Many tools for tuning PID loops and designing gains (see reading)
26 Nov 03 R. M. Murray, Caltech CDS 2

26 November 2003

CDS 101, Lecture 9.2

R. M. Murray, Caltech

Frequency domain compensation with PID


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

1 C ( s) = K p + K I + K D s s 1 = k (1 + + TD s ) TI s kT ( s + 1/ TI )( s + 1/ TD ) = D TI s
Bode Diagrams
50 40

Transfer function for PID controller

& u = K pe + K I e + KDe
Phase (deg); Magnitude (dB)

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

1 =

1 TI

2 =

1 TD

1 H ue ( s ) = K p + K I + K D s s
Roughly equivalent to a PI controller with lead compensation Idea: gives high gain at low frequency plus phase lead at high frequency Place below desired crossover freq
26 Nov 03

10

-2

10

-1

10

10

10

10

Frequency (rad/sec)

R. M. Murray, Caltech CDS

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)

26 Nov 03

R. M. Murray, Caltech CDS

26 November 2003

CDS 101, Lecture 9.2

R. M. Murray, Caltech

PID vs lead/lag compensation


PID Control Lead/Lag Compensation

1 C (s) = K p + K I + K D s s
Bode Diagram 50 Magnitude (dB) 40 30 20 10 0 90 Phase (deg) 45 0 -45 -90 -3 10 -2 -1 0 1 2 3 Phase (deg) Magnitude (dB) 50 40 30 20 10 0 90 45 0 -45 -90 -3 10

C ( s) = K

s + alag s + alead s + blag s + blead


Bode Diagram

1 =

1 TI

2 =

1 TD

1 = blag 2 = alag
3 = alead

4 = blead

10

10

10

10

10

10

10

-2

10

-1

10

10

10

10

Frequency (rad/sec)

Frequency (rad/sec)

Pros: easy to design, implement Cons: low freq lag, high freq gain
26 Nov 03

Pros: low freq phase, high freq rolloff Cons: more complicated (slightly)
5

R. M. Murray, Caltech CDS

Example: PID cruise control


0.5

1/ m r P( s ) = s +b/m s + a
Ziegler-Nichols design for cruise controller Plot step response, extract L and a, compute gains
Bode Diagrams
100 50

0.4

0.3

L = 2.49 a = 0.039

step

0.2

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.)
-200 -3 10
-1 0 1

Result: sluggish increase loop gain


6

10

10

10

Frequency (rad/sec)

26 Nov 03

R. M. Murray, Caltech CDS

26 November 2003

CDS 101, Lecture 9.2

R. M. Murray, Caltech

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

C ( s ) = K (1 +

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)
26 Nov 03 R. M. Murray, Caltech CDS 7

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

26 Nov 03

R. M. Murray, Caltech CDS

26 November 2003

CDS 101, Lecture 9.2

R. M. Murray, Caltech

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
26 Nov 03 R. M. Murray, Caltech CDS 9

Second Order System Response


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

2 2 n n = 2 s 2 + 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

1 2

10

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

26 Nov 03

R. M. Murray, Caltech CDS

Real Axis

10

26 November 2003

CDS 101, Lecture 9.2

R. M. Murray, Caltech

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])
26 Nov 03

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

11

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

26 Nov 03

R. M. Murray, Caltech CDS

12

26 November 2003

CDS 101, Lecture 9.2

R. M. Murray, Caltech

Example: Ducted fan lateral position control

P( s ) =
( x, y )
f2 f1

( s 2 mgl ) s 2 ( Js 2 + ds + mgl )

Lateral control (x) Right half plane zero makes design very tricky using y as output
Root Locus Design

20

15

Magnitude (dB)

-40

-60

Reduced sensitivity better performance up to higher frequency


-3

Imag Axes

-20

1 1 + PC

waterbed
10 5 0 -5 -10 -15 -15

-80 10 10
-2

10

-1

10

10

10

Frequency (rad/sec)

-10

-5

0 Real Axis

10

26 Nov 03

R. M. Murray, Caltech CDS

13

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 + KDe
Bode Diagrams
50 40

Phase (deg); Magnitude (dB)

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

1 =

1 TI

2 =

1 TD

2 0 -2 -4 -6

10

-1

10

10

10

10

-8 -7

-6

-5

-4

-3

26 Nov 03

Frequency (rad/sec)

-2 -1 Real Axis

R. M. Murray, Caltech CDS

14

26 November 2003

You might also like