Tracking Distance on one Axis with an Accelerometer

In summary, the conversation discusses methods for tracking distance using an accelerometer for a rocket project. The suggested method involves using the accelerometer's readings to calculate velocity and then using that to calculate distance. However, there is discussion about the accuracy of this method and a better alternative is suggested using fourth-order Runge-Kutta numerical integration. The conversation concludes with the acknowledgment that not everyone may be able to interpret the code being discussed.
  • #1
ferret_guy
18
0
I need to track Distance on one Axis with an Accelerometer for a rocket project (i know there are bettor ways t do this but i am dead set on this one) I was thinking as follows,

Code:
Read Accelerometer
Accelerometer*Δt=Δv
Current speed+Δv=New speed
distance+New speed*Δt=New distance
 
Physics news on Phys.org
  • #2
distance+New speed*Δt=New distance

Isn't "New speed" the speed only at the end of the interval "delta t", not for the whole duration of delta t?
 
  • #3
This function is repeated many times so that is the speed that is dirived from the inatil meshurment and the Δt is the time since the last meshurment so were assuming that your travling at a constant speed for the time it takes to exicute the pice of code
 
  • #4
bahamagreen said:
distance+New speed*Δt=New distance

Isn't "New speed" the speed only at the end of the interval "delta t", not for the whole duration of delta t?

Yes. It will still work, but is inaccurate. A better simple method is averaging accelerations and velocities at the ends of the interval:

PHP:
velocityX[0] = 0 // we assume the device was static when we started recording acc
positionX[0] = 0

for every sample i > 0:
    dt = time[i-1] - time[i] // if sampling rate is constant simply use 1 / frequency here
    velocityX[i] = velocityX[i-1] + (accX[i] + accX[i-1]) / (2 * dt)   
    positionX[i] = positionX[i-1] + (velocityX[i] + velocityX[i-1]) / (2 * dt)

Better is:
http://doswa.com/2009/01/02/fourth-order-runge-kutta-numerical-integration.html
 
  • #5
Thank you I was hesitant about posting code because I dident know how many people wold be able to interpret it
 

1. How does an accelerometer track distance on one axis?

An accelerometer measures acceleration, which can be used to calculate distance. By measuring the acceleration of an object over time, the device can determine how far it has traveled on a single axis.

2. What is the accuracy of distance tracking with an accelerometer?

The accuracy of distance tracking with an accelerometer depends on several factors, such as the quality of the sensor and the calibration of the device. Generally, accelerometers have a margin of error of around 5% to 10%.

3. Can an accelerometer track distance on multiple axes?

Yes, some accelerometers have the ability to track distance on multiple axes. This is useful for tracking movement in three-dimensional space.

4. How does an accelerometer determine the starting point for distance tracking?

An accelerometer does not determine the starting point for distance tracking. It simply measures acceleration and calculates the distance traveled from that point. The starting point must be manually set by the user or programmed into the device.

5. Are there any limitations to using an accelerometer for distance tracking?

Yes, there are some limitations to using an accelerometer for distance tracking. It is not as accurate as other methods, such as GPS, and it can be affected by external forces such as vibrations or changes in temperature. Additionally, it may not be suitable for tracking very small distances or movements.

Similar threads

Replies
1
Views
1K
Replies
4
Views
4K
Replies
4
Views
8K
Replies
25
Views
7K
Replies
3
Views
2K
Replies
1
Views
2K
  • Mechanics
Replies
1
Views
934
Replies
1
Views
3K
Replies
14
Views
1K
Back
Top