Attitude Stabilization as a Feedback Design Problem
Consider a simplified single-axis spacecraft attitude model. The spacecraft must rotate from an initial attitude error toward a commanded attitude while avoiding excessive angular velocity and excessive control torque.
Here, \( \theta \) is attitude angle, \( \omega \) is angular velocity, and \( u \) is the applied control torque. This is the same physical model used in many introductory attitude-control problems, but now the focus is not only stability. The focus is how the feedback gain should be chosen.
LQR asks: “What gains minimize a defined cost?”
Why Manual Tuning Becomes Hard
A manually tuned PD controller can work well for simple cases. Increasing \(K_p\) usually makes the response faster, while increasing \(K_d\) usually adds damping.
The difficulty is that gain tuning is a tradeoff. A large \(K_p\) can reduce pointing error quickly, but it may demand more torque and excite oscillation. A large \(K_d\) can damp motion, but it can also slow the response or require high control effort.
Writing the Attitude Model in State-Space Form
Define the state vector as:
The simplified attitude dynamics can be written as:
This form is powerful because it allows the controller to be written as direct feedback from the system state.
PD Control Is Already a State Feedback Controller
For regulation toward zero attitude error, the PD controller can be written as:
This means PD and LQR use the same basic feedback structure. The difference is how \(K_p\) and \(K_d\) are chosen.
What LQR Minimizes
LQR chooses a feedback gain by minimizing a quadratic cost:
For the single-axis attitude model:
Penalizes attitude pointing error.
Penalizes angular-rate motion.
Penalizes control torque effort.
How LQR Chooses Gains
LQR computes:
where \(P\) comes from the algebraic Riccati equation:
In the interactive demo below, the model is the simple double-integrator attitude system, so the LQR gain can be computed directly from \(Q_\theta\), \(Q_\omega\), and \(R\).
Manual PD vs LQR Control
Adjust the manual PD gains and the LQR weights. The plot compares the manual response against the LQR response using the same initial attitude error. The cost breakdown shows what each design is paying for: attitude error, angular-rate motion, and control effort.
LQR weighting:
Constraint awareness:
Constraint Awareness: Ideal vs Saturated LQR
This plot compares the ideal LQR torque demand with the torque that a real actuator can actually deliver after saturation.
Waiting for simulation...
Waiting for simulation...
Waiting for simulation...
What the Comparison Shows
The LQR result is not automatically “better” in every practical sense. It is optimal for the model and cost function that were chosen. If the cost function penalizes torque strongly, LQR will choose a more conservative response. If pointing error is heavily penalized, it will become more aggressive.
This is the main engineering lesson. Manual tuning gives intuition. LQR gives a systematic way to formalize tradeoffs. A strong control engineer understands both.
What This Problem Shows
Useful for intuition and quick tuning, but depends strongly on trial-and-error.
Computes gains by minimizing a cost that balances state error and control effort.
The best controller depends on what the mission values: accuracy, smoothness, or torque economy.
The core lesson is: