cancel
Showing results for 
Search instead for 
Did you mean: 

LSM6DSV half precision error at ~180 degrees

Gorbit99
Associate III

Hi,

We're using the lsm6dsv's SFLP algorithm to calculate IMU rotation. Recently however we noticed that the resulting rotation has big gaps at around the 180degree mark. We believe this is because of the half float precision, specifically because there aren't a lot of representable values near 1. See below image for our calculated accuracy results which match the actual results we're seeing:

1000000957.png

 

23 REPLIES 23

Hi Andrea,

thank you very much for the valuable insights!

How about the ISM330BX? Are the quaternion components also stored in such embedded advanced features registers and which are they?

Kind regards,

Felix

Yes, it should work - I had no time to test it. Please try the attached application example.

You will notice that there is an additional step during the configuration to enable SFLP in the correct way for ISM330BX as specified in AN6109 section 6.5.

flaufer
Associate II

Hi @Andrea VITALI ,

thank you very much, this seems to work.

However, I noticed quite some delay/lag between the quaternions obtained regularly from the FIFO and via the embedded advanced features registers. While the FIFO orientations are up to date, the ones obtained from registers 0x4C - 0x53 seem to be kind of low-pass filtered. This becomes an issue when I select a higher SFLP frequency such as 240Hz. For instance, at 240Hz when I flip the device by 90° it takes several seconds until the output orientation settles and approaches the correct values. It's better at 120Hz but still the orintation is delayed compared to the FIFO data. Any idea why this is the case?

EDIT: Nevermind. My I2C reads and writes were too slow causing the delays. Now it works just fine. Thanks again!

 

Exactly :) the I2C slow readout process can cause delays.

The quaternion you read from the memory is identical to the quaternion you read from the FIFO, except that the one in the FIFO has the sign changed so that the qw component is always positive.

(Q = [qw,qx,qy,qz] represents the same orientation as -Q = [-qw, -qx, -qy, -qz], we need qw to have positive sign when we store qx,qy,qz in the FIFO so that we can reconstruct qw using +sqrt as discussed before)