Links

State-Space Control

The basic idea behind state space control is to use the state of the system in order to set the input. Namely, if we are given
dxdt=Ax+Bu,\frac{d^{}\mathbf{x}}{dt^{}} = A\mathbf{x}+B\mathbf{u},
then we can let
u=rKx\mathbf{u} = \mathbf{r} - K\mathbf{x}
. If we do this, then the equivalent state-evolution equation becomes
dxdt=(ABK)x+Br.\frac{d^{}\mathbf{x}}{dt^{}} = (A-BK)\mathbf{x}+B\mathbf{r}.
Notice that if our system is in phase variable form, then the controlled state-evolution equation is
dxdt=[01000010000001a0k0a1k1an2kn2an1kn1]x+Br.\frac{d^{}\mathbf{x}}{dt^{}} = \begin{bmatrix} 0 & 1 & 0 & 0 & \cdots\\ 0 & 0 & 1 & 0 & \cdots\\ 0 & 0 & \ddots & \ddots & \ddots\\ 0 & 0 & \cdots & 0 & 1\\ -a_0-k_0 & -a_1-k_1 & \cdots & -a_{n-2}-k_{n-2} & -a_{n-1}k_{n-1} \end{bmatrix}\mathbf{x} + B\mathbf{r}.
This makes it very convenient to place our poles where we want since the last row of the
AA
matrix is also the coefficients of the characteristic polynomial.

Design by Transformation

Suppose we have a system
dzdt=Az+Buy=Cz\frac{d^{}\mathbf{z}}{dt^{}} = A\mathbf{z}+B\mathbf{u} \qquad \mathbf{y} = C\mathbf{z}
which is not in phase variable form. To place it into phase variable form, first assume that
z=Px\mathbf{z} = P\mathbf{x}
for some invertible matrix
PP
.
Pdxdt=APx+Bu    dxdt+P1Buy=CPx.P\frac{d^{}\mathbf{x}}{dt^{}} = AP\mathbf{x}+B\mathbf{u} \implies \frac{d^{}\mathbf{x}}{dt^{}} + P^{-1}B\mathbf{u} \qquad \mathbf{y} = CP\mathbf{x}.
Since our transformation is invertible, the controllability of the system is unchanged, so
Cx=[P1BP1ABP1An1B]=P1Cz.\mathcal{C}_x = \begin{bmatrix} P^{-1}B & P^{-1} AB \cdots P^{-1}A^{n-1}B \end{bmatrix} = P^{-1}\mathcal{C}_z.
Assuming the system is controllable,
P=CzCx1P = \mathcal{C}_z\mathcal{C}_x^{-1}
. Now we can apply state feedback to the phase variable system.
dxdt=P1APx+P1B(Kx+r)=P1(APBK)P1z+Br    Kz=KzP1.\frac{d^{}\mathbf{x}}{dt^{}} = P^{-1}AP\mathbf{x}+P^{-1}B(-K\mathbf{x}+\mathbf{r}) = P^{-1}(AP-BK)P^{-1}\mathbb z + Br \implies K_z = K_zP^{-1}.

Observers/State Estimators

When doing state feedback, we often don’t have access to the states themselves because we only have access to
y\mathbf{y}
. In that case, we can’t use
u=rKx\mathbf{u}=\mathbf{r}-K\mathbf{x}
because we don’t know
x\mathbf{x}
. One idea is to keep track of an estimated state
x^\hat{\mathbf{x}}
and estimated output
y^\hat{\mathbf{y}}
which follow the same system dynamics as the actual state and the actual output and receive the same input. If
AA
is a stable matrix, then
limteAtx0=0\lim_{t\to\infty}e^{At}\mathbf{x}_0=0
where
x0\mathbf{x}_0
is the initial state of the system. This means that even if there is a discrepancy between the estimated state and the true state in the beginning, the estimate will match the true state after some time.
Suppose now that we want to control the error between the true state and the estimated state
e=xx^\mathbf{e} = \mathbf{x} - \hat{\mathbf{x}}
, so we add a gain
LL
to the error in the outputs
yy^\mathbf{y}-\hat{\mathbf{y}}
.
dx^dt=Ax^+Bu+L(yy^)=Ax^+Bu+LC(xx^)dedt=d(xx^)dt=Ax+Bu[Ax^+Bu+LC(xx^)]dedt=(ALC)e\begin{aligned} \frac{d^{}\hat{\mathbf{x}}}{dt^{}} &= A\hat{\mathbf{x}} + B\mathbf{u} + L(\mathbf{y}-\hat{\mathbf{y}}) = A\hat{\mathbf{x}}+B\mathbf{u}+LC(\mathbf{x}-\hat{\mathbf{x}})\\ \frac{d^{}\mathbf{e}}{dt^{}} &= \frac{d^{}(\mathbf{x}-\hat{\mathbf{x}})}{dt^{}} = A\mathbf{x}+B\mathbf{u} - \left[A\hat{\mathbf{x}}+B\mathbf{u}+LC(\mathbf{x}-\hat{\mathbf{x}})\right]\\ \therefore \frac{d^{}\mathbf{e}}{dt^{}} &= (A-LC)\mathbf{e}\end{aligned}
Thus we can design
LL
to get quick error convergence. Notice that if our system is not observable, then we will not be able to place the poles of the observer system where we want them to be.
Now, if we we do state feedback using the estimated state, then
dxdt=Ax+B(rKx^)=(ABK)x+B(rKe).\frac{d^{}\mathbf{x}}{dt^{}} = A\mathbf{x}+B(\mathbf{r}-K\hat{\mathbf{x}}) = (A-BK)\mathbf{x}+B(\mathbf{r}-K\mathbf{e}).
Looking at the combined system,
[dxdtdedt]=[ABKBK0ALC][xe]+[B0]r.\begin{bmatrix} \frac{d^{}\mathbf{x}}{dt^{}} \\ \frac{d^{}\mathbf{e}}{dt^{}} \end{bmatrix} = \begin{bmatrix} A-BK & -BK \\ 0 & A-LC \end{bmatrix} \begin{bmatrix} \mathbf{x} \\ \mathbf{e} \end{bmatrix} + \begin{bmatrix} B \\ \boldsymbol{0} \end{bmatrix}\mathbf{r}.
Notice that the poles of this system are just the poles of the original system and the poles of the observer system, so we can choose
KK
and
LL
independently.
Figure 12: State Observer System

Integrators in State Feedback

Suppose we wanted to get rid of the steady state error using state-space control. We would do this using an integrator over the error in the observed outputs.
xN=0t(ry)dt.\mathbf{x}_N = \int_{0}^{t}(\vec{r}-\vec{y})dt.
If we treat this as a new state, its evolution will be
dxNdt=rCx.\frac{d^{}\mathbf{x}_N}{dt^{}} = r - C\mathbf{x}.
If our new control law is
u=Kx+KexN\mathbf{u} = -K\mathbf{x}+K_e\mathbf{x}_N
, then our new state-space equations are
[dxdtdxNdt]=[A0C0][xxN]+[B0]+[0I]r.\begin{aligned} \begin{bmatrix} \frac{d^{}\mathbf{x}}{dt^{}} \\ \frac{d^{}\mathbf{x}_N}{dt^{}} \end{bmatrix} = \begin{bmatrix} A & 0 \\ -C & 0 \end{bmatrix} \begin{bmatrix} \mathbf{x} \\ \mathbf{x}_N \end{bmatrix} + \begin{bmatrix} B \\ \boldsymbol{0} \end{bmatrix} + \begin{bmatrix} \boldsymbol{0} \\ \boldsymbol{I} \end{bmatrix}\mathbf{r}.\end{aligned}
When we apply our feedback rule, we get
[dxdtdxNdt]=[ABKBKeC0][xxN]+[0I]r.\begin{aligned} \begin{bmatrix} \frac{d^{}\mathbf{x}}{dt^{}} \\ \frac{d^{}\mathbf{x}_N}{dt^{}} \end{bmatrix} = \begin{bmatrix} A-BK & BK_e \\ -C & 0 \end{bmatrix} \begin{bmatrix} \mathbf{x} \\ \mathbf{x}_N \end{bmatrix} + \begin{bmatrix} \boldsymbol{0} \\ \boldsymbol{I} \end{bmatrix}\mathbf{r}.\end{aligned}

Linear Quadratic Regulator

Suppose we want to control our system to send the state to
0\boldsymbol{0}
over an infinite time horizon using the input
Kx-K\mathbf{x}
. We want to do this by optimizing a cost function that penalizes control effort and the state error. In particular, we want to minimize the cost function
J=0yTQy+uTRudt.J = \int_{0}^{\infty}\mathbf{y}^TQ\mathbf{y} + \mathbf{u}^TR\mathbf{u} dt.
where
RR
and
QQ
are positve-semi-definite matrices (typically diagonal) and determine how much we penalize the error and the control effort.