An Intelligent Fuzzy Controller Based On Genetic Algorithms
M.Yousefi Azar Khanian*, A.Fakharian , M.Godarzvand Chegini , B.jozi
Abstract— In view of many applications, in recent manipulators is summarized here. This would result in an
years, there has been increasing interest in robot’s increase in robot deflection and poor performance due to
control. Two intelligent controllers based on fuzzy logic and the effect of mechanical vibration in the links and bring
neural network are developed to trace the desired trajectory difficulties for control [1],[2]. Thus, vibration control of a
for a robot. A variety of evolutionary algorithms, have been robotic manipulator system has been an important research
proposed to approximately solve problems of common
area in the last decade [1]-[5]. On the other hand, a robot
engineering applications. Increasingly common applications
involve automatic learning of nonlinear mappings that govern system is a highly nonlinear and heavily coupled
the behavior of control systems. In many cases where robot mechanical system, the mathematical model of such system
control is of primary concern, the systems used to usually consist of a set of linear or nonlinear
demonstrate the effectiveness of evolutionary algorithms often differential/difference equations derived by using some
do not represent practical robotic systems. In this paper, form of approximation and simulation [2],[3]. Therefore,
genetic algorithms (GA) are the evolutionary strategy of
the traditional model-based intelligent control techniques
interest. This procedure and the manner in which fuzzy
will break down when a complete robot representative
controllers are codified into chromosomes is described. It is
applied to learn fuzzy control rules for a practical autonomous model is difficult to obtain due to uncertainly and
vehicle steering control problem, namely, path tracking. GA complexity [6],[7]. When an artificial system is used to
handles the simultaneous evolution of membership functions model the behavior of some natural system, it is possible to
and rule bases for the fuzzy path tracker. Simulation results use genetic algorithms to optimize the system behavior,
show that the proposed fuzzy controller whose all parameters which is described by the values of certain parameters.
have been tuned simultaneously using GAs, offers advantages
Genetic algorithms do not directly operate over these
over existing controllers and has improved performance.
parameters, but over a structured representation of them. In
I. INTRODUCTION addition the search for this value set is guided by the
knowledge of which are the best individuals of a
S EVERAL strategies have been proposed to manage the
tracking control of mobile robots. The fuzzy logic
controller is designed for vibration and position control of
population and by probabilistic rules that allow individuals
to interact.
Genetic algorithms are search algorithms based on the
the system. One of the difficulties in the construction of the mechanics of natural selections and natural genetics. GAs
fuzzy controller is to derive a set of optimal control has the properties that make them a powerful technique for
parameters of the controller such as linguistic control rules, selecting high-performance parameters for fuzzy logic
scaling factors, and membership functions of the fuzzy controllers. Because of the robustness, these are
controller. Mathematical model of the system is obtained to successfully applied to generate if-then rules and
simulate behavior of a single flexible link in open loop membership functions of fuzzy systems [4]. Genetic
control before using fuzzy logic controller. On the other algorithms has recently been demonstrated to be a viable
hand, intelligent control methods are progressing approach to learning fuzzy logic rules for mobile robot
nowadays. Nonlinear intelligent control methods used in control and navigation [4],[5]. Herein, we address the
applications of robot path tracking should face difficulty simultaneous design of fuzzy logic controllers using GA,
resulting from the dynamic modeling of robot. Some of i.e. evolution of both the input membership functions and
these methods are fuzzy control, neural network control the rule base. The optimizing parameters are generally
and intelligent fuzzy control. Some recent work regarding codified as binary strings of finite length.
the intelligent control of robot path trackings or Working simultaneously on the assertion of binary
codes related to one sole parameter allows us to explore
The authors are with the Electrical , Computer and Biomedical arbitrary wide areas of the solution space. Probabilistic
Engineering Department, Islamic Azad University ,Qazvin Branch ,Iran,
Young Researchers Club , Islamic Azad University, Qazvin Branch , Iran rules allow the exploration of regions of the search space
(phone: +98 281 3665275 fax:+98 281 3665279 www.qiau.ac.ir where one or several solutions to the problem can be found.
Zip code : 34185-1416) In addition, we extend the evolutionary influence of GA
(e-mail:
[email protected] ,
[email protected] ,
[email protected] ,
[email protected] )
by incorporating the random selection of fuzzy logic
connectives into the learning process. Finally, we examine
the robustness of the evolved controllers by corrupting wherein the population evolves over time in response to
sensory data used by the path following robot, and by selective pressure induced by the relative fitness of
increasing the nominal forward velocity of the vehicle. This individuals in the problem domain. In our approach, each
provides an indication of how well GA can evolve practical program executes condition-action statements, which
solutions that also retain the tolerance of imprecision and collectively serve as a rule base to be embedded in a fuzzy
uncertainty characteristic of fuzzy logic controllers. controller. To preserve diversity among populations and
vital genetic information among individuals, genetic
II. OVERVIEWS OF INTELLIGENT FUZZY CONTROLLER operators are applied to create new individuals for
AND GA succeeding generations. When the algorithm finally
The basic fuzzy controller is designed with qualitative converges or satisfies its termination criteria, it is
technique based on the analysis of the evaluation of the anticipated that the best (most fit) individual will be
error between the reference signal, the output of the process representative of an optimum or near optimum solution.
to be controlled and the change of the error. The field of intelligent fuzzy system and control has been
A fuzzy logic controller is an intelligent control system that making a big progress motivated by the practical success
smoothly interpolates between rules, i.e. rules fire to in industrial process control. Fuzzy systems can be used in
continuous degrees and the multiple resultant actions are as closed-loop controllers. In this case the fuzzy system
combined into an interpolated result. A fuzzy set may be measures the outputs of the process and takes control
represented by a mathematical formulation known as a actions on the process continuously. The fuzzy controller
membership function. That is, associated with a given uses a form of quantification of imprecise information
linguistic variable (e.g. speed) are linguistic values or fuzzy (input fuzzy sets) to generate by an inference scheme,
subsets (e.g. slow, fast, etc.) expressed as membership which is based on a knowledge base of control force to be
functions which represent uncertainty, vagueness, or applied on the system [8].
imprecision in values of the linguistic variable. These The advantage of this quantification is that the fuzzy sets
functions assign a numerical degree of membership to a can be represented by a unique linguistic expression, such
crisp (precise) number. More precisely, over a given as small, medium, and large etc. The linguistic
universe of discourse (relevant numerical range) X, the representation of a fuzzy set is known as a term, and a
membership function of a fuzzy set, denoted by P(x), maps collection of such terms defines a term-set, or library of
elements x X into a numerical value in the closed unit fuzzy sets. Fuzzy control converts a linguistic control
interval, i.e. P(x): X ĺ [0, 1]. strategy usually based on expert knowledge into an
Implementation of a intelligent fuzzy controller automation control strategy. There are three functions
requires assigning membership functions for inputs and required to be performed by fuzzy logic controller before
outputs. Inputs to a fuzzy controller are usually measured the controller can generate the desired output signals. The
variables, associated with the state of the controlled plant, first step is to fuzzify each input. This can be realized by
associating each input with a set of fuzzy variables. In
that are fuzzified (assigned membership values) before
order to give semantics of a fuzzy variable a numerical
being processed by an inference engine. The heart of the
sense, a membership function is assigned with each
controller inference engine is a set of if-then rules whose
variable [2].
antecedents and consequences are made up of linguistic The logical controller is made of four main components:
variables and associated fuzzy membership functions. (1) Fuzzifier; (2) Knowledge base containing fuzzy IF-
Consequences from fired rules are numerically aggregated THEN rules and membership functions; (3) Fuzzy
by fuzzy set union and then collapsed (defuzzified) to yield reasoning; and (4) Defuzzifer interface [9, 10].
a single crisp output as the control signal for the plant. For In this section, the notion of hierarchy is studied for fuzzy
detailed introductions to fuzzy control, fuzzy set control system.
operations, and concepts of fuzzification, inference, An attempt is made to reduce the size of the inference
aggregation, and defuzzification see one of [2],[6]. Gas are engine for a large-scale system. When a fuzzy controller is
search algorithms based on the mechanics of natural designed for a large-scale system (e. g. flexible structures),
selections and natural genetics. Unlike many classical often several measurable output and actuating input
optimization techniques, genetic algorithms do not rely on variables are involved. In addition, each variable is
computing local derivatives to guide the search process. represented by finite number l of linguistic labels which
Genetic algorithms also include random elements, which would indicate that the total number rules is equal to l n ,
helps to avoid getting trapped in local minima [2]. where n is the number of system variables. Even for a very
In the GA paradigm, a population is comprised of low-order system which as few as five labels per variable,
computer programs or procedures (individuals) that are this exponential expression would become large.
candidate solutions to a particular problem. These Consequently, we will present a hierarchical scheme for
individuals participate in a simulated evolution process flexible link robot arm. It decomposes a large system into a
finite number of reduced-order subsystem (e. g. by
singular perturbation approach), thereby eliminating the
need for a large-sized inference engine [4].
In the next section, we introduce the autonomous vehicle
control problem, followed by discussion of fuzzy logic
controller design issues to be considered when employing
GA.
III. PATH TRACKING CONTROL ERROR VARIABLES
If The control problem examined in this paper is a path
tracking problem, which was formulated by Hemami et al
[7],[8] for a class of low speed (less than 2 m/s) tricycle-
Fig. 1. Tracking control error variables.
model vehicles. We wish to automatically design a fuzzy
controller that will achieve this objective. The inputs
For our application, we assume that the robot has dead-
consist of a measurable position error, İd, and a measurable
reckoning/odometry sensors that provide access to the error
orientation error, İș, associated with path following in the
states at all times, or permit calculations thereof. This
plane (see Figure 2). The output is the steering angle, į,
sensory input data is then mapped to control outputs
which is the corrective control action that would cause the
according to the desired control policy. In path following
errors to approach zero and, thus, force the robot to follow
simulations the state vector of the kinematic model is
the desired path.
updated using the well-known fourth-order Runge-Kutta
The position error is taken as the deviation of the
numerical integration method.
center of gravity, C, or any other desired point of the robot
from the nearest point on the path. The orientation error is IV. GA DESIGN OF FUZZY CONTROLLERS
the angular deviation of the robot from the tangent of the
desired path. Hemami et al derived a state-space kinematic The path tracker to be learned by GA is a two-input,
model for this robot where the state vector was comprised single-output fuzzy controller that will map the error states
of the pose errors described. The reader is referred to either into a proper steering angle at each time step. A population
of [7] or [8] for details of the model derivation, which of candidate solutions is created from which a solution will
culminates in the following: emerge. The allowance for rule bases of various sizes
enhances the diversity of the population. That is, the GA
system creates individuals in the initial population that each
ªHd º ª0 Vu º ªH d º ª MC / MP º ªK d º (1)
«H » «0 0 » «H » « 1 / MP »Vu tan G r «K » have possibly different numbers of rules within a range
¬ T¼ ¬ ¼¬ T ¼ ¬ ¼ ¬ T¼ (15-30) specified before a run. In the process of learning
fuzzy control rules and membership functions, GA
where Vu is forward linear velocity of the robot, and K d manipulates the linguistic variables directly associated with
and KT are rates of change of the effects of path curvature. the controller. Given a desired motion behavior, the search
In [8] it is concluded (based on dynamic analysis of the space is contained in the set of all possible rule bases that
same vehicle) that for small steering angle, G (tan G # G), can be composed recursively from a set of functions and a
set of terminals. The function set consists of membership
Equation (1) approximates the slow dynamics of the
vehicle when its forward velocity is low. For simulations function definitions (describing controller inputs),
presented later, we have simplified the robot kinematic components of the generic fuzzy if-then rule, and common
model by taking this small steering angle approximation fuzzy logic connectives. More specifically, these include
into account. Furthermore, we apply the controller to functions for fuzzy sets, rule antecedents and consequents,
straight-line path following and, therefore, neglect the fuzzy set intersection and union, and fuzzy inference. The
model effects of path curvature. Such a simplification does terminal set is made up of the input and output linguistic
not preclude autonomous tracking of reasonably variables and the corresponding membership functions
complicated paths since multi-segment paths can be associated with the problem. Selection of appropriate t-
defined to be piecewise linear. norms is automated, thereby, giving the GA system greater
control of the evolutionary design. That is, the influence of
GA is extended to include selection of the type of t-norm
employed to compute the conjunction of fuzzy propositions
in the antecedent of a rule. The two most commonly used t-
norms for fuzzy control are Mamdani's min and Larsen's
product [6].T-norms for each conjunctive rule are selected
at random by GA for rule bases in the initial population, where Hd and HT are the position error and orientation
and are carried along based on fitness in successive
error existing at the end of each fitness case simulation.
generations.
The objective of this fitness function is to minimize final
To achieve the goal of evolving fuzzy logic path tracking errors as well as the control effort expended
controllers, the GA system must conform to strong [2]. As such, a perfect fitness score is zero and, in general,
syntactic constraints when breeding individuals. Special lower fitness values are associated with better controllers.
rules of construction were introduced in [4]. In order to
Simulations thus far showed that including G as part of
accommodate evolution of input membership functions, in
the path tracking metric significantly reduces undesired
addition to the rule base, the allowable syntax was
steering oscillations.
extended in [9] and implemented using a representation
proposed in [2],[10]. We refer the reader to [4] and [9] for Fitness functions based solely on final error states
more detail on the syntactic constraints and other GA sometimes yielded impractical controllers that exhibited
implementation issues related to intelligent fuzzy controller rapid oscillations in the steering control signal, which
design. would cause damage to the steering mechanism of a real
mobile robot. The path tracking success of an individual in
A. Controller Fitness Evaluation the population is also based on its ability to minimize
Each rule base in the current population is evaluated to tracking errors to within the following specified tolerances,
determine its fitness value for steering the robot from initial | H d | <0.15m and | H T | <0.26 rad., for each fitness case. A
locations near the desired path to final locations on the path fitness case simulation in which these tolerances are
such that steady state and final pose errors are minimized. satisfied is considered a hit, or successful trial. Thus, each
This evaluation involves frequent simulation of the robot’s individual has the potential of receiving a total of eight hits
motion from each of a finite number of initial conditions during fitness evaluation.
until either the goal state is achieved or the allotted time
expires. The initial conditions are referred to as fitness V. RESULTS
cases in the GA community. For this problem we use eight
In this section, we present representative results of
different initial conditions, which a logical choice is given
simulated path tracking performance for an evolved
the pair-wise symmetry of the possible error categories
controller. The simulated robot is based on kinematic
illustrated in Fig. 1. Consider error category (d), which
model with dimensions taken from the middle size soccer
represents a case where the robot is located on the left of
mobile robot. The middle size soccer robot has a tricycle
the desired path with a negative heading orientation. There
wheel configuration in which the front wheel is driven by
also exists a symmetric case where the robot is located on
DC motors. In each case, the robot travels at a constant
the right of the desired path with a positive heading
nominal forward speed of 1.5 m/s unless otherwise stated.
orientation. These symmetric cases are each represented by
The GA system was implemented in the Matlab
error category (d). The same holds for category (a), (b) and
programming language. Five consecutive runs (initialized
(c) illustrated in the figure, yielding a total of eight fitness
using different random number generator seeds) were
cases that fully describe the possible combinations of errors
executed on a population of 200 individuals for a maximum
with respect to the path. The fitness function is a measure of 100 generations. About one hour of computation time is
of performance used to rank each individual relative to required for a run of this magnitude. A rule base of 25
others in the population. We compute path tracking rules emerged as the fittest among all five runs. This rule
performance by summing the Euclidean norms base used five conjunctive rules, three employing the
(normalized) of the final error states plus the average Mamdani t-norm and two employing the Larsen t-norm.
control effort ( G ) over all eight fitness cases. Fitness of The evolved input membership functions associated with
rules should be evaluated in an environment that reflects the best rule base and the rules are listed in Table 1. The
the objective of a problem. It is necessary to define the notations NB, NS, Z, PS, and PB represent fuzzy linguistic
function used for calculating the fitness of every terms of “negative big”, “negative small”, “zero”, “positive
membership function. In order to do this we have studied small”, and “positive big”, respectively. Terms describing
the inputs, Hd and HT, are preceded with the prefix “p” and
the features that determine a good path for the autonomous
“o” respectively. The fixed output membership functions,
mobile robot when avoiding obstacles. Thus, the following
where the linguistic terms are labeled without prefixes.
fitness function drives the evolution process
8
Fitness function = ¦ (H 2 H T2 G 2 ) (2)
j 1 d j
TABLE 1. Best Evolved Rule Base of correcting vehicle steering from initial states in all other
error categories, the vehicle error status ultimately reduces
1 IF oZ THEN NS
2 IF pPB THEN Z the category (d) of Fig. 2 or its counter-pair.
3 IF pNB THEN Z
4 IF pPS THEN NB VI. ROBUSTNESS CHARACTERISTICS
5 IF pNS and oPS THEN NS (Mamdani’s min)
6 IF pNB THEN PB Given the capability to evolve fuzzy logic controllers
7 IF oNS THEN Z that can effectively follow paths, an important next step is
8 IF oNB THEN PS to examine their robustness to practical perturbations. To
9 IF pNS THEN NS
test the noise robustness of the evolved controller,
10 IF pNS and oZ THEN PB (Larsen’s prod)
11 IF oPB THEN NB simulations were performed with the imposition of a noise
12 IF pNS and oPB THEN NB (Larsen’s prod) signal upon the sensor measurement related to heading
13 IF pPS THEN NS (orientation). We assume that the error states are derived
14 IF oNS THEN PB from sensor measurements which, due to their imperfect
15 IF pPB THEN NB
16 IF oZ THEN PS
nature, introduce an additive sinusoidal noise signature of
17 IF oNB THEN PB small amplitude and low frequency (relative to the
18 IF pNS and oNS THEN PB (Mamdani’s min) controller sampling frequency) that corrupts the orientation
19 IF pNS THEN Z error. For this investigation we impose the sensor noise
20 IF oPS THEN NB
signal, n(t) = 0.26cos(3t) with t = kT, where k=1,2,3,... is
21 IF pZ THEN PS
22 IF pPB and oZ THEN Z (Mamdani’s min) the sampling instant, and T is the sampling period. Thus,
23 IF pPB THEN PS the noise amplitude is bounded by 0.26 radians (15
24 IF oPS THEN PS degrees), and at any sampling instant the corrupted
25 IF oNS THEN PS
orientation error signal lies in the range of ( H T r 0.26)
The evolved controller received a raw fitness of 0.1091 radians. A typical result is shown in Fig. 3 and Fig. 4 ,
with 8 hits. In [4], an fuzzy logic controller designed which illustrates the performance of both the evolved
manually, through a lengthy process of trial-and-error, was controller and the hand-derived controller when induced
presented which also used 25 rules. Hours of iterative with noise and an increased vehicle speed. While the
refinement of membership functions and rules were oscillatory effects of the added noise are clearly evident in
invested before arriving at a suitable design. In comparison, the steady state response, the controller successfully
the hand-derived fuzzy logic controller received a navigates the robot onto the path and maintains the steady
comparable raw fitness (0.08 with 8 hits) for the identical state errors within the tolerances specified earlier. Thus,
tracking problem. Fig. 4 shows the temporal responses of this evolved fuzzy controller exhibits path tracking
position error, orientation error, and control effort for the robustness to the imposed perturbations. This result is
evolved controller and for the hand-derived controller. representative of temporal responses for each of the
This result corresponds to error category (d) of Fig. 2, with remaining fitness cases. In simulations completed thus far,
the most robust fuzzy controllers were those evolved when
initial conditions of H d = 0.8 m and H T = -0.9 rad.
GA was allowed to randomly select t-norms. The
performance assessment of the evolved controller with
regard to robustness is based upon the assumption that low
frequency oscillations within the control signal of
amplitude less than 0.026 radians (1.5 degrees) are
practical. the results indicate that the evolved fuzzy logic
controller was able to navigate the robot along the desired
path with the imposed perturbation of sensor noise and the
increase in the robot’s nominal speed. According to the
control block diagram, the system is also work with the
inverse kinematics equation in the feedback. It is used to
simplify the robot movement calculation. In the next step
the motion error is obtained and given to the fuzzy
Fig. 2. Error categories control.
logic controller to determine which parameter of the
system should change to recover the miss location of
In [8],[9] it was shown that this error category is the the robot.
most general for studying path tracking by tricycle-type
vehicles. It is most general in the sense that in the process
resource for the design of fuzzy controllers. This paper has
demonstrated an approach to path tracking controller
design based on soft computing methods. GA was
successfully applied to discover fuzzy controllers capable
of navigating a mobile robot to track straight-line paths in
the plane. The performance of the best-evolved fuzzy logic
controller was comparable to that of a manually derived
fuzzy logic controller, which required a considerably
longer design cycle. GA simultaneously evolved
membership functions and rules for a fuzzy logic controller
Fig. 3. The simulated rules to control surface of max-min with Matlab that demonstrated satisfactory responsiveness to various
initial conditions while utilizing minimal human interface.
A special feature of overlapping sets using the Mamdani
The speed of evolution alone serves as a strong basis for
product inference engine is that a minimum of one and a practical application of GA in the controller design process.
maximum of two membership sets for each input variable The approach enables expeditious design of fuzzy logic
will fire [10]. controllers that can be directly applied to a physical system.
Alternatively, human experts can use the rapidly evolved
fuzzy logic controllers as design starting points for further
manual refinement. Finally, the evolved fuzzy logic
controller was shown to be robust to perturbations of
sensor noise and an increase in nominal robot speed. This
supports the notion that genetically evolved fuzzy logic
controllers can have practical utility.
REFERENCES
[1] Emara, H. and Elshafei, A. L. (2004) Robust Robot Control
Enhanced by a Hierarchical Adaptive Fuzzy Algorithm. Engineering
Applications of Artificial Intelligence17, 187-198.
[2] Homaifar, A. and McCormick, E., "Simultaneous Design of
Membership Functions and Rule Sets for Fuzzy Controllers Using
Genetic Algorithms", IEEE Transactions on Fuzzy Systems, Vol. 3,
No. 2, 1995, pp. 129-139.
[3] B. Kosko, “Fuzzy systems as universal approximators,” in Proc.
IEEE Int. Conf. Fuzzy Systems, San Diego, CA, Mar. 1992, pp.
1143–1162.
[4] M.J. Gacto, R. Alcalá, F. Herrera, Adaptation and Application of
Multi-Objective Evolutionary Algorithms for Rule Reduction and
Parameter Tuning of Fuzzy Rule-Based Systems. Soft Computing
13:5 (2009) 419-436, doi:10.1007/s00500-008-0359-z
[5] R. Alcalá, M.J. Gacto, F. Herrera, J. Alcalá-Fdez, A Multi-objective
Genetic Algorithm for Tuning and Rule Selection toObtain Accurate
and Compact Linguistic Fuzzy Rule-Based Systems.International
Journal of Uncertainty, Fuzziness and Knowledge-BasedSystems,
15:5 (2007) 539, doi:10.1142/S0218488507004868.
Fig. 4. Evolved fuzzy logic controller response to sensor noise and [6] Tunstel, E. and Jamshidi, M., "On Genetic Programming of Fuzzy
increased forward speed. Rule-Based Systems for Intelligent Control", International Journal of
Intelligent Automation and Soft Computing, Vol. 2, No. 3, 1996, pp.
VII. SUMMARY AND CONCLUSIONS 271-284.
[7] Tunstel E., Lippincott, T. and Jamshidi, M., "Behavior Hierarchy for
In this study the An Intelligent Fuzzy Controller of a robot Autonomous Mobile Robots: Fuzzy-behavior modulation and
is optimized using a genetic algorithm. Initially an evolution", International Journal of Intelligent Automation and Soft
Computing, Vol. 3, No. 1, 1997, pp. 37-49.
overview of intelligent fuzzy controller and GA from
[8] Lee, C., “Fuzzy Logic in Control Systems: Fuzzy Logic Controller,
conventional search techniques and the details of their Part I”, IEEE Transactions on Systems, Man & Cybernetics, Vol. 20,
basic mechanics. Next a GA is used to produce an adaptive No. 2, 1990, pp. 404-418.
fuzzy controller. The major advantage of the method [9] Hemami, A., Mehrabi, M., and Cheng, R., "Optimal Kinematic Path
developed is that all parameters of the fuzzy controller Tracking Control of Mobile Robots with Front Steering", Robotica,
Vol. 12, No, 6, 1994, pp. 563-568.
including the rule base are tuned simultaneously .On the [10] Battle, D. D., Implementation of Genetic Programming for Mobile
basis of the simulated results, it is concluded that GAs Robot Navigation, MS Thesis, Dept. of Electrical Engineering, North
represent a viable approach to providing fuzzy controllers Carolina A&T State University, Greensboro, NC, 1998.
with adaptive capabilities, and can provide an alternative