Main Content

Linear-Quadratic-Integral control

`[K,S,e] = lqi(SYS,Q,R,N)`

`lqi`

computes an optimal state-feedback control
law for the tracking loop shown in the following figure.

For a plant `sys`

with the state-space equations
(or their discrete counterpart):

$$\begin{array}{l}\frac{dx}{dt}=Ax+Bu\\ y=Cx+Du\end{array}$$

the state-feedback control is of the form

$$u=-K[x;{x}_{i}]$$

where *x _{i}* is
the integrator output. This control law ensures that the output

`[K,S,e] = lqi(SYS,Q,R,N)`

calculates
the optimal gain matrix `K`

, given a state-space
model `SYS`

for the plant and weighting matrices `Q`

, `R`

, `N`

.
The control law *u* = –*Kz* =
–*K*[*x*;*x _{i}*]
minimizes the following cost functions (for

$$J(u)={\displaystyle {\int}_{0}^{\infty}\{{z}^{T}Qz+{u}^{T}Ru+2{z}^{T}Nu\}dt}$$ for continuous time

$$J(u)={\displaystyle \sum _{n=0}^{\infty}\{{z}^{T}Qz+{u}^{T}Ru+2{z}^{T}Nu\}}$$ for discrete time

In discrete time, `lqi`

computes the
integrator output *x _{i}* using
the forward Euler formula

$${x}_{i}[n+1]={x}_{i}[n]+Ts(r[n]-y[n])$$

where *Ts* is the
sample time of `SYS`

.

When you omit the matrix `N`

, `N`

is
set to 0. `lqi`

also returns the solution `S`

of
the associated algebraic Riccati equation and the closed-loop eigenvalues `e`

.

For the following state-space system with a plant with augmented integrator:

$$\begin{array}{l}\frac{\delta z}{\delta t}={A}_{a}z+{B}_{a}u\\ y={C}_{a}z+{D}_{a}u\end{array}$$

The problem data must satisfy:

The pair (

*A*,_{a}*B*) is stabilizable._{a}*R*>*0*and $$Q-N{R}^{-1}{N}^{T}\ge 0$$.$$\left(Q-N{R}^{-1}{N}^{T},{A}_{a}-{B}_{a}{R}^{-1}{N}^{T}\right)$$ has no unobservable mode on the imaginary axis (or unit circle in discrete time).

`lqi`

supports descriptor models with nonsingular *E*.
The output `S`

of `lqi`

is the solution
of the Riccati equation for the equivalent explicit state-space model

$$\frac{dx}{dt}={E}^{-1}Ax+{E}^{-1}Bu$$

[1] P. C. Young and J. C. Willems, “An
approach to the linear multivariable servomechanism problem”, *International
Journal of Control*, Volume 15, Issue 5, May 1972 , pages
961–979.