Hello, I'm using a BHI260AB chip with an STM32 as the host processor. To start I want to do something very simple now, which is basically taking the gravity vector measurement and with that vector figure out the inclination angle of my device. So, I have the BHI chip with the following references (in red): Then we have the gravity: Then when the chip has a certain inclination: In this picture, gravity has just two components (YZ) because the drawing shows a rotation around the X-axis (it's easier for me to draw this 2D scheme). But let's assume that the chip can have any orientation and the gravity is decomposed into the three axes. On my project, I have an initial position of the device which is when the BHI chip is in the following orientation: This orientation is considered to be the 0° inclination. And the inclination angle is calculated by doing the following: alfa = arcsin(gz / g); Where gz is the module of the Z component of the gravity and g is the module of the gravity. So I do that calculation with my STM32 and I was surprised when I placed the device in the initial position (picture 4). My alfa angle was showing 6° of inclination. I was expecting the angle not to be 0°, but not to have such an error in the initial position. Inspecting the g components got from the BHI chip in the initial position I got the following: x = 0.017333984375 g y = -0.992431640625 g z = 0.120361328125 g I'm very surprised by the Z component. It should be very low, but it's not. As a comment, I didn't run any calibration on the chip or any offset correction before these calculations. I just connected the chip and used it as it was. But still, I'm concerned about the magnitude of the error. Is there something that I should do before using the gravity vector? I didn't try the same by using the accelerometer values instead of the gravity virtual sensor. But I guess the gravity virtual sensor is based on the accelerometer readings. So, It should be the same. I hope anybody can help me. Thanks!
... View more