Open

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.


Introduction
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.

Fuzzy sets
A Fuzzy Set (FS), F ∈ X is a set of ordered pairs of a generic element x and its degree, namely Membership Function (MF), μ F (x). Any FS can be represented as follows: where the membership degree of x, μ F (x), is constrained to be betwwen 0 and 1 for all x ∈ X.

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 x into a crisp output y = f (x), we can obtain this formula by following the signal x through the fuzzifier to the inference block and into the defuzzifier.We explain, in this section, the working principle of this formula.

Rules
The FLS is associated with a set of IF-THEN rules with meaningful linguistic interpretations.
The lth rule of a FLS having p inputs x 1 , ..., x p and one output y ∈ Y, Multiple Input Single Output (MISO), is expressed as: where

Inference
A fuzzy inference engine combines rules from the fuzzy rule base and gives a mapping from input fuzzy sets in X to output sets in Y.Each rule is interpreted as a fuzzy implication, i.e., a fuzzy set in X×Y, and can be expressed as: Usually in Mamdani FLS, the implication is replaced by a t-norm, i.e. (product or min).Multiple antecedents are connected by a t-norm, so a rule can be expressed by its MF as follows: where T and are t − norm operators (product or min).The p-dimensional input to R l is given by the fuzzy set A x whose MF is expressed as [8] Each rule detemines a fuzzy set B l in Y which is derived from the sup − composition.Then, the MF of this output set is expressed as [8] Finally, the lth rule is expressed as follows

Defuzzifier
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, y l , then it calculates the centroid of the resultantF set of these singletons.
The crisp output of this defuzzifier is expressed as: where y l is the point having maximum membership in the output set [8].

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 l th rule of a first order type-1 TSK FLS having p inputs x 1 ∈ X 1 , ..., x p ∈ X p and one output y ∈ Y is expressed as: where l = 1, ..., M, c l j (j = 0, .., p) are the consequent parameters, y l (x) is the output of the lth rule, and F l k (k = 1, ..., p) are type-1 antecedent fuzzy sets.The output of a TSK FLS is obtained by combining the outputs from the M rules in the following form: where f l (x) (l = 1, ..., M) are the rule firing levels and they are defined as: where T is a t − norm operation, i.e. minimum or product operation (Mendel [8]), and x is the vector of inputs applied to the TSK FLS.

Fuzzy basis functions
For Mamdani FLSs, assuming that all consequent MFs are normalized, i.e., μ G l y l = 1, and using singleton defuzzification, max-product composition and product implication, then the output of the height defuzzifier (9) becomes: The FLS in (13) can be expressed as: where φ l (x) is called a Fuzzy Basis Function (FBF) of the lth rule [11], and it is defined as: where f l is given in (12).
This linear combination allows us to view an FLS as series expansions of FBFs [11], [1], [4] and [10] which has the capability of providing a mix of both numerical and linguistic information.

Weighted FBF
The crisp output of the TSK FLS in (11) can be expressed as: It can also be expressed as: where φ l k (x) is the kth Weighted Fuzzy Basis Function (WFBF) of the lth rule which is expressed as [2]: This linear combination allows us to view the FLS as series expansions of WFBFs [2].The WFBFs have also a capability of providing a combination of both numerical and linguistic information.

Orthogonality principle
We explain in this section how we can obtain, graphically, the optimal scalar that minimizes the norm of an error vector [9].Suppose that we have a set of N measurements collected in a N-vector, − → y , gathered for different values collected in another N-vector, − → φ .The problem is to find : min As shown in Figure 2, we can see that the optimal scalar θ that minimizes the norm of the This can be expressed as follows : Solving for θ we have:

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 c l k (l = 1, ..., M; k = 0, ..., p) in (11) for a TSK FLS, and y l (l = 1, ..., M) in (9) for a Mamdani FLS.

Given a collection of N input-output numerical data training pairs
x (1) : y (1) , x (2) : y (2) , ...., x (N) : y (N)   where x (i) and y (i) are respectively the vector input and scalar output of the FLS given by (13).
We have to tune the y l (l = 1, ..., M) 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: φ j (x (2) ) . . .
where M is the number of rules.We now collect all the N training output data in the same vector − → y : . . .
and the parameters of the consequent in a vector − → θ : By considering the N 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 − → θ opt is a vector which contains the parameters of the consequent, i.e., y l in (3).

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 N input-output numerical training data pairs: x (1) : y (1) , x (2) : y (2) , . . ., x (N) : y (N)   where x (i) is the (p + 1) − dimensional input vector (p + 1 inputs with x 0 ≡ 1) and y (i) is the scalar output of the FLS given by (11).We have to tune the c l k (l = 1, ..., M; k = 0, ..., p) using these data training.
The WFBF vectors are computed using the training input data, then the GOP is applied to the (p + 1) combinations of WFBF vectors and the (p + 1) of N−dimensional training output vector.
Using the elements of the input-output training pairs, the TSK output given in (17), can be rewritten as follows: where Collecting the N equations we obtain: ) ) . . .
By taking each set of N WFBFs as a Weighted Fuzzy Basis Vector, WFBV: and each set of N outputs as a vector, the output vector can be expressed as follows : Now we have to tune p + 1 parameters for each rule, i.e., M vectors of dimension (p + 1).

− →
If we define the l th element of Φ TSK as Φ TSK,l , we have: the output vector (33) becomes : In a matrix form, (36) becomes : So the Weighted Basis Function Matrix (WBFM) Φ can be defined as: The optimal parameters of the consequent conforms a vector, − → c l in (34) are obtained when the , must be perpendicular to all the weighted fuzzy basis vectors, − → φ l k (k = 0, . . ., p and l = 1, . . ., M), which are the columns of the WBFM Φ TSK , as shown in Figure 4.This may be expressed directly in terms of the WBFM Φ as follows:

Description of the system
Schematic drawing of an Inverted pendulum On a Cart (IPOC) system is depicted in Figure 5. where x is the position of the cart, θ is the angle of the pendulum with respect to the vertical direction and F is the external acting force in the x − direction.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, x, is given by: where J is the moment of inertia of the bar.The masses of the cart and the rod are M 1 = 2Kg and m = 0.1Kg, respectively.The rod has a length l = 0.5m.
Since the goal of the control system is to keep the pendulum upright the equations can be linearized around θ = 0. We chose x = θ θ x ẋ T as the state vector, where θ is the pendulum angle variation and ẋ is the cart position variation.The state representation is given by:

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., x 1 = x 1 x 2 = θ θ T and its output is the applied force to the system y =force.In this case, we use a Mamdani FLS with four rules.We use gaussian MF to fuzzify the two controller's inputs (44) and triangular MF to fuzzify the controller output.
where m F l i and σ F l i are respectively the centers and standard deviations of these MFs.
The MFs of the antecedents are depicted in Figures 7 and 8. Figure 9 shows the 56 data training and the optimal fitting given by the GOP method.
The obtained optimal consequent parameters are y 1 , y 2 , y 3 , y 4 opt = (−14.3,−14.23, 9.61, 18.96) Figure 10 shows the response of the pendulum system controlled by the designed FLC to a reference θ re f = 0 with its response at the same reference when it is controlled by untuned FLC.The initial state vector is x 0 = θ 0 θ0 x 0 ẋ0 T = 0.1 0.2 0 0 T .  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.

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 x(t + 6) of a Mackey-Glass time series (45) which is volatile.The following four antecedents were used: x(t − 18), x(t − 12), x(t − 6) and x(t), which are known values of the time series ([2], [3]).
The training data are obtained by simulating (45) for τ = 17.We use the samples x(1001), • • • , x(1524) to train the IT2 FLS and the samples x(1501), • • • , x(2024) for testing.We use two Gaussian MFs per antecedent, so we have then 16 rules.The MFs of the antecedents are Gaussian, where its mean and the standard deviation were obtained from the 524 training samples, x(1001), • • • , x(1524).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 [5], and [6]), 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.

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 ( [5], and [6]).Its application to hardware design problems ( [7]) can improve the performance of fuzzy controllers, so its implementation arises as a new field to be covered.

Figure 1 .
Figure 1.Block diagram of a fuzzy logic system

Figure 2 .
Figure 2. Basic Idea of Orthogonality Principle

Figure 3 .
Figure 3. Basic Idea of Generalized Orthogonality Principle.The error vector should be perpendicular to all of the basis fuzzy vectors.

Figure 5 .
Figure 5.A schematic drawing of the inverted pendulum on a cart

Figure 6 .
Figure 6.Fuzzy control system of the PAPCS

Figure 7 .
Figure 7. Membership functions for the first controller input θ

Figure 10 .Figure 11 .
Figure 10.System responses of PAPCS controlled by a tuned and untuned FLC

Figure 13 .
Figure 13.Integral of the time multiplied by square error values of PAPCS of tuned and no tuned consequent parameters.The error at the end of transition period is less important for the tuned FLC

Table 1 .
Comparison of performance criteria for of PAPCS using tuned and no tuned FLC.

Table 2 .
The optimal TSK FLS consequent parameters obtained by GOP design.