Automatic Retuning of PI Controllers in Oscillating Control Loops

Sep 1, 1997 - A new method for on-line process identification and PI controller tuning is proposed. In the method proposed a standard PI control loop ...
0 downloads 0 Views 201KB Size
Ind. Eng. Chem. Res. 1997, 36, 4255-4263

4255

Automatic Retuning of PI Controllers in Oscillating Control Loops Mats Friman† Process Control Laboratory, Department of Chemical Engineering, Åbo Akademi University, FIN-20500 Åbo, Finland

A new method for on-line process identification and PI controller tuning is proposed. In the method proposed a standard PI control loop is tuned to become unstable through aggressive controller settings, and the obtained oscillations are used for process identification and subsequent controller tuning. The control loop can be tuned to be unstable by mistake or on purpose. In the case where the control loop turns unstable by mistake, due to, e.g., changes in the operating conditions, this new method is useful as it provides a possibility for instant controller retuning of oscillating control loops. The control loop can also be tuned to be unstable on purpose. In that case the method has proved to be particularly suitable for process startup, because it provides a more rapid startup procedure than traditional methods do. With the proposed method, amplitude-and-phase-margin PI controller tuning is utilized. The method is tested on an experimental laboratory process with two inputs and two outputs. Introduction Automatic controller tuning with the use of relay feedback was introduced in 1984 (Åstro¨m and Ha¨gglund, 1984). Before that, control loops were regularly tuned by trial and error because systematic controller tuning put a heavy load on engineering resources. With the introduction of relay autotuning, however, it was possible to perform systematic controller tuning by pressing a button, and a large number of control loops could be tuned with little resources. It is easy to understand how appealing this possibility is to process engineers. Several other approaches of automatic controller tuning have been suggested and also implemented into commercial controllers. Yuwana and Seborg (1982) proposed a method which identifies a first-order-plusdead-time model from a closed-loop test. This method was later improved to find better controller settings for processes with large time delays (Lee, 1989), for secondorder-plus-dead-time processes (Bogere and O ¨ zgen, 1989), and for underdamped processes (Chen, 1989). A number of modifications and extensions of relay identification have been suggested in the literature. Åstro¨m and Ha¨gglund (1984) used a relay with hysteresis to overcome difficulties with noisy signals during identification. They also proposed dynamic elements connected in series with the relay so as to provide identification of different points on the Nyquist curve. Li et al. (1991) connected a variable dead time in series with the process in order to identify several points on the Nyquist curve. Friman and Waller (1995) replaced the relay used in the identification with other suitable nonlinearities. This improved the accuracy of the identification. Even though relay autotuning is easy to use and appeals to process engineers, there are situations where it can be time consuming. One such example is when relay autotuning is utilized during process startup. Because it is required that the process is at rest before identification, the operator can choose between, e.g., the following two procedures during process startup: (1) He/ she can manually control the output to the setpoint before connecting the autotuner, or (2) he/she can put †

Phone: +358-2-2654445. Fax: +358-2-2654479. E-mail: [email protected]. S0888-5885(97)00249-2 CCC: $14.00

the controller on manual, wait for the process to stabilize, and identify the process at the observed operating point (which can be far from the desired setpoint). These procedures are sometimes time consuming. Moreover, the control loop is seldom at rest at instants when controller tuning is desired. For example, if a control loop turns unstable due to, e.g., changes in the operating conditions, it is self-evident that the operator must retune the controller, but relay autotuning cannot instantly be utilized because the process is not at rest. However, the method proposed here provides fast process identification and controller tuning of oscillating control loops. It makes the recovery procedure faster because controller parameters can instantly be determined and implemented without a time-consuming identification experiment. With the method proposed, a conventional PI controller loop is used for identification. The control loop is driven to instability through aggressive controller settings, but the control loop, for a great majority of important chemical processes, enters a stable limit cycle because of saturation levels on the input variable. Input saturation is present in all real processes, but saturation levels can also be user-modified. This method has a number of advantages compared to other closed-loop identification methods. (1) Because the same PI controller is employed for both control and identification, the identification experiment has a simple and wellknown structure. (2) The system does not need to be brought to the operating point before identification and tuning (i.e., it is well suited for rapid startup). (3) Moreover, the process is identified close to the desired setpoint, regardless of initial conditions or possible load disturbances affecting the control loop during identification. The paper is organized as follows. The next section presents the proposed identification method together with a comparison to relay autotuning. The third section contains an analysis of the suggested identification method, the fourth section discusses controller tuning, and in the final section the method is demonstrated on an experimental laboratory process. Relay Identification vs Proposed Identification In this section a new method is introduced for on-line closed-loop identification and subsequent controller © 1997 American Chemical Society

4256 Ind. Eng. Chem. Res., Vol. 36, No. 10, 1997

Figure 1. Setup of the relay experiment, consisting of a relay connected as a feedback controller to the process Gp.

Figure 2. Output y and input u for the relay setup in Figure 1. The process is a second-order-plus-dead-time system Gp ) exp(-s)/(s + 1)2, the setpoint is r ) 50, and the relay has the following parameters: bias u0 ) 50; amplitude h ) 50.

tuning. The method proposed is based on the observation that an oscillating control loop can give valuable process information with respect to controller tuning. Simulations illustrate the similarities between relay identification and the proposed oscillating PI control loop. The setup of the Åstro¨m-Ha¨gglund relay autotuner (Åstro¨m and Ha¨gglund, 1984) is shown in Figure 1 where the process Gp is connected to relay control in a standard feedback loop. The output of the relay is given by

u ) u0 + h sign e

(1)

where h is the relay amplitude, sign e is (1 depending on the sign of e, and u0 is an input bias which should be selected such that symmetric oscillations are obtained. In eq 1 we have assumed a positive steady-state process gain; if the process is reverse acting, we must change the sign of the relay. The bias variable u0 is usually omitted in the analysis, but since we consider setpoint changes and load disturbances, changes in u0 are necessary. With the relay connected in the feedback loop, the system in Figure 1 starts oscillating, and after a number of relay switches, uniform oscillations are obtained and the first harmonic amplitude a and period P of the process output are measured. With use of the describing function analysis (Atherton, 1982), the ultimate gain Ku and ultimate frequency ωu of Gp can be approximated as (Åstro¨m and Ha¨gglund, 1984)

Ku ) 4h/πa

(2)

ωu ) 2π/P

(3)

A simulation of a relay experiment is shown in Figure 2 where also the bias u0 and relay amplitude h are illustrated. According to Åstro¨m and Ha¨gglund (1995), the relay setup in Figure 1 will usually provide a successful identification experiment for processes that are suitable for PID control. In addition, standard assumptions (Gp is linear, stable, and proper) are made through the paper. Moreover, it is assumed that

Figure 3. Setup of the saturated PI controller experiment, consisting of a PI controller GPI, saturation levels on the input, and the process Gp.

Figure 4. Same as Figure 2 but for the saturated PI controller setup in Figure 3. The saturated PI controller has the following parameters: saturation levels umin ) 0 and umax ) 100 and PI controller settings Kp ) 4 and Ti ) 2.

disturbances are modest and, hence, do not falsify the identification experiment. For systems where the measurement signals are corrupted with noise it is common to use a relay with hysteresis in the identification. In contrast to the relay experiment, which identifies the point on the Nyquist curve that intersects with the negative real axis, the relay-with-hysteresis experiment identifies a point on the Nyquist curve somewhere in the third quadrant. A large number of experimental implementations have shown that such elementary information in the form of an identified point on the Nyquist curve is adequate for the purpose of PI and PID controller tuning (Åstro¨m and Ha¨gglund, 1995). Next consider the control loop in Figure 3. In the sequel the connection in Figure 3 is referred to as the “saturated PI controller experiment”. This naming relates to the structure of the feedback loop in Figure 3. The loop contains a standard PI controller

(

GPI(s) ) Kc 1 +

)

1 Ti s

(4)

with saturation levels on the manipulated variable. Input saturation is present in all real processes (as an example, think of an input valve which is limited to the range of 0-100% open), but the saturation levels can also be adjusted manually (i.e., we can program our control system to restrict the valve changes, e.g., to the range of 50-70%). Manually adjusted saturation levels are often well motivated as they reduce the magnitudes of oscillations. In the analysis we consider the situation where the controller settings are tuned such that the control loop turns unstable. With this construction we obtain continuous oscillations in a way similar to that in the relay experiment. Although the system turns unstable, the oscillations are bounded by saturation levels on the manipulated variable. A simulation is shown in Figure 4 where also the saturation levels umax and umin are illustrated. From Figures 2 and 4 we conclude that the control loops in Figures 1 and 3, for this particular example, give quite similar oscillations. In fact, the control loop in Figure 3 can be seen as an extension of the relay

Ind. Eng. Chem. Res., Vol. 36, No. 10, 1997 4257

Figure 5. Same as Figures 2 and 4 but with the modified setpoint r ) 30 and asymmetric oscillations. The signals generated by the relay setup (dashed line) and saturated PI controller setup (dotted line) are shown.

experiment in Figure 1 because a replacement of the PI controller in Figure 3 with a P controller with infinite gain would make the systems in Figures 1 and 3 equal (except for u0). For the purpose of identification, the gain does not even need to be infinite; a finite gain also identifies the ultimate gain Ku and ultimate frequency ωu as long as the gain is large enough to cause continuous oscillations. The identification with a limited gain can sometimes be advantageous because it gives a more accurate identification of Ku and ωu than standard relay identification does (Friman and Waller, 1995). At a general level it is not possible to guarantee that the proposed setup will generate continuous oscillations. However, because of the similarity between the two identification methods in Figures 1 and 3 discussed above, it is believed that the saturated PI controller experiment will work successfully for the important class of processes that are suitable for relay identification (i.e., processes suitable for PID control). The proposed method is not suitable for nonlinear oscillating processes or processes that are affected by periodic disturbances. In the relay experiment the bias value must be properly selected so as to give symmetric oscillations. Likewise, the selection of saturation levels for the saturated PI controller experiment also affects the symmetry of the oscillations. It is evident that the oscillations obtained by the saturated PI controller illustrated in Figure 4 are symmetric only because the average of the two saturation levels umax ) 100 and umin ) 0 (used in the saturated PI controller experiment) is equal to the proper bias value u0 ) 50 (used in the relay experiment). Such assumptions cannot be made about the oscillations in the general case. To illustrate the asymmetric oscillations, we simulated the same systems as in Figure 4 but with a modified setpoint r ) 30. For the process here simulated, the modified setpoint would require a bias value u0 ) 30 which is no longer located halfway between umax and umin. This simulation is shown in Figure 5. A relay experiment with the original (improper) bias value u0 ) 50 is also shown for the sake of comparison. It is evident that the oscillations are no longer symmetric. The problem of load disturbances affecting the control loop during relay identification has been discussed by, e.g., Hang et al. (1993) and Shen et al. (1996). Load disturbances have a similar effect on the symmetry as the setpoint change illustrated here. In Figure 6 are shown simulations where the setpoint is adjusted even further away (r ) 10) from the original value r ) 50 in Figure 2. The identification experiments

Figure 6. Same as Figure 5 but for the modified setpoint r ) 10.

give extremely asymmetric oscillations, in particular in the input signals. For the saturated PI controller experiment the input oscillations are hindered only by the lower saturation levels; the upper saturation level umax ) 100 is no longer active. All three situations with symmetric and asymmetric oscillations illustrated in Figures 4-6 are likely to appear in practice and must therefore be considered in the analysis. Analysis of Oscillations In this section we analyze the oscillations illustrated in Figure 2 obtained through the connection in Figure 3. At the moment we assume that the oscillations are symmetric, but the analysis in the next section is extended to include also asymmetric oscillations illustrated in Figures 5 and 6. The describing function analysis provides us with a tool for analysis of the oscillations that occur for a nonlinear system connected to negative feedback (Atherton, 1982). The components of the feedback path are first classified in a linear part and in a nonlinear part. The linear part is characterized by a transfer function G(s), and the nonlinear part is characterized by an approximate gain and phase N(a) subject to sinusoid input. The feedback connected system is then oscillating with the frequency ω if the following condition holds (Atherton, 1982, p 115):

G(jω) ) -

1 N(a)

(5)

Assuming that the control loop in Figure 3 is oscillating (due to aggressive control settings) with a frequency ω, eq 5 gives the following information about the elements in the feedback loop (Atherton, 1982, p 115). (1) There is a 180° phase lag in the feedback path.

arg(GPI(ωi)) + arg(N(a)) + arg(Gp(ωi)) ) -180° (6) (2) At the observed frequency, the total amplification of the elements in the feedback path is equal to unity.

|GPI(ωi)||N(a)||Gp(ωi)| ) 1

(7)

The nonlinearity involved here, “ideal saturation”, is illustrated in Figure 7. As an example, this nonlinearity could describe the relation between the control signal to an input valve and the actual valve position. Input oscillations with amplitudes a smaller than the saturation level δ pass unchanged, with the gain N(a) consequently equal to 1. For larger amplitudes (a > δ) the nonlinearity causes some reduction in the input amplitude and the gain is hence smaller. The describing

4258 Ind. Eng. Chem. Res., Vol. 36, No. 10, 1997

Equation 7 gives the gain of the process at the identified frequency

rp ) |Gp(ωi)| )

Figure 7. Ideal saturation nonlinearity.

Figure 8. Point P on the Nyquist curve identified in the third quadrant by an identification angle φp. With a PI or PID controller this point can be moved to the point S which is specified by an angle φs and a magnitude rs.

function of the ideal saturation nonlinearity is given by (Atherton, 1982, p 85)

{

1 N(a) ) 1 (2R + sin(2R)) π

(8)

where R ) arcsin(δ/a). Note that N(a) is realsindicating that the phase lag contribution of the ideal saturation nonlinearity is zero, arg(N(a)) ) 0. Consequently, the overall phase lag contribution depends on the process and PI controller only. From the transfer function of the PI controller with the proportional gain Kc and integration time Ti (eq 4), we have the phase lag φPI of the PI controller

(

φPI ) -arg 1 +

)

( )

1 1 ) arctan Tiωi Tiω

(9)

Note that a typical dynamic element has a negative “phase angle” which is here expressed as a positive “phase lag”. Equations 6 and 9, in combination with the fact that the ideal saturation has zero phase lag, mean that the process is identified in the third quadrant. With respect to controller tuning (discussed later), it is motivated to introduce the concept “identification angle” defined as the angle between the negative real axis and a line from the origin through the identified point on the Nyquist curve; see Figure 8.

( ) 1 Tiω

φp ) arctan

(10)

From eq 4 we get the PI controller amplification kPI

x

kPI ) |GPI(ωi)| ) Kc

1+

1 Ti ω2 2

Here av is the amplitude of the controller output and ay the amplitude of the output oscillations. Equation 12 suggests that either of these must be measured in the identification experiment in order to calculate the process amplification rp at the observed frequency ω. To summarize, if the connection in Figure 3 causes continuous symmetric oscillations, we can identify a point P on the Nyquist curve, specified by a gain (eq 12) and an identification angle (eq 10). We observe that the whole system is identified at a 180° phase lag (eq 6), the phase lag contribution given by the PI controller is in the range of 0-90° (eq 9), and the phase lag given by the saturation nonlinearity is zero (eq 8). This means that the process is identified in the third quadrant. This information about the process is adequate for the purpose of PI and PID controller tuning (Åstro¨m and Ha¨gglund, 1995). A number of questions remain, however, unanswered. Therefore, it is important to investigate possible asymmetric oscillations illustrated in Figures 5 and 6. This is discussed in the following section where a method to modify the saturation levels in order to achieve symmetric oscillations is proposed. Moreover, a method that takes into account the asymmetric oscillations in the identification is discussed. Asymmetric Oscillations

aeδ a>δ

1 1 ) (12) |GPI(ωi)||N(av)| kPIN(kPIay)

(11)

For the conventional relay experiment, it is a wellknown problem that asymmetric oscillations can appear during identification if the bias value u0 of the relay is improperly selected or if load disturbances affect the control loop during identification. These difficulties affect the accuracy of the identification, and a solution to overcome these problems has been proposed by Shen et al. (1996). Their method is based on two relay experiments. In the first experiment the asymmetric oscillations are used to calculate a new bias u0, and in the second the process is identified with the corrected bias, with symmetric oscillations in the identification experiment. A similar procedure can be used for the saturated PI controller experiment. Asymmetric oscillations can be used to modify the saturation levels (umax and umin) so that symmetric oscillations for a second saturated PI controller experiment are obtained. The observed asymmetric oscillations can be used to calculate a new bias value u0 that would give symmetric oscillations for a relay experiment if relay identification is preferred. In contrast to what we did in the relay experiment, we do not here attempt to identify a single predetermined point on the Nyquist curve (the critical point), but we try to identify a point on the Nyquist curve somewhere in the third quadrant. Moreover, it turns out that we can take into account the asymmetric oscillations in the calculations. To summarize, if asymmetric oscillations appear during the proposed saturated PI control identification, they can be utilized in three ways. 1. If a relay experiment is preferred, the asymmetric oscillations can be used to derive a proper bias value u0 for a relay experiment.

Ind. Eng. Chem. Res., Vol. 36, No. 10, 1997 4259

Figure 9. Illustration of the difference in symmetry between the describing function (DF) and the sinusoid-plus-bias-describing function (SBDF). The purpose of the describing function is to estimate an average gain of the amplitude reduction given by the nonlinearity.

2. The oscillations can be used to modify the saturation levels in order to achieve smaller but symmetric oscillations for a saturated PI controller experiment. 3. The asymmetry in the oscillations can be taken into account in the calculations, and a point P on the Nyquist curve in the third quadrant can instantly be identified. The calculation of the bias u0 and the identification of the asymmetric oscillations are analyzed below. The asymmetric oscillations caused by the saturated PI controller in Figures 5 and 6 illustrate an interesting and useful feature: the output y oscillates closer to the setpoint than it does for the relay experiment. In contrast to relay identification, the average of y for one period of oscillation is equal to the setpoint r.

yj )

∫t′t′+Py(t) dt ) r

1 P

(13)

The integral of the signal over one period in eq 13 is referred to as the steady-state part of the signal y. The reason for the relationship yj ) r is the integral action in the controller, and it is justified by the fact that, for an oscillating feedback system, the steady-state part of the input to an integrator is zero (Atherton, 1982, p 182). Now consider the steady-state part of the input signal.

u)

∫t′t′+Pu(t) dt

1 P

(14)

Steady-state relations together with the fact that yj ) r indicate that u ) u is the input signal that would give output y ) r at constant signals and, consequently, the bias value that would give symmetric oscillations for a relay experiment. With eq 14 we can calculate a bias value that would give symmetric oscillations for a relay experiment. Moreover, we can modify the saturation levels so that symmetric oscillations in a saturated PI controller experiment are obtained. To summarize, an oscillating control loop with integral action in the controller can be used to determine a proper input bias for a relay experiment or to modify the saturation levels for a saturated PI controller experiment. The input bias is u0 ) u, and the saturation levels are umax,min ) u ( h, where u is the average of u over one period of oscillation (eq 14). The describing function analysis provides us, however, also with tools for the analysis of asymmetric oscillations (Atherton, 1982). With the sinusoid-plusbias-describing function (SBDF) analysis it is possible to estimate an average gain of a nonlinearity due not only to a sinusoid input (as in the describing function

Figure 10. Illustration of how one period of v (left) passes through the saturation nonlinearity, giving one period of u (right). The variables av, γ, δ, u0, and v0 in eqs 17-21 are also illustrated.

analysis), but also to a sinusoid-plus-bias input. The difference between DF and SBDF is illustrated in Figure 9. The SBDF for the ideal saturation nonlinearity is an extension of the conventional describing function. In the conventional describing function analysis, the input is assumed to have a steady-state part of zero, but in the SBDF analysis we assume a sinusoid input with a bias γ as a steady-state part. Otherwise, we use the same notation for the saturation levels ((δ) and for the amplitude of controller output oscillations (av). According to the SBDF analysis, the approximate gain of the ideal saturation nonlinearity due to a sinusoid-plus-bias input is given by (Atherton, 1982, p 408)

( ( ) ( ))

Np ) 0.5 f1

δ+γ δ-γ + f1 av av

(15)

where the function f1 is given by (Atherton, 1982, p 86)

{

1 2 f1(F) ) (arcsin F + Fx1 - F2) π -1

F>1 |F| < 1 (16) F < -1

With the assumption of sinusoid input to the nonlinearity, we get the relationship between the terms av, δ, and γ in eq 15 and the saturation levels umax, umin and the peak-to-peak values vmax, vmin. These variables are illustrated in Figure 10.

γ ) u0 - v0

(17)

u0 ) 0.5(umax + umin)

(18)

v0 ) 0.5(vmax + vmin)

(19)

δ ) 0.5(umax - umin)

(20)

av ) 0.5(vmax - vmin)

(21)

4260 Ind. Eng. Chem. Res., Vol. 36, No. 10, 1997

The point S can be interpreted as minimum specifications of the amplitude margin (AM) and the phase margin (PM), because assuming that S is chosen inside the unit circle in the third quadrant, the following relations hold for systems whose gain and phase decrease monotonously with increasing frequency:

AM > 1/rs PM > φs

Figure 11. PID controller tuning as interpreted by Åstro¨m and Ha¨gglund (1995). A given point on the Nyquist curve can be moved to an arbitrary position in the complex plane by proportional (P), integral (I), and derivative (D) action.

In analogy with the analysis of symmetric oscillations (eqs 10-12), but with SBDF analysis which incorporates the asymmetry in the calculations, a point P on the Nyquist curve can be identified with the angle φp given by eq 10 and the magnitude rp given by

rp )

1 kPINp

(22)

Here the PI controller gain kPI is given by eq 11 and the gain of the nonlinearity Np by eqs 15-21. Note that the angle φp and the magnitude rp are easily obtained because only three parameters need to be measured from the identification experiment, the oscillating frequency ω and the peak-to-peak values (vmax and vmin) of the controller output for a period of oscillation. In addition, we need the PI controller parameters (Kc, Ti) and the input saturation levels (umax,min). A rather large number of parameters and equations are involved, but the calculations are simple as there are no complicated root-finding or numerical integration routines involved. Controller Tuning With the saturated PI controller experiment, a point on the Nyquist curve somewhere in the third quadrant is identified. This point is specified by three parameters, the identified frequency ω, an angle φp, and a magnitude rp. This information about the process is the same as what we obtain in an identification experiment through a relay with hysteresis. For that purpose Åstro¨m and Ha¨gglund (1995) developed a controller tuning method for PI controller tuning and PID controller tuning. Their method is based on the observation that a PID controller connected in series with the process can move the identified point to a point arbitrarily selected in the complex plane with the use of proportional, integral, and derivative action; see Figure 11 (adapted from Åstro¨m and Ha¨gglund, 1995, p 140). If we restrict ourselves to PI controller tuning without derivative action in the controller, the identified point cannot be moved to a point arbitrarily selected in the complex plane. Figure 11 suggests that the PI controller connected in series with the process can only move the identified point clockwise. This fact also follows from the positive phase lag contribution of the PI controller (eq 9). In the sequel the identified point P is specified with a magnitude rp and an identification angle φp. With the controller connected in series with the process, the point P is moved to a point S specified by a magnitude rs and an angle φs. These variables are illustrated in Figure 8.

(23)

Note that the restriction of choosing PI control instead of PID control means that the minimum phase margin specification must be chosen smaller than the identification angle. The parameters rs and φs are design parameters which must be specified by the user, commonly in the ranges of 0 < rs < 1 and 0 < φs < φp. For the selection of rs and φs, Friman and Waller (1997) studied a large number of different processes, including processes with dead times, integrators, and first-, second-, and higher-order processes as well as processes with non-minimum-phase dynamics, and found that good average robustness and performance were obtained with the specification rs ) 0.5 and φs ) 15°. (This recommendation was based on an identification angle φp ) 30°.) When the points P and S are known, it is straightforward to calculate the PI controller parameters. Åstro¨m and Ha¨gglund (1995, p 141) give the following equations for calculation of the controller settings. The controller gain is given by

Kc )

rs cos(φs - φp) rp

(24)

and the integral time is given by (note that it is required that φp > φs)

Ti )

1 ω tan(φp - φs)

(25)

For the purpose of identification and tuning, some simple guidelines can be given. Various identification angles are obtained by different proportional action/ integral action ratios in the controller during identification. A smaller integral time introduces more phase lag in the controller and, hence, a larger identification angle is obtained. If a prespecified identification angle is required, an iterative method must thus be applied. Multiple points on the Nyquist curve can be utilized to obtain transfer function models; see Li et al. (1991). If some knowledge of the process is available, it can be utilized for identification and tuning. For processes whose dynamics is dominated by a dead time, a large identification angle and a small phase margin specification are recommended. Friman and Waller (1997) recommend φp ) 45° and φs ) 0°. On the other hand, if the controlled process contains an integrator, integral action in the controller is of little use, and in that case the phase margin specification should be selected so that the difference φp - φs is small (from simulations we recommend 0° < φp - φs < 10°). The identification and tuning procedure proposed can be summarized by the following steps. 1. Register the physical saturation levels umin and umax. If tighter levels are preferred, program the control system to operate with modified saturation levels. Turn off any integral windup compensation feature. Adjust

Ind. Eng. Chem. Res., Vol. 36, No. 10, 1997 4261

Figure 12. A water mixer.

the PI controller parameters Kc and Ti so that the control loop starts oscillating (turns unstable). 2. Measure the frequency of oscillation ω and the peak-to-peak values vmin and vmax of the control signal. 3. Identify the process amplification rp (eq 22) and identification angle φp (eq 10). 4. Calculate a new controller gain Kc (eq 24) and a new integral time Ti (eq 25) through the specifications rs and φs interpreted as a minimum specification on the amplitude margin AM and phase margin PM (eq 23) of the controlled system. If the identified angle φp in step 3 is unfavorable with respect to the phase margin specification in step 4, a modification of the initial PI controller settings is necessary. Some iterations might thus be needed in the identification procedure. Experimental Example: A Water Mixer This process is a water mixer (Figure 12) previously controlled through various multivariable control algorithms (Roos, 1991; Stro¨mborg, 1992; Ha¨ggblom, 1993; Friman and Waller, 1994). The controlled variables are the level h and temperature T, and the manipulated variables are the voltages (Ucold, Uwarm) to the cold water valve and to the warm water valve, respectively. We used decentralized control with the variable pairing given as {level control r cold water flow} and {temperature control r warm water flow}. At the considered operating point (h ) 20 cm; T ) 30 °C), the level control loop has a time constant of 3 min and a temperature loop constant of 0.5 min. Note that these time constants are not identified nor back calculated; only a single point on the Nyquist curve is identified during each identification experiment. The relative gain (RGA) is on the order of 0.5. Because the two control loops interact, we must tune the controllers by a strategy that takes into account the interactions between the control loops. Such a method, suggested for autotuning of decentralized controllers, is the sequential tuning method (Loh et al., 1993). For decentralized control of a 2 × 2 system with the sequential tuning method, the smallest number of identification and tuning steps is three and can, e.g., be the following. 1. The first loop is identified with the second controller in open-loop. The controller is tuned and connected on automatic control. 2. With the first loop on automatic control, the second control loop is identified, tuned, and connected on automatic control. 3. The first loop is reidentified and tuned, with the second on automatic control. If necessary, steps 2 and 3 can be repeated until controller settings converge. Loh et al. (1993) propose

Figure 13. Identification experiment of the water mixer.

that, if the loop with the fastest dynamics is tuned first, rapid convergence of the tuning procedure is obtained, and in that case more than three identification and tuning experiments do not change the controller settings very much. For the sake of simplicity we made all identification and tuning experiments according to the sequential tuning method with the three-step procedure discussed above. Loh et al. applied the Ziegler-Nichols controller tuning rules, but in this method, where a point on the Nyquist curve in the third quadrant is identified, the Åstro¨m-Ha¨gglund (1995) method based on minimum specifications on the amplitude margin and phase margin for the PI controlled system is more appropriate. An identification and tuning experiment is presented in Figure 13. The experiment is a startup procedure starting from an empty tank. Three identification and tuning experiments are made. 1. At time instant t ) 0 the level controller is tuned to be unstable with the temperature controller in openloop. From previous experiments it was known that the controller gain had been less than 1 V/cm and the gain was therefore selected to Kc,cold ) 10 V/cm in order to achieve an oscillating (unstable) system. The integral time was selected to Ti,cold ) 1 min and the saturation levels were selected equal to the physical saturation levels, i.e., umin ) 0 V (corresponding to a closed valve) and umax ) 9.9 V (corresponding to an fully open valve). At time instant t ) 7 min the process is identified and the controller is tuned with minimum specifications on the amplitude margin and the phase margin (rs ) 0.5; φs ) 10°). 2. At t ) 7 min the temperature controller is tuned to be unstable. In analogy with the first experiment, it was known from previous experiments that the gain had been less than 1 V/°C and the gain was consequently selected to Kc,warm ) 10 V/°C in order to secure an unstable loop. The integral time and the saturation levels were the same as those for the level control identification experiment in step 1. At t ) 16 min the process is identified and the controller is tuned (rs ) 0.5; φs ) 10°). 3. The level control loop is then reidentified. At t ) 16 min the controller is tuned to be unstable (through the same controller settings and saturation levels as in

4262 Ind. Eng. Chem. Res., Vol. 36, No. 10, 1997 Table 1. Values from Three Identification and Tuning Experiments from the Experimental Run Illustrated in Figure 13 initial controller param loop level temp level

Kc 10 V/cm 10 V/°C 10 V/cm

identified process param

obtained controller param

Ti (min)

ω (rad/min)

rp

φp (deg)

1 1 1

3.9 2.4 3.0

0.92 cm/V 2.48 °C/V 1.32 cm/V

14.3 24.0 18.5

Kc 0.54 V/cm 0.20 V/°C 0.31 V/cm

Ti (min) 3.4 1.8 2.2

Table 2. Same as Table 1 but for the Experimental Run in Figure 14 initial controller param loop level temp level

Kc 10 V/cm 10 V/°C 10 V/cm

identified process param

obtained controller param

Ti (min)

ω (rad/min)

rp

φp (deg)

0.5 0.5 0.5

6.3 3.5 5.2

0.85 cm/V 3.28 °C/V 0.96 cm/V

17.7 29.8 20.9

Kc 0.58 V/cm 0.14 V/°C 0.51 V/cm

Ti (min) 1.2 0.8 1.0

proposed method is easy to understand since no waitfor-the-process-to-stabilize step is required before each identification and tuning experiment. The control quality was further tested by setpoint changes of level and temperature (not shown). No significant differences in the control quality for the controller settings obtained through the three tuning experiments were observed. Discussion

Figure 14. Same as Figure 13 but with reduced input saturation levels.

the first experiment), and at t ) 24 min the process is identified and the controller is tuned (rs ) 0.5; φs ) 10°). Data about the identification and tuning experiments are summarized in Table 1 where initial PI controller parameters during identification, the identified frequency ω, the identified process amplification rp, and identification angle φp are shown. The controller parameters obtained through the minimum specifications on the amplitude margin and phase margin (rs ) 0.5; φs ) 10°) are also included. In order to demonstrate the reduction of the magnitudes of oscillations through tighter, user-modified, saturation levels, the identification and tuning experiments in Figure 13 were made with the saturation levels umin ) 3 V and umax ) 7 V. This identification experiment is shown in Figure 14. Clearly the magnitudes of oscillations are smaller. Process identification data and controller settings are given in Table 2. For the sake of comparison we made a conventional relay autotuning experiment according to the sequential tuning method (Loh et al., 1993) discussed above. In order to determine a proper bias value for the relay experiment, a steady-state input-output relation of the process must be known. Such a relation can, e.g., be the input and output values of the process at rest. In order to obtain such an input-output relation, the controllers were put on manual and in 15 min the level had stabilized. After that the level control loop and temperature control loops were autotuned according to the three-step procedure discussed above. The whole experiment took 42 min, which can be compared to the experiments illustrated in Figures 13 and 14 which both took 24 min to make. The difference in favor of the

The controller tuning method here proposed is considered an alternative to relay autotuning. Even though the setup of an unstably tuned PI controller provides a useful method for process identification and controller tuning, there are some disadvantages involved. The experimental examples above indicated that the identification and tuning experiment might be difficult to automate. This relates to the user specification of two initial controller parameters during identification, the controller gain and integral time, a selection that requires some knowledge of the process. First, the controller parameters must be selected so that an unstable control loop is obtained. Moreover, a modification of the proportional action/integral action ratio of the PI controller during identification might be necessary if there are specifications on the identification angle. The tuning method could be extended to incorporate also PID controller tuning. As already mentioned, the proposed identification method provides the same information about the process as a relay with hysteresis experiment does, and similar tuning rules can consequently be utilized. Derivative action in the controller should, however, not be connected during identification. One advantage with the proposed method is that it could be applied on a group of processes badly suited for relay autotuning. Such a group is processes whose main dynamics do not have a 180° phase lag, with level control referred to as a standard example. Even though all real processes do have a 180° phase lag, problems during identification can occur if the 180° phase lag is obtained at a high frequency with typically small and hardly measurable magnitudes of output oscillations. With the method suggested here, a phase lag of 180° is not required. A minimum phase lag of 90° is appropriate because of the phase lag contribution of the PI controller in the feedback path during identification. It is strongly recommended that user-modified tight saturation levels be used during identification instead of physical saturation levels. Considering typical control loops of level, temperature, and pressure in the chemical process industry, it is not a difficult task to find examples where costly damage could be caused if

Ind. Eng. Chem. Res., Vol. 36, No. 10, 1997 4263

the process turns unstable, with oscillations hindered only by physical saturation levels. For most real processes, changes in the saturation levels give variations in the identified process parameters due to nonlinear behavior of the process. Tighter saturation levels mean that the process is locally identified; larger saturation levels, on the other hand, mean that the process is identified at a wider region. This difference was apparent in the water mixer experiments above. The use of large saturation levels gave a larger identification angle compared to the case with tighter saturation levels. This phenomenon relates to the movement of the input valves. The valves move at a constant, rather slow, speed, and they introduce a phase lag into the system, with a larger phase lag for a larger magnitude of oscillation. In identification experiments of processes like this, the operator must decide whether or not he wants to incorporate the maximum valve movement into the identification, something that might be useful to do if large valve movements are expected in control and operation. The difference in the identified phase lag in the experimental runs in Figures 13 and 14 explains why stronger integral action in the initial controller parameters was selected for the run in Figure 14. This selection introduced more phase lag into the control loop and allowed equal phase margin specifications in all six controller tuning experiments illustrated in Figures 13 and 14. Conclusions A new method for on-line identification and PI controller tuning has been proposed. With this method, a PI controller is tuned to become unstable, on purpose or by mistake, and the subsequent oscillations are used for process identification and subsequent controller tuning. The method has proved to be particularly useful for rapid startup because the operator does not need to bring the process to the operating point before identification. For situations where the process turns unstable due to, e.g., changes in the operating conditions, no separate identification experiment is needed but new controller parameters can instantly be derived. To use a PI controller instead of a relay in the feedback loop during identification means that the process is identified in the third quadrant. This has certain advantages as it allows PI controller tuning with minimum specification on both amplitude margin and phase margin. Acknowledgment These results have been obtained within the Graduate School in Chemical Engineering with funding from the Academy of Finland. This support is gratefully acknowl-

edged. Moreover, I thank Kurt Waller and Hannu Toivonen for valuable comments and careful reading of the manuscript. Literature Cited Åstro¨m, K. J.; Ha¨gglund, T. Automatic Tuning of Simple Regulators with Specifications on Phase and Amplitude Margins. Automatica 1984, 20, 645-651. Åstro¨m, K. J.; Ha¨gglund, T. PID Controllers: Theory, Design, and Tuning, 2nd ed.; Instrument Society of America: Research Triangle Park, NC, 1995. Atherton, D. Nonlinear Control Engineering, student ed.; Van Nostrand Reinhold: London, 1982. Bogere, M. N.; O ¨ zgen, C. On-Line Controller Tuning of Second Order Dead Time Processes. Chem. Eng. Res. Des. 1989, 67, 555-560. Chen, C.-L. A Simple Method for On-Line Identification and Controller Tuning. AIChE J. 1989, 35, 2037-2039. Friman, M.; Waller, K. V. Autotuning of Multiloop Control Systems. Ind. Eng. Chem. Res. 1994, 33, 1708-1717. Friman, M.; Waller, K. V. Closed-Loop Identification by Use of Single-Valued Nonlinearities. Ind. Eng. Chem. Res. 1995, 34, 3052-3058. Friman, M.; Waller, K. V. A Two-Channel Relay for Autotuning. Ind Eng. Chem. Res. 1997, in press. Ha¨ggblom, K. E. Experimental Comparison of Conventional and Nonlinear Model-Based Control of a Mixing Tank. Ind. Eng. Chem. Res. 1993, 32, 2653-2661. Hang, C. C.; Åstro¨m, K. J.; Ho, W. K. Relay Auto-Tuning in the Presence of Static Load Disturbance. Automatica 1993, 29, 563564. Lee, J. On-line PID Controller Tuning from a Single, Closed-Loop Test. AIChE J. 1989, 35, 329-331. Li, W.; Eskinat, E.; Luyben, W. L. An Improved Autotune Identification Method. Ind. Eng. Chem. Res. 1991, 30, 15301541. Loh, A. P.; Hang, C. C.; Quek, C. K.; Vasnani, V. U. Autotuning of Multiloop Proportional-Integral Controllers Using Relay Feedback. Ind. Eng. Chem. Res. 1993, 32, 1102-1107. Roos, K. A Study of Autotuning in Process Control (in Swedish). M.Sc. Thesis, Process Control Laboratory, Åbo Akademi, Åbo, Finland, 1991. Shen, S.-H.; Wu, J.-S.; Yu, C.-C. Autotune Identification to Overcome Load Disturbance. Ind. Eng. Chem. Res. 1996, 35, 1642-1651. Stro¨mborg, K. B. Multivariable Self-Tuning PID Control of a Mixing Tank. Report 92-7, Process Control Laboratory, Åbo Akademi, Åbo, Finland, 1992. Yuwana, M.; Seborg, D. E. A New Method for On-Line Controller Tuning. AIChE J. 1982, 28, 434-439.

Received for review March 26, 1997 Revised manuscript received July 7, 1997 Accepted July 8, 1997X IE970249Y

X Abstract published in Advance ACS Abstracts, September 1, 1997.