## 4 Control-Law Design
### Design of Comparison Scheme for the First Group of Controllers
#### 4.1.2 Design of Sliding Mode Controller  
Since \(\theta_{2}(t)\) is a function of \(\theta_{1}(t)\), we define them as follows (where \(\Delta>0,K_{p},K_{f}>0\)). Taking \(K_{p}=\begin{bmatrix}5&0\\ 0&2\end{bmatrix},K_{f}=140,\Delta=0.3\), then:  
\[\left\{\begin{array}{l}e_{1}=\theta_{d1}-\theta_{1},e_{f}=f_{d}-f\\ \dot{\theta}_{\uparrow 1}=\dot{\theta}_{d1}+\Delta e_{1},r_{1}=\dot{e}_{1}+ \Delta e_{1}\end{array}\right., \tag{18}\]  
where \(e_{1}\) is the tracking error of the joint angle \(\theta_{1}\); \(e_{f}\) is the tracking error of the contact force \(f\); and we take \(r_{1}\) as the sliding surface. The sliding-mode function is \(r_{L1}=L(\theta_{1})r_{1}\). The contact control is \(f_{\uparrow}=f_{d}+K_{f}e_{f}\). The SMC scheme is designed to:  
\[\tau=M_{1}(\theta_{1})\bar{\theta}_{\uparrow 1}+C_{1}\Big{(}\theta_{1},\dot{ \theta}_{1}\Big{)}\dot{\theta}_{\uparrow 1}+G_{1}(\theta_{1})+K_{P}r_{L1}+J_{ \phi}^{T}(\theta_{1})f_{\uparrow}, \tag{19}\]  
When we substitute Equations (18) and (19) into Equation (8), according to Properties 1 and 2 and Equation (12), we get:  
\[M_{L}(\theta_{1})\dot{r}_{1}+C_{L}\Big{(}\theta_{1},\dot{\theta}_{1}\Big{)}r_ {1}+L^{T}(\theta_{1})K_{P}r_{L1}=0, \tag{20}\]  
Next, the stability and convergence of the controller are analyzed with the Lyapunov function:  
\[V=\frac{1}{2}M_{L}(\theta_{1})r_{1}^{2}, \tag{21}\]  
By taking the derivative of Equation (21), we consider Equations (18) and (20) and Property 1, so we have:  
\[\dot{V}=r_{1}\Big{(}-L^{T}(\theta_{1})K_{p}r_{L1}\Big{)}=-r_{L1}^{T}K_{p}r_{L1 }\leq 0, \tag{22}\]  
Since \(\dot{V}\) is semi-negative definite, and \(K_{p}\) is positive definite, then when \(\dot{V}\equiv 0\), \(r_{L1}\equiv 0,\dot{r}_{L1}\equiv 0;then\)\(r_{1}\equiv 0,\dot{r}_{1}\equiv 0,\dot{e}_{1}\equiv 0,e_{1}\equiv 0\). According to the [PERSON] theorem, when \(t\Rightarrow\infty,e_{1}\Rightarrow 0,\ddot{e}_{1}\Rightarrow 0\). From \(f_{\uparrow}-f=e_{f}+K_{f}e_{f}=\Big{(}1+K_{f}\Big{)}e_{f}=0\), we know that \(e_{f}=0\), and according to [PERSON]'s theorem, when \(t\Rightarrow\infty\), the convergence speed of \(f\Rightarrow f_{d}\), depending on \(\Big{(}1+K_{f}\Big{)}\).  
In the preceding section, we reconstructed the MPC model guided by the recent literature and considered the specifics of our research. This scheme involves the generation of control commands by forecasting the future state of the robot. However, we introduced an SMC tailored to our research subject in this section because of the model inaccuracies and external disturbances. Illustrated in Figure 2 are the schematics of these two controllers. Considering the joint angle \(\theta_{1}\) tracking performance under two common disturbances (see Figures 6-8 in Section 5.1), we opted for the SMC scheme.  
Effective control of single-leg motion can be achieved by judicious selection of a suitable sliding-mode function. However, the switching gains required to address modeling uncertainties in SMC may lead to issues of decreased precision. As discussed in Sections 4.1.1 and 4.1.2, when using a high gain (see Table 2), SMC outperformed the designed linear MPC in the displacement-tracking effect, while there were still high errors in contact-force tracking (refer to Figures 6-8 in Section 5.1). The LADRC, characterized by solid disturbance rejection capabilities and high control accuracy, represents an advanced control method. Consequently, in the subsequent section, we design the LADRC based on the SMC scheme to enhance the contact-force tracking effectiveness of the SMC scheme.