On Development of Fuzzy Controller: The Case of Gaussian and Triangular Membership Functions

In recent years , the use of Fuzzy set theory has been popularised for handling overlap domains in control engineering but this has mostly been within the context of triangular membership functions. In actual practice however , such domains are hardly triangular and in fact for most engineering applications the membership functions are usually Gaussian and sometimes cosine. In an earlier paper , we derived explicit Fourier series expressions for systematic and dynamic computation of grade of membership in the overlap and non-overlap regions of triangular Fuzzy sets. In another paper , we extended the methodology to cover cases of cosine , exponential and Gaussian Fuzzy sets by presenting explicit Fourier series representation for encoding fuzziness in the overlap and non-overlap domains of Fuzzy sets. This current paper presents the development of a “ Fuzzy Controller ” device , which incorporates the formal mathematical representation for computing grade of membership of Gaussian and triangular Fuzzy sets. It is shown that triangular approximation of Gaussian membership function in Fuzzy control can lead to wrong linguistic classification which may have adverse effects on operational and control decisions. The development of the Fuzzy controller demonstrates that the proposed technique can indeed be incorporated in engineering systems for dynamic and systematic computation of grade of membership in the overlap and non-overlap regions of Fuzzy sets ; and thus provides a basis for the design of embedded Fuzzy controller for mission critical applications.


Introduction
The key elements in human thinking are not numbers, but labels of Fuzzy sets, viz: classes of objects in which the transition from membership to non-membership is gradual rather than abrupt (Zadeh [1]).Fuzzy logic has found applications for control and analysis purposes, as for example recorded in the work of Bellman and Zadeh [2], Berenji and Khedar [3].Ruan and Fantoni [4] also reported industrial applications of Fuzzy logic.Olunloyo and Ajofoyinbo [5] applied hybrid Fuzzy-stochastic methodology for maintenance optimization.Araujo, Sandri and Macau [6], Marinke and Araujo [7], and Moura, Rodrigues and Araujo [8] presented some other industrial applications of Fuzzy systems/logic most of which are related to thermal-vacuum processes, usually encountered in particular, in the qualification of space devices.Savkovic [9] studied Fuzzy logic theory and applied it to the process control system.Ji and Wang [10] developed an adaptive Neural Fuzzy Controller for active vibration suppression in flexible structures.Researchers generally treat the overlap region as intersection or union of two or more Fuzzy sets and have invoked the Min and Max operators, respectively, as needed.Olunloyo, Ajofoyinbo and Badiru [11] proposed an algorithm for the treatment of overlap of adjoining Fuzzy sets based on partitioned grids.In view of the importance of this Fuzzy overlap region, especially where there is need to monitor and ensure smooth transition between the adjoining Fuzzy sets in relation to the design of mission critical applications, Olunloyo and Ajofoyinbo [12] proposed an alternative approach for computing membership function based on the Fourier series representation of the envelope of the Fuzzy patch.In the literature, for example, as in the work of King and Mamdani [13], and Zimmermann [14], most control applications use triangular and trapezoidal profiles for membership functions.However, such triangular or trapezoidal assumptions, in most applications are generally poor approximations of the prevailing Gaussian membership function that governs most engineering processes.The Gaussian membership function applies in engineering problem domain, especially for engineering measurements; as it gives actual representation at every point.
According to Ross [15], membership function essentially embodies all fuzziness in a particular Fuzzy set, and its description is the essence of a Fuzzy property or operation.Watanabe [16] asserted that the statistical techniques for determining membership functions fall into two broad categories viz: use of frequencies and direct estimation.The two methods were analysed by Turksen [17] when he reviewed the various methods and their methodology for implementation.The determination of membership function can also be categorized as either being manual or automatic.The automatic generation of membership function emphasises the use of modern soft computing techniques (in particular Genetic Algorithm and Neural Networks).Meredith, Karr and Krishnakumar [18] applied Genetic Algorithm (GA) to the fine tuning of membership functions in a Fuzzy logic controller for a helicopter.Karr [19] applied GA to the design of Fuzzy logic controller for the Cart Pole problem. Lee and Takagi [20] also tackled the Cart problem.In their case, they took a holistic approach by using GA to design the whole system (determination of the optimal number of rules as well as the membership functions).Moreover, Ross [21] reported on six methods for developing membership functions namely: intuition, inference, rank ordering, neural networks, genetic algorithm and inductive reasoning.The manual and automatic techniques for determining membership functions of Fuzzy sets are nonsystematic and suffer from certain deficiencies.On the one hand, most of the existing automatic techniques are heuristic in nature; which implies that different values can be obtained for same input values presented at different times.On the other hand, the manual techniques suffer from the deficiency that they rely on subjective interpretation of words and the peculiarities of the engaged human expert.
By analyzing the nature of the overlap patches defined by the intersection and union of a typical grade of membership function for a linguistic variable, it is shown that the resultant signal does fall into the class of functions for which a Fourier series representation can be written.The problem then is to construct such a series and compute the corresponding coefficients.Furthermore, in order to align the results with the properties of membership functions, some element of normalization and standardization is introduced.To be more specific, starting with triangular Fuzzy sets, Olunloyo, Ajofoyinbo and Badiru [22] formulated explicit Fourier series representation for computing the grade of membership in the overlap and non-overlap regions.Ajofoyinbo [23] derived explicit Fourier series expressions for encoding fuzziness in the overlap and non-overlap domains of membership functions of different Fuzzy sets.This methodology was extended by obtaining explicit Fourier series expressions for computing the union and intersection of the Gaussian, cosine and exponential Fuzzy sets.In [24], Olunloyo, Ajofoyinbo and Ibidapo-Obe presented an implementation of embedded "Fuzzy Controller" via simulation.In the current work, the development of Fuzzy controller based on Fourier series representation for computing grade of membership of Gaussian and triangular Fuzzy sets are presented.This paper also investigates the performance of Fuzzy controller based on Gaussian and triangular membership functions, in classifying data values in the universe of discourse.The remainder of this paper is organized as follows: Problem formulation is presented in Chapter 2. This is followed by Systems design and implementation in Chapter 3. Discussion of sample results is presented in Chapter 4. Chapter 5 concludes the paper.

Problem Formulation
Fundamental conditions for Fourier series representation are: 1) Function must be periodic, 2) Function must have finite number of discontinuities, and 3) Function must be bounded.
We note that the universe of discourse in a Fuzzy plane consists of one or more data points.Each of the data points in a given universe of discourse has some form of data distribution around it in the form of some distribution profile, whether Gaussian, exponential, triangular or any other.Since all data points in the universe of discourse would have same form of data distribution around every data point, we could therefore derive an explicit Fourier series expression for the envelope of the Fuzzy patch since we can be assured of the repetition of the assumed distribution pattern around each data point.Moreover, in as much as the distribution around the data points has same shape, then appropriate normalisation can be introduced to transform the union and intersection of such Fuzzy sets into functions that are amenable to Fourier series representation.Although various functional profiles of membership functions could be used, the triangular and trapezoidal have in the past served as approximations of the others in the first instance.In fact, the trapezoidal form can, further, be approximated by the triangular form since the end-points of the 'tolerance' interval in a trapezoidal distribution have the same grade of membership and could therefore be assigned a point value that represents the peak of the triangular profile.In Sections 2.1 and 2.2 below, we present Fourier series representation for computing union and intersection of Gaussian and triangular Fuzzy sets respectively.

Fourier Series Representation for Gaussian
Membership Function The membership function of union of Gaussian Fuzzy sets is computed as follows: w here Recall from Abramowitz and Stegun [25]: From Equation (4), we define 1 I and 2 I as: We compute coefficients and as follows: I and 2 I from Equations ( 5) and ( 6) respectively, we can re-write Equation (7) as follows: Similarly, we obtain the expression for computing membership function in the overlap region of Gaussian Fuzzy sets (i.e., intersection of the Gaussian Fuzzy sets) as follows: where By invoking Equation (3), we can express Equation ( 13) as: From Equation ( 14), we define 1 J and 2 J as: Coefficients and are then computed as follows: Upon substituting 1 J and 2 J from Equations ( 15) and ( 16) respectively, we can re-write Equation (17) as: and

Fourier Series Representation for Triangular Membership Function
The Fourier series representation for computing the grade of membership of the intersection of triangular Fuzzy sets (i.e.triangular pulses) is given by: where For the case k odd, and for the case k even Similarly, the Fourier series representation for the union of triangular Fuzzy sets (i.e.polygonal waveform) is given by: where for the case k odd, while, for the case k even, where .i.e. maximum grade of membership for the intersection of triangular Fuzzy sets.

Systems Design and Implementation
We briefly describe the development of a "Fuzzy controller" to measure temperature and pressure, and produce some output that can represent input to other sub-s ystems or systems.Itemised below are some of the de-tails of systems design and the implementation of the Fuzzy Controllers.The electrical circuit is presented in Figure 1, while the corresponding photo-image of the device is presented in Figure 2.
The circuit in Figure 1  There are only four units of the PIC16F877A Microcontrollers deployed in the circuit.Each Microcontroller is configured with XT 4MHz Crystal.Moreover, the circuit incorporates the LCM-S01602DSF/C Liquid Crystal Display (LCD) output unit capable of displaying 2 × 16 characters.
The four (4) Microcontrollers are grouped into two functional sections namely: a) Section 1: Temperature This section consists of two (2) Microcontrollers.Microcontroller #1 executes the Program code for temperature input from the LM35D Sensor; it also conditions and convert signals to digital form, and computes grade of membership of the Gaussian Fuzzy sets.Similarly, Microcontroller #2 executes the corresponding program code for temperature input from the LM35D Sensor, digitises the signals, and computes membership grades of the triangular Fuzzy sets.Switching between Sections 1 and 2 is achieved with the Switch labelled TEMP/PRES; while switching between the two Microcontrollers in each Section is achieved with the Switch labelled IC SEL.

Use of Fourier Series Representations in the Fuzzy Controllers
We note that the Program code for the implementation of the Fuzzy controller is written in HITECH ANSI C Language and programmed onto the Microcontrollers using the Microchip PICSTART Plus Programmer.

Working Principle of the Fuzzy Controller
The Fuzzy controller starts by obtaining the real temperature/pressure value and executes the Program code for temperature/pressure input.The Fuzzy Controller conditions and converts the input signal to digital form.The conversion result is subsequently passed to the Function in the Program code that does further processing of the result, computes the grade of membership (i.e.Gaussian or triangular) based on the Fourier representation and relates this value to appropriate linguistic value.The final output (i.e.Very Low, Low, Low Normal, Normal, High Normal, High, Very High) and the corresponding input value from the sensor, which is converted to characters, are then displayed on the LCD.Sample Fuzzy rules for the Fuzzy Controller for the case of union of Gaussian Fuzzy sets are presented be-

System Flowchart
We present the system flowchart for the operations of the Fuzzy Controller in Figure 3.

Discussion of Sample Results Obtained from Device for Temperature Measurements
We present in

Summary and Conclusions
Fuzzy logic is very relevant in machine, process or systems control, and particularly as a means of making machines more capable and responsive by resolving intermediate categories in between states hitherto classified on bivalent logic.In recent years, the use of Fuzzy set theory has been popularised for handling overlap domains in control engineering but this has mostly been in the context of triangular membership functions.In actual practice however, such domains are hardly triangular and 27)We note that 0  is the point of overlap of the two adjoining triangular Fuzzy sets.Thus, 0  represents the maximum grade of membership of the intersection of the triangular Fuzzy sets.In compliance with the requirements of the membership function of Fuzzy set, in respect of the intersection, we normalize   f x as follows: consists of the following major hardware components: a) Microchip 40-Pin Enhanced Flash PIC16F877A Microcontrollers b) LM35D precision integrated-circuit temperature sensor c) MPX4115A piezoresistive pressure sensor, and d) LCM-S01602DSF/C Liquid Crystal Display (HD 44780-compliant LCD)

Figure 1 .
Figure 1.Electrical circuit of the fuzzy controller.

Figure 2 .
Figure 2. Photo image of the fuzzy controller device.b) Section 2: Pressure This section consists of two (2) additional Microcontrollers to handle the pressure readings from the MPX 4115A Sensor.Microcontroller #3 computes grade of membership of the Gaussian Fuzzy sets, while the Microcontroller #4 computes the grade of membership of the triangular Fuzzy sets.Switching between Sections 1 and 2 is achieved with the Switch labelled TEMP/PRES; while switching between the two Microcontrollers in each Section is achieved with the Switch labelled IC SEL.

Table 1 ,
sample results obtained from the Fuzzy Controller device for temperature measurements.For example, a decision rule that would have related to Normal linguistic class, would by virtue of wrong classifications, be related to others.

Table 1 . Results-Linguistic classification.
fact for most engineering applications are usually Gaussian and sometimes cosine.In this paper, we presented Fourier series representation for the systematic computation of membership functions for Gaussian and triangular Fuzzy sets.We also presented the development of a "Fuzzy Controller" to measure temperature and pressure and produce output that can represent input to additional sub-systems or systems.By way of comparative analysis, it is shown that triangular approximation of Gaussian membership function in Fuzzy control can lead to wrong linguistic classification(s) which may have adverse effects on operational and control decisions.The development of the Fuzzy controller device clearly demonstrates that the proposed technique can indeed be incorporated in engineering systems for the dynamic and systematic computation of grade of membership in the overlap and non-overlap regions of Fuzzy sets; and thus provides a basis for the design of embedded Fuzzy Controller for mission critical applications. in