Calibration on magnetometer

Hello to everyone. I am struggling a little on this one.
I purchased a HMC 5883 L for making a compass. After learning that it's not working when rolling/pitching, I purchased another module which is adafriut 9 dof , IMU + Acc + Mag.
basically the 9dof it's an FXOS8700 + FXAS21002.
Adafruit Precision NXP 9-DOF Breakout Board [FXOS8700 + FXAS21002] : ID 3463 : $14.95 : Adafruit Industries, Unique & fun DIY electronics and kits ** This is the link in case somebody wants to check.

I am getting errors on FXOS8700 readings, and seems to be something about the calibration of the sensor itself.
Here we can see an image that i did while rotating 360 degrees both sensors, HMC on top and FXOS on bottom :

Red and blue are X and Y readings, Green is Z and yellow it's Heading.

We can see that QMC is doing a decent job keeping lines in order and returning a right heading value, going from 0 to 360.
However, FXOS it's not, i believe it's returning decent X and Y values but Z it's totally offset. There's no way on earth i can get a right reading on heading.

Both codes are doing the same, getting events X , Y , Z , and doing (atan2(mag_Y2, mag_X2)) , later converting to degrees to check the reading.

I tried playing little bit with the calibration to get that Z value better but I am not finding the way, I tried MotionCal.exe from teensy but no way neither.

Any help would be really appreciated.

Thanks a lot

Fede

It is essential to calibrate orientation sensors.

Adafruit has tutorials on sensor calibration, and offers the MotionCal program specifically for calibrating the orientation sensors they sell.

Seems like MotionCal it's not recognizing my sensor, It did only once, first time, but now i cant get it again

thanks

fede

Best to post on the Adafruit forum.

There's a code that I can write my own calibration called calibration Write.
I was lucky enough to get a screenshot from the only moment that the motioncal worked well and i will try with that.
Once that the calibration is written in the EEPROM memory, does it take those offset's automatically?
Or should I call them using any specific code line.
Maybe it's a stupid question but i am new on coding.

Thanks

fede

That depends on the code you are using.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.