Adaptive Dynamic Matrix Control of pH - American Chemical Society

online method has been developed for identification of a process in terms of pseudo impulse response coefficients. Using this scheme a first-order wit...
1 downloads 0 Views 629KB Size
I n d . Eng. Chem. Res. 1994,33,641-646

641

Adaptive Dynamic Matrix Control of pH Sachi N. Maiti, Navneet Kapoor? and Deoki N. Saraf' Department of Chemical Engineering, Indian Institute of Technology, Kanpur 208 016, India

Dynamic matrix control (DMC) was used to neutralize a continuous process stream in a stirred tank. In the presence of large disturbances, the controller performance deteriorated because of processmodel mismatch. An adaptive DMC was successful in overcoming this difficulty. A closed-loop online method has been developed for identification of a process in terms of pseudo impulse response coefficients. Using this scheme a first-order with delay time model was fitted to the process. This model was subsequentlyused to update the dynamic matrix thus making the DMC algorithm adaptive.

Introduction The control of pH is a commonly encountered problem in the process industry. Neutralization may be an integral part of many processes found in, for example, waste water treatment, the soap industry, ore flotation, and biotechnological processing, as well as other pH sensitive processes. Of the many applications of pH control, neutralization in waste water treatment is by far the most important task. Also it is usually the most difficult one because of the "S-shaped" titration curve with the steepest slope at the neutralization point which makes it a highly nonlinear process. It is well established that a proportional-integralderivative (PID) type controller is often unsatisfactory due to its poor performance. Several monographs (Shinskey, 1973; Moore, 1978; McMillan, 1985) have discussed the difficulties encountered in pH control. McAvoy et al. (1972) modeled the pH process in terms of a single acidsingle base and developed model equations by considering material balances and chemical equilibria. Gustafsson and Waller (1983) generalized it to include mass balances for all the species present. They partitioned the state vector into a reaction variant and a reaction invariant part. For fast acid-base reactions, the invariant part of the model was found to be sufficient for controller design. Gustafsson (1985) applied their dynamic model experimentally by lineralization. Williams et al. (1990) developed a twoparameter model by considering the waste water as a single fictitious acid of unknown concentration and unknown Gibb's free energy of dissociation. They used the generic model control (GMC) strategy of Lee and Sullivan (1988) in their studies. Lee et al. (1993) parametrized the pH processes with three parameters and identified these with the relay feedback testing as used in online tuning of PID controllers (Seborg et al., 1989). Wright and Kravaris (1991)used the concept of McAvoy et al.(1972)and defined a term called the strong acid equivalent of the process. They parametrized the controller in terms of this quantity which could be estimated online. Their model was linear in terms of the strong acid equivalent and they used a PI control law for their simulation studies. Wright et al. (1991) obtained better performance from this method in comparison with conventional PI control while experimenting in a laboratory scale setup. Kulkarni et al. (1991) used the internal model control (IMC) of Garcia and Morari (1982) in their simulation studies. Because of the use of an unsteady-state model for the strong acid-strong base

* Author to whom correspondence should be addressed. E-mail: [email protected]. + Presently a graduate student at University of Minnesota, Minneapolis, MN.

neutralization process, they required a fast integration algorithm and, from a practical point, a high-speed computer. The information about the composition of a process stream may not always be available in terms of acidic (basic) species or it being a strong acid-strong base system or a strong acid (base)-weak base (acid) buffered system. So the methods which require this information may not work well in every situation. Similarly, an algorithm which is based on a particular titration curve would fail in other cases. Buchholt and Kummel(l979) experimentally demonstrated the performance of a self-tuning controller. The algorithm performed well because of its adaptive nature. Mahuli et al. (1993) used a statistical cumulative sum technique for continuous online model adaptation. The scheme utilized a filter to remove the noise and eliminate incorrect model changes. In a recent review, Gustafsson and Waller (1992) discussed the relative merits of linear and nonlinear control of pH. They used a self-tuning adaptation schemeto accommodate both time-varyinggain and flow parameters. However, a large number of parameters in the model made their estimator ill-conditioned. Dynamic matrix control (DMC) developed by Cutler and Ramaker (1980) is one of the most successful algorithms with the process industry. However, its usage for the control of pH has not been mentioned in open literature. This may be so because the conventional DMC is a nonadaptive algorithm whereas for pH control, an adaptive scheme has been shown to be superior (Buchholt and Kummel, 1979; Gustafsson and Waller, 1992). If DMC is made adaptive, it can be expected to perform well even in the presence of time-varying process gain and process nonlinearity as encountered in pH control. The dynamic matrix control algorithm uses a large number of response coefficients which must be evaluated from an open-loop step test. Recursive identification of these coefficients is impractical as it involves the solution of a large number of equations in each sampling interval. Freedman and Bhatia (1985) proposed a scheme for adaptive dynamic matrix control with online evaluation of the model coefficients. However, they were able to test it for an extremely small system with only 3 coefficients in the dynamic matrix which required updating. A cycle time of 0.1 min may be adequate for such simple problems but more realistic systems are likely to have 50 or more coefficients making it difficult to determine that many coefficients in a reasonable time. Moreover, in a continuous operation, it may not always be feasible to run a process without a controller particularly if the system changes frequently. It is, therefore, desirable to develop a method to obtain the step response coefficients under closed-loop conditions.

Qsas-5885/94/2633-Q641$04.5QfQ 0 1994 American Chemical Society

642 Ind. Eng. Chem. Res., Vol. 33, No. 3, 1994

The present work is an experimental study of the pH control of a process stream using the dynamic matrix control algorithm. The algorithm is made adaptive by a new online closed-loop identification scheme. Experiments have been carried out for a strong acid-strong base system though the method can be used for other acidbase systems also.

Closed-Loop Identification Method In this section a method is presented to identify the open-loop transfer function by deconvolution based on the measurement of the output in the closed loop. The method relies on a simple experimental test, for example, a step change in the controller set point or a change in the disturbance level. The DMC controller reacts to a negative step change in a disturbance added to the process output in the same way it would react to an equivalent positive set-point change in that output and vice versa. So, from a theoretical point of view it does not matter whether the change is given in the set point or to the disturbance. In DMC, the output of a single-input, single-output (SISO)system can be computed from its impulse response coefficients as follows:

I

o

/

i

2

3

4

,

5

6

7

a

Sornpling i n s o n t

Figure 1. Typical step response curve.

In eq 9, hjare called "pseudo impulse response" coefficients and at ith sampling instant these are calculated as:

N i-1

The step response coefficients{ai)are related to the impulse response coefficients {hi)by the expression

hi

ai - aiWl

(2)

The sequence {ai)is used to construct a dynamic matrix of the system. From eq 1at the k + l t h sampling instant we have N

(3)

Assuming future disturbances remain at the current level, one gets from eqs 1 and 3, N

(4)

Suppose that the system is at steady state at kth sampling instant andit is excited at that moment by giving a step change of arbitrary magnitude in the set point or to the load. The DMC controller will calculate the manipulated variables at successive sampling instants to bring the process to the new steady state or to nullify the load change. Let Auk, Auk+l, -., be the changes in the manipulated variable at the kth, k + lth, sampling instants. Figure 1shows a typical process response to a unit step change in the manipulated variable. From Figure 1 it is obvious that ..e,

AYk+l

= hIAuk

(5)

&k+2

= hlAUk+l+ h2AUk

(6)

AYk+3

= hlAUk+2 + hzAUk+1 + h3Auk

(7)

AYk+i = hlAUk+i-l

+ h2AUk+i-2 + ... + h i h k

In compact form eqs 5-8 can be expressed as

(8)

hi =

j=l

;

i = 1, ...,N

(10)

auk

Only the input and output data at different sampling instants are needed in eq 10. It may be noted that eq 10 gives the delay-free pseudocoefficients but most of the real processes have delay times. If Tde is the delay time in the number of sampling instants, then the first Tds number of coefficients would be zero since that many output changes are zero. To update the full dynamic matrix (PU), one would need to obtain N pseudo impulse response coefficients requiring that many measurements. However, that may require a long time during which the updated model is not available. To cut down on this time, in the present method, only some pseudo impulse response coefficients are calculated online, the corresponding step response coefficients are obtained from eq 2, and then a parametric model is fitted to these data using a least-square algorithm. The usage of such a model allows extrapolation of the remaining step response coefficients. If one actually measures the output, say for the time required for 50% of the final response, the remaining 50% of the response is predicted using the fitted model which can subsequently be used to generate the updated dynamic matrix. The time interval during which step response is actually measured is referred to as identification horizon (IH). A first-order plus delay time (FOPDT) model was used to represent the process for the purpose of extrapolation. The Gauss-Newton method with the Levenberg-Marquardt (Cuthbert, 1987) modification was used for minimizing the objective function given by

where m is the number of data points in the step response, hi is the estimated output from the model, and ai is the corresponding value calculated from the measured output. In the time domain, the model is given by

Ind. Eng. Chem. Res., Vol. 33, No. 3,1994 643

'M

rF[

Alkali

which can be rewritten in a more convenient form as 8, = O1 - O2 exp (-e&,)

Acid

...................

................ ,

0,.

..............

(13)

I

I

where01= K,, 02 = KPexp(Td/7),and03 = 1/7. The problem is thus reduced to finding the parameter vector, 8 (01,02, 031, which minimizes F. It may be mentioned here that while only a first-order with delay time model was considered in the present study, this is by no means a limitation of the proposed identification scheme. Second- or higher-order models can be fitted at the expense of larger computation time. The identification method discussed above is general, and in addition to DMC it can be used for other model predictive controllers which utilize discrete convolution type models, for example, internal model control, model algorithmic control (Richalet et al., 19781, etc.

Experimental Section The experimental setup is schematically shown in Figure 2. It consists of a well-stirred tank of approximately 30-L capacity to which an acidic influent process stream is continuously fed which must be neutralized. The alkali (NaOH) for neutralization comes from an overhead storage tank whose flow is controlled witha stepper motor actuated controlvalve. The liquid in the stirred tank is maintained at a constant level with the help of an independent PI type SISO controller. A glass electrode type pH probe and transmitter (Philips, India) are used for monitoring the pH in the tank. Disturbance in the input process stream pH can be introduced by mixing with it a stream of acid (HC1) with the help of another stepper motor operated valve. The experimental as well as simulation studies were carried out using an IBM compatible PC/XT computer. Any available nominal model parameters can be used as the initial guess for the nonlinear identification algorithm. The model identification program converged in 5-10 iterations. The convergence was achieved when the sum of the squares of the residual function as well as absolute value of relative change in values of 0 in two successive iterations simultaneously became less than 1P. The program took between 30 and 40 s on the PC/XT machine to identify the process and to update the dynamic matrix. A sample time of 20 s was used throughout the study. Results and Discussion Figure 3 shows an experimental step response of the pH process in the range 2-7. The dashed line represents the fitted first-order with delay time type transfer function model. Here the acidic process stream was the laboratory tap water mixed with decinormal HC1. The model parameters were obtained by a nonlinear optimization technique to fit the data in the least-square sense (Kp = -0.068, r = 6.66, and T d = 0.08). The comparison shows that the first-order with delay time model approximates the process reasonably well. The above step response was used as the nominal model for the DMC algorithm. Figure 4 demonstrates the performance of DMC for both servo and regulatory control problems. The influent process stream was initially at pH = 2, and the set point was fixed at pH = 7. A decinormal alkali was used for titration. As seen in the figure, DMC could bring the effluent pH close to 7 reasonably fast and hold it there.

.

..............,

FC

.

,

Process Stream

INDEX Diff. Pres. Tkansm. From Computer pH Meter Stepper Motor To Computer

DPT

+

FC

PM SM TC

Neutralization Tank

1

I

4 Neutralized Stream

Figure 2. Schematic of the neutralization process.

-0010 -0 020

- 0 060

Y

-

-0070

z , I r I 1 8 , ,

,,,

8 , 1 1 1 1 8

l

m

r

m

~

l

l

~1

8

1

~8

1

~8

~,

,

m

,,

~

8 t l , I ~ I I I I c

v

80,

Iaco 40

3.0 2.0

10

J1

8

8

8

,

8

I

8

8

I

I

8

8

8

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

644 Ind. Eng. Chem. Res., Vol. 33, No. 3, 1994 I

90,

I

-0 oc

0

Process K p -0 1026 Tau 808 Td 015

Model -0068 666 0 08

1

-0 25

I i

. * ~ ~ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 a . . . . . . . . . . . . . . . . . .

Process

-024

Model -012

20 10

10

0

20

30

40 50 Time in mins

60

70

80

Figure 5. Comparison of the performance of DMC with that of ADMC (-) in the presence of a process-model mismatch. (e-)

0.050

0

c.

10

Time

ip

15

20

mlns

Figure 7. Comparison of the closed-loopidentified model with the processfor differentidentificationhorizonsin the presenceof output noise.

the signal to noise ratio is greater than 5 , the identification becomes satisfactory. Figure 7 shows the process idenooooo tification results in the presence of a random Gaussian 0 0 0 0 0 lh=20 __ Process noise in output with zero mean and f0.2 amplitude for a ..... Model simulation experiment. A step change in set point of 1.5 was introduced. As seen in the figure, the performance -0 050 ------.._._._._....~._......_.. of the identification technique is satisfactory. That means CL if we use raw data for identification or if the performance 0 of the noise filter deteriorates, the identification algorithm -0.100 still gives satisfactory performance as long as the disturbance or the change in set point is large. It may be mentioned that one needs adaptation of the process model -0 150 only when the system changes appreciably to a different operating point. -0 200 Figure 8a shows the performance of DMC and ADMC 0 5 10 15 20 25 30 35 for small process-model mismatch. First 25 samples were Time in mins used to identify the process afresh. While DMC did not Figure 6. Comparison of the closed-loop identified model with the perform poorly, ADMC showed improvement. Also when process for different identification horizons. an arbitrary step disturbance entered the process at 45 min, ADMC showed improved disturbance rejection a result in simulation. The dashed line represents DMC capability. Figure 8b compares the controller action, Le., performance when the process was taken to have Kp = alkali flow, for the two cases of Figure 8a. Again ADMC -0.1026,~= 8.08, and Td = 0.15 whereas the nominal model needed a smaller change in control action to eliminate the parameters were K, = -0.068, 7 = 6.66, and Td = 0.08 as disturbance. Figure 9 shows results for a similar experidentified earlier. For such a large mismatch, DMC iment as that in Figure 8 except that at 45 min, a much performance is clearly not satisfactory particularly after larger step disturbance was given. As seen in the figure, the large step disturbance was given at 40 min. This calls while ADMC settled down to the set point after small for online adaptation of the control algorithm so that the oscillations, DMC showed much larger oscillations over a model can be updated to match with the process. Figure longer time interval. 6 shows how adaptive DMC (ADMC), with an identifiAlthough ADMC yielded improved performance over cation horizon of 10,15, and 20 sampling instants, reduces DMC in both the experiments shown in Figures 8 and 9, the mismatch. Clearly, if sufficient data points are DMC was not totally unsatisfactory when process-model included in the identification horizon, it is possible for the mismatch was not large. But Figure 10shows a comparison model to approach the process closely. When the process between DMC and ADMC when actual process gain was in Figure 5 was reidentified in this manner, the ADMC approximately 6 times that of the model. DMC showed performed quite well (solid curve). Both set-point tracking an overshoot in set-point tracking, and the process pH and disturbance rejection showed significant improvement started to oscillate when a large step disturbance was given with the use of ADMC as compared to simple DMC as in feed-stream pH at 25 min. The ADMC, however, settled seen in Figure 5. down to the set point much faster. Small oscillations in It may be mentioned here that the closed-loop identiADMC indicated the presence of a little process-model fication technique may not perform well in feedback mismatch still remaining, but that is because the idencontrol systems because of the possibility of a correlation tification horizon in this case was only 7 and obviously a of the noise with the input to the process (Isermann, 1993). model based on only a few measurements cannot be This problem is particularly significant when the signal expected to match the process well. Since a stronger alkali, to noise ratio is small. In a simulation experiment it was 0.2 N, was used in this experiment as compared to 0.1 N found that for a small change in set point, the identified model was not close enough to the actual process if a in the previous experiment (Figure 91, this also resulted in added fluctuations. Although the step disturbance in random Gaussian noise of comparable magnitude was this experiment was larger (process stream normality from superimposed on the output. However, if the set-point 0.01 to 0.079 N) as compared to the previous experiment change is large compared to the noise component, i.e., if i

c

. . . IH=10 1~=15

Ind. Eng. Chem. Res., Vol. 33, No. 3, 1994 645

8.0

20 3

--

I

-

7

r.:

30

4

10

-

--

I

0

10

20

30

40

50

60

70

90

80

100

1 1 ~ 1

21 .o o 0

10

20

30

Time in mins. 200.0

40

50

70

60

80

Time in mins. 1

I

3 1801

180.0

1604

1600

.-c0 'V,1 4 0 0 0

a 1200 0

c

2 1000 i

80.0 Q oi

60.0 40.0

4

20.0

O ' ! < , ,

0

10

20

30

40

50

60

70

80

90

100

Time in mins.

Figure 8. Comparison of the performance of DMC with that of ADMC (-) in the presence of a small disturbance: (a) pH vs time and (b) flow of alkali (stepper motor position) vs time. (-e)

9.0

8 0

,

20

31 00

I

lb

I

I

I

2b

!

I

1

1

3b

I

I

I

I

4b

8

\

1

1

8

$0

\

1

1

6b

1

/

8

8

7b

I

I

1

I

d0

Time in mins

Figure 10. Comparison of the performance of DMC (.-) with that of ADMC (-) in the presence of a large process-model mismatch and a large disturbance: (a) pH vs time and (b)flow of alkali (stepper motor position) vs time.

I

i

quite easily. The identification can be carried out once a day or whenever feed quality changes significantly. Alternatively, it should be possible to build in the algorithm, a logic for automatic identification of the presence of a large disturbance in the process which can turn on the adaptive algorithm. Although, in the present investigation, a first-order with time delay model was fitted to the process, the proposed identification scheme can as easily be used with higher-order models. It is also possible to extend this identification technique to multivariable problems as well as to other model predictive control algorithms such as model algorithmic control, internal model control, etc. ADMC provides an alternative to the existing linear and nonlinear adaptive schemes for control of systems with time-varying process parameters.

z5.0

40

d

i o T i m e in mins

Figure 9. Comparison of the performance of DMC

ADMC

(-)

(e-)

with that of

in the presence of a large disturbance.

(0.01 to 0.034 N),the dip in the tank pH was smaller because of higher concentration of alkali being used for neutralization.

Conclusions Dynamic matrix control can be used for process stream neutralization as long as process-model mismatch is small. For large mismatch, however, DMC is not satisfactory and model updating is required. The ADMC as described here can successfully handle this problem. The method of closed-loop online identification presented here provides a scheme to make DMC adaptive

Nomenclature ai = ith step response coefficient bk = estimated output from the model at sampling time k d k = disturbance at sampling time k hi = ith impulse response coefficient or pseudo impulse response coefficient I = objective function IH = identification horizon Kp = process gain N = truncation horizon of the step response model P = prediction horizon pH = -loglo[hydrogen ion concentration in mol/Ll Td = delay time Tds = delay time in number of sampling instant

646 Ind. Eng. Chem. Res., Vol. 33, No. 3, 1994 tk = k t h sampling instant

U = control horizon

uk = manipulated variable at sampling time k Auk = change in manipulated variable at sampling time k Yk = output of the process at sampling time k yo = output of the process initially Ayk = change in output of t h e process at sampling time k Greek Letters

0 = parameter vector in t h e first-order with delay time model Bi

= parameters in the first-order with delay time model

T

= process time constant

Literature Cited Buchholt, F.; Kummel, M. Self-tuning Control of apH-Neutralization Process. Automatica 1979,15, 665-671. Cuthbert, T. R., Jr. Optimization Using Personal Computers with Application to Electrical Networks; John Wiley & Sons: New York, 1987. Cutler, C. R.; Ramaker, B. L. Dynamic Matrix Control-A Computer Control Algorithm. Proc. J.Am. Control Conf. 1980, paper WP5B. Freedman, R. W.; Bhatia, A. Adaptive Dynamic Matrix Control: Online Evaluation of the DMC Model Coefficients. Proc. Am. Control Conf. 1985, paper WAF-11. Garcia, C. E.; Morari, M. Internal Model Control. LA Unifying Review and Some New Results. Znd. Eng. Chem. Process Des. Dev. 1982,21, 308-323. Gustafsson, T. K. An Experimental Study of a Class of Algorithm for Adaptive pH Control. Chem. Eng. Sci. 1985,40, 827-837. Gustafsson, T. K.; Waller, K. V. Dynamic Modeling and Reaction Invariant Control of pH. Chem. Eng. Sci. 1983,38, 389-398. Gustafsson, T. K.; Waller, K. V. Nonlinear and Adaptive Control of pH. Znd. Eng. Chem. Res. 1992, 31,2681-2693. Isermann, R.; Digital Control Systems; Narosa Publishing House: New Delhi, India, 1993; Vol. 2. Kulkarni, B. D.; Tambe, S. S.; Shukla, N. V.; Deshpande, P. B. Nonlinear pH Control. Chem. Eng. Sci. 1991,6, 995-1003.

Lee, P. L.; Sullivan, G. R. Generic Model Control-GMC. Comput. Chem. Eng. 1988,12, 573-580. Lee, J.; Lee, S.D.; Kwon, Y. S.; Park, S.Relay Feedback Method for Tuning of Nonlinear pH Control Systems. AZChE J. 1993, 39, 1093-1096.

Mahuli, S. K.; Rhinehart, R. R.; Riggs, J. B. pH Control Using a Statistical Technique for Continuous On-Line Model Adaptation. Comput. Chem. Eng. 1993,17,309-317. McAvoy, T. J.; Hsu, E.; Lowenthal, S.Dynamics of pH in Controlled Stirred Tank Reactor. Znd. Eng. Chem. Process Des. Dev. 1972, 11, 68-70.

McMillan, G. K. pH Control; Instrument Society of America: Research Triangle Park, NC, 1985. Moore, R. L. Neutralization of Waste Water by pH Control; Instrument Societyof America: ResearchTrianglePark,NC,1978. Richalet, J.; Rault, A.; Testud, J. L.; Papon, J. Model Predictive Heuristic Control: Application to Industrial Processes. Automatika 1978, 14, 413-428. Seborg, D. E.; Edgar, T. F.; Mellichamp, D. A. Process Dynamics and Control; Wiley: New York, 1989. Shinskey, F. G. pH and pZon Control in Process Waste Streams; Wiley-Interscience: New York, 1973. Williams, G. L.; Rhinehart, R. R.; Riggs, J. B. In-line Process-ModelBased Control of Waste Water pH Using Dual Base Injection. Ind. Eng. Chem. Res. 1990,29, 1254-1259. Wright, R. A.; Kravaris, C. Nonlinear Control of pH process Using the Strong Acid Equivalent. Znd. Eng. Chem. Res. 1991,30,15611572.

Wright, R. A,; Soroush, M.; Kravaris, C. Strong Acid Equivalent Control of pH Processes: An Experimental Study. Znd. Eng. Chem. Res. 1991, 30, 2437-2444. Received for review May 18, 1993 Revised manuscript received November 16, 1993 Accepted December 3, 1993' Abstract published in Advance ACS Abstracts, February 1, 1994.