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.

#biped walking #compass gait #five-link walker #hybrid zero dynamics #orbital stability #Poincaré map

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 LL, MM and L/g\sqrt{L/g} 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 (qstance,q˙stance,q˙swing)(q_{\rm stance},\dot q_{\rm stance},\dot q_{\rm swing}). 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 q=(qs,qf,qT,qf2,qs2)q=(q_s,q_f,q_T,q_{f2},q_{s2}), COM locations are ∑jCbj(sin⁡qj,cos⁡qj)\sum_j C_{bj}(\sin q_j,\cos q_j). Thus K=CTdiag⁡(m)CK=C^T\operatorname{diag}(m)C, Dij=Kijcos⁡(qi−qj)+Ic,iδijD_{ij}=K_{ij}\cos(q_i-q_j)+I_{c,i}\delta_{ij}, hi=∑jKijsin⁡(qi−qj)q˙j2h_i=\sum_jK_{ij}\sin(q_i-q_j)\dot q_j^2, and Gi=−gjsin⁡qiG_i=-g_j\sin q_i, where gj=∑bmbCbjg_j=\sum_bm_bC_{bj}. These give all five equations Dq¨+h+G=BuD\ddot q+h+G=Bu with four internal joint torques. Reference-axis inertias are converted by Ic=Ijoint−mp2I_c=I_{\rm joint}-mp^2.

Impact uses the complete 7-DOF floating model: q˙e+=q˙e−+De−1JTΛ\dot q_e^+=\dot q_e^-+D_e^{-1}J^T\Lambda, JDe−1JTΛ=−Jq˙e−JD_e^{-1}J^T\Lambda=-J\dot q_e^-. Both impulse components and released-foot velocity are checked, and all five angular coordinates are relabeled.

A quartic Hermite posture curve uses phase s=((qs+qf)/2+a)/(2a)s=((q_s+q_f)/2+a)/(2a). 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 A=1TDqsA=\mathbf1^TDq_s, σ=As˙\sigma=A\dot s, and ζ=σ2/2\zeta=\sigma^2/2. The exact five-link zero dynamics are σ˙=∑jgjsin⁡qj\dot\sigma=\sum_jg_j\sin q_j and dζ/ds=Aσ˙d\zeta/ds=A\dot\sigma. Composite Simpson integration yields W(s)W(s). Full impact gives δ=σ+/σ−\delta=\sigma^+/\sigma^- and P(ζ)=δ2ζ+W(1)P(\zeta)=\delta^2\zeta+W(1). Newton solves P(ζ)−ζ=0P(\zeta)-\zeta=0; its Jacobian is the scalar δ2\delta^2.

The implemented input-output linearizing controller solves the full five dynamic equations together with four prescribed output accelerations. The ideal finite-time law uses v=−k2sign⁡(y)∣y∣1/3−ksign⁡(y˙)∣y˙∣1/2v=-k^2\operatorname{sign}(y)|y|^{1/3}-k\operatorname{sign}(\dot y)|\dot y|^{1/2}. 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 ζ\zeta; intersecting their inequalities with ζ(s)>0\zeta(s)>0 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 0.015L/g0.015\sqrt{L/g} (Fine: 0.0075L/g0.0075\sqrt{L/g}), 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

InputSymbolUnitDefault
WalkerwalkerFive-link HZD walker
Leg lengthL_legm0.8
Total massM_bodykg40
Ground friction coefficientfriction0.8
Joint torque limitT_limitN*m120
Half stride angle
Angle swept by the mean stance-leg orientation on either side of vertical.
stride_halfrad0.25
Knee flexion at contactknee_contactrad0.16
Torso lean at contacttorso_leanrad0.12
Additional swing knee flexionswing_bendrad0.7
Downhill slopeslopedeg3
Hip / leg mass ratiomass_ratio2
Leg mass position / leg length
Distance from the foot to the concentrated leg mass, divided by leg length.
com_fraction0.5
Velocity disturbance fraction
Scales both compass angular rates, or five-link pre-impact momentum, by one plus this fraction.
disturbance-0.1
Integration resolutionaccuracyStandard
Step playback
A fraction of the step duration; the impact and leg exchange occur at the end.
t_phase0.75

Results

With the default inputs above, the calc gives:

ResultValue
Limit cycleStable HZD gait
Largest multiplier modulus0.7902
Step duration0.6352 s
Step length0.3946 m
Mean walking speed0.6212 m/s
Applied disturbanceReturns toward gait
HZD admissible momentum reduction0.2
HZD admissible momentum increase0.304
Peak joint torque75.2964 N·m
Required friction coefficient0.641
Minimum normal reaction324.8449 N
Impact kinetic energy loss fraction0.347
Fixed-point residual0
Impact closure residual0

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.

ResultSourceThis calc
Published HZD scalar-map benchmark979979

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.

ResultSourceThis calc
Swing knee reference-axis inertia0.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.

ResultSourceThis calc
Largest multiplier modulus0.580.58
Step duration0.7343 s0.7343 s
Step length0.5354 m0.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.

ResultSourceThis calc
Largest multiplier modulus0.79020.7902
Step duration0.6352 s0.6352 s
Mean walking speed0.6212 m/s0.6212 m/s
Pre-impact squared momentum / 2398.6 kg²·m⁴/s²398.6 kg²·m⁴/s²
Peak joint torque75.296 N·m75.296 N·m
Minimum normal reaction324.8 N324.8 N
Maximum swing foot clearance0.06717 m0.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.

ResultSourceThis calc
Largest multiplier modulus1 ± 0.030.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.

ResultSourceThis calc
Step duration0.6215 s0.6215 s
Largest multiplier modulus0.53890.5389
Fixed-point residual0 ± 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.

ResultSourceThis calc
Step duration0.6215 s0.6215 s
Largest multiplier modulus0.53890.5389
Fixed-point residual0 ± 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.

ResultSourceThis calc
Step duration0.3963 s0.3963 s
Largest multiplier modulus0.51370.5137
Normalized eigenvalue polynomial residual0 ± 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.

ResultSourceThis calc
Maximum swing foot clearance0.06565 m0.06565 m

Related Resources

Responses

Your email address will not be published. Required fields are marked *

L ading...