Bipedal walking cycles two legs through stance and swing phases, keeping the projected centre-of-mass (COM) over the support polygon (ZMP - zero moment point control). A balance controller applies small corrective torques when disturbance pushes the COM toward the edge of stability.
leg_angle(t) = A * sin(omega*t + phase_offset)
ZMP stable if COM_xy stays within support polygon
torque_correction = -K_balance * (COM_error)
- Stride length — how far each foot swings forward per step; longer strides increase speed but reduce margin of stability.
- Step speed — the gait cycle frequency (steps per second).
- Balance gain — how strongly the controller corrects torso lean to keep the COM centred; higher gain resists disturbance faster.
- Terrain disturbance — random perturbation applied to the torso each step, testing the balance controller.
Real humanoid robots (e.g. Atlas, Optimus) use inverse kinematics to translate a desired foot trajectory into joint angles at hip, knee, and ankle, combined with real-time IMU feedback for the balance loop shown here.