Data-Driven Controller Tuning Using Frequency Domain

May 17, 2006 - In other words, only the knowledge of the plant at some specific frequencies is usually required for the design, because many PID tunin...
0 downloads 4 Views 235KB Size
4032

Ind. Eng. Chem. Res. 2006, 45, 4032-4042

Data-Driven Controller Tuning Using Frequency Domain Specifications Daniel Garcia,* Alireza Karimi, and Roland Longchamp Laboratoire d’Automatique, Station 9, Ecole Polytechnique Fe´ de´ rale de Lausanne, CH-1015 Lausanne, Switzerland

This paper presents an overview of our recent work on a model-free proportional-integral-derivative (PID) controller tuning procedure. The method can handle different stability and performance indicators in the frequency domain. The phase margin, gain margin, crossover frequency, and more-advanced indicators, which are the infinity-norm of the sensitivity functions, can be considered for the design. The actual values of the design parameters are measured directly on the system, thanks to closed-loop experiments. A frequency criterion is then defined as the weighted sum of squared errors between the measured and desired values of the design parameters. The minimization is done iteratively using the Gauss-Newton algorithm. The approach presented does not require any parametric model of the plant and can be applied to a wide range of industrial applications. Simulation examples show the rapid convergence of the algorithm and the effectiveness of the method for PID controller tuning. 1. Introduction Despite the existence of more-advanced structures, the proportional-integral-derivative (PID) controller is, by far, the most dominating feedback controller type used today for industrial applications. The widespread use of such controllers is mostly due to their very simple structure, which consists of only three parameters, as well as the good performances that can be achieved for many systems. For these reasons, PID control is always the first solution that is envisaged for control system design. The emergence of automatic tuning methods in the past few years has also contributed to the large interest in these controllers. Different authors have considered this approach using plant models. The methods are usually based on a first-1 or second-order2,3 plant model with dead-time, obtained by the measurement of one or more points on the frequency response of the process. The problem that is associated with low-order models is that they are not always representative of the real plants. At the end of the design, the desired closed-loop specifications will then not necessarily be achieved on the real plant, because of the use of simplified model structures. The parametric identification of higher-order models is, on the other hand, much more difficult to be implemented in an automatic way, because it requires the know-how of the control designer. According to ref 4, it is recognized that obtaining the process model is the most time-consuming task in the model-based control. Moreover, in ref 5, the authors affirm with arguments that, after an adequate dynamic model of a plant is obtained, 80%-90% of the implementation is completed. Furthermore, parametric models contain much more information than is effectively required for the controller design. In other words, only the knowledge of the plant at some specific frequencies is usually required for the design, because many PID tuning methods try to shape the loop only at these frequencies. This has motivated the use of data-driven tuning procedures. The simplest data-based approach is probably the ZieglerNichols method, where only the plant critical point (the point on the frequency response of the plant corresponding to the * To whom correspondence should be addressed. Tel.: +41 24 447 02 82. Fax: +41 24 447 02 01. E-mail address: [email protected].

phase of -π radians) is measured and then moved in the complex plane. However, this approach is known to give unsatisfactory results in many situations. In ref 6, an automatic tuning method has been proposed, based on a single relay feedback test. This experiment gives, using describing function analysis, the critical gain and frequency of the system or other points on the Nyquist curve with the use of a relay with hysteresis. The identified point can then be moved using the modified Ziegler-Nichols method to the desired position in the complex plane. Different authors have also considered the phase and gain margins adjustment in a model-free framework. Two relay experiments have been proposed for measuring directly the phase7,8 and gain margins9 as well as the corresponding frequencies. Using this information, iterative methods have been proposed for the adjustment of these design parameters.10,11 However, gain and phase margins measure the stability only in certain specific directions. In other words, these margins may fail to give reasonable bounds on the sensitivity functions for some systems. This fact has motivated the use of constraints on sensitivity functions for PID controller design. However, little attention has been paid to the consideration of such constraints in a model-free framework. In ref 9, the Kappa-Tau method proposes as an extension of the traditional Ziegler-Nichols method, simple tuning formulas, that provide for unknown systems approximately a given value for the infinity-norm of the sensitivity function. An automated proportional-integral (PI) controller method has been proposed in ref 12 to measure the phase margin and maximum sensitivity value using a PLL identifier. An ad hoc algorithm has then been used to achieve a specified value for these design parameters. The contribution of the paper is the consideration of the infinity-norm of the sensitivity and complementary sensitivity functions in the design procedure. New approaches are first presented to measure these margins using limit cycles, obtained with nonlinear closed-loop experiments. A frequency criterion, which is defined as the weighted sum of squared errors between the actual and desired value of the design parameters, is then used for the tuning procedure. Its minimization is performed with the Gauss-Newton algorithm without requiring any other information about the plant, other than that obtained by the

10.1021/ie0513043 CCC: $33.50 © 2006 American Chemical Society Published on Web 05/17/2006

Ind. Eng. Chem. Res., Vol. 45, No. 12, 2006 4033

previously mentioned measurement procedures. Furthermore, this paper constitutes a generalization of a previous work11 and also allows us to take into account the classical phase margin, gain margin, and crossover frequency (the frequency where the loop gain is equal to the identity). Note that the proposed approach does not require any parametric model of the plant and can be used for a wide range of industrial control problems, because only few assumptions are made about the plant and the controller structure. The paper is organized as follows: The choice and importance of the design parameters are explained in section 2 and procedures for their measurements are then presented in section 3. In section 4, the controller tuning problem is defined and solved. The approach is then illustrated with some simulation examples in section 5. Finally some concluding remarks are offered in section 6. 2. Design Parameters Phase- and gain-margin specifications, as well as constraints on the infinity-norm of the sensitivity functions, are habitually used in PID controller tuning methods to shape the loop frequency response in certain frequency ranges. Appropriate choice of the design parameters, as well as their specified values, result in a closed-loop system with desired properties of stability and performance. In this section, the design parameters and the relations between them, as well as their influences on the closedloop stability and performance, are discussed. 2.1. Closed-Loop Stability. Consider the loop transfer function L(s)

Figure 1. Geometrical interpretation in the complex plane of the phase margin (Φm), gain margin (Mg), crossover frequency (ωc), and infinitynorm of the sensitivity and complementary sensitivity functions (Ms and Mt).

L(s) ) K(s)G(s)

2.2. Closed-Loop Performances. Let the complementary sensitivity function be

(1)

where G(s) and K(s) represent, respectively, the plant and the controller transfer functions. It is assumed in the latter that the resulting closed-loop system is stable. The sensitivity function, which is defined as

1 S(s) ) 1 + L(s)

(2)

expresses the transfer function from disturbances to the output of the closed-loop system and also quantifies how sensitive is this system to variations of the considered plant.13 The infinitynorm of the sensitivity function

Ms ) ||S||∞

(3)

gives an upper bound for the amplification of a sinusoidal disturbance by the closed-loop system. Furthermore, Ms represents a very significant parameter for the closed-loop stability robustness, because its value is simply the inverse of the shortest distance from the Nyquist curve of the loop to the critical point -1. A geometrical interpretation is that the Nyquist curve of the loop is always outside a circle around the critical point with the radius 1/Ms (see Figure 1). Phase and gain margins also represent the closed-loop stability robustness but are less representative than the infinity-norm of the sensitivity function, because they only measure the robustness in certain specific directions. The phase margin Φm is the distance (in radians) from the critical point to the Nyquist curve of the loop along the unit circle, whereas the gain margin (Mg) expresses this distance along the real axis. From the geometrical interpretations, relations between Ms and both phase and gain margins can easily be found. A given value on Ms ensures a

lower bound for both margins:9

Mg g

Ms Ms - 1

Φm g 2 arcsin

T(s) )

1 2Ms

(4)

L(s) 1 + L(s)

(5)

This function represents the transfer function from the set point to the process output. The infinity-norm of the complementary sensitivity function,

Mt ) ||T||∞

(6)

is a key performance measurement of the closed-loop system, because it is closely related to the peak overshoot at the plant output, resulting from a set-point change of the reference signal. For second-order systems, an exact relation exists between Mt and the maximum peak overshoot Mp (in %):14

( [

Mp ) 100 exp -π

])

1 - (1 - 10-0.1Mt)1/2

1 + (1 - 10-0.1Mt)1/2

1/2

(7)

This relation often has satisfactory application, because the frequency responses of most closed-loop systems behave as second-order systems in the frequency range around the resonance frequency. The infinity-norm of the complementary sensitivity function Mt has, similar to the Ms value, a very nice interpretation in the complex plane.15 Suppose that, at a given frequency ωi, the following equation holds:

|T(jωi)| ) c

(8)

where c is a constant number. In the complex plane, |K(jωi)G(jωi)| corresponds to the distance from the origin to the frequency response of the loop at ωi. On the other hand,

4034

Ind. Eng. Chem. Res., Vol. 45, No. 12, 2006

ωc )

Figure 2. Loci of constant value for the magnitude of the complementary sensitivity function.

|1 + K(jωi)G(jωi)| is the distance between the critical point -1 and K(jωi)G(jωi). From eqs 5 and 8, the ratio of these distances is equal to c. The loci of constant |T| values then correspond to the sets of points in the complex plane, of which the ratio of the distance to the origin and to the critical point is constant. For |T| ) 1, the locus corresponds obviously to the vertical line through the point -0.5 + 0j (see Figure 2). For other values, the loci correspond to circles centered on the real axis with the following center ct and radius rt:

|T|2 ct ) 1 - |T|2

(9a)

|T| 1 - |T|2

(9b)

rt )

| |

Figure 2 depicts the loci of constant values for different values of |T|. The circle corresponding to the infinity-norm of the sensitivity function defines then the largest circle in the complex plane, where the frequency response of the loop always remains outside (see Figure 1). The phase margin also constitutes an accepted measure of closed-loop performance. Designing the phase margin corresponds to choosing the magnitude of the complementary sensitivity function at the crossover frequency. For many systems, this frequency is, however, just above the frequency of the maximum peak resonance Mt. Thus, by designing the phase margin, one tries to shape the loop frequency response in this region and, thus, to choose approximately the infinitynorm of the complementary sensitivity function. From the geometrical interpretations, a relation between Mt and the phase margin exists. A given value of Mt ensures a lower bound for the phase margin, according to the following inequality:16

Φm g -arccos

(

)

1 - 2Mt2 2Mt2

+π≈

63 -3 Mt

(10)

A very common measure of the system speed, in the frequency domain, is the system crossover frequency ωc. This frequency is intimately connected to the bandwidth of the closedloop system. The value of the latter is specified in many control problems. ωc is also closely related to the rise time τ of the closed-loop system. The guiding rule,16

2.3 τ

(11)

which comes from considering the closed-loop system to behave roughly like a second-order system, often gives satisfactory results in practice. It applies approximately and only to stable minimum-phase systems. 2.3. Choice of the Design Parameters. The proposed tuning procedure allows one to take into account all the design parameters introduced previously. However, because all parameters are not independent, it is not desirable to consider all of these for a controller design problem. On the other hand, PID controllers have only a few parameters. If one wants all the chosen specifications to be achieved at the end of the design, this limited number of parameters also requires the number of design parameters to be restricted. The design parameters should be chosen as a compromise between desired results and the complexity of the tuning procedure. The gain and phase margins can be chosen to represent the stability and performance of the closed-loop system. However, the results obtained with these margins would probably not be as good as those obtained by considering the infinity-norm of the sensitivity functions. One weakness of these margins is the fact that they act very locally and often fail to bound the sensitivity functions at all frequencies. For some complex high-order systems, one can have large gain and phase margins, even if the system is close to instability. Another problem that is associated with the gain margin is that an appropriate specification is not known a priori and is dependent especially on the system structure and parameters. For a firstor a second-order system with negligible time delay, the gain margin should be chosen to be very large, in contrast to that of a higher-order system or a system with a large time delay. However, the measurement of these margins on the real plant is very simple and can be performed very quickly, thanks to the methods presented in section 3. On the other hand, the consideration of the infinity-norm of the sensitivity functions represents the essence of the control problem much better. Furthermore, specifications on these design parameters are easier to give. It has been noted16 that different systems that have been designed with the same specification values exhibit about the same behavior in a normalized time scale. The drawback of using these design parameters is, however, that the identification procedure requires more effort and more time is needed for their measurement of the system (see section 3.1). 3. Measurement Procedures In the approach presented, the values of the design parameters must be measured in real-time directly on the system. Different techniques exist currently for measuring the robustness margins with their corresponding frequencies.6,17,18 Among these methods, relay tests have been well-accepted by the industrial community, because their implementation is simple and the measurement precision is satisfactory for controller tuning. In the standard relay method,6 the controller is replaced by an onoff relay in a closed-loop arrangement. For many systems, this scheme produces an oscillation, where the control signal is a square wave and the process output is close to a sinusoid. An approximate analysis of the resulting oscillations can be made using describing function analysis. This technique considers that the plant attenuates sufficiently higher harmonics of the relay output such that it is sufficient to consider only the first harmonic of the signal produced by the nonlinear element. The amplitude

Ind. Eng. Chem. Res., Vol. 45, No. 12, 2006 4035

Figure 3. Closed-loop experiment for measuring the infinity-norm of the sensitivity function.

and frequency of the obtained limit cycle give, respectively, the critical point of the system and its corresponding frequency. However, one problem that is associated with the relay methods is the assumption that higher-order harmonics are totally damped by the process. Even if this one behaves like a low-pass filter, the harmonics residues may lead to non-negligible measurement errors.7 To improve the precision of the approximations, an adaptive method that was proposed in ref 19 for measuring the critical gain can be used. In this method, the relay is replaced by a saturation nonlinearity and a time-varying gain, which can be interpreted as a varying saturation slope. Several modifications of the standard relay methods have been proposed to measure other points of interest. Through use of the relay transient instead of only stationery oscillations, it was shown in ref 20 that multiple points of the plant frequency response can be estimated with only one experiment. The robustness margins given by the controller can then by computed using this nonparametric model. An alternative way to obtain the desired information is to use one specific relay experiment for each robustness margin. The phase and gain margins of a system including a linear controller can be measured with wellknown relay experiments.7-9 Hereafter, schemes for measuring the infinity-norm of the sensitivity and complementary sensitivity functions are presented. 3.1. Measurement of the Infinity-Norm of the Sensitivity Function. The scheme introduced in ref 21 and depicted in Figure 3 has been proposed for measuring Ms. The values of k > 0 represent the saturation slope, and R is a positive real number. The maximum signal amplitude at the output of the saturation is set to 1, without any lack of generality. A basic requirement is that the following closed-loop transfer function is stable:

[R/(R + 1)]L(s) GR ) 1 + [R/(R + 1)]L(s)

(12)

However, if the system L(s) is stable in a closed-loop experiment, GR remains stable for many industrial plants, because its loop is just obtained by reducing the gain (R/(R + 1) < 1). Suppose now that a limit cycle is generated by the closedloop experiment of Figure 3 and let us consider its properties using the describing function analysis. The necessary condition for obtaining an oscillation is given by

1 1 R(L(jω) + 1) - 1 )jω R(L(jω) + 1) + 1 Ns

(13)

where Ns represents the describing function of the saturation

Figure 4. Illustration of the necessary condition for obtaining a limit cycle for the Nyquist plot of the sensitivity function.

nonlinearity. To simplify the notation in the sequel, the function seen by the saturation is defined as follows:

FR(jω) )

1 R(L(jω) + 1) - 1 jω R(L(jω) + 1) + 1

(14)

A limit cycle may thus occur if there exist intersection points between FR(jω) and -1/Ns, which corresponds to the half straight line (-∞, -(1/k)). Equation 13 is equivalent to

1 1 - {1/[R(L(jω) + 1)]} 1 )jω 1 + {1/[R(L(jω) + 1)]} Ns which, after calculation, gives

[

]

-1 - (jω/Ns) 1 )R 1 + L(jω) -1 + (jω/Ns)

(15)

(16)

Because Ns is a real positive function, the term on the righthand side of eq 16 has, thus, a modulus of R. Hence,

|

|

1 )R 1 + L(jω)

(17)

Moreover, by considering the phase of each term of eq 16, one obtains



(

)

()

1 ω ) 2 arctan Ns 1 + L(jω)

∈ (0,π)

(18)

The two last equations show that, if a limit cycle occurs, there exists at least one intersection point, in the complex plane, between the frequency response of the sensitivity function and the half-circle located in the upper half-plane with radius R. Moreover, the frequency of the oscillation is the frequency at which the amplitude of the sensitivity function is R. The Nyquist plot of a typical sensitivity function and circles with different radius are depicted in Figure 4. It can be shown, in this figure, that if R is chosen smaller than Ms, one or more intersection points exist between the frequency response of the sensitivity function and the half-circle with the corresponding radius. Furthermore, it has been noted in ref 21 that, for each value of R, only the intersection point related to the lowest frequency corresponds to a stable limit cycle. If R is chosen larger than Ms, it has been theoretically proven that the scheme becomes passive and, thus, no limit cycle occurs. The necessary condition

4036

Ind. Eng. Chem. Res., Vol. 45, No. 12, 2006

tion and Ms can be measured. If R is further increased, the limit cycle no longer exists, because there is no intersection point I. The goal of the measurement procedure is to vary R and k to obtain a limit cycle at ωm. Furthermore, we wish to choose the parameter k such that we obtain accurate measurements. In other words, the saturation should generate as few higher harmonics as possible. The generation of higher harmonics is directly proportional to the distance along the negative real axis between I(R) and -1/k. The same tuning rule as that used in ref 19 is chosen for the parameter R, so that the signal at the output of the saturation is almost unsaturated:

dR ) δ|kus - ys| -  dt

(19)

Suppose that k is chosen such that

Figure 5. Illustration of the necessary condition for the obtention of a limit cycle for the Nyquist plot of the loop.

1 - < I(R ) Ms) k

(20)

If, now, R is chosen according to eq 19, I(R) will move to the vicinity of -1/k. Suppose, now, that -1/k is increased, such that

1 - > I(R ) Ms) k

Figure 6. Function observed by the saturation FR for three different values of the parameter R.

for the occurrence of a limit cycle can also be seen with the Nyquist curve of the loop transfer function (see Figure 5). This condition corresponds to the existence of intersections between the Nyquist curve of the loop and the half-circle located in the lower half-plane with radius 1/R. Now the procedure for measuring the infinity-norm of the sensitivity function Ms is described. Two assumptions are first formulated for the system: (1) The minimum distance between L(jω) and the critical point happens at ωm and I {L(jωm)} e 0. (2) The angle Ω between the real axis and the frequency response of the loop is an increasing function of the frequency ω, around ωm (see Figure 5). These assumptions are generally not restrictive, because they are met on the majority of systems for which PID controllers can be used. Consider now the function FR(jω). Figure 6 depicts a typical frequency response of FR(jω) for three values of R. If R < Ms, there exist intersection points between the negative real axis and the curve. The first intersection, which corresponds to the stable limit cycle, is denoted by I(R). This intersection point is obviously a function of R. It can be shown, using the second assumption that was made previously, that if R is continuously increased, I(R) will move along the negative real axis toward the origin until R ) Ms. At this value, the system oscillates at the frequency of the maximum amplitude of the sensitivity func-

(21)

R will then be increased until R ) Ms. If R is further increased, the limit cycle is damped such that, according to eq 19, its value is decreased. R will then stay in the vicinity of Ms. The measurement procedure can now be explained more precisely: (1) Choose R and k such that a limit cycle occurs. This can be done by selecting a large value for k and R and reducing progressively the value of R. At R ) R0 ) Mg/(Mg - 1), an oscillation will occur,21 where Mg represents the gain margin. This value is slightly smaller than Ms for many systems. (2) Set the fraction -1/k to be equal to I(R0) and then let R vary according to eq 19. (3) Increase k iteratively, according to the rule kr+1 ) pkr, and wait until a stationary limit cycle is obtained. The variable r is the iteration number and p is a positive number. (A value of p ) 1.2 has been chosen in the examples and can be used as a guideline.) At each change of k, R will increase to move I(R) in the vicinity of -1/k. As -1/k becomes larger than I(Ms), R will no longer increase as a function of k and will remains at Ms. At the time when a change of k will not generate an increase of R, the procedure can be stopped. The infinity-norm of the sensitivity function and the related frequency, as well as the point of the plant corresponding to this frequency, can be measured. 3.2. Measurement of the Infinity-Norm of the Complementary Sensitivity Function. The same approach as that used to measure Ms can be applied for determining the infinity-norm of the complementary sensitivity function Mt. The closed-loop scheme is shown in Figure 7, where, again, the slope of the saturation k is a real positive number and β > 1. Once again, the necessary condition for the existence of a limit cycle using describing function analysis can be written as

1 1 β(L(jω) + 1) + L(jω) )jω β(L(jω) + 1) - L(jω) Ns

(22)

After straightforward calculation, this condition becomes

[

]

(jω/Ns) + 1 L(jω) )β 1 + L(jω) (jω/Ns) - 1

(23)

Ind. Eng. Chem. Res., Vol. 45, No. 12, 2006 4037

is considered as a design parameter:

Mm )

1 1 ) Ms ||S||∞

(26)

4.2. Iterative Solution. The controller parameters minimizing the criterion can be obtained iteratively using the GaussNewton method:

Fm+1 ) Fm - γmR-1J′(Fm)

Figure 7. Closed-loop experiment for measuring the infinity-norm of the complementary sensitivity function.

Again, the term on the right-hand side of eq 23 has a modulus of β. Hence, the proposed scheme may produce limit cycles at the frequency where the magnitude of the complementary sensitivity function equals β. This scheme also has a passivity property if β is chosen to be larger than the infinity-norm of the complementary sensitivity function. The measurement procedure is the same as that proposed in section 3.1. Note that the proposed method is not applicable if the infinity-norm of the sensitivity function is