Extended Kalman Filter : Measurement Matrix

In summary: It seems that you are trying to use the state vector x as an input to the EKF, but you do not have the function h(x). You need to read up on the EKF before you try to use it, and find a book that will explain it to you in more detail.
  • #1
mikedamike
28
0
Hi,

I am currently learning and trying to build an extended kalman filter. However I am not sure how to created the measurement matrix. The measurement matrix H is described using formula 3.6 on page 18 of this document

http://www.scribd.com/doc/54702247/UAV-Design

My problem is that i do not understand how to operate that formula or what data i need to operate it. Is there anyone who could make sense of the equation and explain it to me.

Thanks in advance.
 
Last edited by a moderator:
Physics news on Phys.org
  • #2
mikedamike said:
My problem is that i do not understand how to operate that formula

That link leads to a series of pages, so it isn't clear what formula you mean. Can you give a link to a version of that document as a PDF or something easier to read?
 
  • #3
Sorry about that. I think this link will take you to the correct page. Its equation 3.7

http://www.scribd.com/doc/54702247/UAV-Design#page=21

Thanks for the reply.
 
Last edited by a moderator:
  • #4
Dear mikedamike, it's quite similar to the ordinary KF. In the case of EKF, you don't have a simple explicit form of the matrix but there is a function. If you have possibility to read Simon's Optimal state estimation, kalman filters, H_inf filter and nonlinear approaches, there is a nice worked example.
 
  • #5
Hi camillio,
Thanks for your reply. I have got the book you recommended and have only had a quick skim over it. Just to clarify am i right in assuming to calculate

h(xk)

i would simply use the linear function

Hxk

Where this implies that h(xk) in the EKF it is expressed as a nonlinear function but the EKF operates the function as a linear function?
 
  • #6
Well, I'd better say that you linearize [itex]h(x) [/itex] around [itex]x_k[/itex] using the Taylor expansion, e.g. (Simon eq. 13.41) and then you operate on a linear function. I'm not sure that its exactly what you were meaning to say in your last post. However, I suggest to read that book or the related chapter, it will make you really master the topic :-)
 
  • #7
Im still really struggling on my original question. I realize i need to make the measurement matrix using the state vector. Using the below equation basically implies that the matrix is essentially created by dividing x/x which i got from

Hk = [itex]\frac{∂ h(x)}{∂ x}[/itex]

i think linerize Hk using taylor series.

Please correct me if my logic is incorrect.

The 5 element state vector for the system is x = [ q p r α β ]
The vector is updated using the sensors of an aircraft.

For purpose of example x = [ 2 4 3 5 9 ]

therefore my H matrix would be

[itex]\frac{2}{2}[/itex][itex]\frac{2}{4}[/itex][itex]\frac{2}{3}[/itex][itex]\frac{2}{5}[/itex][itex]\frac{2}{9}[/itex]

[itex]\frac{4}{2}[/itex][itex]\frac{4}{4}[/itex][itex]\frac{4}{3}[/itex][itex]\frac{4}{5}[/itex][itex]\frac{4}{9}[/itex]

[itex]\frac{3}{2}[/itex][itex]\frac{3}{4}[/itex][itex]\frac{3}{3}[/itex][itex]\frac{3}{5}[/itex][itex]\frac{3}{9}[/itex]

[itex]\frac{5}{2}[/itex][itex]\frac{5}{4}[/itex][itex]\frac{5}{3}[/itex][itex]\frac{5}{5}[/itex][itex]\frac{5}{9}[/itex]

[itex]\frac{9}{2}[/itex][itex]\frac{9}{4}[/itex][itex]\frac{9}{3}[/itex][itex]\frac{9}{5}[/itex][itex]\frac{9}{9}[/itex]

Then i would just linearize the above using a taylor series.

Have i got this right or completely wrong?
 
Last edited:
  • #8
Sorry about this camillio. I understand that h(x) gets linearized to operate kalman functions on but i guess what I am trying to ask is given a state vector x=[q p r a b] where the measurements are extracted from sensors how would the measurement matrix be constructed using the following formula Hk = ∂h(x)/∂x
 
  • #9
Nevermind mikedamike. The steps are:
(i) differentiate the function [itex]h[/itex] wrt [itex]x[/itex]. It is the same as computing Jacobian! You have [itex]H_k[/itex];
(ii) put values of [itex]x_k[/itex] into [itex]H_k[/itex];
(iii) run filter update.

I really propose to consult the book, in Ex. 13.3 you can see how measurement equation looks like, how linearized [itex]H[/itex] looks and notice the its dimension and [itex]x_1[/itex] element in it. That's where you put value of the estimated [itex]x_1[/itex].

Hope it helps.
 
  • #10
Well, in addition to that post - I hope you know that you must have the function [itex]h(x)[/itex]. It seems to me that you are playing just with "some" matrix (and call it [itex]H[/itex]), but you don't have mentioned a particular form of [itex]h[/itex].
 
  • #11
This is it, I am confused as i do not have the function of h(). The book defines the function for f() in the system dynamics matrix but not for h(). it does however describe a measurement vector y which is identical to the state vector. I don't know what this means i thought it implied that the measurements where identical to the state vector.
 
Last edited:
  • #12
Hm, now I'm really lost. Can you send me which book and which page/problem? It is quite straightforward to express *regression* models as special forms of the Kalman filter and your last post resembles that, but I really doubt this is what your problem is about.
 
  • #13
The book is called fault tolerant flight control and guidance systems by Guillaume J.J. Ducard. The pages of interest in the book 52-59 with the ekf vectors expressed on 49. I cannot upload the book because the file size is too big. If you would like me to get you an electronic copy i can do so.
 
  • #14
Hm, I've read through the pages and haven't found any particular form of [itex]h[/itex]. The same applies to [itex]f[/itex], but may be it's derived using "an expert's knowledge". Maybe previous pages, or so? In any case, I do not like the superficially theoretic but deeply (and incomprehensibly) applied treatment of EKF in this book :-(

I regret, mikedamike, can't provide better news.
 
  • #15
I've only looked at the abstract definition of the measurement function. It seems to me that the function (obviously) depends on what your sensors measure. For example, suppose you have an accelerometer mounted on the right wingtip. What this accelerometer measures is probably not a state variable of the UAV. However, if you know the other state variables of the air craft (heading, acceration of roll angle etc.) you can write what this sensor ought measure in terms of those state variables. How to write this equation does involve expert knowledge of mechanics. To the deterministic equation for this variable, you add a term representing noise.

If my thoughts are correct, you shouldn't expect to find any "standard" set of measurement equations for a UAV, unless there is some "standard" set of sensors defined for UAVs.
 
  • #16
Is it at all possiable that f(x) is equal to x=[q p r a b] ?

By this i am saying that any function required on the elements of X have already occurred (or possiably need not occur) and therefore the filter runs as f(x) is equal to x = [q p r a b]

Sorry for belated reply
Regards

mike
 
  • #17
mikedamike said:
Is it at all possiable that f(x) is equal to x=[q p r a b] ?

It would be easier to make sense of this discussion if you defined the problem in a self contained way within a post. I don't have the book that's been mentioned and I find the Scribd user interface to be as irritating and useless as the Google books user interface.

I don't know what [q p r a b] denotes or what "f(x)" denotes. In my last post, I'm referring to the vector valued measurement function, which I think we are denoting by H(x) where x are the state variables. I'm saying that the jth component of H(x) would be what the jth sensor measures. Sensors may or may not directly measure the state variables. For example, the state variables of a UAV might include such things as the x,y and z components of the acceleration of the center of mass and the rate of change of the roll, pitch and yaw. They might not include the z acceleration component of the right wingtip. The state variables x are supposed to give us a complete description of the condition of the UAV. We can calculate the z acceleration of the right wingtip from the state variables. The function that does this calculation would be the component of H(x) corresponding to that sensor.

In a real world situation for a UAV, it is unlikely that you would have a sensor that directly measured each state variable, so it is unlikely that H(x) would be equal to the vector of state variables.
 
  • #18
Hi I am sorry about re-using this out dated post. I realize you don't have the book. In that book it does define a systems dynamics matrix (Fk) and a control matrix (Gk) with equations and expresses that it should be evaluated with X (this to me means solve).

it defines the plant as

X' = f(x,u) <- this is the non linear plant

It then states that equation X' = f(x,u) is linearized using Euler integration equation

Xk+1 = Fk xk + Gk uk + wk

Therefore could i be correct in saying that f(x) is achieved by evaluating the system dynamics matrix with the state vector

Sorry to be a pain
Thanks for your patience
 
  • #19
mikedamike said:
it defines the plant as

X' = f(x,u) <- this is the non linear plant

Is x the vector of state variables and is u the vector of noise variables?

It then states that equation X' = f(x,u) is linearized using Euler integration equation

Xk+1 = Fk xk + Gk uk + wk

I suppose this means that we implement Euler's method for approximation the solutions to a differential equation. http://en.wikipedia.org/wiki/Euler_method
Therefore could i be correct in saying that f(x) is achieved by evaluating the system dynamics matrix with the state vector

It's hard to quarrel with verbal generalities!

If X' is "the system dynamics matrix" and this consists of the partial derivatives of the state variables with respect to the other state variables then applying Euler's method of approximating a differential equation would involve steps of evaluating the matrix X' at the values of state variables x and the noise variables u at time t and using the resulting value of the matrix X' to estimate the value of the state variables x at a later time t+h.

Was that the question?
 
  • #20
Last edited:
  • #21
My display just hangs at "loading..." when I scroll up. It isn't worth the trouble.

If this is an academic project, you're going to have do some sort of write-up eventually, aren't you? How do you intend to write the equations? Get started writing the problem up. The effort won't be wasted.
 
  • #22
honestly i really need to learn the concept I am getting there its just a few things i need clarification on
 
  • #23
My preview of the book in Google Books doesn't include a page 52. (And don't refer to the page by the page number that's marked on the page itself, refer to it by the page that's shown at the top of the Google Books' screen.)
 
  • #24
it will start on pg 234 scroll up 2 pages and it jumps to page 61. page 52 is my interest where 52 of book page = 52 of page number in google books.

regards
mike
 
  • #25
My view of the book doesn't behave as you described. I don't get page 52 as part of my preview. Perhaps each person who views a book that is incompletely presented gets to see a randomly selected part of the book that is a function of his IP address or something like that.
 

1. What is the purpose of the measurement matrix in an Extended Kalman Filter?

The measurement matrix in an Extended Kalman Filter is used to map the predicted state of a system to the measured state. It helps to incorporate sensor measurements into the filtering process and improve the accuracy of the estimated state.

2. How is the measurement matrix different from the state transition matrix in an Extended Kalman Filter?

The state transition matrix describes how the state of a system evolves over time, while the measurement matrix describes how the predicted state is related to the measured state. The state transition matrix is based on the underlying physics of the system, while the measurement matrix is based on the sensor measurements.

3. Can the measurement matrix be time-varying in an Extended Kalman Filter?

Yes, the measurement matrix can be time-varying in an Extended Kalman Filter. This is often the case when dealing with nonlinear systems, where the relationship between the predicted state and the measured state may change over time.

4. What is the difference between the measurement matrix and the observation matrix in an Extended Kalman Filter?

The measurement matrix is used in the prediction step of the Extended Kalman Filter to map the predicted state to the measured state. The observation matrix, on the other hand, is used in the update step to map the state prediction error to the measurement residual. In linear systems, the measurement matrix and observation matrix are often the same, but in nonlinear systems, they are different.

5. How is the measurement matrix chosen in an Extended Kalman Filter?

The measurement matrix is chosen based on the type of sensors used to measure the system state. It should be designed to capture the relationship between the predicted state and the measured state accurately. This can be done through system identification techniques or using prior knowledge of the system's dynamics.

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
1
Views
747
  • Engineering and Comp Sci Homework Help
Replies
1
Views
808
Replies
6
Views
2K
Replies
2
Views
2K
  • General Engineering
Replies
4
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
2K
  • General Engineering
Replies
1
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
984
  • Mechanical Engineering
Replies
5
Views
1K
Replies
3
Views
3K
Back
Top