Find the Acceleration and Distance from the Output of an Accelerometer Sensor

Click For Summary

Discussion Overview

The discussion revolves around the use of an accelerometer sensor to determine acceleration and distance traveled by a car. Participants explore the conversion of sensor data into meaningful physical quantities, the appropriate formulas for calculating distance from acceleration, and the challenges associated with integrating acceleration data over time.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested
  • Mathematical reasoning
  • Experimental/applied

Main Points Raised

  • One participant inquires about converting accelerometer output values into acceleration units and finding distance from acceleration, questioning the applicability of the formula v = u + 1/2(a * t^2).
  • Another participant suggests that the formula mentioned is not suitable and proposes using a different approach involving the second derivative of position.
  • It is noted that tracking position from accelerometer and gyroscope outputs requires iterative calculations of motion equations, especially if rotations are involved.
  • Participants discuss the importance of understanding the relationship between accelerometer output and physical movement, suggesting initial tests to clarify this relationship.
  • Concerns are raised about the accuracy of position calculations due to potential errors from integrating acceleration data twice, with one participant recommending the use of FFT for better results.
  • There is a discussion about the necessity of knowing the time interval between sensor readings and the limitations of using accelerometer data alone for 3D movement tracking.
  • One participant emphasizes the need for additional sensors, such as a vehicle speed sensor (VSS), to improve accuracy in measuring distance and velocity.
  • Another participant highlights that errors can accumulate during integration, particularly due to factors like pitch error in vehicles.

Areas of Agreement / Disagreement

Participants express differing views on the best methods for calculating distance from accelerometer data, with some advocating for traditional integration methods and others suggesting alternative approaches. There is no consensus on a single correct method, and various challenges and limitations are acknowledged throughout the discussion.

Contextual Notes

Participants note that the accuracy of distance calculations can be significantly affected by factors such as sensor noise, the need for initial conditions, and the effects of gravity on accelerometer readings. The discussion also highlights the complexity of integrating acceleration data, particularly in dynamic environments like vehicles.

Who May Find This Useful

This discussion may be useful for individuals interested in sensor data analysis, particularly in automotive applications, as well as those exploring the integration of accelerometer data for motion tracking and position estimation.

varul92
Messages
2
Reaction score
0
My question is kindof related to physics, as I have an Accelerometer sensor through which I am able to get the sensor data as following:

x = 192
y = 433
z = -453

I need to convert these values in such a way so that It will share Acceleration in cm or meters,
And also what concept I should use to find out the distance through acceleration?

While searching something useful I found out the formula

v = u + 1/2(a * t^2)

Is this right formula to use for finding distance but still the major issue is how to find the time from these sensors

Note: I am using Arduino to get the output from these sensors
 
Physics news on Phys.org
varul92 said:
I need to convert these values in such a way so that It will share Acceleration in cm or meters
You will need to check the documentation to find what units are provided. Note that cm and m are units of distance, not acceleration.

varul92 said:
While searching something useful I found out the formula

v = u + 1/2(a * t^2)

Is this right formula to use for finding distance
No, this formula will not work for your application. You will need to use ##a=\frac{d^2}{dt^2}x##.
 
Last edited:
The way to track positions from accelerometer and gyroscope outputs is to iteratively perform the integrations and calculations of the 6 degree of freedom (6DOF) equations of motion. If you are certain that there are no rotations, it is a lot simpler.
 
  • Like
Likes   Reactions: Fededevi
varul92 said:
And also what concept I should use to find out the distance through acceleration?
Did you google "position from inertial sensor" or similar. It is a very common application, and there are various methods and tools available.
 
varul92 said:
While searching something useful I found out the formula

v = u + 1/2(a * t^2)
There are three well known (so-called suvat) equations which tell you about motion under linear acceleration. This link has them all in one place and they are worth learning off by heart - or at least having them very much to hand. They apply ONLY to motion under constant acceleration. If the acceleration is varying over time the you need to use Integral calculus based calculations.
Suvat will help you calculate any of the s,u,v,a,t values if you know all the others. You have to pick the right formula to use i.e. the one with the required answer on the left or at least the quantity you need in it somewhere so you can re-arrange the equation to bring it on the left.
One very important thing about accelerometers is that when you consider motion under gravity, an accelerometer will register zero when the measured object is in free fall because the same (g) acceleration is applied to the meter and the object. This is not a problem if you bear it in mind.
PS this sort of dead reckoning position finding method can have enormous errors!
 
  • Like
Likes   Reactions: Fededevi
sophiecentaur said:
this sort of dead reckoning position finding method can HAS enormous errors!

Edited to reflect my experience. I have used accelerometers to (attempt to) measure position. And I was using industrial grade PCB accelerometers with 12 bit A/D converters in a system with 1 LSB of noise. Translated into English, that last sentence is "And I was using equipment far better than your LIS3DHTR".

Start a project like this by first plotting acceleration while running simple tests: Accelerometer stationary in various positions, waving band and forth, etc. When you fully understand the relationship between what you are doing with the accelerometer and the output of the accelerometer, then the next step is to calculate velocity. Save the position for last, and only after successfully getting velocity.
 
  • Like
Likes   Reactions: sophiecentaur
the major issue is how to find the time from these sensors
You don't need the absolute time, you just need to know the time passed since the last reading of the sensor. The specs of the IC say that the sensor outputs the acceleration at up to 5khz, So your timestep for integration should be 1/5000s if you use it at that frequency.

I want to point out that you can't obtain the movements in 3D with only the accelerometer data, unless you completely restrict the sensor rotation and you know the initial orientation.
And you can't even calculate the orientation with the data even if the device is at rest.
For example if the sensor is at rest on a table orthogonal to gravity so the axis are reading something like [ 0, 0, 1], you can rotate the sensor on the table plane without it detecting any change.
Or for example if the sensor is free-falling you loose the gravity reference vector and you can't detect any rotation at all which makes subsequent calculations basically guesses.
 
  • Like
Likes   Reactions: FactChecker
@varul92 I notice that you haven't replied to these responses. It could be that the responses have assumed too much about what you know. Could you give PF an idea of your present level of knowledge and also more about the project you are involved in?
 
  • #10
Hi @sophiecentaur

Sorry For the late replies, I am using this accelerometer in my car with ESP8266 to find out the distance my car has been traveled from the initial point to the final point after a specific interval of time specified in the program by me. Mentioned above formulae by me were searched from Arduino forums but I wasn't sure to make it work with my device I need some good suggestion to make it work.

I am thankful and even going through all the replies everyone mentioned and will update you shortly with my results too
 
  • #11
varul92 said:
I am using this accelerometer in my car with ESP8266 to find out the distance my car has been traveled from the initial point to the final point after a specific interval of time specified in the program by me.
Are you talking about the linear distance of the path traveled or about the distance "as the crow flies" between the initial and final position?
In the first case, forward acceleration of the car can be simply integrated to velocity and then integrated again to distance. You should understand that small errors can accumulate. Also, initial velocity must be zero or known and input.
In the second case, you definitely need the full complexity of an inertial reference system, with gyroscopes to determine the direction that the car is pointed.
 
Last edited:
  • #12
So this is a car acceleration / velocity / distance project. That is important information.

As several people have pointed out, integrating acceleration twice amplifies errors. One source of error is pitch error. The car pitches up under acceleration, plus no road is perfectly level. A simple accelerometer sees pitch as acceleration.

A better approach would be to use the accelerometer to sense the beginning of acceleration, plus tap into the vehicle speed sensor (VSS) to get velocity and position. The VSS signal can be counted to get position directly and accurately, and differentiated to get velocity. The primary error in the VSS signal is the exact tire diameter, which you can get from a calibration run. Another error, of course, is spinning the wheels. Other sensors measure wheel rotation for the anti lock brake system. Tapping into the wheel sensor of a nondriven wheel will get you actual velocity when the driven wheels are laying rubber.

Velocity from the VSS signal is available from the OBD buss, but that source has latency. Latency means that the velocity on the OBD buss is delayed from the actual velocity. The OBD buss is a good source of velocity for normal driving, but not so good for measuring drag race performance.
 
  • Like
Likes   Reactions: Dale

Similar threads

  • · Replies 47 ·
2
Replies
47
Views
5K
  • · Replies 1 ·
Replies
1
Views
2K
Replies
4
Views
2K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 10 ·
Replies
10
Views
3K
  • · Replies 4 ·
Replies
4
Views
5K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 4 ·
Replies
4
Views
9K
  • · Replies 10 ·
Replies
10
Views
3K
  • · Replies 12 ·
Replies
12
Views
25K