TEACHING PID-CONTROLLER DESIGN

TEACHING PID-CONTROLLER DESIGN

TEACHING PID-CONTROLLER DESIGN F. L. Pagola, R. R. Pecharromán E.T.S. de Ingeniería (ICAI) Universidad Pontificia Comillas, Madrid, Spain pagola@dea...

122KB Sizes 3 Downloads 192 Views

TEACHING PID-CONTROLLER DESIGN

F. L. Pagola, R. R. Pecharromán

E.T.S. de Ingeniería (ICAI) Universidad Pontificia Comillas, Madrid, Spain [email protected]

Abstract: This paper presents an analytical, formula-based approach to the design of common controllers in the frequency domain. The orientation of the paper is mainly didactical. The proposed method makes it easier for the students to understand the design procedure and the compromises involved in the design of each type of PID controller. This method facilitates the assessment of different design options and limits. For this purpose, graphic output can be generated. The results are illustrated using a case study throughout the paper. Copyright © 2006 IFAC Keywords: PID Control, Control education, Control system design, Frequency-response methods, Nichols charts, Phase margins.

1. INTRODUCTION Control-system design or tuning by means of frequency-response methods is a well known topic. It is presented in practically all introductory textbooks on control. Still, a distinct trial-and-error flavor prevails in textbooks and, what is worse, no clear picture of design compromises and performance limits emerges. This makes the students feel that PID-controller analysis is easy while the design is difficult and, somehow, an “art”. This is probably true in the case of non-typical processes. On the contrary, when students are learning the controller design for the first time, it is highly recommended to use normal plants and clear design procedures. The purpose of this paper is to present a powerful, systematic and easy-to-use design procedure for PID controllers. Wakeland (1976) and Mitchell (1977) first presented formulae that led to the design of phase-lead and phase-lag compensators in a single step. Phillips and Nagle (1995) use those formulae in a textbook, and more recently Yeung et al. (2000) have presented a universal design chart for conventional compensators, using a graphic design tool, after reducing the different compensators to the same

basic form. This paper spells out an analytic design procedure that allows: 1) the design of a tentative controller to satisfy the given performance specifications; 2) to assess some performance limits; 3) to generate graphic output, useful to investigate design options for a particular value of the damping index. The paper is organized as follows. Section 2 presents the principle of the design method essentially the same used in previous references. It also highlights some important remarks. In section 3, formulae, design limits and compromises of different conventional controllers are explained and graphically illustrated; numerical examples are given and some extensions are suggested. In section 4, the different design examples are compared and analyzed from various points of view. Conclusions are given in section 5.

r(t)

u(t)

e(t) C(s) -

Figure 1. Plant and controller

d(t) -

y(t) P(s)

2. PRINCIPLE OF THE DESIGN METHOD

Phase 2. Tune the parameters of the controller, C(s), to satisfy:

Refer to the well-known control structure in figure 1, where r(t) is the set-point or reference input, e(t) is the error, u(t) is the manipulated variable, y(t) is the controlled variable, d(t) is a disturbance input, P(s) is a transfer function model of the process, or plant, and C(s) is the transfer function model of the controller. Given the process P(s), the aim is to design or tune the parameters of known structure compensation or control C(s), in order to fulfill some specifications.

C ( jω ) = AC e jϕC

(2)

2.3 Structure of C ( s ) In this paper, an interactive-PID control will be used (Åström and Hägglund, 1995):

C ( s) = K

1 + Is 1 + Ds Is 1 + fDs

(3)

2.1 Frequency-response performance specifications • • •



Stability: Nyquist criterion. Damping: φm (phase margin), or Gm (gain margin). Speed: ω0 (crossover frequency) or ωu (ultimate frequency), associated frequencies. Steady-state accuracy (SSA) -higher with lower steady-state errors in the response to normalized inputs in r(t) and d(t): For a given P( s ) , SSA increases with increasing K = C (0) if there is no integral term (pole s = 0 ) in C ( s ) ; adding this term increases SSA qualitatively (i.e., the former error becomes zero) , and then SSA increases with increasing K I = sC ( s ) s =0

The design method is based on a single point of the frequency-response. So, it will require afterwards checking related to the rest of the frequencyresponse: stability, other margins; and then checking related to time-response to steps or other reference inputs and disturbances. The advantages lie in that it is easily automated, and is very useful to assess the different design options and limits. In many instances, it will directly give useful designs.

This includes as particular cases the P, PI and PD controllers. The design consists of obtaining values of the parameters K, I, D, f that satisfy equation (2), solving for both phase and amplitude. In the general case there are several solutions because there are more parameters than equations. This will be discussed for each control type.

3. SOLUTION FOR DIFFERENT CONTROLLERS Throughout this paper, results obtained with a simple plant and a constant phase-margin will be shown:

P( s) =

1 s(1 + 0.4 s )(1 + 0.1s )

φm = 60º

(4)

Note that some of the statements in this paper may depend on the condition of assuming ‘well-behaved’ plants, like this one, where both amplitude and phase decrease with increasing ω in the significant frequency range. But this is quite usual.

3.1 Proportional control (P) 2.2 Single-point conditions

For P,

It will be assumed that damping comes first; all designs will be compared for equal damping, given by any of the usual indices: phase margin or gain margin. It is well known that these indices can fail, depending on the nature of the plant: gain margin cannot be applied to simple second-order systems; phase margin can be misleading for plants with significant delays. Resonant peak and maximum sensitivity are more global measures of the distance to the critical stability point (-1), but are more difficult to manage, and can also fail sometimes. Phase 1. Given φm (phase margin), ω0 (crossover frequency), AP , ϕ P (amplitude and phase of P( jω0 ) ), obtain the amplitude and phase of the controller: AC , ϕ C such that, for ω = ω0 :

AC e jϕC . AP e jϕ P = e j ( −π +φm )

(1)

C( s) = K

ϕC = 0

K = AC

(5)

Figure 2 shows graphically the design of the proportional controller for the given example, using the Nichols chart. Bode plots can also be used, but the Nichols chart is more useful to understand the design procedure. The reason is that both amplitude and phase changes are shown in a single plot, avoiding the continuous change from amplitude to phase plots and back. The case of the proportional control is very simple. As the phase introduced by the controller is ϕ C = 0 the plot only moves vertically when the controller is added to the plant, depending on the value of K. The objective is to move the plot so that the open-loop frequency response crosses the point of amplitude 0dB and phase −π + φm = −120º at frequency ω0 to fulfill the phase margin condition (1).

PD 40

5 4

f=0

30

f=0,05 f=0,1

Ad dB20

2

φm

f=0,2 10

A dB

0

Ac=K (dB)

-2

0 -1 10

ω0

2

10

f=0

ϕ

o

C

C(s).P(s) P(s)

-6

1

10

90

ϕc=0

-4

0

10

75 f=0,05

60 45

f=0,1

30 f=0,2 15

-8 0 -1 10

-10 -190

-180

-170

-160

-150

-140

-130

-120

-110

Then, the design consists of: Step 1. Calculate the desired phase, given by the specification of phase-margin. Example: −π + φm = −120º Step 2. Calculate the frequency for which the plant has this phase. This is going to be the crossover frequency. Example: ω0 = 1.10 Step 3. Calculate the amplitude of the plant at this frequency. That yields the required value of K to obtain 0dB amplitude on the open-loop frequency response. Example: K = 1.21 For future reference in this paper, a name is given to the value obtained in the case of Proportional control, for a particular P( s ) and damping: KP, and the associated frequency ωP. For the proposed example, KP=1.21 and ωP=1.10. Note that there are no degrees of freedom at all in this case. Given the desired damping (phase margin), both speed (frequency) and SSA (K) are fixed. If a faster system is required a PD controller must be used; this will usually provide a moderate increase in SSA as well. If much better SSA is needed, then a PI controller will be used.

3.2 Proportional-Derivative control (PD)

0 ≤ f <1

Figure 4 shows graphically the design of the PD controller for the given example. Using the phase lead, a higher-frequency point of the plant (compared to the one of the P controller, ωP) can be moved to the same 0dB and −π + φm = −120º point in order to obtain an equally damped but faster system. The controller has now three parameters (K, D, f) so three conditions have to be fixed. Given φm there are two degrees of freedom, which allow for the selection of ω > ωP and the filtering factor f. Then, starting from the specified φm , the design has the following steps: Step 1 Decide the desired ω > ωP . Example: ω0 = 3.9 Step 2. Calculate the amplitude and phase of the plant at this frequency. This yields the required value of AC and ϕ C that the controller has to introduce to move that frequency to the 0dB and −π + φm = −120º point (see (1) and figure 4). Typical values of speed will frequently yield values of ϕ C around 45º. Example: AC = 7.76 and ϕ C = 48.6º Step 3. Decide the value of the filtering factor f. This involves a compromise between performance and noise protection. As figure 3 shows, f limits the maximum value of ϕ C that the PD controller can give: 1− f (7) ϕ CM = asin 1+ f Example: f = 0.1 yields ϕ CM = 54.9º

1 + Ds 1 + fDs

0 < ϕC ≤ π / 2

2

10

Figure 3. Bode plots of the dynamical part of a PD controller.

Figure 2. Graphical approach for P control

C ( s) = K

1

10

ωD

-100

ϕ

For PD,

0

10

5

φm

0

(6) A dB

-5

Figure 3 shows the Bode plots of the PD controller (Ad being the amplitude without the gain K). The main effect is the phase lead that will provide more speed while keeping the same damping: higher frequencies will be moved to the zone of the plot where φm is evaluated. Note that the phase lead is affected by the value of f. A secondary effect is the increment in the amplitude given by the dynamical part of the PD controller (apart from the gain K).

P(s)

C(s).P(s) -10

Ac (dB) -15

ϕc

ω0 -20 -190

-180

-170

-160

-150

-140

-130

-120

-110

ϕ

Figure 4. Graphical approach for PD control

-100

Step 4. Check that the design is possible, that is, check that ϕ C < ϕ CM . If this condition is not fulfilled the design has no solution. Then, one of the two following options has to be chosen: a) reduce ω in order to reduce the required ϕ C or b) reduce f in order to increase ϕ CM

PD results for a given P(s) and phase margin =60º 7

6 f=0,05 5 K

1/ f − 1 2 tan ϕ C

f=0,2

1 + (ω D )

1

(9)

Figure 3 shows that, for a required ϕ C , two solutions can be obtained for D. The second solution is not considered, since it leads in this case to a lesser K and consequently to lesser SSA. Ideal PD control. The case of f = 0 results in simplified formulae:

ω D = tan ϕC K = AC cos ϕ C

(10) (11)

Maximum phase lead is 90o. This will usually define an upper limit for speed ( ω ). Maximum f. Equation (7) gives the maximum value of ϕ C that can be obtained for a certain value of f. Keeping in mind that ϕ C < ϕ CM is a necessary condition, it is also interesting to use the converse relationship, that gives the maximum f that can be used in order to obtain a desired ϕ C :

1 − sin ϕC 1 + sin ϕC

2

3

4

5

6

7

8

9

10

ωο

Figure 5. K (SSA) vs. ω0 (speed) as a function of f (noise filtering) for PD control.

2

2

1

(8)

Example: D = 0.404 and K = 4.21 . Note that K > K p , thus increasing SSA.

fM =

2

0

− 1/ f

f=fM

3

2

1 + ( f ωD )

K = AC

f=0,1 4

Step 5. Obtain the controller parameters using the solution of equation (2) for PD:

1/ f − 1 ωD = − 2 tan ϕC

f=0 f=0,02

(12)

Range of designs. Using the above formulae, figure 5 gives the range of results in speed ( ω0 ) and SSA (K) for different values of noise filtering (f). Many important design compromises and limits can then be analyzed, involving these three important and interrelated performance characteristics. It must be stressed that this figure corresponds to the example, but the general shape is valid for a wide variety of ‘well-behaved’ plants (even including transport delays or positive zeros). For constant ω0 : f lies between f=0 and f=fM. The former gives the greater SSA at the expense of noise protection. For constant f: there are two remarkable points, a) maximum ω0 and b) maximum K. P control is located on the left of the figure. In all cases ω > ωP (increasing speed) and in most cases K>KP (moderately increasing SSA). 3.3 Proportional-Integral control (PI) For PI,

C ( s) = K P

1 + Is Is

ϕC < 0

(15)

Comparing to P control, the benefit of PI lies in that the integration greatly improves SSA. The design aims at obtaining only moderately worse transients. 5

The solution for f = f M can be written as:

4

ϕc 2

1 1 = tan ϕ C + cos ϕ C fM

K = AC

fM =

AC cos ϕC 1 + sin ϕC

ω0

Ac (dB)

φm

(13)

0

P(s) A dB

ωD =

(14)

Comparison of equations (11) and (14) shows that, for a given frequency, K is of the same order but smaller for maximum f; the general case lies between both extremes.

-2

C(s).P(s)

-4

-6

-8

-10 -190

-180

-170

-160

-150

-140

-130

-120

ϕ

Figure 6. Graphical approach for PI control

-110

-100

Figure 6 shows graphically the design of the PI controller for the given example. As the controller introduces a phase lag, the crossover frequency is necessarily lower than ωP if the phase margin is to be kept constant. The controller has two parameters so two conditions have to be fixed. Given φm there is one degree of freedom, which is normally used to set ω < ωP . Then, given the specified φm , the design has the following steps: Step 1. Decide the value of ω < ωP . The key idea is that a reduction in speed is accepted to obtain the SSA improvement. But ω is kept close to ωP . Typical values are around 80% of ωP . Example: ω0 = 0.74 Step 2. Calculate the amplitude and phase of the plant at this frequency. That yields the required value of AC and ϕ C that the controller has to introduce to move that frequency to the 0dB and −π + φm = −120º point (see (1) and figure 6). Frequency values not very far from ωP require small phase lags, usual values being around ϕ C ≅ −10º . Example: AC = 0.774 and ϕ C = −9.3º Step 3. Obtain the controller parameters using the solution of equation (2) for PI:

ωI =

−1 tan ϕ C

(16)

K = AC cos ϕ C

(17)

Example: I = 8.27 and K = 0.764 . For small ϕ C the frequency point of design is near the point used in P control, so ω ≅ ωP and K ≅ K P The only reason for not using even smaller phase lags is that it then takes too long to eliminate steadystate errors. In this context, it makes sense to maximize KI over ω (see figure 7). This results in minimum steady-state errors, and also minimizes IE criterion with a step in the disturbance (Shinskey, 1996). This is a good choice in the use of the degree of freedom, but it requires iterations.

Range of designs. P control is located on the right of the figure, giving maximum ω0 but KI = 0. Another remarkable point is the already noted maximum KI.

3.4 PID control This control combines the good features of both controllers to increase speed (with PD) and to greatly improve steady-state errors (with PI). There are four parameters, so given φm there are three degrees of freedom, which allow for the selection of ω > ωP , the phase lag of the PI part ( ϕ PI < 0 ) and the filtering factor of the PD part (f). Example: Select ω0 = 3.3 . Obtain AC = 5.75 and ϕ C = 41.1º . Select ϕ PI = −10º . Using ϕ PI = ϕ C in (16), one obtains I = 1.72 It is important to note that in the phase equation the phase lead given by the PD part of the controller must compensate for the phase lag given by the PI part. Note that ϕ PI < 0 , so then ϕ PD > ϕ C :

ϕ PD = ϕC − ϕ PI

(18)

Example: ϕ PD = 41.1 − ( −10) = 51.1º Select f = 0.1 that permits (7) up to ϕ CM = 54.9º Using ϕ PD = ϕ C in (8) D = 0.560 is obtained. Finally, K will be obtained from the amplitude equation (complete controller amplitude equal to AC ) Example: K = 2.74 Different options are possible in the use of the degrees of freedom, e.g. choosing f and maximizing KI (see figure 8). Range of designs Figure 8 gives a range of results for constant filtering, f = 0.1 . Note that obtaining high values of ω0 requires small phase lags. If maximum KI is desired, the values for the phase lag of the PI part are higher than those usually recommended by most authors, -5º to –10º. PID results for a given P(s) and phase margin =60º with f=0,1

PI results for a given P(s) and phase margin =60º

1.8

0.1

ϕpi=-20º

ϕ pi=-15º

1.6

0.09 KI

ϕpi=-10º

ϕ pi=-25º 1.4

0.08 KI=K/I 0.07

ϕpi=-7,5º 1.2

0.06

ϕ pi=-5º

1

ϕ pi=-30º

0.05 0.8 0.04 0.6 0.03 0.4 0.02 0.2 0.01 0 0.5

0 0.6

0.7

0.8

0.9

1

ωο

Figure 7. KI (SSA) vs. ω0 (speed) for PI control.

1.1

1

1.5

2

2.5 ωο

3

3.5

4

Figure 8. KI (SSA) vs. ω0 (speed) as a function of

ϕ PI for PID control with f=0.1

3.5 Other considerations

1.2

PID

PI

1

PD

Non-interactive PID. This formulation is frequently used in practical controllers (Åström and Hägglund, 1995). Equivalent parameters can be obtained or, alternatively, another set of formulae can be derived.

Responses to a set-point step

0.8

P 0.6 0.4

y(t) 0.2 0

Phase-lag compensation. PI control has replaced phase-lag in most applications, since the latter has no advantages besides some implementation issues. Another set of formulae has been derived for this case (Phillips and Nagle, 1995). They use it also for PD design (setting K instead of f) but this can be misleading, since the range of reasonable values of K is quite narrow, as can be seen in figure 5. Gain margin based design. The phase margin has been used in this paper as the damping specification. For those cases where gain margin (Gm) is preferred, equation (1) is replaced by:

AC e jϕC . AP e jϕ P =

1 − jπ e Gm

(19)

The same formulae are valid using the ultimate frequency ωu ; for this reason, they have been given in terms of a nonspecific ω

PID

PD

-0.2 -0.4

PI

Responses to a disturbance step -0.6

P

-0.8 -1 -1.2 0

2

4

6

8

10

12

time

Figure 9. Step responses of different designs Figure 9 shows responses to reference and disturbance steps; since the plant has already an integration, the integral action only improves the latter responses. For P and PD controls, the steadystate error is 1/K; this gives an estimate of the maximum error for PI and PID controls. The area between 0 and the response to a disturbance step is equal to 1/KI; this shows the usefulness of KI as a performance index.

5. CONCLUSIONS Graphical insight: a word of caution. The use of the presented analytical expressions has proven to be very powerful. On the other hand, the ‘blind’ application of formulae is not recommended, and the graphical insight provided by Bode or Nichols charts is invaluable. An easy ‘golden rule’ to be followed in case of lack of insight is that the controller parameters must be real and non-negative.

4. DESIGN EXAMPLES Table 1 shows different controllers for the given plant and phase-margin in (4). Chosen specifications for each case are shaded. Other damping specifications have also been checked: gain margin (Gm), resonant peak (Mr) and maximum sensitivity (Ms). All of them are adequate. Table 1. Parameters and performance of different designs

φm = 60º ω0

P

PD

PI

PID

1.1

3.9

0.74

3.3

K I D f KI

1.21 0

4.21 0.404 0.1 0

0.764 8.27 0.092

2.74 1.72 0.56 0.1 1.60

ϕ PI º ϕ PD º

-

-

-9.3

-10

-

48.6

-

51.1

Gm Mr dB Ms dB

10.3 0.2 3.0

8.2 0.2 3.1

15.4 1.2 2.3

7.4 1.1 3.1

An analytical method for the design of PID controllers has been presented in this paper. It makes it easier for the students to learn how to obtain useful designs following a systematic procedure. The method also gives insight into the possible designs, their performance limits and the involved trade-offs. This method is successfully used at our university, both in class and experimental laboratory setups. Interactive SysQuake plots, were the novelty is that phase-margin and cross-over frequency can be specified to calculate controller parameters, are also used to reinforce the student understanding: www.dea.icai.upcomillas.es/ramon/ACE06/Pagola_PD.sq

REFERENCES Åström, K. J. and T. Hägglund (1995). PID Control Theory, Design and Tuning, Instrument Society of America, Research Triangle Park, North Carolina, USA, second edition. Mitchell, J. R. (1977). Comments on Bode compensator design. IEEE Trans. Autom. Control, vol. 22, pp.869-870. Phillips, C. L. and H. T. Nagle (1995). Digital Control Systems. Analysis and Design. PrenticeHall. Shinskey, F. G. (1996) Process Control Systems. Application, Design and Tuning. McGraw-Hill. Wakeland, W. R. (1976). Bode compensator design. IEEE Trans. Autom. Control, vol. 21, pp.771-773. Yeung, K. S. and K. H. Lee (2000). A universal design chart for linear time-invariant continuoustime and discrete-time compensators. IEEE Trans. Education, vol. 43, pp.309-315.