ICM20648 DMP, how to reset Game Rotation Vector?

By blazs120gl , 6 February 2019

Hello all! I'm new to this forum. I've adapted the emd v. IC demo to run on my ICM + SPI setup.
It will load the DMP firmware and I can enable the gaming rotation vectors (quaternion). As it can be expected from a compass-less device, the yaw is drifting as this axis can't be corrected from the gravity vector (axis of drift and vector parallel) and no other source of reference is available.

The drift itself would be no problem if I could just zero the DMP quaternion. Offsetting the error (measuring the initial position and calculating the 'error', then subtracting it when a 'center' command is received) is not a solution as the quaternion keeps deviating until it 'sticks' in a terminal position and correcting it will not make it move to that direction anymore.

Is there a way to reset the DMP quaternion on-the-fly?

The demo example provides no such option (via these user menu options on the serial port).
Currently I'm doing a SW reset but this is pretty bad workaround, slow and not suitable for an automatic correction (it might enter into a reset loop).

Thanks very much in advance!

phpbb Topic ID
37406