I'm running the Embedded MotionDriver 6.12 software on a Cortex-M0 processor and communicating with a MPU-9250 via I2C. I'm using the DMP to perform 6-axis fusion and the MPL to add in the compass data for 9-axis fusion. I have several questions about the MPL library.
1) How can I determine the status of the compass calibration? Presumably I need to perform some figure-eight patterns with the device to calibrate it. How do I know when I have done enough and the MPL is performing 9-axis fusion?
2) How can I determine if a large magnetic disturbance has been detected and the MPL has fallen back to 6-axis fusion?
3) I have enabled the "heading from gyro" algorithm to allow 9-axis fusion before the compass is calibrated. How do I know when the MPL switches over to using actual compass data?
4) Do the "fast no-motion" and temperature compensation algorithms for the gyroscope apply to the 9-axis fusion quaternion data or just to raw gyro data? Since the DMP is performing the 6-axis fusion, I'm guessing the only gyro calibration applied to the fusion result is the "GYRO_CAL" feature performed by the DMP.
5) Is there any documentation on the MPL functions? There was none included in the MotionDriver 6.12 zip file and the header files don't have any comments.
Thanks,
Austin
Hi Austin,
I think inv_got_compass_bias() in results_holder.c will tell you when the compass bias has been established. My guess is that if you have set 9-axis fusion enabled, then as soon as the compass bias has been established, the MPL will switch to 9-axis fusion.
I am not sure if "heading from gyro" gives 9-axis fusion before the compass is calibrated. 9-axis fusion is adding compass readings to the fusion to add a drift free reading into the mix. No compass, no drift free element.
I also would like much better documentation.
Thanks,
Justin
Justin,
Thanks for your response. I tried using inv_got_compass_bias(), but it always stays equal to zero, no matter how many figure-eights I do. I have called the following to enable 9-axis fusion and compass calibration:
inv_enable_quaternion();
inv_enable_9x_sensor_fusion();
inv_enable_vector_compass_cal();
inv_enable_magnetic_disturbance();
Any other ideas?
Austin
Are you reading the compass and loading into the mpl?
In the driver download you will find an example application which has the core data loop for reading the dmp fifo and loading into the mpl.
Justin
Justin,
Yes, I am reading the compass and loading it into the MPL using the inv_build_compass() functions. Below is the code that runs in my main loop that I copied from the example application. See anything I'm missing?
Austin
can't seen anything missing. Have you set the compass sample rate and scale? I also use inv_enable_eMPL_outputs(). Are you getting good compass data in your data loop?
Good Luck,
Justin
Justin,
I'm back to looking into this issue of how to determine if the magnetometer is calibrated. I tried inv_got_compass_bias() and inv_get_compass_state() both functions always report zero, before or after some figure-eights.
Below is my IMU init code. Please review. Thanks.
Austin
can't see anything wrong.
Silly question, but have you set the correct compiler definitions e.g. COMPASS_ENALED?
Have you double checked you are actually getting good mag readings. Maybe you have a damaged device?
Also figure of 8 needs to cover all directions as the library is mapping out the bias ellipsoid so make sure you are rotating through all angles.
It seems to work fine for me.
Hope your have more luck.
Justin
Justin,
Thanks for reviewing my code and for the tips on how to perform good figure-eights. That did it. The accuracy value went to 3 and the return value of inv_got_compass_bias() became 1.
Austin
Hi abkirchhoff.
I apologize i bring up this old topic. However I have a similar situation with yours.
The accel and gyro accuracy is set to 3 during self-cal. However for compass, it always 0 no matter what I do.
May I know how you solve the problem on getting compass accuracy to 3?
Thank you
Handi
Handi,
I don't have any more information for you other than to make sure you are doing good figure-eights. The figure-eights should be performed in several different planes and don't go super fast. I think it took a bit longer than I expected as well. That's all I can tell you.
Austin
Seems like a hot topic, I spent myself several days before figuring out a 'good' figure eight. And yes, it helped to push compass accuracy from 0 to 3. What I've done is after doing classic figure eight I turned board to each of the 6 directions and CC and CCW rotations on each axis.
Hello,
I have an important question.
What is the data format (type) of 9-axis combination data which Motion Fusion processing in MPU-9250 sensor?
I read information above, and it written 9-axis quaternion data.
9-axis combination data format of MPU-9250 is quaternion data?