View Single Post
  #1   Spotlight this post!  
Unread 28-09-2013, 12:55
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,100
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Plotting Location w/ Accellerometer Project

Quote:
Originally Posted by Invictus3593 View Post
We can use a time interval of about 100ms to calculate distance traveled with this equation: D=1/2at^2
You left out the second term...

D = ½at2 + Vot

... and that formula is valid only if "a" is constant over the time interval.

Hate to be a party pooper, but... Due to the double integration, tiny errors in "a" will rapidly accumulate so that the computed position will quickly diverge from the true position.

Trapezoidal integration will help somewhat: Given t, x, v, and a at some point in time, and anew at some later point in time tnew, proceed as follows:

dt = tnew - t;
vnew = v + dt*(anew+a)/2;
xnew = x + dt*(vnew+v)/2;





Last edited by Ether : 28-09-2013 at 13:13.
Reply With Quote