Integrating accelerometer data (obtain velocity and distance)

Click For Summary
The discussion focuses on using an accelerometer to measure distance and velocity, with challenges related to noisy acceleration data. The user is experimenting with filtering techniques, including low-pass moving averages and filtering windows, to improve data accuracy. Suggestions include using the trapezoidal method for integration and calibrating sensors based on consistent results, as the user consistently measures 5.81 meters instead of the expected 4.8 meters. A Kalman filter is mentioned as potentially beneficial for precise readings, but may be unnecessary given the averaging approach. Overall, the conversation emphasizes the importance of calibration and exploring different track lengths to assess measurement accuracy.
SrTp
Messages
1
Reaction score
0
Hi everyone!

I'm trying to work with an accelerometer to measure distances (straight line) but I'm not being very successful..

I've made this experiment: attached the accelerometer to a electric slot car and accelerate it to the maximum until it reached the end of a straight line track with 4.8 meters long.
The sampling was made every 10 milliseconds.
In the end, it crashes into a pillow (:D) but I'm not considering those crash accelerations to the calculus.

The acceleration values are incredibly noisy...and my questions are:
- which initial filter should be applied to the noisy samples? a low pass moving average?
. how do I know which is the best number of samples to consider in the average? 2, 3, 4,..?

- after that I've read that we could apply something like a filtering window to discriminate between "valid" and "invalid/noisy" accelerations. If the acceleration values are in that window they should be changed to 0.0, indicating that there is no movement therefore no velocity and then the distance will not be incremented.
. so...once again, how can I determine the best values for that window? How can I be sure that I'm not excluding important values or including noise?

- I've also read about kalman filters but they might be too difficult for me to understand..I think.

For the integration calculus I'm using a first order approximation - trapezoidal method (hope I'm doing it well...). Btw, is this the best method or there are many others I should try?

With my trapezoidal method applied to raw data and without any filter I'm getting 5.81 meters. I've tried to apply the moving average filter but it doesn't seems to help.
For the filtering window method I'm not sure which values to apply so I'm not getting good results.

If needed I can post the accelerometer raw data...

Hope someone can help me!
Best regards :smile:
 
Physics news on Phys.org
Your Integration is probably doing exactly what a moving average would do so I don't think that will help. If you consistently come put with 5.81 instead of 4.8 I would think that noise is not an issue, and would just use that run as a calibration for your sensors. Can you try different track lengths and see if the "error" is proportional?

A Kalman filter would be useful if you needed accurate instantaneous acceleration values, but since you are "averaging" them all together the individual reading errorss will tend to cancel each other out.
 

Similar threads

Replies
11
Views
24K
  • · Replies 4 ·
Replies
4
Views
9K
Replies
8
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 4 ·
Replies
4
Views
9K
Replies
10
Views
2K
Replies
2
Views
3K
  • · Replies 14 ·
Replies
14
Views
2K
  • · Replies 8 ·
Replies
8
Views
5K