Skip to content
Digital Control

Discrete observers and the separation principle

The prediction observer and its error dynamics proved, deadbeat observer with an example, current observer, the separation principle proved, disturbance estimation, the Kalman filter.

State feedback (lesson on deadbeat control) requires knowing the whole state, but usually only part of it is measured: the position and not the velocity, the temperature at one point and not in the whole furnace. The observer reconstructs the state from measurements and commands, using the model. In discrete time it is simply one more difference equation in the program. In this lesson we look at the prediction observer and the dynamics of its error, the deadbeat observer with an example, the current observer, the separation principle with its proof, disturbance estimation and the Kalman filter.

The prediction observer

The program knows the model x(k+1) = \Phi x(k) + \Gamma u(k), y = Cx, the commands it has issued and the measurements. It simulates the model in parallel with the process and corrects it with the difference between the measurement and its prediction:

    \[ \hat{x}(k+1) = \Phi\hat{x}(k) + \Gamma u(k) + L\big(y(k) - C\hat{x}(k)\big) \]

Theorem. The estimation error e = x - \hat{x} evolves according to

    \[ e(k+1) = (\Phi - LC)\,e(k) \]

regardless of the command.

Proof. Subtracting the observer equation from that of the process, the terms \Gamma u(k) cancel and what remains is e(k+1) = \Phi e(k) - L(Cx(k) - C\hat{x}(k)) = (\Phi - LC)e(k). ∎

If the eigenvalues of \Phi - LC are inside the unit circle, the estimate converges to the true state whatever the initial error. The problem of choosing L is the dual of state feedback: the eigenvalues of \Phi - LC are those of \Phi^T - C^TL^T, and they can be placed anywhere if the system is observable (Systems Theory lesson on observability). The same methods are used, including Ackermann’s formula applied to the pair (\Phi^T, C^T).

The deadbeat observer

Placing all the eigenvalues of \Phi - LC at zero, the error vanishes in n steps (by the same Cayley-Hamilton argument as in the previous lesson): after n measurements the state is known exactly, in the absence of noise.

Example. Double integrator with T = 1, measuring position only, C = \begin{bmatrix} 1 & 0 \end{bmatrix}. With L = (l_1, l_2):

    \[ \Phi - LC = \begin{bmatrix} 1 - l_1 & 1 \\ -l_2 & 1 \end{bmatrix} \]

with trace 2 - l_1 and determinant 1 - l_1 + l_2. To get the polynomial z^2 both must be zero: l_1 = 2, l_2 = 1. The matrix becomes \begin{bmatrix} -1 & 1 \\ -1 & 1 \end{bmatrix}, and its square is the zero matrix. After two position samples the observer knows the velocity too: it is, essentially, the difference quotient between two positions corrected for the effect of the command.

With noisy measurements such a fast observer amplifies noise; usually the observer poles are chosen 2 to 4 times faster than those of the controller, a compromise between speed and filtering.

The current observer

The prediction observer uses measurement y(k) to estimate x(k+1): the estimate of x(k) does not exploit the measurement that has just arrived. The current observer first makes a prediction and then corrects it with the measurement at the same instant:

    \[ \bar{x}(k) = \Phi\hat{x}(k-1) + \Gamma u(k-1),\qquad \hat{x}(k) = \bar{x}(k) + L_c\big(y(k) - C\bar{x}(k)\big) \]

The command computed from \hat{x}(k) reacts without a one-step delay, at the cost of having to do the computation between sampling and updating (lesson on implementation). It is the same prediction-correction structure as the Kalman filter.

The separation principle

Feedback from the estimated state
The process, described by Phi, Gamma and C, receives the command u and produces the measurement y. The observer, with gain L, receives u and y and produces the estimate x hat; gain K brings it back to the summing node with the reference, scaled by N.

The estimate is used in place of the state: u(k) = -K\hat{x}(k). Is it legitimate to design K and L separately?

Theorem (separation principle). With u = -K\hat{x} and the prediction observer, the closed-loop eigenvalues are the union of the eigenvalues of \Phi - \Gamma K and those of \Phi - LC.

Proof. Use as variables the state x and the error e = x - \hat{x}. Since \hat{x} = x - e:

    \[ x(k+1) = \Phi x - \Gamma K(x - e) = (\Phi - \Gamma K)x + \Gamma Ke \]

and by the previous theorem e(k+1) = (\Phi - LC)e. In matrix form:

    \[ \begin{bmatrix} x \\ e \end{bmatrix}(k+1) = \begin{bmatrix} \Phi - \Gamma K & \Gamma K \\ 0 & \Phi - LC \end{bmatrix}\begin{bmatrix} x \\ e \end{bmatrix}(k) \]

The matrix is block triangular, and its characteristic polynomial is the product of those of the diagonal blocks. ∎

The controller and the observer are thus designed independently. Beware, though: separation concerns the poles, not robustness. The stability margins of the whole can be much smaller than those of true state feedback, and must be checked.

Estimating disturbances

An unknown constant disturbance d at the input is modelled as an extra state that does not change, d(k+1) = d(k), with x(k+1) = \Phi x + \Gamma(u + d). If the augmented system is observable, the observer also estimates d, and the controller compensates it with u = -K\hat{x} - \hat{d}. The result is integral action obtained by another route, which extends to sinusoidal disturbances (with an oscillator in the disturbance model) and to other known shapes: this is the internal model principle.

The Kalman filter

When the process is subject to random disturbances and the measurements to noise, with known variances, there is an optimal gain L, which minimises the variance of the estimation error: the Kalman filter. The gain is obtained from a Riccati equation, dual to that of optimal control (lesson on LQ and predictive control), and automatically balances trust in the model and trust in the measurements: very noisy measurements give a small gain, an uncertain model gives a large gain. It is used everywhere: inertial and GPS navigation, battery state-of-charge estimation, target tracking.

Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
0
Would love your thoughts, please comment.x
()
x