## 2 Dynamic Analysis and Modeling of Single Leg  
A multilegged robot's foot contact motion differs significantly from traditional gait motions. To address uncertainties and external disturbances, it is necessary to reduce the model order, design a suitable controller, and enhance anti-interference ability by offsetting model uncertainty. This study used the single-leg system as an example. Figure 1 depicts a double-joint single leg with horizontal constraints, serving as the basis for analyzing force and position in a limited movement scenario of a single-leg robot. Where \(\theta_{1}\) and \(\theta_{2}\) are the hip and knee joints, respectively, and where \(f\) is the restrictive contact force. The \(l_{1}\) and \(l_{2}\) are the lengths of leg joints. Based on Figure 1, let \(y\) be the foot position vector. Then, the constraint equation and its Jacobian information are:  
\[\left\{ \begin{array}{l}\Psi(\theta)=\psi(y)=\psi(g(\theta))=0\\ J_{\psi}(\theta)=\frac{\partial\varphi(y)}{\partial y}\frac{\partial\varphi( \theta)}{\partial\theta}\end{array} \right., \tag{1}\]  
Friction and load variation uncertainties were considered for a single-leg system. The standard dynamic equation for a single leg can be expressed as Equation (2). \[\left\{\begin{array}{l}M(\theta)\ddot{\theta}+C(\theta,\dot{\theta})\dot{ \theta}+G(\theta)=\tau\\ \left\{\begin{array}{l}M(\theta)= \begin{bmatrix}\alpha+2(\varepsilon cos( \theta_{2})+\eta sin(\theta_{2}))&\beta+\varepsilon cos(\theta_{2})+\eta sin( \theta_{2})\\ \beta+\varepsilon cos(\theta_{2})+\eta sin(\theta_{2})&\beta\end{bmatrix} \\ C(\theta,\dot{\theta})=\begin{bmatrix}2(-\varepsilon sin(\theta_{2})+\eta cos (\theta_{2}))\dot{\theta}_{2}&(-\varepsilon sin(\theta_{2})+\eta cos( \theta_{2}))\dot{\theta}_{2}\\ (\varepsilon sin(\theta_{2})-\eta cos(\theta_{2}))\dot{\theta}_{1}&0\\ G(q)= \begin{bmatrix}\varepsilon\varsigma_{2}cos(\theta_{1}+\theta_{2})+\eta \varsigma_{2}sin(\theta_{1}+\theta_{2})+(\alpha-\beta+\varsigma_{1}) \varsigma_{2}cos(\theta_{1})\\ \varepsilon\varsigma_{2}cos(\theta_{1}+\theta_{2})+\eta\varsigma_{2}sin( \theta_{1}+\theta_{2})\end{bmatrix} \\ \left\{ \begin{array}{l}\alpha=I_{1}+m_{1}l_{\rm cl}^{2}+I_{2}+m_{2}l_{\rm cl }^{2}+m_{2}l_{\rm l}^{2};\beta=I_{2}+m_{2}l_{\rm cl}^{2}\\ \varepsilon=m_{2}l_{\rm l}l_{\rm cl}\cos(\delta_{2});\eta=m_{2}l_{\rm l}l_{\rm cl }\sin(\delta_{2});\varsigma_{1}=m_{1}l_{\rm l}l_{\rm cl}-I_{1}-m_{1}l_{\rm l}^ {2}\\ \varsigma_{2}=g/l_{\rm l},\;\;g\text{ is the acceleration of gravity}\end{array} \right., \tag{2}\]  
This formula is also the general paradigm for a double-joint mechanical leg or arm (see References [5; 9; 14] in the Introduction). Where \(m_{1}\) and \(m_{2}\) are the masses of legs \(l_{1}\) and \(l_{2}\), \(l_{\rm cl}\) and \(l_{\rm cl}\) are half the lengths of legs \(l_{1}\) and \(l_{2}\), respectively. \(\theta= \begin{bmatrix}\theta_{1}&\theta_{2}\end{bmatrix} ^{T}\), \(\tau= \begin{bmatrix}\tau_{1}&\tau_{2}\end{bmatrix} ^{T}\), \(\alpha,\beta,\varepsilon,\eta\) are functions of the physical parameters, which are listed in Table 1 based on physical knowledge. \begin{table}
\begin{tabular}{c c c c c c c c c} \hline \(m_{1}\) & \(l_{1}\) & \(l_{\rm cl}\) & \(l_{\rm 1}\) & \(m_{2}\) & \(l_{\rm 2}\) & \(l_{\rm 2}\) & \(\delta_{2}\) & \(\varsigma_{1}\) & \(\xi_{2}\) \\ \hline \(1\,\mathrm{kg}\) & \(1\,\mathrm{m}\) & \(0.5\,\mathrm{m}\) & \(0.1\,\mathrmConsidering the uncertainty of the friction and load variation in single-legged robots, we added the constraint term \(\tau_{f}=J_{\psi}^{T}(\theta)f\). We substituted Equation (1) and Table 1 into Equation (2) and simplified to obtain Equation (3). Among them, \(M(\theta)\) is the \(2\times 2\) order positive definite inertia matrix; \(C\Big{(}\theta,\dot{\theta}\Big{)}\) is the \(2\times 2\) order centrifugal force, Coriolis force; \(G(\theta)\) is the \(2\times 1\) order gravity term; and \(Y=\theta\) is the output vector. \(\tau_{f}\) represents the constraint term, and the \(\tau\) represents the control torque.