Comparison of performance criteria for of PAPCS using tuned and no tuned FLC.
In the early days, the parameters of the fuzzy logic systems were fixed arbitrary, thus leading to a large number of possibilities for FLSs. In 1992, it has been shown that linguistic rules can be converted into Fuzzy Basis Functions (FBFs), and numerical rules and its associated FBFs must be extracted from numerical data training. Since that time, a multitude of design methods to construct a FLS are proposed. Some of these methods are intensive on data analysis, some are aimed at computational simplicity, some are recursive and others are offline, but all based on the the same idea: tune the parameters of a FLS using the numerical training data. Methods for designing FLSs can be classified into two major categories: A first category where shapes and parameters of the antecedent MFs are fixed ahead of time and training data are used for tuning the consequent parameters, and a second category that consists of fixing the shapes of the antecedent and consequent MFs using training data to tune the antecedent and the parameters of the consequent.
Two kinds of FLSs, the Mamdani and the Takagi-Sugeno-Kang (TSK) FLSs are widely used and they are currently adopted by the scientific community. They solely differ in the way the consequent structure is defined. The fact that a TSK FLS does not require a time-consuming defuzzification process makes it far more attractive for most of applications.
In this chapter, we consider the first category to design a TSK FLS basing on alinear method. Our design approach requires a set of input-output numerical data training pairs. Given linguistic rules of the FLS, we expand this FLS as a series of FBFs that are functions of the FLS inputs. We use the input training data to compute these FBFs. Therefore, the system becomes linear in the FLS consequent parameters, and we consider each set of FBFs as a basis vector which is easy to be optimized. Then follows the consequent parameters optimization via a minimizing process of the error vector - the output training data minus the FBFs vectors weighted by the consequent parameters - norm. This minimzation can be obtained by applying the Generalized Orthogonality Principle (GOP). Optimization process is carefully analyzed in this chapter and its applications in two major areas of concern are demonstrated including robotics and dynamic systems. Firstly, we shall show the improved results with analysis upon the application of GOP in the Fuzzy Logic Controller (FLC) for an inverted pendulum. Secondly, we show how a FLS based on this principle enhances the performance of forecaster for the chaotic time series.
2. Fuzzy Logic Systems (FLS) basic concepts
2.1. Fuzzy sets
A Fuzzy Set (FS), is a set of ordered pairs of a generic element and its degree, namely Membership Function (MF),. Any FS can be represented as follows:
where the membership degree of, , is constrained to be betwwen and for all
2.2. Mamdani FLS
An FLS is an intuitive and numerical system that maps crisp (deterministic) inputs to a crisp output. It is composed of four elements which are depicted in Figure 1. To completly describe this FLS, we need a mathematical formula that maps the crisp input into a crisp output we can obtain this formula by following the signal through the fuzzifier to the inference block and into the defuzzifier. We explain, in this section, the working principle of this formula.
The FLS is associated with a set of IF-THEN rules with meaningful linguistic interpretations. The th rule of a FLS having inputs and one output, Multiple Input Single Output (MISO), is expressed as:
where are fuzzy antecedent sets wich are represented by their MFs, and is a consequent set where (is the number of rules in the FLS).
A fuzzifier maps any crisp input into a fuzzy set in .
A fuzzy inference engine combines rules from the fuzzy rule base and gives a mapping from input fuzzy sets in to output sets in. Each rule is interpreted as a fuzzy implication, i.e., a fuzzy set in, and can be expressed as:
Usually in Mamdani FLS, the implication is replaced by a t-norm, i.e. (product or). Multiple antecedents are connected by a t-norm, so a rule can be expressed by its MF as follows:
where and are operators (or). The p-dimensional input to is given by the fuzzy set whose MF is expressed as 
Each rule detemines a fuzzy set in which is derived from the composition. Then, the MF of this output set is expressed as 
Finally, the th rule is expressed as follows
As we pointed out before, the main idea of a Mamdani FLS is to use crisp inputs to make fuzzy inference and finally find a crisp output which represents the behavior of the FLS. The process of finding a crisp output after fuzzification and inference is called Deffuzification. This final step consist on find an operation point given the results of the inference process of the FLS, which results on a fuzzy output set, so we need to use a mathematical method which returns a crisp measure of the behavior of the FLS.
There are many types of defuzzifiers, but we consider in this paper the Height Defuzzifier which replaces each rule output fuzzy set by a singleton at the point having maximum membership in that output set, , then it calculates the centroid of the resultantF set of these singletons. The crisp output of this defuzzifier is expressed as:
where is the point having maximum membership in the output set .
2.3. Takagi-Sugeno-Kang (TSK) FLS
A TSK FLS is a special FLS which is also characterized by IF-THEN rules, but its consequent is a polynomial. Its output is a crisp value obtained from computing the polynomial output, so it does not need a defuzzification process. The rule of a first order type-1 TSK FLS having inputs and one output is expressed as:
where, are the consequent parameters, is the output of the th rule, and are type-1 antecedent fuzzy sets.
The output of a TSK FLS is obtained by combining the outputs from the rules in the following form:
where are the rule firing levels and they are defined as:
where is a operation, i.e. minimum or product operation (Mendel ), and is the vector of inputs applied to the TSK FLS.
2.4. Fuzzy basis functions
For Mamdani FLSs, assuming that all consequent MFs are normalized, i.e., and using singleton defuzzification, max-product composition and product implication, then the output of the height defuzzifier becomes:
The FLS in can be expressed as:
where is called a Fuzzy Basis Function (FBF) of the rule , and it is defined as:
where is given in.
2.5. Weighted FBF
The crisp output of the TSK FLS in can be expressed as:
It can also be expressed as:
where is the Weighted Fuzzy Basis Function (WFBF) of the rule which is expressed as :
This linear combination allows us to view the FLS as series expansions of WFBFs . The WFBFs have also a capability of providing a combination of both numerical and linguistic information.
3. Orthogonality principle
We explain in this section how we can obtain, graphically, the optimal scalar that minimizes the norm of an error vector .Suppose that we have a set of measurements collected in a -vector, , gathered for different values collected in another -vector,. The problem is to find :
As shown in Figure 2, we can see that the optimal scalar that minimizes the norm of the error vector, , is obtained when. This can be expressed as follows :
Solving for we have:
4. FLS design based on GOP
GOP is an optimization principle which can be applied to both Mamdani and TSK FLSs. Under the premise of fixed shapes and the parameters of the antecedent MFs over the time, then a training dataset is used to tune the consequent parameters. The consequent parameters are in for a TSK FLS, and in for a Mamdani FLS.
4.1. Mamdani FLS design
Given a collection of input-output numerical data training pairs
where and are respectively the vector input and scalar output of the FLS given by. We have to tune the using these data training. Firstly, we compute the FBFs with training input vectors, then we apply the orthogonality principle on these FBFs and the training output vector.
Equation (14) can be decomposed as follows:
So we have
Now, if each FBF is considered as a basis function, we can compose the following vector:
where is the number of rules. We now collect all the training output data in the same vector
and the parameters of the consequent in a vector:
By considering the equations, a FLS can be expressed in vector-matrix format as follows:
where the fuzzy basis function matrix is given by:
To find the optimal vector and because of fitting with basis sets, we generalize the presented orthogonality principle to a multi-dimensional basis leading to a GOP. The error vector should be perpendicular to all of the basis fuzzy vectors, as shown in Figure 2.
In a matrix form, we obtain:
Solving for, we have:
where is a vector which contains the parameters of the consequent, i.e., in (3).
4.2. TSK FLS design
In the same way, the consequent parameters of a TSK FLS are tuned. The design approach is related to the following problem:
Given a collection of input-output numerical training data pairs:
where is the input vector (inputs with) and is the scalar output of the FLS given by. We have to tune the using these data training.
The WFBF vectors are computed using the training input data, then the GOP is applied to the combinations of WFBF vectors and the of dimensional training output vector.
Using the elements of the input-output training pairs, the TSK output given in, can be rewritten as follows:
where. Collecting the equations we obtain:
By taking each set of WFBFs as a Weighted Fuzzy Basis Vector, WFBV:
and each set of outputs as a vector, the output vector can be expressed as follows:
Now we have to tune parameters for each rule, i.e., vectors of dimension.
If we define the element of as, we have:
the output vector becomes :
In a matrix form, becomes :
So the Weighted Basis Function Matrix (WBFM) can be defined as:
The optimal parameters of the consequent conforms a vector, in are obtained when the error vector, , must be perpendicular to all the weighted fuzzy basis vectors,, which are the columns of the WBFM, as shown in Figure 4.
This may be expressed directly in terms of the WBFM as follows:
Solving for provides the following
5. FLC design for controlling an inverted pendulum on a cart
5.1. Description of the system
Schematic drawing of an Inverted pendulum On a Cart (IPOC) system is depicted in Figure 5. where is the position of the cart, is the angle of the pendulum with respect to the vertical direction and is the external acting force in the In order to keep the pendulum upright, we design a Fuzzy Logic Controller (FLC) using the GOP.
The Lagrange equation for the position of the pendulum, , is given by:
The Lagrange equation for the position of the cart, , is given by:
where is the moment of inertia of the bar. The masses of the cart and the rod are and, respectively. The rod has a length
Since the goal of the control system is to keep the pendulum upright the equations can be linearized around. We chose as the state vector, where is the pendulum angle variation and is the cart position variation. The state representation is given by:
5.2. FLC structure and design
We try to keep the pendulum upright regardless the cart’s position, i.e., Pure Angular Position Control System (PAPCS). Then, the two inputs of the Fuzzy Logic Controller FLC are the angular pendulum position, , and its derivative, , i.e., and its output is the applied force to the system force.
In this case, we use a Mamdani FLS with four rules. We use gaussian MF to fuzzify the two controller’s inputs and triangular MF to fuzzify the controller output.
where and are respectively the centers and standard deviations of these MFs.
Figure 9 shows the 56 data training and the optimal fitting given by the GOP method.
The obtained optimal consequent parameters are
Figure 10 shows the response of the pendulum system controlled by the designed FLC to a reference with its response at the same reference when it is controlled by untuned FLC. The initial state vector is.
We evaluate the proposed design by using its error rate. For quantifying the errors, we use three different performance criteria to analyze the rise time, the oscillation behaviour and the behaviour at the end of transition period. These three criteria are: Integral of Square Error (), Integral of the Absolute value of the Error () and Integral of the Time multiplied by Square Error ()
Table 1 summarizes the obtained values of ISE, IAE and ITSE of PAPCS using FLC, when tuning and no tuning are used.
We notice from this table that the errors obtained when tuning is used are all smaller than those obtained with untuned FLC. Fig.11, 12, 13 show the different quantified errors.
Figures 10, 11, 12 and 13 show that the system using tuning is less oscillatory, having a rise time and errors at the end of transition period smaller than those obtained by untuned FLC.
6. FLS design for predicting time series
We apply the GOP to design an FLS which predicts a time series. The FLS has to predict the future value of a Mackey-Glass time series which is volatile. The following four antecedents were used: and, which are known values of the time series (, ).
The training data are obtained by simulating for. We use the samples to train the IT2 FLS and the samples for testing. We use two Gaussian MFs per antecedent, so we have then rules. The MFs of the antecedents are Gaussian, where its mean and the standard deviation were obtained from the training samples,. Table 2 summarizes the consequent parameters per each rule.
Figure 14 displays performance of the FLS in training data, and Figure 15 shows its results on Testing data. Note that the GOP-designed is a better forecaster, since the differences from original data are small in both training and testing data sets.
Some additional analyses should be performed to verify the goodness of fit of the method (See , and ), but in this case, the proposed GOP has shown good results, so we can recommend its application to real cases. Time series analysis is an useful topic for many decision makers, so the use of optimal and easy-to-be-implemented techniques, as the proposed one has a wide potential.
7. Concluding remarks
In this chapter we have presented an enhancement method of fuzzy controllers using the generalized orthogonality principle. We applied the method to two different cases: a first one involving control of an inverted pendulum and a second one for fuzzy forecasting. In the first application, numerical rules and their FBFs were extracted from numerical training data. This combination of both linguistic and numerical information simultaneously become FBFs an useful method. Since a specific FLS can be expressed as a linear combination of FBFs, we generalized orthogonality principle on FBFs that results in a better FLS.
In the second study case, we applied the GOP to design a FLS for time series forecasting. The FLS has been applied to a Mackey-Glass time series with better results compared to a non-GOP FLS. The results were validated with simulations.
All the FBFs can be seen as a basis vector, which allows to optimize the parameters of the consequents. This means that the error vectors are orthogonal to these FBFs, resulting in the minimization of the magnitudes of these error vectors, and consequently an optimal FLS.
The proposed method has a wide potential in complex forecasting problems (, and ). Its application to hardware design problems () can improve the performance of fuzzy controllers, so its implementation arises as a new field to be covered.