PD Control Compensation Based on a Cascade Neural Network Applied to a Robot Manipulator

A Proportional Integral Derivative (PID) controller is commonly used to carry out tasks like position tracking in the industrial robot manipulator controller; however, over time, the PID integral gain generates degradation within the controller, which then produces reduced stability and bandwidth. A proportional derivative (PD) controller has been proposed to deal with the increase in integral gain but is limited if gravity is not compensated for. In practice, the dynamic system non-linearities frequently are unknown or hard to obtain. Adaptive controllers are online schemes that are used to deal with systems that present non-linear and uncertainties dynamics. Adaptive controller use measured data of system trajectory in order to learn and compensate the uncertainties and external disturbances. However, these techniques can adopt more efficient learning methods in order to improve their performance. In this work, a nominal control law is used to achieve a sub-optimal performance, and a scheme based on a cascade neural network is implemented to act as a non-linear compensation whose task is to improve upon the performance of the nominal controller. The main contributions of this work are neural compensation based on a cascade neural networks and the function to update the weights of neural network used. The algorithm is implemented using radial basis function neural networks and a recompense function that leads longer traces for an identification problem. A two-degree-of-freedom robot manipulator is proposed to validate the proposed scheme and compare it with conventional PD control compensation.


INTRODUCTION
An industrial robot manipulator frequently works at high velocities to reach its desired position. Common tasks performed by robot manipulators include trajectory tracking, reaching positions, and picking and dropping objects. These tasks need the robot controllers to maintain satisfactory dynamic behavior in spite of possible external perturbations, unknown dynamic parameters, and sensor information loss (Armendariz et al., 2014). Several controllers that are often implemented to manage these features are also mentioned (Luo and Kuo, 2016;Makarov et al., 2016;Nicolis et al., 2016;Pan et al., 2018;Hwang and Yu, 2020). Over time, the Proportional Integral Derivative (PID) control has been used to design industrial robots due to their simple structure and simple hardware implementation. However, during operation, the PID integral gain provokes the controller to reduce its bandwidth and stability (Rahimi Nohooji, 2020). PD control with uncertainty compensation has been proposed to manage the increase of integral gain due to the steady-state error. The PD controllers are also limited without gravity compensation, which requires a dynamic model (Wen Yu and Rosen, 2013). In practice, the non-linearities of a dynamic robot system are generally unknown.
To solve this issue, different approaches have been developed in order to compensate for unmodeled uncertainties (i.e., noise, gravity, and friction). Intelligent compensation is a model free and it has been applied to well-known algorithms such as the neural networks (NNs) and fuzzy logic (FL) (Krishna and Vasu, 2018;Wang et al., 2019b). In Liu et al. (2020), the authors propose an adaptive NN backstepping control design for fractionalorder non-linear systems with actuator faults whose parameters and patterns are fully unknown. Baek et al. (2016) present an adaptive sliding mode control scheme that implements the timedelay estimation. In Xu et al. (2018), a fuzzy NN sliding mode control is designed to improve controller performance against system uncertainty and external disturbances. Kumar et al. (2012) proposed a hybrid trajectory tracking controller for redundant robot manipulators. The adaptive controller is implemented to estimate unstructured uncertainties and error reconstruction. In He et al. (2018), one Radial Basis Function Neural Network (RBFNN) is used to estimate the unknown dynamics robotic manipulator. Jung and Hsia (2000) proposed two NN control schemes for a non-model-based robot manipulator, which show advantages over feedback error learning. In Zhang et al. (2018), the authors proposed a gravity compensation based on an RBFNN and robustness analysis, and the results were compared with a classic PID and PD with fixed gravity compensation. Gandolfo et al. (2019) propose a control scheme that combines a classical PD and a robust adaptive compensator based on NNs.
Although adaptive controllers are addressed for systems with non-linear and uncertainties dynamics, thus their slow convergence can lead to performance degradation or even affect operational safety. In Liu et al. (2019), an adaptive NN control with optimal number of hidden nodes and less computation is formulated for approximating the trajectory of robot manipulator. Similarly, Yang et al. (2018) develop a control and identification scheme in order to identify the unknown robot parameters with an enhanced convergence rate. Another approach is to relax the linear parameterized assumption and the requirements of system knowledge, thus, NNs have been used as function approximators. In time series modeling, RBFNN is commonly used for function approximation, since its value is different from zero in infinite space, and its approximation can avoid the local minimum (Wang et al., 2019a). An RBFNN uses a Gauss function as its activation function. In general, RBFNN controllers waste less computational resources in comparison to other NN controllers . In Wang et al. (2012), the authors proposed an RBFNN to compensate for nonlinear dynamics of the robotic manipulator and a robust control designed to suppress the modeling error of NN.
However, update laws commonly increase the weight magnitudes until the output error has been mitigated, without a robust design continued training can lead to excessive control effort. In order to avoid this, adaptive controls frequently update the neural weights according to robust adaptive laws, which are computed with Lyapunov methods (Razmi and Macnab, 2020). In this work, a robust adaptive control design to compensate a nominal controller for robot manipulator with uncertainties and external perturbations is formulated. Moreover, a scheme based on two RBFNN in cascade is proposed in order to improve the response of the nominal controller. In the scheme aforementioned, the first NN is used to estimate the error and the second uses the estimation error value to improve the output of the nominal controller. NN weights are online updated by developing new adaptive laws. The adaptive law based on the gradient is modified by introducing a recompense function of the online error in order to improve the convergence of the NN weights.
In this work, a PD control with a scheme based on NNs in cascade is designed to manage the compensation of uncertainties in a robot manipulator. The main contributions of this paper are summarized as follows: • In order to improve the robustness of the system against external disturbance, and unknown system parameters, a scheme of cascade NNs is proposed. • A recompense function for neural weights updates is proposed in order to improve the NNs' weights convergence. • The response of the nominal controller is improved.
To validate the proposed scheme and compare it with conventional neural compensation, a two-degree-of-freedom robot manipulator (TDOFRM) is proposed. This paper is organized as follows: Section 2 presents the preliminary mathematical model of the TDOFRM, the conventional PD compensation with RBFNN. Section 3 describes the controller design based on NNs in cascade. Section 4 presents simulation experiments and compared with the conventional compensation, and finally, section 5 presents the conclusions.

Dynamic Model of Robotic Manipulator
The dynamic model of an n degree of freedom robot manipulator can be described as follows (Spong and Vidyasagar, 1989): is a n × n inertia matrix, C(q,q) is a n × n is a centrifugal and Coriolis matrix, and g(q) is a n×1 vector of gravity. q,q,q are the position, velocity, and acceleration of each link, respectively. τ ∈ R n is the control input and d denotes disturbances.

Proportional Derivative Control Scheme
In industrial application, the exact model is difficult to obtain and external disturbances are always present in practice. According to Liu (2013), a nominal model of robot manipulator can be computed as M 0 (q), C 0 (q,q), and g 0 (q). Considering M = M 0 − M, C = C 0 − C, and g = g 0 − g, Equation (1) is reordered as follows: Thus, Submitting Equation (4) into Equation (3), the close loop system can be expressed as follows: in industrial applications is unknown, hence, f (·) requires to be estimated and compensated.

Radial Basis Function Neural Network Approximation
The NNs approximates M(q), C(q), and g(q) when they are unknown. The Radial Basis Function (RBF) algorithm can approximate a continuous function and it is defined as and W * = argmin is n × n matrix that denotes the optimal weigh values for f (·) approximation.

Adaptive Law to Compensation Control
In the controller scheme proposed (Feng, 1995), the close loop system is given by the following equation: wheref (·) =Ŵφ(x) andŴ is an estimation of W * . Equations (1) and (9) have the same term, and the substitution result is shown in the following equation: Then, the equation M 0 (q)q + C 0 (q,q)q + g 0 (q) is subtracted with Equation (10) in both sides as follows: The result is given as follows: Equation (12) can be rewritten as follows: Select to x = ( eė ) T . Equation (13) turns intȯ where where ζ denotes the modeling error due to the use of the NN. The modeling error ζ is bounded by a finite constant ζ 0 , where The Lyapunov function is given by the following equation: whereW =Ŵ − W * is a definition that describes the estimation error. In Equation (17), P is a positive definite matrix that satisfies the Lyapunov equation Equation (17) can be rewritten in terms of the next definition Thus, the derivative of V is given as follows: Substituting Equation (16) for (20), the results is given bẏ Considering that x T PBζ = ζ T B T Px, x T PBW T φ = φ TW B T Px and φ TW B T Px = tr[B T Pxφ TW ] in Equation (21), this results iṅ

Adaptive Control Based on Cascade Neural Network
The PD control has been widely implemented in robot control to deal with the drawbacks presented by the integer gain in PID control. However, the PD control can have similar deficiencies if the derivative gain has high values (Wen Yu and Rosen, 2013). The PD control with compensation presents positive results to avoid high derivative gains and identify uncertainties that occur in the real operation of robot manipulators. In this work, a compensation of the nominal controller is proposed. The adaptive control scheme is shown in Figure 1. Two RBFNN in cascade are proposed to deal with the tracking error and the NN weight estimation error.

NN Weight Estimation Error
The input of NN is an error vector defined as follows: where i and ϑ denote the real and desired position and velocity of the n-link of the robot. The NN estimation error anticipates which action to take in order to improve the output of the nominal control. Thus, the prediction of estimation error is also given as the output of RBFNN as follows: where φ e is the Gaussian function given by Equation (6). The criterion for the weight update is proposed in the following equation:Ẇ e = γ e rφ e (x) T PB where r = e −x 2 e is a function that represents the recompense signal. The goal of the recompense function is to lead longer traces for an identification problem.

Adaptive Law to Compensate the Nominal Controller
A novel adaptive control scheme is proposed to ensure that the output of the nominal controller for the system defined in Equation (1) reaches the position desired, and the estimated NN can converge an ideal weight. An RBFNN is selected to approximate the system dynamics and deals with uncertainties and external disturbances, which is given as follows: where φ c is a Gaussian function given by the equation form 6.
The NN actor provides compensation to the PD controller to, that is,f (·) =f * . The weigh update of the NN actor is proposed according to the following equation: If we select the parameter update law asẆ =Ẇ, we assume that the value x ≈x + (x − x). Substituting Equation (27) into Equation (22), the result is given aṡ Frontiers in Neurorobotics | www.frontiersin.org As it is well-known, ζ T ≤ ζ 0 and from Equation (15), B = M −1 0 (q) , and Equation (28) can be written as follows: where λ min denotes the minimum eigenvalues of matrix Q and λ max denotes the maximum eigenvalues of matrix P. In order to satisfyL ≤ 0, the value of x should be satisfied as follows: According to Equation (28),L is negative semidefinite, that is L(x, W, t) ≤ L(x, W, 0). It implies that x, and W are bounded. Let function =L and integrate with respect to time as follows: Due to L(x, W, 0) is bounded, and L(x, W, t) is non-increasing and bounded, the following result can be computed: Since˙ (s) is bounded, by Barbalat's lemma (Slotine and Li, 1991), lim t→∞ (s) = 0, that is x → 0 as t → ∞.
The desired position vector is defined as follows: The initial positions are given by q 0 = π 12 π 12 T . The uncertainties and unknown disturbances are defined as follows: Frontiers in Neurorobotics | www.frontiersin.org Two RBFNNs are proposed for critic and actor agents. Here, γ e is the learning rate of the RBFNN estimation error and γ c is the learning rate of the RBFNN tracking error; c i is the center vector of neural net i and b is the width value of Gaussian function for neural net i. The next values are proposed due to the optimal weight for the actor NN and critic NN could take arbitrary large values, but in order to avoid any numerical problems, this work considers γ e = 0.5, γ c = 0.4, c i = −2 −1 0 1 2 , b i = 0.5, and i = 4. The uncertainties and disturbances were added to the controller. According to the RBFNN in cascade, an RBFNN predicts the NN estimation error, and this value is included in adaptive laws to update the RBFNN compensation in order to take adequate action for the disturbances and guarantee the convergence of tracking error. The proposed recompense function helps to maintain longer traces for the identification task over time.
The compensation of proposed algorithm is compared with an RBFNN compensation. Figure 4 shows tracking errors for links 1 and 2. The red line represents the tracking error of an RBFNN for compensation, which presents overshoot to reach the desired positions and oscillations in steady state. The blue line indicates the tracking error of the proposed algorithm, which present robustness against uncertainties and disturbances. The green line indicates the desired tracking positions for links 1 and 2.
The simulations were proposed in order to show the difference between adaptive conventional control and the proposed scheme. In this sense, two desired tracking signal was proposed that goes at different velocities, and link 1 follows a slow signal and link 2 follows a fast signal. Figure 5 shows the control inputs to links 1 and 2, and it also exhibits the improvement of the nominal controller under our scheme proposed in comparison with adaptive conventional control.
In Figure 6, the NN weights convergence process of the two RBFNN in cascade are shown. Figure 6 also denoted as the identification process in order to deal with the uncertainties and external disturbances is reached.
The important factors that usually must be considered together are time and error. A performance index is a measure that indicates those features of the response that are regarded  Table 2 shows that the proposed controller presents a better response than the conventional PD control compensation based on an RBFNN. According to the performance indices of links 1 and 2, the proposed scheme presents an adequate response against external disturbance. Moreover, it presents less oscillation in steady state and less time in the transient response than the conventional compensation based on an RBFNN.

CONCLUSIONS
The algorithm proposed has been implemented to compensate for the PD control of a TDOFRM. A PD control was selected because the common knowledge that if designed with gravity compensation, it can reach asymptotic stability. The cascade scheme was implemented by two RBFNN in cascade, which compensates for the control input in order to deal with the estimation error, uncertainties, and external disturbances. The proposed algorithm was validated using a simulation of a TDOFRM. Two adaptive algorithms for compensating for the controller of robot manipulators were implemented. The first was based on a conventional RBFNN, and the second is the proposed algorithm that uses two RBFNN. An adaptive law is proposed to deal with the simultaneous convergence of both NNs, which are used to estimate for tracking error and estimation error. The results showed that the proposed compensation scheme based on RBFNN presents robustness against external uncertainties and disturbances, also an adequate convergence for the NN weights. Position tracking has been reached without overshoots and oscillations in steady state in comparison to compensations with a conventional RBFNN scheme.

DATA AVAILABILITY STATEMENT
The raw data supporting the conclusions of this article will be made available by the authors, without undue reservation.

AUTHOR CONTRIBUTIONS
JB and GH proposed a two-degree-of freedom robot manipulator to validate the scheme proposed and they also design the robot manipulator simulation. JV-N and DB contributed to the analysis and discussion of results. LS and EZ contributed with the theoretical analysis, simulations, and also written the main text. All authors participated and contributed to the final version manuscript.