# Nonlinear Robust Adaptive Control of Universal Manipulators Based on Desired Trajectory
## 3 Controller Design
### Lyapunov Feedback Compensation Design  
Since the desired trajectory is used to compensate the dynamic model of the robot, it will inevitably affect the control. In the following, the compensation control term is designed based on the Lyapunov stability theory. The position error during trajectory tracking is denoted as \(e=q-q_{d}\). Based on the theory of sliding mode control, the model reference velocity is denoted as \(\dot{q}_{r}=\dot{q}_{d}-\Lambda e\), and the model's reference acceleration is denoted as \(\ddot{q}_{r}=\ddot{q}_{d}-\Lambda\dot{e}\), which introduces the reference velocity error:  
\[r=\dot{q}-\dot{q}_{r}=\dot{q}-\big{(}\dot{q}_{d}-\Lambda e\big{)}=\dot{e}+\Lambda e \tag{12}\]  
where \(\dot{q}_{r}\) and \(\ddot{q}_{r}\) are mentioned in Equation (3), and \(\Lambda\in R^{6\times 6}\) is a symmetric positive-definite matrix. The reference velocity error will be shown as a state variable of the control system in the subsequent proof. Next, a lemma is given in advance for use in the subsequent proof. **Lemma 1**. : _For robotic systems, the error due to the use of desired trajectory computation to compensate for the dynamics can be bounded by a priori known non-negative constants \(b_{1},b_{2},b_{3},b_{4}\)[34]:_  
\[ \begin{split}& r^{T}\big{(}Y_{ld}-Y_{l}\big{)}\theta_{l}+r^{T} \Big{(}Y_{fd}-Y_{f}\Big{)}\theta_{f}\\ &\leq b_{1}\|\ e\ \|\ \|\ r\|+b_{2}\|\ e\ \|^{2}\|\ r\ \|+b_{3}\|\ r\ \|^{2}+b_{4}\|\ r\ \|^{2}\|\ e\ \|\end{split}  \tag{13}\]  
_where \(\|\star\|\) is the Euclidean norm of \(\star\)._  
Now, the design of each control term is given below:  
\[ \begin{split}& u=u_{feedforward}+u_{robust}+u_{adaptive}+u_{ compensation}\\ &\left\{\begin{array}{l}u_{feedforward}=Y_{l}\big{(}q_{d}, \dot{q}_{d},\dot{q}_{d},\ddot{q}_{d}\big{)}\theta_{l0}+Y_{f}\big{(}\dot{q}_{ d}\big{)}\theta_{f0}\\ u_{robust}=Y_{l}\big{(}q_{d},\dot{q}_{d},\dot{q}_{d},\ddot{q}_{d}\big{)} \delta\theta_{l}\\ u_{adaptive}=Y_{f}\big{(}\ddot{q}_{d}\big{)}\widetilde{\theta_{f}}\\ u_{compensation}=-K_{r}r-K_{e}-K_{c}\|e\|^{2}r\end{array}\right.\end{split}  \tag{14}\]  
where \(u_{feedforward}\) is the nominal dynamics feedforward term from Equation (11), and \(u_{robust}\) and \(u_{adaptive}\) are the robust and adaptive terms, whose implementation will be developed in detail in the next two subsections. \(\widetilde{\theta_{f}}=\dot{\theta_{f}}-\theta_{f0}\) denotes the error between the online estimated friction coefficients and the initial friction coefficients. The update law of \(\dot{\theta_{f}}\) is given in the design of \(u_{adaptive}\). \(K_{r}\), \(K_{e}\), and \(K_{c}\) are symmetric positive definite matrices. In this subsection, the design of the feedback compensation control term \(u_{compensation}\) is mainly considered. The following design is based on Lyapunov stability theory. For the control system, the position error \(e\) and the reference velocity error \(r\) are selected as the state variables. Based on the Lyapunov stability theory, the positive definite function is selected as the Lyapunov function:  
\[V=\frac{1}{2}r^{T}M(q)r+\frac{1}{2}e^{T}K_{e}e \tag{15}\]  
Taking the derivative of \(V\) in Equation (15) with respect to time, we have:  
\[\dot{V}=r^{T}M(q)\dot{r}+\frac{1}{2}r^{T}\dot{M}(q)r+e^{T}K_{c}\dot{e} \tag{16}\]Substituting the total output of the control system in Equation (14) into the robot dynamics in Equation (1) gives:  
\[ \begin{split}& M(q)\ddot{q}+C\big{(}q,\dot{q}\big{)}\dot{q}+G(q)+F \big{(}\dot{q}\big{)}\\ &=Y_{ld}(\theta_{l0}+\delta\theta_{l})+Y_{fd}\big{(}\theta_{f0}+ \widehat{\theta_{f}}\big{)}-K_{r}r-K_{e}e-K_{c}\|e\|^{2}r\end{split}  \tag{17}\]  
Both sides of Equation (17) are simultaneously subtracted from both sides of Equation (3), and we obtain:  
\[