cancel
Showing results for 
Search instead for 
Did you mean: 

How can I calibrate lsm6dso imu sensor ? the sensor can be positioned in any way. And in these different positions I have to calibrate the sensor when the device is turned on. my different number of sensors will use this app.

Iakgu.1
Associate III

How can I determine the offset values? After determining I will use the following example.

https://github.com/STMicroelectronics/STMems_Standard_C_drivers/blob/master/lsm6dso_STdC/example/lsm6dso_offset.c

1 ACCEPTED SOLUTION

Accepted Solutions
Eleon BORLINI
ST Employee

Hi @Iakgu.1​ ,

for the gyroscope, you have no dependency of the zero rate level (G_TyOff parameter in the datasheet, p. 9) offset with the position, so you can simply acquire the gyro output in a steady condition in order to evaluate the residual post solder offset, and compensate it in post processing.

For the accelerometer, you have to take into account the gravity field: in this case it would be better to know your position, in order to understand the portion of earth gravity offset along each axis. However, you could think to place the LSM6DSO in a steady condition (regardless the actual position of the device in space), and use the high pass filter (datasheet p.58) to cut the 1g gravity from each axis. In this way the residual contribution to the output would be given by the offset.

For a general overview on the available firmware calibration libraries running on STM32, you can refer to the X-CUBE-MEMS1 package, especially the MotionAC accelerometer calibration library and the MotionGC gyroscope calibration library.

-Eleon

View solution in original post

4 REPLIES 4
Eleon BORLINI
ST Employee

Hi @Iakgu.1​ ,

for the gyroscope, you have no dependency of the zero rate level (G_TyOff parameter in the datasheet, p. 9) offset with the position, so you can simply acquire the gyro output in a steady condition in order to evaluate the residual post solder offset, and compensate it in post processing.

For the accelerometer, you have to take into account the gravity field: in this case it would be better to know your position, in order to understand the portion of earth gravity offset along each axis. However, you could think to place the LSM6DSO in a steady condition (regardless the actual position of the device in space), and use the high pass filter (datasheet p.58) to cut the 1g gravity from each axis. In this way the residual contribution to the output would be given by the offset.

For a general overview on the available firmware calibration libraries running on STM32, you can refer to the X-CUBE-MEMS1 package, especially the MotionAC accelerometer calibration library and the MotionGC gyroscope calibration library.

-Eleon

Iakgu.1
Associate III

Thank you for your answer. Please confirm if I got it right. @Eleon BORLINI​ 

I will take measurements while the device is stationary.

if the gyroscope measures 10, 20, 30 dps in three axes, I will subtract 10, 20, 30 dps from the values I read after each measurement.

For the accelerometer, I will first apply a high pass filter. I'll take measurements later.

If the measured values are 10,20,30 mg, I will apply these values to the offset registers of the accelerometer.

The values I write to the offset registers will be automatically subtracted from the values to be measured in the future.

Hi @Iakgu.1​ ,

basically yes, even if for the accelerometer a check in a known condition, for example flat in X and Y (where you know that the 1g gravity vector should be equal to 0 in ideal case) would be very useful.

-Eleon

Iakgu.1
Associate III

thank you again @Eleon BORLINI​