1
$\begingroup$

I am working through some coursework on self-tuning control and part of one of the questions requires the use of the extended Kalman filter for joint parameter and state estimation. For completeness, my system in state-space form is (skip to "My Problem" if you want):

$x_{k+1} =A(\theta_{k})x_k + B(\theta_{k})u_k, \quad x_0=\bar{x_0}$ $y_k=C(\theta_{k})x_k+e_k$

Where $u_k$ is the system input, $y_k$ is the system output and $e_k$ is an uncoloured white noise sequence. Note that I only need to consider this measurement noise, i.e. the $\Gamma, v_k, q_k$ that might also be included are all considered to be zero. Also, (omitting "$k$"s for ease of reading):

$A(\theta)= \begin{bmatrix} 0 & -a_2 \\ 1 & -a_1 \end{bmatrix} \quad , \quad B(\theta)= \begin{bmatrix} b_1\\ b_0 \end{bmatrix} \quad , \quad C(\theta)= \begin{bmatrix} 0 & 1 \end{bmatrix}$

Where $a_i$ and $b_j$ are the coefficients of the $A(q^{-1})$ and $B(q^{-1})$ polynomials of an ARX system.

The extended state-space form is then:

$z_{k+1}=\mathcal{F}(z_k,u_k)$ $y_k=\mathcal{H}(z_k)+e_k$

Where:

$\mathcal{F}(z_k,u_k)= \begin{bmatrix} A(\theta_k)x_k+B(\theta_k)u_k\\ \theta_k \end{bmatrix} \quad, \quad \mathcal{H}(z_k)=C(\theta_k)x_k$

The EKF prediction step is then: $\hat{z}_{k|k-1}=\mathcal{F}(\hat{z}_{k-1|k-1},u_{k-1})$ $P_{k|k-1}=\mathcal{F}^*_{k-1}P_{k-1|k-1}\mathcal{F}^{*^T}_{k-1}$

And the correction step is: $L_k=P_{k|k-1}\mathcal{H}^{*^T}_{k}(\mathcal{H}^{*}_{k}P_{k|k-1}\mathcal{H}^{*^T}_{k}+\sigma^2_e)^{-1}$ $\hat{z}_{k|k}=\hat{z}_{k|k-1}+L_k[y_k-\mathcal{H}(\hat{z}_{k|k})]$ $P_k=(I-L_k\mathcal{H}^{*}_{k})P_{k|k-1}$

Where: $\mathcal{F}^*_{k-1}=\begin{bmatrix} A(\theta_{k-1|k-1}) & R_1\\ 0 & I \end{bmatrix} \quad , \quad \mathcal{H}^*_{k}=\begin{bmatrix} C(\hat{\theta}_{k|k-1}) & R_2 \end{bmatrix}$

With the Jacobians $R_1=\frac{\partial[A(\theta_k)x_k+B(\theta_k)u_k]}{\partial\theta_k}\bigg|_{\hat{z}_{k-1|k-1}}$ $R_2=\frac{\partial C(\theta_k)}{\partial\theta_k}\bigg|_{\hat{\theta}_{k|k-1}}$

My Problem

I have performed the partial differentiation to find the Jacobians $R_1$ and $R_2$, and thus tried to build $\mathcal{H}^{*}_{k}$ and $\mathcal{F}^{*}_{k}$, but I have made an error somewhere that I cannot find! I have:

$R_1=\begin{bmatrix} 0 & -x_{2,k}\\ -x_{2,k} & 0\\ 0 & u_k\\ u_k & 0 \end{bmatrix}\bigg|_{\hat{z}_{k-1|k-1}} \quad , \quad R_2=\begin{bmatrix} 0 & 0 & 0 & 0\\ 0 & 0 & 0 & 0 \end{bmatrix}\bigg|_{\hat{\theta}_{k|k-1}}$

But this $R_2$ does not allow the construction of $\mathcal{H}^*_{k}$ since it and $C(\theta_k)$ are of different size. (I'm not very familiar with partial differentiation of vectors, so it's entirely possible I have made errors in finding both $R_1$ and $R_2$!)

  • 0
    OK, mystery solved. There is an error in the text that I have used for my reference for the EKF for calculating $R_2$. The correct version is of the form: $R_2=\frac{\partial [C(\theta_k)x_{k|k-1}]}{\partial\theta_k}\bigg|_{\hat{\theta}_{k|k-1}}$ this then gives the 1x4 result that I'm after. The answer is therefore that there was a typo in my reference material! (If someone can tell me how to mark this answered I will do so!)2011-05-03

0 Answers 0