Control of Nonlinear Chemical Processes Using Adaptive Proportional

modified PID algorithms that have the ability to adapt their tuning parameters on-line can be ... An automatic on-line tuning strategy for PI controll...
0 downloads 0 Views 157KB Size
1980

Ind. Eng. Chem. Res. 2000, 39, 1980-1992

Control of Nonlinear Chemical Processes Using Adaptive Proportional-Integral Algorithms Emad Ali* Chemical Engineering Department, King Saud University, P.O. Box 800, Riyadh 11421, Saudi Arabia

It is believed that a fixed-parameter proportional-integral derivative (PID) may not do well for nonlinear, time-variant, or coupled processes. It needs to be re-tuned adequately to retain robust control performance over a wide range of operating conditions. Alternatively, nonlinear control algorithms can be employed. To avoid complexity introduced by such nonlinear controllers, modified PID algorithms that have the ability to adapt their tuning parameters on-line can be used instead to perform as well. An automatic on-line tuning strategy for PI controllers is proposed and compared with other existing adaptive PI algorithms such as fuzzy gain scheduling, model-based gain scheduling, a nonlinear version of PI, internal model control, and self-tuning adaptive control. The proposed tuning methodology adapts the PI settings by direct utilization of explicit expressions for the gradients of the closed-loop response with respect to the PI settings. The adapted parameters are determined such that the resulting closed-loop response lies inside predefined time-domain constraints. Application of the proposed technique as well as the other aforementioned systems to two nonlinear simulated continuously stirred tank reactor examples is demonstrated. These examples present challenging control problems because of their interesting dynamics such as time-varying gain and gain with changing sign character. Simulation results indicated that the proposed tuning algorithm can provide comparable, if not superior, performance to those obtained by the other tested algorithms. Introduction The conventional proportional-integral derivative (PID) algorithm is still widely used in the industry because it is simple, robust, and time-tested. However, its performance may degrade when applied to highly nonlinear processes, which are the fact rather than the exception in the chemical process industry. Many tuning procedures for PID algorithms were proposed in the literature to retain good performance.1 However, despite their differences, these methods provide only initial (fixed) good values. Generally, standard PID algorithms with fixed parameters may perform poorly when the process gain varies substantially with operating conditions. In this case, different sets of controller parameters should be used for differently partitioned regions of the operating condition space; otherwise, nonlinear control such as nonlinear model-predictive control should be used.2 Gain-scheduled control and adaptive PI control are other alternatives for handling processes with known nonlinearities.3 Recently, the future of these schemes became more promising.4 Ali1 proposed an automatic online tuning (ATN) approach for PI algorithms, which is capable on nonlinear compensation. The approach adapts the PI settings continuously on-line to force the resulted closed-loop response to satisfy predefined performance specifications. The approach can improve the control performance, even if no a priori knowledge of good values for the PI settings is available. The special features of the proposed automatic tuner can be summarized as follows: 1. It incorporates closed-loop prediction criteria. This allows advance correction of the controller settings. It includes feedback; thus, it can compensate for modeling errors. * To whom correspondence should be addressed. Fax: ++(9661)467-8770. Phone: ++(9661)467-6871. E-mail: [email protected].

2. The performance specification is expressed in the form of time domain constraints, which makes it more appealing for a practitioner. This also adds some flexibility because the user can adjust his/her specification on-line for trade-off. 3. The method can adjust the parameters of all control loops simultaneously and interactively where other methods tune each loop individually. A similar approach was used by Zhou et al.5 to tune generic model control. However, in their approach an open-loop prediction of the output response is used. The objective of this paper is then to test the proposed ATN and compare its performance with those obtained by different existing adaptive PI schemes, among which are fuzzy gain scheduling6 (FGS), model-based gain scheduling7 (MGS), a nonlinear version of PI algorithms8 (NLPI), internal model control9 (IMC), and a self-tuning controller (STC) with a PID structure.10 The intent is to demonstrate how the proposed automatically tuned PI algorithm would provide improved performance over those obtained by a fixed-parameter PID and adaptive (gain-scheduled) control algorithms when applied to processes with time-varying dynamics. In addition, a similar performance improvement can also be achieved for processes with gain that changes the sign in which conventional PID controllers fail. Thus, such a controller can deliver robustness over a broader range of operating conditions. It should be mentioned that the proposed algorithm is a hybrid system of standard PI algorithm in the lower level and a model-based tuning algorithm in the higher level. The purpose of the tuning algorithm is to update the PI parameters each sampling time or at scheduled time intervals. No specific type of model is required for the tuning algorithm. Any form of models that can predict the output response and sensitivity to PI tuning parameters is sufficient. In this case, the proposed

10.1021/ie990517n CCC: $19.00 © 2000 American Chemical Society Published on Web 05/05/2000

Ind. Eng. Chem. Res., Vol. 39, No. 6, 2000 1981

method is an intermediate solution between the full nonlinear control algorithms and the simple adaptive PI algorithms. The nonlinear control algorithms utilize the nonlinear model directly in the computation of the control law, thus increasing its computational effort and synthesis procedure. On the other hand, the simple adaptive PI algorithms may lack the enhanced performance provided by the proposed algorithm. In the following sections detailed formulation of the tested adaptive PI algorithms including the proposed one is given. Afterward, simulated demonstration of their performance is carried out on two continuously stirred tank reactor (CSTR) control examples. The last section outlines the general conclusions of the study.

Here, kc0 and kp0 are the reference values for the controller and process gains, respectively. The idea is to keep the overall gain of the closed-loop system, that is, the product kc0kp0, constant. It is necessary to keep the overall gain less than unity, particularly at the crossover frequency, to ensure stability.11 Any other known model-based tuning procedure for PI controllers such as ITAE, Coon and Cohen, and IMC13 can also be cast as a MGS scheme. Robust PI Scheme The IMC-based PI controller tuning formalism for first-order lag systems without delay is given as follows:9

kc )

Nonlinear PI Scheme A NLPI control algorithm was proposed by Shunta and Fehervari8 to control the liquid level in a storage tank. It is designed to allow a varying controller gain to accommodate a varying process gain. The controller gain is modified as follows:

kc(t) ) kc0 (1 + κ |e(t)|)

(1)

where kc0 is the controller gain at zero error, e is the error signal expressed in a percentage, and κ is a design parameter.11,12 One advantage of this type of controller is that it permits the use of a small gain so that the system is stable near the set point over a wide range of process operating conditions. With low gain, the closedloop system is insensitive to noise and small disturbances. For large disturbances, however, the controller gain will increase with deviation (e), leading to a rapid response.

Adapting the controller gain with a changing process key (auxiliary) variable is known in general as GS.6-7,11-13 The conventional way of gain scheduling is switching between different sets of local linear controllers, each of which is designed for a specific region of the process operating condition space. Gain scheduling can have different formulations,14 one of which can be given as an interpolation of two given extreme values for the controller gain:15

kc(t) ) (1 - q)kuc + qklc

(2)

where kuc and klc are the upper and lower values for the controller gain, respectively, and q is an interpolation parameter, which can be given as

q ) exp(-κ |e(t)|) where κ is a design parameter. In this case, the scheme is also known as FGS.6 This interpolation criterion is used to provide smooth transition between two different values for the gain. In the present work, the extreme values for kc are determined by their magnitude irrespective of their signs. If the process model is available or its gain can be estimated on-line, a programmable or model gain scheduling (MGS) can be formulated as follows:7

kc(t) )

kc0kp0 kp(t)

(3)

τI ) τ

(4)

where τ is the process time constant and λ is the IMC filter time constant. Instead of using the IMC tuning criteria in a MGS formulation, fixed values for kc and τ can be determined, which provide robust stability and performance for the set of all possible plants, that is, over the entire process operating conditions space. According to Morari and Zafiriou,9 the closed-loop system is robustly stable if and only if the controller stabilizes the nominal plant (p˜ ) and satisfies

|f(iω)|
yi(k + l) yi(k + l) - yui (k + l)

if yui (k + l) < yi(k + l)

0

if yui (k + l) g yi(k + l) g yli(k + l)

}

i ) 1, ..., ny, l ) 1 + ndi, ..., Pw + ndi Step 3. Determine the sampling point at which the maximum violation of the specification occurs. Let this be for output j and point k + m:

Mj(k + m) ) max

max

1eieny 1+ndielePw+ndi

Mi(k + l)

Step 4. If Mj(k + m) ) 0, go to step 5; otherwise, Step 4.1. Compute the deviation from the desired specification and relax it if necessary:

∆y ) -ylj(k + m) - yj(k + m) if ylj(k + m) > yj(k + m) yj(k + m) - yui (k + m) if yuj (k + m) < yj(k + m)

{

}

Step 4.2. Define a ) ∇wkyjT (k + m) and scale it by postmultiplying with ψ, which is a matrix that has the current values of the settings on the diagonal and zeros elsewhere. Step 4.3. If ||a||∞ e β (a user defined number, equal to 10-5 in this paper), go to step 4.4; otherwise, solve:

min ||a∆wk - ∆y||2 ∆wk

subject to

∆wl e ∆wk e ∆wu where ∆wl ) wl - wk, ∆wu ) wu - wk, and wl and wu are the lower and upper bounds on w, respectively. Go to step 4.5. Step 4.4. Set ∆wk ) 0. Step 4.5. Set wk ) wk + ∆wkψ. Step 5. Compute and implement the control action. Shift to the next sampling time, and set k ) k + 1. Go to step 1. The optimization problem (step 4.3) is solved by MATLAB software. When the sampling time exceeds the window size of the bounds, the tuner is disabled and switched back to the observation phase. Pw is used as an adjustable parameter. However, as a rule of thumb, a value for Pw between 3/h and 10/h, where h is the sampling time, would result in the best possible performance. A value less than 3/h is too short to predict bound violation early. If a value less than 3/h for Pw is used, then it results in slower and delayed adaptation. A very large value may be of no benefit as modeling errors propagate with horizon. Moreover, depending on

the window size of the performance specifications, a lagging bound violation that may not be anticipated with Pw g 10/h is unlikely. Nevertheless, Pw equal to the process time constant divided by the sampling time is a good starting value. The shape of the performance specifications can be designed such that it reduces overshoot, reject disturbances, and maintain proper speed of the response. The nominal magnitude of performance specifications is determined by prudent plant experience. However, they are adjusted automatically on-line to suit the actual size and behavior of the process output. The specifications can also be changed on-line via the user to search for a better performance or to achieve possible tradeoff. When dealing with a multiloop system, the space of tuning parameters, w, contains the PI parameters for all loops. Thus, step 4.3 of the tuning algorithm adjusts all these parameters simultaneously. To consider crossloop interaction, additional linear constraints can be added to the least-squares problem in step 4.3. However, this paper deals with SISO systems. The issue of simultaneous and interactive tuning of MIMO systems is considered in an upcoming paper. Each controlled output should be assigned two “nominal” performance envelopes. One for disturbance rejection and another for set point tracking. Typical performance envelopes are shown in the simulation figures using a solid line. In the following section, activation of the tuning algorithm and scaling of the nominal performance envelopes are discussed. Activation of the Algorithm. Process Operating at Steady State. The closed-loop response will be monitored every sampling interval to check whether the closedloop prediction of the process output violates its corresponding threshold value or not. The adaptation algorithm will then be triggered only when any of the outputs violates its threshold value because of the influence of disturbance. The algorithm will be turned off again when the time exceeds the window size of the specifications. The tuning algorithm will scale the disturbance performance specifications to properly suit the actual behavior of the process under disturbance. To achieve this, a scaling factor will be computed on-line at the triggering point on the basis of an estimate of the actual effect of the disturbance on the output. At the triggering point, say, k, the estimate of the disturbance effect on the output j, which possesses the maximum violation of its threshold, is given by

dj ) ypj(k) - ymj(k) where “ym” is the model output and “yp” is the measured output. Hence, the scaling factor can be computed as follows:

Sdj )

µdj max ybd(l,j)

(26)

1elens

where “ybd” is the nominal disturbance specifications and ns is the size of the specifications window. Here, µ is a relaxation tuning parameter. A value of 2 for µ means that Sdj is equal to 1 when dj is half the maximum value of the specifications. The nominal envelope specifications for output j will be scaled through multiplication with Sdj. For the other outputs, the upper bound of their corresponding nominal speci-

Ind. Eng. Chem. Res., Vol. 39, No. 6, 2000 1985

fications will be scaled by multiplication with the absolute value of Sdj, while the lower bound will be changed to the mirror image of the upper bound after scaling. Process Operating at Changing Set Point. In this case, the adaptation is triggered at the time instant at which the set point change occurs. When the time exceeds the window size of the specifications, the algorithm will then be turned off, and nominal disturbance specifications are assigned to the output with set point change assuming that the output has settled at its new set point. In this case, scaling the nominal envelopes is straightforward. Each output with a changing set point is scaled with the magnitude of its corresponding set point change. Outputs with fixed set points are scaled by the absolute value of the maximum set point change. To avoid getting an ambiguous scaling factor, the scaling factor for outputs with fixed set points in the above two cases is constrained between upper and lower limits (Sdu, Sdl) which are determined by the user.

Figure 1. Schematic diagram of the nonisothermal CSTR of example 1. Table 1. Process Parameters parameter

value

parameter

value

Tf Tamb Vr Hair ∆H D Tref E k0

24 °C 29 °C 2.8 l 2.5 J/(m2 °C min) -1.5 kJ/mol 15 cm 24 °C 48.32 mol/J 109.31 L/(mol min)

R CpA CpB CpC CpD CAf CBf CCf CDf

0.008314 J/(mol K) 75.25 J/(mol °C) 175.3 J/(mol °C) 78.2 J/(mol °C) 103.8 J/(mol °C) 0.1 mol/L 0.1 mol/L 0.0 mol/L 0.0 mol/L

Simulation Examples In the following, two examples are presented to evaluate the proposed algorithm and other adaptive PI algorithms. Note that all the algorithms are based on standard PI algorithms implemented in digital form; that is, the control action is computed at the sampling time. The sampling time is taken to be 1 min for example 1 and 0.2 min for example 2. The PI parameters are updated each sampling time for all the algorithms except IMC. The latter uses fixed PI parameters. As mentioned above, all the control algorithms including the proposed one are based on a PI controller integrated with a tuning method. Thus, these control algorithms are conceptually similar but vary according to the complexity of their tuning methods. NLPI and FGS tuning methods operate directly on the measured output. The MGS tuning method requires measurement of additional key variables and uses a correlation that determines the process operating conditions from the measured key variable. On the other hand, IMC, STC, and ATN use model-based tuning methods. However, IMC utilizes the model only off-line, that is, during the design phase. STC utilizes the model on-line and, moreover, requires frequent adaptation of the model. Therefore, it is more computationally involved than the aforementioned methods. ATN utilizes the model online and requires solving the constrained least-squares problem. Although ATN seems to be more computationally involved than STC, it can be further simplified if a linear recursive model is used. Moreover, regardless of the type of model used, the optimization problem (step 4.3) can be reduced to a solution of a least-squares problem or linear equations. In that case, the bounds on the design parameters can be satisfied by a regular saturation function. Example 1: Non-Isothermal CSTR. A liquid-phase chemical reaction of the form A1 + B1 f C1 + D1 with known kinetics19,20 is taking place in a nonisothermal CSTR as shown in Figure 1. The CSTR is equipped with an overflow and a total feed (pure A1 and pure B1). The two feeds are equimolar at 0.1 M. This reactor represents an existing lab-scale process at the department laboratory with its various design parameters listed in Table 1. This process is chosen as a test example for its varying dynamics character as it operates in two dif-

ferent stages. The first stage is the start-up where the process operates in a semibatch mode during which the liquid holdup is unstable. The second stage is the steady state where the process operates in a continuous mode during which the liquid holdup is constant at its maximum. The complete dynamic model for the process is given as follows:21

dV ) F1 + F2 dt

(27)

dVCA ) F1CAf - VkrCA2 dt

(28)

dVCc ) (F1 + F2)Ccf + VkrCA2 dt

(29)

4

V(

CiCpi) ) (F1CAfCpA + F2CBfCpB)(Tf - T) ∑ i)1 VkrCA2∆H - Qr (30)

where

kr ) k0 exp(-E/RT) Qr ) Ashair(T - Tamb) As denotes the reactor surface area. The material balances for component B1 and D1 are omitted because they are identical to those for component A1 and C1, respectively. Equations 27-30 simulate the CSTR dynamics during the start-up stage. To simulate the dynamics of the second stage, the liquid holdup is set constant at its maximum value and eq 27 to zero. Because of this interesting dynamics, the process gain and time constant change substantially with operating conditions, as shown in Figure 2a. The figure demonstrates the open-loop response of the product concentration for two different step changes in the inlet flows starting from zero initial conditions. The corresponding steady-state operating conditions of the process are listed in Table 2. According to Figure 2a, the process

1986

Ind. Eng. Chem. Res., Vol. 39, No. 6, 2000

Figure 2. (a) Open-loop response to two independent step changes in feed flow rates; (b) closed-loop response to -0.02 step change in CAf. Table 2. Steady-State Operating Conditions variable

initial

F1 F2 CA CB CC CD V T kp τ

0.0 L/min 0.0 L/min 0.1 moL/L 0.1 mol/L 0.0 mol/L 0.0 mol/L 0.0 L 24 °C 0.011

minimum throughputs

maximum yield

0.01 L/min 0.1 L/min 0.01 L/min 0.1 L/min 0.0062 mol/L 0.0174 mol/L 0.0062 mol/L 0.0174 mol/L 0.044 mol/L 0.0326 mol/L 0.044 mol/L 0.0326 mol/L 2.8 L 2.8 L 27.7 °C 26.5 °C -0.1382 -0.0338 8 5

maximum throughputs 1 L/min 1 L/min 0.03676 mol/L 0.03676 mol/L 0.01324 mol/L 0.01324 mol/L 2.8 L 25.04 °C -0.0039 1.35

has smaller gain at larger step change; thus, it can be concluded that the process possesses a negative gain. However, a positive controller gain is required at the zero initial condition to start up the reactor. The phenomena of varying process gain with operating conditions and the changing sign of the process gain during start-up are the main motives to implement and test the various proposed PI algorithms. The process static gain and time constant at different operating conditions are listed in Table 2. These process parameters were estimated by reaction curve tests, except those at the initial conditions. Because the initial condition is unstable, the process gain is identified by an impulse test.12 Disturbance Rejection. First, we consider the control problem of rejecting a step change disturbance in CAf while the process is operating at the maximum yield. The controlled variable is the product concentration (CC) with F1 and F2 as the manipulated variables. F1 will be manipulated via a standard PI control loop and F2 through ratio control with an obvious ratio of F1:F2 ) 1:1.21 The two inlet flows are constrained between 0 and 1 L/min. The resulting closed-loop response is shown in Figure 2b for three values of kc. The smaller gain (kc ) -55) is obtained by the Ziegler-Nichols22 method at the maximum yield operating conditions where the larger gain (kc ) -148) is obtained by the same method at the maximum throughput condition. It is clear that using a controller gain tuned at a higher process gain point leads to a sluggish response. Obviously, for this case, good performance can be achieved at larger kc. Next, we will seek improving the feedback performance through implementation of the proposed algorithms using kc ) -55 as the initial guess. A sampling time of 1 min is used in all simulations. Implementation of NLPI, FGS, and MGS methods to the above control problem is depicted in Figure 3a. The corresponding simulation for kc is shown in Figure 3b. It should be noted that, only for these algorithms, the reset time, τI, is fixed constant at 1.5, while kc0 ) -55,

Figure 3. Closed-loop response to a step change in CAf ) -0.02 mol/L using NLPI, FGS, MGS, and IMC algorithms.

klc ) -55, kuc ) -148, and κ ) 1 are used. Note that the value of τI is determined using the Ziegler-Nichols method and the value of κ by trail and error. The error signal, e, is taken as the percentage deviation from the initial value for the controlled variable. For the MGS algorithm, the time-varying process gain, kp, is computed on-line from a correlation obtained by fitting precalculated static gains to a logarithmic function in F1. Figure 3a indicates that MGS had the best performance in the sense of less downshoot. However, this method requires advanced programming of the process gain. Another encountered difficulty is that when the computed value is used for kp0 that corresponds to the operating condition about which kc0 is computed, the product, kc0kpc, becomes 1.5. Therefore, the overall gain of the control loop is larger than unity, which is an invitation for instability. This situation led, in fact, to an oscillatory closed-loop response, which is not shown in the figure. In fact, the simulation shown in Figure 3a corresponds to kc0kp0 ) 1. The IMC-tuned PI algorithm is also applied to this control problem and the result is shown in Figure 3a by the dash-and-dot line. In this case, a first-order transfer function for the nominal model is obtained around the maximum yield operating point:

p˜ (s) )

-0.00338 5s + 1

According to Table 2, excluding the zero condition, the following uncertainty set is obtained:

0.0039 < |kp| < 0.01382 1.35 < τ < 8 Given this information, the multiplicative uncertainty is defined as follows:

lm(s) )

-7.423s - 0.885 8s + 1

This leads to the following control parameters:

τI ) τ˜ ) 5 min,

kc )

τ˜ 5 ) λk˜ p -0.0338λ

(31)

The adjustable parameter λ is used to provide robustness. For this reason, the robust stability and perfor-

Ind. Eng. Chem. Res., Vol. 39, No. 6, 2000 1987

Figure 4. Bode plot of the robust stability and robust performance conditions.

Figure 5. Closed-loop response to a step change in CAf ) -0.02 mol/L using ATN and STC tuning algorithms.

mance conditions (eqs 5 and 7) are plotted against frequency for several values of λ, as shown by Figure 4. It is obvious that the closed-loop system is robustly stable for any value of λ > 0; however, robust performance requires larger values for λ Specifically, λ g 3 is necessary to ensure robust performance in the integral squared error (ISE) sense. As indicated by Figure 3a, the closed-loop response using the IMC-tuned controllers, given by eq 31 with λ g 3, is sluggish. This is, of course, due to robustness requirements, which dictated conservative controller parameter values. Although IMC resulted in inferior feedback performance compared with those obtained by the other methods, it is the only method that guarantees stability. Thus, it may become superior when the process operates at the verge of instability. The self-tuning PI control scheme described earlier was applied with P(0) ) I and θ(0) ) 0 with no additional filter on the controller output, as shown by Figure 5. The STC performance was found to be sensitive to the initial guess of P and θ. Therefore, an openloop simulation that brings the process output from a zero initial condition to the maximum throughput condition preceded the simulation shown in Figure 5. The reason for the open-loop simulation is to allow enough time for the RLS to converge to a reliable estimate of θ. The controller is then employed with the desired closed-loop poles placed on the origin. The

resulting closed-loop response (Figure 5) is far inferior to that of the ATN in the sense of larger downshoot. Further performance improvement through closed-loop poles placement and/or using covariance resetting or forgetting factor18 was found to be of little help. The proposed automatic tuning is also applied to this control problem with Pw ) 7 and two different initial values for kc, as shown in Figure 5. The value of Pw is determined by our rule of thumb mentioned earlier in the paper. τI(0) is set equal to 1.6 for both cases. A threshold value of (1% is used in both simulations. The desired performance specification envelope is selected such that it limits the overshoot to 4% during the first 10 samples, 2% during the second 10 samples, and 0.5% for the remaining samples within an overall window size of 30 samples. The controller gain was constrained between -50 and -200, and the reset time was constrained between 0.5 and 4. Because a large value for Pw is used, the tuner is triggered at the first sampling point. At the triggering point, the tuner flipped and scaled down the specification envelope to handle the adverse effect of the disturbance on the process output. The scaled performance envelope is shown in Figure 5 by the solid lines. The resulting closed-loop response outperformed that obtained by the STC in terms of less downshoot. However, for the case of kc(0) ) -148 a slower response is observed. This is because the reset time settled at a larger value. However, because a large portion of the output response lies inside the performance envelope, the feedback performance is considered acceptable. This is because the desired performance envelope is chosen arbitrarily and thus its strict satisfaction is not necessary. One purpose of the envelope is to provide a driving force to trigger the tuning algorithm. Overall, the entire adaptive PI algorithms used above, as shown in Figures 3 and 5, managed to vary kc to improve the regulatory performance. For fare comparison with the fixed-parameter PI algorithm tuned at maximum yield point and with each other, a numerical measure of the performance “goodness” is listed in Table 3. The second row of Table 3 lists the integral squared error. The error is defined as the deviation from the set point. While the third row presents the percentage deviation of the maximum downshoot for each algorithm from that for a fixed kc at -55. It is clear that all algorithms outperformed the PI algorithm with fixed settings in terms of smaller ISE and positive percentage deviation. The positive deviation is an indication of less downshoot. Specifically, the ATN method with kc(0) ) -55 had the best performance because it provided the smallest ISE and a relatively large percentage deviation. Although the ATN algorithm with kc(0) ) -148 had poorer performance measure with respect to that of MGS, it is considered superior to the others. Generally, NLPI, FGS, and MGS require reasonable values for the PI settings to be known beforehand, while the STC and ATN can start from any arbitrary values. Furthermore, the former methods lack a mechanism for on-line performance adjustment. On the other hand, while adjustment of the STC performance can be achieved via pole placement, the ATN performance can be fine-tuned through on-line adjustment of the specification bounds. This feature makes the ATN more appealing because expressing the desired performance in the form of timedomain bounds is more representative of the real-time practice. In addition, it provides visual measure of the

1988

Ind. Eng. Chem. Res., Vol. 39, No. 6, 2000

Table 3. Summary of Performance Comparisons for Various PI Algorithms algorithm

fixed kc at -55

NLPI

MGS

FGS

IMC

STC

ATNa

ATNb

ISE ×100 % deviation

0.45

0.1973 3.4

0.1118 8.3

0.1530 5.2

0.2613 4.8

0.1648 5.1

0.1058 7.4

0.1608 7.2

a

kc(0) ) -55. b kc(0) ) -148.

Figure 7. Schematic diagram for the adiabatic CSTR of example 2.

Figure 6. Closed-loop response to a set point change of 0.0326 mol/L using FGS, MGS, STC, and ATN algorithms.

performance goodness which eases the practitioner effort to track tradeoff among different performance specifications. Start-up Control Problem. Another challenging control problem related to this process is the start-up from a zero initial condition to a maximum yield condition. As mentioned earlier, the controller should be able to start initially with a positive controller gain and then switch to a negative one immediately. This situation rules out the use of NLPI and IMC. Implementation of FGS, MGS, STC, and ATN algorithms is illustrated in Figure 6. For the FGS algorithm, kuc ) -120, kuc ) 50, and percentage error (e) are used. It was found that κ must be retuned to make the algorithm perform well. For the MGS, the overall gain for the control loop is set constant at 0.5. As far as the STC algorithm is concerned, P0 ) I and θ(0) ) [0.3, 0.3, 0.1] are used. The latter is found from previous runs. It is necessary to start the RLS with good estimates of the model parameters to ensure stable operation of the STC. Unlike the disturbance rejection case, open-loop tests preceding the closed-loop simulation cannot be used to estimate the model parameters because the process is unstable at the initial conditions. For the ATN scheme, Pw ) 7, kc(0) ) 50, and τI(0) ) 1.6 are used in the simulation. It should be noted that the algorithm could perform as well for any arbitrary initial value for kc. The performance envelope is designed such that it allows 11% overshoot in the first 10 samples, limits the output to within 2% for the second 10 samples, and eventually brings the response to within 0.11%. As demonstrated in Figure 6, the entire adaptive PI algorithms had the ability to switch the sign of the controller gain from a positive to a negative value. The situation lead to successful automatic start-up. The fuzzy gain scheduled controller delivered relatively

slower response but with no overshoot, but at the expense of extensive adjustment of κ. The model-based gain scheduled and the self-tuning controllers displayed faster responses than those obtained for FGS, however, at the price of noticeable overshoots. Furthermore, the feedback response obtained by STC showed slow convergence to the set point because of slowly varying tuning parameters. Interestingly, the proposed automatic tuner scheme had a rapid and an overshoot-free set point tracking. It should be noted, although not shown here, that fixed-parameter PI failed. By failure, it is meant that it cannot start up the reactor from zero initial conditions for any fixed values for the tuning parameters. Using a PI controller with a fixed negative gain keeps the reactor at the initial conditions. In contrast, a PI controller with a fixed positive gain can start up the reactor, but suffers from offset and undesirable performance. It is worth mentionion that, for the case of the STC algorithm, kc was kept constant at 50 and τI at 2 for the first three samples during which the STC was disconnected. A transition from the fixed setting PI to the STC scheme was invoked at the third sample time. The initial fixed-parameter operation was necessary to collect enough data to activate the RLS estimator, which requires, depending on the size of the model, two past measurements of the output. Example 2: Adiabatic CSTR. This process is adopted from Economu et al.23 and depicted in Figure 7. A first-order reversible exothermic reaction of the form A f R is taking place in an adiabatic CSTR. The dynamic model of the process is given as follows:

x˘ 1 ) x˘ 2 ) -

u1x1 + k1(1 - x1) - k2x1 τx3

u1u2 u1x2 + 5[k1(1 - x1) - k2x1] τx3 τx3 x˘ 3 )

u1 - 0.43205xx3 τ

where

k1 ) 3 × 104 exp k2 ) 6 × 107 exp

( (

) )

-5000 1.98x2 -7500 1.98x2

Ind. Eng. Chem. Res., Vol. 39, No. 6, 2000 1989

Figure 8. (a) Equilibrium diagram; (b) steady-state gain.

In the model, x1, x2, and x3 denote the product concentration, temperature, and liquid level in the tank, respectively. u1 and u2 denote the flow rate and temperature of the inlet stream, respectively, and k1 and k2 denote the reaction rate constants for the forward and backward reactions, respectively. The time constant, τ, of the process equals 60 s. This problem is chosen because it has a sign change for the static gain, as clearly shown in Figure 8. This phenomenon may cause difficulties for linear controllers and thus pose a potential for application of nonlinear or adaptive PI control algorithms. In fact, different authors have tested their nonlinear control algorithms on this problem.5,24-26 In most of these studies, the control objective was to bring the process from one side of the equilibrium curve to the peak where maximum yield occurs. A linear PI controller can also handle this control objective. Because the initial position is known, that is, left or right of the peak, a proper sign for the controller gain can be used and thereby satisfactory set point tracking can be obtained. A more challenging control problem would be to reject input disturbances while the process is running at peak. A drift in the product concentration to the left of the equilibrium curve requires a controller gain with a positive sign and vice versa. Because the disturbance magnitude and its direction are not measured, multiple linear controllers must be used to tackle this situation. Instead, adaptive control algorithms that possess the capability to switch its gain sign can be helpful. For this reason, the MGS, STC, and ATN schemes are applied to this regulatory problem to compare and investigate their effectiveness. The FGS is not tested for this case because it requires extensive trial-and-error adjustment of its parameter κ. Specifically, these control schemes will be tested for rejecting a +5 K step change in the feed temperature while the process is operating at the maximum yield. Although a feed-forward controller can handle this control problem, we assume that these step changes represent an unmeasured arbitrary disturbance that drifts the process output to either sides of the equilibrium curve. The steady-state values at the peak are u1 ) 1.12 L/min, u2 ) 436 K, x1 ) 0.5088 mol/L, x2 ) 438.5 K, and x3 ) 0.1867 m. The controlled variables are the liquid height, x3, and the product concentration, x1. In due course, x3 is manipulated by u1 (feed flow rate) and x1 by u2 (feed temperature set point). Simulation of the height-flow loop is omitted in the sequel because it does not present any difficulties. For the second loop, two sets of good values for the PI settings are available. For the process operating at the left of peak, the settings are kc ) 800 and τ ) 2 and that for operating at the right of the peak are kc ) -800 and τ ) 2. A sampling time of 0.2 min is used in all simulations. The solid line in Figure 9a demonstrates the closedloop response to a -5 K step change in the feed temperature using a PI controller with a fixed wrong sign for the gain, that is, kc ) -800. The wrong sign of

Figure 9. Closed-loop response to a step change in feed temperature using MGS: (a) -5 K step change; (b) +5 K step change.

kc led to further reduction of the inlet stream temperature until the process reached the quenched steady state. The same figure demonstrates the ability of the MGS scheme to substantially improve the closed-loop performance. In fact, the resulting performance is almost identical to that obtained using the correct sign and magnitude for the controller gain, that is, kc ) 800, which is shown by the dashed line in Figure 9a. Implementation of the MGS is based on setting the overall loop gain, kc0kp0, to 1. In addition, the process gain, kp, is identified on-line from a correlation obtained by fitting the steady-state gain curve, which is shown in Figure 8b, to a polynomial in the feed temperature of order 6. The lower portion of Figure 9a demonstrates how the controller gain moves from a negative to a positive value to compensate for the load change. Similarly, the solid line in Figure 9b shows the feedback response to a positive disturbance for a PI controller with a fixed positive gain. With the wrong sign for the controller gain, the feed temperature kept increasing until the reaction reached the burnout condition. Improved response is obtained by applying the MGS scheme (Figure 9b, dashed line). However, a somewhat poor performance is observed. The predicted process gain at the peak is a small positive number, and because the disturbance is assumed unmeasured, the gain correlation kept predicting positive gain. This in turn produced positive control actions until the feed temperature became large enough for the gain correlation to predict negative values. This behavior explains the abrupt fluctuation in the controller gain and consequently the sharp drop in the product concentration. This result is indicative of the adverse influence of modeling errors on the performance of the MGS, which lacks feedback to compensate for such problems. The STC algorithm is also tested for the same disturbance rejection problem. For this simulation, the initial covariance matrix is set to identity, the initial model parameter vector is set to zero, and the desired closed-loop poles are placed on the origin. Open-loop simulation is carried out prior to the closed-loop response to ensure the convergence of the model parameters to optimal values. Successful implementation is

1990

Ind. Eng. Chem. Res., Vol. 39, No. 6, 2000

Figure 10. Closed-loop response to a step change in feed temperature using STC: (a) -5 K step change; (b) +5 K step change.

Figure 11. Closed-loop response to a -5 K step change in feed temperature using ATN.

observed for the case of a -5 K step change, as illustrated in Figure 10a. However, the performance deteriorates for the case of a +5 K step change, as indicated in Figure 10b (dashed line). In this case, the estimator predicts positive process gain and consequently positive controller gain. Even when the process crosses the zero gain toward the right side of the peak, the estimator cannot adapt itself to this variation because it lost alertness. The latter is a fundamental problem associated with the RLS method. Resetting the covariance to identity during simulation amends this shortcoming. As a result, the estimator was able to update the model parameters and, thus, predict the correct sign for the gain. However, a vigorous closedloop response was obtained which is not shown in the figure for brevity. A smoother transient response was obtained when a nonzero filter, that is, v ) 0.08 (Figure 10b), is used. However, a sluggish response is obtained as indicated by the prolonged simulation time used. Last, the ATN methodology is examined for the above regulatory problem. In all simulations that follow, Pw ) 10, kc(0) ) [7, -800], τI(0) ) [1.6, 1.6], kuc ) [10, 10 000], klc ) [1, -10 000], τuI ) [4, 4], and τlI ) [0.5, 0.5] are used. It should be noted that although the automatic tuner is applied to the 2 × 2 control system, the performance specifications for the first loop were set very loose to avoid adaptation in that direction. The performance specifications for the second loop are designed to limit the overshoot to 2% in the first interval of 5 min, 0.5% in the second interval, and 0.2% in the last interval. A threshold of 0.2% is employed. Figure 11 demonstrates the effectiveness of the ATN algorithm for rejecting a -5 K step change in the feed temperature using kc(0) ) [7, -800]. Although starting

Figure 12. Closed-loop response to a +5 K step change in feed temperature using ATN.

with a wrong sign for the controller gain, the proposed algorithm managed to bring the value of kc to the proper sign, thereby stabilizing the reactor. Apparently, the resulting response is not as good as that obtained using a fixed kc at 800 which is shown by the dashed line in Figure 11. However, the adapted response is well contained inside the desired specifications and outperforms that obtained for a fixed kc at -800, shown in Figure 9a. The performance envelope shown is the scaled one with its initial portion as the threshold value. The latter spanned 5 min because the algorithm was not triggered until the 10th sampling point when the closed-loop prediction started violating the preset threshold. Similarly, Figure 12 depicts the effectiveness of the proposed algorithm to reject a positive disturbance with kc(0) ) [7, 800]. In the same manner as before, the ATN managed to control the process, although it started with a wrong sign for kc. The superiority of the ATN scheme over the MGS and STC processes for this specific case is not surprising. The ability of the ATN to predict well the process dynamics is due to the direct utilization of a nonlinear model in the algorithm. In addition, uncertainties due to parametric errors as well as unmeasured disturbances are accounted for through adding estimates of the modeling error to the model closed-loop predictions.1 On the other hand, MGS is comparable to feed-forward compensation and, therefore, has no feedback to compensate for uncertainties and/or unmeasured disturbances.27 Moreover, although the STC is equipped with feedback criteria, it may fail in predicting time-varying parameters because of the loss of alertness (sensitivity to new data). This phenomenon known as “falling asleep” occurs when the covariance matrix diminishes with time. These comments on the MGS and STC are explanations of their inferiority to the ATN process in this specific case. To further demonstrate the robustness of the proposed tuning algorithm, the previous control problem is repeated in the presence of modeling errors. Specifically, the activation energies of the forward and backward reactions for the model are assumed to be 10% higher than the nominal value. In this case, the equilibrium curve for the model is shifted to the right; that is, the peak occurs at a higher temperature than that for the nominal plant. Surprisingly, the resulting performance, which is shown by the dashed line in Figure 12, outweighs that obtained with no modeling error. In fact, the presence of modeling error affected the closed-loop prediction in a way that led to earlier activation of the adaptation algorithm. Consequently, the performance

Ind. Eng. Chem. Res., Vol. 39, No. 6, 2000 1991

envelope in this case is different than that shown in the figure. The swift and advanced adaptation of kc provided quick output recovery to its desired value and minor downshoot. Conclusions Because most chemical process systems are nonlinear in nature, adaptive (gain scheduled) PI control algorithms are more adequate for such cases. This paper tests and compares a proposed automatic PI tuner (ATN) with other standard gain scheduled controllers. The ATN exploits developed expressions for the sensitivity of the closed-loop response to the PI settings to achieve the desired performance specifications. The desired specifications are defined in time-domain constraints (envelope) which act as the main driving force for on-line adaptation. The investigation revealed that the presented adaptive PI algorithms and, in particular, the proposed one can compensate for nonlinearity more efficiently than the fixed-parameter PI algorithm can with less computational effort than what the complex nonlinear control systems require. Nonlinear PI (NLPI), fuzzy gain scheduling (FGS), and internal model control (IMC) can be applied successfully to processes with a varying gain but not for processes which exhibit changing gain sign character. IMC provides rigorous design procedures that guarantee robust stability and performance which other methods lack. However, it may result in a conservative control law. FGS requires a priori knowledge of good minimum and maximum values for the controller gain, kc. MGS demands preprogramming or on-line identification of the process gain (kp) or other auxiliary variable. It may cause serious problems if a large degree of uncertainty is associated with the prediction of kp. The self-tuning controller (STC), on the other hand, generally requires extensive computations for parameter estimation. Optimal convergence of the estimator is also necessary; otherwise, poor performance may occur. Notably, the proposed ATN performs as well as the other schemes and is sometimes superior. The main advantage of the proposed scheme is that adaptation is based on future predicted trajectories of the error signal and not on its instantaneous value. This criterion makes it more suitable for non-minimum-phase processes. In addition, it uses a time-domain expression for the desired performance. This feature does not only provide a visual measure of the performance goodness but also allows the user to on-line adjust the required performance to achieve certain tradeoff. However, the method requires a given model for the process from which the closed-loop sensitivity should be derived. However, an extension of the proposed algorithm to different types of models is possible. The procedure only requires a means to compute the sensitivity of the closed-loop response to the tuning parameters. The method also, as it stands, lacks robust stability conditions which is an interesting issue to be addressed in future work. In the absence of such, a safe upper and lower bounds on the PI tuning parameters can be employed. Nomenclature A ) output polynomial in the z domain A1 ) reactant A for the irreversible reaction A1 + B1 f C1 + D1 Am ) desired closed-loop polynomial

As ) surface area of the CSTR, m2 ai ) coefficient i for polynomial A aui , ali ) upper and lower values for ai ami ) coefficient i for polynomial Am B ) input polynomial in the z domain B1 ) reactant B for the irreversible reaction A1 + B1 f C1 + D1 bi ) coefficient i for polynomial B bui , bli ) upper and lower values for bi C ) constant matrix C1 ) product C for the irreversible reaction A1 + B1 f C1 + D1 Ci ) concentration of component i, mol/L CA, CC ) concentration of component A and C, respectively, mol/L CAf, CCf ) concentration of component A and C at feed conditions, respectively Cpi ) heat capacity for component i, J/(mol °C) CpA ) heat capacity for component A and B, respectively, J/(mol °C) D ) reactor diameter in example 1, m D1 ) product D for the irreversible reaction A1 + B1 f C1 + D1 E ) activation energy, mol/J e ) error signal Fi ) feed flow for stream i, L/min f ) IMC filter G ) polynomial in the z domain h ) sampling time, min (s) hair ) heat-transfer coefficient for the air, J/(m2 °C min) k ) sampling instant kr ) reaction rate constant, 1/(mol min) k0 ) pre-exponential factor kc ) controller gain kc0, kuc , klc ) reference, upper, and lower values of the controller gain kp, kp0) process static gain and its reference value, respectively Kc ) diagonal matrix of controller gains KI ) diagonal matrix of reciprocal reset time m ) sampling instant at which maximum violation occurs M ) bound violation measure ny, nx ) number of controlled and state variables, respectively ns ) size of performance envelope window nd ) time delay P ) covariance matrix Pw ) prediction horizon p ) plant-transfer function p˜ ) model-transfer function q ) design parameter Q ) zero-order polynomial in z domain Qr ) heat losses to surrounding area, kJ/mol R ) ideal gas constant S ) polynomial in z domain Sd, Sdu, Sdl ) scaling factor for specifications envelope and upper and lower bounds for Sd s ) Laplace operator si ) ith coefficient for polynomial S T, Tf, Tamb ) reactor, feed, and ambient temperatures, respectively, K (°C) t ) time, min u ) vector of manipulated variables (inputs) ui ) manipulated variable i V, Vr ) liquid holdup and reactor volume, respectively, L v ) STC controller filter parameter x ) vector of state variables xi ) ith state variable xe ) vector of augmented state variables y ) vector of measured outputs

1992

Ind. Eng. Chem. Res., Vol. 39, No. 6, 2000

yi ) ith measured output yr ) vector of set points yu, yl ) upper and lower bounds on y ybd ) vector of performance specifications w, wu, wl ) vector of PI tuning parameters space and upper and lower bounds on w z ) backward shift operator Greek Letters β ) design parameter ) 10-5 λ ) IMC filter parameter κ ) adjustable parameter for NLPI and FGS schemes  ) sensitivity function O ) regressor vector θ ) vector of model parameters δ ) adjustable parameter for the IMC robust performance condition µ ) relaxation factor ζ ) damping factor ω ) frequency ψ ) scaling matrix ∆H ) heat of reaction, kJ/mol ∆u ) vector of change in manipulated variable ∆y ) bound violation magnitude ∆w ) change in PI settings space τD, τΙ ) PID derivative and integral time, respectively τlΙ, τuΙ ) lower and upper values for PID integral time τ ) time constant ∇wy ) gradient of the measured output with respect to PI settings space lm, hl m ) multiplicative uncertainty and its upper bound, respectively

Literature Cited (1) Ali, E. On-line Tuning Strategy for PI Control Algorithms. J. King Saud Univ. Eng. Sci. 1999, 11 (1), 49-70. (2) Ali, E.; Abasaeed A.; Al-zahrani, S. Improved Regulatory Control of Gas-Phase Ethylene Polymerization Reactors. Ind. Eng. Chem. Res. 1999, 38 (6), 2383-2390. (3) Astrom, K.; Wittenmark, B. Computer Controlled Systems; Prentice-Hall: Englewood Cliffs, NJ, 1990. (4) Doyle, F.; Kwatra, H.; Schwaber, J. Dynamic Gain Scheduled Process Control. Chem. Eng. Sci. 1998, 53, 2675-2690. (5) Zhou, W. Lee, P.; Sullivan, G.; Brown, M. An Adaptive Strategy for Constrained Generic Model Control. Chem. Eng. Commun. 1990, 97, 109-134. (6) Ling, C.; Edgar, T. Real-Time Control of a Water-Gas Shift Reactor by a Model-Based Fuzzy Gain Scheduled Technique. J Process. Control 1997, 7 (4), 239-253.

(7) Ogunnaik, B.; Ray, W. Process Dynamics, Modeling and Control; Oxford University Press: Oxford, 1994. (8) Shunta, J.; Fehervari, W. Nonlinear Control of Liquid Level. InTech 1976, 43-48. (9) Morari, M.; Zafiriou, E. Robust Process Control; PrenticeHall: Englewood Cliffs, NJ, 1989. (10) Cameron, F.; Seborg, D. A Self -Tuning Controllers with a PID Structure. Int. J. Control 1983, 38, 67-78. (11) Shinsky, F. G. Process Control Systems; McGraw-Hill: New York, 1988. (12) Luyben, W. Process Modeling, Simulation and Control for Chemical Engineers; McGraw-Hill: New York, 1990 (13) Seborg, D.; Edgar, T.; Mellichamp, D. Process Dynamics and Control; Wiley and Sons: New York, 1989. (14) Astrom, K.; Wittenmark, B. Adaptive Control; AddisonWesley: New York, 1989. (15) Ha, Q. P. Proportional-Integral Controllers with Fuzzy Tuning. Electron. Lett. 1996, 32 (11), 1043-1044. (16) Rotstein, G. E.; Lewin, D. R. Control of an Unstable Batch Chemical Reactor. Comput. Chem. Eng. 1992, 18 (1), 27-49. (17) Goodwin, G.; Sin, K. Adaptive Filtering, Prediction and Control; Prentice-Hall: Englewood Cliffs, NJ, 1984. (18) Shah, S.; Cluett, W. Recursive Least Squares Based Estimation Schemes for Self-Tuning Control. Can. J. Chem. Eng. 1991, 69 (2), 89-96. (19) Abu-Khalaf, A. M. Mathematical Modeling of an Experimental Reaction System. Chem. Eng. Ed. 1994, 28 (1), 48. (20) Abu-Khalaf, A. M. Start-Up of a Non-Isothermal CSTR: Mathematical Modeling. Chem. Eng. Ed. 1997, 31 (4), 250. (21) Abu Khalaf, A. M.; Ali, E. Automatic Start-up of a NonIsothermal CSTR. Chem. Eng. Ed., in press. (22) Ziegler, J. G.; Nichols, N. B. Optimum Setting for Automatic Controllers. Trans. ASME 1942, 64, 759-768. (23) Economu, C. G.; Morari, M.; Palsson, B. O. Internal Model Control. 5. Extension to Nonlinear Systems. Ind. Eng. Chem. Process Des. Dev. 1986, 25, 403-411. (24) Li, W. C.; Biegler, L. T.; Economu, C. G.; Morari, M. A Constrained Pseudo-Newton Control Strategy for Nonlinear Systems. Comput. Chem. Eng. 1990, 14, 451-468. (25) Chong, W.; Biegler, L. T. Process Control Strategies for Constrained Nonlinear Systems. Ind. Eng. Chem. Res. 1988, 27, 1421-1433. (26) Gattu, G. Model Predictive Control and Optimal Operation of Continuous and Batch Processes. Ph.D. Dissertation, University of Maryland, College Park, MD, 1994. (27) Stephanopoulos, G. Chemical Process Control; PrenticeHall: Englewood Cliffs, NJ, 1984.

Received for review July 15, 1999 Revised manuscript received December 21, 1999 Accepted January 11, 2000 IE990517N