Summary
For the dynamical system given below, which defines a Luenberger observer, how does one explicitly obtain a value for the observer gain, $L$?
$\hat{x}(k+1) = A \hat{x}(k) + B u(k) + L[y(k) - \hat{y}(k)]$
$\hat{y}(k) = C \hat{x}(k)$
Are my assumptions and understanding in parts 1. - 5. below correct?
Context
Part of a colleague's work is a review on fault detection techniques. They wish to give the reader some insight into when it is appropriate to consider certain fault detection methods, and to give a high-level explanation as to why choices in certain papers worked well or were, in other cases, ill-informed. They asked me if I could provide some mathematical insight in some areas.
One of the most basic model-based methods for doing this work uses state observers.
From Wikipedia:
The state of a linear, time-invariant physical discrete-time system is assumed to satisfy
$x(k+1) = A x(k) + B u(k)$
$y(k) = C x(k) + D u(k)$
In order to make my question easier to answer I want to establish what the pertinent variables are and what they represent. We also make some modifications to the notation and a simplifying assumption:
- $x$ represents a state variable that, in the application domain, cannot be directly observed or measured.
- For known-input observers $u$ represents a state variable for which all of the values of $u(k)$ are known.$^1$
- $y$ represents a state variable that, in the application domain, is an 'output' measured at each $k$. This, practically speaking means that we know all the values of $y(k)$.
- We use a carat to denote estimated variables.
- For the application in question it is often assumed that $D=0$.
We make a distinction between the true value of the variables and the values that we estimate during our calculation:
$\hat{x}(k+1) = A \hat{x}(k) + B u(k)$
$\hat{y}(k) = C \hat{x}(k)$
$u$ is known without error at each time step, and in a practical sense we measure it to determine this value. We can only know $x$ without error if $x(0)$ is known without error, and the state space matrices $A$, $B$, and $C$, are known without error. In practice this never happens. Hence the above form of the equations which acknowledge that as we calculate $x$ and $y$, we will only have approximations of the true values; $\hat{x}$ and $\hat{y}$.
Our goal is to compare the estimated value $\hat{y}$ to the known value $y$. If the two values differ then we know that a measurement error has occurred (that is, the value of $y$ which we assumed was a correct representation of the system's behaviour is actually incorrect due to a measurement error), or that the system behaviour has changed unexpectedly (the values in $A$, $B$, and $C$ have changed, new terms have been added, the system has become non-linear or completely different).
The method for deciding that the values are sufficiently different for sufficiently long is not important, I don't think.
$^1$There is a class of observers, unknown-input observers, for which this is not the case, but that is not what is being asked about here.
My Understanding, Assumptions, and Questions
So, the first method I want to get a handle on is the Luenberger observer. The Luenberger observer seems to have been developed for control purposes as a way to make control systems tolerent to noise and changes in uncontrolled inputs, but the literature on fault detection definitely describes them as useful for detecting certain faults. In the Luenberger observer we have:
$\hat{x}(k+1) = A \hat{x}(k) + B u(k) + L[y(k) - \hat{y}(k)]$
$\hat{y}(k) = C \hat{x}(k)$
Again, from Wikipedia:
The observer is called asymptotically stable if the observer error $e(k) = \hat{x}(k) - x(k)$ converges to zero when $k \rightarrow > \infty$. For a Luenberger observer, the observer error satisfies $e(k+1) = (A - LC) e(k)$. The Luenberger observer for this discrete-time system is therefore asymptotically stable when the matrix $A-LC$ has all the eigenvalues inside the unit circle.
So the understanding/intuition I have here is as follows, I'm relatively confident in this but would appreciate it if anyone has corrections or extensions:
- We have a dynamical system, $x(k+1) = A x(k) + B u(k)$. The 'visible' (measurable) outputs of this system are given by $y(k) = C x(k)$.
- Our model of the system is not perfect, so we compute an estimated $\hat{y}(k)$, and we compare it to the measured value of $y(k)$.
- If $\hat{y}(k)$ and $y(k)$ are sufficiently different for some definition of 'sufficiently different' we can conclude that either our measurement of $y(k)$ was erroneous, or that the model which was used to calculate $\hat{y}(k)$ became intolerably inaccurate at some point. We use this as a basis to detect different kinds of faults.
- By adding the term $L[y(k) - \hat{y}(k)]$ to the first equation we have introduced a kind of feedback loop into the model. If either of the error types occur and $y(k) - \hat{y}(k) \neq \vec{0}$ then this will affect our calculation of $x(k+1)$, which in turn can (but might not, depending on L) affect our calculation of $\hat{y}(k+1)$.
There is a lot in the literature about properties of $L$, and inequalities or equalities that $L$ must satisfy. Wikipedia gives the example $A-LC$ has eigenvalues inside the unit circle. I have found many other relations for different situations and different forms of dynamical systems, but I have thus far failed to find any explanation of how to actually choose $L$.
- I assume that $L$ must be chosen such that 'expected' problems (such as noise or changes in $u$) in the model are removed or compensated for, so that a family of $y(k) - \hat{y}(k)$ will produce a $y(k+1) - \hat{y}(k+1)$ within this family such that $|y(k+1) - \hat{y}(k+1)| < |y(k) - \hat{y}(k)|$.
That is, for some family of residuals this system should remain stable. This is desireable from a control perspective and it translates relatively well to fault detection since we wish to be tolerant of noise and changes in system inputs.
Any remaining $y(k) - \hat{y}(k)$ will cause successive values of $|y(k') - \hat{y}(k')|$ for $k'>k$ to be larger and larger. This would make 'expected' deviation from the model unimportant and magnify error since our estimated values $\hat{x}$ and $\hat{y}$ would likely diverge from normal. From a control perspective this would be unfortunate but completely expected behaviour given that the practical equivalent of this is a sensor failure or process fault. From the perspective of fault detection we can use this divergence to infer the existence of the failure.
I base this assumption on nothing other than how I would use/implement this idea, and have no idea if it is correct.
Are assumptions 1. - 5. correct?
With respect to 5. in particular, if it is incorrect, what is the correct intuition?
How does one actually choose an $L$ that has the desired behaviour outlined in 5. or a version of 5. that presents the correct intuition, if 5. is incorrect?