## 2 Materials and Methods
### Control Development
#### 2.3.2 Controller Design  
The tracking performance of the leg joints can be measured using the tracking error \(e\). Assistant variable \(r\) is designed as follows:  
\[e =q_{r}-q \tag{15}\] \[r =e+\alpha e \tag{16}\]  
where \(\alpha\) is a constant gain. \(q_{d}=[q_{1d},q_{2d}]^{T}\in\mathbb{R}^{2}\) is the desired trajectory, and \(\|q_{d}\|\leq\vartheta\), \(\|\dot{q}_{d}\|\leq\bar{a}\). \(\bar{\vartheta}\) and \(\bar{a}\) denote the positive bounds. According to (16), we obtain \(\dot{q}=\dot{q}_{d}+\alpha e-r\) and \(\ddot{q}=\ddot{q}_{d}+\alpha\dot{e}-\dot{r}\). By substituting the dynamics in (1), we obtain the following:  
\[M\dot{r}=Y-\tau-\tau_{e}-Cr \tag{17}\]  
where \(Y\) is the regressor matrix of the uncertainty of system.  
\[Y=M(\ddot{q}_{d}+\alpha\dot{e})+C(\dot{q}_{d}+\alpha e)+G \tag{18}\]  
According to (17), the control torque is formulated as follows:  
\[\tau=k_{r}r+e+Y-\tau_{e} \tag{19}\]  
where \(k_{r}\) denotes the constant gain matrix. We assume that \(\hat{Y}\) denotes the estimation of \(Y\), and \(\hat{\tau}_{e}\) denotes the estimation of \(\tau_{e}\). Hence, the control torque is redesigned as follows:  
\[\tau=k_{r}r+e+\hat{Y}-\hat{\tau}_{e} \tag{20}\]  
The control torque consists of two terms: the tracking term \(k_{r}r+e\) and the estimation term \(\hat{Y}\). \(\hat{Y}\) denotes the estimation error between \(\hat{Y}\) and \(Y\).  
\[\hat{Y}=Y-\hat{Y} \tag{21}\]  
To obtain an accurate estimation \(\hat{Y}\), the adaptive law is designed as  
\[\dot{\hat{Y}}=\Gamma r+k_{cl}\Gamma(y_{p}^{T}y_{p})\hat{Y} \tag{22}\]  
where \(\Gamma\) denotes the adaptive gradient descent along the direction of the error reduction. \(k_{cl}\Gamma(y_{p}^{T}y_{p})\hat{Y}\) denotes the concurrent learning term that drives the adaptive law toward a smaller estimation error. \(k_{cl}\Gamma(y_{p}^{T}y_{p})\hat{Y}\) guarantees the convergence of the estimation process. \(\Gamma\) denotes the positive constant matrix, and \(k_{cl}\) is the selectable gain. The auxiliary output \(y_{p}\) function is defined as follows:  
\[y_{p}=\Phi+\int_{0}^{t}\Psi dy_{p} \tag{23}\]  
The auxiliary regressors \(\Phi\) and \(\Psi\) are formulated as follows:  
\[\Phi=M\dot{q}-M\dot{q}_{pre} \tag{24}\]  
\[\Psi=-\dot{M}q+C\dot{q}+G \tag{25}\]  
By substituting (20) into (17), the closed-loop error system can be obtained as follows:  
\[M\dot{r}=-k_{r}r+\hat{Y}-e-Cr \tag{26}\]Combining (16) and (26), the closed-loop dynamics can be transformed from (21) and (22), as follows:  
\[\left[\begin{array}{c}\dot{e}\\ M\dot{t}\\ \hat{Y}\end{array}\right]=\left[\begin{array}{c}r-\alpha e\\ -k_{r}r+\tilde{Y}-e-Cr\\ -\Gamma r-k_{cl}\Gamma(y^{\mathsf{T}}y)\tilde{Y}\end{array}\right] \tag{27}\]  
To eliminate the use of sensors for torque measurement, \(\hat{\tau}_{e}\) was adopted to estimate the interaction force \(\tau_{e}\) as follows:  
\[\left\{\begin{array}{c}\dot{y}_{\tau e}=-Ly_{\tau e}-L[-C\dot{q}-G+P_{\tau e }]\\ \hat{\tau}_{e}=y_{\tau e}+P_{\tau e}\end{array}\right. \tag{28}\]  
where \(\hat{\tau}_{e}\) denotes the estimated interaction force. The auxiliary vector \(y_{\tau e}\) is designed to make the observer independent of the acceleration information. The observer gains \(L\) and \(P_{\tau e}\) are formulated as follows:  
\[\left\{\begin{array}{c}L=A^{-1}M^{-1}\\ P_{\tau e}=A^{-1}\dot{q}\end{array}\right. \tag{29}\]  
where \(A\) is a constant matrix, and \(A^{-1}=\frac{1}{2}(\sigma_{\tau e,1}+2\beta_{\tau e}\sigma_{\tau e,2})I_{t}\)\(\|\dot{M}\|\leq\sigma_{\tau e,1}\), \(\|M\|\leq\sigma_{\tau e,2}\). \(\beta_{\tau e}\) determines the convergence rate. By the observation error as \(\hat{\tau}_{e}=\hat{\tau}_{e}-\tau_{e}\), the closed-loop equation of the DOB can be expressed as follows:  
\[\dot{\hat{\tau}}_{e}=-L\hat{\tau}_{e}-\hat{\tau}_{e} \tag{30}\]