Multi-Stages for Tuning Fuzzy Logic Controller (FLC) Using Genetic Algorithm (GA)

ABATRACT In this paper, a study on tuning of fuzzy logic controller (FLC) using genetic algorithm (GA) for controlling an armature controlled DC motor as an example of linear plant and for controlling nonlinear plant as another example is performed. There are different ways in which a FLC can be tuned, like: tuning the scaling gains, Rule Base (RB), and Data Base (DB) represented by type of membership functions or parameters of membership functions used. The tuning process in this paper includes a multi-stage tuning represented by searching the good scaling gains, RB, and DB then a combination of multi-stage (CMS) tuning methods using Genetic Algorithm (GA) based on a fitness function that is defined in terms of performance criterion (Integral of Squared Error ISE). The performances of these tuning stages are evaluated and a comparison between them has been introduced using linear and nonlinear plants.


INTRODUCTION
he main idea of Fuzzy Logic Control (FLC) was introduces by Zadeh, and first applied by Mamdani in an attempt of controlling structurally illmodeled systems [1].The knowledge base (KB) of FLC has two main parts that need to be designed: one is the Data Base (DB) which represents the Membership Functions (MFs) definition and the other is the Rule Base (RB).Usually extracting the expert experience from human process operators is the most used method to perform this task.However, when using fuzzy logic to design a FLC it is often difficult, even for an expert; to provide good definition for the MFs and the Scaling Factors (SFs) i.e. he may not be capable of expressing his knowledge in terms of fuzzy control rules.To avoid this drawback, automatic learning methods for designing FLCs have been used by deriving automatically an appropriate KB for the controlled system without necessity of its human operator [2].
The main motivation for writing this paper is to do a study of multi stage tuning for FLC by GA.Main parts like SFs, DB, and RB play an important role in any fuzzy controller, and optimizing them is a necessary task, since these parts are always built by designers with trial and error along with their experience or experiments.This study is done on FLC for controlling the armature controlled DC motor as an example of linear plant and for controlling nonlinear plants as another example.After performing the tuning process, an inference is drawn and tabled as to which procedure is better than other with reference to steady state characteristics and performance indices.

FUZZY LOGIC CONTROLLER (FLC)
In this paper, the Fuzzy Proportional Derivative (PD) controller has two input variables (error (e) and change in error (ce)) and produces one output variable (control action (u)) is used.The fuzzy system is applied to the proportional and derivative signal of the error signal of the control system.The transient response is affected mostly by the proportional signal and the derivative signal.For the enhancement of the transient response, the varying gains are implemented on the proportional and derivative parts of FLC.   - Since there are seven MFs on each input universe of discourse, there are 49 rules that can be used in the rule-base (RB) [2][3].The complete set of used rules is shown in tabulated form in Table (1) [4].

GENETIC FUZZY SYSTEMS (GFSs)
The genetic fuzzy systems are primarily used to automate the knowledge acquisition step in fuzzy system design.The use of GAs in Fuzzy Logic systems goes back to the early 90's, when researchers began to use attributes with fuzzy values and a fuzzy pattern matcher for case retrieval [5] [6].Fuzzy systems make use of a GA in their design process are called Genetic-Fuzzy systems (GFSs).GA adapts either part or all of the components of the fuzzy knowledge base which is composed of the data base and the rule base where each plays a specific role in the GFSs.The objective of genetic tuning process is optimizing the performance of already existing fuzzy system to find the optimal configuration of fuzzy sets and/or rules by maximizing or minimizing a certain function representing or describing the behavior of the system [2].A general structure for a GFSs is represented in In this paper, the GA can be used for tuning the FLC at: 1. Finding the good solutions for the scaling gains (factors) then use it in the following stages.2. Tuning the rules of FLC (i.e., rule base tuning) only.3. Tuning the membership functions of FLC (i.e., data base tuning) only.4. Combination of these tuning stages.
The performance of each tuning stage is evaluated in terms of Integral of Squared Error (ISE) criteria, which has been chosen for its simplicity in calculation.The ISE is defined as: Where t is the instant time and e(t) is the error which is calculated as the difference between the set point and the output.
The upper limit T is a finite time chosen somewhat arbitrarily so that the integral approaches a steady state value.The fitness function on which basis GA selects better adapted chromosomes is inversely proportional to the ISE and suggested defined by the equation below [3] ISE fitness 1 =

…… (2)
After applying the genetic algorithms operations (encoding, selection, crossover and mutation), the survived chromosome will have the optimized fitness that gives a minimum ISE (or optimal solution).
In the next subsections the multi-stages tuning are discussed where the GA parameters used for tuning are: Population size (pop size) = 200 The population size used in the multi-stages tuning is 200; this size is not small enough to cover the search space and is not too large to prevent increasing number of computations and computation time.

Scaling Factors (SFs) Tuning
The scaling factors at the input and output of the FLC can have significant impact on the performance of the resulting fuzzy control system, and hence they are convenient parameter for tuning, so at the first stage, GA is used to tune the FLC input/output gains (ee, cce, and uu) to produce base or reference system.This stage contains finding the initial solutions of scaling gains genetically, where real coded GA is used to represent the entire population.The length of chromosome is three.

Rule Base (RB) Tuning
This stage tunes the RB of FLC by GA to improve the FLC performance depending on the solution obtained by the first stage that can be considered as a good initial solution.The population of potential solution is made up of RBs applied by a common processing structure to solve a specific problem.Because the learning process is centered on rules and all knowledge bases contains an identical data base (DB) shown in Fig. (2), consequently the population of solutions can be reduced to a population of RBs.Each RB is represented by a decision table, and these decision tables must be coded to constitute suitable genetic material [7].In this paper a real coded GA is used to encode the strings of the population of RBs, the initial gene pool (chromosome denoted as C 1 ) is created from the initial RB shown in table (1) where each position in the table will represent a gene of the chromosome (i.e. the initial chromosome of the population represent the consequent parts of initial RB).A chromosome is obtained by going row-wise through the table and producing a string of with the integers found at each place in it.The population where the genetic process applied is a number of 200 chromosomes (in the two examples described in this paper) coded as strings with 49 real values with its 7 possible values (-0.75, -0.5, -0.25, 0, 0.25, 0.5, 0.75) corresponding to the 7 components of the fuzzy partition (NB,NM,NS,Z,PS,PM,PB).

Membership Function (DB) Tuning
This stage tunes the DB of FLC by GA.In this subsection the chromosomes are encoded with the values of parameters of the membership functions (DB).In this paper a real coded GA is used to encode the strings of the population of membership functions.Since 7 MFs of a triangular-shaped are used for each input and output of the FLC there will be 21 MFs altogether.Each chromosome C i will consist the definition of these MFs.Considering each membership function of the input has a parametric representation based on a 3-tuple of real values (A i , B i , C i ) and each membership function of the output has a parametric representation based on a 1-tuple (B i ) hence the total number of parameters tuned is 49 variables per fuzzy system (no. of parameters of each input MF * no. of MFs of each input * no. of inputs + no. of output MFs = 3*7*2+7=49).
The initial chromosome structure for the initial DB shown in Fig. (2) can be represented as The first three genes of values -1, -3/4, and -2/4 are the parametric representation of the first triangle membership function of the input (NB) and the last seven genes are the parametric representation for the centers of the output membership functions (NB, NM, NS, M, PS, PM, PB) respectively.The population of chromosomes consist C 1 as its first chromosome and the remaining ones initiated randomly, with each gene being in its respective interval of performance defined as follows:   4) shows these intervals.

Combination Multi-Stage (CMS) Tuning
GAs can be used for combining the multi-stage (i.e.RB and DB) tuning processes explained previously for improving the fuzzy system specifications based on the FLC of optimized scaling factors.The combination methodology of tuning includes different processes that are not necessarily applied simultaneously.In this paper this methodology, which called combination multi-stage tuning and has been abbreviated as CMS, consists of two component parts: 1.A post-processing stage working on the initial RB set shown in table (1) in order to refine FLC rules (RB tuning stage) using GA as explained exactly in previous subsection (3-2) then, 2. Taking into consideration the optimized fuzzy rules (RB) obtained from the previous stage, in this stage, GA is used to tune the initial membership functions (DB) shown in Fig.
( 2) by the way explained in previous subsection .In this case, each chromosome forming the genetic population will encode a complete DB based on the optimized RB of the FLC.Each piece of chromosome codes the fuzzy partition that assigns a membership function to every linguistic label.

PROBLEM FORMULATION
In this paper, two examples of linear and nonlinear control systems are chosen to evaluate the performance and control capabilities of (RB, DB, and CMS) genetically tuned FLC methods in terms of system response subjected to unit step input, thereby obtaining a comparison between these tuning stages in terms of performance indices and steady state responses.
In the linear and nonlinear examples used in the simulation, the open-loop transfer function of the plants has been converted into a discrete model using zero order hold method.

SIMULATION CONDITIONS First Example (Linear System)
In this example, the third order plant described by the open loop transfer function of an armature controlled DC motor is considered in equation below [8] The

Second Example (Nonlinear System)
In this example, the nonlinear plant described by the open loop transfer function below [2] )
The simulation results obtained using (RB, DB, and CMS) genetically tuned FLC methods are listed in Tables (2 and 3) for linear and nonlinear plants respectively.
These results are shown in Figsure (5 and 6) for linear and nonlinear plants respectively.Where Figure (5) shows the unit step system response of the first example (linear plant) with the FLC corresponding to the different tuning stages.While Figure (6) shows the unit step system response of the second example (nonlinear plant) with the FLC corresponding to the different tuning stages.The simulation result listed in Tables (2 and 3) show that the system response with RB    In the case of CMS genetically tuned FLC method, it has been found that the parameters obtained by GAs at the first stage represent the genetically tuned Rule Base (modified RB) and the parameters obtained by GAs at the second stage represent the triangle parameters that define the genetically tuned Membership Functions (modified MFs) based on the optimized RB.Tables (3 and 4) show the genetically tuned Rule Base (RB) of the FLC for linear and nonlinear plants respectively where the shaded regions refer to fire ruled.Whereas Figures (7 and 8) show the modified MFs of the FLC after MFs tuning based on the optimized RB for linear and nonlinear plants respectively.

CONCLUSIONS
The main advantage of using GA for tuning of Fuzzy PD controller is its ability to adapt to any constraints.In this paper a study of different tuning methods of the FLC for linear and nonlinear systems by GA is carried out.The tuning methods used are rules (RB), membership functions (DB), and combination of them called by combination of multi-stage (CMS) tuning method.By using CMS method, the inference rules and the shapes of MFs in the antecedent and consequent parts of mamdani FLC are optimized by GA.From the simulation results of two examples used, the influence of the tuning methods can be realized from the improvement (decrement) of the performance indices and steady state responses as shown from the responses at Figures ( 5 and 6) for linear and nonlinear plants respectively.Results of comparison are indicated in Tables (2 and 3) for linear and nonlinear plants respectively.From tables, it is clear the CMS-tuning method provides better results than DB or RB tuning methods by improving the steady state characteristics and performance indices of linear or nonlinear control system.

Fig.( 1 )
shows the structure of Fuzzy PD controller used, where ee, cce, and uu are the gains of error, change of error, and control action respectively and often called scaling factors (SFs).T PDF created with pdfFactory Pro trial version www.pdffactory.comEng.& Tech.Journal, Vol.31,Part (A), No.6, 2013 Multi-Stages for Tuning Fuzzy Logic Controller (FLC) Using Genetic Algorithm (GA) 1168 For each of inputs and output of FLC, seven symmetric and triangular-shaped membership functions are defined and evenly distributed on the appropriate universe of discourse which normalized to the interval [-1,1] for linear and nonlinear plants which are used in the simulation results as shown in Figure (2).

Figure ( 2 )
Figure (2) Initial membership function (Mamdani type) of Fuzzy PD controller for inputs (e, ce) and output control action (u).

Figure ( 4 )
Figure (4) Intervals of Performance. i parameters of the DC motor have the following values L m = armature Inductance= 0.025 H R m = armature resistance= 5 Ω B= mechanical friction = 0.01625 Nm/rad/sec J= moment of inertia= 0.042 kgm 2 K W = voltage constant of the motor K T = torque constant of the motor K= motor constant= K W = K T = 0.9The transfer function of the plant is[9]

Figure ( 5 )
Figure (5) Unit step response of the first example (linear plant) (a) Responses of DB and RB genetically tuned FLC.(b) Response of the CMS genetically tuned FLC.(b)

Figure ( 6 )
Figure (6) Unit step response of the second example (nonlinear plant)(a) Responses of DB and RB genetically tuned FLC.(b) Response of the CMS genetically tuned FLC.

Figure ( 7 )Figure ( 8 )
Figure (7) Genetically tuned MFs of the Fuzzy PD controller for linear plant based on the optimized RB .

Table ( 2) Time response specifications of the different tuning stages for linear plant.
(3)genetically tuned FLC is better than that with FLC of optimized scaling factors only, in terms of Integral of Squared Error (ISE), Mean of Squared Error (MSE), and Integral of Time Multiplied by Absolute Error (ITAE) as the performance indices and Percentage Overshoot (PO), Rise Time (Tr), and Settling Time (Ts) as steady state responses.While the CMS-tuning method gives the best performance among them.Where it may be observed, that in the case of linear system results explained in last row of Table(2), the performance indices (ISE, MSE, and ITAE) of the CMS tuned FLC method are (1.3, 0.02, and 0.3714) respectively which are less than these of other tuning methods as shown in the table.In addition, it may be observed that percentage overshoot (PO) of the CMS tuned FLC method is about 5% which are less than these of other tuning methods as shown in this table too.In the same manner, the comparison result of CMStuning method with other tuning stages in the case of the nonlinear plant can be noted in Table(3). or

Table ( 4) Genetically tuned Rule Base (RB) of the Fuzzy PD controller for nonlinear plant.
PDF created with pdfFactory Pro trial version www.pdffactory.comEng.