Setting BW on Accel & Gyro Breakout Boards

bungalow_steve, I have been giving my previous post some more thought.

If you have the MEMS sensor hardware filter set to cutoff at a very high frequency, you must have a high sampling frequency ( >=2x the cutoff frequency) to avoid aliasing; the MEMS hardware filter is the anti-aliasing filter in your case.

For my application with a 50-Hz sample frequency, I have to have an anti-aliasing filter no wider than 25-Hz. One way or another, this filtering has to be done prior to sampling. The Sparkfun breakout boards with ~350-Hz BW need an external analog filter, I don’t see how to avoid that?

If aliasing occurs it will corrupt the desired signal and no amount of filtering post sampling will fix it.

I use Matlab to give me the FIR filter coefficients, just plug in cutoff frequency, slope, ripple, etc etc. out comes the coefficients, there are lots of other FIR filter designer software too.

Yes you are correct, in your case I would sample at a higher rate then downsample.

So for the 350hz, I would sample at 1000Hz, then filter (FIR filter) and then downsample to a lower rate. The MSP430 with the HW multipler can do FIR filters very quickly, it was built to do FIR filters. A 10 tap FIR filter is just

y = xoC0 + x1C1 + x2C2 + x3C3 + … x9*C9

where C0 to C9 are the coefficents and xo to x9 are the last 10 A/D readings

the filter only runs at the downsample rate, not at your A/D sampling rate, so CPU time is not bad,

if you do run out of CPU time, you have to lower the external HW filter anti-aliasing cutoff frequency so you can lower your sample rate

Having a fast CPU gives you more options to experiment with! Then with your final design you can optimize with a slower CPU. That’s how I generally design my products.

I am sampling accelerometer and gyro outputs at 50-Hz so need to set the output BW to approx 25-Hz

the signal will aliasing if you did that ,

according to sampling theorem your sampling frequency should be lower than gyro frequency otherwise you well take the same sample twice or more

Nice video. Its really fantastic. I am impatient to see it. If you have more please share with us.

Thanks

Hi,

Any help re kalman filter. I am trying to integrate the 3 axis gyro and the 3 axis accel for my quad. I am trying to use a complimentary filter but still no luck. When it is almost 0 degrees (on a seasaw balancing x axis only) it kicks and the PID has to redo all the job again.

Regards