## 2 Analysis of the Gait Pattern
### Robot Dynamics Description
During the heel-strike stage, it is ensured that the foot maintains contact with the ground, without sliding and bouncing;
3. The collision only changes the angular velocity;
4. Event \(u_{N}=0\) when the leg in the stance phase becomes airborne; At the moment of collision, the model state is shown as Equation (37):  
\[\frac{y_{0}}{l}+\cos(q_{1})-\cos(q_{1}+q_{2})=0 \tag{37}\]Equation (38) is the angle position relations at the heel-strike event, where '+' represents 'immediately after impact' and '-' represents 'just before impact', which are the coordinates of the stance foot for the next step:  
\[ \begin{bmatrix}q_{1}^{+}\\ q_{2}^{+}\\ x_{0}^{+}\\ y_{0}^{+}\end{bmatrix} = \begin{bmatrix}q_{1}^{-}+q_{2}^{-}\\ -q_{2}^{-}\\ x_{0}^{-}+l\big{(}\sin\bigl{(}q_{1}^{-}+q_{2}^{-}\bigr{)}-\sin\bigl{(}q_{1}^{-} \bigr{)}\bigr{)}\\ 0\end{bmatrix}  \tag{38}\]  
Kinetic equation analysis for the heel-strike process is shown as Equations (39) and (40):  
\[\dot{q}^{*}= \begin{bmatrix}j_{1}^{*}\\ \dot{q}_{2}^{*}\\ \dot{x}_{0}^{*}\\ \dot{y}_{0}^{*}\end{bmatrix}  = \begin{bmatrix}\dot{q}_{1}^{-}+\dot{q}_{2}^{-}\\ -\dot{q}_{2}^{-}\\ \dot{x}_{0}^{-}+l\left(\dot{q}_{1}^{-}+\dot{q}_{2}^{-}\right)\cos\bigl{(}q_{1 }^{-}+q_{2}^{-}\bigr{)}-l\dot{q}_{1}^{-}\cos\bigl{(}q_{1}^{-}\bigr{)}\\ \dot{y}_{0}^{-}+l\left(\dot{q}_{1}^{-}+\dot{q}_{2}^{-}\right)\sin\bigl{(}q_{1 }^{-}+q_{2}^{-}\bigr{)}-l\dot{q}_{1}^{-}\sin\bigl{(}q_{1}^{-}\bigr{)}\end{bmatrix}  \tag{39}\]  
\[q^{+}=q^{*} \tag{40}\]  
The relationship between the instantaneous impulse and the change in momentum of the model is shown as Equation (41):  
\[M\bigl{(}q^{+}\bigr{)}\dot{q}^{+}-M(q^{*})\dot{q}^{*}=J_{i}^{T}P \tag{41}\]  
where \(J_{i}= \begin{bmatrix}0&0&1&0\\ 0&0&0&1\end{bmatrix} \), and \(P\) is a \(2\times 1\) matrix that represents the impulse forces at the instant, with components along the x-axis and y-axis. Following the collision, the velocity of the new stance foot is zero. Equation (42) is derived as follows:  
\[J_{i}\dot{q}^{+}=0 \tag{42}\]  
As the switch between the two legs occurs prior to the collision, we can obtain \(q^{+}=q^{*}\). Equations (41) and (42) yield Equation (43) as follows:  
\[J_{i}\dot{q}^{*}+J_{i}M(q^{*})^{-1}J_{i}^{T}P=0 \tag{43}\]  
By utilizing Equation (43), we can derive the instantaneous impulse force shown in Equation (44):  
\[P=-(J_{i}M\bigl{(}q^{*})^{-1}J_{i}^{T}\bigr{)}^{-1}J_{i}\dot{q}^{*} \tag{44}\]  
Hence, combining Equations (41) and (44), which represents the identity matrix, we can calculate the velocity of the model immediately after the heel-strike, as shown in Equation (45):  
\[\dot{q}^{+}=(I-M(q^{*})^{-1}J_{i}^{T}(J_{i}M(q^{*})^{-1}J_{i}^{T})^{-1}J_{i}) \dot{q}^{*} \tag{45}\]  
4. Push-off:  
The instantaneous push-off process occurs slightly before the heel-strike and is implemented as a design strategy to minimize energy loss during walking. This process involves applying an instantaneous impulse at the stance foot, pushing the model along the axial direction of the stance leg. The magnitude of the impulse is equal to the change in momentum of the model, which is shown in Equation (46):  
\[M\Bigl{(}q_{p}^{+}\Bigr{)}\dot{q}_{p}^{+}-M\Bigl{(}q_{p}^{+}\Bigr{)}\dot{q}_{p }^{-}=J_{p}^{T}P_{push} \tag{46}\]where \(J_{p}= \begin{bmatrix}0&0&-\sin(q_{1}{}^{+})&\cos(q_{1}{}^{+})\end{bmatrix} \), \(P_{\text{push}}\) represents the impulse and \(J_{p}^{T}\)\(P_{push}\) represents the axial component impulses of \(P_{\text{spush}}\) in the x-direction and \(P_{\text{ypush}}\) in the y-direction. Therefore, the velocity just after push-off can be shown as Equation (47):  
\[\dot{q}_{p}^{+}=M(q_{p}^{+})^{-1}\Big{(}M\Big{(}q_{p}^{+}\Big{)}\dot{q}_{p}^{- }+J_{p}^{T}P_{push}\Big{)} \tag{47}\]  
After completing the push-off and heel-strike sequentially, the walking gait switches to the next cycle gait.