Sunteți pe pagina 1din 10

Ind. Eng. Chem. Res.

1997, 36, 1665-1674 1665

Wastewater Neutralization Control Based in Fuzzy Logic:


Simulation Results
Rau
l Garrido, Manel Adroer, and Manel Poch*
Laboratori dEnginyeria Qumica i Ambiental, Departament dEnginyeria Qumica, Agra` ria i Tecnologia
Agroalimenta` ria, Campus Montilivi, Universitat de Girona, 17071 Girona, Spain

Neutralization is a technique widely used as a part of wastewater treatment processes. Due to


the importance of this technique, extensive study has been devoted to its control. However,
industrial wastewater neutralization control is a procedure with a lot of problemssnonlinearity
of the titration curve, variable buffering, changes in loadingsand despite the efforts devoted to
this subject, the problem has not been totally solved. In this paper, the authors present the
development of a controller based in fuzzy logic (FLC). In order to study its efectiveness, it has
been compared, by simulation, with other advanced controllers (using identification techniques
and adaptive control algorithms using reference models) when faced with various types of
wastewater with different buffer capacity or when changes in the concentration of the acid present
in the wastewater take place. Results obtained show that FLC could be considered as a powerful
alternative for wastewater neutralization processes.

Introduction
Neutralization is a technique commonly used in
chemical engineering as part of the process used in the
treatment of wastewater. Given the importance of this
technique, extensive study has been devoted to its
control. However, because of the difficulties involved
and despite the efforts devoted to this subject, the
problem has not been totally solved.
The titration curve directly gives the neutralization
process model, since it is the direct relation between the
pH and the base flow ratio or versus the base concen-
tration in the reactor (Cb). It can be observed in Figure
1 that the titration curve of any acid is markedly
nonlinear. For instance, in a strong monoprotic acid
three clearly differentiated zones are distinguishable: Figure 1. Tritation curve of an acid.
at low base concentrations there is a zone in which the
pH varies slightly, the so-called buffering zone; in the 1994), adaptive control (Kurtz, 1985), and predictive-
second zone (which occurs for a very small range of adaptive control (Aragon, 1993; Palancar, 1993; Proll
concentrations) there is a sudden change in the pH 1994).
curve, which value passes from acid to basic, with great One of the alternatives recently applied to the control
sensitivity of the pH to changes in the base concentra- of chemical processes in general, and to pH control in
tion. Finally there is a third zone in which changes in particular, is the use of fuzzy logic. This logic provides
the pH are small as in the first one. Due to the shape a simple, orderly means of introducing expert knowledge
of the curve, the controller has to be sufficiently into the process under control, whether by means of a
versatile: rapid in the buffered zones and sensitive model or in an intuitive way. Fuzzy logic is based in
around neutrality (Moore, 1978). the implementation of a set of decision-making rules
combined with a linguistic system of its own, which
The problem is increased when instead of a single allows the problem of process control to be tackled from
acid, the wastewater presents a combination of acid (or/ an almost human point of view. A fuzzy controller
and base) types, with possibly different pK values. converts linguistic variables into numerical values by
Morover, when processing wastewater which may have means of membership functions which, in turn, interact
variations in the concentrations of each acid or respec- with the rules determing the control action required at
tive flow, the control process becomes more difficult. any given moment.
Finally when developing an efficient control algorithm, In the case of pH control, numerous papers have been
it will be necessary to bear in mind the possible written in the past years, putting forward control
limitations of the process as regards dead time. algorithms or testing regulator design methods. Of
The difficulties have led to various alternatives being these, the following can be mentioned: nonadaptive
put forward to solve each one. Thus, many authors controllers (Galluzo, 1991), in association with neural
propose different solutions to the problem: predictive networks (Lee, 1990; Nie, 1994; Cheng, 1993), those
combined with traditional control algorithms (Riggs, using fuzzy models (Kelkar, 1994), those used in com-
1990; Gaulian, 1990), modified PI controller (Costello, bination with traditional control methods (Kwok, 1993),
those optimized with genetic algorithms (Karr, 1993),
* To whom correspondence should be addressed. E-mail: and in-line control (Parekh, 1994).
eqampe@fc.udg.es. Telephone: 34.72.418438. FAX: In the present paper the authors present the results
34.72.418150. of comparing the application of a fuzzy controller with
S0888-5885(95)00654-3 CCC: $14.00 1997 American Chemical Society
1666 Ind. Eng. Chem. Res., Vol. 36, No. 5, 1997

some of the others mentioned in the Literature Cited,


testing them in computer simulations. Among the latter
there are two which are based on the knowledge, by
different types of identification, of the characteristics
of the titration curve of the acids present in the water,
and a third adaptive controller based on a reference
model. Their respectives advantages and disadvan-
tages, depending on the conditions in which they are to
be used, are assessed from the point of view of the end
user.

Proposed Fuzzy Controller


The proposed fuzzy controller has two inputs and one
output. The inputs are the error (e), which is the
difference between the pH set point and the actual pH,
and the error velocity (v), which is the difference
between the actual error and that of the preceeding
iteration, bearing in mind that data acquisition is
spaced at equal time intervals:

e ) pHsp - pH (1)

v ) ek - ek-1 (2)

The output variable is S. This variable enables us to Figure 2. -shaped membership function.
calculate the actual flow ratio by means of the equation
membership functions with different n values are
ratk ) ratk-1 10S/K (3) represented in Figure 2.
It was decided to work with a high number of
This equation carries out the final control action on the elements in the sets: seven for each of the input
basis of the last flow ratio, ratk-1 and on an exponential variables and nine for the output variable. In this way,
operator which makes the pH regulation faster and a response with few sudden changes is obtained. The
more versatile. The K factor makes it possible to adjust membership functions were distributed in such a way
the output of the fuzzy algorithm by attenuating the that those in the center were closer to each other, thus
response during the course of the process. In this way giving greater precision of response around the set point.
it becomes unnecessary to keep modifying the fuzzy The elements of the fuzzy sets overlap, to some extent,
controller membership functions, which can be the same between them.
with any type of acids. A small K is used when the In Figure 3 the velocity fuzzy set, the error fuzzy set,
water is buffered; for wastewater containing strong and the output fuzzy set are presented.
acids the process is very sensitive to changes in the flow
ratios. In order to avoid possible instabilities in the
process, large K values are used. This study has sought Rules
to avoid possible instabilities and has therefore selected
a large K (a value of K ) 200 was chosen), suitable for For the implementation of the fuzzy logic control it
water with low buffering capacity. Bearing this fact in is necessary to define a series of rules through which
mind, the proposed controller is seen at its worst when the knowledge of the behavior of the system is applied.
highly buffered water is simulated. These rules are of the following type: if the error is BM
and the velocity is PL, then the response of the output is
Classification of the Variables NL.
The rules to be applied are constantly changing
There are many types of functions which allow us to depending on input perturbations. For example, if
classify the variables which intervene in the fuzzy buffered water goes into the plant, the velocity variable
controller. For this particular controller, the so-called would be small, which means that it will be necessary
-function (Yamakawa, 1992) has been used. This has to modify more quickly the flow ratio than if the velocity
some advantages compared with the typical triangular were great, but taking also into account the solutions
and trapezoidal or Gaussian functions: the first is that pH so as not to go too far beyond the set point. If the
it is continuous and the second is that it can easily be absolute value of the error were small, the modification
made to approximate triangular, trapezoidal, or Gauss- should be made smaller than if the absolute error were
ian forms by modifying three parameters: a (the great. A process based on similar reasoning, taking into
midpoint abscissa of the function), W (the width for account all the possible input case combinations, per-
) 0.5), and n (the order of the function): mits the definition of all the other control rules. The
control system has a total of 49 rules, of which some
1 will never be applied. However, in the interest of the
( )
(x) ) n
(4)
2(x - a) controller stability, it was felt that all eventualities
1+ should be taken into account.
W
The decision matrix implemented is presented in
The values are in the range of 0-1. Several -shaped Table 1. It shows the elements of the output fuzzy set
Ind. Eng. Chem. Res., Vol. 36, No. 5, 1997 1667
In the inference step the elements of the output fuzzy
set become activated. In this work this is made accord-
ing to the following process: the elements of the input
fuzzy sets having functions greater than zero are
paired one element of the error (e) variable set to one
element of the velocity (v) variable set, making all
possible combinations. Looking at the rules, defined
previously, to each pair corresponds an element p of the
output fuzzy set (S). The truth value of this output
element will be calculated as

po(S) ) min(i(e),j(v)) (5)

This means that if element i of the error fuzzy set and


element j of the velocity fuzzy set have functions not
equal to zero, according to the rules, element p of the
output fuzzy set will have a o function equal to the
minimum of the two input function values.
If any one of the output fuzzy set elements is activated
more than once, its final o function will be the sum of
all the o functions of this element.

po(S) ) po(S) + po(S) (6)

Any nonactivated element of the output fuzzy set will


have an o(S) equal to zero.
In the defuzzification stage a numerical final output
value must be obtained. This is done through an
average integral including all the output fuzzy set
elements having a o greater than zero:

io(S)S)Min Si(S) dS
S)Max i

i
Figure 3. Velocity (a, top), error (b, middle), and output (c, Scen ) (7)
io(S)S)Min i(S) dS
S)Max i
bottom) fuzzy sets. The acronyms for the velocity set elements are
NR for negative rapid, NM for negative medium, NL for negative i

low, L for velocity around zero, PL for positive low, PM for positive
medium, and PR for positive rapid. The acronyms for the error where io ) truth value of the i output fuzzy set element
fuzzy set elements are BA for basic high, BM for basic medium, obtained using eqeqs 5 and 6, Mini ) minimum S values
BB for basic low, OP for error around zero, AB for acid low, AM for which the function has nonzero values, Maxi )
for acid medium, and AA for acid high. The acronyms for the
output fuzzy set elements are NR for negative high, NM for
maximum S values for which the function has nonzero
negative medium, NL for negative low, NSL for negative small, values, and Scen ) output that goes to eq 3.
OP for response around zero, PS for positive small, PL for positive
low, PM for positive medium, and PR for positive high. Other Controllers Studied
Table 1. Decision Matrix As already mentioned under the previous section, this
velocity paper proposes a fuzzy logic based controller for the pH
error control of acid wastewater. In order to observe its
NR NM NL L PL PM PR efficiency, it will be compared, through computer simu-
BA NR NM NM NR NM NM NM lations, with other controllers mentioned in the Litera-
BM NM NL NL NM NL NL NL ture Cited.
BB NL NS NS NS NS NS NS
OP NS NS OP OP OP PS PS
1. This is a controller which identifies the evaluation
AB PS PS PS PS PS PL PL curve being approximated by means of a single hypo-
AM PL PL PL PM PL PM PM thetical acid. It combines a general model control
AA PM PM PM PR PM PR PR (GMC) algorithm with its identification of the curve in
order to determine the appropiate control action. In this
that will become activated as a function of the pairs of paper it will be referred to as SAGMC (single acid
input fuzzy sets elements, as is stated in the rules general model control) (Riggs, 1990).
developed. 2. This controller identifies the evaluation curve off-
line, interpolating the curve by means of a set of
Algorithms hypothetical acids determined by the controller. On the
basis of its knowledge of the evaluation curve, it
There are three steps in the calculation of the output determines the gain of a feedback controller which
of the fuzzy controller: fuzzification, inference, and performs the final control action. During the identifica-
defuzzification. tion stage the system is without control. The controller
In the fuzzification stage a value (in the range of will be referred to as MAFBC (multi acid feedback
0-1) must be assigned to all the elements of the input control) (Gaulian, 1990).
fuzzy sets. This is made computing the membership 3. This is an adaptive controller which uses a
functions , for every element of both sets, in accordance reference model. It will be referred to as RMAC
with their respective input values. (reference model adaptive control) (Kurtz, 1985).
1668 Ind. Eng. Chem. Res., Vol. 36, No. 5, 1997

Figure 4. Flow diagram of the fuzzy logic controller.

Figure 5. Diagram showing the neutralization process.

For further information on these controls, see Ap- the disturbance. With this criterion, several sets of
pendix B. parameters according to a central composition design
were tested, selecting for each controller the set giving
Results the best performances.
Studies Performed. In order to carry out a com-
Characteristics of the Process Studied. The parative study of the different controllers, two separate
different control systems were suposed to operate under subordinate studies were proposed as those thought to
the same process conditions. The input water flow was be the most appropiate to the problems posed by the
considered constant, at 2 L/min, in all the simulations. wastewater neutralization process: (1) behavior of the
The neutralization tank volume was 0.7 L, except for process controllers in relation to various types of
the SAGMC controller, which had two tanks of 0.3 and wastewater with differing buffer capacity; (2) behavior
0.4 L, respectively, with the total volume identical to of the process controllers in relation to changes in the
that described for the previous controllers. In all the concentration of a strong acid present in the water.
cases the tanks were considered to be perfectly mixed. The first point of the study aims to observe the effect
The concentration of the base, NaOH, was 250 mmol/ caused by the presence of acids with differing buffering
L. Finally, the actions of each controllers were per- strengths on the regulating capacity. This study evalu-
formed every 2 s. No dead time was considered. Figure ates the versatility of the various controls. The second
5 schematically shows how a neutralization process point monitors the control in relation to changes in the
works and gives a general view of the components concentration of an acid with pK ) 2, and observes the
required to implement a pH controller. recovery speed of the controls, as well as their possible
It should be pointed out that the controllers obtained instability.
from the Literature Cited were optimized to ensure that In all the studies the set point was fixed at pH ) 7.
they were in perfect condition when the study was Most procedures require that the wastewater have pH
carried out. A factorial design was made for each values between approximately 6 and 8, and if the water
controller in order to select a set of parameters. As a did not fulfill this condition, it was required that it
test, a step change in concentration (varying from 10 should rapidly be adjusted.
to 30 mmol/L) was done with an acid with pK ) 2. The 1. Behavior of the Process Controllers in Rela-
optimization criterion used was the time needed to settle tion to Various Types of Wastewater with Differ-
Ind. Eng. Chem. Res., Vol. 36, No. 5, 1997 1669

Figure 6. pH evolution with time for the different controllers;


changes in acid concentration are implemented.

Figure 7. Maximum deviation vs pK, with different controllers


ing Buffer Capacity. In this case simulations were as step changes in acid concentration are implemented.
made using in every one of them an acid with a specific
pK, thus enabling us to compare the behavior of the
different controllers under the same conditions. These
pK values were uniformly distributed throught the
whole working pH range (varying from 1 to 7). Com-
paring the groups of simulations among themselves, it
was possible to study the influence of the acids pK on
the performance of the different controllers.
In every simulation step changes of the acid concen-
tration were introduced during the process. The changes
were from 10 to 20 mmol/L, and back from 20 to 10
mmol/L at 10 min intervals. The criteria for evaluating
the behavior of the controllers were the pH deviations
and the time needed to bring the pH within an interval
of (0.25 units of pH around the set point.
Figure 6 shows the evolution over time of the pH of
one group of simulations with different controllers and
the same acid strength (pK ) 3). In the figure the step
changes in the acid concentration are shown. The
MAFBC controller is the one which, because of its
operating mode (involving the off-line adjustments of
the evaluation curve), maintains the pH closest to the
set point. It is the one which shows the smallest
deviations, as well as being able to stabilize the process
within the time interval between stages. The FLC is
also able to bring the pH close to neutral in the 10 min Figure 8. Time (in minutes) needed for the different controllers
interval, but its degree of deviation is much greater than to reach a pH close to the set point vs the acids pK.
in the MAFBC controller. The RMAC and SAGMC
controllers are those which perform least well, altough identification of the model which it carried out before
SAGMC shows less pH deviation. the control began. Thus the internal feedback control-
In Figure 7 the pH deviations vs the pK of each acid lers gain is constantly the best. The FLC has a high
considered are presented. It could be observed that deviation value at pK ) 7, compared with the other
there is a general tendency for the maximum deviation controllers, but works much better, in a comparative
to decrease as the pK of the simulated acid increases way, at low pK.
(FLC at high pK is an exception). This effect is due to Figure 8 shows a general tendency, for the time
the fact that, as pK increases, the process gain becomes needed to settle the pH disturbance, to diminish as the
less sensitive around pH ) 7, and therefore small pK of the simulated acid increases, except in the case
changes in the flow ratio do not lead to any major of the FLC. This is due to the fact that, for the same
variation in the pH. reason which accounted for the deviation behavior, as
We can see that MAFBC is the control with best the pK increases, the process becomes less sensitive to
performances and with a lower deviation rate in all the the variations in the flow, and therefore the pH values
points studied. This is because the control system is at show smaller fluctuation, reaching the range 6.75-7.25
all times aware of the titration curve, thanks to the more quickly.
1670 Ind. Eng. Chem. Res., Vol. 36, No. 5, 1997

Figure 9. pH disturbances for an acid concentration step change Figure 10. pH recovery time from a disturbance vs concentration
from 50 to 80 mmol/L (pK ) 2). step change.

The fuzzy control, at high pK, behaves in a way the proposed conditions, being approximately 3 times
opposite the value of other controllers. The reason for faster than the MAFBC, 5 times faster than the RMAC,
this being that, in all the simulations, a constant K was and 7 times faster than the SAGMC.
used, which is best suited for the control of low buffering
capacity wastewater. This K considerably lessens the
response of the controller so that it remains stable even Conclusions
when strong unbuffered acids are present in the water It must be taken into account that the neutralization
to be treated. It will also be stable with weak acids, process studied only treats acid wastewater by strong
but the response will be too slow. If a smaller value of base, but it is possible to extrapolate the conclusions if
K is used, the system takes less time to reach the basic wastewater were treated. Following the results
required pH interval. presented in the previous two points, we proceed to
2. Behavior of the Controllers in Processes with make a comparative evaluation of each controller.
Changes in the Concentration of an Acid Present
Influence of the Acid pK. Unbuffered waters are
in the Water. In order to study this point, a series of
considered those which because of their composition
simulations were performed, similar to those described
have no weak acid species (pK < 3). These waters are
before, with an acid having pK ) 2 and introducing
the most difficult to control, due to their great sensitivity
different step changes in its concentration. The acid
to changes in the neutralizer flow around neutral pH.
concentration was 50 mmol/L at the beginning of the
process, and step changes, of either positive or negative In the conditions studied, MAFB controller is always
sign, were implemented. The minimum concentration better than SAGM controller and RMA controller, both
value has been 1 mmol/L and the maximum 110 mmol/ regarding the pH deviation values as well as the
L. In Figure 9 the recovery time of the system needed recovery time, in the whole range of pKs. This is due
to reach the zone of pH ) 7 ( 0.25, vs the concentration to its determination of the titration curve before starting
step changes, is presented (using different controllers). the control.
In the abscissas we can see the values of the steps The FLC presents important differences in its behav-
(positive or negative) with reference to the initial 50 ior related to the acids pK value. In unbuffered waters
mmol/L concentration. it is the fastest in bringing the pH to around set point,
It can be seen that, after the disturbance, the fuzzy even better than MAFBC, and pretty good regarding pH
controller regulates most quickly the pH and brings it deviation, not as good as MAFBC but better than
within the parameters of the criterion. The pH devia- SAGMC and RMAC. This may be due to the fact that
tion of the MAFBC is considerably less, but the recovery it acts more directly on the manipulated variable on
time is greater. The slowest acting controller is the account of its rule-based configuration.
SAGMC, while the RMAC shows the greater pH devia- In buffered waters the fuzzy controller loses efficiency,
tion with a time recovery between those of MAFBC and compared with the other controllers. Its response
SAGMV. velocity decreases considerably for pK ) 5-6 and the
The process was not found to be unstable in any of pH deviation increases a lot, becoming the worst of all
the simulations carried out. In this subordinate study, the tested controllers in both criteria. This is due to
if each controller is studied in turn, it can be found that its having been designed (uses a large K) to work with
all of them show a similar trend: as the absolute value wastewaters containing strong acids.
of the step disturbances decreases, the time that the With the exception of FLC we can see there is a
process takes to become stabilized decreases. However, general trend that the value of the pH deviations and
the controllers show differences in the speed to overcome the length of the recovery time decrease as the pK of
the disturbance. The fuzzy control is the fastest under the acid increases.
Ind. Eng. Chem. Res., Vol. 36, No. 5, 1997 1671
Looking at Figures 9 and 10, it could be concluded o ) -function value for the output set elements
that the size of the step change does not seem to have [ ] ) ion concentration
an influence on the trends presented above. Evidently
the size of the pH disturbance and the recovery time Appendix A. Ionic Model
increase if the size of the step increases.
The model used for carrying out the simulation is
Water Variability. This factor affects particularly
based on the balance of electrical charges inside the
the MAFB controller, which makes an off-line determi-
solution (Stumm, 1970). The balance of charges for any
nation of the titration curve. Therefore many changes
monoprotic acid, neutralized to any proportion with
in the acid species present, with different dissociation
NaOH, is determined by the following equation:
constants, will render the controller ineffective. In some
circumstances it could spend more time identifying
curves than controlling.
[A-] + [OH-] ) [Na+] + [H+] (8)
where [Na+] is equal to the concentration of neutralizing
Nomenclature base added.
The model has the capacity to simulate the joint
a ) midpoint of the -function behavior of three monoprotic acids in solution. The
a0 ) integral correction parameter, RMAC equilibrium constants Ka will be supposed to remain
Ci ) concentration of the i ion constant during the process, and that is equivalent to
Ca, Cai ) total acid concentration (acid + conjugate base) saying that the temperature and the ionic strength will
Cb, Cbi ) total base concentration (base + conjugate acid) also remain constant. The acid and conjugate basic
Cbadd, Cbaddi ) strong base concentration added species are broken down into ionic fractions, which
Cbase ) base concentration in acid wastewater plus base depend exclusively on pH and Ka.
concentration added In order to illustrate how the ionic model works, we
Cbinput ) base in acid wastewater input are now going to suppose that there is a single acid, but
Cbneut, Cbneuti ) strong base needed to neutralize the acid on the basis of the deductions carried out, the model
wastewater, SGMC, MAFBC can be extended to more acids. The balance of charges
e ) pH error, FLC input will be as follows:
infresp ) inference output
k1, k2 ) controllers adjustement parameter, SAGMC [H+][H+]
Ka ) (9)
K ) FLC adjustment parameter [HA]
Ka ) equilibrium acid constant
Kc ) controller gain, MAFBC Ca ) [A-] + [HA] (10)
Kfg ) gain factor, MAFBC
KI ) reference velocity factor, RMAC [H+]
[HA] ) Ca ) R0Ca (11)
Kp ) process gain Ka + [H+]
KR ) adaptive controller gain, RMAC
Kw ) equilibrium water constant Ka
n ) order of the -function [A-] ) Ca ) R1Ca (12)
pHact ) actual pH in the stirred tank, MAFBC Ka + [H+]
pHsp ) set point pH
Kw
pHss ) GMC output, SAGMC R1Ca + - Cb ) 0 (13)
pH3 ) output pH from second CSTR, SAGMC [H+]
q1, q2 ) controllers adjustment parameter, RMAC
Q ) output flow from CSTR where Cb is the concentration of NaOH added.
Qbadd ) base flow added
In the equations there are three variables Ca, [H+],
and Cb. The variables Ca and Cb have a similar behavior
Qinput ) acid wastewater input flow
determined by the differential equations of a CSTR.
rat ) flow ratio, base flow/acid wastewater flow
ratact ) flow ratio at the actual pH, MAFBC dCa Q
ratsp ) flow ratio at the pH set point, MAFBC ) (Cainput - Ca) (14)
dt V
rulek ) result of a fuzzy rule applied
S, Scen ) FLC output dCb Q
t ) time ) (Cbadd - Cb) (15)
dt V
T0 ) time interval between data gathering
v ) error velocity variation of pH, FLC input where Q is the output flow from the CSTR, V its volume,
x ) FLC input or output Cainput is the total acid concentration from the waste-
xw ) pH error, RMAC water, and Cbadd is the total base concentration, due to
W ) width of the -function when (x) ) 05 the base addition, in the total flow.
zi ) charge of the i ion The equation system is solved by using Runge-
R ) time constant of the reference velocity Kuttas fourth order method of numerical integration,
Ri ) ionic fractions of species in solution
which calculates the equation independently of pH, and
then the pH is calculated by means of the balance of
Cbneut ) variation of the concentration to neutralize the
acid wastewater
charges.
KR ) adaptive controller gain variation, RMAC
xw ) error variation velocity, RMAC
Appendix B. SAGMC, MAFBC, and RMAC
xwref ) reference error variation velocity, RMAC 1. SAGMC. This controller has two distinct parts
) -function value which operate interactively.
1672 Ind. Eng. Chem. Res., Vol. 36, No. 5, 1997

Identification of the Curve. Because of its design, value will be used to determine the flow of base to be
this controller requires divided addition of NaOH into added at any given moment, by means of the following
two separate tanks. The controller adds 75% (in their equation:
study, Riggs and co-workers propose 60-90% addition)
of the total quantity of NaOH in the first tank, and the Cbneut
remainder in the second. In order to identify the curve, Qbadd ) Q (22)
Cbadd
it measures the pH at the input (pH1), at the output
from the first tank (pH2), and at the output from the where Qbadd is the total base flow for the tanks, Q is
second tank (pH3), and by knowing the concentration the output flow, Cbneut is the concentration of base, in
of the base added at each of the tanks, three points on the total flow, required to neutralize the acid waste-
the pH vs Cbadd (concentration of base added) are water, and Cbadd is the concentration in the base
obtained. From the balance of charges and the equi- neutralizing flow.
librium equation for a monoprotic acid, together with The values of the fixed parameters used in the
the definition of pH, we obtain the following: simulations were
(c + Cbadd) 10-pH k1 ) 1.25 k2 ) 0.02
Ka ) e-G/RTKa - ) 0 (16)
(Ca - c - Cbadd)
2. MAFBC. Like the previous controller this has two
distinct parts, identification and actual control, although
[A-] ) Cbadd + [H+] - [OH-] ) Cbadd + c (17) these do not interact. Instead, the identification algo-
rithm calculates the curve off-line and, following iden-
Kw tification, the control is carried out.
c ) 10-pH - (18) Identification of the Curve. The identification
10-pH
algorithm acts by modifying the quantity of base added,
There are three equations for the experimentally and the pH in solution is measured once the system has
measured points (pH1, pH2, pH3, vs Cb1 ) 0, Cb2, Cb3), reached an approximately stationary state. Using this
and two unknown variables Ca and Ka. The problem is methodology a number of experimental points on the
solved by applying an algorithm based on the minimiza- evaluation curve are determined, pH vs flow ratio.
tion of an objective function, in which the quadratic When these experimental points are known, the evalu-
errors for each measuring point are summed, thereby ation curve is modeled, using hypothetical acid species
enabling the three points measured to be adjusted to a determined by the program, as will be shown below.
curve determined by the concentration and acid con- According to the concept of the balance of electrical
stant of an hypothetical acid. The objective function is charges in solution, the positive charges must be

( )
equaled by the negative ones, so that the overall solution
i)3
1 Ca - ci - Cbadd 2 is neutral:
Obj ) Ka
- (19) i)n


i)1 10-pHi(ci + Cbadd)
Cizi ) 0 (23)
i)1
Ka can be taken from the previous expression and be
given as the explicit function of Ca as a weighed average where n is the total number of different ionic species in
of the three point values: solution, Ci is the concentration of the i ion, and zi is its

( )
charge.
i)3 Ca - ci - Cbadd

Taking into account all the species present in solution,
the balance of electrical charges would be as follows:
1 i)1 (10-pHi)2(ci + Cbadd)2

( )
) (20) -Ca1Ra1 - Ca2Ra2 - ... - CanRan + Cb1Rb1 + Cb2Rb2 +
Ka i)3
1
... + CbmRbm + [H+] - [OH-] ) 0 (24)
i)1 10 -pHi
(ci + Cbadd)
where Cai is the total concentration (acid + conjugate
GMC Algorithm. Once the parameters of the model base) of the i acid, Cbj is the total concentration (base +
are known, the GMC is used to determine the variable conjugate acid) of the base j, and Rai and Rbj are the ionic
pHss. On the basis of the proportional and integral fractions of the species in solution (see Appendix A).
error, this variable allows us to calculate the base to be Considering the neutralization of an acid water, it will
added: be supposed that all the basic species correspond to the
alkaline cations, which will be totally disssociated bases.
pHss ) pH3 + k1(7 - pH3) + k2 0t(7 - pH3) dt (21)
Therefore the ionic fractions are independent of pH and
will have the unit value

where k1 and k2 are the controllers adjustment param- Rb1 ) Rb2 ) ... ) Rbn ) 1 (25)
eters.
In both the algorithms previously explained it is This means that all the Cbj may be grouped together:
possible to interact simultaneously. From the knowl-
edge of the process, based on a single acid model, Cbase ) Cb1 + Cb2 + ... + Cbn (26)
calculate the base concentration necessary to achieve
the condition pH ) pHss where pHss is determined by Furthermore, the base concentration present in the
the algorithm GMC. In order to do this, the balance of system can be divided into two parts:
electrical charges in solution is applied to calculate the
concentration of the base in solution Cbneut needed. This Cbase ) Cbinput + Cbadd (27)
Ind. Eng. Chem. Res., Vol. 36, No. 5, 1997 1673
where Cbinput is the base present in the input water and The aim is that the product of Kc and the process gain
Cbadd is the base added in the neutralization process. be constant at all times, that is, that the total gain in
The balance of electrical charges is as follows: the loop will be always constant.
The evaluation curve model is used to determine the
Ca1Ra1 + Ca2Ra2 + ... + CanRan + -Cbinput ) [H+] - process gain on the basis of the actual pH in the
solution, pHact:
[OH-] + Cbadd (28)
pHsp - pHact
From this equation a system of linear equations, one Kp ) (32)
ratsp - ratact
for each of the experimental points, could be obtained.
The pH and the dissociation constants of the hypo-
thetical acids are known, thus allowing calculation of where pHsp is the pH set point, pHact is the actual pH,
Rai and Cbadd. The concentration of the neutralizing base ratsp is the flow ratio at the pH set point, and ratact is
is also known, and the concentrations [H+] and [OH-] the flow ratio at the actual pH, in the model.
can be calculated from the measurement of the pH and It is extremely important that the flow ratios consid-
the dissociation constant of the water, Kw. Thus we ered above be always those of the theoretical curve;
have grouped together on the right side of the previous otherwise, errors could occur in the calculation of the
equation all the known terms, which we call D: process gain, and these in turn would affect the calcula-
tion of the controller gain. If the total concentration of
acids does change but the slope of the curve around
D ) [H+] - [OH-] + Cbadd (29) neutrality does not change too much, the model would
be still valid and the Kp obtained using eq 32 could be
The only unknown terms will be the concentrations Cai used without impairing the control. Anyway if there
and Cbinput present in the input water. Thus, on the was a significant change in the pH vs rate curve slope,
basis of the experimental points taken during the it would be necessary to proceed to a new identification
identification stage, a system of linear equations is of the system during which the process would be left
obtained. If the number of equations were equal to the without control.
number of unknown terms, that is, n + 1 ) p, the vector The calculation of Kc is made as is shown in the
of the concentrations could be found, thus solving the following equation:
linear system of equations. However, the method is
unstable because negative values may be obtained for Kfg
some of the concentrations of the hypothetical acids, a Kc ) (33)
Kp
fact which makes no sense in physical terms. In fact, a
technique is applied to decompose the matrix of the
coefficients into singular values (SVD), based on the where Kfg is the gain factor.
adjustment of the experimental points by means of the Once the Cbneutn concentration of base needed to
minimization of the quadratic errors, that enables neutralize the acid wastewater has been determined,
finding a solution for the concentration vector. With the required dose of basic solution flow can be calcu-
this technique a solution can be found even in the case lated:
of having more equations than unknowns or more
unknowns than equations. Thus it is possible to elimi- Cbneutn
Qbadd ) Q (34)
nate the acids having negative concentrations values. Cbadd
Ultimately, there always remain a series of acids
(eventually only one) which fit the titration curve. where Qbadd is the flow of neutralizing basic solution,
The parameter which characterizes the hypothetical Cbadd is the concentration of the neutralizing base
acids is the pK. It is good to start the calculations with solution, and Q is the output flow from the CSTR.
a series of acids, with pK uniformly distributed The values of the fixed parameters used in the
thorought the whole working pH range, that will span simulations were
the space between the maximum and the minimum pH
of the experimental points. Working this way, the curve Kfg ) 25 )3
adjustment is much better. This fact has been taken
into account in the implementation of this controller.
As in the case of the previous controller, it is necessary
Control Algorithm. The control algorithm consists
to know the base concentration Cbadd in the neutralizing
of a PI-feedback loop with variable gain:
solution.
At the beginning of the process it will be always
Cbneutn ) Cbneutn-1 + Cbneut (30) necessary to make a system identification; new identi-
fications will be needed if the control becomes too
where Cbneutn is the concentration of the base, in the sluggish or erratic.
total flow, needed to neutralize the acid wastewater, in 3. RMAC. This controller has a different approach
the n iteration, Cbneutn-1 is the concentration of base from those previously mentioned, since it does not
added in the n - 1 iteration. attempt to model the evaluation curve, but rather on
The feedback loop calculates the quantity of base the basis of a reference model of the velocity of the error
Cbneutn which is going to modify the actual base variation (or variation in the control deviation) assesses
dosification. the control action required at any given time.
The controller gain is manipulated by a higher adap-
(
Cbneut ) Kc e(t) +
1

0te(t) dt) (31) tive loop, so that in the event of a deviation in the
velocity of error variation in relation to that of the
reference model, it modifies the gain depending on the
where Kc is the controller gain and is the reset time. direction and degree of the deviation.
1674 Ind. Eng. Chem. Res., Vol. 36, No. 5, 1997

The behavior of the reference model determines the Cheng Liang Chen; Wen Chilh Chen. Application of neural
dynamic behavior of the entire control system. The network on the design of a fuzzy controller. Proceedings of the
reference model is a decreasing integral function cor- IASTED International Conference. Applied Modelling and
Simulation; IASTED: Anaheim, 1993; pp 18-19.
responding to a first order delay. Costello, D. J. Evaluation of model-based control techniques for a
The definition of the control system is as follows: buffered acid-base reaction system. Trans. Inst. Chem. Eng.
Control Algorithm. 1994, 72, 47-54.
Galluzo, M.; Cappellani, V.; Garofalo, V. Fuzzy control of pH using
Qbadd(k) ) Qbadd(k-1) + KR(xw(k) + q1xw(k-1) + NAL. Int. J. Reasoning 1991, 5 (6), 505-519.
Gaulian, M.; Lane, J. D.; Loparo, K.; Scheib, T. J. Tritation-curve
q2xw(k-2)) (35) estimation for adaptive pH-control. EP Patent 457989, Nov 27,
1991, before US patent 526416, May 21, 1990.
where Qbadd is the flow base dose, k is the number of Karr, C. L.; Gentry, E. J. Fuzzy control of pH using genetic
discrete time intervals, KR is the adaptive control gain, algorithms. IEEE Trans. Fuzzy Syst. 1993, 1 (1), 46-53.
q1 and q2 are the constant controller parameters, and Kelkar, B; Postlethwaite, B. Fuzzy-model based pH control.
xw is the pH error. Proceedings of the Third IEEE Conference on Fuzzy Systems.
The control equation is a second order filter, which IEEE World Congress on Computational Intelligence; IEEE:
New York, 1994; Vol. 1, pp 661-666.
calculates the manipulated variable on the basis of the Kurtz, H. Adaptive control of a wastewater neutralization process.
information on the actual and the two preceding errors. IFAC Proc. Serv. 1985, 3257-3261.
Value of the Control Velocity. xw(k) is the control Kwok, D. P.; Wang, P. Enhanced fuzzy control of pH neutralization
deviation or error, and its delta is the variation in the processes. Proceedings of the IECON93. International Confer-
error over a period of time, that is, the velocity of the ence on Industrial Electronics, Control, and Instrumentation;
error variation: IEEE: New York, 1993; Vol. 1, pp 285-288.
Lee, S. J.; Chen, S. S.; Kao, M. A neural network approach to self-
xw(k) ) pHref - pH(k) (36) organizing controller design. Proceedings of the ISMM Inter-
national Symposium Computer Applications in Design, Simu-
lation and Analysis, MIMI90; Acta Press: New Orleans, 1990;
xw(k) ) xw(k) - xw(k-1) (37) pp 273-276.
Jang J.-S. R.; Sun C.-T.; Neuro-Fuzzy Modeling and Control.
Calculation of the Reference Velocity. The refer- Proceedings of the IEEE, Special Issue on Engineerings Ap-
ence velocity is given by plications of Fuzzy Logic; IEEE: New York, 1995; Vol. 83, No.
3, pp 378-406.
xwref(xw) ) -KIT0(1 - e-|xw|/R) sign(xw) (38) Moore, R. L. Neutralization of Waste Water by pH. Control;
Instrument Society of America: Pittsburgh, 1978; pp 10-17,
where KI is the controller factor, T0 is the time interval 37-38.
between data gathering, and R is the time constant of Nie, J.; Loch, A. P.; Hang, C. C. Fuzzy modeling of nonlinear pH
processes through neural approach. Proceedings of the Third
the reference model. IEEE Conference on Fuzzy Systems. IEEE World Congress on
Integral Correction Gain. After each measure- Computational Intelligence; IEEE: New York, 1994; Vol. 2, pp
ment and following calculation of reference velocity, the 1224-1229.
controller gain is corrected: Qin, S. J.; Borders, G. A multiregion fuzzy logic controller for

( )
nonlinear process control. IEEE Trans. Fuzzy Syst. 1994, 2 (1),
KR(k) xwref(xw(k)) - xw(k) 74-81.
) a0 (39) Palancar, M. C.; Aragon, J. M.; Miguens, J. A. Control of the pH
KR(k-1) xwref(xw(k)) of waste water by means of finite-stage regulators. European
Meeting on Chemical Industry and Environment; Palahi: Gi-
KR(k) ) KR(k-1) + KR(k) (40) rona, Spain, 1993; Vol. 2, pp 79-87.
Parekh, M.; Desai, M.; Hua Li; Rhinehart, R. R. In-line control of
xw(k) ) 0 if sign(xw(k) xw(k)) ) 1 nonlinear pH neutralization onf fuzzy logic. IEEE Trans.
Components, Packag. Manuf. Technol. 1994, 17 (2), 192-201.
xw(k) ) xw(k) if sign(xw(k) xw(k)) ) -1 (41) Proll, T.; Karim, N. M. Model-predictive pH control using real-
time NARX approach. Process Syst. Eng. 1994, 40 (2), 269-
By using the integral correction, the controller gain 282.
increases as the controlled pH variable moves away Riggs, J. B.; Rhinehart, R. Russell: Method for pH-control in
wastewater treatment. US Patent 4940551, July 10, 1990.
from the pH set point and also as it approaches it more Stumn, W.; Morgan, J. J. Aquatic Chemistry; John Wiley and
slowly than the established reference velocity. The Sons: New York, 1970; pp 102-108.
controller gain always decreases when the pH ap- Yamakawa, T. A fuzzy logic controller. J. Biotechnol. 1992, 1-32.
proaches the pH set point more rapidly than the
reference velocity.
The values of the fixed parameters used in the
simulations were Received for review October 25, 1995
Revised manuscript received December 30, 1996
q1 ) -1.63 q2 ) 0.666 a0 ) 0.3 Accepted December 31, 1996X
KI ) 0.01 R ) 0.3 IE950654U
Literature Cited
Aragon, J. M.; Palancar, M. C.; Miguens, J. A. Adaptive control
system for the regulation of the pH of waste water. European
X Abstract published in Advance ACS Abstracts, March 15,
Meeting on Chemical Industry and Environment; Palahi: Gi-
rona, Spain, 1993; Vol. 2, pp 69-77. 1997.

S-ar putea să vă placă și