2 deleted 4 characters in body
source | link

Your main mistake is in not treating acceleration as a single vector. When the car is at rest, that vector will always be 1 g downwardsupwards. Don't look at just the X component of the raw accelerometer data. Do the real vector math.

But my problem is that when the device is on tilt (0g when no tilt) the acceleration is between (downward) 0g->-1g or between (upwards) 0g-> 1g.

No. This is the point. What you are saying may be true for the X component of the accelerometer output, but it is not true for acceleration when the car is at rest.

The ideal measured acceleration will always be the actual acceleration of the car (relative to the earth), plus the 1 g acceleration due to gravity. The latter is always in the downup direction. If you know the orientation of the car, then you can subtract off this 1 g due to gravity to find the acceleration you are actually looking for.

Note that there is considerable error in such readings, especially from cheap MEMS sensors. While you should be able to get a good idea about short term events like hard acceleration or hard braking, this data is nowhere near good enough to do inertial navigation for more than a few seconds at best.

Your main mistake is in not treating acceleration as a single vector. When the car is at rest, that vector will always be 1 g downwards. Don't look at just the X component of the raw accelerometer data. Do the real vector math.

But my problem is that when the device is on tilt (0g when no tilt) the acceleration is between (downward) 0g->-1g or between (upwards) 0g-> 1g.

No. This is the point. What you are saying may be true for the X component of the accelerometer output, but it is not true for acceleration when the car is at rest.

The ideal measured acceleration will always be the actual acceleration of the car (relative to the earth), plus the 1 g acceleration due to gravity. The latter is always in the down direction. If you know the orientation of the car, then you can subtract off this 1 g due to gravity to find the acceleration you are actually looking for.

Note that there is considerable error in such readings, especially from cheap MEMS sensors. While you should be able to get a good idea about short term events like hard acceleration or hard braking, this data is nowhere near good enough to do inertial navigation for more than a few seconds at best.

Your main mistake is in not treating acceleration as a single vector. When the car is at rest, that vector will always be 1 g upwards. Don't look at just the X component of the raw accelerometer data. Do the real vector math.

But my problem is that when the device is on tilt (0g when no tilt) the acceleration is between (downward) 0g->-1g or between (upwards) 0g-> 1g.

No. This is the point. What you are saying may be true for the X component of the accelerometer output, but it is not true for acceleration when the car is at rest.

The ideal measured acceleration will always be the actual acceleration of the car (relative to the earth), plus the 1 g acceleration due to gravity. The latter is always in the up direction. If you know the orientation of the car, then you can subtract off this 1 g due to gravity to find the acceleration you are actually looking for.

Note that there is considerable error in such readings, especially from cheap MEMS sensors. While you should be able to get a good idea about short term events like hard acceleration or hard braking, this data is nowhere near good enough to do inertial navigation for more than a few seconds at best.

1
source | link

Your main mistake is in not treating acceleration as a single vector. When the car is at rest, that vector will always be 1 g downwards. Don't look at just the X component of the raw accelerometer data. Do the real vector math.

But my problem is that when the device is on tilt (0g when no tilt) the acceleration is between (downward) 0g->-1g or between (upwards) 0g-> 1g.

No. This is the point. What you are saying may be true for the X component of the accelerometer output, but it is not true for acceleration when the car is at rest.

The ideal measured acceleration will always be the actual acceleration of the car (relative to the earth), plus the 1 g acceleration due to gravity. The latter is always in the down direction. If you know the orientation of the car, then you can subtract off this 1 g due to gravity to find the acceleration you are actually looking for.

Note that there is considerable error in such readings, especially from cheap MEMS sensors. While you should be able to get a good idea about short term events like hard acceleration or hard braking, this data is nowhere near good enough to do inertial navigation for more than a few seconds at best.