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

  • I guess what I was thinking is that you could somehow clip off the low and high end of the output and just quantize the middle. Essentially, you'd turn it into a +-200 deg/sec range device and toss away the rest. It's the same thing you'd get with a higher resolution ADC, except you sacrifice some of the range.

    So imagine you can do your ADC over the range of 1.1 to 1.9v, with 0 deg/s at 1.5v. You'd be able to resolve .78 deg/sec of rotation, from -200 to +200. Everything outside of that range just gets clipped to the max or minimum.
  • Developer
    maybe, if we put a resistance, to reduce .50v. Then when we have -500 deg/s = 0v, and +500deg/s = 2 volts, and 1volts = central point. But remember is just theory, maybe in the real world we can have noise, or something. 2000mV/1023= 1.94mV/Deg/s, Good enough to have a resolution of 1deg/s.
  • Developer
    For an airplane= 1 deg/s resolution is ok
    For an helicopter= 0.1 deg/s resolution is ok.
  • Developer
    With more resolution more precision, 1.66 deg/s resolution no so good, 1 degree/s resolution is good, but 0.1 degrees/s would be super good.
  • So what if you set the arduino to look for voltages up to something like 1.7v (assumption: does anything above that just clip?).

    Now you have a range of 0.5v to 1.7v, with 1.5v being the center. The arduino can detect 1.66 deg/s of rotation with a range of -500 to +100 deg/sec. There must be some simple way of centering that too... I just don't really know what the minimum deg/sec resolution and the total range you practically need.
  • Developer
    I don't know if the amplifier can eliminate the .50v@-500degrees/s of the gyro, to adjust it to 0V. Any way is better put an ADC with more resolution, because you can reduce some "noise".
  • Developer
    No, arduino have a ref pin, (to adjust the maximum voltage value to whatever you choose), the problem is, ok you adjust Arduino to 2.5 v (max output voltage of the Gyro = +500 degrees/s), you going to have:
    1023 (10bits)/ 2500 mVolts = 2.44, so Arduino is capable to represente a decimal value every 2.44milivolts.
    The gyro is +-500degrees/s, when is neutral the output voltage is 1.5Volts, when you rotate the gyro to a positive way, the max output is going to be 2.5Volts@+500 degrees/s, and the negative way is going to be .50Volts@-500 degrees/s.
    That means we have a range of 2Volts (2000 mVolts) and 1000 Degrees/s, so if we divide: 2000mVolts / 1000 Degrees/s = 2mV/Degree/s.
    Arduino only detect changes every 2.44mvolts, and the gyro change every 2mV/Degree/s. So, is not enough. We need an ADC of 12 bit of resolution or a gyro with less range (300 degrees/s is enough)
  • Is there a common amplifier IC that converts 3.3v to 5v? 3 of those ADXRS300s are going to be expensive :(
  • Developer
    James Hall--> Thanks =) i hope, even someday touch NASA like a tourist.
  • Developer
    Tom Pycke: Kalman Filters for IMU's explanation:
    http://tom.pycke.be/mav/71/kalman-filtering-of-imu-data
This reply was deleted.