2 weeks, 5 days ago.
How to get time value from accelerometer readings
I am doing a project with ADXL313. my goal is to study the rotational behavior of accelerometer. For that, I need to extract the velocity value from accelerometer data. I am very confused as the accelerometer gives the output in mg/LSB form how we can extract the velocity data from there. To get acceleration value I divide the readings of accelerometer and after that calculate the magnitude by sqrt(x^2+y^2) but now I am confused that how I will calculate the velocity if I don't have the time value as we know the formula for calculating velocity is a/t. please help me to solve this issue.
2 weeks, 5 days ago.
as we know the formula for calculating velocity is a/t
That formula is wrong. Velocity can be calculated from acceleration as integral over time. The correct formula is:
v0 + Integral of
v0 is the initial (starting) velocity at time
ais the acceleration varying over the time
t0 is the initial (starting) time
tis the time variable
tcurrent is the time at which we calculate the velocity
Acceleration and also velocity are vectors. To calculate acceleration in Cartesian coordinate system the formula shall be applied for each coordinate (x, y and z). One can use a
Timer to produce time data associated with the measured acceleration but because the calculation involves integration, small errors in the acceleration lead to a large build up of error in the calculated velocity. And there are also other things to consider:
- The output of ADXL313 is affected by Earth gravity. No one (including an ADXL313 sensor) is able to distinguish a gravitational field from acceleration (as explained by A.Einstein in his thought experiment "Elevator Action").
- A spinning ADXL313 will show increased acceleration in the radial direction but the sensor won't actually travel off the position.
To sum it up, I think it's impossible to reliably calculate velocity using just data measured by an ADXL313 sensor.
2 weeks, 4 days ago.
First, review the formula for velocity... it is integration of acceleration over time (a*dT where dT needs to be made as small as possible). If, for example, the accelerometer only outputs updates at 10Hz then dT can not be smaller than 0.1. But, as you will found out, this too can lead to errors. So review Kalman filtering before just assuming you can do a simple integration.