You are on page 1of 4

FUZZY LOGIC CONTROL OF A pH NEUTRALIZATION PROCESS

Ranganath Muthu Elamin El Kanzi

Department of Chemical Engineering


University of Bahrain
rmuthu@eng.uob.bh elkanzi@eng.uob.bh

ABSTRACT 2. THE pH NEUTRALIZATION PROCESS

In this paper, fuzzy logic control of a pH neutralization pH control is a common issue in many industrial
process is attempted. The pH neutralization process is a processes. The basic idea is to control the pH variations
classic example of a highly nonlinear system. For in some liquid flow, usually making the pH as close to I
nonlinear systems, fuzzy logic control provides a better as possible. This influent liquid flows into a tank, where
alternative to the classical proportional plus integral (PI) it is mixed with an amount of a concentrated reagent to
controller. Both the controllers namely the PI controller alter its pH. If the effluent is acidic with a pH of 4, the
and fuzzy logic controller (FLC) are designed for a reagent would be basic with a pH larger than 10. The
simulated pH neutralization process. It is shown that the reagent is more concentrated than the effluent, since it is
FLC is able to control the pH neutralization process desirable to add as little volume to the effluent as
better. The simulation is performed in the MATLAB possible.
environment using Simulink and Fuzzy Logic Toolbox. The pH is controlled in a tank - the influent flows
into the top of the tank, and the reagent is also added to
the top of the tank. The tank is well stirred so that the pH
is uniform throughout the tank. The effluent is pumped
1. INTRODUCTION out at the bottom of the tank, as shown in the Fig. 1.

Fuzzy Logic Controllers (FLCs) allow for a simpler


human like approach to control system design and do not
need the mathematical model as in the case of
conventional control design methods. For non-linear
systems, controlling with conventional controllers such
as PI, is difficult. FLCs provide reasonable and effective
alternatives to classical controllers. By using a linguistic
approach, fuzzy set theory can he integrated into control
theory using rules of the form, If {condition] THEN
{action}. Using enough of these rules one can create a
limctional controller. In the same way, the input
variables can be partitioned into overlapping sets that
have a linguistic correlation (i.e., large, small, very Figure 1. A pH Neutralization Process
small) to form a membership function. Most often than
not these fuzzy sets are triangular in shape. The 2.1 System Model
membership values control the degree to which each rule
From elementary mass balance considerations, it can be
firs, illustrating the interdependent relationship
shown that an appropriate state space model for the
between rule sets and membership functions [I].
strong acid-strong base system is [2]
In this paper, a fuzzy logic controller (FLC) is
designed and implemented for the highly non-linear pH
neutralization process. The performance of the FLC is
compared with the conventional proportional plus
integral (PI) controller.

0-7803-8163-7/03/$17.00 0 2003 IEEE ICECS-2003


1066
Where operations performed by a fuzzy logic (controller are as
c, is is the excess hydrogen ion concentration in follows [4,5]:
the effluent stream (moIL)
c,,(t) is the excess hydrogen ion concentration of 4.1. Fuzzification
the reagent (mol/L)
c,(t) is the excess hydrogen ion concentration in Fuzzification can be considered as a mapping 6om an
the influent stream (mol/L) observed input space to fuzzy sets. The fuzzification
u(t) is the flow rate of the reagent (Us) interface performs the following functions:
q(t) is the flow rate ofthe influent stream us) 1. Measure the values ,of input variables at each
V is the volume of the tank (L) sampling instant.
Normally, the reagent concentration is constant, and we 2. Normalizes the measured variables to within the
control the effluent pH by varying the reagent flow. The universe of discourse (UOD).UOD is the range
concentrations are excess concentrations, meaning that of values of an input variable to the FLC.
they measure the concentration of hydrogen ions in 3. Performs the function of hzzification that
excess to that found in water. We can convert an excess converts the input data into suitable linguistic
concentration C to pH using the following formula. variables.

PH = -log[ 40.25c:+ 10-l~.+OX] 4.2. Knowledge Base

(2) The howledge base of an FLC has two components


The parameter values are chosen as namely a database and a rule base.
c. : -10-2mol/L 1. The database provides necessarf definitions that
ci : 10' m o m are used to define linguistic variables and fuzzy
9 : 10Umin data manipulation in rhe FLC.
V : 83.67 L 2. The rule base characterizes the control goals and
maximum reagent flow, U : 0.025 U s control policy by means of a set of linguistic
control rules.
3. DESIGN OF PI CONTROLLER
4.3. Decision Making Logic
We assume that the tank system has a level controller
that maintains a constant liquid volume in the tank. The It determines the degree to which each measured value is
reagent flow is controlled using a simple PI controller as a member of a given labeled group. A given
shown in the Fig. 2. The control valve on the reagent measurement may he classified sirnultanmusly as
pipe has saturation, since it can be hlly open (giving a belonging to several linguistic rules. The Degree of
maximum flow rate) or fully closed (giving a minimum Fulfillment @OF) of each rule is determined by applying
flow rate of zero). We assume that the control valve the rules of Boolean Algebra 1:Union and Intersection) to
allows a maximum reagent flow rate of 1.5 W min. The each linguistic group that is part of the rule. This is done
parameters of the PI controller are chosen as K, = 0.03 for all the rules in the system. Finally,, the net control
and Ti = 0.06s by trial and error, to give the hest action is determined hy weighting the action associated
FesPonse, - - .-. .--
i .
-- ..- _I_".
-'I.!

!
With Nk by the DOF.

4.4. Defuzzification
! i
I
j I The defuzzifier converts the output fuzzy set into a crisp
solution variable. The most commonly used method of
I I defuzzification is the 'Center of Area' method that
! .~..- . --
. _..______.. -
..- -j
generates the center of gravity of the final fuzzy control
_I

Figure 2. Conventional Control System


space. It produces a result that is sensitive to all the
4. DESIGN O F FUZZY LOGIC rules. It is given hy
CONTROLLER m m
U = B cipi / x H (3)
Fig. 3 shows the block diagram of an FLC [3]. The i= 1 i= 1
components of conventional and fuzzy systems are Where
almost alike. The difference mainly being that fuzzy Ci is the value corresponding to the center of the
systems contain "fiuzifiers", "knowledge base", and output fuzzy set
"decision making logic'' and "defuzzifiers". The pi is the membership value of the output fuzzy set
U is the crisp value ofthe output variable

1067
(I..

I 0.0

:
: 0..

0.2

.* -11 .I 4.6 0 0.8 I I.5 1


Figure 3. Fuzzy Logic Conh-ol System Enno11

Figure 4(a) Membership Functions for Error


5. IMPLEMENTATION OF FLC

4.1. Fnzzifieation

4.1.1. Selection of FLC Variables


The input variables used for the FLC are
a. 'Error e(t)', which the difference between the
desired pH and the measured value of pH.
b. 'Change in Error Ae(t)', which is calculated, is
the difference between the error at the present
instant e(t) and the error at the previous instant
e(t-1).
I . . . . . , / . . I
Ae(t) = e(t) - e(-1) (4) -1 4.1 .o, 4.2 .DI 0 ..I 01 o., 0" E.

The output variable is the 'change in output Au(t)' . The S"1xaE U Ennom

FLC output is given by Figure 4(b) Membership Functions for Change in


Error
u(t) = u(t-1) + Au(t) (5)

4.1.2. Defenninafion of the Universe of Discourse


POD)
a. The UOD for error -2 pH to +2 pH.
b. The UOD for change in error is 4 . 5 pH to +0.5
PH.
c. The UOD for change in output is -0.03 Us to
+0.03 Us.

4.1.3. Selection ofLinguislic Variables


The fuzzy input and output variables, namely Error,
Change in Error and Change in Output, are divided into
seven linguistic (fuzzy) variables namely NL (h'egative
Large), NM (Negative Medium), NS (Negative Small), Figure *e) Membership Functions for Change in
ZE (Zero), PS (Positive Small), PM (Positive Medium) output
and PL (Positive Large).
Table 1 Rule Base of the FLC
4.2. Knowledge Base
E R R 0 R e(t)
4.2.1. Data Base I INL INM INS I Z E IPS IPM I P L I
The membership functions for the input and output
variables i.e. error, change in error and change in
controller output are given in Figs. 4(a) - (c).

4.2.2. Rule Base


The rules that tie the input and output variables are
given in Table 1.

1068
4.3. Decision Making Logic

In the FLC, once the appropriate rules are fired, the


degree of membership of the output fuzzy variable i.e.
change in output, is determined by encoding the
antecedent fuzzy subsets, in this case error and change
in error. The max-min implication technique is used.

4.5. Defuzzification

The commonly used 'Center of Area' method is used for


defuzzification.

6. RESULTS AND DISCUSSION


iiq
-
f

5.5

0
.... PIcD.eDI*r

IO 100 110
TI.
.
*<IO
,"..cond.
210 100 150 400

Figure 6. Servo response of controllers


6.1. Regulatory Response
Table 2. IAE for the pI Neutralization Process
Load disturbance is given hy varying the influent flow.
At t = 100 s, the influent flow is increased by 2% of its
nominal value. At t = 200 s, the influent flow is further
I CONTROLLER I CONTROL ACTION I
increased by 4% of its nominal value. At t=300 s, the
influent flow is decreased by 6% of its nominal value.
The response of the PI controller and FLC are shown
Fig. 5. The setpoint i s assumed as 7.25 pH.
From Fig. 5 , it is seen that the conventional PI
controller has more deviation of the controlled variable
fiom steady state than the F E . This is reflected in the
Integral Absolute Error (IAE) given in Table 2, which is . 7. CONCLUSION
2.585 for the PI controller and 0.991 for the FLC.
An FLC is successfully designed for a pH neutralization
6.2. Servo Response process. It is shown in this paper thal the FLC shows
better regulatory as well as :servo resplmse than the PI
The setpoint is initially varied fiom 7.25 pH to 7.75 pH wntroller.
at t = 100 s. The next variation of the setpoint is from
1.75 pH to 6.25 pH at t = 200 s. Finally, the setpoint is
vaned from 6.25 pH to 7.25 pH. The initial setpoint is REFERENCES
7.25 pH. The response of the PI controller and FLC are
r11 G.J. Klir and B. Yuan, Fuzzy Sets and Fuzzy Logic:
shown in Fig. 6.
Theory and Application', Prentice Hall ER,New Jersey,
From Fig. 6 it is seen that the servo response ofthe 1995.
FLC is slightly better than the PI controller with the IAE hnp:lcsd.new~stle.edu.aw'wnt~~simulationsl
121
for PI control being 1.179 and IAE for FLC being 0.866. ph-siml .html.
r31 D. Driankov, H. Hellendoorn and M. Reinfrank M, An
Znfroduction to Fuzzy Control, Narcs Publishing
House, New Delhi, 1996.
141 C.C. Lee, "Fuzzy logic control systems: Fuzzy logic
controller- Part I', IEEE Transaction!; on Systems, Man
and Cybernetics," Vol. 20, No. 2, pp. 404418, 1990.
[51 C.C. Lee, "Fuzzy logic in control systems: F- logic
controller - Part II," IEEE Transactions on Systems, Man
and Cybernetics, Vol. 20, No. 2, pp. 419435, 1990.

ACKNOLEDGEMEN7

The authors would like to acknowledge the financial support to


this research work by the University of Bahrain Research
Council.

1069

You might also like