View Single Post
  #7   Spotlight this post!  
Unread 27-02-2010, 13:00
Kennersoft Kennersoft is offline
Registered User
FRC #0079
 
Join Date: Feb 2006
Location: Clearwater, FL
Posts: 6
Kennersoft is an unknown quantity at this point
Re: Any sucess using a accelerometer to measure distance

Quote:
Originally Posted by billbo911 View Post
If you truly want to measure distance with an accelerometer you need to be aware of one major obstacle, gravity sucks!

I know, that is a bit obtuse, but my point is, gravity will play a huge factor in getting accurate measurements. You see, if the accelerometer is even the slightest bit unlevel, gravity will be adding or subtracting from the values collected from the accelerometer. On top of that, if the mounting mechanism is not completely stable, with respect to the ground, then gravity's effect on the values will not be constant. So, as you might imagine, gravity will not be your friend if you try to take this approach.

Please do not let me discourage you with this posting, it is only meant to make you aware that while measuring distance with an accelerometer is theoretically possible, it's accurate implementation is far from simple.
This is true, but if you're tracking your robot's attitude (heading, pitch, and roll) you can compensate for that. We have that in our code, and it even "calibrates" itself on startup by reading the current gravity.

dwodrich, I do have sample code for you, except it's a mess right now since we're having to rewrite it a tad to reduce complexity. When some of the students can't follow what's going on I know I've got a problem.
Reply With Quote