## 3 Methods
### Design of Adaptive Sliding Mode Controller  
When patients wear the exoskeleton for rehabilitation training, the lower limbs may have involuntary shaking, and the exoskeleton robot may also have uncertain vibration, which will cause disturbance to the exoskeleton robot system and affect the accuracy of the tracking reference control trajectory of the exoskeleton robot. Therefore, in this paper, a sliding mode control method based on RBF neural network is proposed for position control of the exoskeleton. This algorithm uses sliding mode control to enhance the robustness of the control system against uncertain disturbances, and RBF neural network to fit the system model, which is difficult to accurately model to reduce chattering of the sliding mode controller. Considering the modeling error and uncertainty disturbance of the human-machine coupling dynamic model, the dynamic model of exoskeleton robot can be rewritten as:  
\[\textbf{M}_{\textbf{e}}(\textbf{q}_{\textbf{e}})\ddot{\textbf{q}}_{\textbf{e}}+ \textbf{C}_{\textbf{e}}(\textbf{q}_{\textbf{e}},\dot{\textbf{q}}_{\textbf{e}}) \dot{\textbf{q}}_{\textbf{e}}+\textbf{G}_{\textbf{e}}(\textbf{q}_{\textbf{e}}) +\textbf{J}_{\textbf{e}\textbf{h}}{}^{T}\textbf{F}_{\textbf{h}}+\textbf{J}_{ \textbf{e}\textbf{k}}{}^{T}\textbf{F}_{\textbf{k}}+\boldsymbol{\tau}_{\textbf{d }}=\textbf{u}, \tag{18}\]  
where \(\textbf{u}\) is the exoskeleton control torque, and \(\boldsymbol{\tau}_{\textbf{d}}\) is the uncertainty caused by modeling error and system disturbance. The goal of designing the sliding mode controller is to ensure that the actual trajectory \(\textbf{q}_{\textbf{e}}(t)=[q_{eh}(t),\ q_{ek}(t)]^{T}\) of exoskeleton can track the command trajectory \(\textbf{q}_{\textbf{d}}(t)=[q_{dh}(t),\ q_{dk}(t)]^{T}\). It assumed that the trajectory tracking error is \(\mathbf{e}(t)=\mathbf{q}_{\mathbf{d}}(t)-\mathbf{q}_{\mathbf{e}}(t)\), where \(\mathbf{e}(t)=\left[e_{h}(t),\ e_{k}(t)\right]^{T}\). The sliding surface is designed as follows:  
\[\mathbf{r}(t)=\dot{\mathbf{e}}(t)+\mathbf{\Lambda e}(t), \tag{19}\]  
where \(\mathbf{\Lambda}\)\(=\) diag\((\Lambda_{1},\Lambda_{2})\) is a positive definite matrix, \(\mathbf{r}(t)=\left[r_{1}(t),\ r_{2}(t)\right]^{T}\) is the slope of the sliding surface. Then:  
\[ \begin{array}{l}\mathbf{M}_{\mathbf{e}}\dot{\mathbf{r}}=\mathbf{M}_{ \mathbf{e}}(\ddot{\mathbf{q}}_{\mathbf{d}}-\ddot{\mathbf{q}}+\mathbf{\Lambda e })=\mathbf{M}_{\mathbf{e}}(\ddot{\mathbf{q}}_{\mathbf{d}}+\mathbf{\Lambda e})- \mathbf{M}_{\mathbf{e}}\ddot{\mathbf{q}}=\mathbf{M}_{\mathbf{e}}(\ddot{ \mathbf{q}}_{\mathbf{d}}+\mathbf{\Lambda e})-\mathbf{u}+\mathbf{C}_{\mathbf{ e}}\dot{\mathbf{q}}_{\mathbf{e}}+\mathbf{G}_{\mathbf{e}}+\mathbf{J}_{\mathbf{e}\mathbf{h}} \mathbf{}^{T}\mathbf{F}_{\mathbf{h}}\\ +\mathbf{J}_{\mathbf{e}\mathbf{h}}\mathbf{}^{T}\mathbf{F}_{\mathbf{k}}+ \mathbf{\tau}_{\mathbf{d}}=\mathbf{M}_{\mathbf{e}}(\ddot{\mathbf{q}}_{ \mathbf{d}}+\mathbf{\Lambda e})-\mathbf{C}_{\mathbf{e}}\mathbf{r}+\mathbf{C}_ {\mathbf{e}}(\ddot{\mathbf{q}}_{\mathbf{d}}+\mathbf{\Lambda e})+\mathbf{G}_{ \mathbf{e}}+\mathbf{J}_{\mathbf{e}\mathbf{h}}\mathbf{}^{T}\mathbf{F}_{ \mathbf{h}}+\mathbf{J}_{\mathbf{e}\mathbf{h}}\mathbf{}^{T}\mathbf{F}_{ \mathbf{k}}+\mathbf{\tau}_{\mathbf{d}}-\mathbf{u}=\\ -\mathbf{u}+\mathbf{f}+\mathbf{J}_{\mathbf{e}\mathbf{h}}\mathbf{}^{T}\mathbf{F} _{\mathbf{h}}+\mathbf{J}_{\mathbf{e}\mathbf{h}}\mathbf{}^{T}\mathbf{F}_{ \mathbf{k}}+\mathbf{\tau}_{\mathbf{d}}\end{array}  \tag{20}\]  
where \(\mathbf{f}=\mathbf{M}_{\mathbf{e}}(\ddot{\mathbf{q}}_{\mathbf{d}}+\mathbf{ \Lambda e})-\mathbf{C}_{\mathbf{e}}\mathbf{r}+\mathbf{C}_{\mathbf{e}}(\ddot{ \mathbf{q}}_{\mathbf{d}}+\mathbf{\Lambda e})+\mathbf{G}_{\mathbf{e}}\) is the uncertainty term in the exoskeleton dynamics model. In engineering applications, the uncertain term \(\mathbf{f}\) of the model is unknown, so it is necessary to approximate the uncertain term \(\mathbf{f}\).