8.3. State Observers¶
In many practical cases it is not possible to measure all the states of a system.
That is we cannot form \(u=r-\mathbf{Kx}\) for the purposes of feedback control because we do not have access to \(\mathbf{x}\).
If we know \(\mathbf{A}\), \(\mathbf{B}\), \(\mathbf{C}\), and \(\mathbf{D}\) then it may be possible to reconstruct the states from one or more of the system outputs by means of an observer.
It is necessary that the system states be observable from the output(s).
8.3.1. State Observer¶
The main idea is to construct a model of the system and subject it to the same input:
Severe differences occur between \(\mathbf{x}\) and \(\hat{\mathbf{x}}\) due to disturbances and parameter errors. Solution:- Employ feedback !
NB To simplify treatment, we take \(\mathbf{D}=0\).
8.3.2. State Observer with Feedback¶
8.3.3. Observer state equations¶
For the observer we have the state equations:
8.3.4. Observed State Errors¶
Let the error in the estimated states \(\hat{\mathbf{x}}\) be:
then
Given,
then
8.3.5. Properties of the Observed Error State Equations¶
These are the state equations for the observer error.
The errors decay to zero with time if the eigen values of \((\mathbf{A}-\mathbf{LC})\) lie in the left half plane (LHP).
In fact we can design the matrix \(\mathbf{L}\) to place the eigen values anywhere we wish
If we place them well into the LHP then \(\mathbf{e}\) will decay quickly to zero making the observer states accurately track the system states \(\mathbf{x}\) after a short time.
\(\hat{\mathbf{x}}\) can then be used for feedback control.
8.3.6. Design of the L Matrix¶
This is particularly easy when we use the observer canonical form.
Given the TF:
the matrices of the state space model are:
and the feedback vector is:
The state matrix of the observer is:
The poles of the observer are the roots of the CE:
If the desired observer poles are at \(s=p_1,p_2,\ldots,p_n\) then the desired CE equation is:
The \(l\) coefficients may be found by matching the two equations above. Thus,
8.3.6.1. In-Class Example 1¶
Problem: Design an observer with poles or eigen values \(\lambda_{1,2} = -20,\ -20\) using the observer canonical form for the system with a TF:
SOLUTION: The observer canonical form gives:
with \(\mathbf{L}=[l_1,\ l_2]^T\) we have observer poles at the roots of:
The desired CE is:
Comparing coefficients gives:
So the observer states are given by:
where \(\mathbf{L}=[25\ 356]^T.\)
8.3.6.1.1. Block Diagram of the Observer¶
8.3.7. Design of L Matrix for Other Forms of State Equation¶
When the observer canonical form is not used, then the design of the observer is more difficult. Ackermann’s formula can be adapted as follows:
\(\mathcal{O}\) is the observability matrix:
and if \(\alpha_e(s)=s^n + \alpha_1s^{n-1}+\cdots+\alpha_n\) then
Notice that if the system is unobservable, then the matrix inverse \(\mathcal{O}^{-1}\) does not exist and we cannot design an observer for this system.
In MATLAB we could evaluate the \(\mathbf{L}\) matrix using:
L=acker(A',C',p)'
where p
is a vector of desired observer poles.
8.3.8. Choice of Observer Poles¶
Rule of thumb: observer poles can be faster than the open-loop system poles (i.e. further from the origin) by a factor of 2 to 6. This makes the effect of the observer dynamics short-term and the overall response is dominated by the system poles.
If noise/disturbance is present this has an effect on the choice:
Process noise \(w\): \(d\mathbf{x}/dt=\mathbf{Ax}+\mathbf{B}u+\mathbf{B}_1 w\)
Sensor noise \(v\): \(y = \mathbf{C}x+v\)
Observer: \(d\hat{\mathbf{x}}=\mathbf{A}\hat{\mathbf{x}}+\mathbf{B}u+\mathbf{L}(y-\mathbf{C}\hat{\mathbf{x}})\)
Error \(\mathbf{e}=\mathbf{x}-\hat{\mathbf{x}}\): \(d\mathbf{e}/dt=(\mathbf{A}-\mathbf{LC})\mathbf{e}+\mathbf{B}_1 w - \mathbf{L}v.\)
In the error equation, the sensor noise is multiplied by \(\mathbf{L}\) and the process noise is not. Therefore,
if \(\mathbf{L}\) is very small, the effect of sensor noise \(v\) is removed but the observer is “slow” to respond, so that the error will not reject the effect of \(w\) very well.
if \(\mathbf{L}\) is large, the observer response is “fast” and the error rejects the process noise \(w\) well, but the sensor noise \(v\) is amplified by \(\mathbf{L}\) resulting in large errors.
Optimal control design methods can be used to achieve the “best” compromise.
8.3.9. Footnote¶
Or some states in \(\mathbf{x}\), either because the states are not physical states and hence cannot be measured, or because they are physical states but we do not have suitable sensors for the physical quantity that is represented by the state.