Open access peer-reviewed chapter

Enhancing Fuzzy Controllers Using Generalized Orthogonality Principle

By Nora Boumella, Juan Carlos Figueroa and Sohail Iqbal

Submitted: July 9th 2012Reviewed: July 16th 2012Published: September 27th 2012

DOI: 10.5772/51608

Downloaded: 1561

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

2. Fuzzy Logic Systems (FLS) basic concepts

2.1. Fuzzy sets

A Fuzzy Set (FS), FXis a set of ordered pairs of a generic element xand its degree, namely Membership Function (MF),μF(x). Any FS can be represented as follows:

F=x,μF(x)|xXE1

where the membership degree ofx, μFx, is constrained to be betwwen 0and 1for all xX.

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

2.2.1. Rules

The FLS is associated with a set of IF-THEN rules with meaningful linguistic interpretations. The lth rule of a FLS having pinputs x1,...,xpand one outputyY, Multiple Input Single Output (MISO), is expressed as:

Rl:If  x1  is  F1l  and,...,and  xp  is  Fpl  THEN  y  is  GlE2

where Fil(i=1,2,...,p)are fuzzy antecedent sets wich are represented by their MFsμFil, and Glis a consequent set where l=1,...,M(Mis the number of rules in the FLS).

Figure 1.

Block diagram of a fuzzy logic system

2.2.2. Fuzzifier

A fuzzifier maps any crisp input x=(x1,...,xp)TX1××XpXinto a fuzzy set Fxin X[8].

2.2.3. Inference

A fuzzy inference engine combines rules from the fuzzy rule base and gives a mapping from input fuzzy sets in   Xto output sets inY. Each rule is interpreted as a fuzzy implication, i.e., a fuzzy set inX×Y, and can be expressed as:

Rl:  F1l×...×FplGl=AlGl        l=1,...,ME3

Usually in Mamdani FLS, the implication is replaced by a t-norm, i.e. (product ormin). Multiple antecedents are connected by a t-norm, so a rule can be expressed by its MF as follows:

μRl(x,y)=μF1l×F2l×...×Fplx1,x2,..,xpμGly=Ti=1pμFilxiμGlyE4

where Tand are t-normoperators (productormin). The p-dimensional input to Rlis given by the fuzzy set Axwhose MF is expressed as [8]

μAx(x)=μX1x1...μXpxp=Ti=1pμXil(xi)E5

Each rule detemines a fuzzy set Blin Ywhich is derived from the sup-composition. Then, the MF of this output set is expressed as [8]

μBly=μAXRly=supxXμAxxμRl(x,y)E6
μBly=supxXTi=1pμXi(xi)Ti=1pμFil(xi)μGl  (y)E7

Finally, the lth rule is expressed as follows

μBl(y)=μGlyTi=1pμFilxi        yYE8
(8)

2.2.4. 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:

y(x)=f(x)=l=1My¯lμBl(y¯l)l=1MμBl(y¯l)E9

where y¯lis the point having maximum membership in the output set [8].

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 lthrule of a first order type-1 TSK FLS having pinputs x1X1,...,xpXpand one output yYis expressed as:

Rl:   IF  x1 is F1l and x2 is F2l  and ... and xpisFpl  THEN      yl(x)=c0l+c1lx1+...+cplxpE10

wherel=1,...,M, cjl(j=0,..,p)are the consequent parameters, yl(x)is the output of the lth rule, and Fkl(k=1,...,p)are type-1 antecedent fuzzy sets.

The output of a TSK FLS is obtained by combining the outputs from the Mrules in the following form:

yTSK(x)=l=1Mfl(x)c0l+c1lx1+...+cplxpl=1Mfl(x)E11

where fl(x)l=1,...,Mare the rule firing levels and they are defined as:

fl(x)=Tk=1pμFkl(xk)E12

where Tis a t-normoperation, i.e. minimum or product operation (Mendel [8]), and xis 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., μGly¯l=1,and using singleton defuzzification, max-product composition and product implication, then the output of the height defuzzifier 9becomes:

y(x)=f(x)=l=1My¯lTi=1pμFil(xi)l=1MTi=1pμFil(xi)E13

The FLS in 13can be expressed as:

y(x)=f(x)=l=1My¯lϕl(x)E14

where ϕl(x)is called a Fuzzy Basis Function (FBF) of the lthrule [11], and it is defined as:

ϕl(x)=fll=1Mfl        l=1,...,ME15

where flis given in12.

This linear combination allows us to view an FLS as series expansions of FBFs [11], [12], [4] and [10] which has the capability of providing a mix of both numerical and linguistic information.

2.5. Weighted FBF

The crisp output of the TSK FLS in 11can be expressed as:

yTSK(x)=l=1Mϕl(x)k=0pcklxkE16

It can also be expressed as:

yTSK(x)=l=1Mk=0pϕkl(x)cklE17

where ϕkl(x)is the kthWeighted Fuzzy Basis Function (WFBF) of the lthrule which is expressed as [2]:

ϕkl(x)=xkϕl(x),    l=1,...,M;k=0,...,pE18

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.

3. 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 Nmeasurements collected in a N-vector, y, gathered for different values collected in another N-vector,ϕ. The problem is to find :

minθy-θϕE19

Figure 2.

Basic Idea of Orthogonality Principle

As shown in Figure 2, we can see that the optimal scalar θthat minimizes the norm of the error vector, e=y-θϕ, is obtained wheneϕ. This can be expressed as follows :

ϕy-θϕ=0E20

Solving for θwe have:

θopt=yTϕϕTϕE21
(21)

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 ckll=1,...,M;k=0,...,pin 11for a TSK FLS, and y¯ll=1,...,Min 9for a Mamdani FLS.

4.1. Mamdani FLS design

Given a collection of Ninput-output numerical data training pairs

x(1):y(1),x(2):y(2),....,x(N):y(N)E22

where x(i)and y(i)are respectively the vector input and scalar output of the FLS given by13. We have to tune the y¯ll=1,...,Musing 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:

y(x(1))=f(x(1))=y¯1ϕ1(x(1))+...+y¯MϕM(x(1))y(x(2))=f(x(2))=y¯1ϕ1(x(2))+...+y¯MϕM(x(2))y(x(N))=f(x(N))=y¯1ϕ1(x(N))+...+y¯MϕM(x(N))E23

So we have

y(x(i))=f(x(i))=l=1My¯lϕl(x(i))          i=1,...,NE24

Now, if each FBF is considered as a basis function, we can compose the following vector:

ϕj=ϕj(x(1))ϕj(x(2))ϕj(x(N)),    j=1,2,...,ME25

where Mis the number of rules. We now collect all the Ntraining output data in the same vector y:

y=y(x(1))y(x(2))y(x(N))E26

and the parameters of the consequent in a vectorθ:

θ=y¯1y¯2y¯ME27

By considering the Nequations, a FLS can be expressed in vector-matrix format as follows:

y=ΦθE28

where the fuzzy basis function matrix Φis given by:

Φ=[ϕ1,ϕ2,...,ϕM]E29

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.

Figure 3.

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

In a matrix form, we obtain:

ΦTy-Φθ=0E30

Solving forθ, we have:

θopt=y¯1y¯2y¯M=ΦTΦ-1ΦTyE31

where θoptis a vector which contains the parameters of the consequent, i.e., y¯lin (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 Ninput-output numerical training data pairs:

x(1):y(1),x(2):y(2),,x(N):y(N)E32

where x(i)is the p+1-dimensionalinput vector (p+1inputs withx01) and y(i)is the scalar output of the FLS given by11. We have to tune the ckll=1,...,M;k=0,...,pusing these data training.

The WFBF vectors are computed using the training input data, then the GOP is applied to the p+1combinations of WFBF vectors and the p+1of N-dimensional training output vector.

Using the elements of the input-output training pairs, the TSK output given in17, can be rewritten as follows:

yTSK(x(i))=ϕ01(x(i))ϕp1(x(i))Tc01cp1++ϕ0M(x(i))ϕpM(x(i))Tc0McpME33

wherex(i)=1,x1(i),...,xp(i)T. Collecting the Nequations we obtain:

yTSK=ϕ01(x(1))ϕp1(x(1))ϕ01(x(N))ϕp1(x(N))c01cp1++ϕ0M(x(1))ϕpM(x(1))ϕ0M(x(N))ϕpM(x(N))c0McpME34

By taking each set of NWFBFs as a Weighted Fuzzy Basis Vector, WFBV:

ϕkl=ϕkl(x(1))ϕkl(x(2))ϕkl(x(N)),    l=1,...,Mk=0,...,pE35

and each set of Noutputs as a vector, the output vector can be expressed as follows:

yTSK=ϕ01ϕp1c0lcp1++ϕ0MϕpMc0McpME36

Now we have to tune p+1parameters for each rule, i.e., Mvectors of dimensionp+1.

cl=c0lcpl,    l=1,...,ME37

If we define the lthelement of ΦTSKasΦTSK,l, we have:

ΦTSK,l=ϕ0l,,ϕpl,l=1,..,ME38

the output vector 33becomes :

yTSK=ΦTSK,1c1++ΦTSK,McME39

In a matrix form, (36)becomes :

yTSK=ΦTSKc1cMTE40

So the Weighted Basis Function Matrix (WBFM) Φcan be defined as:

ΦTSK=ΦTSK,1,,ΦTSK,ME41

The optimal parameters of the consequent conforms a vector, clin 34are obtained when the error vector, yTSK-ΦTSKc1cMT, must be perpendicular to all the weighted fuzzy basis vectors,ϕklk=0,,pandl=1,,M, which are the columns of the WBFMΦTSK, as shown in Figure 4.

Figure 4.

Extended Generalized Orthogonality Principle. The error vector y←-ΦyC1←⋯yCM←T should be perpendicular to all the fuzzy basis vectors, ϕkl←

This may be expressed directly in terms of the WBFM Φas follows:

ΦTy-ΦTΦyC1yCMT=0E42

Solving for yC1yCMTprovides the following

yC1yCMoptT=ΦΦT-1ΦyE43

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 xis the position of the cart, θis the angle of the pendulum with respect to the vertical direction and Fis 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.

Figure 5.

A schematic drawing of the inverted pendulum on a cart

The Lagrange equation for the position of the pendulum, θ, is given by:

ml24+Jθ¨+ml2(x¨cosθ-gsinθ)=0E44

The Lagrange equation for the position of the cart, x, is given by:

M1+mx¨+ml2(θ¨cosθ-θ˙2sinθ)=F(t)E45

where Jis the moment of inertia of the bar. The masses of the cart and the rod are M1=2Kgandm=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=θθ˙xx˙Tas the state vector, where θ˙is the pendulum angle variation and x˙is the cart position variation. The state representation is given by:

x˙=01006l(m+4M1)0000001-3gmm+4M1000x+06l(m+4M1)04m+4M1F(t)E46
μFil(xi)=exp-12xi-mFilσFil2E47
(43)

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., x1=x1x2=θθ˙Tand its output is the applied force to the system y=force.

Figure 6.

Fuzzy control system of the PAPCS

In this case, we use a Mamdani FLS with four rules. We use gaussian MF to fuzzify the two controller’s inputs 44and triangular MF to fuzzify the controller output.

μFil(xi)=exp-12xi-mFilσFil2E48

where mFiland σFilare respectively the centers and standard deviations of these MFs.

The MFs of the antecedents are depicted in Figures 7 and 8.

Figure 7.

Membership functions for the first controller input θ

Figure 8.

Membership functions for the second crontroller input θ

Figure 9 shows the 56 data training and the optimal fitting given by the GOP method.

Figure 9.

Data training and its approximation based on GOP

The obtained optimal consequent parameters are

y¯1,y¯2,y¯3,y¯4opt=-14.3,-14.23,9.61,18.96E49

Figure 10 shows the response of the pendulum system controlled by the designed FLC to a reference θref=0with its response at the same reference when it is controlled by untuned FLC. The initial state vector isx0=θ0θ˙0x0x˙0T=0.10.200T.

Figure 10.

System responses of PAPCS controlled by a tuned and untuned FLC

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 (ISE=0e(t)2dt), Integral of the Absolute value of the Error (IAE=0e(t)dt) and Integral of the Time multiplied by Square Error (ITSE=0te(t)2dt)

Table 1 summarizes the obtained values of ISE, IAE and ITSE of PAPCS using FLC, when tuning and no tuning are used.

No tuningTuning
ISE0.23380.2224
IAE4.73434.0403
ITSE6.77334.4278

Table 1.

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

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.

Figure 11.

Integral of square error values of the PAPCS of tuned and no tuned consequent parameters. Rise time of the system is shorter for the tuned FLC

Figure 12.

Integral of the absolute value of the error values of PAPCS of tuned and no tuned consequent parameters The system is less oscillatory for the tuned FLC before becoming stable

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

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 x(t+6)of a Mackey-Glass time series 45which is volatile. The following four antecedents were used: x(t-18),x(t-12),x(t-6)andx(t), which are known values of the time series ([2], [3]).

dx(t)dt=0.2x(t-τ)1+x10(t-τ)-0.1x(t)E50

The training data are obtained by simulating 45forτ=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 16rules. The MFs of the antecedents are Gaussian, where its mean and the standard deviation were obtained from the 524training samples,x(1001),,x(1524). Table 2 summarizes the consequent parameters per each rule.

Rlc1c2c3c4c5
R1-3.587.94-9.170.030.78
R29.92-10.9-0.021.29-7.83
R316.057.5812.405.25-33.96
R48.92-6.78-12.223.68-4.13
R51.064.6428.42-40.170.16
R622.57-33.28-12.4317.13-12.76
R7-2.93-7.655.73-2.91-1.30
R822.8826.23-15.79-6.19-0.60
R9-3.864.362.040.214.77
R1027.72-45.3524.637.926.26
R11-0.24-4.9930.94-26.546.65
R122.365.34-26.9318.21-8.03
R13-30.6613.375.273.601.43
R1423.62-21.97-3.876.048.01
R153.70-5.070.61-0.768.38
R16-25.0511.30-0.421.274.64

Table 2.

The optimal TSK FLS consequent parameters obtained by GOP design.

Figure 14.

Mackey-Glass time series. The samples x(1001),⋯,x(1524)are used for designing the FLS forecaster

Figure 15.

Output of the TSK FLS time-series forecaster. The samples x(1525),⋯,x(2024)are used for testing the GOP design

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.

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 ([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.

How to cite and reference

Link to this chapter Copy to clipboard

Cite this chapter Copy to clipboard

Nora Boumella, Juan Carlos Figueroa and Sohail Iqbal (September 27th 2012). Enhancing Fuzzy Controllers Using Generalized Orthogonality Principle, Fuzzy Controllers - Recent Advances in Theory and Applications, Sohail Iqbal, Nora Boumella and Juan Carlos Figueroa Garcia, IntechOpen, DOI: 10.5772/51608. Available from:

chapter statistics

1561total chapter downloads

3Crossref citations

More statistics for editors and authors

Login to your personal dashboard for more detailed statistics on your publications.

Access personal reporting

Related Content

This Book

Next chapter

New Areas in Fuzzy Application

By Muhammad M.A.S. Mahmoud

Related Book

First chapter

New Strategy to Approach the Inverse Kinematics Model for Manipulators with Rotational Joints

By José-Emilio Vargas-Soto, Efren Gorrostieta-Hurtado, Saúl Tovar- Arriaga, Jesús-Carlos Pedraza-Ortega and Juan-Manuel Ramos- Arreguín

We are IntechOpen, the world's leading publisher of Open Access books. Built by scientists, for scientists. Our readership spans scientists, professors, researchers, librarians, and students, as well as business professionals. We share our knowledge and peer-reveiwed research papers with libraries, scientific and engineering societies, and also work with corporate R&D departments and government entities.

More About Us