Robust Adaptive Tracking Control of Manipulator Arms with Fuzzy Neural Networks

The learning space for executing general motions of a flexible joint manipulator is quite large and the dynamics are, in general, nonlinear, time-varying, and complex. The objective of this paper is to design a nonlinear system based on the fuzzy neural network control using supervised training, into executing reference trajectories by a flexible joint manipulator. The structure identifications of controller networks are performed by using the Adaptive Neural Fuzzy Inference System (ANFIS), with new parameters and weight coefficients automatically adapted and adjusted, in order to decrease position tracking errors. In order to adapt and reduce the number of undefined parameters in the network, a new technique is used. Reported research works use the Euler method for the resolution of the arm's dynamic function, in this paper, a more exact method was used, represented by the Fourth-Order Runge-Kutta (RK4) method. A comparative study has been carried out between these two methods in order to prove the effectiveness of the later. Finally, in order to test the robustness of the proposed approach, it was also investigated considering parameter variations. The tracking speed of the model on the system control accuracy was also analyzed. The simulation results show that the proposed approach has a good tracking effect. Keywords-Adaptive Neuro Fuzzy Interface System (ANFIS); Fuzzy Neural Network (FNN) control; manipulator robot; supervised training; trajectory tracking; robustness


INTRODUCTION
Robotic manipulators have reshaped industrial processes. Pressing requirements of improved and enhanced productivity in industrial applications have necessitated the deployment of robots to automate tasks [1]. Some of the most common tasks for which robots are designed to are: transportation and material handling [2,3], assembly and manufacturing [4], and point and arc welding [5,6]. Robotic manipulators can be categorized as rigid or flexible. Rigid manipulators increase tensile strength with more precision due to the materials used such as steel or aluminum frames but have high cost and weight [7]. The advancements in material technology have enabled us to acquire low cost and weight flexible joint robotic manipulators, but quite often an oscillation is produced throughout the manipulator arm, posing a great challenge in terms of manipulator's control [8]. Linear control techniques (e.g. Proportional-Integral-Derivative (PID)) are valid when a robot moves slowly and can be modeled by linear differential equations with constant coefficients [9]. The linear control fails when there is a need to tackle complex system dynamics [8], nonlinearities and parameter changes in the control laws, which require robust or adaptive control laws to handle the trajectories [9]. Many nonlinear control strategies have been developed to deal with the nonlinearities present in the system, such as robust control [10], optimal control [11], adaptive control [12], nonlinear control [13,14], and intelligent control [15]. In [9], authors present a systematic review of control strategies for multi-Degree of Freedom (DoF) robotic manipulators, using one of the most commonly used modeling formulas, Euler Lagrange. A review of modeling of serial articulated robotic arms was recently presented in [7]. Kinematics is usually derived using Denavit-Hartenberg (D-H) parameters. The problem of robust control law design for accurate trajectory tracking of a flexible joint manipulator is addressed in [14], by considering joint flexibility and actuator dynamics. The system's model has been derived using the Euler-Lagrange approach. Authors in [16] proposed an iterative control law to regulate the set-point of a flexible robotic system that is driven electrically and is subjected to model uncertainty. Most of the reported techniques suffer from limitations related to the level of complexity resulting from iterative differentiations of nonlinear virtual functions and thus leading to complex and computationally expensive algorithms.
The arm positioning is commonly performed by a fuzzy controller. Regarding the fuzzy logic control, it incorporates in a control system the way human beings think. Through fuzzy technology, the human operator experience, which controls processes and industrial plants, is captured in order to be included in computerized controllers with the same or better performance than humans. The fuzzy control does not need mathematical modeling of the process, but the modeling of actions from the knowledge of a specialist, using linguistic terms, i.e. verbal descriptions. Moreover, fuzzy controllers also handle linear and nonlinear systems and are able to control complex multivariable systems [17]. But the fuzzy controller is unable to learn, in contrast to the neural networks. With favorable generalization ability and relatively simple structure, a neural network is not involved with complicated mathematical calculations and is characterized as the approximation to any nonlinear function with arbitrary precision [18]. Therefore, it can be combined in many aspects  [19]. For that reason, we have used the hybridization of these two approaches in order to exploit their advantages. This hybridization allowed us to improve the performance of the network controller and achieve satisfactory results through online learning [20,21]. The dynamics of a robot manipulator are, in general, nonlinear time-varying and complex [22]. Therefore, most controllers are not able of effectively controlling movements of a flexible joint manipulator under different distance, velocity, and load requirements [23], and the use of a complicated nonlinear dynamic model makes real-time implementation difficult [24]. Moreover, it is by no means an easy task to identify the model parameters accurately. In this work, two network controllers based on fuzzy neural network control using supervised training are proposed, where each network will control one joint of the arm manipulator with two DoF. Parameters and structure identifications of network are necessary in any modeling which aims to achieve a generalized model. ANFIS employs well-known parameter-identification techniques [25], where the determination of the optimal number of fuzzy rules will be determined by the identification scheme of the structure [26]. For most of fuzzy controllers, the rule composition is very difficult, it needs experts' knowledge or perspective insight of system behavior [27]. We propose a solution based on supervised training, where each synaptic weight between the third and the fourth hidden layer of each controller network represents a fuzzy rule [20].
There are several learning algorithms. They can be classified into two main categories: supervised and unsupervised. In unsupervised learning, the system learns about the pattern from the data itself without a priori knowledge. On the other hand, supervised learning is guided learning, i.e. when the network is formed it compares the input and the desired result which is represented in our case by the reference joint. However, in this case, new parameters and weight coefficients are automatically adapted and adjusted, through online error learning, in order to decrease the position tracking error. Meanwhile, the control system is analyzed. One of the major difficulties of this learning type is the local minimum error [28]. In order to overcome this problem, changes in the parameters of the learning law such as the learning step can be carried out. In the process, the resolution of the arm's dynamic function was performed by two comparative methods, RK4 and Euler method. Finally, control laws were subjected to various test inputs in a simulation to characterize the tracking performance, and some results are illustrated to show the validity of the proposed approach.
II. PROPOSED APPROACH In this approach, the fuzzy system is used to represent the abstract controller program, and the neural network is used to manage the parameters specifying the fuzzy rules, using learning and knowledge of sampled movements [18,29]. The fuzzy system encodes knowledge by qualitative rules rather than a precise quantitative description [30]. However, the use of fuzzy qualitative rules is more effective and tends to cover a wider learning space. The Fuzzy Neural Network (FNN) controller shown in Figure 1 modulates the motion command via sensory feedback and uses the resultant signal to move the robot manipulator. First we have a reference movement block. This movement is defined by the angle and the angular speed assigned to each articulation of each rod of the manipulator arm. These sampled data are then processed in parallel by two FNN controllers to produce two outputs, torque ߬ ଵ and torque ߬ ଶ , applied to the manipulator arm which is simulated by its dynamic function. Finally, a sensory feedback is carried out in order to calculate the error in position and angular speed. Proper learning process is also imperative for determining the weights in the networks. Parameters specifying the fuzzy rules for governing sampled movements are stored and manipulated by the n6eural network to process a wide range of movements. The success of the proposed scheme depends on designing the FNN to generate proper motion commands for various motions. As indicated in the block diagram in Figure 1, we use the feedback error of position (݁) and error of velocity (݁ሶ ) between the reference and actual joints, denoted as: The performance of the trained model is evaluated while decreasing the error between the reference trajectory and the trajectory tracked by the robot manipulator where n represents the number of training examples.

III. CONTROLLER DESIGN
A fuzzy neural system is a fuzzy system presented in the network architecture. Parameter identification of the fuzzy system is performed by an automatic learning technique of an adaptive neural network [21,31]. ANFIS is one of the wellknown neural fuzzy approaches and it has shown good results in the modeling of complex non-linear problems [20,21]. It must be noted that the application of ANFIS is not limited only to systems difficult for modeling, but we can also use this method to design controllers easier. Different learning techniques have been developed for the tuning of the inputs and consequent parameters in the ANFIS [32,33]. In this study, the FNN system employed the learning, because it is the most appropriate method for the ANFIS architecture. An initial Takagi-Sugeno (T-S) fuzzy inference system [34] is developed by defining the input and output membership functions. The determination of the optimum number of rules is very important in fuzzy modeling, it can be determined by a structure identification scheme [26], and the parameters of the initial fuzzy inference system are tuned in ANFIS architecture. Finally, the performance of the trained model is evaluated while decreasing the error between the reference trajectory and the trajectory tracked by the robot manipulator. As mentioned above, two network controllers are proposed in this study, where each FNN system is implemented as shown in Figure 2.
The parameters of fuzzy reasoning are expressed by the connection weights or node functions of the neural network [35]. In Figure 2, the inputs of the FNN are the reference position and the velocity trajectories of a sampled motion, and the output is the motion command. The reason of choosing this structure is that the numbers of fuzzy rules and membership functions for input and output are pre-specified in this type of FNN. Thus, for various motions there are the same numbers of fuzzy parameters with the same attributes. Consequently, these fuzzy parameters are appropriate to be generalized by the neural network in order to deal with a motion. The structure adopted of each FNN, consists of five layers of nodes, which are of the same type within the same layer. Each of the five layers performs one stage of the fuzzy inference process, as described below:

A. Layer 1
This layer is the input layer, and inputs are transmitted to the next layer directly without any calculation. In Figure 2, we can see two input nodes ‫ݍ‬ ோ and ‫ݍ‬ሶ ோ of motions of a single DoF.

B. Layer 2
Each input node in this layer is an adaptive node which produces the membership grade of linguistic label. It is a fuzzy layer. Each node ݆ in this layer has a node function ܱ ଶ .
where ߤ is the degree of the Gaussian membership function, ‫ݔ‬ is the input to the node j, ߠ is the center of membership functions, and ߪ the width of membership functions.
In this paper, it is chosen that ‫ݍ‬ ோ , ‫ݍ‬ሶ ோ and the torque ߬ have the same kind of membership function, where ߬ is composed by seven fuzzy subsets, NB, NM, NS, ZE, PS, PM, PB: N represents negative, P positive, S small, M medium , B large and ZE zero. ‫ݍ‬ ோ and ‫ݍ‬ሶ ோ are composed by five fuzzy subsets, as shown in Figure 3, which implies 5×5 = 25 nodes in the rule layer.

C. Layer 3
This layer is intended for the implementation of the fuzzy rules. Each node in this layer corresponds to a rule, which is defined as a fuzzy conditional statement of the form rule [36,37]: If x is A and y is B Then z is C where x and y are fuzzy sets representing the inputs ‫ݍ‬ ோ and ‫ݍ‬ሶ ோ . z represents the output τ , and A, B, and C represent linguistic variables. In this layer, the membership functions are multiplied and the output is: (4) where ߤሺ‫ݔ‬ሻ and ߤሺ‫ݕ‬ሻ denote the degree of membership functions. A control rule for each network is described as follows: If is NB and ሶ is NB then is NB.

D. Layer 4
In T-S model approach, the output model is a combination of the input variables according to fuzzy rules. The use of this model allows us to obtain an output according to the input variables [17,34]. The fuzzy rules are structured as follows: where ݂ represents the T-S function, ‫‬ , ‫ݍ‬ , and ‫ݎ‬ are the consequent parameters [38].
According to several studies, the synaptic weights between the hidden layers have no physical significance. In this work, through the network architecture we can take the synaptic weights between the second and the third hidden layer in the form of the consequent parameters of the T-S function.

E. Layer 5
For given values of the input variables ‫ݔ‬ (݇), the final output of the fuzzy plant model ‫ݕ‬ ො is inferred by taking the weighted average of the local model outputs ‫ݕ‬ [39].
denotes the membership functions of the fuzzy set ‫ܨ‬ , and ‫ܭ‬ denotes the gravity centers of the output fuzzy sets associated with each rule. It means that a local model in the consequent part of each fuzzy rule describes each operation of the arm manipulator depending on the input values. In this layer only one node is needed for a single motion command τ.
Because the number of rules in Layer 3 is pre-specified by the number of nodes, and weights for the input and output layer are fixed, the parameters to learn in the FNN are the modifiable weights present on the input links to the rule layer and the output membership layer and the consequent parameters of the T-S function.
IV. SUPERVISED TRAINING METHOD The purpose of learning in an FNN controller is to adapt these synaptic weights, in order to generate a control vector τ corresponding to a sampled movement. During learning, an error rate related to the resultant motion is back-propagated to adjust the parameters from layer to layer sequentially [40,41]. The error rate can be obtained by differentiating the error between the reference motion and the actual motion relative to the motion command. The training adopted for this error is the supervised training; this method is widely applied in minimization problems, optimal control, parameter identification, neural network training, etc. [42]. The adaptation law of the weights is: where ߱ ‫)ݐ(‬ is the weight between the neuron j in layer ݇ and the neuron ݅ in layer (k-1), ‫ݐ‬ is the index of iteration, ߙ is the momentum, and ߤ the learning step.
The output of the neuron j in layer ݇ is given by: The connection weights are adjusted so that the feedback error ‫)ݓ(݁‬ is minimized: where ݂ is the neuron activation function, ܵ ‫)ݐ(‬ the input of neuron j, ݊݇ the number of corresponding neurons, n the number of training examples, ݀ the reference output, and ‫ݕ‬ is the actual output. We use the feedback error to derive the error rate ߲݁(߱) ߲߱ ‫)ݐ(‬ ⁄ . and Substituting the results obtained in (17)  The second term at the right side of (18) satisfies: Finally, we get: This final function represents the adaptation law of the weights used in the FNN controller.

V. SIMULATION
To demonstrate the effectiveness of the proposed approach, a two-joint robot manipulator was used [43]. The dynamic equations for this planar manipulator of 2DoF as shown in Figure 4 are described by the joint positions, velocities, and accelerations as functions of time [44]: where q and ‫ݍ‬ሶ are the actual position and velocity vectors and ߬ ଵ and ߬ ଶ are the torques. In this simulation, the parameters for robot manipulator are given as: where ‫ݍ‬ ଵ , ‫ݍ‬ ଶ are the positions of links, ݉ ଵ , ݉ ଶ are the masses, ݈ ଵ , ݈ ଶ the lengths, ‫ܫ‬ ଵ , ‫ܫ‬ ଶ express lengthwise centroid inertia values, and ݈ ଵ , ݈ ଶ are the half lengths.
The resolution of the mathematical model with computed torques of the flexible robot manipulator of 2 DoF requires transforming them in the form of the following differential functions.
For the first joint: For the second joint: These functions are derived by using two methods, Euler, and Runge-Kutta method [45,46]. In many cases, differential equation systems can take the form of an ordinary first-order differential equation of the type: where ‫ݕ‬ሺ‫ݐ‬ሻ is the function we are looking for and ‫ݕ‬ its initial value. We note h as a step based on the discretization of the variable t, and ‫ݕ‬ the approximate value of ‫ݐ(ݕ‬ ) for the different instant ‫ݐ‬ = ݄݊. By integrating the differential equation between ‫ݐ‬ and ‫ݐ‬ ାଵ we have the relation: The idea is to approach this integral with more precision than the Euler method.

A. Euler Method
Coming back to Euler's method, the integral in (26) can be approached by the rectangle method on the left (explicit Euler), or by the rectangle method on the right (implicit Euler). The error produced corresponds to the area of quasi-triangular shape and of dimension h.ph where p is the slope of f at the instant ‫ݐ‬ . So the error is about: ݁ ா ≃ ଵ ଶ ݄ܲ ଶ . Improvements to the Runge-Kutta method of order 2 consist in improving the integral by calculating the area of a trapezoid instead of that of a rectangle. The error is therefore related to the curvature of the function and not to its slope. In order to reduce the error of the later we used the Runge-Kutta method of order 4.

B. Runge-Kutta Method
The Runge-Kutta method of order 4 is an additional step in the refinement of the calculation of the integral (26). Instead of using the trapezoid method, we use the Simpson method [47]. This consists of replacing the integrated function with a parabola passing through the extreme points and the midpoint. We have: Here, a difficulty appears because the equation presents two unknowns: ‫ݕ‬ ାଵ/ଶ and ‫ݕ‬ ାଵ . To make the diagram explicit, we must estimate 4݂൫‫ݐ‬ ାଵ/ଶ , ‫ݕ‬ ାଵ/ଶ ൯ and ‫ݐ(݂‬ ାଵ , ‫ݕ‬ ାଵ ) from ‫ݕ‬ , ‫ݐ‬ and h. Let's start with the term 4݂൫‫ݐ‬ ାଵ/ଶ , ‫ݕ‬ ାଵ/ଶ ൯ which we break down into two identical terms: In the first, we replace ‫ݕ‬ ାଵ/ଶ by its value deduced from the explicit Euler method: In the second term, we replace ‫ݕ‬ ାଵ/ଶ by its value deduced from the implicit Euler method: that we will approach ‫ݕ‬ + ݄/2. ݂൫‫ݐ‬ ାଵ/ଶ , ‫ݕ‬ ାଵ/ଶ ൯. Since the implicit and explicit Euler methods produce quasi-opposite errors, there is a hope to minimize the error on the calculation of 4݂൫‫ݐ‬ ାଵ/ଶ , ‫ݕ‬ ାଵ/ଶ ൯. To summarize, we will write: As for the term ‫ݐ(݂‬ ାଵ , ‫ݕ‬ ାଵ ), we approach it by estimating ‫ݕ‬ ାଵ by the midpoint method, i.e. by applying the rectangle method in the middle: Finally we obtain the explicit diagram of Runge-Kutta of order 4: Compared to the RK2 method, this numerical diagram requires the double calculations at each step and therefore longer calculation time, without mentioning the rounding errors which accumulate faster. However, this defect is compensated by a gain in precision.
Finally, the algorithm developed for this method is: Algorithm RK4 1. Initialization of step h, of duration T. Finally a comparative study will be carried out between Euler's method and Runge-Kutta method in order to prove the effectiveness of the later.
In each FNN controller, we have 2 nodes in layer 1, 10 nodes in layer 2, 25 nodes in layers 3 and 4, and 1 node in layer 5. Consequently, a total of 125 parameters must be adapted for each joint during training. Because between the second and the third layer we have 5.10=50 synaptic weights, and between the third and the fourth layer we have 25 synaptic weights to adapt, finally each neuron in layer 4 needs three parameters ‫‬ , ‫ݍ‬ and ‫ݎ‬ where ܱ ସ = ߬ = ܱ ଷ ‫(‬ ‫ݍ‬ + ‫ݍ‬ ‫ݍ‬ሶ + ‫ݎ‬ ) . The parameter ‫ݎ‬ represents an amplifier of the torque ߬ , to simplify the calculation we take ‫ݎ‬ = 0 . Then total 50+25+50=125 parameters have to be set for each network. Moreover, it is by no means an easy task to identify the model parameters accurately [48], but as we mentioned earlier, to adapt and reduce the number of undefined parameters in the network, a new technique is used. Generally, for the adaptation of T-S function coefficients we use the Genetic Algorithm which is an optimization algorithm [32,49]. In optimization, which is a field of mathematics, the goal is to come up with the member of a set that is the best according to some criterion [50].This method includes several steps and it takes a lot of time and calculations. In order to overcome this problem a new technique is used, with a simple idea: According to several studies, synaptic weights in the FNN controller have no physical significance, while in our work, the coefficients ‫‬ and ‫ݍ‬ represent the weights between the second and third hidden layer. This technique allows us to reduce the number from 125 to 75 parameters. The trajectory references tracked by joint-1 and joint-2 are expressed as follows [51]: The simulation results are represented in Figures 5-11. In general, several hundred learning tests have been used to learn how to govern a sampled movement.       In order to solve the dynamic function, a comparative study was carried out between the two methods, the Euler method and the RK4 method. The simulation time is ‫ݐ‬ ∈ [0s,2.9s] and the sampling time is 0.01s. According to the simulation results, we can approve the efficiency of the RK4 method as can be seen from Figures 5, 7, 8, and 10 where the outputs of the first and second joint can track the reference movements and angular velocity respectively. The output is the position of the manipulator's end effector which can freely move. Due to this flexibility at the joint, oscillations are produced near the ends [8].

VI. TEST OF ROBUSTNESS
Robust control is an approach to controller design that aims to achieve robust performance and/or stability in the presence of uncertainties in the system [50]. In order to test the robustness of the proposed approach, changes of the weight and the lengths for each joint of the arm manipulator are carried out. Also changes in the initial values were affected.

Variable
Value We have chosen another motion execution described as follows [52]:  The difference between the reference and current trajectory is an input vector to the controller that generates joint rate commands. The simulation results of the proposed approach show the responses of joint positions, and position tracking errors, tracking angular velocities, and the outputs of the FNNs, for joint 1 and 2, with different initial conditions. It can be seen from Figures 12, 14, and 17 that the outputs of the first and   Table V, the average tracking error with the RK4 method is 3.10.10 -3 rad and with Euler's method it is -6.33.10 -3 rad. When the dynamic equations are derived by using the RK4 method, the system control effect is better, and tracking error of joint is smaller.  Note that the proposed scheme bends the motion tracks near the ends, as shown in Figures 7, 10, 14, and 17. This error in speed produces an error in position. This phenomenon occurs because the scheme did not fully accomplish a salient braking in the end of the motion tracking and could be diminished via further learning in motion governing. Analogously, the human also demonstrates a similar behavior in performing fast movements: an overshoot in the end of the movement [53,54]. As can be seen, the motions generated using the proposed approach capture the behaviors of the reference motions well and the simulation results verify the efficiency of the proposed solution. VII. CONCLUSION This paper presents a solution for the problem of learning and controlling a 2DoF industrial manipulator. One of the major problems in applying learning controllers to govern general motions is that the dynamics of robot manipulators are, in general, nonlinear, time-varying, and complex, which makes implementation in real time difficult. To tackle this, we have developed a Fuzzy Neural Network controller by taking advantage of the merits of the T-S fuzzy system and a Neural Network using supervised training. Network parameters and structure identifications were performed by using the ANFIS system. This design allows new parameters of the controller to be adapted in order to decrease the position tracking errors. In order to solve the dynamic function, a comparative study was carried out between two methods, the Euler method and the RK4 method, and according to the simulation results, we can accept the efficiency of the later. Finally, in order to test the system robustness, the proposed approach was also investigated for parameter variations and for another motion execution. The simulation results show that the proposed approach has a good tracking effect, and verify that the proposed scheme is sufficiently accurate and robust. Regarding future research, we are going to include a task of robust control strategies on multi DoF robotic manipulators and evaluate their performance. Velocity (rad/s) q'2R K q'R ef4 q'2Eu