sparkfun / SparkFun_ICM-20948_ArduinoLibrary

Arduino support for ICM_20948 w/ portable C backbone
Other
168 stars 72 forks source link

Question about DMP Mount Matrix #152

Closed dobodu closed 56 minutes ago

dobodu commented 2 days ago

Hi mark,

Once again, thank you for this piece of work, I was soo much inspirated by your code for my Micropython Library.

I am wondering on the way you set the mount matrix in your library. Let me exmplain.

The mounting matrix is a rotation matrix where normally Q.tQ = 1 (in other words determinant = 1) I totally understand the way your library works, adding a scale factor to output directly in uT (versus hardware unit).

However, if the rotation matrix can be expressed as 9x9 32bits numbers, the DMP compass output is a 3-tupple of 16 bits. For example, X-axis (M00 factor) is 0x09999999 so whenever the raw magnetometer data is 0x01, 0x01 * 0x09999999 lead to an output > DMP compass register capacity.

I am wrong (I might missed something, and I'm a bit lazy do dig in Inversense Nucleo code)

PaulZC commented 56 minutes ago

Please see DMP.md

image

For more details, you will need to dig into the InvenSense Nucleo code...