13 ControlofSecond-OrderSystemmurray/courses/cds101/fa02/caltech/pph02-c… · Normalized Time...

22
13 Control of Second-Order System In this section, we analyze PD and PID control of a plant typical in mechanical positioning systems. We also propose a possible design method. The nominal model for the plant is P (s)= A s(s + p) where A and p are fixed parameters. 13.1 PD control First, consider PD control, specifically proportional control, with inner loop rate- feedback. This is shown below (its just the PID diagram, with the integral action removed) K P K D A 1 s+p 1 s - - u r y d Inner-loop Rate-Feedback × In terms of plant and controller parameters, the loop gain (at breaking point marked by ×) is L(s)= A(K D s + K P ) s(s + p) In other words, from a stability point of view, the system is just unity-gain, negative feedback around L. K P K D A 1 s+p 1 s y 126

Transcript of 13 ControlofSecond-OrderSystemmurray/courses/cds101/fa02/caltech/pph02-c… · Normalized Time...

Page 1: 13 ControlofSecond-OrderSystemmurray/courses/cds101/fa02/caltech/pph02-c… · Normalized Time (wn*t) Normalized Response, wn^2 y Normalized Disturbance Response, PD 130 †Unit step

13 Control of Second-Order System

In this section, we analyze PD and PID control of a plant typical in mechanicalpositioning systems. We also propose a possible design method. The nominalmodel for the plant is

P (s) =A

s(s+ p)

where A and p are fixed parameters.

13.1 PD control

First, consider PD control, specifically proportional control, with inner loop rate-feedback. This is shown below (its just the PID diagram, with the integral actionremoved)

KP

KD

A1

s+p1s

- i - - i - - - i?- - -

?

¾

6?

¾¾

6− −ur y

d

Inner-loop Rate-Feedback

×

In terms of plant and controller parameters, the loop gain (at breaking pointmarked by ×) is

L(s) =A(KDs+KP )

s(s+ p)

In other words, from a stability point of view, the system is just unity-gain, negativefeedback around L.

KP

KD

A1

s+p1s

- - i - - - i?- - -

?

¾

6

?

¾¾

6

y

126

Page 2: 13 ControlofSecond-OrderSystemmurray/courses/cds101/fa02/caltech/pph02-c… · Normalized Time (wn*t) Normalized Response, wn^2 y Normalized Disturbance Response, PD 130 †Unit step

The closed-loop transfer function from R and D to Y is

Y (s) =AKP

s2 + (AKD + p)s+ AKP

R(s) +1

s2 + (AKD + p)s+ AKP

D(s)

The characteristic equation is

CE : s2 + (AKD + p)s+ AKP

Clearly, with two controller parameters, and a 2nd order closed-loop system, thepoles can be freely assigned. Using the (ξ, ωn) parametrization, we set the charac-teristic equation to be

s2 + 2ξωns+ ω2n

giving design equations

KP :=ω2n

A, KD :=

2ξωn − pA

In terms of the (ξ, ωn) parametrization, the loop gain and transfer functions are

L(s) =(2ξωn − p)s+ ω2

n

s(s+ p)

Y (s) =ω2n

s2 + 2ξωn + ω2n

R(s) +1

s2 + 2ξωn + ω2n

D(s) (66)

Although this is a 2nd order system, and most quantities can be computed an-alytically, the formulae that arise are rather messy, and interpretation ends uprequiring plotting. Hence, we skip the analytic calculations, and simply numeri-cally compute and plot interesting properties for different values of ωn, p and ξ.Normalization is the key to displaying the data in a cohesive and minimal fashion.

For now, take p = 0 (you should take the time to write a MatLab script filethat duplicates these results for arbitrary p). In this case, it is possible to writeeverything in terms of normalized frequency, all relative to ωn. This simultaneouslyleads to a normalization in time (recall homework 8). Hence frequency responsesare plotted G(jω) versus ω

ωn, and time responses plotted y(t) versus ωnt. We

consider a few typical values for ξ.

127

Page 3: 13 ControlofSecond-OrderSystemmurray/courses/cds101/fa02/caltech/pph02-c… · Normalized Time (wn*t) Normalized Response, wn^2 y Normalized Disturbance Response, PD 130 †Unit step

The plots below are:

• Magnitude/Phase plots of Loop transfer function. These are normalizedin frequency, and show L(jω) versus ω

ωn. From these, we can read off the

crossover frequencies and margins.

xi = 0.5

xi = 0.707

xi = 0.95

xi = 1.3

10−2

10−1

100

101

102

10−2

10−1

100

101

102

103

104

Normalized Frequency (w/wn)

Mag

nitu

de

Open−Loop Transfer Function, PD

xi = 0.5

xi = 0.707

xi = 0.95

xi = 1.3

10−2

10−1

100

101

102

−180

−170

−160

−150

−140

−130

−120

−110

−100

−90

Normalized Frequency (w/wn)

Phas

e (d

egre

es)

Open−Loop Transfer Function, PD

128

Page 4: 13 ControlofSecond-OrderSystemmurray/courses/cds101/fa02/caltech/pph02-c… · Normalized Time (wn*t) Normalized Response, wn^2 y Normalized Disturbance Response, PD 130 †Unit step

• Magnitude/Phase plots of closed-loop R → Y transfer function. These arenormalized in frequency, and show GR→Y (jω) versus

ωωn.

xi = 0.5

xi = 0.707

xi = 0.95

xi = 1.3

10−2

10−1

100

101

102

10−4

10−3

10−2

10−1

100

101

Normalized Frequency (w/wn)

Mag

nitu

de

R−>Y Frequency Response, PD

xi = 0.5

xi = 0.707

xi = 0.95

xi = 1.3

10−2

10−1

100

101

102

−180

−160

−140

−120

−100

−80

−60

−40

−20

0

Normalized Frequency (w/wn)

Pha

se (d

egre

es)

R−>Y Frequency Response, PD

129

Page 5: 13 ControlofSecond-OrderSystemmurray/courses/cds101/fa02/caltech/pph02-c… · Normalized Time (wn*t) Normalized Response, wn^2 y Normalized Disturbance Response, PD 130 †Unit step

• Magnitude plot of closed-loop D → Y These are normalized in frequencyand magnitude,, and show ω2

nGD→Y (jω) versusωωn.

xi = 0.5

xi = 0.707

xi = 0.95

xi = 1.3

10−2

10−1

100

101

102

10−4

10−3

10−2

10−1

100

101

Normalized Frequency (w/wn)

Nor

mal

ized

Mag

nitu

de, |

wn^

2 G

|

Normalized Disturbance Response, PD

• Unit step d → y responses. These are normalized both in time, and inresponse. Hence the plot is ω2

ny(t) versus ωnt.

xi = 0.5

xi = 0.707

xi = 0.95

xi = 1.3

0 1 2 3 4 5 6 7 80

0.2

0.4

0.6

0.8

1

1.2

Normalized Time (wn*t)

Nor

mal

ized

Res

pons

e, w

n^2

y

Normalized Disturbance Response, PD

130

Page 6: 13 ControlofSecond-OrderSystemmurray/courses/cds101/fa02/caltech/pph02-c… · Normalized Time (wn*t) Normalized Response, wn^2 y Normalized Disturbance Response, PD 130 †Unit step

• Unit step r → y responses. These are normalized in time, and show y(t)versus ωnt.

xi = 0.5

xi = 0.707

xi = 0.95

xi = 1.3

0 1 2 3 4 5 6 7 80

0.2

0.4

0.6

0.8

1

1.2

Normalized Time (wn*t)

Y

R−>Y Step Response, PD

• Magnitude plot of closed-loop R → E. These are normalized in frequency,and show GR→E(jω) versus

ωωn.

xi = 0.5

xi = 0.707

xi = 0.95

xi = 1.3

10−2

10−1

100

101

102

10−2

10−1

100

101

Normalized Frequency (w/wn)

Mag

nitu

de

R−>E (Sensitivity), PD

Some things to notice.

131

Page 7: 13 ControlofSecond-OrderSystemmurray/courses/cds101/fa02/caltech/pph02-c… · Normalized Time (wn*t) Normalized Response, wn^2 y Normalized Disturbance Response, PD 130 †Unit step

• The r → y response has the canonical 2nd order response we have come toknow and love.

• The steady-state disturbance rejection properties are dependent on ωn. Asωn increases, the effect of a disturbance d on the output y is decreased.Hence, in order to improve the disturbance rejection characteristics, we needto pick larger ωn.

• Depending on ξ, the gain-crossover frequency is between about 1.3ωn and2.5ωn. So, using this controller architecture, the gain crossover frequencymust increase when the steady-state disturbance rejection is improved. Thephase margin varies between 53◦ and 83◦.

• There is no phase-crossover frequency, so as defined, the gain margin is infi-nite.

• The closer that the complex frequency response remains to 1 (over a largefrequency range), the better the r → y response. The term “bandwidth” isoften used to mean the largest frequency ωB such that for all ω satisfying0 ≤ ω ≤ ωB,

|1−GR→Y (jω)| ≤ 0.3

Be careful with the word “bandwidth.” Make sure whoever you are talkingto agrees on exactly what you both mean. Sometimes people use it to meanthe gain crossover frequency. Generally, the higher the bandwidth, the fasterthe response, and better the disturbance rejection. Of course, its hard toexplicitly assess time-domain properties from a single number about a fre-quency response, so use it carefully. The same types of intuition can also beassessed by looking at the frequency range over which the transfer functionis GR→E small, and also verifying that it is not too large in another range.

13.2 PID Control

In order to reduce the steady-state effect of the disturbance, we next analyzePID control, namely proportional+integral, with inner loop rate feedback. This isshown below.

KI

KP

KD

A1

s+p1s

- i - - - i - - - i?- - -

¢¢¢

?

¾

6?

¾¾

6

-

− −ur y

d

Inner-loop Rate-Feedback

132

Page 8: 13 ControlofSecond-OrderSystemmurray/courses/cds101/fa02/caltech/pph02-c… · Normalized Time (wn*t) Normalized Response, wn^2 y Normalized Disturbance Response, PD 130 †Unit step

The open-loop transfer function is

L(s) =A(KDs

2 +KP s+KI)

s2(s+ p)

The closed-loop transfer function is

Y (s) =A(KP s+KI)

s3 + (p+ AKD)s2 + AKP s+ AKI

R(s) +s

s3 + (p+ AKD)s2 + AKP s+ AKI

D(s)

The closed-loop characteristic equation is

s3 + (p+ AKD)s2 + AKP s+ AKI

With three controller parameters, and a 3rd order closed-loop system, the polescan be freely assigned. Using the (ξ, ωn) parametrization, along with a 3rd pole at−αωn, we set the characteristic equation to be

CE : (s2 + 2ξωns+ ω2n)(s+ αωn)

Multiplied out, this gives

s3 + (2ξ + α)ωns2 + (2ξα + 1)ω2

ns+ αω3n

Choosing specific values of ξ, ωn and α yields appropriate controller gains, via thedesign equations, which are obtained by simply equating coefficients,

KD =(2ξ + α)ωn − p

A, KP =

(2ξα + 1)ω2n

A, KI =

αω3n

A

Note that for α¿ 1, the design equations giveKD andKP as in the PD case, alongwith a very small integral control term. Hence, for a given pair (ξ, ωn), picking αsmall and doing the full PID design is equivalent to doing the PD design for ξ andωn, and then simply adding a small amount of integral control as an afterthought.That approach will leave a closed-loop pole near the origin, approximately ats = −AKI

ω2n(= −αωn).

In terms of the parameters, the closed-loop transfer function is

Y (s) =(2ξα + 1)ω2

ns+ αω3n

(s2 + 2ξωns+ ω2n)(s+ αωn)

R(s) +s

(s2 + 2ξωns+ ω2n)(s+ αωn)

D(s)

The steady-state gain from d to y is zero, due to the integral term. Again, takethe case p = 0. For clarity, let’s also pick ξ = 0.707, and only study the variationin responses due to our choice of α. Again, the normalization with ωn is complete,in both time and frequency, with frequency responses plotted versus ω

ωn, and time

responses plotted versus ωnt.

133

Page 9: 13 ControlofSecond-OrderSystemmurray/courses/cds101/fa02/caltech/pph02-c… · Normalized Time (wn*t) Normalized Response, wn^2 y Normalized Disturbance Response, PD 130 †Unit step

The plots below are:

• Magnitude/Phase plots of Loop transfer function

alpha = 0.1

alpha = 0.3162

alpha = 1

alpha = 3.162

alpha = 10

10−2

10−1

100

101

102

10−2

10−1

100

101

102

103

104

105

106

107

Normalized Frequency (w/wn)

Mag

nitu

de

Open−Loop Transfer Function, PID, xi = 0.707

alpha = 0.1

alpha = 0.3162

alpha = 1

alpha = 3.162

alpha = 10

10−2

10−1

100

101

102

50

100

150

200

250

300

Normalized Frequency (w/wn)

Phas

e (d

egre

es)

Open−Loop Transfer Function, PID, xi = 0.707

134

Page 10: 13 ControlofSecond-OrderSystemmurray/courses/cds101/fa02/caltech/pph02-c… · Normalized Time (wn*t) Normalized Response, wn^2 y Normalized Disturbance Response, PD 130 †Unit step

• Magnitude/Phase plots of closed-loop R→ Y transfer function

alpha = 0.1

alpha = 0.3162

alpha = 1

alpha = 3.162

alpha = 10

10−2

10−1

100

101

102

10−4

10−3

10−2

10−1

100

101

Normalized Frequency (w/wn)

Mag

nitu

deR−>Y Frequency Response, PID, xi = 0.707

alpha = 0.1

alpha = 0.3162

alpha = 1

alpha = 3.162

alpha = 10

10−2

10−1

100

101

102

−180

−160

−140

−120

−100

−80

−60

−40

−20

0

Normalized Frequency (w/wn)

Pha

se (d

egre

es)

R−>Y Frequency Response, PID, xi = 0.707

• Magnitude plot of closed-loop R→ E

135

Page 11: 13 ControlofSecond-OrderSystemmurray/courses/cds101/fa02/caltech/pph02-c… · Normalized Time (wn*t) Normalized Response, wn^2 y Normalized Disturbance Response, PD 130 †Unit step

• Normalized Disturbance-to-output response

alpha = 1e−05

alpha = 0.1

alpha = 0.3162

alpha = 1

alpha = 3.162

alpha = 10

10−2

10−1

100

101

102

10−4

10−3

10−2

10−1

100

Normalized Frequency (w/wn)

| wn^

2 G

|Normalized Disturbance Response, xi = 0.707

alpha = 1e−05

alpha = 0.1

alpha = 0.3162

alpha = 1

alpha = 3.162

alpha = 10

0 1 2 3 4 5 6 7 8−0.2

0

0.2

0.4

0.6

0.8

1

1.2

Normalized Time (wn*t)

wn^

2 y

Normalized Disturbance Response, xi = 0.707

136

Page 12: 13 ControlofSecond-OrderSystemmurray/courses/cds101/fa02/caltech/pph02-c… · Normalized Time (wn*t) Normalized Response, wn^2 y Normalized Disturbance Response, PD 130 †Unit step

• Unit step r → y responses

alpha = 0.1

alpha = 0.3162

alpha = 1

alpha = 3.162

alpha = 10

0 1 2 3 4 5 6 7 80

0.2

0.4

0.6

0.8

1

1.2

1.4

Normalized Time (wn*t)

YR−>Y Step Response, PID, xi = 0.707

• R→ E magnitude plots

alpha = 0.1

alpha = 0.3162

alpha = 1

alpha = 3.162

alpha = 10

10−2

10−1

100

101

102

10−4

10−3

10−2

10−1

100

101

Normalized Frequency (w/wn)

Mag

nitu

de

R−>E (Sensitivity), PID, xi = 0.707

Some things to notice.

137

Page 13: 13 ControlofSecond-OrderSystemmurray/courses/cds101/fa02/caltech/pph02-c… · Normalized Time (wn*t) Normalized Response, wn^2 y Normalized Disturbance Response, PD 130 †Unit step

• For a given ωn and α > 1, both the crossover frequencies, and bandwidth(look atGR→E) are much higher than the PD case. This is somewhat reflectedin quicker rise times and comparable settling times.

• The gain crossover frequency increases significantly with increasing α. Forinstance, at α ≈ 0 (which is the same as the PD control) the crossoverfrequency is about 1.7ωn, whereas for the crossover frequency jumps to ap-proximately ≈ 5ωn at α ≈ 3.1. At the respective crossover frequencies, thephase margins of eth PD and PID designs are similar.

• As α increases, the disturbance rejection properties change. Any (and every)α > 0 gives perfect steady-state disturbance rejection, but the time-domainand frequency domain properties for different α are quite different.

• It is instructive to calculate the residue associated with the pole at −αωn

when r(t) is a unit step. It is then fairly easy to explain the slow settlingtimes that occur for the intermediate values of α.

Remember, in typical applications, the uncertainty in the plant’s behavior increaseswith increasing frequency, so designs that lead to higher crossover frequencies usu-ally are required (for confidence) to have significantly larger phase margins. Usu-ally, for a given problem, modeling innaccuracies and unknown dynamics typicallyimpose a maximum allowable crossover frequency, regardless of phase margin.

138

Page 14: 13 ControlofSecond-OrderSystemmurray/courses/cds101/fa02/caltech/pph02-c… · Normalized Time (wn*t) Normalized Response, wn^2 y Normalized Disturbance Response, PD 130 †Unit step

Since some normalization is possible (using ωn), brute-force repeated simulationallows us to approximately compute several functions. They are functions of p,ξ and α. Here, we imagine that p is known, and fixed. We also propose to fixξ = 0.707, leaving only functions of α. In any given design situation, it may benecessary to modify the choice of ξ, and recompute. The functions are plottedbelow.

• normalized crossover frequency versus α

10−2

10−1

100

101

102

0

20

40

60

80

100Normalized Gain Crossover Frequency, xi = 0.707

wc/

wn

Alpha

139

Page 15: 13 ControlofSecond-OrderSystemmurray/courses/cds101/fa02/caltech/pph02-c… · Normalized Time (wn*t) Normalized Response, wn^2 y Normalized Disturbance Response, PD 130 †Unit step

• phase margin versus α

10−2

10−1

100

101

102

60

65

70

75

80

85

90Phase Margin, xi = 0.707

PHI

Alpha

140

Page 16: 13 ControlofSecond-OrderSystemmurray/courses/cds101/fa02/caltech/pph02-c… · Normalized Time (wn*t) Normalized Response, wn^2 y Normalized Disturbance Response, PD 130 †Unit step

• normalized rise time versus α

10−2

10−1

100

101

102

1

1.5

2

2.5

3

3.5Normalized Rise Time, xi = 0.707

Alpha

wn*

Tris

e

• normalized settling time versus α

2 percent

3 percent

4 percent

10−2

10−1

100

101

102

0

5

10

15

20

25

30Normalized Settling Time, xi = 0.707

Alpha

wn*

Tset

tle

141

Page 17: 13 ControlofSecond-OrderSystemmurray/courses/cds101/fa02/caltech/pph02-c… · Normalized Time (wn*t) Normalized Response, wn^2 y Normalized Disturbance Response, PD 130 †Unit step

• normalized peak response due to step disturbance versus α

10−2

10−1

100

101

102

0

0.2

0.4

0.6

0.8

1

1.2Normalized Peak Disturbance Response, xi = 0.707

Alpha

wn^

2 y

• normalized settling time due to step disturbance versus α

10−2

10−1

100

101

102

0

50

100

150

200

250

300

350

400Normalized Disturbance Settling (Relative), xi = 0.707

Alpha

wn*

Tset

tle

142

Page 18: 13 ControlofSecond-OrderSystemmurray/courses/cds101/fa02/caltech/pph02-c… · Normalized Time (wn*t) Normalized Response, wn^2 y Normalized Disturbance Response, PD 130 †Unit step

• percentage overshoot versus α

10−2

10−1

100

101

102

5

10

15

20

25

30

35Percent Overshoot, xi = 0.707

Alpha

% O

vers

hoot

Suppose that these have been computed reasonably accurately, at sufficiently largenumbers of α values. Can we use all of this data to develop a foolproof designmethod?

13.3 A Brute-Force Design Method

In designing the PID controller gains, the free parameters (at this point) to be cho-sen are ξ, ωn and α. For fixed choice of ξ, we can precompute functions f1, f2, . . . , f5of α such that

1. Gain crossover frequency (ωc) equals ωnf1(α)

2. Rise Time (tR) equals f2(α)/ωn

3. Settling Time (tS) equals f3(α)/ωn

4. Peak response to step disturbance (yd,max) equals f4(α)/ω2n

5. Settling time of step disturbance response (tS,d) equals f5(α)/ωn

So, given target requirements, we can fairly easily determine if there is a PIDcontroller which satisfies the objectives. Specifically, take objectives as

ωc ≤ ωc, tR ≤ tR, tS ≤ tS, yd,max ≤ yd,max, tS,d ≤ tS,d

143

Page 19: 13 ControlofSecond-OrderSystemmurray/courses/cds101/fa02/caltech/pph02-c… · Normalized Time (wn*t) Normalized Response, wn^2 y Normalized Disturbance Response, PD 130 †Unit step

where the over-bar quantities are targets. Hence we search for values of ωn and αwhich satisfy

gL(α) := max

f2(α)

tR,f3(α)

tS,

√√√√f4(α)

yd,max

,f5(α)

tS,d

≤ ωn ≤

ωc

f1(α)=: gU(α)

Hence, we simply graph the two functions gL and gU , and see if there is any valueof α where gl(α) ≤ gu(α). If so, then simply pick an α∗ for which the inequality ittrue, and pick any ω∗n such that

gL(α∗) ≤ ω∗n ≤ gU(α

∗)

Moreover, since the overshoot reaches a maximum at α = 1, and falls off on bothsides, you can easily reduce the overshoot by moving to one side of the feasibleregion.

13.4 Design Example

Consider the Lab, with single inertia, and pulley. The PD control worked reason-ably well with ωn = 25, and ξ = 0.707. This implies that a phase margin of 65◦ ata crossover frequency of 38 is adequate for stability robustness. So, in designing aPID controller, let’s aim for a crossover frequency of 38, a rise time of 0.4 seconds,settling time of 0.55 seconds, and a disturbance response settling time of 0.7 sec-onds. We’ll set the peak disturbance response at 5, which essentially makes it notrelevant, and then we could tighten down on it if we wanted.

The constraints on α and ωn are shown below

10−2

10−1

100

101

102

10−2

10−1

100

101

102

103

Alpha

wn

wn/Alpha Design Options

144

Page 20: 13 ControlofSecond-OrderSystemmurray/courses/cds101/fa02/caltech/pph02-c… · Normalized Time (wn*t) Normalized Response, wn^2 y Normalized Disturbance Response, PD 130 †Unit step

The circle is the point I chose, which MatLab tells me is

α = 0.36, ωn = 19.2

which is pretty similar to what we had working in the lab. Plots of the variousrelevant quantities

• Open-Loop gain

100

101

102

103

10−2

10−1

100

101

102

Open−Loop Gain

Frequency, rad/sec

| L(j

w) |

145

Page 21: 13 ControlofSecond-OrderSystemmurray/courses/cds101/fa02/caltech/pph02-c… · Normalized Time (wn*t) Normalized Response, wn^2 y Normalized Disturbance Response, PD 130 †Unit step

• Open-Loop Phase

100

101

102

103

100

120

140

160

180

200

220

240

260

280Open−Loop Phase

Frequency, rad/sec

Pha

se L

(j w

), de

gree

s

• Response to unit-step reference

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 10

0.2

0.4

0.6

0.8

1

1.2

1.4Unit Step response

Time, sec

y

146

Page 22: 13 ControlofSecond-OrderSystemmurray/courses/cds101/fa02/caltech/pph02-c… · Normalized Time (wn*t) Normalized Response, wn^2 y Normalized Disturbance Response, PD 130 †Unit step

• Response to unit-step disturbance

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 10

0.2

0.4

0.6

0.8

1

1.2

1.4

1.6x 10

−3 Unit Step disturbance response

Time, sec

y

147