## 3 Control Design  
### Adaptive Sliding Mode Control  
**Remark 1**. : _This section presents an ASMC for the robotic manipulator under the existence of disturbance. The unknown control direction does not happen in this case. Therefore, \(\mathbf{B}=\mathbf{I}_{n\times n}\)._  
\(\mathbf{e}=\mathbf{x}_{1}-\mathbf{x}_{1d}\) is the trajectory tracking error and \(\mathbf{x}_{id}\) presents the desired trajectory. A sliding mode surface is selected as follows:  
\[\mathbf{s}=\dot{\mathbf{e}}+\lambda\mathbf{e} \tag{6}\]  
where \(\lambda=diag(\lambda_{1},\lambda_{2},\dots,\lambda_{n})\in R^{n\times n}\), \((i=1,2)\) are positive definite matrices. The time derivative of the sliding surface is computed as  
\[\dot{\mathbf{s}}=\ddot{\mathbf{e}}+\lambda\dot{\mathbf{e}} \tag{7}\]  
Replacing (2) into (7), it is rewritten as follows:  
\[\dot{\mathbf{s}}=\lambda\dot{\mathbf{e}}+\mathbf{M}^{-1}(\mathbf{x}_{1})( \mathbf{B}\mathbf{u}-\mathbf{C}(\mathbf{x}_{1},\mathbf{x}_{2})\mathbf{x}_{2}- \mathbf{G}(\mathbf{x}_{1})-\mathbf{d}(t))-\mathbf{\tilde{x}}_{1d} \tag{8}\]Based on assumption 2 and the sliding mode design procedure, an SMC can be designed as  
\[\mathbf{u}=\mathbf{u}_{eq}+\mathbf{u}_{r} \tag{9}\]  
where  
\[\mathbf{u}_{eq}=\mathbf{B}^{-1}\big{(}\mathbf{M}(\mathbf{x}_{1})\big{(}\tilde{ \mathbf{x}}_{1\mathbf{d}}-\lambda\dot{\mathbf{e}}\big{)}+\mathbf{C}(\mathbf{x }_{1},\mathbf{x}_{2})\big{(}\dot{\mathbf{x}}_{1\mathbf{d}}-\lambda\mathbf{e} \big{)}+\mathbf{G}(\mathbf{x}_{1})-\mathbf{k}\mathbf{s}\big{)} \tag{10}\]  
is an equivalent control with \(\mathbf{k}=diag([k_{1},\ldots,k_{n}])\in R^{n\times n}\), and  
\[\mathbf{u}_{r}=-\mathbf{B}^{-1}\mathbf{n}sign(\mathbf{s}) \tag{11}\]  
is used to ensure the stability of the system with the existence of the uncertainties, \(\mathbf{\eta}=diag([\eta_{1},\ldots,\eta_{n}])\in R^{n\times n}\) expresses a diagonal positive matrix which is chosen for the condition \(\mathbf{\eta}_{i}\geq|\delta_{i}|\). The function is \(sign(\mathbf{x})=[sign(x_{1}),\ldots,sign(x_{n})]^{T}\in R^{n\times 1}\). In practice, the external disturbance usually changes with respect to time, and the robust gains can cause the chattering effect when the robust gains are significantly larger than the external disturbance. In order to overcome this disadvantage, fast adaptive laws are developed to adjust the robust gain online with respect to the external disturbance. The robust control (11) is replaced by the equation below:  
\[\mathbf{u}_{r}=-\mathbf{B}^{-1}\mathbf{\eta}sign(\mathbf{s}) \tag{12}\]  
The adaptive laws are selected as follows:  
\[\dot{\mathbf{\eta}}_{i}= \begin{cases}\kappa_{1i}\big{(}\kappa_{2i}^{-1}|s_{i} |\big{)}^{\gamma(t)}\gamma(t)&\text{, if }0<\hat{\eta}_{i},\min_{i}|s_{i}|\geq \varepsilon_{2}\\ \kappa_{1i}\kappa_{2i}|s_{i}|^{-1}&\text{ if }\hat{\eta}=0,\min_{i}|s_{i}|\geq \varepsilon_{2}\\ 0&\text{ otherwise}\end{cases}  \tag{13}\]  
where \(\gamma(t)=sign(|s_{i}|-\varepsilon_{1})\), \(\kappa_{ji}(j=1,2;i=1,\ldots,n)\) are positive constants, \(\varepsilon_{1}\) are predefined error boundaries, \(\varepsilon_{1}=10\varepsilon_{2}\geq 0\). These adaptive robust gain laws do not need knowledge of the upper boundary of the external disturbance. The adaptive robust gains will rapidly grow and drive the sliding surface \(s_{i}(i=1,\ldots,n)\) to the desired areas that are smaller than \(\varepsilon_{1i}\). Otherwise, when the sliding variable stays in these regions, the gains will gradually reduce. From the property of the adaptive robust gain laws, the chattering effect is significantly reduced under the existence of the time-varying external disturbance. **Theorem 1**. : _When we consider the external disturbance in the robot manipulator with the known control direction described in (2), the sliding mode surface presented in (6), and the controller defined in (9), then the sliding variables\(s_{i}\), are bounded. Additionally, the chattering effect is reduced significantly._  
Proof.