Tracking Distance on one Axis with an Accelerometer

AI Thread Summary
The discussion focuses on using an accelerometer to track distance on one axis for a rocket project, despite acknowledging that there are better methods available. The initial approach involves calculating speed and distance based on acceleration readings over time intervals. A key point raised is that the "New speed" calculated represents the speed only at the end of the interval, which could lead to inaccuracies. A more accurate method suggested involves averaging accelerations and velocities at the ends of the interval to improve calculations. The conversation emphasizes the importance of precision in tracking distance using accelerometer data.
ferret_guy
Messages
18
Reaction score
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
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?
 
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
 
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
 
Thank you I was hesitant about posting code because I dident know how many people wold be able to interpret it
 
The rope is tied into the person (the load of 200 pounds) and the rope goes up from the person to a fixed pulley and back down to his hands. He hauls the rope to suspend himself in the air. What is the mechanical advantage of the system? The person will indeed only have to lift half of his body weight (roughly 100 pounds) because he now lessened the load by that same amount. This APPEARS to be a 2:1 because he can hold himself with half the force, but my question is: is that mechanical...
Some physics textbook writer told me that Newton's first law applies only on bodies that feel no interactions at all. He said that if a body is on rest or moves in constant velocity, there is no external force acting on it. But I have heard another form of the law that says the net force acting on a body must be zero. This means there is interactions involved after all. So which one is correct?
Thread 'Beam on an inclined plane'
Hello! I have a question regarding a beam on an inclined plane. I was considering a beam resting on two supports attached to an inclined plane. I was almost sure that the lower support must be more loaded. My imagination about this problem is shown in the picture below. Here is how I wrote the condition of equilibrium forces: $$ \begin{cases} F_{g\parallel}=F_{t1}+F_{t2}, \\ F_{g\perp}=F_{r1}+F_{r2} \end{cases}. $$ On the other hand...
Back
Top