⚙️ State-Space Control and LQR
Interactive 3D state-space system where users adjust LQR cost weightings and watch the optimal controller's state trajectory converge to the origin under different penalty settings.
A mass sliding on a frictionless rail is regulated back to rest by an optimal LQR feedback controller, while a linked 3D plot extrudes the live state (position, velocity) forward through time as a spiral that collapses onto the origin.
🔬 What It Demonstrates
The controller solves the continuous algebraic Riccati equation in real time from your Q and R weightings, deriving the feedback gains k₁, k₂ that minimise a trade-off between state error and control effort.
🎮 How to Use
Raise Q₁ or Q₂ to penalise position or velocity error more heavily, raise R to make control effort more costly, and set the initial offset x₀ — then watch the gains, the rail mass, and the state-space spiral respond together.
💡 Did You Know?
LQR was formalised by Rudolf Kálmán in the early 1960s and, alongside the Kalman filter, became foundational to the Apollo guidance computer and nearly every modern autopilot.
Interactive 3D multi-state system where tuning LQR cost weights shows how state-feedback control drives all state variables to a target trajectory optimally.
3D · Three.js / WebGL renderer · 60 FPS target · runs fully client-side, no install