You are on page 1of 15

Australian Journal of Basic and Applied Sciences, 4(12): 6331-6345, 2010

ISSN 1991-8178

A Simplified PID-like ANFIS Controller Trained by Genetic Algorithm to Control
Nonlinear Systems
1
O.F. Lutfy,
1
S.B. Mohd Noor,
1
M.H. Marhaban and
2
K.A. Abbas
1
Electrical and Electronic Engineering Dept., Faculty of Engineering,
2
Food Technology Dept., Faculty of Food Science & Technology, Universiti Putra Malaysia,
Serdang 43400, Selangor, Malaysia.
Abstract: This paper proposes a simplified ANFIS (Adaptive Neuro-Fuzzy Inference System) structure
acting as a PID-like feedback controller to control nonlinear systems. Only few rules have been
utilized in the rule base of this controller to provide the control actions, instead of the full
combination of all possible rules. The proposed controller has several advantages over the conventional
ANFIS structure particularly the reduction in execution time and memory resources without sacrificing
the controller performance, and hence, it is more suitable for real time control. In addition, the real-
coded Genetic Algorithm (GA) has been utilized to train this ANFIS controller, instead of the hybrid
learning methods that are widely used in the literature, and hence, the necessity for the teaching signal
required by other techniques has been eliminated. Moreover, the GA was used to find the optimal
settings for the input and output scaling factors for this controller, instead of the widely used trial and
error method. Three nonlinear systems, including the CSTR (Continuous Stirred Tank Reactor), have
been selected to be controlled by this controller to demonstrate its accuracy and generalization ability.
In addition, this controller robustness to output disturbances has been also tested and the results clearly
indicated the remarkable performance of this controller. The result of comparing the performance of
this controller with a conventional ANFIS controller and a conventional PID controller has shown the
superiority of the proposed ANFIS structure.
Key words: neuro-fuzzy systems, ANFIS, genetic algorithms, conventional PID controller.
INTRODUCTION
Fuzzy logic (FL) has been successfully applied in many challenging control applications. However, the
design of an effective fuzzy controller includes several problems, particularly, the selection of suitable
membership functions (MFs) and fuzzy if-then rules and moreover how to optimize these MFs and rules in
order to achieve the desired performance. On the other hand, artificial neural networks (ANNs) have been
employed in solving various kinds of control problems. However, ANNs suffer from some problems like their
black-box nature and the difficulty in deciding the proper network structure and size to solve a given problem.
In order to overcome the limitations of each of these techniques, the integration of both FL systems and ANNs
has received much attention in the literature and resulted in the appearance of a rapidly emerging field of
neuro-fuzzy systems.
One of the most widely used neuro-fuzzy systems is the ANFIS network, which was proposed by Jang,
(1993, 1997). The ANFIS is a fuzzy inference system (FIS) implemented in the framework of an adaptive
fuzzy neural network, and is a very powerful approach for building complex and non-linear relationships
between a set of input and output data.
ANFIS modeling for a specific application includes two phases, namely; structure identification and
parameter optimization. Structure identification involves selecting the number of MFs and fuzzy rules in the
ANFIS structure in order to achieve the desired performance. On the other hand, parameter optimization is in
charge of finding the optimum values for all the parameters in the premise and consequent parts of the final
ANFIS structure.
Structure identification techniques can be classified into two main types based on the input space
partitioning method; namely, grid partitioning and cluster-based partitioning. In grid partitioning Jang, (1993,
1995, 1997) fuzzy rules are generated by enumerating all possible combinations of the input MFs for all the
Corresponding Author: O.F. Lutfy, Electrical and Electronic Engineering Dept., Faculty of Engineering,
6331
Aust. J. Basic & Appl. Sci., 4(12): 6331-6345, 2010
input variables. This partitioning method leads to an exponential explosion in the number of rules in the
ANFIS structure even when the number of inputs is moderately large. This relationship between ANFIS
dimensionality and the number of rules is one of the major drawbacks of a conventional fuzzy approach that
is commonly referred to as the curse of dimensionality.
In order to mitigate this problem, the cluster-based partitioning of the input space has been proposed for
identifying a more compact ANFIS structure. In this technique, the input space is partitioned, based on the
distribution of training data, into clusters which will decide the initial MFs shapes and the number of fuzzy
rules. Several clustering techniques have been proposed in the literature. The main difference among these
techniques lies in the method adopted to partition the input space. Examples of these clustering methods
include hard c-means (HCM) clustering, fuzzy c-means (FCM) clustering, and subtractive clustering (Jang,
J.S.R., C.T. Sun and E. Mizutani, 1997; Wang, J.S. and C.S.G. Lee, 2001; Gonzalez, J., 2002; Chiu, S.L.,
1994).
However, all these methods are off-line clustering techniques which assume the availability of the input-
output data in advance. In control systems, these data are only available on-line and hence the on-line
clustering techniques (Juang, C.F. and C. Lo, 2008; Ferreyra, A. and W. Yu, 2004; Yu, W. and X. Li, 2009)
are more suitable to partition the input space.
A disadvantage of these on-line clustering methods is that they include some parameters whose values
must be set in advance by the user using some trade-off between the final modeling accuracy and the execution
speed of the clustering algorithm. In addition, such techniques will add additional computational complexity
to the overall ANFIS modeling process.
A different strategy in dealing with ANFIS structure identification problem has been proposed in
(Jovanovic, B.B., 2004) by reducing the number of fuzzy rules in the ANFIS structure without using any
clustering method. In particular, the researchers used p.n rules, where n is the number of input variables and
p is the number of fuzzy sets for each input variable, instead of the p
n
rules of the conventional ANFIS
structure. They used this modified ANFIS structure, which they called MANFIS, in time series prediction. Zhai
et al. (2009) applied the above mentioned structure, MANFIS, to model the dynamic nonlinear characteristics
of power amplifiers with memory effects.
Another partitioning strategy, without using clustering methods, was proposed by Liu et al. (2002). They
used only p rules in the rule layer of the ANFIS structure. In addition, they updated the consequent parameters
of this structure on-line, while the antecedent parameters were kept fixed. They applied this ANFIS structure
in time series prediction.
This work follows this research direction by reducing the number of rules in the ANFIS structure to be
equal to p rules, without using any on-line optimization as the one used in (Liu, F., 2002) and without using
any clustering technique to find the number of rules. In addition, this ANFIS structure is used as a feedback
controller and not as a predictor as used in (Liu, F., 2002).
Moreover, to avoid the necessity of the teaching signal, required in other optimization techniques, the GA
is used to optimize all the parameters in this ANFIS structure, along with the input and output scaling factors
for this controller.
In order to reduce the number of parameters to be optimized by the GA, the zero-order Sugeno fuzzy
model is utilized in which the consequent of a rule is specified by a singleton.
The rest of the paper is organized as follows. In section 2, the ANFIS structure is reviewed and the
proposed ANFIS controller is presented. The implementation of the real-coded GA and its operators are
discussed in section 3. The proposed genetic learning for the ANFIS controller is given in section 4. The
simulation results of controlling several non-linear systems are presented in section 5. Finally, section 6
presents the conclusions.

2. Structure of the PID-like ANFIS Controller:
The structure of the PID-like ANFIS controller is depicted in Fig. 1 (Lutfy, O.F., 2009). As can be seen,
this structure has a total of five layers, and each of these layers performs a defined task to achieve the overall
fuzzy inference system. In order to describe this ANFIS structure, let , , and represent the three
1
x
2
x
3
x
input variables e, e, and e, respectively, and y represents the single output variable u of this controller,
where e is the error of the plant being controlled, e is its rate of change, e is the summation of errors, and
u is the output control action of this ANFIS controller.
6332
Aust. J. Basic & Appl. Sci., 4(12): 6331-6345, 2010
Fig. 1: Structure of the conventional PID-like ANFIS controller.
Seven fuzzy linguistic terms are used for each input variable, let the set {A
1
, A
2
, A
3
, A
4
, A
5
, A
6
, A
7
}
represents these terms, where A
1
, A
2
, A
3
, A
4
, A
5
, A
6
, and A
7
represent negative big, negative medium, negative
small, zero, positive small, positive medium, and positive big, respectively.
A typical Sugeno fuzzy rule can be expressed in the following form:
If is A
a1
and is A
a2
and is A
a3
Then y=k
0
+k
1
+k
2
+k
3
, where a1, a2, a3 {1, 2, 3, 4, 5, 6, 7}.
1
x
The consequent part of the above rule, y, can be either a constant or a linear function of the input
variables. In the former case a zero-order Sugeno fuzzy model is obtained, in which the consequent of a rule
is specified by a singleton, while in the latter case a first-order Sugeno model is obtained as in the above rule.
As mentioned before, the zero-order Sugeno fuzzy model is used in this work. This selection was made
in order to reduce the number of parameters to be optimized by the GA in the consequent part of the ANFIS
structure from 1372 genes in the case of a first-order Sugeno fuzzy model into 343 genes in the case of the
zero-order model of the conventional ANFIS structure. Furthermore, only seven of these parameters are
required for the simplified ANFIS structure in this work. From the simulation results of section 5, it can be
concluded that the zero-order model has achieved a satisfactory performance, which justify the selection of this
model.
In order to describe the function of each layer in Fig. 1, the output of the i
th
node in layer k will be
expressed as O
k,i
in the following (Jang, J.S.R., C.T. Sun and E. Mizutani, 1997; Lutfy, O.F., 2009):
Layer 1:
All nodes in this layer are adaptive nodes, and they generate the degree of membership for each of the
three input variables. The node function is:
(1)
7
14
1, 1
1, 2
1, 3
( ), 1, 2,..., 7
( ), 8, 9,...,14
( ), 15,16,..., 21
i
i
i
i A
i A
i A
O x i
O x i
O x i

= =
= =
= =
6333
Aust. J. Basic & Appl. Sci., 4(12): 6331-6345, 2010
The membership functions of A
a
, a = 1, 2, , 7, for each input variable are chosen to be bell-shaped
activation functions. Only two parameters have been used for each of these functions instead of the widely
used generalized bell function, which uses three parameters, in order to reduce the number of parameters to
be optimized by the GA. These bell-shaped functions can be represented by:
(2)
2
( ) exp 1/ 2( )
k
a
a k
a
x
k A
A k x
A
x C
x
o
| |
= |
|
\ .
where x
k
, k{1,2,3}, represents the scaled input variables after they have been multiplied by the input scaling
factors (c
1
for the error, c
11
for its rate of change, and c
111
for the summation of errors, as shown in Fig. 1).
and are the centers and widths of these bell-shaped functions, respectively, and they are referred
k
a
x
A
C
k
a
x
A
o
to as the premise parameters of the ANFIS structure.
Layer 2:
Each node in this layer is a circle node, not adaptive, labeled . These nodes perform the multiplication
operation for fuzzy inferencing. The number of all possible antecedent combination is 343, and the total
number of rules is 343. Therefore, there are 343 nodes in this layer. Each node output represents the activation
level of a rule:
(3)
1 2 3
2, 1 2 3
( ) ( ) ( )
a a a
i i A A A
O w x x x = =
where i=1, 2, , 343 and a1,a2,a3, {1,2,3,4,5,6,7}. The output of each node in this layer represents the firing
strength of the rule.
Layer 3:
This layer has the same number of nodes as layer 2. Each node in this layer is also a fixed node labeled
N. The i
th
node calculates the ratio of the i
th
rule's firing strength to the sum of all rule's firing strengths:
(4)
3, 343
1
i
i i
j
j
w
O w
w
=
= =
_
where i=1, 2, , 343. The outputs of this layer are called the normalized firing strengths.
Layer 4:
Similar to layers 2 and 3, there are 343 nodes in this layer. All the nodes are adaptive nodes. The outputs
of this layer are generated by multiplying the normalized firing strengths from the corresponding nodes in layer
3 by the consequent parameters (k
0i
, i=1,2, , 343) of the zero-order ANFIS. The output of each node is:
(5)
4, 0 i i i
O w k =
where i=1, 2, , 343, and is the output of layer 3.
Layer 5:
The single node in this layer computes the overall output as the summation of all incoming signals:
(6)
343
5 4,
1
i
i
O O
=
=
_
And finally, in order to obtain the output of the ANFIS controller, O
5
is multiplied by a factor c
2
, which
represents the output scaling factor of this controller:
6334
Aust. J. Basic & Appl. Sci., 4(12): 6331-6345, 2010
(7)
2 5
y u c O = =
Equation 7 above can be written in more detail as:
(8)
2
0 1
1
2
2
1
1
( )
exp 1/ 2
( )
exp 1/ 2
j
a
j
a
j
a
j
a
x
R
j j A n
i j x
i
A
x
R
j j A n
j x
i
A
c x C
k
y u c
c x C
o
o
=
=
=
=
( | |
| |

( |
[ |
| ( |
\ .
\ . (
= =
(
| |
| |

(
|
[ |
(
| |
\ .
(
\ .
_
_
where R=343, n=3, and c
j
, j = 1,2,3, represents the three input scaling factors c
1
, c
11
, and c
111
in Fig. 1,
respectively.
2.1 The Proposed Simplified PID-like ANFIS Controller:
A conventional fuzzy reasoning system, with n inputs each partitioned into p fuzzy sets, requires p
n
rules.
If certain human expertise are available, they can be used to determine the ANFIS structure, however, these
information are not always available. Therefore, it is better to utilize the full combination of rules in the
ANFIS structure (Jovanovic, B.B., 2004). In this structure the total number of fitting parameters is:
F(n,p,m)=n.p.m+p
n
.(n+1) for the first-order sugeno model (9)
F(n,p,m)=n.p.m+p
n
for the zero-order sugeno model (10)
where m is the number of fitting parameters per membership function. As mentioned before, the zero-order
sugeno model will be used in this work. So if three inputs are used, seven fuzzy sets per input, and two fitting
parameters per membership function, then the resulting number of parameters will be 385. Of course, with this
number of parameters, it will not be an easy task for any optimization technique to find the optimal values
for these parameters in terms of accuracy and computational complexity. The so called curse of
dimensionality can be clearly concluded from the p
n
term in the above equations, so special care must be
taken before choosing the number of input variables and the number of membership functions for each of these
inputs.
In this work, in order to overcome the dimensionality problem, the ANFIS structure shown in Fig. 2 is
proposed. In this structure, only seven rules have been utilized in the rule layer instead of the 343 rules used
in the conventional structure. Referring to Fig. 2, the output of layer two will be expressed by:
(11)
2, 1, 1, 7 1, 14
1, 2,..., 7
i i i i
O O O O i
+ +
= =
Accordingly, layers three and four will have only seven nodes, as shown in Fig. 2. Therefore, the total
number of parameters required to represent this structure will be 49 parameters, instead of the 385 in the
standard case. As will be seen in section 5, this change will dramatically reduce the computing time without
sacrificing the controller performance.
3. Implementation of the Real-coded GA:
For the implementation of the real-coded GA, MATLB software was used in this work by writing a
specific code to train the ANFIS controller without using the GA or the fuzzy logic toolboxes. Each
chromosome used for the conventional ANFIS controller contains 389 genes (385 fitting parameters plus 4
scaling factors), while only 53 genes (49 fitting parameters plus 4 scaling factors) were required for the
simplified ANFIS controller.
In order to achieve a fair comparison, the same real-coded GA was used to train both the conventional
and the simplified ANFIS controller.
6335
Aust. J. Basic & Appl. Sci., 4(12): 6331-6345, 2010
3.1 Operators of the Real-coded GA:
In this section, the operators of the real-coded GA used in this work are briefly explained.
Fig. 2: Structure of the proposed PID-like ANFIS controller.
3.1.1 Hybrid Selection:
This selection method (Al-Said, I.A.M., 2000) is a combination of Roulette Wheel and deterministic
selection. For a particular generation in this method, only those chromosomes that have better fitness values
than the worst individual in the old population are accepted in the new population. This method is expected
to ensure good guidance in the complex and nonlinear search space.
3.1.2 Elitism:
In this operation, the best n parents (in this work the best two) from the current generation are copied
directly into the next generation as they are. This approach prevents the best fitness value in a given generation
from becoming worse than that in the previous generation (Lutfy, O.F., 2009; Mitchell, M., 1998).
3.1.3 Crossover:
In the real-coding crossover operator, which is similar to that of binary coding, a pair of mating
chromosomes exchanges information by exchanging a subset of their components, where an integer position
k is selected uniformly at random along the chromosome length. Then two new chromosomes are created by
swapping all the genes between positions k+1 and L, where L is the chromosome length (Lutfy, O.F., 2009;
Mitchell, M., 1998). Note that this operation does not change the values of genes in the chromosomes.
For example, the pair of chromosomes a and b as:
a=[2,5,1,7,4,3,8]
b=[7,9,3,2,6,5,1]
are crossed over at the third digit position to yield:
a=[2,5,3,2,6,5,1]
b=[7,9,1,7,4,3,8].
6336
Aust. J. Basic & Appl. Sci., 4(12): 6331-6345, 2010
3.1.4 Mutation:
This operation causes random changes in the components of the chromosomes in the new population. In
binary-coding GA, this operator randomly flips some of the bits in chromosomes. For example, the
chromosome 00010 might be mutated in its second position to yield 01010. In real-coded GA this operator
is adapted by simply replacing the mutated gene with another random number chosen in the same range
assigned for that gene (Lutfy, O.F., 2009). As an example, the chromosome c=[5,8,1,4,2,9,3] is mutated at
the fifth gene to yield:
c=[5,8,1,4,6,9,3].
4. The proposed Genetic Learning for the ANFIS Controller:
The following genetic procedure has been adopted for training both the conventional and the simplified
ANFIS controllers:
Step 1:
Initialize the genetic operators: the crossover probability Pc, the mutation probability Pm, the population
size, and the maximum number of generations.
Step 2:
Generate randomly the initial population within certain bounds, in which each individual represents the
entire antecedent and consequent parameters along with the input and output scaling factors of a single
controller.
Step 3:
Evaluate the objective function for each individual in the population using the Integral Square of Errors
(ISE) criterion, which has the following form:
(12)
2
0
0.5 0.5 ( )
T
k
ISE e k
=
=
_
where e(k) is the error between the desired output and the plant output at sample k, and T is the observation
time. Then, for each individual, calculate the fitness function using the Darwinian fitness equation of the form:
(13)
1
fitness
objective function c
=
+
whereis a small constant chosen to avoid division by zero.
Step 4:
Put in descending order all the chromosomes in the current population (i.e. the first one is the fittest).
Then apply Elitism strategy described in section 3.1.2.
Step 5:
Select two individuals by using the hybrid selection method, and then apply the real-coded genetic
operators of crossover and mutation described previously to form two new chromosomes for the new
population.
Step 6:
Stop if the maximum number of generations is reached, otherwise increment the generations counter by
one and go to step 3.
5. Simulation Results:
Three nonlinear plants are selected to be controlled by the simplified ANFIS controller in order to assess
its performance in terms of control accuracy, generalization ability, and disturbance rejection. As mentioned
before, the ANFIS network is used as a feedback controller as shown in Fig. 3.
In order to evaluate the generalization ability of this controller, two different reference signals were used
for each plant, the first signal is a training signal to optimize the controller parameters, while the second signal
6337
Aust. J. Basic & Appl. Sci., 4(12): 6331-6345, 2010
is a test signal to evaluate how well the controller has been trained in the training phase. The training signal
for plants 1 and 2 has the following definition:
(14)
0.4 0 51
0.6 51 101
( )
0.4 101 151
0.4 151 200
train
k
k
r k
k
k
s <

s <

s <

s s

while the optimized individual (controller) in the GA is tested by the following test signal:
(15)
2
0.5*sin( ) 0 67
66
( ) 0.4 67 134
0.6 134 200
test
k
k
r k k
k
t
s <

= s <

s s

Fig. 3: Block diagram of the control system, where the PID-like ANFIS network is used as a feedback
controller.
The universe of discourse (U.O.D.) for all the input MFs are selected to be from 6 to 6 (another range
can also be selected since there are input and output scaling factors).
The parameters of the real-coded GA are set to the following values:
Population size: 50
Maximum number of generations: 300
Pc (crossover probability): 0.8
Pm (mutation probability): 0.05
These parameter values were found to be suitable for the current application after many simulation tests.
The nonlinear plants used in this work are:
Plant 1 (Narendra, K.S. and K. Parthasarathy, 1990):
This is a nonlinear (in both input and output) plant, having the following difference equation:
(16)
3
2
( )
( 1) ( )
1 ( )
y k
y k u k
y k
+ = +
+
Fig. 4 shows the output response, control signal, best 0.5ISE against the generations, learned MFs of error,
change of error and summation of errors for this plant.
From Fig. 4-a, it is obvious that the simplified ANFIS controller has done well in controlling this nonlinear
plant in terms of tracking ability to the test signal which indicates the good generalization ability of this
controller. The small steady-state error in the sinusoidal part can be attributed to the absence of this part in
the training signal of equation (14), however, the steady-state error was zero for the other parts of the test
signal.
6338
Aust. J. Basic & Appl. Sci., 4(12): 6331-6345, 2010
Fig. 4-b shows the control signal from this controller to deal with the different parts of the test signal.
Fig. 4: Plant 1 (a) Output response (b) Control signal (c) Best 0.5ISE (d) Learned MFs of "error" (e) Learned
MFs of "change of error" (f) Learned MFs of "summation of errors".
6339
Aust. J. Basic & Appl. Sci., 4(12): 6331-6345, 2010
The choice of the maximum number of generations to be 300 seems to be adequate since the 0.5ISE has
reached its near optimal value in less than the early 50 generations as can be seen from Fig. 4-c. This fast
convergence for the 0.5ISE is almost the same for all the plants in this work, hence, this graph will not be
shown for the remaining plants due to space limitations.
Figures 4-d, 4-e, and 4-f show the genetically optimized shapes of the input MFs for the three input
variables to the ANFIS controller.
Plant 2 (Pham, D.T. and L. Xing, 1997):
This is also a nonlinear plant with the following difference equation:
(17)
2
( 1)
( ) 0.3 ( 2) 0.5 ( 1)
1.5 ( 1)
y k
y k y k u k
y k

= +
+
The simulation results for this plant are shown in Fig. 5. Fig. 5-a shows the remarkable performance of
the simplified ANFIS controller in tracking the test signal, while Fig. 5-b shows the corresponding control
signal from the controller.
Fig. 5: Plant 2 (a) Output response (b) Control signal.
In order to further confirm the generalization ability of the proposed controller, another, more difficult,
test signal was used for this plant. This test signal is a combination of two sinusoidal signals as shown in Fig.
6-a, which shows the notable generalization ability of this controller to deal with situations not encountered
during the training phase. The corresponding control signal is shown in Fig. 6-b.
5.1 Robustness Test:
In order to establish how robust the simplified ANFIS controller is to environmental changes that might
encounter the control system, the controller behavior in the presence of external bounded disturbances is tested
in this section. This test was conducted on plant 2 by applying bounded external disturbances of 30% of the
plant output in only the test phase using equation (15), while in the training phase, equation (14), these
disturbances are not included, which means that the controller is not trained to deal with these disturbances.
The first disturbance is applied for 30 samples at the interval (85< k < 144), while the second disturbance is
applied for 30 samples at the interval (150 < k < 179) in the test signal of equation (15).
Fig. 7 shows the simulation results of this test, where the adaptation of the control actions to eliminate
the effects of the disturbances can be clearly seen in Fig. 7-b. From Fig. 7-a, it can be seen that the
convergence to the test signal is achieved with zero steady-state error during the presence of these disturbances
and after their absence. This result clearly indicates the good ability of the simplified ANFIS controller in
dealing with external disturbances.
6340
Aust. J. Basic & Appl. Sci., 4(12): 6331-6345, 2010
Fig. 6: Plant 2 with a different test signal (a) Output response (b) Control signal.
Fig. 7: Plant 2 subjected to 30% external disturbances (a) Output response (b) Control signal.
5.2 Comparative Study with a Conventional ANFIS Controller:
It is important here to compare the performance of the simplified ANFIS controller, described in section
2.1, with the conventional ANFIS controller, described in section 2, in terms of control accuracy and execution
time. The CSTR process, which exhibits highly nonlinear dynamical behavior, is used to conduct this
comparative study. A schematic diagram of the CSTR process is shown in Fig. 8. The model of this process
consists of the following two nonlinear ordinary differential equations (Nahas, E.P., 1992):
(18)
0
0
( ) exp ,
( )
( ) exp 1 exp ( )
A AF A A
c c
A
f c cf
c c c
q E
C C C k C
V RT
C
H k C q E hA
T T T q T T
V C RT C V q C


-
-
| |
=
|
\ .
( | |
A | |
= + + ( |
|
|
\ .
(
\ .
where C
A
is the product concentration of component A, T is the reactor temperature, q is the feed flowrate,
and q
c
is the coolant flowrate. The objective is to control C
A
by manipulating q
c
. The values used for the
parameters of this model, defined in nominal operating conditions, are shown in Table 1.
6341
Aust. J. Basic & Appl. Sci., 4(12): 6331-6345, 2010
Table 1: Nominal CSTR operating conditions.
Parameter Description Nominal value
q Process flow-rate 100 l min
-1
C
AF
Inlet feed concentration 1 mol l
-1
T
f
Feed temperature 350 K
T
cf
Inlet coolant temperature 350 K
V Reactor volume 100 l
hA Heat transfer coefficient 710
5
cal min
-1
. K
-1
k
0
Reaction rate constant 7.210
10
min
-1
E/R Activation energy 9.9510
3
K
H Heat of reaction -210
5
cal mol
-1
,
c
Liquid densities 1000 g l
-1
C

, C
c
Specific heats 1 cal g
-1
. K
-1
q
c
Coolant flow-rate 103.41 l min
-1
T Reactor temperature 440.2 K
C
A
Product concentration 8.3610
-2
mol l
-1

Fig. 8: Continuous stirred tank reactor.
The fourth order Runge-Kuta method was utilized in order to numerically solve this continuous time model
using a simulation step size of 0.1 seconds. The real-coded GA was set to the same values used before for
plants 1 and 2.
Fig. 9 shows the CSTR output response controlled by the simplified ANFIS controller (solid line) and by
the conventional ANFIS controller (dashed line). From this figure, it is clear that the simplified ANFIS
controller has achieved better performance compared to the conventional ANFIS controller. In terms of control
accuracy, the simplified controller has caused less overshoots and oscillations than the conventional controller.
This superiority of the simplified controller can be explained by considering the large number of parameters
(389 parameters) to be optimized in the conventional ANFIS controller against only 53 parameters for the
simplified ANFIS controller. Moreover, in terms of computing time, the conventional controller required 436.82
seconds, while the simplified controller took only 71.36 seconds.
Table 2 summarizes the results of comparing the proposed controller with the conventional ANFIS
controller to control the previous plants. The results in table 2 clearly confirm the remarkable performance of
the proposed controller in terms of accuracy and computing time. Hence, it is a better candidate for real time
control than the conventional ANFIS controller.
5.3 Comparative Study with a Conventional PID Controller:
Since the simplified PID-like ANFIS controller can be considered as the intelligent version of the
conventional PID controller, it is important to compare their performances to demonstrate the improvement
resulted from the nonlinear nature of the intelligent controller. Again the CSTR process is used to conduct this
comparison. The conventional PID controller used in this study is described by the following discrete equation
(Mikles, J. and M. Fikar, 2007).
(19)
2
( ) ( ) 1 (( 1) ) 1 (( 2) )
s D D D
s c s s s
I s s s
T T T T
u kT K e kT e k T e k T
T T T T
( | | | |
A = + + + +
( | |
\ . \ .
6342
Aust. J. Basic & Appl. Sci., 4(12): 6331-6345, 2010
Table 2: Comparison results of the simplified and the conventional ANFIS controllers.
Controlled Plant Simplified ANFIS Controller Conventional ANFIS Controller
---------------------------------------------------------- -------------------------------------------------------------
0.5ISE Time (sec.) 0.5ISE Time (sec.)
Plant 1 0.448 51.16 0.452 312.21
Plant 2 0.442 51.40 0.443 306.90
CSTR 0.000161 71.36 0.000222 436.82
Fig. 9: CSTR output response controlled by the proposed ANFIS controller (solid line), and by the
conventional ANFIS controller (dashed line).
Fig. 10: CSTR output response controlled by the proposed ANFIS controller (solid line), and by the
conventional PID controller (dashed line).
where , K
c
, T
D
, T
I
, and T
s
are the proportional gain, derivative time, integral ( ) ( ) (( 1) )
s s s
u kT u kT u k T = A +
time, and the sampling time, respectively.
In order to achieve a fair comparison, the same real-coded GA with the same settings, used to train the
ANFIS controller, is used to tune the PID parameters. However, due to the complexity of the process, the PID
controller required 1000 generations, while only 300 generations were enough for the ANFIS controller. Fig.
10 clearly shows the superiority of the ANFIS controller compared to the PID controller, keeping in mind that
the training signal is different from the test signal in the case of the ANFIS controller due to its generalization
ability, while the training and test signals were the same for the PID controller.
6. Conclusions:
In this paper, a simplified ANFIS structure acting as a PID-like feedback controller has been proposed to
control nonlinear systems. Only few rules have been utilized in the rule base of this controller to provide the
6343
Aust. J. Basic & Appl. Sci., 4(12): 6331-6345, 2010
control actions, instead of the full combination of all possible rules. Reduction in execution time and memory
resources are the main advantages of this controller compared with the conventional full-rules ANFIS controller
without sacrificing the controller performance and hence, it is more suitable for real time control applications.
Based on minimizing the 0.5ISE criteria, the real-coded GA has been utilized to train this ANFIS controller,
instead of the hybrid learning methods that are widely used in the literature, and hence, the necessity for the
teaching signal required by other techniques has been eliminated. Moreover, the GA was used to find the
optimal settings for the input and output scaling factors for this controller, instead of the widely used trial and
error method. In order to reduce the number of parameters to be optimized by the GA, only two parameters
have been used for the bell-shaped membership functions in the premise part of each rule. Moreover, the zero-
order Sugeno fuzzy model is used in order to reduce the number of consequent parameters to be optimized
by the GA in layer four of the ANFIS structure from 1372 genes in the case of a first-order Sugeno fuzzy
model into 343 genes in the case of the zero-order model, keeping in mind that only seven genes are required
for the simplified ANFIS structure used in this paper. From the simulation results of section 5, it can be
concluded that the zero-order model has achieved a satisfactory performance which justify the selection of this
model.
The simulation results showed the effectiveness of the simplified PID-like ANFIS controller in terms of
tracking accuracy to the desired output with zero steady-state error, reduction in computational time, and
generalization ability. The robustness test clearly indicated the notable performance of the simplified controller
in dealing with external disturbances during their presence and after their absence. In addition, the result of
comparing the performance of the simplified ANFIS controller with a conventional ANFIS controller and a
conventional PID controller has shown the superiority of the proposed controller.
REFERENCES
Al-Said, I.A.M., 2000. Genetic Algorithms Based Intelligent Control. Ph.D. Thesis, University of
Technology, Baghdad-Iraq.
Chiu, S.L., 1994. Fuzzy Model Identification Based on Cluster Estimation. Journal of Intelligent and Fuzzy
Systems, 2: 267-278.
Ferreyra, A. and W. Yu, 2004. On-ine Fuzzy Neural Modeling with Structure and Parameters Updating.
In the IEEE International Conference on Computational Intelligence for Measurement Systems and Applications,
pp: 127-132.
Gonzalez, J., I. Rojas, H. Pomares, J. Ortega and A. Prieto, 2002. A New Clustering Technique for
Function Approximation. IEEE Transactions on Neural Networks, 13(1): 132-142.
Jang, J.S.R., 1993. ANFIS: Adaptive-Network-based Fuzzy Inference System. IEEE Transactions on
Systems, Man and Cybernetics, 23(3): 665-685.
Jang, J.S.R., C.T. Sun and E. Mizutani, 1997. Neuro-Fuzzy and Soft Computing: A Computational
Approach to Learning and Machine Intelligence. Prentice-Hall, Inc.
Jang, J.S.R. and C.T. Sun, 1995. Neuro-Fuzzy Modeling and Control. Proceedings of the IEEE, 83(3): 378-
406.
Juang, C.F. and C. Lo, 2008. Zero-order TSK-type Fuzzy System Learning Using a Two-Phase Swarm
Intelligence Algorithm. Fuzzy Sets and Systems, 159(21): 2910-2926.
Jovanovic, B.B., I.S. Reljin, and B.D. Reljin, 2004. Modified ANFIS Architecture - Improving Efficiency
of ANFIS Technique. In the 7th Seminar on Neural Network Applications in Electrical Engineering, pp: 215-
220.
Liu, F., R. Pei and X. Guan, 2002. A New Algorithm of Fuzzy On-line Identification for Nonlinear
Systems. In the Proceedings of the 4th World Congress on Intelligent Control and Automation, pp: 103-106.
Lutfy, O.F., S.B. Noor, M.H. Marhaban, and K.A. Abbas, 2009. A Genetically Trained Adaptive Neuro-
Fuzzy Inference System Network Utilized as a Proportional-Integral-Derivative-like Feedback Controller for
Non-linear Systems. Proc. IMechE, Part I: Journal of Systems and Control Engineering, 223(3): 309-321.
Mitchell, M., 1998. An Introduction to Genetic Algorithms. First MIT Press Paperback Edition, Cambridge.
Mikles, J. and M. Fikar, 2007. Process Modelling, Identification, and Control. Springer-Verlag, Berlin,
Heidelberg.
Narendra, K.S. and K. Parthasarathy, 1990. Identification and Control of Dynamical Systems Using Neural
Networks. IEEE Transactions on Neural Networks, 1(1): 4-27.
Nahas, E.P., M.A. Henson and D.E. Seborg, 1992. Nonlinear Internal Model Control Strategy for Neural
Network Models. Computers Chem. Eng., 16(12): 1039-1057.
6344
Aust. J. Basic & Appl. Sci., 4(12): 6331-6345, 2010
Pham, D.T. and L. Xing, 1997. Neural Networks for Identification, Prediction and Control. Springer-
Verlag, 3
rd
Printing, London.
Wang, J.S. and C.S.G. Lee, 2001. Efficient Neuro-Fuzzy Control Systems for Autonomous Underwater
Vehicle Control. In the Proceedings of 2001 IEEE International Conference on Robotics and Automation, pp:
2986-2991.
Yu, W. and X. Li, 2009. Online Fuzzy Modeling with Structure and Parameter Learning. Expert Systems
with Applications, 36(4): 7484-7492.
Zhai, J., J. Zhou, L. Zhang, J. Zhao and W. Hong, 2009. The Dynamic Behavioral Model of RF Power
Amplifiers with the Modified ANFIS. IEEE Transactions on Microwave Theory and Techniques, 57(1): 27-35.
6345

You might also like