Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Removing gravity from accelerometer

Hi,

 

Is there an easy way to remove the gravity readings from the accelerometer?

 

Thanks,

Best Answer
0 Votes
7 REPLIES 7

Perhaps not a trivially easy way...

 

Convert the acceleration readings to a vector (magnitude and angles). Subtract g from the magnitude of the vector. Convert the modified vector back to (x,y,z).

 

I find that the inclusion of gravity is helpful because it lets me use accelerometer readings as de facto orientation readings, when there is no separate orientation sensor.

Peter McLennan
Gondwana Software
Best Answer
0 Votes
Thanks,

My math is aweful, looks like I'm going to have to read up on it.

What I'm looking to get is the actual velocity of wrist movement. What I
think I need to do is remove gravity from the readings and then use the xyz
velocity to calculate the actual velocity. So I don't think including
gravity will help me.
Best Answer
0 Votes

for velocity i would go with a vector as said :

convert xyz readings to a distance using this formula : 

 

var movement_total = Math.round((Math.round(10000 * Math.sqrt(accelerometer.x * accelerometer.x + accelerometer.y * accelerometer.y + accelerometer.z * accelerometer.z)) / 100))

 

then do this at a time T1 then at a time T2, substract the first measure to the second will automatically remove the gravity from the equation. 

 

edit : physicists would correct, it's not a distance since it's acceleration that is measured, but it will work. 

Best Answer

Thanks,

 

I don't think I am following though. The equation seems to be calculating the actual acceleration. What do the 10000 and 100 represent?

If acceleration is a constant 5m/s/s(accelerometer readings of 3,4,0). Are you saying the calculation measured ove1 second should be 

5*1 - 5*0 = 5.

 

So the velocity is 5m/s?

 

Best Answer
0 Votes

so the x10000 / 100 is only there to round to 2 digits after 0 (with math.round function), not useful in your case.

 

For your case, let's say that acceleration is 5m/s^2 as you said, basically after one second, your device would have move 5 meters from the starting point so the calculation is right (5m/s). The difficult part is to get to distances when acceleration is null, which depends on initial velocity and direction. 

For accounting for direction, I would calculate the delta of each coordinate acceleration, so a deceleration would be taken into account.

Best Answer
0 Votes

The issue I have there then is that Fitbit includes gravity. So instead of acceleration readings of 3,4,0 the reading would be 3,4,9.8 which works out at an acceleration of 11m/s/s and a velocity of 11m/s according to the above.

Best Answer
0 Votes

yes true- so the only solution is to get orientation, in order to know where the g value should be corrected at t0 and t1. Then 

 

From what I know, the Ionic is the only one with orientation/gyroscope

Best Answer
0 Votes