# Tuning of a TS Fuzzy Output Regulator Using the Steepest Descent Approach and ANFIS

Authors: Ricardo Tapia-Herrera; Jesús Alberto Meda-Campaña; Samuel Alcántara-Montes; Tonatiuh Hernández-Cortés; Lizbeth Salgado-Conrado
Journal: Mathematical Problems in Engineering
 (2013)

---

## Abstract

The exact output regulation problem for Takagi-Sugeno (TS) fuzzy models, designed from linear local subsystems, may have a solution if input matrices are the same for every local linear subsystem. Unfortunately, such a condition is difficult to accomplish in general. Therefore, in this work, an adaptive network-based fuzzy inference system (ANFIS) is integrated into the fuzzy controller in order to obtain the optimal fuzzy membership functions yielding adequate combination of the local regulators such that the output regulation error in steady-state is reduced, avoiding in this way the aforementioned condition. In comparison with the steepest descent method employed for tuning fuzzy controllers, ANFIS approximates the mappings between local regulators with membership functions which are not necessary known functions as Gaussian bell (gbell), sigmoidal, and triangular membership functions. Due to the structure of the fuzzy controller, Levenberg-Marquardt method is employed during the training of ANFIS.


---

## Body

## 1.  Introduction

A fundamental problem in dynamic systems is to control a plant in order to have its outputs tracking some reference signals produced by an exosystem (external generator), while the stability property of the  closed-loop system is guaranteed. In this regard, the output regulation problem [1] consists of finding the control law capable of(a)
stabilizing the closed-loop system when the plant is not influenced by the exosystem,(b)
taking the tracking error asymptotically to zero when the plant is under the action of the exosystem.One of the first works on output regulation theory presented in the literature was developed by Francis and Wonham in 1975 [2]. This paper obtains structural criteria necessary to synthesize multivariable linear regulators with structural stability to small perturbations. The main contribution of this work is that structural stability requires feedback from the regulate variable, and these structural features are called “internal model principle.” Later in 1977 [3], the linear regulation theory for tracking a reference is proposed by Francis, by finding that the solution for the output regulation of an autonomous linear system subject to perturbations and reference signals can be obtained from a system of linear matrix equations.Isidori and Byrnes [1] extend the results obtained by Francis to the general case in which the plant and/or the exosystem are nonlinear. They also show that Francis equations are a particular case of nonlinear output regulation equations. In addition, they also show, as in linear case, that if the plant is exponentially stabilizable via output feedback, the solution for the nonlinear case requires an error feedback regulator. Unfortunately, the so-called Francis-Isidori-Byrnes (FIB) equations used to solve the nonlinear output regulation problem involve a set of nonlinear partial differential equations which in many cases are too difficult, or even impossible to solve in a practical way (see Figure 1).Output regulation scheme for (a) linear systems and (b) nonlinear systems [4].
(a)
(b)On the other hand, in the real world, there exists a wide range of problems that involve the analysis of uncertain and inaccurate information, and that is the main reason for the “soft computing.” The term soft computing, according to Zadeh, is “A collection of methodologies that aim to exploit the tolerance for imprecision and uncertainty to achieve tractability, robustness, and low solution cost.” Its principal constituents are fuzzy logic, neurocomputing, and probabilistic reasoning [5]. Each of these approaches has features that make them suitable to solve different problems. Fuzzy systems are characterized by their ability to handle and use inaccurate approximate reasoning, while neural networks have the property of learning. Many of these tools have been used with efficiency to solve complex real world problems as diagnosis, estimation, control, and autonomy of systems.In that sense, some techniques have been developed to characterize nonlinear systems by means of linear local subsystems [5]. One of these approaches is the well-known Takagi Sugeno (TS) fuzzy modeling. This technique allows describing the nonlinear dynamics by means of a suitable “blending” of linear subsystems, each of them corresponding to different operation points. Basically, the “combination” is performed by a weighted summation of linear local subsystems. Thus, local controllers can be designed for each subsystem, obtaining the aggregate controller by using the same membership functions of the TS fuzzy plant.As mentioned previously, the set of differential equations derived by Isidori and Byrnes in nonlinear regulation is difficult to solve, representing an interesting opportunity to apply soft computing: in particular neural networks and fuzzy logic.For instance, in [6], an iterative algorithm with the structure of a recurrent neural network is presented. The network is introduced with the purpose of dealing with model errors caused by the estimation of parameters of an off-line training and the possible dynamic changes; an online learning approach providing the necessary parameters for the network is also used. In this sense, the network can capture the uncertainties of the system, and the regulator adjusts the control action in order to guarantee the regulation condition. That is an attempt to combine the identification capability of neural networks and the stability properties of the control theory. As a result, the control structure learns the system dynamics and ensures the asymptotic convergence of the error. Subsequently, this method was applied at the control scheme of a solar plant [7]. Zhang and Wang [8] propose an approximation in power series form, wherein a neural network carries out the synthesis and self-tuning of controller in real time. This method ensures regulation properties, namely, stability and asymptotic tracking.Later in [9], the fuzzy output regulation is formulated, in which a nonlinear system described by a Takagi-Sugeno fuzzy model follows a reference signal generated by a fuzzy exosystem. It was also shown that the fuzzy regulation problem can be solved by means of local linear regulator only if the following conditions are satisfied.(i)
The zero error manifoldπ(w) is equal for every local linear subsystem (see Figure 1).(ii)
Input matricesBi are equal for every local linear subsystem, that is, (B1=B2=⋯=Bi).Unfortunately, the aforementioned conditions are not satisfied in a great number of systems. A proposal to overcome this problem is presented in [5, 10], wherein the fuzzy regulator is designed on the overall fuzzy model instead of local linear subsystems. The advantage of this approach is the global convergence of the tracking error in the interest region, in contrast to local properties of classical method of nonlinear control. Moreover, the solution of the fuzzy regulation problem is given in terms of the “dynamical Francis equations,” and a very practical way to solve such a dynamical equation is also given. However, a disadvantage of this approach is that exact fuzzy controller is far more complex than the regulator designed from the fuzzy summation of local linear regulators, in general. For that reason, in the present work, an approach based on the local design of linear regulators is proposed, but considering that the nonlinearity of the controller may be different from the nonlinearity of the plant. In other words, it will be assumed that the membership functions of the fuzzy plant and the membership functions of fuzzy regulator are different. Therefore, the appropriate membership functions for the fuzzy regulators will be obtained by means of an adaptive network-based fuzzy inference system (ANFIS) and the steepest descent approach.A hybrid intelligent system combines two or more soft computing techniques [10]. Such combination allows taking advantage of each tool, improving the behavior of the overall system. According to [11, 12], the following combinations can be found in the literature:(i)
fuzzy controllers tuned by neural networks,(ii)
fuzzy controller tuned by evolutionary computation,(iii)
neural networks synthesized by evolutionary computation,(iv)
neural networks controlled by fuzzy logic,(v)
evolutionary computation controlled by fuzzy logic.The Artificial Neural Networks (ANN) have shown great efficiency in different fields as identification, classification, or recognition patterns. On the other hand, a system based on fuzzy logic has the capability of working with uncertain information and taking decisions based on rules previously established by an expert system. A neurofuzzy system takes the inference under cognitive uncertainty from fuzzy logic and from ANNs their learning capability, adaption, parallelism, and generalization [13, 14].The performance of a fuzzy controller is extensively linked to the shape of membership functions that represent linguistic variables [15], so as the binary operators [16]. These parameters conform the structure of fuzzy controller and generally are defined by an expert to trial and error [17]. ANN brings the possibility of avoiding the trial and error procedure [18–20]. Therefore, ANN gives to fuzzy controller the capability of learning, which means that fuzzy system can be tuned by itself [21]. Besides, the neural approach can not only be used to adjust the parameters of the fuzzy controller but also an ANN can be used as a fuzzy controller, in the sense that the fuzzy controller will have the structure of a neural network [22].  For instance, Moreno-Velo develops Xfuzzy which is a program where several proposed approaches are applied to learning process on neurofuzzy systems. Xfuzzy integrates a wide variety of supervised learning algorithms [23].In [24, 25], the authors present methodologies that reduce the time of training for neurofuzzy systems with the aim of using them on real-time applications.(Adaptive Neural-Fuzzy Network Inference System) (ANFIS) proposed by Jang [26] builds a mapping between input-output pairs, using IF-THEN rules. ANFIS employs hybrid training, combining backpropagation and the least-squares estimator, and it has been used for modeling nonlinear functions, identification of nonlinear components in control systems, and for prediction of chaotic series.So, the main contribution of the present work is to develop an approach based on ANFIS that is capable of approximating the appropriate membership functions, such that tracking error for the overall fuzzy system is reduced when the fuzzy controller is obtained from the fuzzy summation of local linear regulators, while avoiding the restriction of proposing a priori form of the membership functions, which is the main disadvantage of the steepest descent approach.The rest of the paper is organized as follows. In Section2, a review of basic concepts of fuzzy output regulation is presented. In Section 3, an overview of ANFIS and an introductory example using the steepest descent in fuzzy regulation are given. In Section 4, some cases of study are solved and their respective simulation results are depicted. Finally, in Section 5, some conclusions are drawn.


## 2. The Output Regulation Problem

From a given linear system(1)x˙=Ax+Bu,y=Cx
and an exosystem
(2)ω˙=Sω,yref=Qω,
it is desired to design a controller that stabilizes asymptotically the system (1) when the exosystem (2) is disconnected, that is,  (ω=0), and achieving e(t)→0 as t→∞ when (1) is under the influence of (2).  According to [26], the controller is  u=K(x-Πω)+Γω and the tracking error is ess=x-xss, where xss=Πω(3)ess=x-Πω∴e˙ss=x˙-Πω˙⟶x˙=e˙ss+Πω˙.
By substituting the previous equations in (1), one gets
(4)e˙ss=Aess+AΠω+BKess+BKΠω-BKΠω+BΓω-Πω˙.
But K has to be designed such that (A+BK) is asymptotically stable. Therefore, e(t)→0 as t→∞ if and only if
(5)ΠS=AΠ+BΓ,0=CΠ-Q.
The set of (5) is called Francis equations. Dimensions of each matrix are
(6)A∈ℝn×n,B∈ℝn×m,C∈ℝm×n,Π∈ℝn×r,S∈ℝr×r,Γ∈ℝm×r,P∈ℝn×r,Q∈ℝm×r.
According to Isidori and Byrnes, the extension of the regulation problem to the nonlinear case is
(7)x˙=f(x,ω,u),y=h(x),ω˙=s(ω),yref=q(ω).
Thus, the control signal becomes u=k[x-π(ω)]+γ(ω). Then, similar to the linear case, the error in steady-state is e˙ss=x˙-x˙ss with xss=Πω:
(8)ess=f(x,ω,u)-ddt[π(ω)],(9)ess=f(x,ω,u)-∂π∂ωω˙,(10)ess=f(x,ω,u)-∂π∂ωs(ω),(11)∂π∂ωs(ω)=f(π(ω),ω,γ(ω)),0=h(π(ω))-q(ω).
The set (11) is called Francis-Isidori-Byrnes (FIB) equations [1], subjected to
(12)f(0,0,0)=0,h(0)=0,π(0)=0,γ(0)=0,S(0)=0,q(0)=0.


### 2.1. Exact Fuzzy Output Fuzzy Regulation

The fuzzy model proposed by Takagi and Sugeno is a fuzzy system described by the rules of the type IF-THEN, where the consequent parts include the local dynamics represented by linear subsystems [27], that is.Local linear subsystems:(13)x˙(t)=Aix(t)+Biu(t),y(t)=Cix(t)i=1,2,…,r.
Therefore, the nonlinear dynamics can be approximated by the following TS model:
(14)x˙=∑i=1r1hi1{Aix+Biu}+∑i=1r1hi1Pi,y=∑i=1r1hi1Cix.
In a similar way, the exosystem can be approximated by a TS fuzzy system of r2 rules as follows:
(15)ω˙=∑i=1r2hi2Siω,yref=∑i=1r2hi2Qiω.
Note that the membership functions of the plant are not necessarily the same as the exosystem functions. Fuzzy plant (14) and fuzzy exosystem (15) can be rewritten as
(16)x˙=A~(t)x(t)+B~(t)u(t),y=C~(t)x(t),ω˙=S~(t)ω(t),yref=Q~(t)ω(t).
And the desired fuzzy controller is
(17)u(t)=∑i=1r1hi1(z1(t))Ki[x(t)-π(ω(t))]+γ(ω(t)).
With this representation, the steady-state manifold is π(ω(t))=Π~(t)ω(t), while the steady-state input is γ(ω(t))=Γ~(t)ω(t) [9, 28]. Π~(t) and Γ~(t) can be obtained by differentiating the steady-state error:
(18)e˙ss=x˙(t)-Π~˙(t)ω(t)-Π~(t)ω˙(t).
In steady-state, one gets
(19)Π~˙(t)+Π~(t)S~(t)=A~(t)Π~(t)+B~(t)Γ~(t)+P~(t).
Solving (19) in an analytical way may be very difficult. But its numerical solution is given in [4] through a very practical way. However, the resulting controller is very complex, in general.


## 2.1. Exact Fuzzy Output Fuzzy Regulation

The fuzzy model proposed by Takagi and Sugeno is a fuzzy system described by the rules of the type IF-THEN, where the consequent parts include the local dynamics represented by linear subsystems [27], that is.Local linear subsystems:(13)x˙(t)=Aix(t)+Biu(t),y(t)=Cix(t)i=1,2,…,r.
Therefore, the nonlinear dynamics can be approximated by the following TS model:
(14)x˙=∑i=1r1hi1{Aix+Biu}+∑i=1r1hi1Pi,y=∑i=1r1hi1Cix.
In a similar way, the exosystem can be approximated by a TS fuzzy system of r2 rules as follows:
(15)ω˙=∑i=1r2hi2Siω,yref=∑i=1r2hi2Qiω.
Note that the membership functions of the plant are not necessarily the same as the exosystem functions. Fuzzy plant (14) and fuzzy exosystem (15) can be rewritten as
(16)x˙=A~(t)x(t)+B~(t)u(t),y=C~(t)x(t),ω˙=S~(t)ω(t),yref=Q~(t)ω(t).
And the desired fuzzy controller is
(17)u(t)=∑i=1r1hi1(z1(t))Ki[x(t)-π(ω(t))]+γ(ω(t)).
With this representation, the steady-state manifold is π(ω(t))=Π~(t)ω(t), while the steady-state input is γ(ω(t))=Γ~(t)ω(t) [9, 28]. Π~(t) and Γ~(t) can be obtained by differentiating the steady-state error:
(18)e˙ss=x˙(t)-Π~˙(t)ω(t)-Π~(t)ω˙(t).
In steady-state, one gets
(19)Π~˙(t)+Π~(t)S~(t)=A~(t)Π~(t)+B~(t)Γ~(t)+P~(t).
Solving (19) in an analytical way may be very difficult. But its numerical solution is given in [4] through a very practical way. However, the resulting controller is very complex, in general.


## 3. Overview of Adaptive-Network-Bases Fuzzy Inference System (ANFIS)

In Figure2, an Adaptive-Network-Based Fuzzy Inference System network is shown. ANFIS is a system that employs the structure of fuzzy Takagi-Sugeno-Kang systems (TSK) and learning algorithms of neural networks with the purpose of adjusting the consequent and antecedent parameters of the fuzzy system.Figure 2
ANFIS architecture for 2 input variables.Basically, ANFIS architecture is formed by five layers, each of them is described in the following.Layer  1. Fuzzification process, variables x and y are the inputs to membership functions O1,i. Generally, gbell functions are used in this stage, for example.Rule 1.
Ifx is O1,1 and y is O1,3, then f1=p1x+q1y+r1.Rule 2.
Ifx is O1,2 and y is O1,4, then f2=p2x+q2y+r2.
Consider(20)mA,j=O1,j(x)=11+((x-ci)/ai)2bjj=1,2
or
(21)mB,j=O1,j(y)=11+((y-ci)/ai)2bjj=3,4.
Parameters ai, bi, ci are called premise parameters, where these premise parameters can be modified (Figure 3).Shapes of gbell  function with modified parameters.
(a)
Modifying parameter “a”
(b)
Modifying parameter “b”
(c)
Modifying parameter “c”
(d)
Modifying parameter “a” and “b”Layer  2. Nodes denoted with Π. In these nodes, the inferences between fuzzy sets are performed. The T-norm is used for firing strengths:
(22)O2,j=wj=mAj(x)·mBj(x),j=1,2.Layer  3. Normalization of firing strengths
(23)O3,j=w-j=wjw1+w2.Layer  4. The consequent part of fuzzy system is in nodes Oi4, and it is given by a set of functions fi=pix+qiy+ri, and they are activated according to the normalize firing strengths:
(24)Oj4=w-jfj=w-j(pjx+qjy+rj).Layer  5. Summation of input signals is obtained as
(25)O15=∑jOj4=∑jw-jfj.


### 3.1. Case of Study

Consider the following TS fuzzy system:(26)x˙(t)=∑i=12hi(x1(t))[Aix(t)+Biu(t)],ω˙(t)=Sω(t),e(t)=∑i=12hi(x1(t))Cix(t)-Qω(t),
where
(27)A1=[0120],A2=[0130],B1=[02],B2=[01],C1=C2=Q=[10],S=[01-10],
with the control
(28)u(t)=∑i=12hi(xi(t))Ki[x(t)-Πiω(t)]︸fuzzystabilizer+∑i=12hi(xi(t))Γiω(t)︸fuzzyregulator.
It is important to remark that the fuzzy regulator included in (28) is obtained by using the same membership functions of the plant.Observe that in this example,x1 should track ω1. This can be easily deduced from matrices C1, C2, and Q. Πi and Γi are obtained from the solution of (5) for each of the two rules. Thus, a fuzzy regulator is designed on the basis of two local linear systems. The membership functions hi are proposed as triangular ones satisfying h1+h2=1.The fuzzy steady-state manifold is(29)π(ω(t))=Π1ω(t)=Π2ω(t)=[1001][ω1(t)ω2(t)]=Πω(t),
while the steady-state input is
(30)γ(ω(t))=∑i=12hi(ω1(t))Γiω(t)=[-32h1(ω1(t))-4h2(ω1(t))][ω1(t)ω2(t)].
And the Ki gains are obtained from LMI approach [29] in order to ensure global stability:
(31)K1=[-1.61-0.35],K2=[-4.22-0.71].
From the matrices considered in the system (26), it is clear that B1 and B2 are different from each other. Therefore, an asymptotical error cannot be expected when the fuzzy regulator is constructed by the fuzzy summation of the local linear regulators using the same membership functions of the plant [28]. So, Figure 4 shows the behavior of state variable x1 of fuzzy plant and state ω1 of exosystem, while the tracking error is given in Figure 5.Figure 4
x
1 versus ω1 when membership functions of the plant are used to fuzzily combine the local regulators.Figure 5
Tracking error when the membership functions of the plant are used to fuzzily combine the local regulators.In order to overcome the problem of controller (28), a decoupling between the membership functions of fuzzy stabilizer and fuzzy regulator is proposed, that is,
(32)u(t)=∑i=12hi(xi(t))Ki[x(t)-Πω(t)]︸FuzzyStabilizer+∑i=12μi(xi(t))Γiω(t)︸FuzzyRegulator.
Observe that in this new controller, the membership functions of the regulation part are not the same as that considered in the fuzzy plant. In the following, these membership functions μi will be estimated by means of the Steepest Descent approach and ANFIS.According to [5], a fuzzy system with membership functions of type gbell is a universal approximator and consequently gbell functions are used to approximate fuzzy mapping in local regulators, subjected to condition μ2=1-μ1, where
(33)μ1=f(x,a,b,c)=11+|(x-c)/a|2b.
The parameters a, b, and c determine the shape of gbell function. As a consequence, the main goal is to estimate a, b, and c such that the resulting membership functions μ1 and μ2 improve the performance of the fuzzy controller (32). One of the most useful methods for tuning task found in the literature is the “steepest descent” method:
(34)ai(k+1)=ai(k)-ηai∂E(a,b,c)∂ai=1,2,bi(k+1)=bi(k)-ηbi∂E(ai,bi,ci)∂bii=1,2,ci(k+1)=ci(k)-ηci∂E(ai,bi,ci)∂cii=1,2.
It can be readily observed that expressions (34) depend on error eee(k)=x(k)-Πω(k), where x(k) and ω(k) represent the  kth training input-output pair  for the fuzzy plant and the exosystem, respectively.The “steepest descent” approach must reduce the error on the direction of the parameters of the controller. Therefore, (34) need to be adapted such that they consider the evolution of the states of the plant and exosystem (see Figure 6).Figure 6
Scheme of the iterative regulation.In order to obtain the training pairs, the plant is discretized using the approximationx˙≈(xk-xk-1)/T. Therefore, the following discrete plant can be readily obtained:
(35)xk=[(h1K1xk-1+h2K2xk-1-h1K1Πωk-h2K2Πωk+μ1Γ1ωk+μ2Γ2ωk)(h1A1+h2A2)xk-1+(h1B1+h2B2)×(h1K1xk-1+h2K2xk-1-h1K1Πωk-h2K2Πωk+μ1Γ1ωk+μ2Γ2ωk)]T+xk-1.
And the mean squared error is
(36)ess=x-Πω⟶ess(k)=xk-Πωk⟹Ess=12(xk-Πωk)2.
The current value of state xk is an explicit function of μ1 and μ2, and this implies that xk depends on parameters a, b, and c. Therefore, the steepest descent method should minimize the error function with respect to independent variables [30–33] (see Figure 7), that is,
(37)∂E∂a1=(xk-Πωk)T[(h1B1+h2B2)(Γ1-Γ2)ωk]T∂μ1∂a1,∂E∂b1=(xk-Πωk)T[(h1B1+h2B2)(Γ1-Γ2)ωk]T∂μ1∂b1,∂E∂c1=(xk-Πωk)T[(h1B1+h2B2)(Γ1-Γ2)ωk]T∂μ1∂c1.
Recalling that partial derivatives for a generalized bell (gbell) membership function are [34]
(38)∂μ1∂a1=2baμ1(1-μ1),∂μ1∂b1={-ln|ωk-1-ca|μ1(1-μ1),ifωk-1≠c,0,ifωk-1=c,∂μ1∂c1={2bωk-1-cμ1(1-μ1),ifωk-1≠c,0,ifωk-1=c.
The parameters that adjust the membership functions μi are updated by the steepest descent method according to the following training law in the antecedent part:
(39)a1(k+1)=a1(k)-ηa(xk-Πωk)T×[(h1B1+h2B2)(Γ1-Γ2)ωk]T∂μ1∂a1,b1(k+1)=b1(k)-ηb(xk-Πωk)T×[(h1B1+h2B2)(Γ1-Γ2)ωk]T∂μ1∂b1,c1(k+1)=c1(k)-ηc(xk-Πωk)T×[(h1B1+h2B2)(Γ1-Γ2)ωk]T∂μ1∂c1.Figure 7
Training of the fuzzy controller.The simulation results are shown in Figure8, where state x1 tracks to ω1. From Figure 9, it is observed that the error is minimized considerably in comparison with the linear controller (28) (Figure 5). When the regulator is fully trained, the reference tracking is achieved in a very acceptable way, which is depicted in Figures 10 and 11.Figure 8
x
1 versus ω1 during the learning scheme.Figure 9
Tracking error during the learning scheme.Figure 10
x
1 versus ω1 when the controller has been fully trained.Figure 11
Tracking error when the controller has been fully trained.But according to [1], if the regulation problem has a solution, then it is unique. In fuzzy regulation, this means that the membership functions of the fuzzy regulator cannot have arbitrary shapes, and in many cases, their shape is unknown. Obviously, the steepest descent approach is not applicable if the shape of the membership functions is not given a priori. In the following, this disadvantage will be overcome by considering ANFIS.


### 3.2.  ANFIS in Output Fuzzy Regulation

Considering (26), when h1 is equal to 1, the dynamics of the overall fuzzy system are described by the first local linear subsystem and the exact output regulator is obtained from Γ1. In the same way, if h2 is equal to 1, the exact output regulator is obtained directly from Γ2. With this in mind, the next fuzzy implications are obtained:IFh1 is 1, THEN μ1=1→u(t)=h1K1[x(t)-Πω(t)]+μ1Γ1ω(t),IFh2 is 1, THEN μ2=1→u(t)=h2K2[x(t)-Πω(t)]+μ2Γ2ω(t).A set of fuzzy rules can be established, taking into account that the regulation problem is exactly solved by local linear regulator, that is,Ifh1 is 1 then μ1=1⇒ureg(t)=Γ1,Ifh2 is 1 then μ2=1⇒ureg(t)=Γ2.In the fuzzy rules given previously, it is supposed thatμi is a function of ω1, while μ2 can be obtained from μ2=1-μ1. Then, ω1 is chosen as the input variable in ANFIS. Figure 12 shows the ANFIS architecture with one input.Figure 12
ANFIS architecture for one input variable.Layer  1. For this example, gbell membership functions are chosen, and 8 nodes are distributed uniformly (see Figure 13) according to [35]
(40)a1=4,b1=2,c1=-30,a2=4,b2=2,c2=-21,a3=4,b3=2,c3=-12,a4=4,b4=2,c4=-3,a5=4,b5=2,c5=3,a6=4,b6=2,c6=12,a7=4,b7=2,c7=21,a8=4,b8=2,c8=30,μAj(h1)=11+((h1-ci)/ai)2bij=1,2,…,8;0≥h1≤1.Figure 13
Distribution of the membership functions for input layer.Layer  2. The weight of each function corresponds to its own membership function because only one input variable is considered:
(41)w1=μA1,w2=μA2,w3=μA3,w4=μA4,w5=μA5,w6=μA6,w7=μA7,w8=μA8.Layer  3. Weight normalizing:
(42)w-i=wiw1+w2+w3+w4+w5+w6+w7+w8,i=1,2,…,8.Layer  4. Takagi-Sugeno coefficients:
(43)fi=w-i(pih1+ri)i=1,2,…,8.Layer  5.
(44)
f
=
f
1
+
f
2
+
f
3
+
f
4
+
f
5
+
f
6
+
f
7
+
f
8
.


### 3.3. Adjustment of Input Layer Parameters

Thus, the goal is to generate the adequate membership functions for the fuzzy regulator by means of ANFIS regulators, but these values depend on the reference signal. The proposed scheme is depicted  in Figure14.Figure 14
Rule tuning including ANFIS.As discussed in Section3.1, the steepest descent method adjusts parameters ai, bi, ci. Then, the chain rule used for the error function eee=x1-ω1 depends on parameters ai,bi,ci, that is,(45)∂E∂ai=∂E∂x1∂x1∂μ1∂μ1∂fi∂fi∂wi∂wi∂μAi∂μAi∂ai,∂E∂bi=∂E∂x1∂x1∂μ1∂μ1∂fi∂fi∂wi∂wi∂μAi∂μAi∂bi,∂E∂ci=∂E∂x1∂x1∂μ1∂μ1∂fi∂fi∂wi∂wi∂μAi∂μAi∂ci,∂E∂x1=(x1-ω1),∂x1∂μ1=[(Γ1-Γ2)h1]T,∂μ1∂Fi=1,∂Fi∂wi=wi∑wi(pix+ri)=pix+ri-f∑wi,∂wi∂μA1=1.
The terms ∂μAi/∂a1, ∂μAi/∂a1, and ∂μAi/∂a1 are calculated from (38), while
(46)∂E∂ai=(x1-ω1)[(Γ1-Γ2)h1]T(pih1+ri-f∑wi)(∂μAi∂ai),∂E∂bi=(x1-ω1)[(Γ1-Γ2)h1]T(pih1+ri-f∑wi)(∂μAi∂bi),∂E∂ci=(x1-ω1)[(Γ1-Γ2)h1]T(pih1+ri-f∑wi)(∂μAi∂ci).
Each one of the n functions that are proposed in the input layer of ANFIS is fitted by using the previous expressions.


### 3.4. ANFIS Learning Using Levenberg-Marquardt Approach

The Levenberg-Marquardt (L-M) method is an effective nonlinear least-squares approach to nonlinear regression problems [36]:
(47)Θk+1=Θk-(JTJ+λI)-1gh,
where gh≡(1/2)g; λ is a nonnegative number.It has been proved that the L-M method reduces the root mean squared error further than hybrid learning method. In this work, the mean square error is used, and the gradient takes into accountT-S parameters of the fourth layer. Therefore, the following training rules can be obtained:
(48)∂E∂pi=∂E∂x1∂x1∂μ1∂μ1∂fi∂fi∂pii=1,…,n,∂E∂ri=∂E∂x1∂x1∂μ1∂μ1∂fi∂fi∂rii=1,…,n.


## 3.1. Case of Study

Consider the following TS fuzzy system:(26)x˙(t)=∑i=12hi(x1(t))[Aix(t)+Biu(t)],ω˙(t)=Sω(t),e(t)=∑i=12hi(x1(t))Cix(t)-Qω(t),
where
(27)A1=[0120],A2=[0130],B1=[02],B2=[01],C1=C2=Q=[10],S=[01-10],
with the control
(28)u(t)=∑i=12hi(xi(t))Ki[x(t)-Πiω(t)]︸fuzzystabilizer+∑i=12hi(xi(t))Γiω(t)︸fuzzyregulator.
It is important to remark that the fuzzy regulator included in (28) is obtained by using the same membership functions of the plant.Observe that in this example,x1 should track ω1. This can be easily deduced from matrices C1, C2, and Q. Πi and Γi are obtained from the solution of (5) for each of the two rules. Thus, a fuzzy regulator is designed on the basis of two local linear systems. The membership functions hi are proposed as triangular ones satisfying h1+h2=1.The fuzzy steady-state manifold is(29)π(ω(t))=Π1ω(t)=Π2ω(t)=[1001][ω1(t)ω2(t)]=Πω(t),
while the steady-state input is
(30)γ(ω(t))=∑i=12hi(ω1(t))Γiω(t)=[-32h1(ω1(t))-4h2(ω1(t))][ω1(t)ω2(t)].
And the Ki gains are obtained from LMI approach [29] in order to ensure global stability:
(31)K1=[-1.61-0.35],K2=[-4.22-0.71].
From the matrices considered in the system (26), it is clear that B1 and B2 are different from each other. Therefore, an asymptotical error cannot be expected when the fuzzy regulator is constructed by the fuzzy summation of the local linear regulators using the same membership functions of the plant [28]. So, Figure 4 shows the behavior of state variable x1 of fuzzy plant and state ω1 of exosystem, while the tracking error is given in Figure 5.Figure 4
x
1 versus ω1 when membership functions of the plant are used to fuzzily combine the local regulators.Figure 5
Tracking error when the membership functions of the plant are used to fuzzily combine the local regulators.In order to overcome the problem of controller (28), a decoupling between the membership functions of fuzzy stabilizer and fuzzy regulator is proposed, that is,
(32)u(t)=∑i=12hi(xi(t))Ki[x(t)-Πω(t)]︸FuzzyStabilizer+∑i=12μi(xi(t))Γiω(t)︸FuzzyRegulator.
Observe that in this new controller, the membership functions of the regulation part are not the same as that considered in the fuzzy plant. In the following, these membership functions μi will be estimated by means of the Steepest Descent approach and ANFIS.According to [5], a fuzzy system with membership functions of type gbell is a universal approximator and consequently gbell functions are used to approximate fuzzy mapping in local regulators, subjected to condition μ2=1-μ1, where
(33)μ1=f(x,a,b,c)=11+|(x-c)/a|2b.
The parameters a, b, and c determine the shape of gbell function. As a consequence, the main goal is to estimate a, b, and c such that the resulting membership functions μ1 and μ2 improve the performance of the fuzzy controller (32). One of the most useful methods for tuning task found in the literature is the “steepest descent” method:
(34)ai(k+1)=ai(k)-ηai∂E(a,b,c)∂ai=1,2,bi(k+1)=bi(k)-ηbi∂E(ai,bi,ci)∂bii=1,2,ci(k+1)=ci(k)-ηci∂E(ai,bi,ci)∂cii=1,2.
It can be readily observed that expressions (34) depend on error eee(k)=x(k)-Πω(k), where x(k) and ω(k) represent the  kth training input-output pair  for the fuzzy plant and the exosystem, respectively.The “steepest descent” approach must reduce the error on the direction of the parameters of the controller. Therefore, (34) need to be adapted such that they consider the evolution of the states of the plant and exosystem (see Figure 6).Figure 6
Scheme of the iterative regulation.In order to obtain the training pairs, the plant is discretized using the approximationx˙≈(xk-xk-1)/T. Therefore, the following discrete plant can be readily obtained:
(35)xk=[(h1K1xk-1+h2K2xk-1-h1K1Πωk-h2K2Πωk+μ1Γ1ωk+μ2Γ2ωk)(h1A1+h2A2)xk-1+(h1B1+h2B2)×(h1K1xk-1+h2K2xk-1-h1K1Πωk-h2K2Πωk+μ1Γ1ωk+μ2Γ2ωk)]T+xk-1.
And the mean squared error is
(36)ess=x-Πω⟶ess(k)=xk-Πωk⟹Ess=12(xk-Πωk)2.
The current value of state xk is an explicit function of μ1 and μ2, and this implies that xk depends on parameters a, b, and c. Therefore, the steepest descent method should minimize the error function with respect to independent variables [30–33] (see Figure 7), that is,
(37)∂E∂a1=(xk-Πωk)T[(h1B1+h2B2)(Γ1-Γ2)ωk]T∂μ1∂a1,∂E∂b1=(xk-Πωk)T[(h1B1+h2B2)(Γ1-Γ2)ωk]T∂μ1∂b1,∂E∂c1=(xk-Πωk)T[(h1B1+h2B2)(Γ1-Γ2)ωk]T∂μ1∂c1.
Recalling that partial derivatives for a generalized bell (gbell) membership function are [34]
(38)∂μ1∂a1=2baμ1(1-μ1),∂μ1∂b1={-ln|ωk-1-ca|μ1(1-μ1),ifωk-1≠c,0,ifωk-1=c,∂μ1∂c1={2bωk-1-cμ1(1-μ1),ifωk-1≠c,0,ifωk-1=c.
The parameters that adjust the membership functions μi are updated by the steepest descent method according to the following training law in the antecedent part:
(39)a1(k+1)=a1(k)-ηa(xk-Πωk)T×[(h1B1+h2B2)(Γ1-Γ2)ωk]T∂μ1∂a1,b1(k+1)=b1(k)-ηb(xk-Πωk)T×[(h1B1+h2B2)(Γ1-Γ2)ωk]T∂μ1∂b1,c1(k+1)=c1(k)-ηc(xk-Πωk)T×[(h1B1+h2B2)(Γ1-Γ2)ωk]T∂μ1∂c1.Figure 7
Training of the fuzzy controller.The simulation results are shown in Figure8, where state x1 tracks to ω1. From Figure 9, it is observed that the error is minimized considerably in comparison with the linear controller (28) (Figure 5). When the regulator is fully trained, the reference tracking is achieved in a very acceptable way, which is depicted in Figures 10 and 11.Figure 8
x
1 versus ω1 during the learning scheme.Figure 9
Tracking error during the learning scheme.Figure 10
x
1 versus ω1 when the controller has been fully trained.Figure 11
Tracking error when the controller has been fully trained.But according to [1], if the regulation problem has a solution, then it is unique. In fuzzy regulation, this means that the membership functions of the fuzzy regulator cannot have arbitrary shapes, and in many cases, their shape is unknown. Obviously, the steepest descent approach is not applicable if the shape of the membership functions is not given a priori. In the following, this disadvantage will be overcome by considering ANFIS.


## 3.2.  ANFIS in Output Fuzzy Regulation

Considering (26), when h1 is equal to 1, the dynamics of the overall fuzzy system are described by the first local linear subsystem and the exact output regulator is obtained from Γ1. In the same way, if h2 is equal to 1, the exact output regulator is obtained directly from Γ2. With this in mind, the next fuzzy implications are obtained:IFh1 is 1, THEN μ1=1→u(t)=h1K1[x(t)-Πω(t)]+μ1Γ1ω(t),IFh2 is 1, THEN μ2=1→u(t)=h2K2[x(t)-Πω(t)]+μ2Γ2ω(t).A set of fuzzy rules can be established, taking into account that the regulation problem is exactly solved by local linear regulator, that is,Ifh1 is 1 then μ1=1⇒ureg(t)=Γ1,Ifh2 is 1 then μ2=1⇒ureg(t)=Γ2.In the fuzzy rules given previously, it is supposed thatμi is a function of ω1, while μ2 can be obtained from μ2=1-μ1. Then, ω1 is chosen as the input variable in ANFIS. Figure 12 shows the ANFIS architecture with one input.Figure 12
ANFIS architecture for one input variable.Layer  1. For this example, gbell membership functions are chosen, and 8 nodes are distributed uniformly (see Figure 13) according to [35]
(40)a1=4,b1=2,c1=-30,a2=4,b2=2,c2=-21,a3=4,b3=2,c3=-12,a4=4,b4=2,c4=-3,a5=4,b5=2,c5=3,a6=4,b6=2,c6=12,a7=4,b7=2,c7=21,a8=4,b8=2,c8=30,μAj(h1)=11+((h1-ci)/ai)2bij=1,2,…,8;0≥h1≤1.Figure 13
Distribution of the membership functions for input layer.Layer  2. The weight of each function corresponds to its own membership function because only one input variable is considered:
(41)w1=μA1,w2=μA2,w3=μA3,w4=μA4,w5=μA5,w6=μA6,w7=μA7,w8=μA8.Layer  3. Weight normalizing:
(42)w-i=wiw1+w2+w3+w4+w5+w6+w7+w8,i=1,2,…,8.Layer  4. Takagi-Sugeno coefficients:
(43)fi=w-i(pih1+ri)i=1,2,…,8.Layer  5.
(44)
f
=
f
1
+
f
2
+
f
3
+
f
4
+
f
5
+
f
6
+
f
7
+
f
8
.


## 3.3. Adjustment of Input Layer Parameters

Thus, the goal is to generate the adequate membership functions for the fuzzy regulator by means of ANFIS regulators, but these values depend on the reference signal. The proposed scheme is depicted  in Figure14.Figure 14
Rule tuning including ANFIS.As discussed in Section3.1, the steepest descent method adjusts parameters ai, bi, ci. Then, the chain rule used for the error function eee=x1-ω1 depends on parameters ai,bi,ci, that is,(45)∂E∂ai=∂E∂x1∂x1∂μ1∂μ1∂fi∂fi∂wi∂wi∂μAi∂μAi∂ai,∂E∂bi=∂E∂x1∂x1∂μ1∂μ1∂fi∂fi∂wi∂wi∂μAi∂μAi∂bi,∂E∂ci=∂E∂x1∂x1∂μ1∂μ1∂fi∂fi∂wi∂wi∂μAi∂μAi∂ci,∂E∂x1=(x1-ω1),∂x1∂μ1=[(Γ1-Γ2)h1]T,∂μ1∂Fi=1,∂Fi∂wi=wi∑wi(pix+ri)=pix+ri-f∑wi,∂wi∂μA1=1.
The terms ∂μAi/∂a1, ∂μAi/∂a1, and ∂μAi/∂a1 are calculated from (38), while
(46)∂E∂ai=(x1-ω1)[(Γ1-Γ2)h1]T(pih1+ri-f∑wi)(∂μAi∂ai),∂E∂bi=(x1-ω1)[(Γ1-Γ2)h1]T(pih1+ri-f∑wi)(∂μAi∂bi),∂E∂ci=(x1-ω1)[(Γ1-Γ2)h1]T(pih1+ri-f∑wi)(∂μAi∂ci).
Each one of the n functions that are proposed in the input layer of ANFIS is fitted by using the previous expressions.


## 3.4. ANFIS Learning Using Levenberg-Marquardt Approach

The Levenberg-Marquardt (L-M) method is an effective nonlinear least-squares approach to nonlinear regression problems [36]:
(47)Θk+1=Θk-(JTJ+λI)-1gh,
where gh≡(1/2)g; λ is a nonnegative number.It has been proved that the L-M method reduces the root mean squared error further than hybrid learning method. In this work, the mean square error is used, and the gradient takes into accountT-S parameters of the fourth layer. Therefore, the following training rules can be obtained:
(48)∂E∂pi=∂E∂x1∂x1∂μ1∂μ1∂fi∂fi∂pii=1,…,n,∂E∂ri=∂E∂x1∂x1∂μ1∂μ1∂fi∂fi∂rii=1,…,n.


## 4. Numerical Results after Applying ANFIS

From Figures15 and 16, it can be observed that the fuzzy tracking is improved and that the tracking error is smaller than the one obtained through the steepest descent approach.Figure 15
x
1 versus ω1 when ANFIS is included in the fuzzy controller.Figure 16
Tracking error when ANFIS is included in the fuzzy controller.Figure17 shows membership function μ1 obtained from different methods: (1) analytically computed, (2) membership functions for fuzzy regulator are the same than ones of fuzzy plant (μ1=h1), and (3) ANFIS estimation. Note that the membership function generated by ANFIS tends to the real one (analytically computed). It is important to recall that the  μ1+μ2=1, and therefore the missing membership function, μ2, can be easily obtained.Figure 17
Membership functionμ1 obtained from different methods.The control signal appears in Figure18.Figure 18
Control signal when ANFIS is included in the fuzzy controller.Case 1.
In some applications, it is desired that external reference signal has variable frequency, and thus a new exosystem is proposed:(49)S=[03-30].
The local steady-state manifolds can be obtained from
(50)Π1=Π2=[1003],Γ1=[-1120],Γ2=[-130].
Figure 19 shows the system behavior during the training stage. As expected, the fuzzy plant tracks asymptotically the exosystem.Figure 19
x
1 versus ω1 for Case 1.Case 2.
A practical example is the inverted pendulum (Figure20), whose nonlinear model is given by [29]
(51)x˙1(t)=x2(t)x˙2(t)=gsin(x1(t))-amlx22(t)sin(2x1(t))/2-acos(x1(t))u(t)4l/3-amlcos2(x1(t)),
where the mass of the cart is M=8 kg, the mass of the pendulum is m=2 kg, the length of the pendulum is 2l=1 m, the gravity is g=9.81 m/s2, and a=1/(m+M).Figure 20
Inverted pendulum on a cart.This nonlinear model can be approximated by a TS fuzzy model of two rules with(52)A1=[0117.311760],A2=[019.369570],B1=[0-0.17647],B2=[0-0.00523],S=[01-10],K1=[-120.6667-22.6667],K2=[-2551.6-764],
and membership functions as those depicted in Figure 21.Figure 21
Membership functions for the two-rule model [29].The regulation condition is not satisfied when the membership functions of the plant are used to combine the local regulators because matricesB1 and B2 are different (Figure 22).Figure 22
x
1 versus ω1 when the regulator uses the same membership functions of the plant.On the other hand, from Figures23 and 24, it can be observed that the tracking is improved, that is, the tracking error is considerably reduced when ANFIS is used to obtain the adequate membership.Figure 23
x
1 versus ω1 when ANFIS is included in the fuzzy controller.Figure 24
Tracking error when ANFIS is included in the fuzzy controller.


## 5. Conclusions

In this paper, it has been shown that the nonlinearity of the plant is not necessarily the same nonlinearity needed by the regulator to ensure reference tracking. In other words, the membership functions for fuzzy regulator and for the fuzzy plant are not the same, in general.  In that sense, the steepest descent and ANFIS approaches have been used to estimate the adequate membership functions of fuzzy regulator in order to reduce the tracking error when the overall fuzzy controller is obtained from the fuzzy summation of local controllers.It is also important to mention that although the Steepest Descent can be used to approximate the fuzzy membership functions, the approach can be trapped in a local minimum or local maximum. On the other hand, ANFIS due the hybrid training avoids this problem.On the other hand, the use of ANFIS avoids the restriction of proposing a priori form of the membership functions, which is another disadvantage of the Steepest Descent approach.Finally, it can be concluded that a suitable approximation of the nonlinearity of the fuzzy regulator is obtained when ANFIS is used as a tuning tool during the designing of fuzzy regulators.



---

*Source: 873430-2013-06-27.xml*