Part 12 - State feedback

Introduction

In this part we’ll see how we can represent a system using its states.

State feedback

We can represent a system using its space-state representation.

Given an input signal, r(t)r(t), that we multiply with a constant, KrK_r.

We also have noise in the system.

Our feedback is also multiplied with a matrix LuL_u.

x=[x1x2xn]x = \begin{bmatrix} x_1 \newline x_2 \newline \vdots \newline x_n \end{bmatrix}

We can represent our system as:

{x˙=Ax+Bu+Bvvy=Cx\begin{cases} \dot{x} & = Ax + Bu + B_v \cdot v \newline y & = Cx \end{cases}

We can define u(t)u(t) as:

u=KrrLuxu = K_r r - L_u x

Let’s find the transfer function GryG_{ry}, so we set the noise to zero.

{x˙=Ax+Buy=Cx\begin{cases} \dot{x} & = Ax + Bu\newline y & = Cx \end{cases} {x˙=Ax+B(KrrLux)y=Cx\begin{cases} \dot{x} & = Ax + B(K_r r - L_u x)\newline y & = Cx \end{cases} {x˙=(ABLu)x+BKrry=Cx\begin{cases} \dot{x} & = (A - BL_u)x + BK_r r \newline y & = Cx \end{cases}

If we take the Laplace transform of the space-state representation:

{sX(s)=(ABLu)X(s)+BKrR(s)Y(s)=CX(s)\begin{cases} sX(s) & = (A - BL_u)X(s) + BK_r R(s)\newline Y(s) & = CX(s) \end{cases} {sX(s)(ABLu)X(s)=BKrR(s)Y(s)=CX(s)\begin{cases} sX(s) - (A - BL_u)X(s) & = BK_r R(s)\newline Y(s) & = CX(s) \end{cases} {(sIA+BLu)X(s)=BKrR(s)Y(s)=CX(s)\begin{cases} (sI - A + BL_u)X(s) & = BK_r R(s)\newline Y(s) & = CX(s) \end{cases} {X(s)=(sIA+BLu)1BKrR(s)Y(s)=CX(s)\begin{cases} X(s) & = (sI - A + BL_u)^{-1}BK_r R(s)\newline Y(s) & = CX(s) \end{cases} {X(s)=(sIA+BLu)1BKrR(s)Y(s)=C(sIA+BLu)1BKrR(s)\begin{cases} X(s) & = (sI - A + BL_u)^{-1}BK_r R(s)\newline Y(s) & = C(sI - A + BL_u)^{-1}BK_r R(s) \end{cases}

Which means:

Gry(s)=Y(s)R(s)=C(sIA+BLu)1BKrG_{ry}(s) = \dfrac{Y(s)}{R(s)} = C(sI - A + BL_u)^{-1}BK_r

The characteristic equation for this is det(sIA+BLu)=0det(sI - A + BL_u) = 0

Loop transfer function

We won’t cover the calculations to prove this, but:

L(s)=Lu(sIA)1BL(s) = L_u(sI - A)^{-1} B

Which means:

S(s)=11+L(s)=11+Lu(sIA)1BS(s) = \dfrac{1}{1 + L(s)} = \dfrac{1}{1 + L_u(sI - A)^{-1} B} T(s)=L(s)1+L(s)=Lu(sIA)1B1+Lu(sIA)1BT(s) = \dfrac{L(s)}{1 + L(s)} = \dfrac{L_u(sI - A)^{-1} B}{1 + L_u(sI - A)^{-1} B}

Let’s now go back, let’s find GruG_{ru} this time:

U(s)=KrR(s)LuX(s)U(s) = K_rR(s) - L_uX(s) U(s)=KrR(s)Lu(sIA+BLu)1BKrR(s)U(s) = K_rR(s) - L_u(sI - A + BL_u)^{-1} BK_r R(s) Gru(s)=U(s)R(s)=KrLu(sIA+BLu)1BKrG_{ru}(s) = \dfrac{U(s)}{R(s)} = K_r - L_u(sI - A + BL_u)^{-1} BK_r

Finally, let’s also find GvyG_{vy}, therefore we set r=0r = 0.

{x˙=AxBLux+Bvvy=Cx\begin{cases} \dot{x} & = Ax - BL_ux + B_v v \newline y & = Cx \end{cases} {x˙=(ABLu)x+Bvvy=Cx\begin{cases} \dot{x} & = (A - BL_u)x + B_v v \newline y & = Cx \end{cases}

Taking the Laplace transform:

{sX(s)=(ABLu)X(s)+BvV(s)Y(s)=CX(s)\begin{cases} sX(s) & = (A - BL_u)X(s) + B_v V(s) \newline Y(s) & = CX(s) \end{cases} {(sIA+BLu)X(s)=BvV(s)Y(s)=CX(s)\begin{cases} (sI - A + BL_u)X(s) & = B_v V(s) \newline Y(s) & = CX(s) \end{cases} {X(s)=(sIA+BLu)1BvV(s)Y(s)=CX(s)\begin{cases} X(s) & = (sI - A + BL_u)^{-1} B_v V(s) \newline Y(s) & = CX(s) \end{cases} {X(s)=(sIA+BLu)1BvV(s)Y(s)=C(sIA+BLu)1BvV(s)\begin{cases} X(s) & = (sI - A + BL_u)^{-1} B_v V(s) \newline Y(s) & = C(sI - A + BL_u)^{-1} B_v V(s) \end{cases} Gvy(s)Y(s)V(s)=C(sIA+BLu)1BvG_{vy}(s) \dfrac{Y(s)}{V(s)} = C(sI - A + BL_u)^{-1} B_v

Usually, KrK_r is found using the fact that we want low-frequency amplification, meaning Gry(0)=1G_{ry}(0) = 1

This means that:

Kr=1C(sIA+BLu)1BK_r = \dfrac{1}{C(sI - A + BL_u)^{-1}B}
Definition 1 (Controllability)

State feedback requires that our control signal, u(t)u(t) affects all states. This means that:

det(S)0det(S) \neq 0

Where SS:

S=[BABA2BAn1B]  For clarification, this is a long series of matrix multiplicationsS = [B AB A^2B \ldots A^{n-1}B] \ | \ \text{For clarification, this is a long series of matrix multiplications}

We call SS for the controllability matrix. The system is controllable if det(S)0det(S) \neq 0.

Example 1

We have the following system which has feedback such that:

Gry(s)=8s2+4s+8G_{ry}(s) = \dfrac{8}{s^2 + 4s + 8}

The given dynamics for the system is represented as:

{x1˙=2x1+x2x2˙=5x1+2uy=x1\begin{cases} \dot{x_1} & = -2x_1 + x_2 \newline \dot{x_2} & = -5x_1 + 2u \newline y & = x_1 \end{cases}

We have no noise present in this system.

Let’s firstly determine if this system is controllable.

Let’s define all matrices:

x=[x1x2]x = \begin{bmatrix} x_1 \newline x_2 \end{bmatrix}A=[2150]A = \begin{bmatrix} -2 & 1 \newline -5 & 0 \end{bmatrix}B=[02]B = \begin{bmatrix} 0 \newline 2 \end{bmatrix}C=[10]C = \begin{bmatrix} 1 & 0 \end{bmatrix}D=[0]D = \begin{bmatrix} 0 \end{bmatrix}

The controllability matrix:

S=[BAB]S = \begin{bmatrix} B & AB \end{bmatrix}AB=[20]AB = \begin{bmatrix} 2 \newline 0 \end{bmatrix}S=[0220]S = \begin{bmatrix} 0 & 2 \newline 2 & 0 \end{bmatrix}det(S)=40det(S) = -4 \neq 0

Therefore, this system is controllable.

Let us now find LuL_u and KrK_r such that Gry(0)=1G_{ry}(0) = 1.

Let’s first find LuL_u.

Lu=[l1l2]L_u = \begin{bmatrix} l_1 & l_2 \end{bmatrix}C(sIA+BLu)1BKrC(sI - A + BL_u)^{-1}B K_r[10]([s+215s]+[02][l1l2])1[02]Kr\begin{bmatrix} 1 & 0 \end{bmatrix} \left( \begin{bmatrix} s + 2 & -1 \newline 5 & s \end{bmatrix} + \begin{bmatrix} 0 \newline 2 \end{bmatrix} \begin{bmatrix} l_1 & l_2 \end{bmatrix} \right)^{-1} \begin{bmatrix} 0 \newline 2 \end{bmatrix} K_r[10]([s+215s]+[002l12l2])1[02]Kr\begin{bmatrix} 1 & 0 \end{bmatrix} \left( \begin{bmatrix} s + 2 & -1 \newline 5 & s \end{bmatrix} + \begin{bmatrix} 0 & 0 \newline 2l_1 & 2l_2 \end{bmatrix} \right)^{-1} \begin{bmatrix} 0 \newline 2 \end{bmatrix} K_r[10]([s+215+2l1s+2l2])1[02]Kr\begin{bmatrix} 1 & 0 \end{bmatrix} \left( \begin{bmatrix} s + 2 & -1 \newline 5 + 2l_1 & s + 2l_2 \end{bmatrix} \right)^{-1} \begin{bmatrix} 0 \newline 2 \end{bmatrix} K_r

As we defined earlier, the characteristic equation is det(sIA+BLu)=0det(sI - A + BL_u) = 0

Which means:

(s+2)(s+2l2)+(5+2l1)=0(s + 2)(s + 2l_2) + (5 + 2l_1) = 0s2+s2l2+2s+4l2+5+2l1=0s^2 + s2l_2 + 2s + 4l_2 + 5 + 2l_1 = 0s2+(2l2+2)s+4l2+5+2l1=0s^2 + (2l_2 + 2)s + 4l_2 + 5 + 2l_1 = 0

We knew that:

Gry(s)=8s2+4s+8G_{ry}(s) = \dfrac{8}{s^2 + 4s + 8}

Which must mean that:

{2l2+2=44l2+5+2l1=8\begin{cases} 2l_2 + 2 & = 4 \newline 4l_2 + 5 + 2l_1 & = 8 \end{cases}

We find that l1=1,l2=12l_1 = 1, l_2 = -\frac{1}{2}, which means that:

Lu=[112]\boxed{L_u = \begin{bmatrix} 1 & -\frac{1}{2} \end{bmatrix}}

Let’s now find KrK_r.

Kr=1C(sIA+BLu)1BK_r = \dfrac{1}{C(sI - A + BL_u)^{-1} B}

This is just some basic matrix operations:

Kr==4K_r = \ldots = \boxed{4}