Abstract
The development of control systems based on fuzzy rules facilitates the solving of problems when insufficient phenomenological information is available. The most common way of grouping fuzzy rules to form a controller is known as Mamdani controller. This controller consists of a set of rules with two premises, the error and the error variation, and one conclusion, the control action variation. One of the most delicate phases of the project of fuzzy systems is the definition of the supports (range) of each fuzzy qualifiers. This work apply genetic algorithms, together with some model of the system, to the adjustment of the supports of the fuzzy sets used in a Mamdani controller. The results show that the automatic adjustment is faster and more efficient that the manual one. Finally, the results are compared with a PID that was also adjusted with genetic algorithms.
Fuzzy logic; Genetic Algorithm; Mamdani Controller
APPLICATION OF GENETIC ALGORITHMS TO THE ADJUSTMENT OF THE SUPPORTS OF FUZZY SETS IN A MAMDANI CONTROLLER
M.M.Mazzucco1^{*} * To whom correspondence should be addressed , A.Bolzan^{2}, R.M.Barcia^{1 } and R.A. F. Machado2
Universidade Federal de Santa Catarina, Centro Tecnológico,
^{1 }Programa de PósGraduação em Engenharia de Engenharia de Produção
^{2} Departamento de Engenharia Química e Engenharia de Alimentos
Email, marcos@lcp.enq.ufsc.br
C.P. 476, CEP 88060970, Florianópolis  SC, Brazil
(Received: October 12, 1999 ; Accepted: April 4, 2000)
Abstract. The development of control systems based on fuzzy rules facilitates the solving of problems when insufficient phenomenological information is available. The most common way of grouping fuzzy rules to form a controller is known as Mamdani controller. This controller consists of a set of rules with two premises, the error and the error variation, and one conclusion, the control action variation. One of the most delicate phases of the project of fuzzy systems is the definition of the supports (range) of each fuzzy qualifiers. This work apply genetic algorithms, together with some model of the system, to the adjustment of the supports of the fuzzy sets used in a Mamdani controller. The results show that the automatic adjustment is faster and more efficient that the manual one. Finally, the results are compared with a PID that was also adjusted with genetic algorithms.
Keywords: Fuzzy logic, Genetic Algorithm, Mamdani Controller.
INTRODUCTION
Control systems based on fuzzy logic (Zadeh, 1965) are indicated to the solution of problems when heuristic knowledge is available. This availability occurs under three forms: IF...THEN rules, vagueness concepts (much, few, high, low...) and numerical limits for this concepts (Mamdani, 1981). The three forms have equal importance to the success of the required solution and depend, in many cases, of the extraction of the specialists knowledge. The specification of the numerical limits (supports) to the fuzzy sets becomes more complex as one takes into account that the specialist does not always express his ideas in a clear way. On the other side the adjustment, or the readjustment, of the supports in fuzzy sets may be performed with base on some data set.
This work presents the adjustment of the supports of the sets that compose the Mamdani controller with base on data obtained from a SISO system (Single InputSingle Output). The adjustment of the Mamdami controller is a simple optimization problem that, due to the nature of the controller, requires a robust optimization method. The flexibility in relation to the objective function, as well as the stochastic nature of the genetic algorithms, were the criteria that oriented the choice of the optimization method. The Genetic Algorithms (GA) (Goldberg, 1989) are easily adaptable to restrictions and do not require a continuous or differentiable objective function.
The optimization strategy adopted is based on the minimization of the absolute error of the system output in relation to the reference, as well as on the minimization of the actions and of the variations of the control actions.
The performance of the Mamdani controller was compared with the performance of a PID controller that was also adjusted by means of genetic algorithms.
MAMDANI CONTROLLER IMPLEMENTATION
The Mamdani controller is constituted of a group of rules and fuzzy sets in which the inference mechanism is the Mamdani one (Mamdani, 1974). The implication of a fuzzy Mamdani system may be characterized by a rule of the kind:
IF [premise 1 is qualification 1] AND [...is...] THEN [consequent is qualification]
Typically, a Mamdani controller is based on the measures of error and error variations with time, making up, hence, two discourse universes: error (E) and error variation (DE). The inference about these two discourse universes is projected over a third one, the control action variation (DU), then the output of the controller is obtained.
Usually, three or five fuzzy sets are used as qualifiers of the discourse universes. Figure 1 illustrates three discourse universes with three sets each: negative, zero and positive. The common shapes employed to define the membership degrees (m) of each qualifier are trapezoidal and triangular.
The upper limit (L+) and the lower limit (L) to the discourse universes are preset from the physical limits of the system. In the case of Figure 1, where three discourse universes are represented, the set of rules presented in Table 1 is generated.
For two discourse universes, the logic connector AND (Tnorm) originally defined by Zadeh (1965), is represented by equation (1).\
Other Tnorm frequently used are the probability, eq. (2), and Lukasiewicz, eq. (3) (Jager, 1995).
(2)
(3)
A compact way of presenting a fuzzy implication of the kind If P_{1} is Q_{1} And P_{2} is Q_{2} Then C is Q is shown in eq. (4);
(4)
where I is the implication (If...Then) and T is the Tnorm.
The membership function generated by the r rule, and hence the fuzzy relation expressed by eq. (4), is determined by eq. (5).
(5)
To a controller with a Tnorm in the form of eq. (1), with the Mamdani implication mechanism and the qualifiers presented in Figure 1, one has:
I(a,b)=min(a,b) (implication of Mamdani)
(6)
T(a,b)= min(a,b)
(7)
(8)
Equation (7) can be applied to the rules set of Table 1, resulting in Table 2, that represents the membership function (m_{r}), for each rule r.
The results of each rule should be aggregated to produce a single result. The aggregation operators are responsible for this task. Once the implication of Mamdani is based on a conjunction (Tnorm), the aggregation operator must be based on a disjunction (Tconorm or Snorm). A typical Tconorm is presented in eq. (9).
The aggregation operator defined to a Mamdani controller with n rules corresponds to eq. (10).
(10)
Finally, the membership function (R) obtained from the aggregation of the results of the rules is converted to a real value (from the real numbers set), known as crisp, through the Center of Area method (COA) (Harris, 1994). The discrete form of the Center of Area method is presented in eq. (11):
(11)
where l is the number of partitions of the domain of the discourse universe (consequent), Li are the discrete values of the discourse universe and m_{R}(Li) are the membership degrees to the discrete values Li.
The implementation of a Mamdani controller is based on the steps described above, with distinction made to Figure 1, Table 2 and equations (10) and (11).
ADJUSTMENT OF THE SUPPORTS OF THE FUZZY SETS
The adjustment of the controller is reduced to a multiple optimization problem, and one wishes to minimize simultaneously:
(a) The error between a system output () and the reference to be achieved in a specified time instant (w_{t+1});
(b) The variations of the control actions (DU) to be applied;
(c) The control actions to be implemented.
Since these objectives are concurrent, that means, the smaller actions or variations in the control actions do not necessarily conduct the system to the reference in the faster way, it is necessary to include terms that allow the equilibration of the degrees of importance. These terms are incorporated as penalization factors of the actions and variations in the control actions, so that the objective function assumes the form of equation (12).
(12)
Usually, equation (12) has a quadratic form, according to eq. (13).
(13)
The format of eq. (13) is necessary due to continuity and differentiability conditions required by the optimization algorithms commonly used. However, this conditions are not necessary to genetic algorithms, allowing the use of the objective function referenced by eq. (12). A function similar to the one of eq. (13) was employed by Mazzucco et al. (1998) to a system modeled by a feedforward neural network.
Fundamentally, the problem consists of adjusting the support of the fuzzy sets that compose a Mamdani controller in such a way that eq. (12) is minimized. The Figures 2, 3 and 4 show the parameters that must be optimized. Strictly, these points do not correspond exactly to the support of the fuzzy sets, but to the range area of each set, because the support of a fuzzy set consists of all the values for which m(x) > 0.
The flow chart of Figure 5 presents the optimization problem in detail.
The fitness of each individual (set of parameters) is calculated from the performance of the Mamdani controller for two set point transitions, an increasing and a decreasing one. Figure 6 presents three possible trajectories resulting from three parameter sets that can be obtained from the adjustment strategy. Obviously, the faster trajectory without overshoot is the one desired, and the result of the optimization must produce the set of parameters that best adapt the Mamdani controller to the objective function of equation (12). The best parameters are, then, definitely inserted in the controller to the application in a SISO type loop, according to Figure 7.
The crossover, selection and mutation operators used were those defined by Goldberg (1989). The elitism operator adopted is based on the maintenance of the genetic information of the individuals of the past generation if their performances are better than the performances of the individuals of the present generation. An elitism rate of 50% implies in the superposition of 50% of the best individuals of the current generation over the individuals of the new generation, if the performance of the last ones is worse than the performance of the first ones. An application for the optimization of a dynamic problem was described by Mazzucco et al. (1998).
The scaling intends to maintain the competition level among the individuals of a population. The Sigma Truncation method, described by Goldberg (1989), is based on the standard deviation and on the average aptitude of the population to perform the scaling of the fitness of each individual. This scaling method was used in this work.
The configurations used in the genetic algorithm are listed in the Tables 3 and 4.
A SIMPLE TEST
A typical SISO system is the level control of a tank (Figure 8). This system can be described by equation (14),considering nonlinear inputs and outputs.
(14)
where h is the level of the water column in the tank (m), , F is the maximum feed flux, (m^{3}/s), D is the diameter of the tank (m), U is the control action (opening of the feed valve), (U= 1, valve 100% closed, U= 5, valve 100% open), K is the valve constant at the exit of the tank.
Data:
D = 0,1 m, K_{V }=1 . 10^{4} m^{5/2}/s, F_{Max }=3 . 10^{4} m^{3}/s;
Initial conditions: h(t=0)=0; U(t=0)=1.
For its simplicity, this system was used to adjust and test both controllers, since an "ideal" adjustment can be accomplished in this case. As an additional test to the system, a white noise of ± 2% was included in order to observe the behavior of the controller in a nonmodeled situation.
During the adjustment phase two set point transitions were adopted, the first one going from 0 to the 1 m position, and the second one going from 1 m to 0.5 m. A similar approach will be given in the next section to the adjustment of the PID controller.
ADJUSTMENT OF THE PID CONTROLLER
Mazzucco et al. (1998) describe a procedure to the automatic identification and adjustment of a PID controller on a first order system. This procedure is illustrated in figure 9. Figures 5 and 9 are similar, exception made to the block responsible for the controller, indicating that the methodology is general for a SISO system. Another important factor to be observed is that in the adjustment of PID controllers with classical techniques (Seborg et al., 1989), only a single positive step is considered, and in this work this is extended to two steps, a positive and a negative one.
The PID controller used, eq. (15), written in the velocity form (Seborg et al., 1989), is obtained from discretization of the continuous form of the PID.
Table 5 presents the limits adopted to the parameters used in the optimization of the PID controller.
Only differences in relation to the objective function (Figure 8) and to the number of parameters (K_{C}, t _{I}, t _{D}) distinguish the optimization of the PID controller from the Mamdani controller optimization.
RESULTS
The performances of the PID and Mamdani controllers were analyzed to four set point variations. The analysis criteria were based on the error in relation to the set point and on the control actions.
The Figures 10 and ^{12} present the behavior of the PID and Mamdani controllers to set point changes, respectively. From the qualitative point of view, both controllers presented a behavior close to the ideal one, that means, conducting the system to the set point in the faster and more efficient way. In the Figures 11 and ^{13} the control actions generated by the PID and Mamdani controllers are shown, respectively. Approximately the same control actions were determined by both controllers, indicating that the objective of minimizing the actions and the variations of the control actions was attained.
The parameters obtained to the Mamdani controller, represented in Figures 2, 3 and 4, are listed in Table 6.
The parameters obtained to the PID controller are listed in Table 7.
Applying a white noise of ± 2% on the output measures of the system, the control actions are stimulated, and the performance of a badly adjusted controller may be degraded. From Figures 14 and ^{16} , it is evident that the noise was appropriately treated by the controller, and there are qualitatively few differences in relation to Figures 10 and ^{12} . However, the control actions exhibited in Figures 15 and ^{17} indicate that the controller acted intensively so that the best response of the system could be attained.
The methodology used in this work can be easily extended to systems with dead time, so that it may become generic for SISO systems.
CONCLUSIONS
The adjustment of controllers is a task that requires ability from engineers and process operators, even in simple cases like the SISO systems. For this class of systems, with the help of a simple model like the one based on a first order system with dead time, it is possible to provide an excellent adjustment for the PID and Mamdani controllers.
Based on the proposed adjustment technique, it is possible to adjust two controllers and, from a performance analysis, choose the best one from the same dynamic data of the process.
The simplicity of the system allowed a precise analysis of the Mamdani controller by comparison with a PID controller adjusted in the same conditions. The adjustment of both controllers for the same situation has shown that the strategy of adjustment is efficient.
The robust nature of the optimization with genetic algorithms has shown to be adequate to the solution of the objective function selected, allowing very good solutions with few generations, independently of the number of parameters.
REFERENCES
 Cancelier, A., Mazzucco, M. M., Machado, R. A. F., Bolzan, "A. Temperature Control of Reactors Using Neural Networks", DYCOPS 5  5th IFAC Symposium on Dynamics and Control of Process Systems, Corfu, Greece, 484 489 (1998).
 Chen, J., Wong, D. S. H., Jang, S., "Product and Process Development using Artificial Neural Network Model and Information Analysis", AIChE Journal, 44, 876887, (1998)
 Goldberg, D. E., "Genetic Algorithms in Search Optimization & Machine Learning", AddisonWesley, USA (1989).
 Harris, C. J., "Advances in Intelligent Control", Taylor & Francis, Great Britain (1994).
 Jager, R., "Fuzzy Logic in Control", PhD Thesis, Technische Universiteit Delft, (1995).
 Mamdani, E. H., "Application of Fuzzy Algorithm for Control of Simple Dynamic Plant", Proc. IEEE, 121, 15851888 (1974).
 Mamdani, E. H., "Advances in the Linguistic Syntesis of Fuzzy Controllers In Fuzzy Reasoning and Its Applications", Academic Press, London (1981).
 Mazzucco, M. M., Claumann C. A., Carlson, L. H. C., Bolzan, A. e Barcia R.M., "Ajuste de um Controlador PID através de Algoritmos Genéticos", ELAIQ' 98 Encuentro Latino Americano de Engeniería Química, Antofagasta, Chile, 588598 (1998).
 Mazzucco, M. M., Machado, R. A. F., Bolzan, A. e Barcia R.M., "Aplicação de uma Rede Neural Feedforward para Controle de Sistemas com tempo morto utilizando horizontes de Controle e Predição Mínimos", ELAIQ' 98 Encuentro Latino Americano de Engeniería Química, Antofagasta, Chile, 599609 (1998).
 Seborg,D. E., Edgar, T. F., Mellichamp, D. A., "Process Dynamics and Control", John Wiley & Sons, Canada (1989).
 Zadeh, L. A., "Fuzzy Sets", Information and Control, 8 ,p338353 (1965).
 Zadeh, L. A., "Probability of Fuzzy Events", Journal of Mathematical Analysis and Applications, 8, 338353 (1965).
Publication Dates

Publication in this collection
16 Mar 2001 
Date of issue
Dec 2000
History

Accepted
04 Apr 2000 
Received
12 Oct 1999