Plain LQR drives the system state toward the origin but leaves a persistent steady-state offset when a constant reference or disturbance is present. The integral state feedback controller (LQI, or servo LQR) removes this offset by augmenting the plant with integrators on the tracking error. A single LQR solve on the augmented system produces two gains: one that acts on the physical states and one that closes the integral loop, guaranteeing zero steady-state error to constant references with no manual trim.
The discrete-time plant is
with state
Define the integral-of-error state
Stacking
Minimise the infinite-horizon quadratic cost
by solving the Discrete Algebraic Riccati Equation (DARE) for
The optimal gain partitions as
At equilibrium
| Case | Time | Space | Notes |
|---|---|---|---|
| Design | DARE iteration on augmented system | ||
| Update | Two matrix-vector products |
Design is a one-time offline computation. The per-sample update cost is dominated by the two gain-state products and the integral accumulation.
Consider a scalar plant (
- Form
$A_a$ (2×2),$B_a$ (2×1) from plant matrices and$T_s$ . - Choose
$Q$ (2×2 diagonal) and$R$ (scalar) to weight states and input. - Solve DARE →
$P$ (2×2) →$K_a = [k_x ; k_i]$ (1×2). - Per step: accumulate
$x_i \mathrel{+}= (r - y) T_s$ , output$u = -k_x x - k_i x_i$ . - After ~200 steps the output converges to
$r$ within numerical tolerance.
-
Integral windup: when the actuator saturates, the integral keeps growing because the
control cannot reach the demanded value. Apply a clamp on
$x_i$ or back-calculate (anti-windup) to prevent divergence after the saturation clears. -
Marginally stable plant: a plant with an open-loop integrator combined with the error
integrator yields a double-integrator augmented system. The DARE still converges if the
augmented pair
$(A_a, B_a)$ is stabilisable; verify that condition before deploying. -
Slow integral weighting: under-weighting the integral state in
$Q$ allows steady-state error to persist for many steps before correcting; over-weighting causes overshoot. -
Sample-time mismatch: the discrete integral
$x_i$ accumulates$T_s$ -scaled errors. Using the wrong$T_s$ at run time shifts the effective integral gain and breaks zero-error convergence. -
Slow DARE convergence: the augmented plant
$(A_a, B_a)$ has eigenvalues at exactly 1, and at high sampling rates those eigenvalues approach 1 from many directions, requiring many more DARE iterations than the default 300. Raise the cap via theMaxIterationstemplate parameter:IntegralStateFeedbackLqi<float, StateSize, InputSize, OutputSize, 30000>.
-
Continuous-time LQI: replace the discrete integrator with
$\dot{x}_i = r - y$ and solve the continuous ARE. - Output-feedback LQI (LQGI): combine with a Kalman filter when only the output (not the full state) is measurable — the separation principle still holds.
-
Anti-windup: add a saturation block on
$x_i$ with back-calculation to recover from actuator limits without integral drift. -
Multiple outputs: the design extends directly to
$p > 1$ by stacking$p$ integral states.
- Motor position/speed servo: eliminate gravity or friction offsets without manual trim.
- Process control: temperature or pressure regulation with constant load disturbances.
- Aerospace attitude control: integral action compensates for persistent aerodynamic moments.
- Robotics: joint torque control with payload-induced constant forces.
-
Lqr: the base regulator; LQI delegates the DARE solve to
Lqron the augmented plant. -
DiscreteAlgebraicRiccatiEquation: the inner solver used by
Lqr. -
Lqg: pairs
Lqrwith a Kalman filter; LQI could similarly pair withLqgfor output-feedback servo control. -
Pid: the integral channel of a PID is the scalar, single-output analogue of
$K_i x_i$ . - SaturationRateLimiter: provides output clamping for anti-windup on the LQI integral.
- B. D. O. Anderson, J. B. Moore, Optimal Control: Linear Quadratic Methods, Prentice Hall, 1990.
- G. F. Franklin, J. D. Powell, A. Emami-Naeini, Feedback Control of Dynamic Systems, 8th ed., Pearson, 2019. Chapter 9.
- K. J. Åström, B. Wittenmark, Computer-Controlled Systems: Theory and Design, 3rd ed., Prentice Hall, 1997. Chapter 5.