ADXL Accelerometer data to speed

AI Thread Summary
Calculating speed using an ADXL330 accelerometer involves integrating acceleration values from the X, Y, and Z axes. To derive a single acceleration value, the formula sqrt(x^2 + y^2) can be used, focusing on horizontal movement while ignoring vertical fluctuations. Implementing a Kalman filter is recommended to reduce noise in the data for more accurate results. Users have shared experiences with sample data, noting discrepancies such as incorrect readings indicating reverse motion when the vehicle was stationary. For projects involving speed and direction logging, selecting appropriate devices and methods is crucial for accuracy.
wa5211
Messages
10
Reaction score
0
I am in need of a little guidance.
I am trying to calculate the speed of travel using an ADXL330 accelerometer, with values in the X Y and Z directions. I know this isn't a particularly accurate way of calculating the speed of travel but its this is the only component i have at my disposal

I have been trying different formulas for converting the three output values into a speed in MPH but so far i have been having no look. Is there a generic equation that i am overlooking.

Any guidance would be greatly appreciated
 
Physics news on Phys.org
What type of vehicle are you trying to calculate the speed of?
 
Initially a car traveling in a straight line which accelerates from a motionless position to a set speed, and then decelerates back to 0 again.
 
You need to integrate the acceleration to get speed.
Measure the acceleration regularly in small time increments and multiply by the time

eg if you measure an acceleration of 2m/s^2 at 1ms then after another 1ms you are going = 2 m s^2 * 0.001 s = 0.002m/s faster

In practice you need a more complex scheme (like a Kalman filter) to smooth out noise in the data
 
Last edited:
That sounds good but how do i get from 3 accelerations in the three different axis, to one acceleration?
 
sqrt( x^2 + y^2 + z^2) gives you the overall acceleration

Or you mount the device with one axis (say X) pointing forward and just use that one for the forward speed. If you want accurate speed in corners you will need the x and y, sqrt(x^2 + y^2)
You probably don't want to include up and down bouncing on the road as part of your 'speed' so ignore Z.
 
Thats great, i have been playing around with that equation recently but will have another go tomorrow to see what i can get out of it.
I have sample data that i know acceleratesd to 60MPH so i will see if i can get some data relatively near that value

Thanks for you help so far!
 
I have been toying with this all day.

I have some sample data which i collected on a run in the car. The data is accelerometer values from the 3 axis of acceleration for a car journey in a straight line. The car accelerates from a standing start to 60 MPH and then decellerated back to a standing position. No matter what modifications i do to the calculation, it appears that the results tell me that the car is reversing very quickly at the end of the data i collected when i know for a fact the car was stationary.

If i post my data would anyone be willing to look at it and see if they get the same results i do?

File has been updated to a working version
 

Attachments

Last edited:
The file seems to be corrupted
 
  • #10
File has been updated to a working version. Sorry for the problem
 
  • #11
That looks about normal for accelerometer data.
Because of the noise and the small values you have to do more than just subtract the value from the previous one - take a look at Kalman filters.
 
  • #12
Ok, il have a look at Kalman filters, thanks for your help
 
  • #13
In file: 0-60 Raw Values.xls
I don't know why (Convert to G-Forces) = (Remove initial calibration error)/500?
what is 500?
 
  • #14
Hi..
I've taken up project on Event data recorder as my final yr project. I want to log in the speed as well as the direction of motion of vehicle into a memory card . Firstly i want to calculate the vehicle's speed using a 3-axis accelarometer and micro-controller ( interfaced with RTC )& record those values into memory device along with vehicle's path ( left,right,straight ) Could anyone suggest me the proper devices to be used for this project so that i can get the max accuracy in my calculations ?? Please guide me. I request the ones who hav already tried this thing to please give me satisfactory replies.. Hope to hear from you soon
 
  • #15
Hello, any idea how does it work at sea on a vessel? On land, it is relatively easy. But at sea, I found that all 3 axes (x, y and z) show positive and negative accelerations when the vessel is moving and even stationary at terminal.
 
Back
Top