Biped Walking: Compass Gait, Five-Link Walker and Poincaré Stability
Find periodic walking gaits, Poincaré multipliers and disturbance margins for a passive compass gait or a full five-link HZD walker. Animate each hybrid step.
Use this biped walking calculator to investigate whether a walking motion repeats and whether nearby steps return toward it. It offers a passive compass gait on an inclined plane and a five link biped with two actuated knees, two actuated hips, and an unactuated point foot. Engineers and students can compare the two approaches without replacing the articulated walker with an inverted pendulum.
Choose the walker, leg length, total mass, and ground friction. For the compass gait, set the downhill slope, hip to leg mass ratio, and position of each leg mass. For the five-link walker, adjust the stride angle, torso lean, knee flexion at contact, and extra swing knee flexion. Its dimensions, mass distribution, and reference-axis inertias follow the proportions of the RABBIT example; length and mass scale the entire mechanism together. The posture curve is constructed here and is not the optimized gait published in the original paper.
The calculation combines continuous swing dynamics with an instantaneous, inelastic foot impact. A Newton iteration seeks a fixed point of the Poincaré map: the state at one heel strike must return to itself at the next. The return-map eigenvalues describe orbital stability. A largest modulus below one means sufficiently small errors shrink from step to step; a value above one means the one-step gait is unstable. An unstable one-step result does not exclude a longer-period gait.
The five-link calculation uses hybrid zero dynamics, an exact restriction of its full rigid-body equations to an impact-invariant posture surface. With ideal finite-time output feedback, its full local return spectrum has one HZD multiplier and eight zero transverse multipliers. The displayed torque and reaction curves come from all five links, their masses, and their inertias.
Change the velocity disturbance fraction to test twelve successive returns. Five-link disturbance bounds also enforce the momentum barrier, ground contact, friction, and joint torque limits along the prescribed posture. A fraction of 0.10 means ten percent. Compass recovery tests one chosen angular-rate perturbation and does not estimate the whole basin of attraction.
Press play to watch one step and the leg exchange. The other cards show the Poincaré section, eigenvalues, actuator loading, ground reaction, and foot clearance. Select Fine resolution when a result is close to a limit.
This planar model excludes lateral balance, compliant feet, backlash, sensor errors, motor bandwidth, and uneven terrain. Its ideal feedback assumptions require separate validation on a real robot. In the compass model, an imaginary massless foot retraction prevents scuffing; the clearance chart deliberately shows the unretracted foot.
How it is calculated
Both walkers use , and as length, mass and time scales. Angles are absolute and clockwise from upward vertical.
Compass gait. The two leg masses and hip mass give the nonlinear double-pendulum mass matrix, centrifugal terms and gravity vector. Classical RK4 integrates swing. A forward, descending foot-contact crossing is located with 30 bisections of a reintegrated partial step; the coincident-foot crossing is excluded. Conservation of angular momentum gives the plastic impact velocities, followed by leg exchange. Shooting uses the three post-impact section coordinates . Multiple seeds include a shallow-slope start. Damped Newton backtracks until a forward-contact trajectory exists and its fixed-point residual decreases. Central differences of complete event-to-event integrations give the 3 × 3 Jacobian. A scaled cubic characteristic polynomial is solved with Aberth–Ehrlich iteration, and a polynomial residual check validates its three eigenvalues. Goswami et al., 1998, §§2–3.
Five links. With , COM locations are . Thus , , , and , where . These give all five equations with four internal joint torques. Reference-axis inertias are converted by .
Impact uses the complete 7-DOF floating model: , . Both impulse components and released-foot velocity are checked, and all five angular coordinates are relabeled.
A quartic Hermite posture curve uses phase . Its endpoint positions swap legs; its initial tangent is the relabeled full impact of the final tangent, normalized to the same phase rate. A quartic knee-flexion bump vanishes with its first derivative at both ends. This enforces hybrid invariance, rather than resetting velocity onto an incompatible trajectory.
Let , , and . The exact five-link zero dynamics are and . Composite Simpson integration yields . Full impact gives and . Newton solves ; its Jacobian is the scalar .
The implemented input-output linearizing controller solves the full five dynamic equations together with four prescribed output accelerations. The ideal finite-time law uses . Locally, when settling occurs before impact, eight transverse multipliers vanish and the remaining multiplier is the HZD value. Westervelt et al., 2003, §§III–V.
Joint torques and total COM acceleration give actuator loading and ground reaction. On the zero manifold these are affine in pre-impact ; intersecting their inequalities with produces the displayed momentum bounds. Friction includes the impact impulse ratio.
The five-link admissible interval also enforces compressive slipless impact, upward release of the old foot, descending forward touchdown, swing clearance, knee limits, and above-ground joint geometry. Violating any geometric or impact constraint empties the interval. Margins and successful recovery require the nominal fixed point to lie inside the resulting interval.
Assumptions
Planar rigid links, ideal revolute joints, identical legs, no ankle torque, and instantaneous slipless plastic impact. The old foot releases without impulse. The five-link surface is level; slope applies only to the passive compass gait.
The five-link dimensions and mass distribution scale homothetically from Westervelt et al., Table I: torso, two femurs and two tibias. Their inertia convention is checked against the equation-details supplement. The constructed posture family retains all five link masses and inertias; it does not reproduce the paper's optimized Bézier coefficients. Its fixed stance-knee shaping bump is 0.08 rad peak additional flexion.
Five-link orbital stability assumes the stated ideal finite-time feedback, exact state knowledge and an invertible decoupling matrix. The robustness interval is restricted to momentum disturbances on the zero manifold. The compass follows Goswami's imaginary massless foot-retraction assumption; it is not a physically rigid-foot scuff model.
Where it applies
Standard resolution uses 1441 five-link phase nodes and Simpson quadrature; Fine uses 2881. All extrema and admissible bounds are evaluated on that full grid. Seventy-three PCHIP samples are retained for plots and playback, so pictures interpolate the solved data and can miss very narrow features. The compass uses RK4 steps of (Fine: ), event refinement, and Jacobian perturbations of 10⁻⁵ in normalized coordinates. Compare Standard and Fine near a boundary.
A stable multiplier answers a local orbital question. It does not establish a global basin, lateral balance, or robustness to arbitrary pushes, terrain changes or posture errors. The eight ideal transverse zeros are a finite-time-feedback result, not measured hardware multipliers. Torque bounds and disturbance limits apply to the nominal zero-manifold dynamics; feedback transients, saturation and finite motor bandwidth can invalidate them. Sampled ground-force and torque inequalities are numerical screening bounds, not certified continuous-time margins.
The solver seeks a symmetric one-step fixed point. It can report that orbit as unstable even where a multi-step or chaotic gait exists. A compass return that fails within six gravitational time scales is treated as unavailable. HZD momentum bounds are inapplicable in compass mode and are shown as gaps.
The published compass transition near 4.37° is approximate: this nonlinear implementation gives a leading eigenvalue near −0.979 there. Its reference check allows a 0.03 difference from −1; no equation or coefficient is adjusted to force the plotted threshold.
The momentum margins are unavailable when the nominal gait violates any contact, impact or geometric requirement. An inadmissible disturbance is followed by gaps in the recovery chart. At zero compass disturbance, the converged fixed point is reused for all twelve returns. Angle inputs use exact compact radian defaults; the unit menu also displays degrees.
References
- Goswami, A., Thuilot, B. and Espiau, B. (1998), A Study of the Passive Gait of a Compass-Like Biped Robot: Symmetry and Chaos, IJRR 17(12), 1282–1301. DOI: 10.1177/027836499801701202. https://www.ambarish.com/paper/COMPASS_IJRR_Goswami.pdf
- Westervelt, E. R., Grizzle, J. W. and Koditschek, D. E. (2003), Hybrid Zero Dynamics of Planar Biped Walkers, IEEE TAC 48(1), 42–56. DOI: 10.1109/TAC.2002.806653. Author manuscript: https://web.eecs.umich.edu/~grizzle/papers/hybrid_zdyn_TAC.pdf
- Westervelt, Grizzle and Koditschek, Five-link equation details, supplemental material to the 2003 TAC paper. https://web.eecs.umich.edu/~grizzle/westervelt_thesis/ieee_tac/equation_details.pdf
Inputs
| Input | Symbol | Unit | Default |
|---|---|---|---|
| Walker | walker | Five-link HZD walker | |
| Leg length | L_leg | m | 0.8 |
| Total mass | M_body | kg | 40 |
| Ground friction coefficient | friction | 0.8 | |
| Joint torque limit | T_limit | N*m | 120 |
| Half stride angle Angle swept by the mean stance-leg orientation on either side of vertical. | stride_half | rad | 0.25 |
| Knee flexion at contact | knee_contact | rad | 0.16 |
| Torso lean at contact | torso_lean | rad | 0.12 |
| Additional swing knee flexion | swing_bend | rad | 0.7 |
| Downhill slope | slope | deg | 3 |
| Hip / leg mass ratio | mass_ratio | 2 | |
| Leg mass position / leg length Distance from the foot to the concentrated leg mass, divided by leg length. | com_fraction | 0.5 | |
| Velocity disturbance fraction Scales both compass angular rates, or five-link pre-impact momentum, by one plus this fraction. | disturbance | -0.1 | |
| Integration resolution | accuracy | Standard | |
| Step playback A fraction of the step duration; the impact and leg exchange occur at the end. | t_phase | 0.75 |
Results
With the default inputs above, the calc gives:
| Result | Value |
|---|---|
| Limit cycle | Stable HZD gait |
| Largest multiplier modulus | 0.7902 |
| Step duration | 0.6352 s |
| Step length | 0.3946 m |
| Mean walking speed | 0.6212 m/s |
| Applied disturbance | Returns toward gait |
| HZD admissible momentum reduction | 0.2 |
| HZD admissible momentum increase | 0.304 |
| Peak joint torque | 75.2964 N·m |
| Required friction coefficient | 0.641 |
| Minimum normal reaction | 324.8449 N |
| Impact kinetic energy loss fraction | 0.347 |
| Fixed-point residual | 0 |
| Impact closure residual | 0 |
Checked against sources
Each case below was calculated by this calc and agrees with the value from its source (within the tolerance where one is shown).
Published RABBIT HZD return-map benchmark
Source: Westervelt, Grizzle and Koditschek (2003), Table II, DOI 10.1109/TAC.2002.806653. Published δ²=0.638, V(θ−)=−354.4 and ζ*=979.0 test the scalar Newton/return-map algorithm only; the constructed posture is a different gait.
Inputs: the default inputs above.
| Result | Source | This calc |
|---|---|---|
| Published HZD scalar-map benchmark | 979 | 979 |
Published five-link swing knee inertia
Source: Westervelt et al. (2003), Table I and equation-details supplement p.1, D4,4=It. The shin diagonal is the moment about the knee; the Cartesian COM mass contribution and centroidal moment must sum to the reported 0.93 kg·m².
Inputs: the default inputs above.
| Result | Source | This calc |
|---|---|---|
| Swing knee reference-axis inertia | 0.93 kg·m² | 0.93 kg·m² |
Compass gait against adaptive SciPy shooting
Source: Goswami et al. (1998) nominal nonlinear model, DOI 10.1177/027836499801701202. Numeric values are from the separately implemented SciPy adaptive ODE/event solver in attached s4, not quoted as published measurements.
Inputs: Walker = Passive compass gait; Leg length = 1 m; Total mass = 20 kg; the others as above.
| Result | Source | This calc |
|---|---|---|
| Largest multiplier modulus | 0.58 | 0.58 |
| Step duration | 0.7343 s | 0.7343 s |
| Step length | 0.5354 m | 0.5354 m |
Five-link gait against independent Cartesian assembly
Source: Second implementation in Python/NumPy: Cartesian COM Jacobian kinetic-energy assembly, full 7-DOF impact projection, and 4001-node trapezoidal momentum quadrature. Attached s4 records program versions and settings. This is an author cross-check, not an external experiment or independent human review.
Inputs: Half stride angle = 0.25 rad; Knee flexion at contact = 0.16 rad; Torso lean at contact = 0.12 rad; Additional swing knee flexion = 0.7 rad; the others as above.
| Result | Source | This calc |
|---|---|---|
| Largest multiplier modulus | 0.7902 | 0.7902 |
| Step duration | 0.6352 s | 0.6352 s |
| Mean walking speed | 0.6212 m/s | 0.6212 m/s |
| Pre-impact squared momentum / 2 | 398.6 kg²·m⁴/s² | 398.6 kg²·m⁴/s² |
| Peak joint torque | 75.296 N·m | 75.296 N·m |
| Minimum normal reaction | 324.8 N | 324.8 N |
| Maximum swing foot clearance | 0.06717 m | 0.06717 m |
Published compass flip neighborhood
Source: Goswami et al. (1998), p.1293 and Fig.8, DOI 10.1177/027836499801701202, reports a multiplier reaching −1 near 4.37°. This implementation and the separate SciPy integration give about −0.979 at that reported slope; the 0.03 tolerance treats the published threshold as approximate, without adjusting the equations.
Inputs: Walker = Passive compass gait; Leg length = 1 m; Total mass = 20 kg; Downhill slope = 4.37 deg; Velocity disturbance fraction = 0; the others as above.
| Result | Source | This calc |
|---|---|---|
| Largest multiplier modulus | 1 ± 0.03 | 0.9785 |
Shallow-slope compass gait — Standard
Source: Independent adaptive SciPy integration and shooting, attached s5; the Goswami et al. (1998) nonlinear model, DOI 10.1177/027836499801701202. This case regresses the previously missed stable 0.5° orbit.
Inputs: Walker = Passive compass gait; Downhill slope = 0.5 deg; Velocity disturbance fraction = 0; the others as above.
| Result | Source | This calc |
|---|---|---|
| Step duration | 0.6215 s | 0.6215 s |
| Largest multiplier modulus | 0.5389 | 0.5389 |
| Fixed-point residual | 0 ± 1 × 10⁻⁸ | 3.282 × 10⁻¹⁰ |
Shallow-slope compass gait — Fine
Source: Same independent SciPy reference as s5, evaluated with the Fine RK4 mesh to verify the low-slope solution is found at both selectable resolutions.
Inputs: Walker = Passive compass gait; Downhill slope = 0.5 deg; Velocity disturbance fraction = 0; Integration resolution = Fine; the others as above.
| Result | Source | This calc |
|---|---|---|
| Step duration | 0.6215 s | 0.6215 s |
| Largest multiplier modulus | 0.5389 | 0.5389 |
| Fixed-point residual | 0 ± 1 × 10⁻⁸ | 3.28 × 10⁻¹⁰ |
Compass eigenvalues for difficult mass geometry
Source: Independent SciPy shooting and NumPy eigvals, s5. This is a formal periodic orbit, for which the separate physical contact assessment rejects separation. The test checks finite, accurate eigenvalues without asserting physical gait feasibility.
Inputs: Walker = Passive compass gait; Hip / leg mass ratio = 0.5; Leg mass position / leg length = 0.75; Velocity disturbance fraction = 0; the others as above.
| Result | Source | This calc |
|---|---|---|
| Step duration | 0.3963 s | 0.3963 s |
| Largest multiplier modulus | 0.5137 | 0.5137 |
| Normalized eigenvalue polynomial residual | 0 ± 1 × 10⁻⁸ | 1.571 × 10⁻¹⁸ |
Compass clearance against dense adaptive integration
Source: Independent SciPy dense ODE solution and scalar optimization, s5. The tolerance covers the calculator's finite time sampling of the peak.
Inputs: Walker = Passive compass gait; Velocity disturbance fraction = 0; the others as above.
| Result | Source | This calc |
|---|---|---|
| Maximum swing foot clearance | 0.06565 m | 0.06565 m |

Responses