HomeEngineering & MaterialsState-Space & LQR Control Simulator

⚙️ 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.

Engineering & Materials3DModerate60 FPS
state-space-controller-lab ↗ Open standalone

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.

⚙ Under the hood

Interactive 3D multi-state system where tuning LQR cost weights shows how state-feedback control drives all state variables to a target trajectory optimally.

state-spacelqroptimal-controlcontrol-systemsfeedback-controlstate-estimationengineering

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

What did you find?

Add reproduction steps (optional)