You are on page 1of 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 A P (s) = s(s + p) where A and p are xed parameters.

13.1

PD control

First, consider PD control, specically proportional control, with inner loop ratefeedback. This is shown below (its just the PID diagram, with the integral action removed) d r
E i EK P E i E

c E A E i E

1 s+p

E c

1 s

E c

KD ' '
'

Inner-loop Rate-Feedback

In terms of plant and controller parameters, the loop gain (at breaking point marked by ) is A(KD s + KP ) L(s) = s(s + p) In other words, from a stability point of view, the system is just unity-gain, negative feedback around L.

E KP

E i

c E A E i E

1 s+p

E c

1 s

E c

KD ' '
'

126

The closed-loop transfer function from R and D to Y is Y (s) = s2 AKP 1 R(s) + 2 D(s) + (AKD + p)s + AKP s + (AKD + p)s + AKP

The characteristic equation is CE : s2 + (AKD + p)s + AKP

Clearly, with two controller parameters, and a 2nd order closed-loop system, the poles can be freely assigned. Using the (, n ) parametrization, we set the characteristic equation to be 2 s2 + 2n s + n giving design equations
2 n , KP := A

KD :=

2n p A

In terms of the (, n ) parametrization, the loop gain and transfer functions are L(s) = Y (s) =
2 (2n p)s + n s(s + p)

2 1 n R(s) + 2 D(s) 2 + 2 + 2 2 s s + 2n + n n n

(66)

Although this is a 2nd order system, and most quantities can be computed analytically, the formulae that arise are rather messy, and interpretation ends up requiring plotting. Hence, we skip the analytic calculations, and simply numerically compute and plot interesting properties for dierent 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 le that duplicates these results for arbitrary p). In this case, it is possible to write everything in terms of normalized frequency, all relative to n . This simultaneously leads to a normalization in time (recall homework 8). Hence frequency responses are plotted G(j) versus n , and time responses plotted y(t) versus n t. We consider a few typical values for .

127

The plots below are: Magnitude/Phase plots of Loop transfer function. These are normalized in frequency, and show L(j) versus n . From these, we can read o the crossover frequencies and margins.
OpenLoop Transfer Function, PD

10

10

xi = 0.5 xi = 0.707 xi = 0.95

10

xi = 1.3

Magnitude

10

10

10

10

10

10

10 Normalized Frequency (w/wn)

10

10

OpenLoop Transfer Function, PD 90 100 110 120

Phase (degrees)

130 140 150 160 170 180 2 10 xi = 0.5 xi = 0.707 xi = 0.95 xi = 1.3

10

10 Normalized Frequency (w/wn)

10

10

128

Magnitude/Phase plots of closed-loop R Y transfer function. These are normalized in frequency, and show GRY (j) versus n .
R>Y Frequency Response, PD

10

10

10

Magnitude

10

xi = 0.5 xi = 0.707 xi = 0.95

10

xi = 1.3

10

10

10

10 Normalized Frequency (w/wn)

10

10

R>Y Frequency Response, PD 0 20 40 60

xi = 0.5 xi = 0.707 xi = 0.95 xi = 1.3

Phase (degrees)

80 100 120 140 160 180 2 10

10

10 Normalized Frequency (w/wn)

10

10

129

Magnitude plot of closed-loop D Y These are normalized in frequency 2 and magnitude,, and show n GDY (j) versus n .
Normalized Disturbance Response, PD

10

xi = 0.5 xi = 0.707 10
0

xi = 0.95 xi = 1.3

Normalized Magnitude, | wn^2 G |

10

10

10

10

10

10

10 Normalized Frequency (w/wn)

10

10

Unit step d y responses. These are normalized both in time, and in 2 response. Hence the plot is n y(t) versus n t.

Normalized Disturbance Response, PD 1.2

Normalized Response, wn^2 y

0.8

0.6

0.4 xi = 0.5 xi = 0.707 0.2 xi = 0.95 xi = 1.3 0 0

3 4 5 Normalized Time (wn*t)

130

Unit step r y responses. These are normalized in time, and show y(t) versus n t.

R>Y Step Response, PD 1.2

0.8

0.6

0.4 xi = 0.5 xi = 0.707 0.2 xi = 0.95 xi = 1.3 0 0

3 4 5 Normalized Time (wn*t)

Magnitude plot of closed-loop R E. These are normalized in frequency, and show GRE (j) versus n .
R>E (Sensitivity), PD

10

10

Magnitude

xi = 0.5 10
1

xi = 0.707 xi = 0.95 xi = 1.3

10

10

10

10 Normalized Frequency (w/wn)

10

10

Some things to notice. 131

The r y response has the canonical 2nd order response we have come to know and love. The steady-state disturbance rejection properties are dependent on n . As n increases, the eect of a disturbance d on the output y is decreased. Hence, in order to improve the disturbance rejection characteristics, we need to pick larger n . Depending on , the gain-crossover frequency is between about 1.3n and 2.5n . So, using this controller architecture, the gain crossover frequency must increase when the steady-state disturbance rejection is improved. The phase margin varies between 53 and 83 . There is no phase-crossover frequency, so as dened, the gain margin is innite. The closer that the complex frequency response remains to 1 (over a large frequency range), the better the r y response. The term bandwidth is often used to mean the largest frequency B such that for all satisfying 0 B , |1 GRY (j)| 0.3 Be careful with the word bandwidth. Make sure whoever you are talking to agrees on exactly what you both mean. Sometimes people use it to mean the gain crossover frequency. Generally, the higher the bandwidth, the faster the response, and better the disturbance rejection. Of course, its hard to explicitly assess time-domain properties from a single number about a frequency response, so use it carefully. The same types of intuition can also be assessed by looking at the frequency range over which the transfer function is GRE small, and also verifying that it is not too large in another range.

13.2

PID Control

In order to reduce the steady-state eect of the disturbance, we next analyze PID control, namely proportional+integral, with inner loop rate feedback. This is shown below. d r
E i E E KI E i T ! E KP E

c E A E i E

1 s+p

E c

1 s

E c

KD ' '
'

Inner-loop Rate-Feedback

132

The open-loop transfer function is L(s) = A(KD s2 + KP s + KI ) s2 (s + p)

The closed-loop transfer function is Y (s) = s A(KP s + KI ) R(s) + 3 D(s) s3 + (p + AKD )s2 + AKP s + AKI s + (p + AKD )s2 + AKP s + AKI

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 poles can be freely assigned. Using the (, n ) parametrization, along with a 3rd pole at n , we set the characteristic equation to be CE : Multiplied out, this gives
2 3 s3 + (2 + )n s2 + (2 + 1)n s + n 2 (s2 + 2n s + n )(s + n )

Choosing specic values of , n and yields appropriate controller gains, via the design equations, which are obtained by simply equating coecients, KD = (2 + )n p , A KP =
2 (2 + 1)n , A

KI =

3 n A

Note that for 1, the design equations give KD and KP as in the PD case, along with 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 at s = AKI (= n ). 2
n

In terms of the parameters, the closed-loop transfer function is Y (s) =


2 3 (2 + 1)n s + n s R(s) + 2 D(s) 2 + 2 s + 2 )(s + ) 2 (s (s + 2n s + n )(s + n ) n n n

The steady-state gain from d to y is zero, due to the integral term. Again, take the case p = 0. For clarity, lets also pick = 0.707, and only study the variation in 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 n t.

133

The plots below are: Magnitude/Phase plots of Loop transfer function


10 10 10 10
7

OpenLoop Transfer Function, PID, xi = 0.707

alpha = 0.1
5

alpha = 0.3162 alpha = 1 alpha = 3.162 alpha = 10

Magnitude

10 10 10 10 10 10

10

10

10 Normalized Frequency (w/wn)

10

10

OpenLoop Transfer Function, PID, xi = 0.707 300

250

Phase (degrees)

200

150

alpha = 0.1 alpha = 0.3162 alpha = 1

100

alpha = 3.162 alpha = 10

50 2 10

10

10 Normalized Frequency (w/wn)

10

10

134

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


10
1

R>Y Frequency Response, PID, xi = 0.707

10

10

Magnitude

alpha = 0.1 10
2

alpha = 0.3162 alpha = 1 alpha = 3.162

10

alpha = 10

10

10

10

10 Normalized Frequency (w/wn)

10

10

R>Y Frequency Response, PID, xi = 0.707 0 20 40 60

Phase (degrees)

80 100 120 140 160 180 2 10

alpha = 0.1 alpha = 0.3162 alpha = 1 alpha = 3.162 alpha = 10

10

10 Normalized Frequency (w/wn)

10

10

Magnitude plot of closed-loop R E

135

Normalized Disturbance-to-output response


10
0

Normalized Disturbance Response, xi = 0.707

10

| wn^2 G |

10

alpha = 1e05 alpha = 0.1 alpha = 0.3162 10


3

alpha = 1 alpha = 3.162 alpha = 10

10

10

10

10 Normalized Frequency (w/wn)

10

10

Normalized Disturbance Response, xi = 0.707 1.2

0.8

wn^2 y

0.6

0.4

alpha = 1e05 alpha = 0.1

0.2

alpha = 0.3162 alpha = 1

alpha = 3.162 alpha = 10

0.2 0

3 4 5 Normalized Time (wn*t)

136

Unit step r y responses


R>Y Step Response, PID, xi = 0.707 1.4

1.2

0.8 alpha = 0.1 0.6 alpha = 0.3162 alpha = 1 0.4 alpha = 3.162 alpha = 10 0.2

Y
0 0

3 4 5 Normalized Time (wn*t)

R E magnitude plots
10
1

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

10

10

Magnitude

10

alpha = 0.1 alpha = 0.3162 alpha = 1

10

alpha = 3.162 alpha = 10

10

10

10

10 Normalized Frequency (w/wn)

10

10

Some things to notice. 137

For a given n and > 1, both the crossover frequencies, and bandwidth (look at GRE ) are much higher than the PD case. This is somewhat reected in quicker rise times and comparable settling times. The gain crossover frequency increases signicantly with increasing . For instance, at 0 (which is the same as the PD control) the crossover frequency is about 1.7n , whereas for the crossover frequency jumps to approximately 5n at 3.1. At the respective crossover frequencies, the phase 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-domain and frequency domain properties for dierent are quite dierent. 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 settling times that occur for the intermediate values of . Remember, in typical applications, the uncertainty in the plants behavior increases with increasing frequency, so designs that lead to higher crossover frequencies usually are required (for condence) to have signicantly larger phase margins. Usually, for a given problem, modeling innaccuracies and unknown dynamics typically impose a maximum allowable crossover frequency, regardless of phase margin.

138

Since some normalization is possible (using n ), brute-force repeated simulation allows us to approximately compute several functions. They are functions of p, and . Here, we imagine that p is known, and xed. We also propose to x = 0.707, leaving only functions of . In any given design situation, it may be necessary to modify the choice of , and recompute. The functions are plotted below. normalized crossover frequency versus
100

Normalized Gain Crossover Frequency, xi = 0.707

80

60

wc/wn
40 20 0 2 10

10

10 Alpha

10

10

139

phase margin versus


Phase Margin, xi = 0.707 90

85

80

PHI

75

70

65

60 2 10

10

10 Alpha

10

10

140

normalized rise time versus


Normalized Rise Time, xi = 0.707 3.5

2.5

wn*Trise
2 1.5 1 2 10

10

10 Alpha

10

10

normalized settling time versus


Normalized Settling Time, xi = 0.707 30 2 percent 25 3 percent 4 percent

20

wn*Tsettle

15

10

0 2 10

10

10 Alpha

10

10

141

normalized peak response due to step disturbance versus


Normalized Peak Disturbance Response, xi = 0.707 1.2

0.8

wn^2 y

0.6

0.4

0.2

0 2 10

10

10 Alpha

10

10

normalized settling time due to step disturbance versus


Normalized Disturbance Settling (Relative), xi = 0.707 400

350

300

250

wn*Tsettle

200

150

100

50

0 2 10

10

10 Alpha

10

10

142

percentage overshoot versus


Percent Overshoot, xi = 0.707 35

30

25

% Overshoot

20

15

10

5 2 10

10

10 Alpha

10

10

Suppose that these have been computed reasonably accurately, at suciently large numbers of values. Can we use all of this data to develop a foolproof design method?

13.3

A Brute-Force Design Method

In designing the PID controller gains, the free parameters (at this point) to be chosen are , n and . For xed choice of , we can precompute functions f1 , f2 , . . . , f5 of such that 1. Gain crossover frequency (c ) equals n f1 () 2. Rise Time (tR ) equals f2 ()/n 3. Settling Time (tS ) equals f3 ()/n
2 4. Peak response to step disturbance (yd,max ) equals f4 ()/n

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 PID controller which satises the objectives. Specically, take objectives as c c , tR tR , tS tS , yd,max yd,max , tS,d tS,d 143

where the over-bar quantities are targets. Hence we search for values of n and which satisfy
f () f () 2 3 gL () := max , , tR tS

Hence, we simply graph the two functions gL and gU , and see if there is any value of where gl () gu (). If so, then simply pick an for which the inequality it true, and pick any n such that
gL ( ) n gU ( )

f4 () f5 () c , =: gU () n yd,max tS,d f1 ()

Moreover, since the overshoot reaches a maximum at = 1, and falls o on both sides, you can easily reduce the overshoot by moving to one side of the feasible region.

13.4

Design Example

Consider the Lab, with single inertia, and pulley. The PD control worked reasonably well with n = 25, and = 0.707. This implies that a phase margin of 65 at a crossover frequency of 38 is adequate for stability robustness. So, in designing a PID controller, lets 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 seconds. Well set the peak disturbance response at 5, which essentially makes it not relevant, and then we could tighten down on it if we wanted. The constraints on and n are shown below
10
3

wn/Alpha Design Options

10

10

wn
10
0

10

10

10

10

10 Alpha

10

10

144

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 various relevant quantities Open-Loop gain
10
2

OpenLoop Gain

10

| L(j w) |

10

10

10

10

10

10 Frequency, rad/sec

10

145

Open-Loop Phase
OpenLoop Phase 280 260 240 220 200 180 160 140 120 100 0 10

Phase L(j w), degrees

10

10 Frequency, rad/sec

10

Response to unit-step reference


Unit Step response 1.4

1.2

0.8

y
0.6 0.4 0.2 0 0

0.1

0.2

0.3

0.4

0.5 0.6 Time, sec

0.7

0.8

0.9

146

Response to unit-step disturbance


1.6 x 10
3

Unit Step disturbance response

1.4

1.2

0.8

0.6

0.4

0.2

0 0

0.1

0.2

0.3

0.4

0.5 0.6 Time, sec

0.7

0.8

0.9

147