Open access peer-reviewed chapter - ONLINE FIRST

Compensatory of Adaptive Neural Fuzzy Inference System

By Rabah Mellah, Hocine Khati, Hand Talem and Said Guermah

Submitted: June 4th 2020Reviewed: January 16th 2021Published: February 15th 2021

DOI: 10.5772/intechopen.96050

Downloaded: 16


The traditional approach to fuzzy design is based on knowledge acquired by expert operators formulated into rules. However, operators may not be able to translate their knowledge and experience into a fuzzy logic controller. In addition, most adaptive fuzzy controllers present difficulties in determining appropriate fuzzy rules and appropriate membership functions. This chapter presents adaptive neural-fuzzy controller equipped with compensatory fuzzy control in order to adjust membership functions, and as well to optimize the adaptive reasoning by using a compensatory learning algorithm. An analysis of stability and transparency based on a passivity framework is carried out. The resulting controllers are implemented on a two degree of freedom robotic system. The simulation results obtained show a fairly high accuracy in terms of position and velocity tracking, what highlights the effectiveness of the proposed controllers.


  • control
  • fuzzy logic
  • neural-fuzzy
  • compensatory fuzzy
  • Kalman filter
  • manipulator robot

1. Introduction

The advantage of fuzzy control is that the fuzzy system can model any continuous (sufficiently smooth) nonlinear function in a compact set and the modeling error decreases [1]. Fuzzy logic resembles human analysis in its use of inaccurate information to create decisions. Many such problems can be formulated as the minimization of functional defined over a class of admissible domains [2]. However, the difficulty in deploying fuzzy clustering strategies along with the high calculating cost and without update the parameters were their disadvantage [3].

On the other hand, a major concern of researchers is turned towards the combination of fuzzy logic and neural network. In this combination, a fuzzy reasoning is followed within multilayered hierarchical neural network. The parameters are represented by connection weights or involved in unit functions. They are learned the actual data [4]. In the near past, ANFIS (Adaptive Neural Fuzzy Inference System) models have become very popular for two reasons: the first reason is that in calibrating of non-linear relationships they offer more advantages over conventional modeling techniques, namely the ability to handle large amounts of noisy data from dynamic and non-linear systems, particularly when the underlying physical relationships are not fully understood. The second reason is that they facilitate the solving of linear systems which include the interpolation modeling such as time series [5].

The reason why authors used ANFIS is that it not only includes the characteristics of both methods but also eliminates some disadvantages in case of their lonely use [6]. Unfortunately, conventional neural fuzzy systems can only optimize the fuzzy membership functions under specially defined fuzzy operators which are unchangeable forever, which makes it use the local optimization technique rather than the global optimization technique [7, 8]. Thus an adaptive neural fuzzy controller with compensatory fuzzy is most suitable in an environment where system dynamics change dramatically, become highly nonlinear, and in principle not fully known.

On the ground of these observations, several optimal and systematic methods have been developed for the design of neural fuzzy controllers with compensatory fuzzy. Among these methods, we have retained the compensatory adaptive neural fuzzy inference system approach which consists in adjusting not only fuzzy membership functions but also dynamically optimize the adaptive fuzzy reasoning. Besides that, ANFIS is a class of adaptive networks that are functionally equivalent to a first order Takagi-Sugeno fuzzy model.

Recently compensatory adaptive neural fuzzy inference system control has gained more attention from the control Community in general, as adaptive fuzzy systems are of crucial importance in several areas. The compensatory adaptive neural fuzzy inference system is preferred to deal with nonlinearities and complexity by working on data characterized by incompleteness and inaccuracy. Therefore, it offers powerful skills, such as adaptive adjustment, parallelism, tolerance error and generalization for the neural fuzzy controller. Thus the optimal methods are used to adjust and optimize the parameters of neural fuzzy controllers through an optimization algorithm in order to improve the control performance [9].

In this chapter, we will present and analyze in section 2 the structure of adaptive neural fuzzy inference system (ANFIS), based on concepts such as fuzzy logic, optimization techniques. This approach is carried out in order to remove a control constraint relating to the need to have a model as faithful as possible, knowing that the modeling errors and the imperfections of the models, contribute to significantly degrade the performance of the conventional control laws [10].

Section 3 presents the mathematical formalism appropriate to the compensatory neural fuzzy inference system controller proposed. The effectiveness of the proposed control is highlighted by some simulation results in Section 4. Finally this paper is concluded with a summary and an outlook to future research directions in Section 5.

2. Presentation of adaptive neural fuzzy inference system (ANFIS)

Jang was the first to present ANFIS as a multi-layer adaptive network-based fuzzy inference system [11]. One can compare this method to a fuzzy inference system besides that it uses back- propagation in minimizing the errors. The operation of a FIS is similar to that of both fuzzy logic (FL) and artificial neural networks (ANN). ln both (ANN) and (FL), the input passes through the input layer (via the input membership function) and the output appears in output layer (via the output membership function). This type of advanced fuzzy logic uses neural networks. Hence, a learning algorithm can be used to change the parameters until an optimal solution is found. It follows that ANFIS uses either back-propagation or a combination of least squares estimation and back-propagation to estimate the membership function parameters [12]. Neural-Fuzzy system has newly known more attraction in research communities than other types of fuzzy expert systems. The reason of it combines the advantages of learning ability of neural network and reasoning ability of fuzzy logic to successfully solve many non-linear and complex real-world problems [13].

The regulator ANFIS is computationally very efficient, as it favors mathematical analysis, and works well with linear, adaptive, and optimization techniques. The fuzzy reasoning is performed with operators min and prod [14].

The conclusions of fuzzy rules are numeric values calculated from the inputs, so the final value is obtained by performing a weighted average of the conclusions [15, 16].

To simplify understanding and without loss of generalities, let us consider a fuzzy regulator with two inputs e1and e2and one outputu. The entry x1is associated with two fuzzy sets A1and A2. As for the two fuzzy sets associated with the second entry x2are B1and B2. The output uis modeled by a fuzzy Sugeno-type system, composed of the following four rules [17]:


Let us denote Ok,ithe node in the ith position of the kth layer. The node functions in the same layer are of the same function family as defined below.

The input layer is denoted Layer 1 and any node iin this layer is a square node with a node function that describes the membership function. Hence O1,iis the membership function ofAi, and it specifies the degree to which a given variable x satisfies its quantifierAi. We select the membership function in such a way the maximum of which is equal to unity and the minimum equal to zero.

The structure of the regulator ANFIS is given by the following figure (Figure 1):

Figure 1.

Structure of the regulator ANFIS.

Through this structure we can see five layers described as follows:

Layer 1: The function of node at this layer is identical to the membership function in the fuzzification process:

Layer 2: generate the degree of activation of a rule.


Layer 3: Each node of this layer is a circular node denoted by N. The output node represents the normalized activation degree according to the ith rule.


Layer 4: Each node of this layer is a square node with a function described as follows:


where viis the output of the node I of layer 3 and aibiciis the set of update parameters.

Layer 5: In this layer, there is only one node that determines the overall output by using the following expression:


Considering x1and x2are the position error eand its derivative e: x1x2=ee.We associate two fuzzy sets for each of the inputs x1and x2namely N (Negative) and P (Positive). μNand μPrepresent the degrees of membership appropriate to variables xiwith respect to the fuzzy subsets Aiand Bi, defined by the following membership functions (Figure 2) [17]:

Figure 2.

Membership functions.


2.1 Learning algorithm

The learning process consists of identifying the consequence parameters ai,biand cifor i = 1,2,….4. Thus, let us assume ydand yare respectively the desired and actual outputs of system. In this work, we consider that the consequence parameters are adjusted by the minimization of the following objective function:


where e=ydy.

In addition, let be Φithe vector of parameters to be adjusted. Our objective is to find the parameters ai,biand ciof the vector Φiusing the gradient descent method combined with the approach of extended Kalman filter. This is equivalent to writing:


We have:


From Eqs. (12) and (13), it follows:


In our case, yucannot be evaluated, but can be estimated using the extended Kalman filter equations. Consequently, Eq. (14) can be written as:




The Eq. (15) can be identified to extended Kalman filter equation:


Where Kkis the Kalman gain defined as follows:


Where Hkis the Jacobian matrix (observation matrix of the system); Pkis the covariance estimation matrix of the error and is the covariance matrix of the process noise.

Taking Hk=ΨiT,Pk=λ1and Rk=λ2,the gain Kkcan be written:


Hence Eq. (18) reduces:


By identification between Eqs. (15) and (21), we have:


Finally, the vector of consequence parameters Φican be adjusted by the following relation:


2.2 Stability analysis of the control system

From Eq. (23), we can consider for a very short time Te, this relation:


Where K1=KTe



Where eu=K1eis the error between the controller’s desired output udand actual output u.

Let be Φi=ΦidΦi,where Φiis the vector of the consequence parameters and Φidthe vector of the desired consequence parameters.


For linear variation, the error euis defined by [18]:


Consider the following Lyapunov function [19, 20, 21]:


Differentiating V with respect to time yields, we obtain [17]:


From Eqs. (26), (27) and (29), we obtain:


Consequently, from Eq. (30), we find that V̇0,so we conclude that the system is asymptotically stable in the sense of Lyapunov according to the LaSalle theorem.

3. Compensatory adaptive neural fuzzy inference system (CANFIS)

The other class of inference systems that can deal this type of analytic information in conclusion of rules inference was proposed by Sugeno and his staff.

As for our contribution here, it consists in adding a compensatory fuzzy part to adjust consequence parameters and as well to dynamically optimize the adaptive fuzzy reasoning. In addition to this, ANFIS represents a class of adaptive networks that are functionally equivalent to a first order Takagi-Sugeno fuzzy model. As performed above, by taking a center-average deffuzzifier mapping, the crisp value of the output u is given as:


We consider the pessimistic and optimistic operation given respectively as follows:


By using these two operations, our contribution is to add the compensatory form formulated as [7]:


Where γiϵ01is compensatory degree. Finally, the crisp value of the compensatory neural-fuzzy inference is derived as [13, 14]:


For simplicity, we define:


Then we have:


The structure of the CANFIS controller with compensatory fuzzy for two input and one output, is shown by Figure 3 [9].

Figure 3.

Structure of CANFIS controller.

3.1 Learning algorithm

Consider as for ANFIS two dimensional data vectors, x=eeand one dimensional output data vectoru2. In order to limit the computation time, we have optimally adjusted the consequence parameters and compensatory degree by minimizing the following objective function:


Where ydand yare respectively desired and actual values of output system. Now let Φ2ifor i = 1….4, be the vector of update parameters. We aim to determine vector Φ2ithrough the extended Kalman filter which consists in linearizing the output around the control input at each sampling period. This is equivalent to writing [16, 19, 20]:


In which


Where λ1and λ2are adaptation gains for varying the convergence rate. Further, to eliminate the constraintγi01, we redefine γias follows [7]:


Where piand riare update parameters such that γi01. Consequently, the vector of update parameters is given as Φ2iT=aibicipirifor CANFIS. According to the definition, we have [17]:


Finally, the vector of parameters Φ2iis adjusted using the following equation:


Where Ψ2iT=u2aiu2biu2ciu2piu2ri.

3.2 Stability analysis of the control system

From Eq. (48), we can consider for a very short time Te, this relation:


Where K1=KTe



Where eu=K1eis the error between the controller’s desired output udand actual output u.

Let be Φ2i=Φ2idΦ2i,where Φ2iis the vector of the consequence parameters and Φ2idthe vector of the desired consequence parameters.


For linear variation, the error euis defined by:


Consider the following Lyapunov function:


Differentiating V with respect to time yields, we obtain:


From Eqs. (51), (52) and (54), we obtain:


Consequently, from Eq. (55), we find that V̇0,so we conclude that the system is asymptotically stable in the sense of Lyapunov according to the LaSalle theorem.

4. Simulation results and interpretation

We applied in simulation the neural-fuzzy command equipped with a compensator explained above, to the two-joint robot in a performance environment described by the following joint trajectories:


With i=1.2.

The compact form of the dynamic model relating to the two-joint robot is given as follows:



q=q1q2: Vector of joint position variables.

q̇=q̇1q̇2: Vector of joint velocity variables.

q¨=q¨1q¨2: Vector of joint acceleration variables.

τ=τ1τ2: Vector of torques applied to joint.

Mq: Inertial matrix.

Cqq̇: Matrix of terms centripetal and coriolis.

Gq: Vector of gravitational effects


The parameters relating to the dynamic model of this robot are given in the following table (Table 1):

Mass of the link 1 m16.5225kg
Mass of the link 2 m22.0458kg
Link length 1 l10.26m
Link length 2 l20.26m
Gravity g9.81m/s2
Distance to the center of mass of link 1 lc10.0983m
Distance to the center of mass of link 2 lc20.0229m
Moment of inertia of the center of mass m10.1213kg.m2
Moment of inertia of the center of mass m20.0116kg.m2

Table 1.

Robot parameters.

Figures 4 and 5 show the time evolution position and velocity errors and the torque applied to each joint of manipulator Robot with neuro-fuzzy controller and neuro-fuzzy controller respectively. Through these graphics, we can see that, the Neural –fuzzy controllers and compensatory Neural-fuzzy controllers provide a good tracking performance.

Figure 4.

Motion errors tracking and torques behavior with neural-fuzzy without disturbances.

Figure 5.

Motion errors tracking and torques behavior with compensatory neural-fuzzy with without disturbances.

On the one hand, we can observe that the tracking errors are limited by low values, and the dynamics of the errors in position vary little compared to that of the errors in speed. This is physically explained by the fact that the position depends only on the environment while the velocity in addition to the environment depends on the Jacobean matrix. On the other hand, the command paths are smooth, which facilitates their implementation. This is achieved through the appropriate choice of parameters of the control structures.

In order to test the capacity of adaptation and robustness of the proposed approach, we have added in our simulation at time t=5sthe combined friction and external torque disturbance for each joint, given as follows.


The results obtained are illustrated by Figures 6 and 7, where we note that the tracking errors show peaks especially at the moment of the introduction of the disturbances, which are rejected quickly, by the Neural – fuzzy controllers and Compensatory Neural-fuzzy structure of the regulator, which allows to conclude that the tracking performance is very little affected by these disturbances. This is due to the low sensitivity to disturbance of the input data of the proposed control strategy.

Figure 6.

Motion errors tracking and torques behavior with neural –fuzzy with disturbances.

Figure 7.

Motion errors tracking and torques behavior with compensatory neural –fuzzy with disturbances.

5. Conclusion

In this chapter, we have proposed and presented a control strategy based on a neuro-fuzzy inference system regulator with a fuzzy compensator to control the manipulator robot with two joints.

It is important to note that the compensatory neural fuzzy inference system is more powerful than fuzzy systems or neural networks, since it can incorporate these advantages:

  • Adaptive fuzzy reasoning method using fuzzy compensator can make the fuzzy system adaptive and efficient more.

  • The neuro-fuzzy compensation system tolerates errors, because it is effective regardless of the choice of initial fuzzy rules (good or bad) for learning.

  • The speed of convergence of the learning algorithm is faster than that of the back propagation algorithm.

  • The learning algorithm not only adjusts membership functions, but also optimizes the dynamics of fuzzy reasoning by adjusting the degree of compensation. As a result, fuzzy neuro systems with a fuzzy compensator are more efficient than conventional neuro-fuzzy systems.

This control strategy has the advantage of requiring only measurements of output variables. The simulations indicate that a complete stabilization of the system is indeed observed.

In conclusion, we wanted, at the end of this chapter, to try to identify a broad-spectrum methodology that opens the field to a possible standardization of the design of control laws based on a neuro-fuzzy structure equipped with a compensator, in order to controlling a poorly understood and imprecise dynamic system. It would be interesting in the context of experimental tests to judge the performance of the methods proposed on real systems.

Download for free

chapter PDF

© 2021 The Author(s). Licensee IntechOpen. This chapter is distributed under the terms of the Creative Commons Attribution 3.0 License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

How to cite and reference

Link to this chapter Copy to clipboard

Cite this chapter Copy to clipboard

Rabah Mellah, Hocine Khati, Hand Talem and Said Guermah (February 15th 2021). Compensatory of Adaptive Neural Fuzzy Inference System [Online First], IntechOpen, DOI: 10.5772/intechopen.96050. Available from:

chapter statistics

16total chapter downloads

More statistics for editors and authors

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

Access personal reporting

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