Is it possible to build an IMU without a MCP3208?
tonocastillo
Posts: 12
Hello,
Is it possible to build an IMU without a MCP3208?
I have a 3 axis digital accelerometer (H48C) and a 3 axis digital gyro (L3G4200D).
For what I have read, an ADC is needed when you have an analog accelerometer. Is this correct?
With the above devices... do I need an ADC?
Thank you.
Is it possible to build an IMU without a MCP3208?
I have a 3 axis digital accelerometer (H48C) and a 3 axis digital gyro (L3G4200D).
For what I have read, an ADC is needed when you have an analog accelerometer. Is this correct?
With the above devices... do I need an ADC?
Thank you.
Comments
I'm also working on a 6-axis IMU using a digital accelerometer (my 3AD module) and a 3-axis gyro that vanmunch (Dave) sells.
Still, I think I'll take a whack at starting from scratch. I may peek if I get stuck...
One trick is getting the data from the sensors at a very high speed. You need an assembly driver to do this because spin isn't fast enough.
That may be the easy part.
After you get the data, you have to magically turn into position and heading. This is the part I don't know how to do yet...
The H48C is analog out so you need 3 channels of ADC for it. The L3G4200D is digital out though. There are ways to do ADC directly with the propeller chip BTW.
There are a number of good digital 3-axis accelerometers out there. The same routines that read the L3G4200D could read them with very few changes - it's all I2C, so you just need to provide the right address bits, and make sure you get the hi/lo bytes in the right order.
The QuadX thread has code posted that will read the L3G4200D, and a bunch of other devices as well.
And, Rayman - A gyro / accel combo won't get you position or heading. They'll let you figure out where "down" with a reasonable degree of accuracy, but that's about it. If you want to know where you are you'll need a GPS, and heading requires a compass (magnetometer).
I'm hoping that will be good enough for me..
Position I haven't tried. In theory it's possible, but the math is more complex. You'll need to generate an estimate of your orientation, then take the accelerometer data and rotate it by that orientation before accumulating it to your running totals. If the accelerometer remained level and held true north as your quad was flying around, you wouldn't need to do this, but it doesn't.
Now, you *could* just assume that you only care about this behavior when the quad is reasonably level and stationary - IE when you only want to hold still in a hover you enable the positional estimate code. Then you'd only have to rotate the acceleration vector by your heading estimate, and you might even be able to get away without doing that. It'd be worth trying for sure.
Do you think I need to build an IMU for this?
If so, I better start buying the ADC...
Or these 2 component I already have should do it?
This is just to have an idea on where to start, I'm a bit new with propeller
The H48C is digital out. It has an on board MCP3204 ADC, so no conversion is necessary.
Jim
Most likely, yes. I have camera leveling working on my own DCM-based quad, and it's all based on the values from the IMU. Since the quad can determine its angle relative to ground, you have all the information you need to perform camera leveling - all you need to do is send servo outputs to counter the movement of the quad. It works very well.