Two-Axis Self-Balancing Stick

An interactive demonstration of an inverted pendulum stabilized in 3D space using reaction wheels and a PID controller.

PITCH: 0.00°
ROLL: 0.00°
Drag to apply disturbance

Simulation Controls

Apply Disturbance

PID Tuning Reset

System Status

Stable & Balancing

How It Works

Gravity

1. Inverted Pendulum

A stick pivoted at the bottom is inherently unstable. Gravity acts on its center of mass, pulling it down. Even a fraction of a degree tilt causes acceleration.

2. Reaction Wheels

Exploiting Newton's Third Law. Accelerating a heavy wheel with a motor applies an equal and opposite torque (reaction force) to the stick, counteracting gravity.

Error Correction

3. PID Control

An IMU (MPU6050) measures the exact angle. The PID algorithm calculates the precise motor speed needed to correct the error smoothly without overshooting.

3D Interactive Circuit Flow

Explore the hardware layout. The animated particles represent power and signal flow.

Power (12V/5V)
Data / I2C
Motor Control
Left Click: Rotate | Right Click: Pan | Scroll: Zoom