Electronic – arduino – Dead reckoning with accelerometer & gyro. Possible

accelerometerarduinogyroimumems

I have a 3 axis accelerometer and a 3 axis gyroscope. I've been tasked with developing a dead reckoning system using this hardware.

Essentially what's needed is for me to develop some code to track the position in 3d space of the board in real time. So if I start with the board on a table and lift it 1m upward, I should be able to see that movement on the screen. Rotations need to be taken into account too, so if I turn the board upside down half way through the same movement, it should still show the same 1m upward result. The same should also hold for any complex movement over a period of a few seconds.

Ignoring the maths needed to do calculate and rotate vectors etc, is this even possible with such a low cost device? As far as I can tell, I won't be able to remove gravity with 100% precision, which means my angle relative to the ground will be off, which means my vector rotations will be off, which leads to an incorrect position measurement.

I also have noise from the accelerometer and gyro bias to account for.

Can this be done?

Best Answer

The answers and comments you're getting are excellent of course, but I can add a little color.

For what its worth, our sensorineural system uses much the same tools, and doesn't always get the answer right! We have 3D accelerometers (the otolith organs) and 3D "gyros" (angular velocitomers, the semicircular canals), and yet we suffer from all sorts of illusions when the system is not able to get the right "answer", like the elevator illusion and the oculogravic illusion. Often these failures occur during low-frequency linear accelerations, which are difficult to distinguish from gravity. There was a time when pilots would nose-dive into the ocean during catapult takeoffs on aircraft carriers because of the strong perception of pitch resulting from the low frequency acceleration associated with the launch, until training protocols taught them to ignore those perceptions.

Granted, the physiological sensors have some different frequency cutoffs and noise floors than MEMS sensors, but we also have a huge neural net thrown at the problem -- though little in the way of evolutionary pressure to solve the problem correctly at these low frequency extremes, so long as catapult launches are fairly rare ;-).

Picture this common-sense "dead reckoning" problem that many have experienced, though, and I think you'll see how this carries over to the MEMS world. You get on a jet, take off in North America, accelerate to cruising speed, cross the ocean, decelerate and land in Europe. Even removing the tilt-translation ambiguities from the problem, and assuming zero rotation, there would be very little hope of a real implementation of a double integration of the acceleration profiles yielding a position profile anywhere nearly accurate enough to tell you you've reached Europe. Even if you had a very accurate 6 axis gyro/accelerometer package sitting in your lap during the trip, that would have its problems as well.

So that's one extreme. There's much evidence suggesting that for everyday behaviors animals use a simple assumption that low-frequency accelerations that are detected are probably caused by reorientations with respect to gravity. A combination of gyros and accelerometers that have broader frequency responses than our inner ear can solve the problem much better, of course, but will still have problems in the extreme due to noise floor, thresholds, and such.

So, for short epochs with non-trivial accelerations, dead reckoning with the right instrumentation is not so bad a problem. For long term, with small accelerations, and low-frequency accelerations, dead reckoning is a big problem. For any given situation, you need to figure out where on that spectrum your particular problem lies, and how accurate your dead reckoning needs are in order to determine whether the best you can do is good enough. We call that process engineering.