Reply by quadrotor October 3, 20062006-10-03
Hey again,

After many hours of reserach I have come to the conclusing that the Kalman
filter in the code is a continuous/discrete implementation which utilizes
equation from the continuous and discrete Kalman filter. Can anyone give
me any links or informatin on this type of Kalman filter??

Cheers
Reply by Peter K. October 2, 20062006-10-02
quadrotor wrote:

> More useful info that maybe somebody can explain. what is a state function > as apposed to the state vector??
The state vector is simply a vector of the variables that make up the state of your system. The state function (from what you quoted) is the functional relationship between the state variables. Ciao, Peter K.
Reply by quadrotor October 2, 20062006-10-02
More useful info that maybe somebody can explain.  what is a state function
as apposed to the state vector??  
QUOTED:

* Our state vector is:
 *
 *	X = [ angle, gyro_bias ]
 *
 * It runs the state estimation forward via the state functions:
 *
 *	Xdot = [ angle_dot, gyro_bias_dot ]
 *
 *	angle_dot	= gyro - gyro_bias
 *	gyro_bias_dot	= 0
 *
 * And updates the covariance matrix via the function:
 *
 *	Pdot = A*P + P*A' + Q
 *
 * A is the Jacobian of Xdot with respect to the states:
 *
 *	A = [ d(angle_dot)/d(angle)     d(angle_dot)/d(gyro_bias) ]
 *	    [ d(gyro_bias_dot)/d(angle) d(gyro_bias_dot)/d(gyro_bias) ]
 *
 *	  = [ 0 -1 ]
 *	    [ 0  0 ]
 *
Reply by Peter Nachtwey October 2, 20062006-10-02
quadrotor wrote:
> > This is my main question but I am also wondering how the A matrix is > derived. > > Anybody got any ideas at all?? I am completly lost and confused.
Me too now. I looked at the code and A is defined in the continuous domain and must be converted to the discrete domain to use. Ac = [ 0 , -1 ; 0, 0 ] Ad = expm(Ac*dt) Ad= [1, -dt; 0 , 1 ] Now Ad can be used to calculate x(n+1) = Ad*x(n). I don't see where the continuous A ( Ac ) is being converted to the discrete A ( ad ) in your C code. Peter Nachtwey
Reply by quadrotor October 2, 20062006-10-02
Just a clarification. When I write A' I mean A transposed. A few posters
thought I meant inverse when I put a "'".
Reply by Peter Nachtwey October 2, 20062006-10-02
Trond Danielsen wrote:
> quadrotor wrote: > > [...] > > > > The introductory papers however all use the update equation: > > P=A*P*A'+Q > > > > Why is the derivative used and where does that equation come from? I > > havent been able to find anything on it. There doesnt seem to be a lot of > > info around on the net and Kalman filtering seems to be something that not > > many people have an understanding of. > > > > A' is not the derivative of A, it is the inverse of matrix A.
I totally missed the A' and didn't understand what quadrotor was asking because he didn't specifically ask about the A'. Now I see why he is confused. Actually the ' should be a superscript T for transpose. Math packages such as Matlab and Scilab use A' to indicate transpose because they are text based. Peter Nachtwey
Reply by Deefoo October 2, 20062006-10-02
"quadrotor" <quadrotor@gmail.com> wrote in message
news:TbWdnS50Sv9fJYLYnZ2dnUVZ_rqdnZ2d@giganews.com...
> Hi, > > I've been undertaking a project to create a controller for a quadrotor > aircraft. Whilst the dynamic modelling and controller design has nearly > been completed I am having trouble getting the requried feedback signals. > > I am trying to implement a Kalman filter to combine the signals of > accelerometers and gyroscopes to produce an attitude estimate. I have read > all the introductory literature and have also obtained some code to
achieve
> the desired sensor fusion along a single axis. > > The code I have is here: 124.243.132.204\tilt.c > > The code uses the derivative of the covariance matrix to do the update: > Pdot = A*P + P*A' + Q > The P matrix is then updated using P=P+Pdot*dt > > The introductory papers however all use the update equation: > P=A*P*A'+Q > > Why is the derivative used and where does that equation come from? I > havent been able to find anything on it. There doesnt seem to be a lot of > info around on the net and Kalman filtering seems to be something that not > many people have an understanding of. > > This is my main question but I am also wondering how the A matrix is > derived. I can not see how the fusion of the gyro and accelerometer data > can be achieved with this matrix when fitting it to the form x=Ax+Bu. I > assume x would be [tilt angle, gyro bias] and u would be the gyro data. > > Anybody got any ideas at all?? I am completly lost and confused. > >
How about this (rather expensive) book: Tracking and Kalman Filtering Made Easy by Eli Brookner http://www.amazon.com/Tracking-Kalman-Filtering-Made-Easy/dp/0471184071/sr=8-1/qid=1159777619/ref=sr_1_1/102-2881457-7674504?ie=UTF8&s=books I have a copy (but never read it ;o) --DF
Reply by Trond Danielsen October 2, 20062006-10-02
quadrotor wrote:
> Any mode ideas as to why Pdot is used to update and how they actually came > up with the A matrix?? >
The A matrix is called the state translation matrix, and describes how x_k relates to x_(k+1) in the absence of a forcing function. It can be derived from the space-state model of the system by the inverse laplace transform, but this becomes very difficult for systems with more than two state variables. The usual way is to compute it numerically. Most textbooks on the topic will tell you how (see my last post).
Reply by Trond Danielsen October 2, 20062006-10-02
quadrotor wrote:
> [...] > > The introductory papers however all use the update equation: > P=A*P*A'+Q > > Why is the derivative used and where does that equation come from? I > havent been able to find anything on it. There doesnt seem to be a lot of > info around on the net and Kalman filtering seems to be something that not > many people have an understanding of. >
A' is not the derivative of A, it is the inverse of matrix A. I have seen many forms of the equation for updating the P matrix. The reason for this is among others to avoid numerical divergence. If you are looking for litterature on the topic, I can recommend the book Introduction to Random signals and Applied Kalman Filtering by Brown and Hwang (isbn: 0-471-12839-2)
Reply by Rune Allnor October 2, 20062006-10-02
steve skrev:
> quadrotor wrote: > > > Why is the derivative used and where does that equation come from? I > > havent been able to find anything on it. There doesnt seem to be a lot of > > info around on the net and Kalman filtering seems to be something that not > > many people have an understanding of. > > > that's an understatement, most Kalman filter info also tends to be > circular, they all reference each other for specific details. Or you > might read something like this "Kalman filtering is a huge field which > cannot be explained in a brief paper.", you know either a big fat "Dead > End" sign or 400 references are coming up shortly.
One book that might be worth looking at (get it on loan from a library before you decide whether to buy!) is Durbin & Koopmans: "Time series analysis by state space methods" Oxford University Press, 2001. Within a handful of pages the authors explain the concept of the Kalman filter sufficiently well for me to be able to implement my own Kalman filter from scratch, and test it against their results. Unfortunately, the book is intended for economical statistics, which does have some impact on readability. Rune