Application of a Model Reference Adaptive Control System to pH

Nov 7, 1996 - A model reference adaptive control system was used for the pH neutralization of acidic wastewater containing acetic and propionic acids ...
0 downloads 0 Views 338KB Size
4100

Ind. Eng. Chem. Res. 1996, 35, 4100-4110

Application of a Model Reference Adaptive Control System to pH Control. Effects of Lag and Delay Time Marı´a C. Palancar,* Jose´ M. Arago´ n, Joaquı´n A. Migue´ ns, and Jose´ S. Torrecilla Department of Chemical Engineering, Faculty of Chemistry, Universidad Complutense de Madrid, 28040 Madrid, Spain

A model reference adaptive control system was used for the pH neutralization of acidic wastewater containing acetic and propionic acids with sodium hydroxide. Buffering changes were made by including sulfuric and common-ion salts. The experimental setup consists of a continuously stirred tank reactor implemented with a pH electrode, control valve, and on-line computer. A numerical simulation was made to study the influence of the model parameters and the effects of factors such as lag, delay time, valve dead band, dead zones, short cuts, and presence of dissolved CO2. The tuning methodology and the effects of lag and delay were validated experimentally. For short delays ( 0.0001). Nevertheless, the upper limit of βA decreases with the time constant of the lag. For example, in the system without lag, the maximum recommended value of βA would be about 0.08, Figure 2b. However, for a lag of 2.2 s, it would be reduced to 0.007, and for a lag of 5 s, to 0.003. The results in Figure 4 illustrate these facts and the improvement of control reached by tuning adequately the parameter βA. The runs were made assuming the same buffering changes (B1, B2, etc.) as in the run which is shown in Figure 3f. When the model parameters are set at the values found for the system without lag, the efficiency of the controller, measured on the basis of the ITSE and OS, decreases with the time constant, as can be seen by comparing Figure 4a and b. However, the controller performance is improved by reducing βA to 0.0015, Figure 4c. In conclusion, for lags with time constant smaller than 2.2 s, the values of the parameters are the same as in the system without lag, and for time constants greater than 5 s, the parameter βA should be tuned again. (c) System with Delay Time. The simulations were made by assuming the pH transmitted to the computer has a delay time. Several criteria are given in the literature about selecting H and R for systems with delay time (Seborg et al., 1986). Approximate values of H and R for a system with delay time can be calculated by

H ) H* + L/∆t

(10)

R g L/∆t + 1

(11)

where H* is the order of the system without delay, and L is the actual delay time. To apply eqs 10 and 11, it is necessary to know or estimate the value of L and its possible range of variation, but it is sometimes difficult to do. Besides, the strict application of eq 10 can give unrealistic values of H which would affect the computing time and the effectiveness and stability of the control action. For example, the delay time in the actual system used in this work can reach values between 2 and 40 s. Consequently, as the sampling time is 2 s, the value of H, from eq 10, could take values between 2 and 21. Several simulations for different delay times were made. The same types of perturbation were assumed as in the system without lag or delay. The range of delay studied is 2-40 s. When the model parameters were set at the values found for the system without lag or delay, the efficiency of the controller (measured on the basis of the ITSE and OS) decreased with the delay time. The most significant effects were found in the case of buffering changes. We repeated the study of the

4106 Ind. Eng. Chem. Res., Vol. 35, No. 11, 1996

Figure 5. Simulation of the system with delay time and the buffering changes described in Table 1. Constant model parameters, H ) F ) 1 and βA/βB ) 50. (a) Delay, 6 s; R ) 1; βA ) 0.025; (b) delay, 6 s; R ) 4; βA ) 0.0004; (c) delay, 10 s; R ) 6; βA ) 0.0003.

relative importance of each model parameter, finding that F and βA/βB can be set at the same values (F ) 1, βA/βB ) 50) as those selected for the system without lag or delay. On the other hand, we found several sets of values for the parameters R, H, and βA that provide similar values of the ITSE and OS. For example, assuming a delay of 6 s, the ITSE is around 6 × 106 for the following sets of parameters: (a) R ) 4, H ) 1, βA ) 0.015; (b) R ) 10, H ) 3, βA ) 0.015; and (c) R ) 5, H ) 2, βA ) 0.0005. To provide a reasonable tuning method, we used the following procedure: (a) selecting R by applying eq 11 in the form R ) L/∆t + 1; (b) to avoid unrealistic values of H, setting this parameter at 1 (in other cases, H should be set at the value H* which was found for the system without delay); and (c) selecting βA by trial and error, taking into account that βA will be lower than that in the system without lag or delay. By way of example, we may consider the results obtained for the system with delay time and buffering changes (B1, B2, etc.). The curves in Figure 5a,b are the responses of the system with a delay of 6 s. The curve in Figure 5a shows how the controller performance is very poor when the model parameters are the

ones used for the system without lag or delay (R ) 1, βA ) 0.025). The curve in Figure 5b shows how the response can be improved by increasing R and reducing βA (R ) 4, βA ) 0.0004). Nevertheless, the controller performance, even with a greater R and a lower βA, deteriorates as the delay time increases; this fact is clearly observed in Figure 5c, where the response curve of the system with a delay time of 10 s is shown (R ) 6, βA ) 0.0003). (d) System with Electrode Lag and Delay Time. The simulations were made under the assumption of simultaneous first-order lag and delay time and following the same tuning method as in the former case, (c). It was found that the βA chosen for the system with only delay can be used in the system with delay and lag. Some representative responses of the system with moderate lag and delay (2.2 and 4 s, respectively) are shown in Figure 6. The model parameters were tuned at H ) F ) 1, R ) 3, βA/βB ) 50, and βA ) 0.0005. The operating conditions and perturbations (B1, B2, etc.) were the same as in the system without lag and delay, whose responses are shown in Figure 3. Except for ramp perturbations, both the ITSE and OS increase in the system with lag and delay time, and the controller can only manage delay times less than 6 s. When the delay time is greater than 10 s, the OS is greater than 4. If one intends to reduce this OS by selecting a very low value of βA, the pH predicted by eq 1, d(k), is always close to 7. Consequently, the actuation on the valve is too weak, and the response can reach pH values under 5.5. From the results obtained, we may consider that the systems with lag time constant less than 5 s and delay time less than 10 s can be described by the same orders of the MRAC chosen for the system with lag and without delay. The controller can be tuned by calculating R by eq 11, and choosing a value of βA lower than the one obtained by the simulation of the same system with lag and without delay. For moderate delay times (10 s). (e) Analysis of Other Factors. The study includes the simulation of different factors which can be industrially relevant: First-Order Lag of the Valve. There were simulated lags with time constants from 2.1 to 4 s. The effects, measured on the basis of the ITSE and OS, are negligible for time constants less than 2.5 s (i.e., the ITSE increases less than 5% with respect to the ITSE in the absence of valve lag). The effects are considerable for time constants equal or greater than 4 s (i.e., the ITSE increases more than 40%). Valve Dead Band. Even with positioners, the best industrial valves have about a 1% repeatability. This can produce reagent imprecision that would cause a pH error. Dead bands from 1% to 10% were simulated. When the dead band is less than 5%, the ITSE increases less than 4%, but for a dead band of 10%, the ITSE increases 20%, and several pH oscillations appear with OS greater than 4 pH units. Dead Volumes and Short Cuts in the Reactor. Industrial mixers are not ideal CSTRs. Dead zones and short cuts characterize their behavior. Dead volumes (from 1% to 20%) and short cuts (from 0.1% to 1%) were simulated. The effects are negligible for dead volumes less than 10%. For a dead volume of 20%, the ITSE increases 13% with respect to that in the ideal tank. The effects of short cuts are important when they are

Ind. Eng. Chem. Res., Vol. 35, No. 11, 1996 4107

Experimental Validation of the Controller

Figure 6. Simulation of the system with lag (time constant, 2.2 s) and delay time (4 s). Constant model parameters, H ) F ) 1, R ) 3, βA/βB ) 50, and βA ) 0.0005. Perturbations of the acidic stream: (a) step of concentration; (b) ramp of concentration; (c) random walks of flow and concentration; (d) buffering changes described in Table 1.

greater than 0.2%. For instance, with a short cut of 1%, the ITSE increases 90%, and the OS reaches values greater than 4. Presence of Dissolved CO2 in the Aqueous Solutions. About 1% of air is CO2, which dissolves in water to form carbonic acid. The effects on the titration curve were simulated assuming dissolved concentrations of carbonic acid from 0.0005 to 0.005 mol/L. Within this range of conditions, the ITSE and OS increase less than 5%.

The experimental study comprises the application of the tuning methodology developed in the simulation and the verification of the controller robustness and adaptive performance. The runs and results are classified into two groups: (a) system without delay time and (b) system with delay time. The random walk changes have not been tested experimentally due to time and material limitations to making this type of perturbation. (a) System without Delay Time. When the electrode is located inside the tank (position 1 in Figure 1), the delay time is practically zero. Most of the model parameters were selected by allowing for the relative influences found by simulation. The types of perturbations used to evaluate the robustness and adaptive performance of the controller were steps, ramps, and buffering changes. In a first series of runs, it was confirmed that several parameters found by simulation of the system without lag or delay, H ) F ) R ) 1 and βA/βB ) 50, are adequate for the real system without delay time. As in the simulated system, the parameter βA has a great influence on the behavior of the real system. The results show that the ITSE and OS of the experimental responses are also minimal over a range of values of βA. The limits of satisfactory values of βA are about the same as those obtained by simulation of the system with a lag time constant of 5 s. By way of example, the experimental responses to three types of perturbations are shown in Figure 7. The alkaline stream concentration was CoNaOH ) 0.15 mol/ L, and the controller was tuned at H ) F ) R ) 1, βA/ βB ) 50, and βA ) 0.0005. The OS is smaller than (0.65 pH unit for steps and ramps of the acid concentration, but it can reach greater values, (1.7, for buffering changes. All the responses are underdamped, with a settling time of 1-2 min. At steady state, there are remainder oscillations of (0.1 pH unit around the setpoint. In most runs, the experimental pH oscillations and OS are slightly greater than those obtained by simulation. However, there are noticeable differences between the ITSEs of simulated and experimental results. For example, comparing the responses to changing buffering, Figures 4c and 7c, the ITSEs of the simulated and experimental runs are respectively 1.66 × 105 and 2.74 × 105. (b) System with Delay Time. The delay time can be due to flow problems (poor mixing) and bad location of the electrode. To study the effects of delay on the controller performance, we induced a delay by inserting the pH electrode in the tubular device connected to the exit of the tank (position 2 in Figure 1). The time delay depends on the internal free volume of the device, about 0.042 L, and the total flow rate of the liquids. The methodology and type of perturbations were the same as those used in the study of the real system without delay time. As we can see from the simulations of the system with delay time, the controller parameters with most influence are βA and R; therefore, they were explored in depth. From a first series of runs, it was verified that the rest of the model parameters could be maintained at the same values found for the real system without delay time, H ) F ) 1 and βA/βB ) 50. The results show that the influence of βA on the ITSE and OS is of the same type as in the simulated system. Nevertheless, the maximum allowable βA is smaller than the value found by simulation of the system with a lag time constant of 5 s. The experimental value of R is different

4108 Ind. Eng. Chem. Res., Vol. 35, No. 11, 1996

Figure 7. Experimental responses of the system without delay time. Constant model parameters, H ) F ) R ) 1, βA/βB ) 50, and βA ) 0.0005. Perturbations of the acidic stream: (a) step of concentration; (b) ramp of concentration; (c) buffering changes described in Table 1.

Figure 8. Experimental responses of the system with delay time. Constant model parameters, H ) F ) 1, R ) 10, βA/βB ) 50, and βA ) 0.0005. Perturbations of the acidic stream: (a) step of concentration; (b) ramp of concentration; (c) buffering changes described in Table 1.

from that expected from the simulation, probably due to the fact that the actual flow of alkaline stream is time variant. For example, to neutralize an acidic stream of CAo ) 0.15 mol/L and QA ) 3.2 × 10-3 L/s, we may suppose two alternatives: (a) using an alkaline stream of CoNaOH ) 0.15 mol/L and (b) using an alkaline stream of CoNaOH ) 0.4 mol/L. In both cases, the residence time (L) of the circulating liquid in the device would be approximately between 13 (when the control valve was fully closed) and 5 s (when the control valve was fully open). If the criterion R ) L/∆t + 1 is applied, the values of R would be between 4 and 8. However, we found experimentally that, for CoNaOH ) 0.15 mol/L, the best value of R (minimum ITSE and OS) was 10, and for CoNaOH ) 0.4 mol/L, it was 12. The observed increasing of R with CoNaOH agrees with the fact that the flow of the alkaline solution required to neutralize a given acidic stream decreases with CoNaOH; consequently, the delay time increases with CoNaOH. Nevertheless, the value of R was, in both cases, out of the expected range, between 4 and 8. It was also greater than the value calculated assuming an average total flow in steady state (to reach a setpoint of 7). For the examples dealt with above, the delay time corresponding to this average flow is 6 s for CoNaOH ) 0.15 mol/L and

10 s for CoNaOH ) 0.4 mol/L. Then, the values of R calculated from those criteria would range between 3 and 5. Some representative examples of experimental responses of the real system with delay time are shown in Figure 8. The alkaline stream concentration was CoNaOH ) 0.15 mol/L, and the controller was tuned at R ) 10 and βA ) 0.0005. The ITSE and OS are greater than expected from simulation, Figure 6, and greater than observed in the real system without delay time, Figure 7. The responses in other runs, carried out with an alkaline stream of CoNaOH ) 0.4 mol/L, were almost the same for steps and ramps of acid concentration. Nevertheless, the responses to buffering changing (B1, B2, etc.) suffered significative increase of the ITSE and OS, probably due to the fact that the delay time was equal or greater than 10 s. This is the longest delay that the controller can manage, as was found in the simulation. Conclusions The applicability of a MRAC for pH control has been discussed and illustrated with numerical simulations and experiments involving different types of perturba-

Ind. Eng. Chem. Res., Vol. 35, No. 11, 1996 4109

tions. The algorithms have a very simple structure and could be implemented in most types of microcomputers. The controller requires simulation and/or experimentation for tuning its five parameters, H, F, R, βA/βB, and βA. A sensitivity analysis has been made by numerical simulation to find which parameters are most relevant. In the system with/without electrode first-order lag and without delay time, the parameter R can be set at 1, but both the ratio βA/βB and the parameter βA have great effects on the ITSE and OS; consequently, they require precise tuning. On the other hand, both the orders H and F have minor effects on the controller performance. In the system with delay time, the parameter R has an importance equal to or greater than βA/βB and βA. From the results of the simulation, a reasonable method is given for tuning easily H, F, and βA/βB in the system with/without lag and with constant and known delay. If the delay is time variant and/or unknown, the only way of selecting R is by trial and error. In this case, a first attempt of R can be made by using eq 11, with a value of L corresponding to the steady state at the setpoint conditions. The parameter βA is the only model parameter that always requires tuning by trial and error. This tuning is easy since the criteria of minimal ITSE and OS are reached with a wide range of values of βA. The MRAC and the tuning methods proposed have been tested experimentally. The main limitations are due to the delay time. The controller performance has been illustrated for systems with short/moderate delay time (