## Saturday, September 27, 2014

### A state estimation example: GPS aided Altimeter. Part two.

In the previous article  we began the description of a telemetry application for altitude measurement.
We've briefly introduced LTI systems and state observers.

In this post we will examine a one degree of freedom inertial unit. With such a unit it will be possible to directly measure altitude variations. Accompanying scripts for Matlab and Scilab are provided as downloads.
The use of inertial units requires considering the mounting position, as explained in this article.

Let's pretend we want to measure the altitude variation of our aircraft using the measurements from an accelerometer. To obtain an initial value, we define an arbitrary, zero-reference position and an altitude direction. The altitude value from the reference is $$z(t)$$ , velocity is $$v(t)$$ and acceleration $$a(t)$$. From now on, assume that the acceleration measurements are always aligned with $$z$$-axis, which is as if we modelled a simple flat fall but this hypothesis allows us to focus on a specific problem. In a real-word case, other measurements from the rest of the axes of the inertial unit should be used to get the correct acceleration value.

Figure 1 Error variance Vs time for example system, initial variance set to zero
The kinematic equations of our system are:
$$\dot{z}(t)=v(t)$$
$$\dot{v}(t)=a(t)$$
The measurement system cannot be considered deterministic, since it is prone to measurement errors. We model the accelerometer output as:
$$\hat{a}(t)=a(t)+b(t)+\mu_a(t)$$
$$b(t)$$ term represents the random walk of the sensor (Paragraph 3.2.2) and $$\mu_a(t)$$ is a Gaussian white noise with given variance $$\sigma^2_{\mu_a}$$. The latter term aggregates different kinds of uncertainty sources such as thermal noise.

Random walk noise is defined as $$\dot{b}(t)=\omega_b(t)$$ where $$\omega_b(t)$$ is Gaussian with given  $$\sigma^2_{\omega_b}$$. The average value of $$b(t)$$ is zero.

It is interesting to note that while a constant accelerometer error $$\epsilon$$ (Paragraph 4.2.1) leads to an error term equal to $$\epsilon t^2/2$$, that constant error can be eliminated with an accurate calibration, hence it is not that interesting to take into account and examine.

If we wanted to reconstruct the aircraft altitude based solely on the accelerometer readings and the zero initial altitude assumption, the observed altitude would be:
$$\dot{\hat{z}}(t) = \hat{v}(t)$$
$$\dot{\hat{v}}(t) = \hat{a}(t)$$
$$\boldsymbol{x}=\begin{bmatrix} \hat{z}\\ \hat{v}\\ \hat{b} \end{bmatrix}$$
$$\dot{\hat{z}}(t)=\hat{v}(t)$$
$$\dot{\hat{v}}(t)=\hat{a}(t)$$
$$\dot{\hat{b}}(t)=0$$
As we are interested in error dynamic  we define a new error state variable $$\delta\boldsymbol{x}(t)=\boldsymbol{x}-\boldsymbol{\hat{x}}$$
$$\delta\boldsymbol{x}(t)=\boldsymbol{A}\delta x(t) +\boldsymbol{B}\begin{bmatrix}\mu_a \\ \omega_b \end{bmatrix}$$
General definition of process noise covariance for a continuous system is $$cov(\boldsymbol{\omega}(t), \boldsymbol{\omega}(\tau))=\boldsymbol{Q}(t)\delta(t-\tau)$$
Defining $$\boldsymbol{\Phi}(\tau)=exp(A\tau)$$
The state error covariance is [2]
$$\boldsymbol{P}_x(t)=\boldsymbol{\Phi}(t)\boldsymbol{P}_x(0)\Phi^T(t)+\int_0^{\tau} \boldsymbol{\Phi}(t)\boldsymbol{B}\boldsymbol{Q}\boldsymbol{B}^T\Phi^T(t)d\tau$$
This is one of the rare cases where solution can be calculated in a closed form, terms with subscript 0 denotes initial value.
$$P_P(t)=(P_{p0}+P_{v0}t^2+P_{b0}t^4/4)+(\sigma^2_{\omega_v}t^3/3+\sigma^2_{\omega_b}t^5/20)$$
$$P_v(t)=(P_{v0}+P_{b0}t^2)+(\sigma^2_{\omega_v}t+\sigma^2_{\omega_b}t^3/3)$$
$$P_b(t)=P_{b_0}+\sigma^2_{\omega_b}t$$
Let's set $$\sigma_{\mu_a}$$  or velocity random walk to a value of $$5e-3 \frac{m/s}{\sqrt{s}}$$ ,  $$\sigma^2_{\mu_a}=2.5e-5\frac{m^2}{s^3}$$  and $$\sigma^2_{\omega_b}=1e-6\frac{m^2}{s^5}$$.

As expected and plotted in Figure 1, the use of an inertial sensor alone, leads to an unacceptable altitude error in a few seconds. In the next post this inertial unit will be coupled with a GPS to provide an enhanced measurement. The primary objective is to constrain the error value within bound limits.
References:
1 A.Leon-Garcia (1994), Probability and Random Processes for Electrical Engineering, Prentice Hall
2. Jay A.Farrell (2008), Aided Navigation, Mc Graw Hill
{"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 2, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0}