Developer

First Arduino IMU test

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



E-mail me when people leave their comments –

You need to be a member of diydrones to add comments!

Join diydrones

Comments

  • You are going to go work at NASA aren't you? Geez..I am very impressed with all your efforts on your project.
  • Developer
    Be careful, you CAN'T use "IMU 5 Degrees of Freedom" with arduino, unless you use an external ADC with more resolution (more trouble), because ADC with 10 bits of resolution is not enough. This is the other reason why i bought the "ADXRS300", works with 5volts, and use less resolution, and in the future if you wanna upgrade your IMU and add the third GYRO to control yaw, is going to be easier. The yaw gyro is very useful in the real world (and more for helis), because if you have high winds, the gyro detects yaw rotations and correct them.
  • Developer
    The vibration of the engine is called "White Noise" (or Constant noise), the same noise made by a blender, vacuum, blow dryers, etc. The Kalman Filters reduce the white noise from the accelerometers (because is calculable, you need to adjust it in the code, depending your project), but not reduce the acceleration caused by centripetal force, descent/climb forces and turbulence, all that forces are detected "wrong" by the accelerometer. So the gyros came to help us.
    http://en.wikipedia.org/wiki/White_noise
    By the way, the white noise calm down Crying babies:
    http://youtube.com/watch?v=lATx_c1aepU

    About accelerometers: the most famous (used by tom p.) is this:
    http:/sparkfun.com/
    commerce/product_info.php?products_id=741
    Dual axis gyroscope with +-500 degrees per seconds, and 3 axis accelerometers +-2G's, is nice, but i bought this:
    http://sparkfun.com/commerce
    /product_info.php?products_id=395
    For money reasons, and use Nintendo Wii Accelerometer (Is called the Mexican way, survive with less). =)
  • Thanks for the reply and the Tom Pycke link. The importance of the gyro measurement is becoming more clear to me now. I'm wondering now, on top of detecting roll/pitch, could you use long term averaging of the accelerometers to also control for external drift inducing forces such as wind?

    I'm looking at gyros now... I wonder if I can get away with a 2 axis setup.
  • Developer
    yes, but slow down the system, and the helicopter vibration is so heavy, that is almost impossible to read. For example 1023= +2G's, 511 is neutral, 0 = -2G's, the reading is jumping +-400!!! and with average +- 50, and that is no enough... Remember, for a helicopter you need fast response and precision, maybe in an electric airplane, would be a good idea (to save money and code), but remember this:
    "There are more forces working on a flying airplane then just good old gravity! Just think about the centripetal force when following a circle path. We’ll need gyroscopes to correct this."
  • Nice work!

    Have you experimented with using the accelerometer data alone, but averaging the samples over time, only allowing each reading to contribute to some percentage of the estimated measurement?
This reply was deleted.