Section 45.2: Balance, stability, and gait

"Balance is what remains after every modeling shortcut gets punished by gravity."

A Dynamics Lecture After Midnight
Biped maintaining balance while stepping and recovering from a push.
Figure 45.2A: Stability is about recoverability over time, not about a single static pose.
Big Picture

Balance, stability, and gait sit at the center of locomotion because every command changes support geometry and momentum at once.

The linear inverted pendulum model gives a compact balance approximation. With center-of-mass horizontal position $c$ and height-fixed natural frequency $\omega = \sqrt{g/z_0}$, the capture point is $\xi = c + \dot c / \omega$. If $\xi$ leaves the reachable foothold set, the current stance cannot stop the fall without taking a step.

For zero-moment-point reasoning, the planned ZMP must stay inside the support polygon during contact. That is a necessary but not sufficient condition for robust walking because actuator bandwidth, contact compliance, perception delay, and state-estimation drift still matter in the closed loop.

A Stable Gait Is A Recovery Policy

The right question is not whether the gait looks smooth on nominal terrain. It is whether the robot still has a feasible next foothold after a push, slip, or height error.

Figure 45.2.1 makes gait generation explicit: estimate balance state, predict recoverability, choose footstep timing, and verify margin after disturbance. Observe CoM, support polygon, phase, contact Model LIPM, ZMP, capture point Act set footstep and stance timing Verify fall rate, recovery time, margin
Figure 45.2.1 makes gait generation explicit: estimate balance state, predict recoverability, choose footstep timing, and verify margin after disturbance.

Theory

Static stability asks whether the projected center of mass lies inside the support region. Dynamic stability asks whether momentum, actuator authority, and future footholds allow recovery before the robot reaches an unrecoverable state.

Gait design is therefore a hybrid systems problem. The robot alternates discrete contact modes and continuous within-contact dynamics. A controller that ignores mode transitions tends to fail precisely when the task becomes interesting: on slopes, during pushes, or while carrying loads.

The right instrumentation is a balance ledger that records ZMP margin, capture-point error, stance phase, slip events, and recovery steps on every episode.

Capture Point (Linear Inverted Pendulum)

Under the Linear Inverted Pendulum (LIPM) assumption, where the center of mass height $z_{com}$ is held constant, the capture point is:

$$x_{cap} = x_{com} + \dot{x}_{com}\sqrt{\frac{z_{com}}{g}}$$

If $x_{cap}$ lies outside the reachable foothold set, the current stance cannot arrest the fall without taking a step. This equation is the minimal diagnostic for whether a stance phase is recoverable.

Algorithm: Push-Recovery Evaluation Loop
  1. Estimate center of mass, center of pressure, stance phase, and body twist at control rate.
  2. Compute ZMP margin and capture-point error relative to the current or planned support region.
  3. If the capture point exits the current support set, trigger a step adjustment or stance widening policy.
  4. If step adjustment is infeasible, reduce commanded velocity and raise damping or compliance according to the safety mode.
  5. Log whether recovery came from ankle strategy, hip strategy, stepping, or operator intervention.

Worked Example

A tiny diagnostic on the capture point can explain why one gait survives a shove that another gait cannot recover from.

import math

com_x = 0.02
com_vx = 0.55
z0 = 0.82
g = 9.81
omega = math.sqrt(g / z0)
capture_point = com_x + com_vx / omega
support_max_x = 0.16
margin = round(support_max_x - capture_point, 3)

print(f"capture_point={capture_point:.3f} m")
print(f"remaining_margin={margin:.3f} m")
capture_point=0.179 m remaining_margin=-0.019 m

Expected output interpretation. The capture point sits 1.9 cm outside the current support limit. A controller that keeps the same stance is already late. It must place a new foot, widen support, or lower momentum quickly enough to move the capture point back into a reachable set.

Code Fragment 45.2.1: The capture-point check is a compact recoverability test. It does not prove a full-body controller will succeed, but it immediately flags when the current support phase is no longer enough.
Library Shortcut

Use Drake for reduced-order reasoning, MuJoCo or Isaac Lab for contact-rich gait replay, and ROS 2 for synchronized force, IMU, and controller logs on hardware.

Practical Recipe

  1. Instrument ZMP, capture-point error, stance phase, and foot slip in every rollout.
  2. Evaluate nominal walking, pushes, friction drops, and height-map errors on the same disturbance panel.
  3. Separate gait generation from recovery logic so you can attribute failures to the right layer.
  4. Tune for recovery margin before tuning for style or top speed.
  5. Archive two traces for every new controller: a stable nominal run and a near-failure recovery run.
Common Failure Mode

A gait can look smooth while silently using torque peaks, contact chatter, or emergency stance corrections that never appear in the summary video.

Practical Example

A warehouse biped that carries boxes should be tested with payload asymmetry and lateral nudges during turns. Many controllers that appear strong in straight-line walking fail when torso momentum and grasp maintenance interact.

Memory Hook

If the robot can only stay upright when nobody bothers it, the gait is choreography, not control.

Research Frontier

Recent locomotion work blends reduced-order planners, MPC, and learned recovery policies. The open challenge is maintaining interpretable balance margins while still exploiting the agility of learned full-body reflexes.

Self Check

Can you explain why ZMP inside the support polygon is useful but insufficient, and what additional signal would tell you whether a step must be taken?

This section is a natural bridge between classical control and modern locomotion learning. Students who see capture-point reasoning first can later interpret learned recovery policies as fast approximations to the same physical objective, rather than as opaque behavior.

It is also worth emphasizing that gait evaluation is not one scalar. The same controller can have good average speed and terrible disturbance behavior. Reporting both nominal and perturbation metrics is part of the scientific content, not bookkeeping.

Balance And Gait Tooling
Tool or LibraryRole in the TopicBuilder Advice
DrakeLIPM, footstep planning, and balance reasoningStart here when you want interpretable reduced-order models.
Isaac Lab or MuJoCoContact-rich rollout and learned gait validationUse the same disturbance panel across controllers.
Force plates or foot contact logsMeasure actual support behaviorDo not infer contact quality from pose traces alone.
Cross-References

This section connects directly to control, scalable RL systems, and advanced humanoid dynamics.

Mini Lab

Replay the same biped or quadruped gait with three push magnitudes and two friction values. Record whether recovery uses ankle strategy, stepping, or failure.

Balance failures should be labeled by root cause: wrong state estimate, late contact detection, bad footstep plan, insufficient actuator authority, or unstable gain schedule. Those labels make later learning and controller tuning faster and more honest.

Section References

MIT Underactuated Robotics. "Humanoid robots and walking." https://underactuated.mit.edu/humanoids.html

Primary exposition of ZMP, walking templates, and planning logic.

Drake project documentation. https://drake.mit.edu/

Useful for reduced-order and optimization-based balance studies.

NVIDIA Isaac Lab documentation. https://isaac-sim.github.io/IsaacLab/

Current practical route for high-throughput locomotion and disturbance testing.

Key Takeaway

Stable gait design is really recoverability engineering under hybrid contact dynamics.

Exercise 45.2.1

Pick one gait controller and define a push-recovery benchmark with exact perturbation times, force magnitudes, and success rules. State which metrics would prove the gait got faster without becoming less recoverable.