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
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:
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 . We define this error signal as:
and its derivative:
We can show that the error signal will satisfy the following relationship:
We know that if the eigenvalues of the matrix (A + LC) all have negative real parts that:
- when .
This means that the difference between the state of the plant and the estimated state of the observer tends to fade as time approaches infinity.
We have two equations:
We can combine them into a single system of equations to represent the entire system:
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 )
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:
- Move them further away from the imaginary axis (in the Left Half Plane!).
- 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.
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:
L=acker(A', C', K)';
where L is the estimator gain and k is the poles for the estimator.
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:
Taking the Z-Transform of this discrete system and solving for an input-output relation gives us:
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.
Consider a linear feedback system with no reference input:
where K is a vector of gain elements. Systems of this form are typically referred to as regulators. Notice that this system is a simplified version of the one we introduced above, except that we are ignoring the reference input. Substituting this into the state equation gives us:
Ackerman's Formula gives us a way to select these gain values K in order to control the location's of the system poles. Using Ackerman's formula, if the system is controllable, we can select arbitrary poles for our regulator system.
where a(z) is the desired characteristic equation of the system and ζ is the controllability matrix of the original system. The goal of this type of regulator is to drive the state vector to zero. By using a reference input instead of a linear state feedback, we can use the same kind of idea to drive the state vector to any arbitrary state, and to give the system arbitrary poles.
The idea of the system above with a linear feedback and no reference input is to drive the system state vector to zero. If we have a system reference input r, we can define a vector N that is the desired value for our state. This combined input is equal to:
where xr is the reference state we want our state x to reach. Here is a block diagram of a system that uses this kind of state reference:
We have our gain matrix, K, and our reference input rN. Mathematically, we can show that:
In this system, assuming the system is type 1 or higher, we can prove that
The state will approach the reference state as time approaches infinity.
The Reference Input is calculated in the continuous domain using the below equations:
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.