Building an Intelligent Controller using Simple Genetic Type-2 Fuzzy Logic System

Despite the advantages offered by type-2 fuzzy systems (T2FS) in handling uncertainties in control applications, one major problem that hinders its wide-spread implementation in real-time applications is its high computational cost (Hameed, 2010). In order to reduce the computational burden of T2FS, a simplified T2FS based on a hybrid structure of four type-1 fuzzy systems (T1FS) and a genetic algorithm (GA) is introduced (Hameed, 2009). In addition to its rule in providing the system with adaptability to cope with changing conditions, a GA provides the system with a tool to detect and illustrate the amount of uncertainty incorporated in the system. In order to show the robustness and reliability of the new implementation, the developed approach is applied to: (a) control a nonlinear multiinput multi-output (MIMO) system equipped with various types of uncertainties as an example of using T2FS in industrial applications, and (b) evaluate students’ learning achievement as an example of using T2FS in decision support systems. The new implementation of T2FS showed a superior response compared to the very complex and computational costly type-reduction approach. In addition, the ease of using the new implementation, which does not require more than the basic knowledge of T1FS and GA, is expected to help advancing the application of T2FS in multiple different areas of applications. FLS constructed based on type-1 fuzzy systems (T1FS), referred to as T1FLS, have demonstrated their ability in many applications, especially for the control of complex nonlinear systems that are difficult to model analytically (Zadeh, 1973; King & Mamdani, 1997). However, researchers have shown that T1FLS have difficulty in modeling and minimizing the effect of uncertainties (Mendel, 2001). A reason being that, T1FS are certain in the sense that for each input there is a crisp membership grade. T2FS, characterized by membership grades that are themselves fuzzy, were first introduced by Zadeh in 1975 to account for this problem (Zadeh, 1975a). As it is illustrated in Fig. 1, the MF of a T2FS has a footprint of uncertainty (FOU), which represents the uncertainties in the shape and position of T1FS (Wu & Tan, 2004). The FOU is bounded up by an upper MF (UMF) and lower by a lower MF (LMF), both of which are T1MF. Since the FOU of T2FS provides an extra mathematical dimension, they are very useful in circumstances where it is difficult to determine an exact membership grade for FS. Therefore, the amount of uncertainty in a system could be reduced by using T2FLS since it offers better capabilities to handle


148
linguistic uncertainties by modeling vagueness and unreliability of information and hence have the potential to outperform its T1 counterpart (Karnik & Mendel, 2001;Sepulveda et al., 2007a). The ability of T2FLS to eliminate persistent oscillations surpasses that of its T1 counterpart. One reason is that the control surface of a T2FLS is smoother than that of T1FLS, especially around the origin (Tan & Pall, 2003). As a result, small disturbances around steady state will not result in significant control signal changes and thus minimizing the amount of oscillation. The additional degree of freedom provided by the FOU allows T2FLS to handle modeling uncertainties better than conventional T1FLS can do. This advantage is practically useful because many fuzzy controllers are designed offline using genetic algorithms (GA) and a model of the controlled process. As it is impossible for a model to capture all the characteristics of the actual plant, the performance of a controller designed using a model will inevitably deteriorate when it is applied to the actual plant, therefore a controller that is equipped with the ability to handle modeling uncertainties would be valuable. Despite the advantages offered by T2FLS, one major problem that may hinder its use in realtime applications is its high computational cost. Type-reduction, which is used to convert T2FS into T1FS so that they can be processed by the defuzzifier to give a crisp output, is very computationally intensive, especially when there are many MFs and the rule base is large (Karnik & Mendel, 1998, 1999. To reduce the computational burden while preserving the advantages of T2FLS, two approaches may be considered: 1) faster type-reduction methods, such as the uncertainty bound method (Wu & Mendel, 2002); and 2) a simpler architecture, such as using only one T2FS in each input domain (Wu & Tan, 2004). In this chapter, a simplified implementation of T2FLS is proposed. The proposed approach only requires the basic knowledge of T1FLS and GA. Fuzzy Logic Toolbox™ and Optimization Toolbox™ from MathWorks™ are used for carrying out this purpose. The rest of the chapter is organized as follows: Section 2 introduces the proposed simplified implementation of T2FLS using four embedded T1FSs. How GA is used to adjust the controller parameters is described in Section 3. The greenhouse climate control (GCC) problem and a simulation study to assess the ability of the proposed implementation to handle uncertainties are presented in Section 4. Finally, conclusions are drawn in Section 5.

A simplified implementation of T2FS
As illustrated in Fig. 1, a T2FS could be obtained by blurring a T1FS. A Gaussian T1FS is often used to represent vague linguistic terms and it is given by: where ci and σi are the center and width of the ith fuzzy set Ai, respectively, i = 1, 2, …, n, and n is the total number of MFs used to represent a universe of discourse. A Gaussian MF (GMF) with uncertain width (i.e., variance) is obtained by blurring its width and keeping its mean (i.e., center) fixed, as shown in Fig. 1(a). On the other hand, a GMF with an uncertain center is obtained by blurring its center and keeping its width fixed, as shown in Fig. 1(b). In this paper and for the sake of simplicity, GMF with uncertain width has been adopted. The upper and lower bounds of a Gaussian T2FS with uncertain width could be represented by: where Ui Li σ σ ≥ , shown in Fig. 1 (a). The upper and lower bounds of each GMF can be further decomposed into the left and the right side MF and represented in the form: A T2FS can be thought of as a set of an infinite number of T1FSs, and correspondingly, the defuzzified output of T2FLS could be obtained by aggregating the centroids of an infinite number of embedded T1FLSs. When the antecedent and consequent membership grades in T2FLS have a continuous domain, the number of embedded T1FLSs becomes uncountable. For the sake of simplicity and without loss of generality, each T2MF will be represented by its upper (U) and lower (L) bounds which are T1MFs, as shown in Fig. 2. Therefore, each two neighbor T2MFs will intersect in four points instead of one point as is MFs constitute the upper, right, lower and left intersection points will be used as the input/output MFs of the upper, right, lower and left T1FLSs respectively. The defuzzified output of the T2FLS is then obtained by averaging the defuzzified outputs of the resultant four embedded T1FLSs, as shown in Fig. 4. When uncertainty equals zero, the four intersection points become one and T2MF degrades to T1MF. Therefore, the proposed structure will vary between T1 and T2 according to the level of uncertainty detected in the system. The proposed method has more degrees of freedom compared to the method represented by Sepulveda and his colleagues in which type-2 MF is decomposed into only UMF and LMF (Sepulveda et al., 2007a;Sepulveda et al., 2007b Fig. 4. Simplified type-2 fuzzy logic system: controller output is the average of the four outputs of the embedded upper, left, right, and lower type-1 fuzzy logic systems, x 1 and x 2 are the controller inputs and y is the controller output. Holland in 1975(Holland, 1975Goldberg, 1988). In this chapter, a GA will be used to evolve the parameters of the proposed implementation of T2FLS to test the hypothesis that the simplified architecture retains the ability to handle measurement and modeling uncertainties. It is not mandatory to use a GA to adjust the controller parameters and instead the controller parameters could be set manually. GA will not only be used as an optimization algorithm but rather it will be used as an uncertainty sensor to detect the level of uncertainty which exist in the controlled system. In other applications such as students\s evaluation, GA can not be used and a proper thickness of T2FS would be manually selected. The thickness of a T2FS will increase as the amount of uncertainty detected in the systems is increased and vice versa. When the uncertainty level is very low or zero, the thickness of a T2FS will equal to zero and the controller will simply behave like a T1FLS. In this chapter, seven MFs are used. The centers of the MFs are set constant, -1 for negative big (NB), -2/3 for negative medium (NM), -1/3 for negative small (NS), 0 for zero (Z), 1/3 for positive small (PS), 2/3 for positive medium (PM) and 1 positive big (PB) and their optimum widths are obtained using a real-valued GA. Each T2GMF has two widths, U σ and L σ where UL σ σ ≥ while T1GMF has only one width value, σ . Since each controller input and output variables are set to the same range of universe of discourse, [-1, 1], three additional parameters, called scale factors (SFs), could be tuned. SFs are real constants which multiply the values of the variables (input or output variables), modifying the limits of their variation range, and therefore have a significant impact on the performance of the resulting fuzzy control system, and hence they are often a convenient parameter for tuning. The modification of the input scale factors has a general effect on the behaviour of the system: increasing input gains implies reducing their universes of discourse, having a direct consequence on control: the response is faster and more oscillatory, reducing the stationary error. It thus improves the transient response by reducing rise time and set-up time, but it does increase the risk of instability with the overshoot increment. On the other side, reducing input gains produces the opposite effects; the wider the membership functions the rougher control can be achieved, which produces a slower response with less overshoot. However, the variation of the output gain has a complex relation with the behaviour of the controller and has not been analysed in depth (Rojas et al., 2006). For the sake of simplicity, it is assumed that all MFs have equal widths. For T2FLS, five parameters namely, U σ , L σ , SF 1 , SF 2 , and SF 3 and for T1FLS, four parameters, namely, σ , SF 1 , SF 2 , and SF 3 have to be tuned. For the proposed T2FLS, up to 4(2n+3) parameters could be optimized, where 4 stands for 4 embedded T1FLSs, 2 stands for the center and the width of the GMF, n stands for the number of MFs used in universe of discourse, and 3 stands for 3 SFs of the input and output parameters of each embedded T1FLS, which could result in better results but also requires greater computational costs. The fitness function used to quantify the optimality of a solution (i.e., chromosome) is the reciprocal of the Integral of Square Error (ISE), given in Eq. (8) where the error e is the difference between the desired set point and the actual system output (Sepulveda et al., 2007b). Chromosomes in a population are ranked according to their fitness value. Optimal or near optimal chromosomes (i.e., solutions) are allowed to reproduce through new generations that will (hopefully) be even better. In this paper, the maximum number of generations is set to 30. The number of chromosomes or solutions in a population is set to 20. The mutation and crossover probability are set to 0.2 and 0.25 respectively. The roulette wheel selection method is used to select the fittest chromosomes, the generational process is repeated until a termination condition has been reached; a solution is found that satisfies minimum criteria or a fixed number of generations reached.

Simulation experiments
In this section, the developed implementation of T2FS will applied to Greenhouse climate control (GCC) problem as an example of an industrial application. It will also applied to the problem of students' evaluation as an example of using T2FS as a decision support system. GCC has received considerable attention in agricultural engineering research (Albright et al., 2001;Koutb et al., 2004;Van Henten & Bontsema, 2009). Controlling the climate inside a greenhouse is a challenging task because of the many sources of uncertainty. Such uncertainty could arise from using none or near accurate models, greenhouse orientation, age and type of crop inside the greenhouse, sensor measurements, actuators and outdoor climate conditions. In this chapter, a simple greenhouse heating-cooling ventilating (HCV) model will be used to control temperature and humidity ratio inside a greenhouse by means of heating, ventilating, and humidifying the air inside the greenhouse. ). In this chapter, two types of uncertainty will be introduced to the system to evaluate the performance of the proposed controller; 1) measurement uncertainty which is introduced to the system by adding random noise to sensory measurements, and 2) modeling uncertainty which is introduced to the system by changing the model parameters by ±10%. A first simulation experiment has been conducted to demonstrate the ability of control scheme to provide non-interacting control and smooth closed-loop response to set-point step change. Measurement uncertainty has been introduced by adding a 10% multiplicative error to all the measured signals. The responses for set-point step changes in temperature and humidity ratio for T1 and T2 controllers are shown in Fig. 5. Fig. 6 illustrates the controller outputs. A simulation of the outside weather conditions of a normal hot day are shown in Fig. 7. The T1MFs and T2MFs for both temperature and humidity loops are shown in Fig. 8, respectively. Fig. 9 illustrates the control surface for both T1 and T2 controllers, respectively.       Table 1. Parameters of type-1 (T1) and type-2 (T2) fuzzy logic controllers obtained by GA where measurement uncertainty is introduced in experiment 1 and modeling uncertainty is introduced in experiment 2. SF e , SF Δe , and SF Δu are the scale factors of error, change of error and change of control signal respectively.
The parameters of T1 and T2 controllers are shown in Table 1. From the table, the difference between σ L and σ U increases as the level of uncertainty detected in the system increases. For the sake of comparison, Mean Squared Error (MSE) and Signal-to-Noise Ration (SNR) for temperature and humidity loops are computed for T1, T2 (the proposed structure), T2 structure proposed by Sepulveda and his colleagues (Sepulveda et al., 2007b) and T2 using type-reduction method (Mendel, 1998), as shown in Table 2. Although the performance of the proposed structure of T2FLS using four embedded T1FLSs is similar to the performance of T2 using type-reduction (T2TR) but implementing T2TR requires acquiring new knowledge and writing new codes but in the case of the proposed T2 structure using four embedded T1FLSs, only the basic knowledge of T1 fuzzy sets is required and take the advantage of using MATLAB® Fuzzy Logic Toolbox™ and Optimization Toolbox™ from MathWorks™ for ease of implementation. Type-2 fuzzy controller using type-reduction method 1.7439 0.0294 0.0309 Table 2. Mean squared error (MSE) and signal-to-noise ratio of temperature (SNRT) and humidity ratio (SNRH) of different types of controllers when measurement uncertainty is introduced in experiment 1 and modeling uncertainty is introduced in experiment 2 Saleh and Kim (2009) proposed a three nodes fuzzy system to evaluate students' learning achievement. The transparency and objective nature of the fuzzy system makes their method easy to understand and enables teachers to explain the results of the evaluation to sceptic students. The method involved conventional triangular MFs of fixed parameters which could result in different results when changed. In order to improve the reliability and robustness of the system, Gaussian membership functions (GMFs) are proposed as an alternative to the traditional triangular MFs (Hameed & Sorensen, 2010). When the three nodes system based on Gaussian membership of width of 4.0 is applied to all students, the resultant new total scores of students rounded to two digits are equal to that of the classical scores but with new ranking orders. The same result is obtained when the T2FS for σ L and σ U of 0.2 and 0.4, respectively, are applied.

Conclusions
The proposed architecture of Type-2 FLS using four embedded Type-1 FLSs provides a smoother control surface and a greater ability to detect and treat the measurement and modeling uncertainties in the controlled system with the aid of a GA. It also achieved a dramatic reduction in computational complexity without sacrificing performance compared to its equivalent type-2 FLS with type-reduction method. The proposed T2FLS is easy to implement using MATLAB® Fuzzy Logic Toolbox™ from MathWorks™ and it does not require more than the basic knowledge of T1FLS.