cancel
Showing results for 
Search instead for 
Did you mean: 

LSM6DSO not reading 1G at rest

Diogo_Goto
Associate II

I  am writing my own library in C++ to operate the LSM6DSO and when the sensor is at rest it reads 0.5 G on the z-axis, I've tried the code with 2 ICs, one in an Adafruit breakout board, and another one in an old PCB that had the sensor soldered one and both got the same error, so I believe that the issue might be in the code, but I can't identify where is the problem. Btw, I am using the dev kit NUH7AZIQ$ATZ3A140012 (STM32H7A3ZIT6Q). Also, when i turn the sensor 90 deg the 0.5g moves to the other axis, and regardless of the range scale I choose, the readings adjust themselves so that it still gives the 0.5 G after applying the conversion factor .

Diogo_Goto_0-1739051739233.png
The first line shows the reading from the CTRL1_XL register and breaks it down into the configurations in that register (which in this picture is set up to +-2G range and sampling of Hz)
the second lines show the reading from the OUTZ_L_A (2Ch) and OUTZ_H_A (2Dh) registers, then it combines that into the raw data and multiply by the sensitivity factor suggested in the data sheet for each range ( in this case 0.0061) 

Diogo_Goto_1-1739054006872.png

Small programs that plots the lsm6dso outputs, as I turned the imu, the 0.5 g readings moved to the other axis

Diogo_Goto_2-1739054522593.png

Here is the part of the code, in this section I its not exactly the library i am writing but it has follows the same procedures and gets the same numbers.




14 REPLIES 14

I fixed the thing you mentioned, and the behaviour of the Gyroscope changed a lot; now it seems to be more sensitive, but I guess it's still within a reasonable range. And it didn't change anything for the accelerometer

Diogo_Goto_0-1740851466746.png

Now the ADDR : 0x11 (CTRL2_G) = 0x42 

 

 

 

No more ideas on what could be wrong. LSM6DSO has been in production for years now and there are no known issues with the HW or with the official standard C drivers.

Last question: did you write to some wrong register address? (there are few undocumented register addresses which hold the factory calibration including the sensitivity and if you happen to write them then the sensor will not behave correctly and calibration will be compromised)

Can you double check that you are using LSM6DSO?

If you are using LSM6DSO32 then the '01' full scale bits would correspond to 32g and then the conversion factor would be 0.976 which would give you the right values

 

The ic is on a old breakout board used by our team, so I can't ensure that no one wrote to any unlisted address.

Also, this breakout board was bought from adafruit and its listed as lsm6dsox, which according to their datasheet is the lsm6dso not the lsm6dso32.

Understood. The WHO_AM_I register is the same in both cases. However, because we are now sure that configuration is correct because we have read it back, and we are sure that int16 values are read correctly, we can conclude that you are using LSM6DSO32 or LSM6DSO32X.