# Stability Criterion for Dynamic Gaits of Quadruped Robot
## 2 ZMP for Irregular Terrain
To solve this problem, the positions of the previous support line, \(\overline{A_{F}B_{F}}\), and the next support line, \(\overline{A_{L}B_{L}}\) are comprehensively considered (for gaits with only one support point, such as gallops, more previous and later support points should be used). The definition of the virtual-support plane is proposed. The following assumptions are made for the current virtual-support plane: (1) this plane always contains the current support line \(\overline{AB}\); and (2) from the disappearance of the previous support line to the disappearance of the current support line, the virtual-support plane gradually changes from \(\Sigma_{1}\) (determined by the current and previous support lines) to \(\Sigma_{2}\) (determined by the current and next support lines). In practice, for uneven terrain, \(\overline{AB}\) and \(A_{F}B_{F}\) (or \(\overline{A_{L}B_{L}}\)) may not lie on the same plane. This paper presents a method to determine the virtual-support plane. The unit normal of the plane on which \(A\), \(B\), and \(A_{F}\) lie is \(n_{11}\) (the angle between this normal and \(x_{i}\) is acute), and that of the plane on which \(A\), \(B\), and \(B_{F}\) lie is \(n_{12}\) (it also has an acute angle with \(x_{i}\)). The unit normal vector \(n_{1}\) of the plane \(\Sigma_{1}\) lies on the bisector of the angle formed by \(n_{11}\) and \(n_{12}\) (Figure 3):  
\[n_{11}=\frac{\overset{\rightarrow}{AB}\times\overset{\rightarrow}{AA}_{F}}{ \|\overset{\rightarrow}{AB}\times\overset{\rightarrow}{AA}_{F}\|}; \tag{8}\]  
\[n_{12}=\frac{\overset{\rightarrow}{AB}\times\overset{\rightarrow}{BB}_{F}}{ \|\overset{\rightarrow}{AB}\times\overset{\rightarrow}{BB}  
\[n_{21}=\frac{\overrightarrow{AB}\times\overrightarrow{AA_{L}}}{\| \overrightarrow{AB}\times\overrightarrow{AA_{L}}\|}; \tag{11}\]  
\[n_{22}=\frac{\overrightarrow{AB}\times\overrightarrow{BB_{L}}}{\| \overrightarrow{AB}\times\overrightarrow{BB_{L}}\|}; \tag{12}\]  
\[n_{2}=\frac{n_{21}+n_{22}}{\|n_{21}+n_{22}\|}. \tag{13}\]  
Then, from the disappearance of the previous support line to that of the current support line, the unit normal vector of the virtual-support plane (i.e., \(x_{s}\) in the inertial coordinate system) is  
\[x_{s}^{i}=\frac{\mu n_{1}+(1-\upmu)n_{2}}{\|\mu n_{1}+(1-\upmu)n_{2}\|}, \tag{14}\]  
where  
\[\upmu=-\frac{1}{T_{b}}t+1. \tag{15}\]  
\(T_{b}\) is the duration between two adjacent steps (half the duration of a gait cycle for trot gait), and \(t\) is the time gap between the current running time and the time point when the previous support line disappeared. The \(z_{s}\) axis of the support coordinate system is  
\[z_{s}^{i}=\frac{\overrightarrow{AB}}{\|\overrightarrow{AB}\|}, \tag{16}\]  
and the \(y_{s}\) axis is  
\[y_{ZMP}^{s}=y_{\mathbb{C}}^{s}-\frac{x_{\mathbb{C}}^{s}\left(F_{ly}^{s}+G_{y}^ {s}\right)+N_{Iz}^{s}}{F_{lx}^{s}+G_{x}^{s}}; \tag{6}\]0  
The rotation matrix from the support to the inertial coordinate system is  
\[{}_{s}^{i}R=\Big{[} \begin{array}{ccc}x_{s}^{i}&y_{s}^{i}&z_{s}^{i}\end{array}  \Big{]}. \tag{18}\]  
The current velocity of the body, which can reflect the robot's current motion state, is not taken into account in the traditional _ZMP_-based stability criteria, however, the velocity is very important for maintaining balance [15], especially under some special condition. For example, when the current ground-reaction force cannot just offset the torque, the robot is made to tumble around a certain direction; however, if the robot's velocity is high enough to allow it to quickly enter a stable area, the robot can maintain its balance. A more accurate assessment of the robot's stability can be proposed by taking the velocity into account. In this paper, the velocity terms are added to the calculation of _ZMP_:  
\[x_{ZMP_{0}}^{s}=0; \tag{19}\]  
\[y_{ZMP_{0}}^{s}=y_{ZMP}^{s}+\eta\Big{(}v_{yr}^{s}-v_{yd}^{s}\Big{)}; \tag{20}\]  
\[z_{ZMP_{0}}^{s}=z_{ZMP}^{s}+\eta(v_{zr}^{s}-v_{zd}^{s}). \tag{21}\]  
The modified _ZMP_ is denoted by _ZMP_\({}_{0}\).