Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Extended Kalman Filter : Measurement Matrix

  1. Mar 21, 2012 #1

    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 [Broken]

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

    Thanks in advance.
    Last edited by a moderator: May 5, 2017
  2. jcsd
  3. Mar 21, 2012 #2

    Stephen Tashi

    User Avatar
    Science Advisor

    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?
  4. Mar 21, 2012 #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 [Broken]

    Thanks for the reply.
    Last edited by a moderator: May 5, 2017
  5. Mar 21, 2012 #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.
  6. Mar 22, 2012 #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


    i would simply use the linear function


    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?
  7. Mar 22, 2012 #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 :-)
  8. Mar 22, 2012 #7
    Im still really struggling on my original question. I realise 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






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

    Have i got this right or completely wrong?
    Last edited: Mar 22, 2012
  9. Mar 22, 2012 #8
    Sorry about this camillio. I understand that h(x) gets linearized to operate kalman functions on but i guess what im 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
  10. Mar 23, 2012 #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.
  11. Mar 23, 2012 #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].
  12. Mar 23, 2012 #11
    This is it, im 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 dont know what this means i thought it implied that the measurements where identical to the state vector.
    Last edited: Mar 23, 2012
  13. Mar 23, 2012 #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.
  14. Mar 23, 2012 #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.
  15. Mar 24, 2012 #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.
  16. Mar 27, 2012 #15

    Stephen Tashi

    User Avatar
    Science Advisor

    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 knowlege 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.
  17. Apr 3, 2012 #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

  18. Apr 3, 2012 #17

    Stephen Tashi

    User Avatar
    Science Advisor

    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 dont 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.
  19. Apr 3, 2012 #18
    Hi Im sorry about re-using this out dated post. I realise you dont 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
  20. Apr 3, 2012 #19

    Stephen Tashi

    User Avatar
    Science Advisor

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

    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

    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?
  21. Apr 3, 2012 #20
    Last edited: Apr 3, 2012
  22. Apr 3, 2012 #21

    Stephen Tashi

    User Avatar
    Science Advisor

    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.
  23. Apr 3, 2012 #22
    honestly i really need to learn the concept im getting there its just a few things i need clarification on
  24. Apr 3, 2012 #23

    Stephen Tashi

    User Avatar
    Science Advisor

    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.)
  25. Apr 3, 2012 #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.

  26. Apr 3, 2012 #25

    Stephen Tashi

    User Avatar
    Science Advisor

    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.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook