Part 12 - State feedback

Posted on Dec 5, 2023
(Last updated: May 26, 2024)

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)$, that we multiply with a constant, $K_r$.

We also have noise in the system.

Our feedback is also multiplied with a matrix $L_u$.

$$ x = \begin{bmatrix} x_1 \\ x_2 \\ \vdots \\ x_n \end{bmatrix} $$

We can represent our system as: $$ \begin{cases} \dot{x} & = Ax + Bu + B_v \cdot v \\ y & = Cx \end{cases} $$

We can define $u(t)$ as: $$ u = K_r r - L_u x $$

Let’s find the transfer function $G_{ry}$, so we set the noise to zero. $$ \begin{cases} \dot{x} & = Ax + Bu\\ y & = Cx \end{cases} $$

$$ \begin{cases} \dot{x} & = Ax + B(K_r r - L_u x)\\ y & = Cx \end{cases} $$

$$ \begin{cases} \dot{x} & = (A - BL_u)x + BK_r r \\ y & = Cx \end{cases} $$

If we take the Laplace transform of the space-state representation: $$ \begin{cases} sX(s) & = (A - BL_u)X(s) + BK_r R(s)\\ Y(s) & = CX(s) \end{cases} $$

$$ \begin{cases} sX(s) - (A - BL_u)X(s) & = BK_r R(s)\\ Y(s) & = CX(s) \end{cases} $$

$$ \begin{cases} (sI - A + BL_u)X(s) & = BK_r R(s)\\ Y(s) & = CX(s) \end{cases} $$

$$ \begin{cases} X(s) & = (sI - A + BL_u)^{-1}BK_r R(s)\\ Y(s) & = CX(s) \end{cases} $$

$$ \begin{cases} X(s) & = (sI - A + BL_u)^{-1}BK_r R(s)\\ Y(s) & = C(sI - A + BL_u)^{-1}BK_r R(s) \end{cases} $$

Which means: $$ G_{ry}(s) = \dfrac{Y(s)}{R(s)} = C(sI - A + BL_u)^{-1}BK_r $$

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

Loop transfer function

We won’t cover the calculations to prove this, but: $$ L(s) = L_u(sI - A)^{-1} B $$

Which means: $$ S(s) = \dfrac{1}{1 + L(s)} = \dfrac{1}{1 + L_u(sI - A)^{-1} B} $$

$$ T(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 $G_{ru}$ this time: $$ U(s) = K_rR(s) - L_uX(s) $$

$$ U(s) = K_rR(s) - L_u(sI - A + BL_u)^{-1} BK_r R(s) $$

$$ G_{ru}(s) = \dfrac{U(s)}{R(s)} = K_r - L_u(sI - A + BL_u)^{-1} BK_r $$

Finally, let’s also find $G_{vy}$, therefore we set $r = 0$. $$ \begin{cases} \dot{x} & = Ax - BL_ux + B_v v \\ y & = Cx \end{cases} $$

$$ \begin{cases} \dot{x} & = (A - BL_u)x + B_v v \\ y & = Cx \end{cases} $$

Taking the Laplace transform: $$ \begin{cases} sX(s) & = (A - BL_u)X(s) + B_v V(s) \\ Y(s) & = CX(s) \end{cases} $$

$$ \begin{cases} (sI - A + BL_u)X(s) & = B_v V(s) \\ Y(s) & = CX(s) \end{cases} $$

$$ \begin{cases} X(s) & = (sI - A + BL_u)^{-1} B_v V(s) \\ Y(s) & = CX(s) \end{cases} $$

$$ \begin{cases} X(s) & = (sI - A + BL_u)^{-1} B_v V(s) \\ Y(s) & = C(sI - A + BL_u)^{-1} B_v V(s) \end{cases} $$

$$ G_{vy}(s) \dfrac{Y(s)}{V(s)} = C(sI - A + BL_u)^{-1} B_v $$

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

This means that: $$ K_r = \dfrac{1}{C(sI - A + BL_u)^{-1}B} $$

State feedback requires that our control signal, $u(t)$ affects all states. This means that: $$ det(S) \neq 0 $$

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

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

Example

We have the following system which has feedback such that: $$ G_{ry}(s) = \dfrac{8}{s^2 + 4s + 8} $$

The given dynamics for the system is represented as: $$ \begin{cases} \dot{x_1} & = -2x_1 + x_2 \\ \dot{x_2} & = -5x_1 + 2u \\ 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 = \begin{bmatrix} x_1 \\ x_2 \end{bmatrix} $$

$$ A = \begin{bmatrix} -2 & 1 \\ -5 & 0 \end{bmatrix} $$

$$ B = \begin{bmatrix} 0 \\ 2 \end{bmatrix} $$

$$ C = \begin{bmatrix} 1 & 0 \end{bmatrix} $$

$$ D = \begin{bmatrix} 0 \end{bmatrix} $$

The controllability matrix: $$ S = \begin{bmatrix} B & AB \end{bmatrix} $$

$$ AB = \begin{bmatrix} 2 \\ 0 \end{bmatrix} $$

$$ S = \begin{bmatrix} 0 & 2 \\ 2 & 0 \end{bmatrix} $$

$$ det(S) = -4 \neq 0 $$

Therefore, this system is controllable.

Let us now find $L_u$ and $K_r$ such that $G_{ry}(0) = 1$.

Let’s first find $L_u$.

$$ L_u = \begin{bmatrix} l_1 & l_2 \end{bmatrix} $$

$$ C(sI - A + BL_u)^{-1}B K_r $$

$$ \begin{bmatrix} 1 & 0 \end{bmatrix} \left( \begin{bmatrix} s + 2 & -1 \\ 5 & s \end{bmatrix} + \begin{bmatrix} 0 \\ 2 \end{bmatrix} \begin{bmatrix} l_1 & l_2 \end{bmatrix} \right)^{-1} \begin{bmatrix} 0 \\ 2 \end{bmatrix} K_r $$

$$ \begin{bmatrix} 1 & 0 \end{bmatrix} \left( \begin{bmatrix} s + 2 & -1 \\ 5 & s \end{bmatrix} + \begin{bmatrix} 0 & 0 \\ 2l_1 & 2l_2 \end{bmatrix} \right)^{-1} \begin{bmatrix} 0 \\ 2 \end{bmatrix} K_r $$

$$ \begin{bmatrix} 1 & 0 \end{bmatrix} \left( \begin{bmatrix} s + 2 & -1 \\ 5 + 2l_1 & s + 2l_2 \end{bmatrix} \right)^{-1} \begin{bmatrix} 0 \\ 2 \end{bmatrix} K_r $$

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

Which means: $$ (s + 2)(s + 2l_2) + (5 + 2l_1) = 0 $$

$$ s^2 + s2l_2 + 2s + 4l_2 + 5 + 2l_1 = 0 $$

$$ s^2 + (2l_2 + 2)s + 4l_2 + 5 + 2l_1 = 0 $$

We knew that: $$ G_{ry}(s) = \dfrac{8}{s^2 + 4s + 8} $$

Which must mean that: $$ \begin{cases} 2l_2 + 2 & = 4 \\ 4l_2 + 5 + 2l_1 & = 8 \end{cases} $$

We find that $l_1 = 1, l_2 = -\frac{1}{2}$, which means that: $$ \boxed{L_u = \begin{bmatrix} 1 & -\frac{1}{2} \end{bmatrix}} $$

Let’s now find $K_r$. $$ K_r = \dfrac{1}{C(sI - A + BL_u)^{-1} B} $$

This is just some basic matrix operations: $$ K_r = \ldots = \boxed{4} $$