## 3 Controller Design and Stability Analysis
### Controller Design  
The TDE technique is applied to handle the system uncertainty in (2):  
\[\hat{\mathbf{\Gamma}}(t)\approx\mathbf{\Gamma}(t-L)=\ddot{\mathbf{q}}(t-L)-\hat{\mathbf{M}}^{- 1}(\mathbf{q}(\mathbf{t}-\mathbf{L}))\mathbf{\tau}(t-L) \tag{7}\]  
where \(\hat{\mathbf{\Gamma}}(t)=\left[\hat{t}_{1},\hat{t}_{2},..,\hat{t}_{n}\right]^{T} \in R^{n}\) is the estimate of \(\Gamma(t)\). \(L>0\) is the sampling time of TDE. **Lemma 1**: _[_14_]_ _The TDE error of robotic manipulator (2) is bounded such that \(\left|\Gamma_{i}(t)-\hat{t}_{i}(t)\right|\leq\Gamma_{i}^{*}\) (for \(i=1,2,\ldots,n\)) if the following condition is satisfied:_  
\[\left|\left|\mathbf{I}-\mathbf{M}^{-1}(\mathbf{q}(t))\hat{\mathbf{M}}(\mathbf{q}(t-L))\right| \right|_{2}<1 \tag{8}\]  
where \(\Gamma_{i}^{*}\) is an unknown positive constant. The control law working with TDE technique is designed as follows:  
\[\mathbf{\tau}(t)=\hat{\mathbf{M}}(\mathbf{q}(t))\big{[}-\hat{\mathbf{\Gamma}}(t)+\mathbf{u}(t) \big{]} \tag{9}\]  
where \(\mathbf{u}(t)=\left[u_{1}(t),u_{2}(t),\ldots,u_{n}(t)\right]^{T}\in R^{n}\) is the virtual control law. The virtual control law in (9) is designed as follows:  
\[ \begin{split} u_{i}=-\dot{d}_{i}sgn\big{(}\hat{q}_{i}\big{)}- \frac{1}{1+k_{yi}\Gamma_{i}}\Big{[}& k_{pi}e_{i}+k_{di}\hat{q}_{ i}+k_{si}A_{i}q_{i}+k_{si}B_{i}z_{i}+\Lambda_{i}\,\hat{q}_{i}+\Lambda_{i} \Lambda_{i}tanh\bigg{(}\frac{e_{i}}{\mathfrak{C}_{i}}\bigg{)}\\ & ti=1,\,2,\,\ldots\,,n\end{split}  \tag{10}\]  
where \(k_{pi}\), \(k_{si}\), \(k_{di}\), \(\mathfrak{C}_{i}\) and \(k_{yi}\) are the positive constants determined by users. \(\Lambda_{i}>0\) is a positive variable determined by the fuzzy reinforcement learning mechanism. \[A_{i}=\frac{\varepsilon_{i}^{2}z_{i}^{2}}{\big{(}\varepsilon_{i}^{2}-q_{i}^{2 }\big{)}^{2}},\,\,B_{i}=\frac{\varepsilon_{i}^{2}}{\varepsilon_{i}^{2}-q_{i}^{ 2}},\,\,C_{i}=\frac{2\Lambda_{i}^{2}}{\big{(}\Lambda_{i}^{2}-q_{i}^{2}\big{)}^{ 2}} \tag{11}\]  
where \(\varepsilon_{i}>0\) is the restricted upper bound of angular position of the \(i^{th}\) joint. \(\Lambda_{i}>0\) is the restricted upper bound of angular velocity of the \(i^{th}\) joint. And the variable \(z_{i}\) is defined as follows:  
\[z_{i}=e_{i}+\int_{0}^{t}\eta_{i}(\Theta)d\Theta,\,\,\eta_{i}=-\beta_{i}z_{i} \tag{12}\]  
where \(\beta_{i}\) is a positive constant. The \(\hat{d}_{i}\) is used to handle the bounded TDE error and the update law of \(\hat{d}_{i}\) is designed as follows. \[\hat{d}_{i}= \begin{cases}\psi_{i}\big{(}1+k_{yi}C_{i}\big{)}\big{|}\dot{q}_{ i}\big{|}\,,\,\,if\Big{(}\hat{d}_{i}\leq 0\Big{)}\text{ or }\big{(}\Omega_{i}>\overline{\Omega}_{i}\big{)}\\ -\psi_{i}\frac{\delta_{i}}{\big{(}1+k_{yi}C_{i}\big{)}|\dot{q}_{i}\big{|}}\,, \,\,if\Big{(}\hat{d}_{i}>0\Big{)}\text{ and }\big{(}\Omega_{i}\leq \overline{\Omega}_{i}\big{)}\end{cases}  \tag{13}\]where \(\psi_{i}\), \(\delta_{i}\) and \(\overline{\Omega}_{i}\) are positive constants. The variable \(\Omega_{i}\) is defined as (14). \[\Omega_{i}=\frac{1}{2}\dot{q}_{i}^{2}+\frac{1}{2}k_{pi}e_{i}^{2}+\frac{1}{2}k_{ si}\frac{e_{i}^{2}z_{i}^{2}}{e_{i}^{2}-q_{i}^{2}}+k_{yi}\frac{\dot{q}_{i}^{2}}{ \Lambda_{i}^{2}-\dot{q}_{i}^{2}}+\Lambda_{i}\mathbb{G}_{i}\ln\left[\cosh\left( \frac{e_{i}}{\dot{\mathbb{G}}_{i}}\right)\right] \tag{14}\]  
**Remark 3**. : \(\hat{d}_{i}\) _is to guarantee the stability in the presence of the bounded TDE errors. A conservative update law of \(\hat{d}_{i}\) is to monotonously increase the value of \(\hat{d}_{i}\) such that \(\hat{d}_{i}=\psi_{i}\big{(}1+k_{yi}\mathbb{C}_{i}\big{)}\big{|}\hat{q}_{i}\big{|}\). Although such adaptive law can achieve the bounded tracking errors and angular velocities, the great value of \(\hat{d}_{i}\) could result in the chattering effect on the calculated control torques. Therefore, a novel adaptive law for \(\hat{d}_{i}\) shown in (13) is proposed to mitigate the chattering effect by decreasing the value of \(\hat{d}_{i}\) without the breach of stability of system. The proof will be given later.