Hi, I am trying to get the orientation information from Qwiic 9DoF - ISM330DHCX, MMC5983MA, connecting them to ESP32 WROOM (USB-C). But there is no combined tutorial for both, like 9DOF_Razor_IMU; there are only the separated tutorials for each.
Now I am trying to do the sensor fusion with preprocessing(Convert Gyro units from dps to rad/s→Axis Alignment(by different z-axis)→Hard-Iron offset calibration for magnetometer)
Could anyone confirm if this workflow is appropriate for the Qwiic 9DoF board? Also, are there any specific issues or “gotchas” related to coordinate system alignment between the ISM330DHCX and MMC5983MA on this PCB that I should watch out for?
I’m still learning the fundamentals of sensor fusion, so I’d really appreciate your feedback. Thank you!
All sensor axes must be consistently aligned with respect to each other and form a right handed coordinate system. That may require you to reassign certain axis labels or signs in the code.
Thank you for your advice! Is there no reference or example code regarding that? I will try following your advice, but as a beginner, there’s a bit of a hurdle. I will try with Gemini even though there is nothing, but I want to avoid the black-box problem.
The data sheet shows how the sensor axes are oriented with the IC package, and inspection of the PCB shows how they are mounted. The PCB also has markings that inform you of the axial directions for each sensor. Every sensor manufacturer does it differently.
However, nothing beats running an example program to print out the raw data from each sensor, pointing the board in various directions, and making certain that YOU understand what the values and signs along X, Y and Z mean in terms of the real world directions of the gravitational and magnetic field vectors at your location.
For example, in the northern hemisphere at mid latitudes, the Earth’s magnetic field points strongly down, as well as to magnetic North (the vertical component is larger than the horizontal component).
If you don’t get this right, the resulting calculations will give meaningless results. Also, the magnetometer and gyro always require careful calibration.