Inspired by the natural gait transition mechanisms observed in quadruped animals, we propose a multi-gait motion strategy to address the trade-off between energy efficiency and stability in quadruped robot locomotion across diverse terrains. Our approach enables a robot dog to dynamically select and transition between gaits based on speed and terrain conditions, leveraging gait parameters such as duty cycle and phase bias. By integrating affine transformations of these parameters with a finite state machine (FSM), we establish a smooth gait transition mechanism. Furthermore, we design a speed-gait mapping table using the cost of transport (CoT) and a stability index (STB) to guide gait selection. Extensive simulations and real-world experiments on a quadruped robot demonstrate that our strategy enhances both energy efficiency and stability, validating the biological principles of gait adaptation in robotic systems.
The fundamental aspect of our multi-gait strategy lies in defining distinct gait patterns for the quadruped robot. We model gaits using the duty cycle $\beta$ and phase offsets $\phi = (\phi_{\text{RF}}, \phi_{\text{RH}}, \phi_{\text{LF}}, \phi_{\text{LH}})$, where RF, RH, LF, LH denote the right-front, right-hind, left-front, and left-hind legs, respectively. The duty cycle $\beta$ represents the ratio of stance phase time to the total gait cycle, while the phase offset $\phi_i$ indicates the leg lift-off time normalized by the cycle period. Mathematically, these are expressed as:
$$\beta = \frac{T_{\text{st}}}{T_{\text{st}} + T_{\text{sw}}}$$
$$\phi_i = \frac{t_i^{\text{LO}}}{T_{\text{st}} + T_{\text{sw}}}$$
where $T_{\text{st}}$ is the stance time, $T_{\text{sw}}$ is the swing time, and $t_i^{\text{LO}}$ is the lift-off time for leg $i$. We implement five classic gaits: Walk, Trot, Bound, Trot-run, and Bound-run, each characterized by specific $\beta$ and $\phi$ values. For instance, the Walk gait has $\beta > 0.5$, ensuring at least three legs are in contact with the ground at any time, promoting stability. In contrast, Trot and Bound gaits have $\beta = 0.5$, with Trot involving diagonal leg pairs and Bound using ipsilateral pairs. The dynamic gaits, Trot-run and Bound-run, feature $\beta = 0.3$, introducing a flight phase where all legs are airborne, which enhances energy efficiency at higher speeds.
To enable seamless transitions between these gaits, we develop a transition mechanism based on affine transformations of gait parameters and an FSM. The transitions are categorized into four processes: Walk $\leftrightarrow$ Trot, Trot $\leftrightarrow$ Bound, Trot $\leftrightarrow$ Trot-run, and Bound $\leftrightarrow$ Bound-run. For example, the transition from Trot to Walk involves gradually adjusting $\beta$ and $\phi$ over a transition period $T_s$:
$$\beta(t) = \alpha_0 \pm \frac{1}{4T_s} t, \quad t \in [0, T_s]$$
$$\phi_{\text{LF}} = 0, \quad \phi_{\text{LH}} = 0.5, \quad \phi_{\text{RF}} = \beta(t), \quad \phi_{\text{RH}} = \beta(t) \mp 0.5$$
where the signs depend on the direction of transition. Similarly, other transitions use analogous affine functions to ensure continuity. The FSM manages the sequence of transitions, with each gait assigned a state (e.g., Walk: 0, Trot: 1, Bound: 2, Bound-run: 3, Trot-run: 4), and events triggering state changes based on predefined actions $a_{ij}$ from state $i$ to $j$. This mechanism allows the robot dog to adapt its gait smoothly without instability during transitions.
For gait selection, we formulate a strategy that minimizes a combined objective function $J_e(\Lambda)$ for a gait $\Lambda$, balancing energy efficiency and stability. The energy consumption per gait cycle is computed as:
$$W = \int_0^{t_f} \left( \sum_{i=1}^{n} \max(u_i \cdot \omega_i, 0) \right) dt$$
where $n=12$ is the number of motors, $u_i$ and $\omega_i$ are the torque and angular velocity of motor $i$, and $t_f$ is the gait cycle duration. The cost of transport (CoT) is then:
$$\text{CoT} = \frac{W}{m g \Delta s}$$
with $m$ as the robot mass, $g$ as gravity, and $\Delta s$ as the distance traveled per cycle. The stability index (STB) incorporates body orientation and vertical motion:
$$\text{STB} = w_1 \left| \frac{v_{bn}}{v_b} \right| + w_2 |\theta_b – \theta_t| + w_3 |\phi_b| + w_4 (|\dot{\theta}_b| + |\dot{\phi}_b|)$$
where $v_{bn}$ is the vertical velocity, $v_b$ is the total velocity, $\theta_b$ and $\phi_b$ are pitch and roll angles, $\theta_t$ is terrain slope, and $\dot{\theta}_b$, $\dot{\phi}_b$ are angular rates. Weights $w_1=0.7$, $w_2=1$, $w_3=1$, $w_4=0.3$ emphasize posture stability. The combined metric is:
$$J_e(\Lambda) = c \cdot \text{STB} + (1 – c) \cdot \text{CoT}$$
where $c$ is a weighting factor. The optimal gait $\Lambda^*$ for a given speed and terrain is selected by minimizing the average $J_e(\Lambda)$ over $N$ cycles:
$$\Lambda^* = \arg \min_{\Lambda} \frac{1}{N} \sum_{i=1}^{N} J_e(\Lambda)$$
Through extensive testing on flat and sloped terrains (e.g., 12° incline) across speeds from 0.3 to 2.7 m/s, we collected CoT and STB data for each gait. The results were used to construct speed-gait mapping tables for different $c$ values, guiding the quadruped robot in selecting the most suitable gait. For instance, on flat terrain, Trot is optimal at low speeds ($\leq 0.9$ m/s), while Bound-run minimizes CoT at higher speeds ($\geq 1.1$ m/s). On slopes, Trot-run is preferred for high-speed motion due to its balance of stability and energy efficiency.
| Current State | Event to Walk (E0) | Event to Trot (E1) | Event to Bound (E2) | Event to Bound-run (E3) | Event to Trot-run (E4) |
|---|---|---|---|---|---|
| Walk | $a_{00}$ | $a_{01}$ | $a_{01}, a_{12}$ | $a_{01}, a_{12}, a_{23}$ | $a_{01}, a_{14}$ |
| Trot | $a_{10}$ | $a_{11}$ | $a_{12}$ | $a_{12}, a_{23}$ | $a_{14}$ |
| Bound | $a_{21}, a_{10}$ | $a_{21}$ | $a_{22}$ | $a_{23}$ | $a_{21}, a_{14}$ |
| Bound-run | $a_{32}, a_{21}, a_{10}$ | $a_{32}, a_{21}$ | $a_{32}$ | $a_{33}$ | $a_{32}, a_{21}, a_{14}$ |
| Trot-run | $a_{41}, a_{10}$ | $a_{41}$ | $a_{41}, a_{12}$ | $a_{41}, a_{12}, a_{23}$ | $a_{44}$ |
In simulation tests, we validated the gait transition mechanism by observing body attitudes and foot heights during switches, such as from Trot to Walk and Trot to Trot-run. The transitions, marked by yellow phases in data plots, showed minimal posture deviations, confirming stability. For example, during Trot to Walk, the duty cycle $\beta$ increased from 0.5 to 0.75 over $T_s = 0.5$ s, while phase offsets adjusted smoothly, maintaining at least three ground contacts. Similarly, transitions to dynamic gaits like Bound-run involved reducing $\beta$ to 0.3, introducing flight phases without compromising balance.

We further evaluated the multi-gait strategy on complex terrains, including continuous slopes (8°, 12°, 18°) and up-down slopes, using random speed commands. Comparisons with fixed-gait strategies (e.g., always Trot or Trot-run) and a literature-based method revealed that our approach, particularly with $c=0.1$ (emphasizing energy efficiency) or $c=0.5$ (balancing stability), achieved lower CoT and STB values. For instance, on a flat-slope terrain, strategy $c=0.1$ reduced CoT by over 20% compared to fixed Trot, while maintaining a 29/30 success rate. The quadruped robot efficiently switched from Bound-run on flat sections to Trot-run on slopes, adapting to terrain changes in real-time.
| Strategy | CoT | STB | Success Rate |
|---|---|---|---|
| Fixed Trot | 0.383 | 0.145 | 29/30 |
| Fixed Trot-run | 0.532 | 0.512 | 23/30 |
| Literature [22] | 0.331 | 0.320 | 29/30 |
| $c=0.1$ | 0.299 | 0.355 | 29/30 |
| $c=0.3$ | 0.316 | 0.283 | 29/30 |
| $c=0.5$ | 0.330 | 0.118 | 30/30 |
| $c=0.7$ | 0.340 | 0.117 | 30/30 |
| $c=0.9$ | 0.344 | 0.109 | 30/30 |
Real-world experiments on a Unitree Go2 robot dog outdoors confirmed the practicality of our multi-gait strategy. At 1.7 m/s on a flat-slope terrain, the robot dog autonomously transitioned from Bound-run to Trot-run, aligning with the $c=0.1$ strategy. Data logs showed a slight CoT increase on slopes due to gravitational work, but STB values remained low, ensuring stable locomotion. This demonstrates the robustness of our approach in authentic environments, bridging simulation-to-reality gaps.
In conclusion, our multi-gait motion strategy for quadruped robots enables stable and energy-efficient locomotion by integrating dynamic gait selection and smooth transitions. The speed-gait mapping, derived from CoT and STB optimization, allows the robot dog to adapt to varying terrains and speeds, mimicking biological principles. Future work will focus on extending this to more gaits and unstructured environments, further enhancing the autonomy of legged robots.
