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

In summary: 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.
  • #1
varul92
2
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
  • #2
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:
  • #3
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 Fededevi
  • #4
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.
 
  • #5
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 Fededevi
  • #6
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 sophiecentaur
  • #7
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 FactChecker
  • #9
@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 Dale

1. What is an accelerometer sensor and how does it work?

An accelerometer sensor is a device that measures acceleration or changes in motion. It works by using a small mass suspended by springs inside the sensor. When the sensor experiences acceleration, the mass moves and this movement is converted into an electrical signal that can be measured.

2. How do you find the acceleration from the output of an accelerometer sensor?

To find the acceleration from the output of an accelerometer sensor, you need to use the formula a = F/m, where a is the acceleration, F is the force acting on the mass, and m is the mass of the object. The force can be calculated by multiplying the output voltage of the sensor by the sensitivity of the sensor.

3. How do you calculate the distance from the output of an accelerometer sensor?

The distance can be calculated by using the formula d = 1/2at², where d is the distance, a is the acceleration, and t is the time. This formula is based on the fact that the distance traveled is equal to half the acceleration multiplied by the square of the time.

4. What are the units of measurement for acceleration and distance in an accelerometer sensor?

The units of measurement for acceleration are typically in meters per second squared (m/s²) or in G-forces (g). The units for distance are typically in meters (m) or in centimeters (cm), depending on the sensitivity and resolution of the sensor.

5. How accurate are the measurements from an accelerometer sensor?

The accuracy of the measurements from an accelerometer sensor depends on various factors such as the quality and calibration of the sensor, external factors like temperature and humidity, and the precision of the measurement equipment. Generally, modern accelerometers have a high level of accuracy and can provide precise measurements with minimal error.

Similar threads

Replies
1
Views
1K
  • Electrical Engineering
Replies
3
Views
1K
Replies
8
Views
2K
Replies
2
Views
731
Replies
4
Views
4K
  • Mechanics
Replies
10
Views
2K
Replies
4
Views
8K
  • Electrical Engineering
Replies
7
Views
2K
  • Mechanics
Replies
8
Views
4K
Replies
12
Views
23K
Back
Top