View Single Post
  #9   Spotlight this post!  
Unread 13-01-2012, 01:08
Sparks333's Avatar
Sparks333 Sparks333 is offline
Robotics Engineer
AKA: Dane B.
FRC #1425 (Wilsonville Robotics)
Team Role: Alumni
 
Join Date: Feb 2004
Rookie Year: 2003
Location: Wilsonville, Oregon
Posts: 184
Sparks333 is a glorious beacon of lightSparks333 is a glorious beacon of lightSparks333 is a glorious beacon of lightSparks333 is a glorious beacon of lightSparks333 is a glorious beacon of lightSparks333 is a glorious beacon of light
Send a message via AIM to Sparks333
Re: Accelerometer Filtering

Really, most filters designs don't require calculus. If you want to do something like a Kalman, it does require a bit of differential equations, but I wouldn't recommend using something like that anyway. All you need to know is a few basic pieces of information - passband frequency and stopband frequency. An accelerometer will have most of its interesting information at around DC, so you'll be wanting a lowpass filter. The easiest filter you can implement is called a finite-impulse response filter (FIR), which, in discrete terms, means all you do is a multi-tap filter like Ether recommended (his is a two-tap filter, but you can realistically have as many taps as you want - the more taps you have the more it will reject higher frequencies [sharper rolloff]). There are ways to set the coefficients of each tap to favor older values over newer (that is the function of Ether's f parameter) or vice-versa, but from experience you can make it work with a a simple boxcar averaging algorithm - every tap has the same coefficient, and they all add to 1.

Looking at the beginning post, though, I do worry slightly - what you propose is to record the robot's location based on gyro and accelerometer readings. I cannot stress enough that this is incredibly difficult, especially for any extended period of time. The best you can do is robot attitude. For anything along those lines, you will actually probably want to use a Kalman, but that's a huge amount of work.

I hope this is helpful.

Sparks
__________________
ICs do weird things when voltage is run out of spec.

I love to take things apart. The fact that they work better when I put them back together it just a bonus.

http://www.ravenblack.net/random/surreal.html
Reply With Quote