DSPRelated.com
Forums

Accelerometer and Kalman Filter

Started by arvkr February 18, 2009
On Wed, 18 Feb 2009 13:22:50 -0500, Rich Webb wrote:

> On Wed, 18 Feb 2009 11:32:51 -0600, Tim Wescott <tim@seemywebsite.com> > wrote: > > >>Kalman filtering is not something that you can learn from web searches, >>although there is good information out there (I regularly use the >>Wikipedia article to remind me the exact order of operations). What you >>need is a book, and the book I recommend is Dan Simon's "Optimal State >>Estimation, Kalman, H-infinity, and Nonlinear Approaches", Wiley, 2006. >>It's a good book, and I love his approach (I even like his approach to >>theology, which you'll find in an appendix, even though I disagree with >>his conclusions). >> >>http://www.powells.com/partner/30696/biblio/0471708585. It costs a >>bundle, but it's worth it. > > How dependent is it on Matlab? That is, hard-wired to Matlab or > reasonably useable with another procedural matrix toolset such as Scilab > or Omatrix?
Not at all. It's purely a mathematics text, not "Optimal State Estimation with My Favorite Simulation Environment" (Damn but that sounds cranky. Everything I write today sounds cranky. Just keep me away from any North Korean politicians...). At any rate, it teaches you the math, and trusts you to translate it into the implementation of your choice. -- http://www.wescottdesign.com
On Wed, 18 Feb 2009 12:53:21 -0600, arvkr wrote:


>>Example please? >> >>Note in advance that if you're using a Kalman filter as an observer in a > >>control system (which is what you imply above), you'll be inputting a >>plant drive as well as a sensor reading -- and there's your two inputs. >> >>-- >>http://www.wescottdesign.com >> >> > http://en.wikipedia.org/wiki/Kalman_filter#Examples Isn't similar to > what i am trying to do? Can my acceleration measurements not be the > noisy measurements in Z_k ( used to correct) and my model predictions > with an initial estimate ( which i have to provide) be X_k. This was > what i had in my mind when i asked the question of how will i derive my > model. May be i have it all confused? arvkr
In that case the position of the truck is measured, and the accelerations are unknown (so I guess you have answered HardySpicer's assertion. Hmm. I learn something...). So at the end of any measurement you know the position of the truck to somewhat better than the variance of the measurement. In your case, the acceleration of the truck is measured, and the position is unknown. Unlike the Wikipedia example, you have no way of distinguishing between a real acceleration of the truck and a bias in your accelerometer reading. At best your position will have an ever- growing error that is equal to the accelerometer bias times the square of time, plus a Gaussian whose variance grows as the square of time. -- http://www.wescottdesign.com
On Wed, 18 Feb 2009 13:14:03 -0600, Tim Wescott <tim@seemywebsite.com>
wrote:

>On Wed, 18 Feb 2009 13:22:50 -0500, Rich Webb wrote: > >> On Wed, 18 Feb 2009 11:32:51 -0600, Tim Wescott <tim@seemywebsite.com> >> wrote: >> >> >>>Kalman filtering is not something that you can learn from web searches, >>>although there is good information out there (I regularly use the >>>Wikipedia article to remind me the exact order of operations). What you >>>need is a book, and the book I recommend is Dan Simon's "Optimal State >>>Estimation, Kalman, H-infinity, and Nonlinear Approaches", Wiley, 2006. >>>It's a good book, and I love his approach (I even like his approach to >>>theology, which you'll find in an appendix, even though I disagree with >>>his conclusions). >>> >>>http://www.powells.com/partner/30696/biblio/0471708585. It costs a >>>bundle, but it's worth it. >> >> How dependent is it on Matlab? That is, hard-wired to Matlab or >> reasonably useable with another procedural matrix toolset such as Scilab >> or Omatrix? > >Not at all. It's purely a mathematics text, not "Optimal State >Estimation with My Favorite Simulation Environment" (Damn but that sounds >cranky. Everything I write today sounds cranky. Just keep me away from >any North Korean politicians...).
Good info, thanks. There seem to be quite a few publications on optimal estimation that could use exactly that title; nice that this isn't one of them. -- Rich Webb Norfolk, VA
arvkr schrieb:
>> On Wed, 18 Feb 2009 09:08:16 -0600, arvkr wrote: >> >>> I have accelerations measurement from an accelerometer and i want to > use >>> kalman filter to estimate and remove the bias so that when i find the >>> position by integrating twice its not crap. How would i model the > kalman >>> filter especially >>> A, B, Q, R, & H. >>> Any help would be appreciated. >>> thanks >>> arvkr >> Your question is tantamount to "How would I model my system". >> >> So, what's your system model? >> >> There's not going to be much meat in a Kalman filter that takes >> accelerometer input and coughs up position unless you have some other >> sensor that lets you know the position, at least once in a while or at >> low bandwidth or with lots of noise or _something_. _With_ such a sensor > >> then the Kalman should 'cross-check' to get the best estimate. >> >> -- >> http://www.wescottdesign.com >> > > > Yes i see your point, but my question is can a kalman filter remove the > acceleration bias with just measurements of acceleration from the > acceleromter and will this result in a better location of the position when > integrated twice after bias removal?
No this will not remove your bias problem since an estimated state variable by Kalman Filter has to be correctly initialized at t=0 otherwise your estimate will be biased, although the bias decreases with the time. So when you can only initialize a(0) with the true values but not v(0) and s(0) there will be always a small bias left. This does not mean that a Kalman Filter might be better estimate your position like your current approach if you can model the sensor statistics right but it does not solve your original problem with the bias. Sebastian
>>>>http://www.powells.com/partner/30696/biblio/0471708585. It costs a >>>>bundle, but it's worth it. >>>
$107.25 at above listed website. $88 at Amazon.com $69 including shipping at one of the alternative sites listed on Amazon. http://www.amazon.com/Optimal-State-Estimation-Nonlinear-Approaches/dp/0471708585/ref=pd_bbs_sr_1?ie=UTF8&s=books&qid=1234988017&sr=8-1
Sebastian Doht schrieb:
> arvkr schrieb: >>> On Wed, 18 Feb 2009 09:08:16 -0600, arvkr wrote: >>> >>>> I have accelerations measurement from an accelerometer and i want to >> use >>>> kalman filter to estimate and remove the bias so that when i find the >>>> position by integrating twice its not crap. How would i model the >> kalman >>>> filter especially >>>> A, B, Q, R, & H. >>>> Any help would be appreciated. >>>> thanks >>>> arvkr >>> Your question is tantamount to "How would I model my system". >>> >>> So, what's your system model? >>> >>> There's not going to be much meat in a Kalman filter that takes >>> accelerometer input and coughs up position unless you have some other >>> sensor that lets you know the position, at least once in a while or >>> at low bandwidth or with lots of noise or _something_. _With_ such a >>> sensor >> >>> then the Kalman should 'cross-check' to get the best estimate. >>> >>> -- >>> http://www.wescottdesign.com >>> >> >> >> Yes i see your point, but my question is can a kalman filter remove the >> acceleration bias with just measurements of acceleration from the >> acceleromter and will this result in a better location of the position >> when >> integrated twice after bias removal? > > > No this will not remove your bias problem since an estimated state > variable by Kalman Filter has to be correctly initialized at t=0 > otherwise your estimate will be biased, although the bias decreases with > the time. So when you can only initialize a(0) with the true values but > not v(0) and s(0) there will be always a small bias left. > This does not mean that a Kalman Filter might be better estimate your > position like your current approach if you can model the sensor > statistics right but it does not solve your original problem with the bias. > > Sebastian
Oh I just realized that you are talking of a bias of the accelarition. Then of course a Kalman Filter won't help you at all since you have a ill-posed estimation problem. I do not much know about acceleromators, but if their bias is a constant you can probably use a well-defined input signal to find more out about the bias.
> No this will not remove your bias problem since an estimated state >> variable by Kalman Filter has to be correctly initialized at t=0 >> otherwise your estimate will be biased, although the bias decreases
with
>> the time. So when you can only initialize a(0) with the true values but
>> not v(0) and s(0) there will be always a small bias left. >> This does not mean that a Kalman Filter might be better estimate your >> position like your current approach if you can model the sensor >> statistics right but it does not solve your original problem with the
bias.
>> >> Sebastian
Here is why i think i can use a kalman filter. Assuming my model is going to just based on accelerometer output, that would mean i just have acceleration measurements where acc_true = scale_error *acc_measured - acc_bias + acc_noise; I am not worried that much about scale error since i have other means of removing the scale error and for simplicity sake assume acc_noise = 0. that will leave me with acc_true = acc_measured - acc_bias Now the measurements i make is a acceleration measurements with a bias in it which will be Zk. I would know the acceleration measurement at starting position that is x(0). Given these if i can accurately model the accelerometer i believe i can use kalman filter to estimate the bias and remove it which is what i am after. Once i get the corrected acceleration which is bias free then i can estimate my position and remove any scale error assuming that the scale error is linear and doesn't square when i integrate ( i am pretty sure i am right in assuming this). What do you guys think?
> No this will not remove your bias problem since an estimated state >> variable by Kalman Filter has to be correctly initialized at t=0 >> otherwise your estimate will be biased, although the bias decreases
with
>> the time. So when you can only initialize a(0) with the true values but
>> not v(0) and s(0) there will be always a small bias left. >> This does not mean that a Kalman Filter might be better estimate your >> position like your current approach if you can model the sensor >> statistics right but it does not solve your original problem with the
bias.
>> >> Sebastian
Here is why i think i can use a kalman filter. Assuming my model is going to just based on accelerometer output, that would mean i just have acceleration measurements where acc_true = scale_error *acc_measured - acc_bias + acc_noise; I am not worried that much about scale error since i have other means of removing the scale error and for simplicity sake assume acc_noise = 0. that will leave me with acc_true = acc_measured - acc_bias Now the measurements i make is a acceleration measurements with a bias in it which will be Zk. I would know the acceleration measurement at starting position that is x(0). Given these if i can accurately model the accelerometer i believe i can use kalman filter to estimate the bias and remove it which is what i am after. Once i get the corrected acceleration which is bias free then i can estimate my position and remove any scale error assuming that the scale error is linear and doesn't square when i integrate ( i am pretty sure i am right in assuming this). What do you guys think?
On Thu, 19 Feb 2009 06:37:36 -0600, arvkr wrote:

>> No this will not remove your bias problem since an estimated state >>> variable by Kalman Filter has to be correctly initialized at t=0 >>> otherwise your estimate will be biased, although the bias decreases > with >>> the time. So when you can only initialize a(0) with the true values >>> but > >>> not v(0) and s(0) there will be always a small bias left. This does >>> not mean that a Kalman Filter might be better estimate your position >>> like your current approach if you can model the sensor statistics >>> right but it does not solve your original problem with the > bias. >>> >>> Sebastian > > Here is why i think i can use a kalman filter. Assuming my model is > going to just based on accelerometer output, that would mean i just have > acceleration measurements where > acc_true = scale_error *acc_measured - acc_bias + acc_noise; > > I am not worried that much about scale error since i have other means of > removing the scale error and for simplicity sake assume acc_noise = 0. > > that will leave me with > acc_true = acc_measured - acc_bias > > Now the measurements i make is a acceleration measurements with a bias > in it which will be Zk. I would know the acceleration measurement at > starting position that is x(0). Given these if i can accurately model > the accelerometer i believe i can use kalman filter to estimate the bias > and remove it which is what i am after. Once i get the corrected > acceleration which is bias free then i can estimate my position and > remove any scale error assuming that the scale error is linear and > doesn't square when i integrate ( i am pretty sure i am right in > assuming this). > > What do you guys think?
Case 1: Your vehicle is sitting perfectly still, and the accelerometer is biased by 1/2 m/s/s. Case 2: Your vehicle is accelerating at 1/2 m/s/s and your accelerometer bias is exactly zero. How do you tell the difference? -- http://www.wescottdesign.com
> >Case 1: > >Your vehicle is sitting perfectly still, and the accelerometer is biased
>by 1/2 m/s/s. > >Case 2: > >Your vehicle is accelerating at 1/2 m/s/s and your accelerometer bias is
>exactly zero. > >How do you tell the difference? > > > >-- >http://www.wescottdesign.com >
Yes, i give up on trying to use just accelerometer to estimate position accurately, kalman or any other filter will not produce the necessary results. Now say i have a 3d gyro data and 3d accelerometer data and 3d compass data, how would i go about designing a kalman filter to fuse information to remove the errors that exist in gyro and accelerometer to produce accurate estimation of position.?