# Nonlinear Robust Adaptive Control of Universal Manipulators Based on Desired Trajectory
## 3 Controller Design
### Lyapunov Feedback Compensation Design
\begin{split}& M(q)\ddot{q}+C\big{(}q,\dot{q}\big{)}\dot{q}+G(q)+F \big{(}\dot{q}\big{)}-\big{[}M(q)\dot{q_{r}}+C\big{(}q,\dot{q}\big{)}\dot{q_{r}}+ G(q)+F\big{(}\dot{q}\big{)}\big{]}\\ &=(Y_{ld}\theta_{l0}-Y_{l}\theta_{l})+\Big{(}Y_{fd}\theta_{f0}-Y_ {f}\theta_{f}\big{)}+Y_{ld}\delta\theta_{l}+Y_{fd}\widetilde{\theta_{f}}-K_{ r}r-K_{e}e-K_{c}\|~{}e~{}\|^{2}r\end{split}  \tag{18}\]  
Note that \(r=\dot{q}-\dot{q_{r}}\). Equation (18) can be organized as:  
\[ \begin{split}& M(q)\dot{r}+C\big{(}q,\dot{q}\big{)}r\\ &=(Y_{ld}\theta_{l0}-Y_{l}\theta_{l})+\Big{(}Y_{fd}\theta_{f0}-Y_ {f}\theta_{f}\Big{)}+Y_{ld}\delta\theta_{l}+Y_{fd}\widetilde{\theta_{f}}-K_{ r}r-K_{e}e-K_{c}\|e\|^{2}r\end{split}  \tag{19}\]  
This is the closed-loop dynamics equation with respect to the state variable of the control system. Substituting it into Equation (16), we have:  
\[ \begin{split}&\dot{V}=r^{T}\Big{[}\frac{1}{2}\dot{M}(q)-C\big{(}q, \dot{q}\big{)}\Big{]}r\\ &+r^{T}\big{(}Y_{ld}\theta_{l0}-Y_{l}\theta_{l}\big{)}+r^{T} \Big{(}Y_{fd}\theta_{f0}-Y_{f}\theta_{f}\Big{)}\\ &+r^{T}\bigg{(}Y_{ld}\delta\theta_{l}+Y_{fd}\widetilde{\theta_{f} }-K_{r}r-K_{e}e-K_{c}\|e\|^{2}\bigg{)}+e^{T}K_{c}\dot{e}\end{split}  \tag{20}\]  
According to Theorem 2, \(r^{T}\Big{[}\frac{1}{2}\dot{M}(q)-C\big{(}q,\dot{q}\big{)}\Big{]}r=0\). \(\widetilde{\theta_{l}}=\theta_{l0}-\theta_{l}\) is denoted as the perturbation value of inertia parameters of links, and \(\widetilde{\theta_{f}}=\dot{\theta_{f}}-\theta_{f0}\) is denoted as the error between the online estimated friction coefficients and the initial friction coefficients. Then, we have:  
\[ \begin{split}&\dot{V}=r^{T}(Y_{ld}-Y_{l})\theta_{l}+r^{T} \Big{(}Y_{fd}-Y_{f}\Big{)}\theta_{f}\\ &+r^{T}Y_{ld}\bigg{(}\widetilde{\theta_{l}}+\delta\theta_{l}\bigg{)} +r^{T}Y_{fd}\Big{(}\hat{\theta_{f}}-\theta_{f}\Big{)}-r^{T}\Big{(}K_{r}r+K_{ e}e+K_{c}\|e\|^{2}r\Big{)}+e^{T}K_{c}\dot{e}\end{split}  \tag{21}\]  
Substituting the error in Equation (13) into the above equation and noting that \(r=\dot{e}+\Lambda e\) gives:  
\[ \begin{split}&\dot{V}=b_{1}\|e\|\|r\|+b_{2}\|e\|^{2}\|r\|+b_{3}\|r\|^{2}+b_{4}\|r\|^{2}\|e\|\\ &-r^{T}K_{r}r-e^{T}K_{e}\Lambda e-r^{T}K_{c}\|e\|^{2}r+r^{T}Y_{ld} \big{(}\widetilde{\theta_{l}}+\delta\theta_{l}\big{)}+r^{T}Y_{fd}\big{(} \hat{\theta_{f}}-\theta_{f}\big{)}\end{split}  \tag{22}\]  
Here, we break it down into three parts:  
\[\left\{ \begin{array}{l}\dot{V_{1}}=b_{1}\|e\|\|r\|+b_{2}\|e\|^{2}\|r\|+b_{3} \|r\|^{2}+b_{4}\|r\|^{2}\|e\|\\ &-r^{T}K_{r}r-e^{T}K_{e}\Lambda e-r^{T}K_{c}\|e\|^{2}r\\ \dot{V_{2}}=r^{T}Y_{ld}\big{(}\widetilde{\theta_{l}}+\delta\theta_{l}\big{)} \\ \dot{V_{3}}=r^{T}Y_{fd}\big{(}\hat{\theta_{f}}-\theta_{f}\big{)} \end{array} \right. \tag{23}\]  
where \(\dot{V_{1}}\) is the derivative term corresponding to the feedback compensation control term, \(\dot{V_{2}}\) is the derivative term corresponding to the robust control term, and \(\dot{V_{3}}\) is the derivative term corresponding to the adaptive control term. The following analyzes the conditions under which \(\dot{V_{1}}\) is a negative definite function. \[