pH Control Using Advanced ProportionalIntegral Controls with the

using Haalman's tuning rules where the process deadtime and time constant are ... inlet pH and effluent pH as well as deadtime coordination of the pH ...
0 downloads 0 Views 189KB Size
2418

Ind. Eng. Chem. Res. 2000, 39, 2418-2426

pH Control Using Advanced Proportional-Integral Controls with the Dual-Injection In-Line Process Scott E. Hurowitz,† Andrei Bobkov, and James B. Riggs* Department of Chemical Engineering, Texas Tech University, Lubbock, Texas 79409

This paper presents both simulation and experimental results for the application of a dualreagent-injection in-line pH controller for wastewater neutralization. The dual-reagent-injection in-line configuration enables the gain estimation of the first-order plus deadtime (FOPDT) model of the process. A proportional-integral (PI) controller is then tuned based on the FOPDT model using Haalman’s tuning rules where the process deadtime and time constant are estimated as a function of process flow rates. Controlling the intermediate pH to the average between the inlet pH and effluent pH as well as deadtime coordination of the pH readings greatly enhances the fidelity of the gain of the FOPDT model and the resulting controller performance. The proposed PI-based controller is compared with a fuzzy logic controller, the best control strategy previously developed for this in-line process, and with a conventional PI controller applied to a single-injection process using extreme changes in the influent wastewater character. Introduction pH control is industrially important for a wide range of applications ranging from wastewater neutralization to controlling the product characteristics for the pulp and paper industry to maintaining quality and production rates for biological reactors. pH control can be an extremely difficult control problem because of one or more of the following issues: (1) severe nonlinearity, (2) limited reagent metering precision, and (3) very large unmeasured disturbances. Titration curves are useful in understanding the nonlinearity associated with pH control. Figure 1a shows a titration curve for the titration of a strong acid with a strong base without buffering present. Note that the slope of this titration curve at pH ) 7 is 105 times larger than the slope at pH ) 2. Similar titration curves result when neutralizing wastewater from the regeneration of an ion-exchange bed because this wastewater is almost exclusively sulfuric acid (H2SO4), sodium hydroxide (NaOH), and deionized water. Note that because pH is the negative logarithm of the hydrogen ion activity, a unit change in pH from 2 to 3 represents a change in hydrogen ion concentration that is 105 times larger than the change in hydrogen ion concentration caused by a pH shift from 6 to 7. Therefore, the use of solution pH for systems without buffering results in the observed nonlinearity in pH solution chemistry (i.e., Figure 1a). Figure 1b shows a titration curve for the case in which strong buffering is present (e.g., the neutralization of phosphoric acid). Note the low gain of the process at neutrality. For unbuffered strong acid/strong base systems (e.g., Figure 1a), the precision of reagent metering and rangeability of control valves and metering pumps can greatly affect the pH control performance. For example, for a metering precision of (2%, neutralization to pH * To whom correspondence should be addressed. E-mail: [email protected]. Tel.: 806-742-3553. Fax: 806-742-1765. † Current address: Exxon Chemical Company, Baton Rouge, LA.

a

b

Figure 1. Examples of titration curves for (a) an unbuffered strong acid system and (b) a buffered acid system.

) 7 for the titration curve in Figure 1a would result in an effluent pH that would cycle between 2 and 12. However, for a buffered system (e.g., Figure 1b), the pH variations would be less than 1 pH unit. Metering pumps and valves with positioners typically have a deadband ranging from 0.1 to 2.0%.1 Rangeability of the control valves with positioners reaches 100:1, and that of metering pumps is typically 20:1.2 Split range flow

10.1021/ie980776x CCC: $19.00 © 2000 American Chemical Society Published on Web 04/19/2000

Ind. Eng. Chem. Res., Vol. 39, No. 7, 2000 2419 Table 1. Control Techniques for Specific pH Control Problems pH control problem type

control approach manual control effluent to reagent ratio control notch gain control controller based upon a specified titration curve adaptive controller

fixed feed rate, influent concentration, and titration curve

variable feed rate; fixed influent concentration and titration curve

variable feed rate and influent concentration; fixed titration curve

× × × ×

× × ×

× ×

×

×

×

control can be used when rangeability of reagent metering becomes an issue. Large changes in the influent feed rate, concentration of the influent, or the shape of the titration curve of the wastewater are just some of the disturbances that can occur in pH control. Changes in the influent feed rate or the concentration of the influent represent significant upsets but do not change the shape of the titration curve or the process gain. Changes in the shape of the titration curve are the most difficult disturbances to handle because they cause significant gain changes in the pH control process and they usually occur as unmeasured disturbances. The typical approach to industrial pH control is to use well-mixed reaction tanks to mix the influent with the reagent to meet the specified pH for the effluent. When dealing with strong acids or strong bases where the influent pH is below 4 or above 10, tanks-in-series are recommended.1 Additionally, for systems with strong acids and strong bases, notch gain controllers2 are applied. Table 1 lists a range of degrees of difficulty for pH control problems along with control approaches ranging from manual to adaptive control. Clearly, when the shape of the titration curve changes significantly, an adaptive controller is required, despite their typically slow ability to adapt to nonstationary process changes.3 An in-line pH control process has been developed4,5 that uses multiple injections of the reagent to more quickly identify changes in the shape of the titration curve and make appropriate changes to the gain of the pH controller. This paper is concerned with evaluation of the performance of a PI controller with several enhancements applied to pH control using the dualinjection in-line process. Previous Work McMillan2 presents the most extensive coverage available on the key issues associated with a full range of industrial pH control problems. Hoyle and McMillan1 present a thorough introduction to industrial pH control along with specific guidelines for designing pH control systems. The earlier work by Shinskey6 focused on industrial pH measurement and control. Trevathan7 also identified some of the key industrial issues associated with pH control. There are a very large number of pH control papers in the literature from academic authors. One of the most prolific groups in this field is the Waller and Gustafsson group from A° bo Akademi, A° bo, Finland. Gustafsson and Waller8 introduced the reaction invariant approach to pH control. The reactant invariant approach models neutralization reactions using user-selected pK values which can linearize the titration curve. This approach greatly simplifies the pH control problem as long as the reaction invariant model matches the actual titration

variable feed rate, influent concentration, and titration curve

×

curve. Gustafsson and Waller9 compared linear and nonlinear adaptive pH control of an experimental process using the reaction invariant approach and found that the nonlinear approach offered significant advantages as long as the approximation of the titration curve was sufficiently accurate. Henson and Seborg10 also used the reaction invariant model to control pH using an adaptive nonlinear algorithm. Their experimental demonstration showed that the method was able to adapt to unmeasured changes in buffering using a reduced-order, open-loop observer. Wright and Kravaris11 developed a nonlinear pH controller based upon a phenomenological model of an ionic neutralization process and knowing either the chemical constituents or the titration curve of the influent stream. Wright et al.12 experimentally demonstrated their nonlinear pH controller. An extension of this approach for systems with unknown chemical species where the shape of the titration curve did not vary radically was used industrially in Wright et al.13 In their latest work, Wright et al.14 presented a method for the general case where the chemical species can be unknown, and the titration curve changes significantly in time. They treated a system consisting of known and unknown species as a combination of impulses (for known species) and a piecewise continuous distribution (for unknown species). This resulted in a smaller number of parameters that needed to be identified online than if only impulses were used. Once the system parameters were identified, the controller was set up in terms of the strong acid equivalent of Wright and Kravaris.11 Lin and Yu15 developed a pH control method based upon autotuning16 and gain scheduling. They based their approach upon identifying all possible variations in the influent compositions in terms of either chemical compositions or titration curves. Their method was experimentally demonstrated by Chan and Yu.17 Maiti et al.18 developed an adaptive dynamic matrix control19 algorithm for pH control. They developed a closed-loop on-line method for identifying a first-order lag plus deadtime (FOPDT) model of the process which was then used to update the dynamic matrix. Almost all of the published work on pH control is based upon using a well-mixed reaction vessel, but recently industry has been using in-line pH control because of its lower capital costs.20 Riggs and Rhinehart4 and Williams et al.5 developed an in-line pH control process in which the reagent was applied in two separate portions to quickly identify changes in the influent titration curve. Their approach used generic model control21 with a weak acid titration curve model. Mahuli et al.22 demonstrated the dual-injection in-line pH control process experimentally. Shukla and Rhinehart23 applied a fuzzy logic controller using the dualinjection in-line process on a laboratory pH control process.

2420

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

Figure 2. Process diagram for in-line pH control using dual base injection.

It should be pointed out that the in-line configuration offers significant advantages over the continuous stirredtank reactor (CSTR) or CSTR-in-series approach with regard to capital costs and space requirements. Moreover, one would expect that the in-line configuration using multiple injections should be able to more quickly identify changes in the shape of the titration curve than adaptive techniques applied to a CSTR configuration. On the other hand, the in-line configuration is a much faster responding process than a CSTR and, as a result, the in-line process is inherently more difficult to control. Therefore, to be able to take advantage of the economic benefits of the in-line configuration, reliable control approaches for the in-line configuration must be developed. This paper presents the details of the application of an advanced PI controller to a dual-injection in-line pH control process. It also provides a comparison between the proposed approach, the fuzzy-logic controller of Shukla and Rhinehart,23 and the conventional PI controller with the controller settings that are used industrially for strong acid/strong base systems (McMillan2). Dual-Injection In-Line Configuration A process diagram for an in-line pH control process using the dual-injection configuration is shown in Figure 2. The influent stream is mixed with the first portion of reagent (typically 60-90% of the total reagent flow) in an in-line mixer (M1), after which the resulting pH is measured. The last portion of reagent is then added and mixed in-line (M2), and the pH of the effluent stream is measured. The advantages of the dual-injection in-line configuration can be understood by considering the operation for neutralizing an influent that has the titration curve shown in Figure 1a and for the one shown in Figure 1b. For the case corresponding to Figure 1a, the inlet and intermediate pH readings would be very close in value while the effluent pH would, of course, be at neutrality. For the case corresponding to Figure 1b, the intermediate pH reading is approximately the average of the inlet and outlet pH readings; therefore, the intermediate pH reading is an excellent indication of whether the influent contains significant buffering or not. To be able to differentiate between influents with low levels of buffering, but with different degrees of buffering, the dual-injection in-line process might be required to operate with more than 90% of the reagent added in the first portion. This results because for the dual-injection approach to be most effective, the intermediate pH reading must be sensitive to changes in the shape of the titration curve. When the titration curve

Figure 3. On-line estimation of the influent titration curve.

represents a system with more buffering, a lower percentage of the total reagent flow can be effectively used for the first portion of reagent. Therefore, the dualinjection in-line process can provide an on-line indication of the general shape of the titration curve of the influent stream while controlling the pH of the effluent stream. In addition, because this is an in-line process, the changes in the character of the titration curve of the influent can be identified in a relatively short period of time. Advanced PI Control Options Considered A PI controller was applied in the dual-injection inline configuration to determine the total reagent flow rate to maintain the effluent pH at its setpoint. The PI controller is tuned based on the on-line identified FOPDT model of the process. The gain of the FOPDT model (KP) is approximated as slope 2 in Figure 3. From Figure 2, one can see that, because of transport delays, the pH sensors at any point in time are actually measuring the pH of different portions of the process stream. Therefore, to estimate process gain on-line [referring to Figure 2], pH3 at time t should be used along with pH2 at t - (θ4 + θ3) and pH1 at t - (θ4 + θ3 + θ2 + θ1) where θ1 is the transport delay between the pH1 sensor and the first reagent injection point, θ2 is the transport delay between the first reagent injection point and the pH2 sensor, θ3 is the transport delay between the pH2 sensor and the second reagent injection point, and θ4 is the transport delay between the second reagent injection point and the pH3 sensor. The transport delays θ1 and θ3 are simply the pipeline delays, while the transport delays θ2 and θ4 are also due to the deadtime of the static mixers, which is approximately 75% of the static mixers residence time as reported by McMillan.2 Therefore,

θ1 ) V1/F θ2 )

(1)

VM1 V2 + 0.75 F + RS F + RS

(2)

V3 F + RS

(3)

V4 VM2 + 0.75 F+R F+R

(4)

θ3 ) θ4 )

where V1-V4 are the volumes of the corresponding

Ind. Eng. Chem. Res., Vol. 39, No. 7, 2000 2421

sections of the pipe as shown in Figure 2, VM1 and VM2 are the volumes of the 1st and 2nd static mixers, respectively, F is the feed rate, R is the total reagent rate, and S is the reagent split (fraction of the total reagent injected in the first portion). When pH readings are coordinated in this manner, the on-line estimated titration curve will be based upon the same packet of influent fluid. The time constant and deadtime of the FOPDT model are calculated as

τP )

VM2 VM1 + + τanalyzer + 2τactuator F + RS F + R θP ) θ2 + θ3 + θ4

(5) (6)

The manipulated variable for the advanced PI controller is the ratio of the total reagent flow to the flow of the process stream. After the FOPDT model is identified, the PI controller parameters are calculated using the tuning rules given by Haalman.24 This set of tuning rules was specifically developed for deadtime dominant processes.

KH )

( )( )( ) 2 1 3 KP

τP θP

τI ) τP

Haalman’s controller gain controller integral time

(7) (8)

An intermediate pH positioner was used to control the intermediate pH at the average of the influent and effluent pH readings by manipulating the fraction of the total reagent injected in the first portion. Controlling the intermediate pH in this manner resulted in an order of magnitude increase in the process gain estimates, compared with allowing the intermediate pH to float between fuzzy limits.23 The intermediate pH positioner is a constant gain PI controller with an integral time equal to the transport delay between the first reagent injection portion and the intermediate pH transmitter. The value of the intermediate pH controller gain used on the simulator was set at 0.008 75, and that on the experimental system was 0.003 06 fraction/pH. This choice of the intermediate controller tuning parameters allowed it to remain stable for the worst case scenario that could be encountered, the high-gain acid/base systems. To make the PI controller more robust (insensitive to errors in the calculated gain and to changing influent systems), an algorithm that provides controller tuning feedback correction was developed. The feedback correction detunes the controller in the case of cycling and tunes it more aggressively in the event of sustained offset. To distinguish between cycling and offset, the mean pH3 value (pH3) and pH3 standard deviation (σpH3) are used. pH3 and σpH3 are calculated using the last N data points, where N was chosen as 1.5 times the system deadtime, θP.

(

θP N ) INTEGER 1.5 ∆tController

)

(9)

The controller gain feedback correction algorithm works by adjusting the detuning factor FD as described below.

IF σpH3 > 1, then severe controller cycling exists, and the controller should be detuned ∆FD(t) ) 2∆FD(t - ∆t) FD(t) ) FD(t - ∆t) + ∆FD(t) KC(t) ) KH(t)/FD(t) When a change in FD is made, that change is held for N control intervals before another change in FD is made. The relaxing of FD back to 1 is handled as follows:

IF σpH3 > 0.3 AND |pHSP - pH3| > 5σpH3, then the controller is stable, offset exists, and the controller should be tuned more aggressively ∆FD(t) )

∆FD(t - ∆t) 2

FD(t) ) FD(t - ∆t) - ∆FD(t) KC(t) ) KH(t)/FD(t) The initial value for ∆FD is equal to 0.25. Ratio control was used to achieve feedforward flow control for a feed rate change in the untreated wastewater. Feedforward pH control was considered, but feedforward pH control based solely on changes in the influent pH measurement is not effective. This is due to the fact that the influent pH does not correlate with the required reagent injection rate. Process Simulator The controller was first evaluated using a dynamic process simulator, which allowed us to look at the processes with dynamics different from those of the experimental system. The simulated in-line pH system has approximately 9 s of transport delay between the first reagent injection point and the effluent pH analyzer, with an additional 2 s of transport delay between the influent pH analyzer and the first reagent injection point, for an influent flow rate of 300 gpm. The process time constant of the simulated in-line system is approximately 2.75 s. The experimental system deadtime is in the range 5-12 s, and the process time constant varies from 5 to 8 s depending on the reagent flow rate at the nominal influent flow rate of 3 L/min. Therefore, the deadtime/ time constant ratio for the experimental system is from 1 to 1.5, while that of the simulated system is approximately 3.25. The simulator was based on the same phenomenological structure as that used by Choi et al.25 but which was adapted to simulate the in-line pH system.26,27 The two static mixers are modeled as perfect CSTR’s with a volumetric holdup of 1.89 gal each. pH measurement noise is simulated by Gaussian distributed random variables,28 and pH measurements are assumed to have a standard deviation of 0.05 pH. Additionally, the dynamics of the pH analyzers are modeled as a firstorder lag with a 1-s time constant. The first-order time constant of 0.5 s is also used to model the actuator dynamics. The nonstationary behavior (drift) of the influent flow rate, influent concentration, and effluent pH analyzer as well as the reagent injection metering precision are

2422

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

Figure 4. Titration curves for the wastewater test described in Table 2.

simulated by a first-order autoregressive moving average (ARMA). Simulation Results To demonstrate an improvement over previous in-line pH control approaches, the pH control performance of the advanced PI controller was compared with that of the fuzzy logic controller of Shukla and Rhinehart23 for several influent composition step disturbances. The fuzzy logic controller represents the best performing control approach for the dual-injection in-line process. As one can see from Figure 4 which shows the titration curves for the simulated industrial wastewater systems used in this test, these disturbances represent the extreme changes in the titration curves for wastewater. Figure 5a shows how the advanced PI and fuzzy logic controller responded to the influent composition disturbance test described in Table 2 using sodium hydroxide (NaOH) as the reagent. Both controllers were brought on-line at t ) 10 s for a phosphoric acid (H3PO4)/ hydrochloric acid (HCl) influent, a relatively low-gain system. The fuzzy logic controller was very sluggish in bringing the effluent pH to setpoint (neutrality, pH ) 7) and exhibited some offset from the setpoint between 100 and 300 s. The advanced PI controller was able to bring the effluent pH to setpoint very rapidly (t ) 50 s) and exhibited very tight pH control. For the influent composition step change from the H3PO4/HCl influent to a sulfuric acid (H2SO4)/H3PO4 influent (a relatively high-gain system) at t ) 300 s, the advanced PI controller exhibited some initial oscillations in the effluent pH as the controller gain adapted to the new influent. However, about 100 s after the step change, the advanced PI controller was able to control the H2SO4/H3PO4 system consistently. The fuzzy logic controller exhibited substantial oscillations in the effluent pH and was not able to control the effluent pH to neutrality for any sustained period of time for (H2SO4)/H3PO4 influent. At t ) 900 s, a second step change in the influent composition was made from the H2SO4/H3PO4 influent to a buffered acid influent consisting of hydrofluoric acid (HF) and potassium fluoride (KF). Both controllers initially exhibited a large excursion from setpoint. However, the advanced PI controller was able to bring the effluent pH back to the setpoint in 70 s and keep it at the setpoint afterward, whereas it took more than 100 s for the fuzzy logic controller to bring pH3 to the setpoint, after which it exhibited several excursions from the setpoint. Figure 5b shows the reagent to

influent flow rate ratio vs time for both advanced PI and fuzzy logic controllers. McMillan2 specified the PI controller settings that are used industrially for in-line pH control of acid/base systems with steep titration curves. These are KC ) 0.1-0.3 and τI ) 30-60 s. In addition, he stated that a filter with a time constant of 0.2 min should be used on pH measurements. We implemented this single injection controller with parameters specified by McMillan (KC ) 0.1 and τI ) 30 s) and compared its performance with that of the advanced PI controller using the influent composition step disturbances described in Table 2. Figure 5c shows the responses of both controllers to these influent step disturbances. As one can see, the conventional PI controller was sluggish in bringing the effluent pH to the setpoint with H3PO4/HCl influent. The effluent pH still exhibited some offset from the setpoint by the time t ) 300 s, when the influent was switched to a highgain H2SO4/H3PO4 system. After the influent step change occurred, the conventional PI controller started cycling and was unable to control the effluent pH to the setpoint. The controller continued cycling until the influent was switched to a buffered HF/KF system, after which it still took the conventional PI controller more time (compared to the advanced PI) to bring the effluent pH to the setpoint. Figure 5d shows the reagent to influent flow rate ratio vs time for both advanced PI and conventional PI controllers. The advanced PI controller performance was also compared with results obtained with the fuzzy logic controller applied to the in-line system for the influent composition disturbance test described in Table 3 using NaOH as the reagent. The responses of two controllers are shown in Figure 6a. Both were brought on-line at t ) 10 s for a H2SO4/H3PO4 influent. The advanced PI controller exhibited some initial oscillations in the effluent pH as the controller gain adapted to the highgain influent. However, after t ) 80 s, the advanced PI controller was able to control the H2SO4/H3PO4 system between pH 6 and 8 with no subsequent deviations outside this range. The fuzzy logic controller was very sluggish initially in bringing pH3 to the setpoint, and even after reaching the setpoint, the effluent pH variability was much higher than that of the advanced PI controller. A step change in the influent composition was made from the H2SO4/H3PO4 influent to a H3PO4/HCl influent at t ) 600 s. Both systems exhibited an initial upset in the effluent pH due to the step change in the influent; however, in both cases the controllers returned the effluent pH to the setpoint in about the same amount of time. A H3PO4 concentration change in the influent was made from 0.03 to 0.04 N H3PO4 at t ) 1200 s. The advanced PI controller responded to the concentration change very well and was fast in returning the effluent pH to the setpoint. The fuzzy logic controller exhibited a larger initial deviation from the setpoint and was not able to eliminate the offset until t ) 1800 s. Figure 6b compares the responses of the advanced PI and conventional PI (KC ) 0.1 and τI ) 30 s) controllers to the influent disturbances described in Table 3. Clearly, the advanced PI controller on a dual-injection system outperforms the conventional PI controller which was first very slow in reaching the setpoint (t ) 300 s) and then exhibited ringing for the H2SO4/H3PO4 influent.

Ind. Eng. Chem. Res., Vol. 39, No. 7, 2000 2423

Figure 5. (a) CV responses of the advanced PI controller and fuzzy logic controller to influent step disturbances from H3PO4/HCl to H2SO4/H3PO4 to HF/KF (simulated run). (b) MV responses of the advanced PI controller and fuzzy logic controller to influent step disturbances from H3PO4/HCl to H2SO4/H3PO4 to HF/KF (simulated run). (c) CV responses of the advanced PI and conventional PI (KC ) 0.1 and τI ) 30 s) controllers to influent step disturbances from H3PO4/HCl to H2SO4/H3PO4 to HF/KF (simulated run). (d) MV responses of the advanced PI and conventional PI (KC ) 0.1 and τI ) 30 s) controllers to influent step disturbances from H3PO4/HCl to H2SO4/H3PO4 to HF/KF (simulated run). Table 2. Wastewater Influent Composition Disturbance Test Shown in Figure 5 time (s)

disturbance (see Figure 4)

10

controller brought on-line for system 1 influent system 1 components 0.06 N phosphoric acid 0.01 N hydrochloric acid influent composition step disturbance from system 1 to system 2 system 2 components 0.08 N sulfuric acid 0.002 N phosphoric acid influent composition step disturbance from system 2 to system 3 system 3 components 0.04 N hydrofluoric acid buffered with 10.00 N potassium fluoride

300

900

Table 3. Influent Composition Disturbance Test Shown in Figure 6 time (s) 10

600

1200

disturbance (see Figure 4) controller brought on-line for system 2 influent system 2 components 0.08 N sulfuric acid 0.004 N phosphoric acid influent composition step disturbance from system 2 to system 1 system 1 components 0.06 N phosphoric acid 0.01 N hydrochloric acid phosphoric acid influent composition step disturbance influent components 0.08 N phosphoric acid 0.01 N hydrochloric acid

The same kinds of influent disturbances (Tables 2 and 3) were used to evaluate the performance of a conventional PI controller applied to a CSTR with a 1-min residence time. As it was expected, if tuned to control strong acid/strong base systems, a constant-gain PI

controller was very sluggish for buffered systems, and if tuned for highly buffered acid/base systems, it became unstable for high-gain systems. Because of a larger residence time associated with CSTRs, it took a conventional PI controller more time before it started

2424

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

Figure 6. CV responses of (a) the advanced PI and fuzzy logic controllers and (b) the advanced PI and conventional PI (KC ) 0.1 and τI ) 30 s) controllers to the influent step disturbance from H2SO4/H3PO4 to H3PO4/HCl followed by a concentration change in H3PO4 (simulated run).

made to the hardware as discussed below. An additional reagent tank has been installed, so that each reagent pump is now connected to a separate supply tank by a separate line. This had to be done because coupling effects were present between the two pumps when a common tank and a single reagent line were used. Coupling in this case means that changes made to the reagent rate in one injection affected the reagent rate in the other injection, so that accurate reagent metering was not possible even if the metering pumps were perfectly calibrated. Coupling did not have a significant effect on the controller performance for slightly buffered acid/base systems; however, it resulted in a greatly increased effluent pH variability when only strong acid was present in a process stream and strong base was used as a reagent. This problem would not be so serious and could be easily corrected by the controller if the flow measurements were available for the reagent rates. Because our setup was not equipped with flow indicators, it was decided to install an additional tank. Therefore, this modification should not be considered as a limitation of the controller applicability in an industrial setting where the flow indicators are generally available. The base reagent solutions were prepared using deionized water rather than Lubbock city tap water because of the tendency of bases to induce precipitation in Lubbock water. Such precipitation is harmful to the experimental setup because it can clog up the tubes, valves, and filters and even degrade the performance of the gear pumps. Besides, it is a well-known fact that base solutions tend to absorb CO2 from the ambient air, thus resulting in additional buffering in the system. Because our purpose was to test the control strategy on as high-gain acid/base systems as possible, that additional buffering was undesirable. Therefore, using fresh alkaline solutions prepared in the deionized water also allowed us to test the controller on the systems that were more difficult to control. The acid solutions were prepared using the Lubbock city tap water. Experimental Validation of the FOPDT Model

Figure 7. Schematic of the experimental setup.

cycling after a step change to a strong acid/strong base system occurred which allowed it to handle short-term influent composition upsets. However, for prolonged disturbances, as the buffered content of the CSTR was washed out and was replaced by a high-gain acid/base system, the controller eventually started limit cycling. Experimental System Description The proposed controller has been also evaluated using the experimental setup shown in Figure 7. This is essentially the same experimental system that was used by Shukla and Rhinehart23 to test their fuzzy logic controller. A detailed description of the system is given by Natarajan.29 However, some modifications have been

Equations 5 and 6 were used to determine the time constant and deadtime, respectively, of the FOPDT model used by the advanced PI controller. To determine the pH analyzers’ first-order time constant, the pH electrodes were taken out of the process line and inserted into a series of solutions of different pH. This has been done for different pH regions using different acid solutions, and the first-order time constants of the pH analyzers were approximated to be 1.5 s. Determining the actuator time constant was not so straightforward. First of all, there are no flow indicators on the system, and it had to be done from the process observations. Second, this value is not constant and is dependent on the magnitude of the step change in the flow rate and on the magnitude of the flow rate itself. The value of the time constant tends to increase as the magnitude of a step change increases, and it decreases with increasing flow rate (higher pump motor rpm). It did not seem possible to implement scheduling for the actuator time constant, so the value of 0.5 s corresponding to a step change of about 0.3 L/min at 3 L/min flow rate was used in the controller calculations. To check how well the FOPDT model reflects the actual process response, about 50 open-loop step responses were generated and then compared to the

Ind. Eng. Chem. Res., Vol. 39, No. 7, 2000 2425

Figure 8. Actual process response vs FOPDT model.

Figure 9. Advanced PI controller and fuzzy logic controller responses to influent step changes from phosphoric acid to sulfuric acid (experimental run).

responses predicted by the FOPDT model. The value of the process gain KP used to generate FOPDT models was equal to the overall change in effluent pH divided by the corresponding change in the manipulated variable (ratio of the reagent rate to influent flow). Therefore, the purpose of these open-loop tests was to validate the process dynamics predicted by the FOPDT models and not the gain of the process. Figure 8 gives a typical example of such a test and shows both the process response and the FOPDT model for cases when the overall change in effluent pH was within 1.5 pH units. As one can see, the FOPDT model catches the process dynamics reasonably well. For cases when the overall change in the effluent pH was more than 1.5 pH units, there was observed a bigger process-model mismatch due to the increased time constant of pH sensors. Experimental Results Figure 9 shows the responses of the advanced PI and the fuzzy logic controllers to the influent step change from 0.025 N phosphoric acid to 0.03 N sulfuric acid. After the controllers were brought on-line with the phosphoric acid influent, it took both controllers approximately 50 s to bring the effluent pH to the setpoint. However, the fuzzy logic controller response initially resulted in a small overshoot in effluent pH and then in an offset between t ) 50 and 100 s. After the influent was switched to sulfuric acid, both controllers exhibited an initial upset in effluent pH. However, the advanced PI controller was able to recover and control the outlet pH within a pH ) 6-9 band in approximately 100 s after the step change, finally bringing it to the setpoint, while the fuzzy logic controller continued cycling.

Figure 10. Responses of the advanced PI and conventional PI controllers to the influent step disturbance from phosphoric acid to hydrochloric acid (experimental run). (a) KC ) 0.1 and τI ) 30 s; (b) KC ) 0.3 and τI ) 30 s.

Figure 10a shows the responses of the advanced PI and conventional PI (KC ) 0.1 and τI ) 30 s) controllers to the step changes in the influent from 0.02 N phosphoric acid to 0.025 N hydrochloric acid. As can be seen from the graph, both controllers easily handled this disturbance. However, notice how sluggish the conventional PI controller was when the influent was phosphoric acid. The controlled variable response shows a persistent offset which was not eliminated by the time t ) 280 s, when the step change to hydrochloric acid was made. At the same time, it took approximately 50 s for the advanced PI controller to bring the effluent pH to the setpoint with the phosphoric acid influent. Figure 10b compares the responses of the advanced PI controller and conventional PI controller with controller a gain of 0.3 and integral time of 30 s. With the specified controller settings, the conventional PI controller worked better for a phosphoric acid influent; it was able to bring the effluent pH to the setpoint faster. However, when the influent was switched to sulfuric acid, the conventional PI controller response resulted in the effluent pH cycling between pH ) 3 and 7. Conclusions An advanced PI controller was developed for in-line control of pH using the dual-injection configuration. When an intermediate pH reading is provided, the dualinjection approach enabled gain scheduling for the effluent pH controller. Time constant and deadtime scheduling were also implemented based upon flow rates and known dimensions of the equipment, and all process variables were dynamically synchronized using

2426

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

deadtime coordination. The controller tuning correction that adjusts the controller gain in the case of cycling or offset was also implemented. The controller showed fast, aggressive control with good disturbance rejection capabilities as tests that represent extreme changes in the influent wastewater character demonstrated. Because of its adaptive qualities, the dual-injection in-line PI controller was shown to perform better than the fuzzy logic and the conventional single-injection PI pH controllers. The experimental and simulated results presented in this paper demonstrate that pH can be effectively controlled in-line, thus demonstrating an economically advantageous alternative to pH control in a CSTR. Nomenclature F ) influent volumetric flow rate, gpm FD ) detuning factor KC ) controller gain, (reagent gpm/influent gpm)/pH KH ) Haalman’s calculated controller gain, (reagent gpm/ influent gpm)/pH KP ) process steady-state gain, pH/(reagent gpm/influent gpm) pH1 ) influent pH transmitter measurement pH2 ) intermediate pH transmitter measurement pH3 ) effluent pH transmitter measurement pH3 ) average effluent pH value pHSP ) setpoint for effluent pH R ) total reagent flow rate S ) fraction of the total reagent injected in the first injection t ) time, s VM1, VM2 ) volumes of the 1st and 2nd static mixers, respectively V1 ) volume of the pipe between the 1st pH analyzer and the 1st reagent injection point V2 ) volume of the pipe between the 1st reagent injection point and the 2nd pH analyzer V3 ) volume of the pipe between the 2nd pH analyzer and the 2nd injection point V4 ) volume of the pipe between the 2nd reagent injection point and the 3rd pH analyzer Greek Symbols θP ) process deadtime, s θ1 ) transport delay between pH1 and the 1st reagent injection portion, s θ2 ) transport delay between the 1st reagent injection portion and pH2, s θ3 ) transport delay between pH2 and the 2nd reagent injection portion, s θ4 ) transport delay between the 2nd reagent injection portion and pH3, s σpH3 ) effluent pH standard deviation τactuator ) actuator first-order time constant τanalyzer ) analyzer first-order time constant τI ) controller integral time constant, s τP ) first-order process time constant, s

Literature Cited (1) Hoyle, J. C.; McMillan, G. K. pH Control. In Instrument Engineers’ Handbook: Process Control, 3rd ed.; Liptak, B. G., Ed.; Chilton Book Co.: Radnor, PA, 1995; p 328. (2) McMillan, G. K. pH Measurement and Control, 2nd ed.; Instrument Society of America: Research Triangle Park, NC, 1994.

(3) Luyben, W. L. Process Modeling, Simulation and Control for Chemical Engineers, 2nd ed.; McGraw-Hill Inc.: New York, 1990. (4) Riggs, J. B.; Rhinehart, R. R. Method for pH Control. U.S. Patent 4,940,551, July 1990. (5) Williams, G. L.; Rhinehart, R. R.; Riggs, J. B. In-Line Process-Model-Based Control of Wastewater pH Using Dual Base Injection. Ind. Eng. Chem. Res. 1990, 29, 1254-1259. (6) Shinskey, F. G. pH and pION Control in Process and Waste Streams; John Wiley & Sons: New York, 1973. (7) Trevathan, V. L. Characteristics of pH Control. AIChE Workshop on Industrial Process Control, Tampa, FL, 1974. (8) Gustafsson, T. K.; Waller, K. V. Dynamic Modeling and Reaction Invariant Control of pH. Chem. Eng. Sci. 1983, 38, 389398. (9) Gustafsson, T. K.; Waller, K. V. Nonlinear and Adaptive Control of pH. Ind. Eng. Chem. Res. 1992, 31, 2681-2693. (10) Henson, M. A.; Seborg, D. E. Adaptive Nonlinear Control of a pH Neutralization Process. IEEE Trans. Control Syst. Technol. 1994, 2, 169-182. (11) Wright, R. A.; Kravaris, C. Nonlinear Control of pH Process Using the Strong Acid Equivalent. Ind. Eng. Chem. Res. 1991, 30, 1561-1572. (12) Wright, R. A.; Soroush, M.; Kravaris, C. Strong Acid Equivalent Control of pH Process: an Experimental Study. Ind. Eng. Chem. Res. 1991, 30, 2437. (13) Wright, R. A.; Kravaris, C.; Camp, D. T.; Wassick, J. M. Control of an Industrial pH Process Using the Strong Acid Equivalent. Proc. Am. Control Conf. 1992, 620. (14) Wright, R. A.; Smith, B. E.; Kravaris, C. On-Line Identification and Nonlinear Control of pH Processes. Ind. Eng. Chem. Res. 1998, 37, 2446-2461. (15) Lin, J. Y.; Yu, C. C. Automatic tuning and Gain Scheduling for pH Control. Chem. Eng. Sci. 1993, 48, 3159. (16) A° stro¨m, K. J.; Ha¨gglund, T. Automatic Tuning of Simple Regulators with Specifications on Phase and Amplitude Margins. Automatica 1984, 20, 645-651. (17) Chan, H. C.; Yu, C. C. Autotuning of Gain-Scheduled pH Control: An Experimental Study. Ind. Eng. Chem. Res. 1995, 34, 1718-1729. (18) Maiti, S. N.; Kapoor, N.; Saraf, N. D. Adaptive Dynamic Matrix Control of pH. Ind. Eng. Chem. Res. 1994, 33, 641-646. (19) Cutler, C. R.; Ramaker, B. L. Dynamic Matrix Control: A Computer Control Algorithm. Presented at the 86th National Meeting of the AIChE, Houston, TX, 1979. (20) McMillan, G. K. (Monsanto Soluia Co.). Personal communication, April 1999. (21) Lee, P. L.; Sullivan, G. R. Generic Model ControlsGMC. Comput. Chem. Eng. 1988, 12, 573-580. (22) Mahuli, S. K.; Rhinehart, R. R.; Riggs, J. B. Experimental Demonstration of Non-Linear Model-Based In-Line Control of pH. J. Process Control 1992, 2, 145-153. (23) Shukla, V.; Rhinehart, R. R. Heuristic In-Line pH control. Adv. Instrum. Control 1996, 51 (1), Part 1, 159-174. (24) Haalman, A. Adjusting Controllers for a Deadtime Process. Control Eng. 1965, July, 71-73. (25) Choi, J. Y.; Pandit, H. G.; Rhinehart, R. R.; Farrell, R. J. A Process Simulator for pH Control Studies. Comput. Chem. Eng. 1995, 19, 527-539. (26) Desai, M. M. pH Control Using a Heuristic Model: A Pilot Scale Demonstration. M.S. Thesis, Texas Tech University, Lubbock, TX, 1994. (27) Shukla, V. In-line pH Control and Controller Performance Evaluation. M.S. Thesis, Texas Tech University, Lubbock, TX, 1996. (28) Edwards, D.; Hamson, M. Guide to Mathematical Modeling; CRC Press: Boca Raton, FL, 1990. (29) Natarajan, S. Implementation of a nonlinear pH controller. M.S. Thesis, Texas Tech University, Lubbock, TX, 1994.

Revised manuscript received October 6, 1999 Resubmitted for review August 5, 1999 Accepted November 2, 1999 IE980776X