|
Re: Any sucess using a accelerometer to measure distance
If you only want your robot's forward velocity, mount your accelerometer with the sensitive axis pointing forward, then you can do an average of a number of them to give you average acceleration over a time, then integrate based on that. For 15 seconds of autonomous, it should be stable enough.
We're using the kit 3-axis accel over I2C and set that up to measure at 200Hz (200 samples/sec), which we then accumulate 10 samples to integrate. The output is velocity at 20Hz. I added a little "distance traveled" item for our autonomous that integrates this 20Hz velocity to distance, with a reset flag that sets it back to 0. This allows for "drive forward 3 feet, turn 90*, drive forward 10 feet" style autonomous as you can reset the distance traveled after the turn.
|