Compensatory Adaptive Neural Fuzzy Inference System

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.


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.

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 e 1 and e 2 and one output u. The entry x 1 is associated with two fuzzy sets A 1 and A 2 . As for the two fuzzy sets associated with the second entry x 2 are B 1 and B 2 . The output u is modeled by a fuzzy Sugeno-type system, composed of the following four rules [17]: Let us denote O k,i the 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 i in this layer is a square node with a node function that describes the membership function. Hence O 1,i is the membership function of A i , and it specifies the degree to which a given variable x satisfies its quantifier A i . 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 (  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 v i is the output of the node I of layer 3 and a i , b i , c i f gis 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 x 1 and x 2 are the position error e and its derivative Δe: : We associate two fuzzy sets for each of the inputs x 1 and x 2 namely N (Negative) and P (Positive). μ N and μ P represent the degrees of membership appropriate to variables x i with respect to the fuzzy subsets A i and B i , defined by the following membership functions (Figure 2) [17]:

Learning algorithm
The learning process consists of identifying the consequence parameters a i , b i and c i for i = 1,2, … .4. Thus, let us assume y d and y are 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 ¼ y d À y.
In addition, let be Φ i the vector of parameters to be adjusted. Our objective is to find the parameters a i , b i and c i of the vector Φ i using 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, ∂y ∂u cannot be evaluated, but can be estimated using the extended Kalman filter equations. Consequently, Eq. (14) can be written as: where The Eq. (15) can be identified to extended Kalman filter equation: Where K k ð Þ is the Kalman gain defined as follows: Where H k ð Þ is the Jacobian matrix (observation matrix of the system); P k ð Þ is the covariance estimation matrix of the error and is the covariance matrix of the process noise.

Stability analysis of the control system
From Eq. (23), we can consider for a very short time T e , this relation: Where e u ¼ K 1 e is the error between the controller's desired output u d and actual output u.
Let beΦ i ¼ Φ id À Φ i , where Φ i is the vector of the consequence parameters and Φ id the vector of the desired consequence parameters.
For linear variation, the error e u is 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.

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 ϵ 0 1 ½ is 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].

Learning algorithm
Consider as for ANFIS two dimensional data vectors, x ¼ e, Δe ½ and one dimensional output data vector u 2 . In order to limit the computation time, we have optimally adjusted the consequence parameters and compensatory degree by minimizing the following objective function:

Fuzzy Systems
Where y d and y are respectively desired and actual values of output system. Now let Φ 2i for i = 1 … .4, be the vector of update parameters. We aim to determine vector Φ 2i through 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 λ 1 and λ 2 are adaptation gains for varying the convergence rate. Further, to eliminate the constraint γ i ∈ 0, 1 ½ , we redefine γ i as follows [7]: Where p i and r i are update parameters such that γ i ∈ 0, 1 ½ . Consequently, the vector of update parameters is given as Φ 2i According to the definition, we have [17]: Finally, the vector of parameters Φ 2i is adjusted using the following equation:

Stability analysis of the control system
From Eq. (48), we can consider for a very short time T e , this relation: Where e u ¼ K 1 e is the error between the controller's desired output u d and actual output u.
Let beΦ 2i ¼ Φ 2id À Φ 2i , where Φ 2i is the vector of the consequence parameters and Φ 2id the vector of the desired consequence parameters.
For linear variation, the error e u is 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.

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: The compact form of the dynamic model relating to the two-joint robot is given as follows: : Vector of joint acceleration variables. τ ¼ τ 1 ; τ 2 ½ : Vector of torques applied to joint. M q ð Þ: Inertial matrix. C q, _ q ð Þ: Matrix of terms centripetal and coriolis. G q ð Þ: Vector of gravitational effects The parameters relating to the dynamic model of this robot are given in the following table (Table 1) 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.
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 ¼ 5s the 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 Neuralfuzzy 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.

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

Author details
Rabah Mellah*, Hocine Khati, Hand Talem and Said Guermah Design and Control Laboratory Automated Systems, Faculty of Electrical Engineering and Computer Science, UMMTO, Tizi-Ouzou, Algeria *Address all correspondence to: mellah.rab@gmail.com © 2021 The Author(s). Licensee IntechOpen. This chapter is distributed under the terms of the Creative Commons Attribution License (http://creativecommons.org/licenses/ by/3.0), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.