cancel
Showing results for 
Search instead for 
Did you mean: 

MEMS ACCELEROMETER LSM6DSV16X Remove Gravity

FilipeLourenço
Associate II

I am using steval mkbox-pro with FP-SNS-DATALOG2 to get acceleration from the subway train.

How can i remove the gravity effect in measurements from the LSM6DSV16X accelerometer?

 

15 REPLIES 15

Thanks @Andrea VITALI.

I will try to do the implementation.

 

Hello @Andrea VITALI 

After reading all the design tips that you recommended, i saw that DT0060 using gyro was the best since i am going to do acquisition on a moving subway train, so i have linear acceleration too.

But in DT0060 i have to get the initial orientation, how can i do that? Using DT0058 (acc+mag) just for the first value of acquisition(when i know that the sensors are not moving)? Does DT0058 also works without using low power accelerometers?

Another question, you talked about doing the magnetometer calibration...I have to calibrate all the sensors that i want to use? Or it's already calibrated? I am using LSM6DSV16X and LIS2MDL.

Thanks again for the help!

 

Hi @Andrea VITALI ,

I also have both accelerometer and gyroscope with 7680kHz but Magnetometer only uses 100Hz maximum. What can be the best way to remove the gravity acceleration without using magnetometer. 

Remind that i am acquiring in a moving subway boggie, and have steval mkbox pro.

Thanks!

the complementary filter architecture described in DT0060 is the following:

1. start with the current best estimate of the orientation

2. update this using gyro data and obtain a new estimate (estimate 1)

3. obtain another estimate from acc and mag data (estimate 2)

4. combine the two estimates to get a new best estimate, usually estimate 1 from gyro is given a large weight (99%) and estimate 2 from acc and mag is given a small weight (1%)

The weight can also be set based on sensor data: for example if acc norm is close to 1g it is probably measuring only gravity, and gyro output is close to 0 we are probably static, and mag norm is close to expected value there is no mag anomaly, then one can give more weight to estimate 2 from acc and mag, leading to a faster recovery of the gyro integration error when motion stops.

Note that estimate 2 is always needed because otherwise the gyro integration error will accumulate over time. Having estimate 2 at a lower rate is ok, when you have it just mix this in with estimate 1 from gyro. If you only have estimate 1 then that counts 100% of course.

Gyro bias (the non-zero output when angular velocity is zero) must be calibrated and compensated. This is typically done measuring the non-zero output in static conditions, recording it, and subtracting it from gyro output before it is integrated.

Magnetometer hard-iron (the spurious offset) must be calibrated and compensated (see DT0059). Suitable motion must be executed by the user to get a successful calibration. Hard-iron is the most important error to compensate, there are other known as soft-iron which matter less but can also be compensated.

All this is no small task: better to use our off-the-shelf fusion MotionFX which comes in X-Cube-MEMS1 package. MotionFX does gyro bias compensation and magnetic calibration automatically, moreover is based on Kalman filter more advanced with respect to complementary filter.

 

@Andrea VITALI Thanks for all your help and patience!

I think i understand your explanation, however it seems a very hard task for me. 

I would prefer to use the MotionFX which comes in X-Cube-MEMS1 package, but that can only be used during the acquisition right? (Not in post processing)

Because, if i understood it, that can only do acquisition at 100Hz and i need much more, that's why i am using FP-SNS-DATALOG2. I cannot combine both right?
And if not, there is no other way than do it manually?

 

Correct, MotionFX can only run on STM32.

MotionFX is computationally expensive and one must check that the clock rate of the micro is high enough to process all samples coming from the sensor. This usually means 100-400Hz max speed depending on the STM32 model and clock.

It seems you need calibration and fusion in post-processing which is something we do not currently offer.