You are on page 1of 4

2011 Third International Conference on Intelligent Human-Machine Systems and Cybernetics

Optimization of a Fuzzy Logic Controller using


Genetic Algorithms
Danilo Pelusi
University of Teramo
Coste Sant’Agostino, Teramo, Italy
Email: dpelusi@unite.it

Abstract—The design of a fuzzy controller suffers from choice thereafter improved through operations such as Reproduction,
problems of fuzzy input and output membership functions and Crossover and Mutation [9]. A Genetic Algorithm manipulates
rules inference system definition. Generally, such procedures the codings representing a parameters set to search a near
are implemented by trial and error iterations which do not
assure an optimal fuzzy controller design. Moreover the fuzzy optimal solution [4], [16], [9]. Because the main design
features of control system depend on the specific application of problem of a fuzzy controller is the selection of optimized
fuzzy controller. There are several techniques reported in recent membership functions and fuzzy rules base, some authors
literature that use Genetic Algorithms to optimize a fuzzy logic used the Genetic Algorithms to find the optimal membership
controller. This paper proposes a methodology to optimize fuzzy functions and fuzzy rules. Kim Chwee Ng and Yun Li [9]
logic parameters based on Genetic Algorithms. The scheme is
applied to the problem of electrical signal frequency driving developed Genetic Algorithms for automatic design of high
for signals acquisition experiments. The fuzzy logic controller is performance fuzzy logic controllers for some engineering
tuned by Genetic Algorithms to achieve the optimal parameters. control applications. The simultaneous tuning of fuzzy con-
The tuning design approach offers a complete and fast way to trollers parameters, obtained by Genetic Algorithms applica-
design an optimal fuzzy system. Moreover, the results show that tion, shown encouraging advantages [16]. The same approach
the optimized fuzzy controller gives better performance than a
conventional fuzzy controller also in terms of rise and settling yielded good results on hydraulic control systems [19]. Khan
time. et al. [7] employed Genetic Algorithms in fuzzy controllers for
temperature control systems. Optimized fuzzy logic controllers
I. I NTRODUCTION are also implemented to reduce the area space of the circuits
Fuzzy logic controllers find application in many engineering components in Field-Programmable Gate Array (FPGA) [14].
applications where the control systems are difficult to model. In this paper, we propose an optimized fuzzy logic controller
The fuzzy techniques are applied in complicated and imprecise for electrical signals parameters driving. Some acquisition
processes for which either no mathematical model exists or the data experiments need of automatized and flexible control
mathematical model is severely nonlinear. The main feature of electronics [1], [17]. We design an intelligent control system
a fuzzy system is the ability to reproduce the human behavior. for data acquisition. The tuning parameter is the frequency
This one is achieved incorporating the human intelligence of a low-pass filter. The scheme selects the membership
into automatic control systems directly. On this way, a fuzzy functions shape using the Genetic Algorithms. The model
logic controller offers a more accurate and efficient approach. is simulated through MATLAB Fuzzy Logic Toolbox and a
Shiuh-Jer Huang and Ji-Shin Lee [15] proposed a stable self- Genetic Algorithms library [5].
organizing fuzzy controller to manipulate the motion trajectory
of a 5-degrees-of-freedom robot. The experimental results II. L OW- PASS FILTER DESIGN
showed that this intelligent controller has a stable learning The target of our model is to yield a suitable signal
ability and good motion control capability. Some authors frequency which depends on a specific input reference value.
[6], [18] presented adaptive fuzzy logic controllers which To define the frequency value, we design a low-pass filter (see
can perform some adaptive fuzzy inference processes using Fig. 1) and define the following transfer function:
various inference parameters such as the shape and location
of suitable membership functions. However, the selection of −R4 /R1
high performance membership functions depends on human T (s) = (1)
s2 R3 R4 C2 C5 + sC5 (R3 + R4 + RR3 R1 4 ) + 1
experience and it assumes huge relevance for the design of √
fuzzy controllers. The choice of the membership functions where ω0 = 1/ R3 R4 C2 C5 is the cutoff frequency. We
requires tedious trial and error processes which do not fast consider R1 = R3 = R4 = R and C2 = C5 = C, therefore
converge to the optimal solution. Genetic Algorithms [8] are the (1) becomes:
of help to solve this problem.
−1
Genetic Algorithms are search algorithms based on mecha- T (s) = (2)
nism of natural selection and natural genetics [3]. The survival s2 R2 C 2 + 3sRC + 1
of the fittest is assured by a random creation of a population with ω0 = 1/RC.

978-0-7695-4444-1/11 $26.00 © 2011 IEEE 143


DOI 10.1109/IHMSC.2011.105
Assuming a fixed value of capacitance C, the cutoff fre-
quency value is defined by resistance R. From the Fig. 1
we can note that the resistor is a potentiometer, i.e. a three-
terminal resistor with a sliding contact that forms an adjustable
voltage divider. Among the various type of programmable
devices, a suitable choice could be the DS1867 programmable
trimmer [2]. On this way, the model tunes the value of
cutoff frequency, driving the filter. We proposed such filter
to implement antialias filters in data-acquisition systems [1],
[17]. Anti-aliasing filters [10] are used before a signal sampler,
Fig. 1. Low-pass filter schematic
to restrict the bandwidth of a signal to approximately satisfy
the sampling theorem [13].
III. F UZZY LOGIC CONTROLLER parameters. The scheme searches the best values of parameters
α and σ of (3), in [−1, 1] and [0.02, 0.12] respectively. Note
The fuzzy logic controller is characterized by Gaussian
that σ determines the amount of overlapping. This feature is
membership functions. This is a suitable choice for high
very important for a distinctive fuzzy decision making.
performance of our tuning control system. The Gaussian
The model generates randomly the parameters α, σ and the
membership functions are defined by:
fuzzy inputs of controller. Such parameters modify the central
µ ¶
(x − α)2 point and the shape of membership functions. The output of
µ(x) = exp − (3) fuzzy controller is adjusted over a range of 0-255 by the Gain
2σ 2
block. The output of this block changes the value of resistance
where the parameters α and σ define the features of fuzzy sets. R of low-pass filter and as a consequence the frequency to
These parameters are optimized by a Genetic Algorithm imple- tune. Such value is compared with the reference frequency and
mented in a user-defined MATLAB function (GA.m block in the model computes the error and the derivative error. These
the block diagram of Fig. 2). The fuzzy logic controller block values are adjusted over a range of 0-200 for the first one
contains a reference to a fuzzy logic inference system. The and 0-15 for the second one. The new inputs are sent to the
inference system has two inputs and one output. The first input fuzzy controller and the process begins again. The suitability
is the error signal ee which indicates the difference between of the ranges of the scaling gains was determined from the
the desired frequency and the actual filter cutoff frequency. prior hand tuning of the controller.
The other input is the error derivative signal de achieved by To evaluate the performance of the controller, it is necessary
differentiating the error signal before passing it to the fuzzy to define a fitness function. The target of our controller is to
logic controller block. drive the output of the process to achieve the desired frequency
The model uses the most commonly seen fuzzy methodol- in the shortest time possible. Because the task of defining a
ogy: the Mamdani fuzzy inference method [11]. Such method fitness function depends on application, we define:
attempts to solve control problems by a set of linguistic
rules obtained from experienced human operators. The main A
feature of such technique is that both the antecedents and f (x) = (4)
(1 + x)4
the consequents of the rules are expressed as linguistic con-
straints. As a consequence, the Mamdani method can provide where x is the performance index defined as
a highly intuitive knowledge base that is easy to understand n
X £ ¤
and maintain. In our problem, the input/output mapping must x= i ee(i)2 + de(i)2 (5)
be acquired from data. i=1
The rules of the fuzzy inference system are shown in
Table I. The definition of these rules come from experimental and A is a nonnegative constant and appropriately chosen so
experiences and trial and error procedures. One of the most that f will not be too small. Moreover, n is the finish time
time consuming part of designing a fuzzy logic controller is the and i is the time index. The model minimizes the function f
definition of rules base. However, the choice of seven member- defined in 4 through the application of Genetic Algorithms.
ship functions for each input and output is a good compromise The Genetic Algorithms process converges quickly to the
between rules precision and computational complexity. optimal solution.

IV. O PTIMIZATION OF CONTROLLER V. R ESULTS


The tuning approach employs the use of MATLAB M-files The model yields the optimal fuzzy sets and rules to drive
and functions to manipulate the fuzzy inference system. This the low pass filter of Fig. 1. For specific application such as
system is continuously modified to find an optimal solution. [1], [17], the value of capacitance C must be fixed to 470pF .
The block named GA.m of Fig. 2 contains a MATLAB Moreover, the resistance value changes from 400Ω to 10KΩ.
M-file that implements the search algorithm to obtain optimal This values define the cutoff frequency ω0 of low-pass filter.

144
TABLE IV
O PTIMAL MEMBERSHIP FUNCTIONS PARAMETERS OF OUTPUT POSITION

NB NM NS ZE PS PM PB
α -0.96 -0.62 -0.35 -0.01 0.37 0.64 1.00
σ 0.04 0.04 0.08 0.10 0.10 0.12 0.09

Fig. 2. Model for optimal fuzzy logic controller

TABLE I
F UZZY LOGIC RULES

de \ ee NB NM NS ZE PS PM PB
NB PB PB PM PS ZE NS NM
NM PM PM PS PS ZE ZE NS
NS PS PS ZE ZE NS NM NB
ZE NB NM NS ZE PS PM PB Fig. 3. Optimal membership functions of input ee
PS NS NS ZE ZE PS PM PB
PM NM NM NS NS ZE ZE PS
PB NB NB NM NS ZE PS PM

TABLE II
O PTIMAL MEMBERSHIP FUNCTIONS PARAMETERS OF INPUT EE

NB NM NS ZE PS PM PB
α -0.96 -0.65 -0.33 0.04 0.37 0.66 0.96
σ 0.11 0.10 0.04 0.10 0.05 0.09 0.11

TABLE III
O PTIMAL MEMBERSHIP FUNCTIONS PARAMETERS OF INPUT DE
Fig. 4. Optimal membership functions of input de
NB NM NS ZE PS PM PB
α -0.96 -0.62 -0.29 -0.04 0.34 0.68 0.95
σ 0.02 0.08 0.11 0.07 0.06 0.09 0.04

The scheme optimizes the parameters α and σ of each


membership functions of the input and output sets. The results
are shown in the Tables II, III and IV.
The optimized membership functions of input are shown
in Fig. 3 and 4. Note that the NM (Negative Medium)
and PS (Positive Small) membership functions of input de
are smoother than input ee. Moreover, the optimal Gaussian
membership functions of output variable position (see Fig. 5) Fig. 5. Optimal membership functions of output position
define with good precision the contact position of potentiome-
ter.
The Table V shows the optimized fuzzy rules. We can VI. C ONCLUSION AND FUTURE WORK
deduce that the trial and error technique can be improved. The The main crux of fuzzy systems is the choice of membership
tuning approach through Genetic Algorithm assures a fast and functions and the definition of rules inference system. This
good definition of fuzzy rules. Moreover, the simulation shows search can be made by tedious trial and error procedures
that the optimized fuzzy controller gives better performance on the base of the specific problem knowledge. Moreover,
than a conventional fuzzy controller also in terms of rise time such process could employ many time without to obtain good
and settling time. results.

145
TABLE V
O PTIMIZED FUZZY LOGIC RULES [7] S. Khan et al., Design and Implementation of an Optimal Fuzzy Logic
Controller Using Genetic Algorithm, Journal of Computer Science 4 (10):
799-806, ISSN 1549-3636, 2008.
de \ ee NB NM NS ZE PS PM PB [8] J. Koza, Genetic Programming: On the Programming of Computers by
NB PB PB PM PS ZE NS NM Means of Natural Selection, MA: MIT Press, Cambridge 1992.
NM PM PM PS PS ZE NS NS [9] C. N. Kim and Li, Y., Design of Sophisticated Fuzzy Logic Controllers
Using Genetic Algorithms, Proceedings of International Conference on
NS PS PS ZE NS NS NM NB Fuzzy Systems, pp. 1708-1712, 1994.
ZE NB NM NS ZE PS PM PB [10] Leler, J. William, Human Vision, Anti-aliasing, and the Cheap 4000 Line
PS NS NS ZE PS PS PM PB Display, ACM SIGGRAPH Computer Graphics 14 (3): 308313, 1980
[11] E.H. Mamdani, and S. Assilian, An experiment in linguistic synthesis
PM NM NM NS NS ZE PS PS with a fuzzy logic controller, International Journal of Man-Machine
PB NB NB NM NS ZE PS PM Studies, Vol. 7, No. 1, pp. 1-13, 1975.
[12] Microchip, PIC16F87X Datasheet, Enhanced Flash Microcontrollers
Microchip Technology Inc., 2003.
[13] Nyquist, H., Certain topics in telegraph transmission theory, Proceedings
Genetic Algorithms searching technique converges intelli- of the IEEE, ISSN: 0018-9219, Vol. 90, pp. 280-305, 2002
[14] G. Sakthivel, T.S. Anandhi, S.P. Natarajan, Design of Optimized Fuzzy
gently and much faster than conventional learning means. In Logic Controller for Area Minimisation and its FPGA Implementation,
fact, the Genetic Algorithms are an extremely efficient and International Journal of Computer Science and Network Security, Vol.10,
robust searching tool for poorly understood processes. No.8, August 2010.
[15] Shiuh-Jer Huang, Ji-Shin Lee, A stable self-organizing fuzzy controller
In this paper, we apply the Genetic Algorithm to obtain for robotic motion control, IEEE Transactions on Industrial Electronics,
the optimal membership functions and the best rules to drive Vol. 47, ISSN: 0278-0046, pp. 421-428, 2000.
a cutoff frequency for specific applications [1], [17]. Such [16] Teo Lian Seng, Marzuki Bin Khalid and Rubiyah Yusof, Tuning of
a Neuro-Fuzzy Controller by Genetic Algorithm, IEEE Transaction on
applications are characterized by nonlinearity which imposes Systems, Man and Cybernetics, Vol. 29, N. 2, April 1999.
the use of sophisticated membership functions. To solve our [17] G. Tosti, M. Busso, O. Straniero, C. Abia, M Bagaglia, M. Dolci, L. Cor-
problem we have chosen Gaussian membership functions. cione, G. Nucciarelli, F. Roncella, G. Valentini, I. Di Varano, D. Pelusi,
The IRAIT Project: infrared astronomy from Antartica, proceedings of
The results show that the optimized fuzzy controller gives SPIE, Volume 5489, pp. 742-753, Glasgow, 2004.
better performance than a conventional fuzzy controller in [18] Yi Wang Huiwen, Deng Zheng Chen, Adaptive fuzzy logic controller
terms of rise time and settling time. In other words, the tuning with rule-based changeable universe of discourse for a nonlinear MIMO
system, Proceedings of International Conference on Intelligent Systems
design approach offers a complete and fast way to design an Design and Applications, ISBN: 0-7695-2286-6, 2005.
optimal fuzzy controller. [19] B. Zupancic, M. Klopcic, R. Karba, Tuning of fuzzy logic controller
All the rules of inference system have weight equal to with genetic algorithm, Informatica (Ljublj.), vol. 23, no. 4, pp. 559-564,
1999.
one. For the future work, we will consider rules with dif-
ferent weights, attempting of improving the results of this
work. Moreover, we will implement the search algorithm
on hardware microcontroller, for example on a controller of
PIC16F87X family [12]. In this way, we will design a real
time experimental setup to test the performance of our optimal
fuzzy controller.

ACKNOWLEDGMENT
The author would like to thank the AMICA team of Astro-
nomical Observatory ”Collurania” of Teramo for the precious
suggestions and for the support.

R EFERENCES
[1] M. Dolci, G. Valentini, O. Straniero, G Di Rico, M. Ragni, D. Pelusi, C.
Giuliani, A. Di Cianno, I. Di Varano, G. Tosti, M. Busso, L. Corcione,
AMICA: the Antarctic Mid-Infrared CAmera for the IRAIT telescope,
EAS Publications Series, Volume 14, pp. 337-342, 2005
[2] Dual Digital Potentiometer with EEPROM DS1867, Datasheets, Dallas
Semiconductor, 1999.
[3] D. Goldberg, Genetic Algorithms in Search, Optimization & Machine
Learning, Addison Wesley Longman, Inc., 1989.
[4] F.Hoffmann, G. Pfister, Automatic Design of Hierarchical Fuzzy Con-
trollers Using Genetic Algorithms, 2nd European Congress on Intelligent
Techniques and Soft Computing, Aachen, 1994.
[5] J.Ivakpour, Genetic Algorithm Performance, Matlab Central, MathWorks,
2006
[6] Jer Min Jou, Pei-Yin Chen, Sheng-Fu Yang, An adaptive fuzzy logic
controller: its VLSI architecture and applications, IEEE Transactions on
Very Large Scale Integration (VLSI) Systems, Vol. 8, p. 52, SSN:1063-
8210, 2000.

146

You might also like