I'm trying to develop an IMU for my Arduino-based UAVS (heli) project. In my first test I just used a three-axis accelerometer, but it didn't work because the motor vibration generated too much noise. I then tried it just with gyros, but of course the the gyros drifted. So I learned through experience what everyone already knows: that the onlyway to make a good IMU is by mixing accelerometers with gyros andKalman Filters, which is eventually what I did ;-)
I ran a test to see how my IMU is responding, and I made a line chart to see the results. The test consists of rotating the device to 70 degrees and then shake it, to see how the filters reduce the "noise". It looks pretty good:
The samples was taken every 20 miliseconds, the blue line is just accelerometer and the red line is Accelerometer+Gyros+KalmanFilters.
Source code here: ArduIMU Beta1
Special thanks to Tom Pycke
Comments
why ı can not see the source code
it gives an error like this "This site has been disabled for violations of our Program Policies. If you feel this disabling was in error, please visit our contact page to let us know. Contact Us"
//////////////////////////////////////////////////////
#ifndef cbi
#define cbi(sfr, bit) (_SFR_BYTE(sfr) &= ~_BV(bit))
#endif
#ifndef sbi
#define sbi(sfr, bit) (_SFR_BYTE(sfr) |= _BV(bit))
#endif
///////////////////////
And thats all!!! just connect a ref voltage to the aref pin and ready!!!
If I get it working, I'll be sure to let you guys know..
Btw, how difficult is it to set the +aref pin on the Arduino?
i dropped the speed in twi.h from 400000 to 300000 and it seems to be working now. maybe it's just flaky when overpowered.