Humanoid Robotics Simulation
Physics-based bipedal robot balance simulation. Two autonomous agents maintaining static equilibrium using PD controller balance correction.
Source code and specifications: github.com/stabilarity/hub
Part of the Open Humanoid research series — a 20-article engineering series building a fully spec-driven autonomous humanoid robot.
About This Simulation
This simulation represents the first milestone in the Open Humanoid project: static balance. Two bipedal robots stand in place and actively maintain equilibrium against random perturbations using a proportional-derivative (PD) controller.
Physics Features
- PD controller simulation: Kp=18, Kd=4.5 gains applied to lateral and sagittal balance axes
- Center of mass (CoM) indicator: red sphere tracking estimated CoM position
- Ground reaction force arrows: green vertical lines at each foot showing load distribution
- Random perturbation injection at 2-5 second intervals simulating external disturbances
- Micro joint compensation: hip and knee flex in response to balance error
- Arm counterbalance motion opposing trunk lean
- Inter-robot communication beam pulse (blue line) simulating coordination link
- Real-time status panel: balance error (rad), CoM offset (m), correction torque (Nm)
Technical Implementation
Built with Three.js. The control loop runs at 60 Hz with Euler integration. Each robot maintains independent state (tilt angle, angular velocity) on two axes. The PD controller computes corrective torque at each frame: τ = −Kp·θ − Kd·θ̇ + perturbation. Tilt is clamped to ±0.12 rad for safety.