View Full Version : doing double integration to getdistance traveled
eccmaster
12-01-2008, 23:33
Has anybody been able to do double integration with readings from the accelerometer in the kop? How do you do double integration in easy c?
mluckham
12-01-2008, 23:50
At http://www.olimex.com/dev/mod-mma7260q.html there is a way to convert acceleration and time to speed, and distance.
V = A * t, then the distance S = V * t
artdutra04
13-01-2008, 03:29
Has anybody been able to do double integration with readings from the accelerometer in the kop? How do you do double integration in easy c?The key to the integration is precise, interrupt-driven timing.
When you take the acceleometer output, you can use the formula vf = vf + (a * t) every time through the program loop. If you use precise timing, you know the set time interval, you know the acceleration, and you know the initial velocity (this was vf the previous time through the loop), so you can solve for the new final velocity.
From here, we plug this into the distance formula of df = df + (vf * t). This formula finds out how far the robot would have traveled at velocity vf for time t, and then adds that onto the previous distance.
With a dual-axis accelerometer, you will need two separate sets of these equations, one for both the x and y dimensions.
don't forget that most accelerometers will not register the spin of your robot, that's a gyroscope...
you can use an accelerometer if you place it not at the center of rotation, with the measuring axis pointed at the tangent of the direction of rotation...
-Leav
Yes, I resurrected an old thread... but I'd rather do that than start a new one on essentially the same subject.
I know doing double integration blows any error in a sampling of the acceleration up very fast over time (squaring and accumulating the error each time) but, has anyone done the double integration and can share some findings?
How fast does error show up? In what way? How accurate is it?
One application I'm looking at would require the double-integrated accelerometer to remain accurate for about 100ms.
Thanks for any data you can offer,
q
vBulletin® v3.6.4, Copyright ©2000-2017, Jelsoft Enterprises Ltd.