Bio-Inspired Gait Transitions for Quadruped Locomotion

Developing gaits inspired by animal locomotion for quadruped robots has become a prevalent approach in achieving dynamic locomotion. Analogous to animal gaits, they exhibit optimal effectiveness at specific velocities, necessitating the transitions between them for enhanced locomotion proficiency. Despite the significance of these transitions, methods for achieving them have received comparatively limited attention. For successful gait transitions, stability and suitable velocities are essential to maintain efficiency. In this study, a bio-inspired gait transition method has been devised, capitalising on the Froude number-a parameter characterising the velocity at which different-sized quadrupeds alter their gaits. By formulating a set of governing equations contingent on the Froude number, stable gait transitions can be generated. A series of simulations were conducted to determine the optimal Froude number ranges for various gaits and to validate the generality of this method by applying it to four distinct quadrupeds. To assess the performance of the gait transitions, a series of hardware experiments were executed, demonstrating a variety of gait transitions, comparing the proposed transition method with existing alternatives and testing its generality.


I. INTRODUCTION
E FFICIENT and stable locomotion is a vital capability for quadruped robots to carry out tasks effectively in real-world applications. Generally, this encompasses moving at various speeds depending on the situation, similar to how animal quadrupeds display a spectrum of gaits subject to the task. As a result, it is standard procedure to base robotic quadruped gaits on categorised real animal gaits through manual design [1] or model matching techniques [2]. These gaits can subsequently be stored and regulated by a gait scheduler for implementation on quadruped robots. The stored gaits can vary from slow to highly dynamic, thereby necessitating a robust control framework Manuscript  for their stable execution in quadruped robots. State-of-the-art frameworks typically employ model predictive control (MPC) for online trajectory optimisation to enhance stability [3], and a whole-body controller (WBC) for maintaining stable contact forces [4]. These strategies have proven successful in achieving highly dynamic locomotion. In spite of the competence of these control frameworks, a single gait type is not suitable for all speeds; much like animals transition between gaits to optimise energy efficiency [5], quadruped robots can adopt this strategy to attain comparable outcomes [6]. However, to leverage this strategy and the efficacy of existing and future control frameworks, any proposed gait transition method must satisfy three primary prerequisites: 1) it must be independent from the control framework (it necessitates no additional effort or alteration to the existing control framework for its implementation), 2) it must be general enough to be applicable to quadrupeds of any size or weight, and 3) it must be resource efficient, not depending on a significant amount of time for implementation nor relying on data that may be inaccessible for all quadrupeds. In addition to these primary prerequisites, of course, any gait transition method must maintain stability and efficiency. For instance, the conventional method of transitioning between gaits is simply to trust the stability the control framework offers to disregard the need for designing gait transitions, defaulting to abrupt gait switching [7]. Nonetheless, switching gaits during highly dynamic locomotion can engender serious stability issues.
To circumvent the instabilities engendered by a rudimentary approach of hard-switching gaits, numerous studies in the literature aim to devise methods for seamlessly transitioning between different gaits. A prevalent method of gait generation and transition involves utilising a Central Pattern Generator (CPG) [8], [9]. These studies employ a network to generate a cyclic gait pattern based on a reference velocity, where natural gait transitions occur as velocity increases. Nonetheless, they hinge on the periodic cycles of the gait pattern, thereby necessitating the entire control framework to be structured around these CPGs, rendering them incompatible with many highly efficient control frameworks (such as the MPC-WBC framework) due to this lack of independence. Another model-based gait transition method builds upon the definition of leg utility [10], although this approach may result in reduced gait efficiency in terms of Cost of Transport (CoT), and, similarly, is not independent. A supplementary method aimed at enhancing gait transitions involves determining gait characteristics and inter-limb coordination by defining a mechanical model [11]. However, this approach can lead to protracted transition times, adversely affecting efficiency, and necessitates the use of CPGs, thereby resulting in the issue of non-independence.
One strategy to surmount gait transition inefficiencies is through the governance of gait transition based on CoT. This tactic is observed in numerous quadruped animals; when energy consumption surpasses natural limits, quadrupeds transition to gaits that are more efficient at higher speeds, and vice versa [12]. The majority of methods that utilise CoT in gait transition design are based on Reinforcement Learning (RL), which formulate the CoT equation as a reward during training to generate highly efficient gaits [6], [13]. Moreover, they are independent of the control framework. However, as these reward functions are contingent upon the motor dynamics of the specific robot, there is no guarantee that the same policy would be effective in different quadruped robots, which severely curtails their generality and they are highly resource inefficient. Another approach that utilises CoT to select the optimal gait involves the use of heuristics [14], although this study does not provide a method of smooth gait transition, which could critically impair stability in quadruped robots, and several transition parameters must be manually selected, significantly reducing its generality.
In terms of meeting all three key prerequisites, the closest approach is linear interpolation of gait parameters [15], independent of the control framework and with potential for generality, albeit inefficient without automatic parameter adjustment. Evidently, no method has achieved all prerequisites, unveiling the issues with these methods. Our solution, rooted in biomechanics, utilises the Froude number, which links gait selection with the linear velocity of various-sized quadrupeds [16], [17]. Thus, a Froude number-based bio-inspired gait transition method offers universality in gait selection and transition design (Fig. 1). Being dimensionless and unaffected by physical parameters, it allows for dynamic transition modifications, paving the way for an independent, general, and efficient method. This letter offers the following contributions: 1) Analysis of CoT's variation across gaits with increasing Froude number to discern the ideal shift point for efficiency. 2) Leveraging the Froude number to devise governing equations defining gait transition traits. 3) Assessment of the bio-inspired transition's generality and proficiency through tests on four quadruped robots, and comparison with two other methods' CoT efficiency. 4) Stability, efficiency, and generality validation of the gait transitions via hardware tests involving an A1 robot demonstrating gait switches under nominal and enhanced mass and height configurations. 5) Comparative analysis of the proposed method's stability and CoT proficiency against two other methods in hardware tests. The remainder of this letter is organised as follows: Section II introduces the control framework for the gait scheduler. Section III expounds the gait scheduler and bio-inspired transitions. Section IV displays the simulations and analyses shaping the transitions. Section V validates these transitions via hardware experiment. Lastly, Section VI concludes and suggests potential research trajectories.

II. CONTROL FRAMEWORK
In this letter, we focus on gait transition and only briefly comment on the control framework shown in Fig. 2, in which the developed gait scheduler is embedded, as it will be used in the experiments. The control framework contains four main units, namely a gait generation module, a motion planning module, a whole-body control module, and a state estimation module. The gait generation module is responsible for generating the contact schedule and contact timings. The motion planning module computes the desired body pose and ground reaction forces.

A. Gait Generator
The gait generator is designed based on a bio-inspired method detailed in Section III to transition between gaits and schedule contact states and timings for all feet according input velocity references. The desired contact states and contact timings will be used in the motion planning module.

B. Motion Planner
The motion planner receives input velocity commands and contact timings of all feet from the gait scheduler and computes body motion references, foot trajectories and ground reaction forces with a 3-D single rigid body model. This simplified model is helpful for computational efficiency and enables continuous online replanning of the motion references, resulting in reactive behaviours of the robot. The desired foot location is based on the Raibert heuristic with a capture-point-based feedback term [18], while the reaction force is obtained by solving a Quadratic Problem minimising the body state error while respecting body dynamics [3].

C. Whole-Body Controller
With the reference motions and forces from the motion planner a whole-body hierarchical inverse dynamics controller [4], accounting for system dynamics, is needed to compute joint torque commands. It formulates all robot tasks as affine functions of generalised accelerations and external generalised forces, and defines strict priorities and the importance of weighting of each task within a hierarchy. After solving a sequence of Quadratic Programs to get the optimal generalised accelerations and external forces, joint torques are calculated from them to track as closely as possible the desired task-space motion and force references.

D. State Estimator
The state estimator provides a high-rate, low-latency estimate of the full state of the robot for the motion planner and whole-body controller at every control loop. A proprioceptive state estimator [7] is used in the framework, fusing IMU information, force data, and kinematic measurements. Unlike other estimation approaches whichthat solve a fully coupled inference problem to deduce position and orientation pose estimates, the state estimator decouples orientation estimation from the base velocity and position estimation. With the IMU gyroscope and accelerometer readings, an orientation filter is employed to estimate the body orientation expressed as a rotation matrix. A linear Kalman filter is used to estimate the base velocity and position with the orientation result and leg kinematics measurements.

III. BIO-INSPIRED GAIT SCHEDULER
Within the gait generation framework (Fig. 2), the bioinspired gait transition module (Fig. 3) is responsible for generating the contact schedule and timings. In this work, we further expand on the standard gait scheduler, though taking the findings of bio-mechanics studies related to the Froude number [16], [17] and applying it quadruped robots, to implement automatic gait switching and stable transitions between a set of designed gaits based on real animal locomotion.

A. Baseline Gait Scheduler
The gait scheduler determines the time and duration that each leg is in contact with the ground, based on a set of gait parameters, to generate periodic phase-based gaits. The scheduler stores a set of phase variables, φ i ∈ [0, 1], for each leg φ 1 , . . . , φ 4 , where the phase depicts the state of each leg in the gait cycle. At the start of the gait cycle, each leg starts in stance at a phase  value of φ i = 0. As φ i increases, and passes the threshold of φ i > φ stance , the leg switches to a swing state. Once it further increases to a maximum value of 1, the phase wraps around to zero, starting the cycle again.
To design gaits to be used in this scheduler, three parameters must be defined: gait period, duty factor and phase offset for each leg. Fig. 4 shows the typical mapping of a trot gait. The gait period is used to define the stepping frequency; at higher velocities, a smaller gait period is more suitable. During locomotion where a gait transition is not occurring, the phase can be calculated by where t is the current time, t i,0 is the start time of the current gait period of the i-th leg, and T is the gait period. The duty factor, d i ∈ [0, 1], determines the proportion of the gait cycle during which a leg is in stance by switching the leg to swing when φ i = d i . With a constant gait period, a smaller d i would result in each leg having an increased aerial time and create a more dynamic gait.
The phase offset, θ i ∈ [0, 1], serves to coordinate the legs to produce different gait patterns based on the leading leg through the relationship φ i = φ 1 + θ i , adjusting the phase of leg i. These phase offsets can be selected based on studying animal gaits in the effort of recreating them.

B. Designed Gaits
For the design of the gaits, direct inspiration is taken from real animal gaits to determine the gait parameters of a static walk and trot [19]. The trot gait is further broken down into walking trot, trot and flying trot gaits for improved locomotion at different speeds; in accordance with Section III-A, the walking trot has an increased T and d i while the flying trot has a decreased T and d i . The static parameters for these gaits are defined in Table I.

C. Governing Gait Transitions With Froude Number
As discussed in Section I, the Froude number is a dimensionless number used to characterise gait transition speeds of different-sized quadrupeds, where Fr is the Froude number, v is the linear velocity of the base (in this case, the robot's trunk), g is the acceleration due to gravity, and h is the maximum leg length. This formulation has been built around the dynamic similarity hypothesis, which states that quadrupeds of different sizes will have the same gait characteristics at a given Fr independent of their size [20]. As such, h can be any parameter as long as it is a geometric dimension that can be multiplied by a factor to get the same dimension of another. In this work, h is chosen as the maximum leg length rather than the hip height, as unlike animals that have a constant hip height at stance, robot quadrupeds have a configurable stance height.
As it is known that animals transition between gaits when energy consumption becomes inefficient at the current gait, which tends to occur at similar Fr values, the same principles can be applied to quadruped robots. In this case, energy consumption can be quantified by CoT [21], which is formulated in this work as P , where τ i is the joint torque,θ i is the joint velocity, k is the total number of actuated joints, m is the mass of the robot, and v cmd is the velocity command sent to the robot. By comparing Fr against P as velocity increases for each gait outlined in Table I, the optimal Fr ranges for each gait can be selected. It should be noted that during the calculation of Fr and P , v is estimated through the use of the state estimator outlined in Section II-D. Data for this comparison is collected in simulation; hence, details on how the Fr ranges detailed in Table II are selected are presented in Section IV-A. This formulation of CoT has been used in this work to find these ranges, as it is a standard metric used in studying legged locomotion efficiency. However, any metric or extension of this P term that describes legged locomotion efficiency, such as accounting for the efficiency of motors, could be used as Fr itself is not dependent on efficiency. For example, if two identical quadrupeds that only differ in their motor efficiency travelled at the same velocity, even though the less efficient quadruped would expend more power, both quadrupeds would still have the same Fr . This line of thought can be extended to where one of the quadrupeds is walking on flat ground and the other is on rough terrain. As long as they are travelling at the same speed, they will still have the same Fr regardless of the extra energy the quadruped on rough terrain has to expend to keep up. Combining this with the ability for Fr to ignore the difference in quadruped size, it can be stated that this method to find the optimal Fr ranges for each gait across different velocities is sufficient to enable generic optimal gait selection in quadruped robots.

D. Gait Blending for Transitions
To ensure that the transition between gaits is stable, the gait parameters of the current and new gait are blended together.
Taking inspiration from [22], weights are used to transition between the gait parameters based on transition duration. These weights are defined as w 1 (n trans ) = 1 − (n trans /D trans ), w 2 (n trans ) = n trans /D trans , where w 1 (n trans ) and w 2 (n trans ) are the weights used for the current and new gait parameters respectively, n trans is the n-th time step of the transition and D trans is the number of time steps in the transition. These weights are applied to all parameters detailed in Table I for a stable and smooth transition. The only parameter not blended using weights is the phase offset, which will be covered later in this section. The transition duration, in terms of D trans , is defined as where D current and D new are the number of time steps in the current and new gait respectively, and C is the number of cycles the transition should occur over. Through modulating C, the duration of the transition can be controlled. With faster transitions at higher velocities becoming more stable, the following definition of C is formulated to create an inverse relationship between Fr and transition duration, where Fr * is the Froude number at which the transition begins, Fr crit is the maximum stable value of Fr for a given gait, and C max is the maximum cycles any transition should occur over. Fr crit is conservatively selected to have a value of 1 as this the limit of a stable walking gait [23]; the closer the Froude number is to this limit, not only is a fast transition more stable but is also required to preserve stability and helps improve efficiency by changing to a more efficient gait quicker. Furthermore, C max is selected as 2 as this is the longest number of cycles quadrupeds take to transition between gaits [5] as although faster transitions are more desirable, if they are too quick this can cause instabilities due to the resultant reduced resolution of the transition, hence C max is selected as this conservative value. To ensure that this gait transition method can handle rapid accelerations, a technique for decreasing the transition duration is devised. In a scenario where the velocity increases so rapidly that it causes another transition to be initiated before the current transition is complete, this may result in a significant loss of stability and efficiency. To address this issue, the value of n during transition becomes a function of Fr according to the following relationship:   5. To find the optimal points to transition between gaits, a set of gaits are run on the A1, AlienGo, ANYmal B and Solo12 to select and verify the Fr bounds. This is done through taking a weighted average of points of intersection between subsequent gaits indicated by the red dot markers. Through defining these bounds, as indicated by the black dashed lines, the gait scheduler enables the robot to track the minimal CoT possible with the available gaits as velocity increases.
The only other parameter left to blend during transitions is the phase offset. Rather than blending the two offsets, it is adjusted during transition so that it phases into the offset of the gait that is being transitioned to, where θ jtrans is the phase offset during transition, and θ jnew and θ j are the new and current gait phase offsets respectively. This enables smooth transition between gaits of different phase offsets, while also adjusting the phase offset at the rate defined by (7). Overall, with gait transition being governed by the quadruped's Fr , as visualised in Fig. 3, transitions occur automatically with velocity and adjust accordingly based on its magnitude to preserve stability and efficiency. Furthermore, this leveraging of Fr enables its use with a variety of quadruped robots, independent of their size and motor dynamics.

IV. SIMULATIONS
To analyse transitions and identify the Fr bounds outlined in Section III-C, a set of simulations was completed. For these simulations, the physics-based simulator PyBullet was used, and the control frequency was set to 500 Hz.

A. Gait Froude Number and CoT Analysis
For identifying the Fr bounds, all gaits in Table I were used with a linear velocity profile, starting from 0 m/s up to 1.5 m/s and at an acceleration of 0.1 m/s 2 . The simulation was completed with the A1, AlienGo, ANYmal B and Solo12 quadrupeds to validate that the Fr value can be used to select points of gait transitions to improve efficiency through selecting the gait with the minimum CoT at a given velocity.
From analysing Fig. 5, it can be observed that the Fr ranges at which transitioning between gaits to minimise CoT are very similar across all quadrupeds. In turn, this validates the theory that Fr can be used to select the optimal point of gait transition for quadrupeds, regardless of their size. However, without a method of selecting the best Fr value to transition, selecting this value is ambiguous. To this end, a weighted average is used to select the Fr values by utilising a dimensionless metric of the need for a legged system to remain stable, E = g/hf 2 where f is the average of the stride frequency of the gaits in question [17], as the weight, where Fr mean i is the mean of the Fr intersection values and r notates the quadrupeds used in this investigation. Through using E as the weight, it creates a bias towards the Fr mean of the smaller quadrupeds as due to their size they have a greater requirement to maintain equilibrium [17], which overall improves the transition conditions for these quadrupeds. It took around 2 minutes for all final Fr points to be selected, which are presented in Table II. To provide initial validation of the proposed method, the bio-inspired gait transitions were tested successfully on the A1, AlienGo, ANYmal B and Solo12 quadrupeds, as illustrated in Fig. 6.

B. Comparing Gait Transition Methods
To evaluate the bio-inspired gait transitions against other existing methods, namely hard gait switching and linear interpolation, simulations were completed with the four quadrupeds for all three transition methods. These other transition methods were selected for this study as they are the only other methods that offer the same level of generality while being independent from the rest of the control framework. In each simulation an increasing velocity command, accelerating at a rate of 0.4 m/s 2 up to a maximum of 1.5 m/s, was sent to the control framework. Once this maximum value was reached, the command velocity decelerated back to 0 m/s at the same rate. From the results presented in Fig. 7, although similar performance is observed at lower Fr values, at higher velocities the bio-inspired gait transitions significantly outperformed the other methods in terms of CoT, and in the cases of ANYmal B and Solo12 it prevents the gait from failing. This is primarily due to the hard switching and linear interpolation methods having fixed and shorter (in the case of hard switching, it is instantaneous) transition durations. Although this could reduce CoT, the reduced transition resolution produces instabilities. It could be argued that simply increasing the transition duration could resolve this issue. However, this requires meticulous tuning of the transition parameters which may not be suitable for various accelerations and will definitely not be generic enough for the same parameter to be used across different quadrupeds. In contrast, in the case of the bio-inspired gait transitions, the transition duration is adaptable based on the acceleration to provide stability, using (6) and (7), and generality is provided through governing these equations with Fr . This improved stability at high speeds and accelerations is further highlighted in Fig. 8, where both hard switching and linear interpolation transition methods cause the gait to fail during the transition between trot to flying trot, while accelerating at 0.4 m/s 2 at a velocity of approximately 1.3 m/s, whereas the bio-inspired method preserved stability during transition.

V. HARDWARE EXPERIMENT
To validate the bio-inspired gait transitions and compare its performance to other transition methods, a set of experiments were completed using A1. During the experiments, the velocity command followed a profile that switched between accelerating at 1 m/s 2 and maintaining constant velocity, up to a maximum of 1.2 m/s from rest. Once this maximum value was reached, a similar velocity profile was used to reduce the velocity back to 0 m/s. To complete a comparative study, the bio-inspired, linear interpolation, and hard switching gait transition methods were all run ten times using this profile, and points of transition were determined by the Fr bounds in Table II, with the data from these experiments being presented in Fig. 9. To validate the method's generality, this experiment was again run ten times but with the A1 modified to mimic a taller and heavier robot. To control the A1 robot, the control framework was run on an Ubuntu computer at 500 Hz and sent torque commands via an Ethernet connection.

A. Transition Stability
After tracking the success rate of each transition method across their ten respective test runs, as summarised in Table III, it was found that the bio-inspired transition method significantly outperformed the other methods. Most failures occurred at high velocities, and this vast difference in success rate is deduced to result from the bio-inspired method's ability to adjust transition resolution to preserve stability. Combining the fact that hard switching and linear interpolation methods lack this functionality and that real-world operation introduces disturbances not Fig. 9. Graph showing the CoT, command velocity, estimated velocity, and contact states of the real robot during the experiment (from top to bottom). In the CoT and velocity plots, data from all ten experiments, for each transition method, are presented as average trend lines and variance displaced by the shaded regions. In the bottom four plots, a shaded region shows that a foot is in contact with the ground, while the white spaces show that it is in swing. The bio-inspired gait transition phases are highlighted in red, while the linear interpolation transition phases are in blue.   Fig. 7 are further exacerbated, causing repeated failures. In turn, this demonstrates that the bio-inspired method can reliably outperform these existing methods in terms of stability. Moreover, throughout the successful implementations of the bio-inspired approach, a maximum roll of 0.12 rd was discerned, further corroborating the maintained stability. It warrants mention that while stability on flat terrain is evidenced, the preservation of such stability during gait transition on uneven terrain may be compromised. This owes to the fact that our proposed technique does not incorporate additional dynamics considerations, thereby revealing its principal constraint.

B. Cost of Transport
Across all experiments, the CoT is observed to decrease as velocity increases and the gait is transitioned to one more suitable for faster velocity commands, as detailed in Fig. 9. Similar CoT trends are observed compared to the simulation results presented in Fig. 7, demonstrating that tracking of the lowest CoT across gaits for the corresponding Fr values transfers successfully to hardware. Similar to the trends seen in Fig. 7, the bio-inspired method maintains the lowest CoT across the different methods for the majority of the experiment due to the stability during transition that it provides. This is particularly evident at higher velocities, where it can be seen that the transition duration is adjusted so that the transition has a higher resolution for stability, to account for this highly dynamic scenario, while remaining short enough to preserve CoT. Whereas, in the cases of linear interpolation and hard switching, the instability caused by their inability to adjust transition parameters results in increased CoT at higher velocities; this effect can be seen to have a lasting effect even after a transition is complete.

C. Velocity Command Tracking
By comparing the plot of the velocity command to the estimated linear velocity during the bio-inspired method experiments (estimated by the state estimator) in Fig. 9, it is observed that during gait transition tracking of the velocity command is virtually unaffected. This validates that the bio-inspired method successfully transitions between gaits while preserving stability and normal function of the robot. However, this is not the case for both linear interpolation and hard switching methods at high velocities, where the previously discussed loss instability at this high velocities causes poor command tracking. This further demonstrates that the bio-inspired method is able to outperform these other existing methods.

D. Contact State During Transitions
The contact states during this experiment are presented in Fig. 9, which details how the contact states are adjusted during transitions for one run of the bio-inspired transition method. During these transitions, the duration and frequency of these states can be seen to blend between the current and new gaits. This demonstrates how the gait blending process detailed in Section III-D facilitates smooth transitions, aiding in preserving stability. This is further emphasised by there being no point during the experiment when only one leg in stance or any harsh changes in contact states occur. Furthermore, it can be observed that the duration of transitions while the robot is decelerating is significantly shorter compared to when accelerating. This is due to the gradient of the velocity profile being steeper, which, as outlined by (7), causes faster transitions to preserve stability.

E. Transition Generality
The high success rate achieved by the bio-inspired transition method without necessitating any modifications during deployment, substantiates that our proposed method boasts considerable generality. To further scrutinise this generality and fortify our assertion, the A1 was configured to transport a payload equating to 26% of its mass and reach a target height that is 15% higher than its customary height, thereby simulating a larger and heavier robot, as depicted in Fig. 10. This adjusted configuration was tested ten times and also demonstrated a high success rate of 90%. These results clearly attest to the generality of the proposed method.

VI. CONCLUSION
In this study, a bio-inspired gait transition approach has been developed and integrated into a gait generator, wherein the Froude number is employed to establish several correlations governing automatic gait transitions, transition duration, and gait blending. As the Fr value at a specific speed is independent of the robot's size and motor dynamics, this method proves to be compatible with various quadruped robots, as confirmed through simulation. Furthermore, the transition approach has been validated on physical hardware, demonstrating its generality and proficiency in producing stable transitions that preserve the cost of transport while surpassing other transition methods in these metrics during a comparative analysis.
Future research to enhance the developed gait scheduler could involve implementing and evaluating more dynamic gaits, such as pacing and galloping over rough ground, to facilitate stable transitions into high-speed locomotion. Another potential avenue for future research is the development of bio-inspired gait transitions capable of accommodating alterations in the velocity command beyond merely forward velocity, encompassing changes in angular velocity as well.