Home▸Space & Astronomy▸Satellite Attitude Control: Quaternion PD vs Gimbal Lock

Satellite Attitude Control: Quaternion PD vs Gimbal Lock

Command a satellite to a target roll/pitch/yaw with a live PD attitude controller, and compare a quaternion-based controller against a naive Euler-angle controller that loses a degree of freedom near 90° pitch — a real gimbal lock.

Space & Astronomy3DAdvanced60 FPS📱 Mobile-adapted⇄ 2D version
Satellite Attitude Control: Quaternion PD vs Gimbal Lock ↗ Open standalone

Command a target roll, pitch and yaw for a rigid satellite and watch a real PD attitude controller drive it there through genuine quaternion kinematics (q̇ = ½Ω(ω)q). Switch between a coordinate-free quaternion controller and a naive Euler-angle controller that runs three independent per-axis PD loops, and push the target pitch toward 90° to see the Euler controller's roll and yaw axes swing into alignment — real gimbal lock, with one degree of control freedom lost — while the quaternion controller sails through the same attitude without noticing anything special happened.

⚙ Under the hood

Command a target roll, pitch and yaw for a rigid satellite driven by a real quaternion PD attitude controller (q̇ = ½Ω(ω)q), then switch to a naive per-axis Euler-angle controller and push the target pitch toward 90° to watch its roll and yaw axes swing into alignment — genuine gimbal lock, with one degree of control freedom lost, while the quaternion controller keeps converging smoothly through the same attitude.

attitude controlquaternionsgimbal lockADCSspacecraftPID control

3D · Three.js / WebGL renderer · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)