# Control Systems/Estimators and Observers

## Estimators and Observers

A problem arises in which the internal states of many systems cannot be directly observed, and therefore state feedback is not possible. What we can do is try to design a separate system, known as an observer or an estimator that attempts to duplicate the values of the state vector of the plant, except in a way that is observable for use in state feedback. Some literature calls these components "observers", although they do not strictly observe the state directly. Instead, these devices use mathematical relations to try and determine an estimate of the state. Therefore, we will use the term "estimator", although the terms may be used interchangeably.

### Creating an Estimator

There are several observer structures including sliding mode, cubic and linear observers. To illustrate the basics of observer design, consider a linear observer used to eatimate the state of a linear system. Notice that we know the A, B, C, and D matrices of our plant, so we can use these exact values in our estimator. We know the input to the system, we know the output of the system, and we have the system matrices of the system. What we do not know, necessarily, are the initial conditions of the plant. What the estimator tries to do is make the estimated state vector approach the actual state vector quickly, and then mirror the actual state vector. We do this using the following system for an observer:

${\displaystyle {\hat {x}}'=A{\hat {x}}+Bu+L(y-{\hat {y}})}$
${\displaystyle {\hat {y}}=C{\hat {x}}+Du}$

L is a matrix that we define that will help drive the error to zero, and therefore drive the estimate to the actual value of the state. We do this by taking the difference between the plant output and the estimator output.

In order to make the estimator state approach the plant state, we need to define a new additional state vector called state error signal ${\displaystyle e_{x}(t)}$ . We define this error signal as:

${\displaystyle e_{x}(t)=x-{\hat {x}}}$

and its derivative:

${\displaystyle e_{x}'(t)=x'-{\hat {x}}'}$

We can show that the error signal will satisfy the following relationship:

${\displaystyle e_{x}'(t)=Ax+Bu-(A{\hat {x}}+Bu+L(y-{\hat {y}}))}$
${\displaystyle e_{x}'(t)=A(x-{\hat {x}})-L(Cx-C{\hat {x}})}$
${\displaystyle e_{x}'(t)=(A-LC)e_{x}(t)}$

We know that if the eigenvalues of the matrix (A - LC) all have negative real parts that:

${\displaystyle e_{x}(t)=e^{(A-LC)(t-t_{0})}e_{x}(t_{0})\to 0}$  when ${\displaystyle t\to \infty }$ .

This ${\displaystyle e_{x}(\infty )=0}$  means that the difference between the state of the plant ${\displaystyle x(t)}$  and the estimated state of the observer ${\displaystyle {\hat {x}}(t)}$  tends to fade as time approaches infinity.

### Separation Principle

We have two equations:

${\displaystyle e_{x}[k+1]=(A-LC)e_{x}[k]}$
${\displaystyle x[k+1]=(A-BK)x[k]+BK\cdot e_{x}[k]}$

We can combine them into a single system of equations to represent the entire system:

${\displaystyle {\begin{bmatrix}e_{x}[k+1]\\x[k+1]\end{bmatrix}}={\begin{bmatrix}A-LC&0\\+BK&A-BK\end{bmatrix}}{\begin{bmatrix}e_{x}[k]\\x[k]\end{bmatrix}}}$

We can find the characteristic equation easily using the separation principle. We take the Z-Transform of this digital system, and take the determinant of the coefficient matrix to find the characteristic equation. The characteristic equation of the whole system is: (remember the well known ${\displaystyle (zI-A)^{-1}}$ )

${\displaystyle {\begin{vmatrix}zI-A+LC&0\\-BK&zI-A+BK\end{vmatrix}}=|zI-A+LC||zI-A+BK|}$

Notice that the determinant of the large matrix can be broken down into the product of two smaller determinants. The first determinant is clearly the characteristic equation of the estimator, and the second is clearly the characteristic equation of the plant. Notice also that we can design the L and K matrices independently of one another.

It is worth mentioning that if the order of the system is n, this characteristic equation (full-order state observer plus original system) becomes of order 2n and so has twice the number of roots of the original system.

### The L Matrix

You should select the L matrix in such a way that the error signal is driven towards zero as quickly as possible. The transient response of the estimator, that is the amount of time it takes the error to approximately reach zero, should be significantly shorter than the transient response of the plant. The poles of the estimator should be, by rule of thumb, at least 2-6 times faster then the poles of your plant. As we know from our study of classical controls, to make a pole faster we need to:

S-Domain
Move them further away from the imaginary axis (in the Left Half Plane!).
Z-Domain
Move them closer to the origin.

Notice that in these situations, the faster poles of the estimator will have less effect on the system, and we say that the plant poles dominate the response of the system. The estimator gain L can be computed using the dual of Ackerman's formula for selecting the gain K of the state feedback controller:

${\displaystyle L=\alpha _{e}(z)Q{\begin{bmatrix}0\\0\\\vdots \\1\end{bmatrix}}}$

Where Q is the observability matrix of the plant, and αe is the characteristic equation of your estimator.

This can be computed in MATLAB with the following command:

This operation can be performed using this MATLAB command:
acker
L=acker(A', C', K)';

where L is the estimator gain and K is the poles for the estimator.

### Composite System

Once we have our L and K matrices, we can put these together into a single composite system equation for the case of state-feedback and zero input:

${\displaystyle {\begin{bmatrix}x[n+1]\\{\bar {x}}[n+1]\end{bmatrix}}={\begin{bmatrix}A&-BK\\LH&A-BK-LH\end{bmatrix}}{\begin{bmatrix}x[n]\\{\bar {x}}[n]\end{bmatrix}}}$
${\displaystyle u[n]=-K{\bar {x}}[n]}$

Taking the Z-Transform of this discrete system and solving for an input-output relation gives us:

${\displaystyle {\frac {U(z)}{Y(z)}}=-K[zI-A+BK+LC]^{-1}L}$

Notice that this is not the same as the transfer function, because the input is on top of the fraction and the output is on bottom. To get the transfer function from this equation we need to take the inverse of both sides. The determinant of this inverse will then be the characteristic equation of the composite system.

Notice that this equation gives us the ability to derive the system input that created the particular output. This will be valuable later.

## Reduced-Order Observers

In many systems, at least one state variable can be either measured directly, or calculated easily from the output. This can happen in the case where the C matrix has only a single non-zero entry per system output.

If one or more state variables can be measured or observed directly, the system only requires a reduced-order observer, that is an observer that has a lower order than the plant. The reduced order observer can estimate the unmeasurable states, and a direct feedback path can be used to obtain the measured state values.

This page of the Control Systems book is a stub. You can help by expanding this page, but make sure to follow the local manual of style. If you would like to help, but you don't know how, you can ask on the main discussion page. (All Stubs)