FXOS8700CQ x, y, z ranges not all the same?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

FXOS8700CQ x, y, z ranges not all the same?

Jump to solution
1,365 Views
tedhuntington1
Contributor II

I am getting data from a FXOS8700CQ and the ranges are:

X: -160 to +200 uT

Y: -160 to +190 uT

Z: +35 to +350 uT

Are these accurate values? (I am in Santa Ana, CA if that makes any difference). Since the magnetometer only measures the magnetic field of the Earth, shouldn't the Z range also be -160 to +200 uT? Is there something wrong with the Z range?

Thanks,

Ted

Labels (2)
0 Kudos
1 Solution
916 Views
anthonyduhamel
NXP Employee
NXP Employee

Hello,

No, you don't need to use those features yet.

If you rotate the device around Z axis, the Z magnetic filed should not change significantly because the geomagnetic field is horizontal.

Capture.PNG

If you rotate the sensor randomly thought all axis you get:

Capture.PNG

Z measurements are always positive, because there is offset/bias, we called it "Hard-Iron". It's why we calibrate the magnetometer.

The sensor fusion ​will correct that.

Picture below displays the extracted parameters.

Capture.PNG

Anthony

View solution in original post

0 Kudos
6 Replies
916 Views
anthonyduhamel
NXP Employee
NXP Employee

Hello Ted,

Your values look too higher for the earth magnetic field. Did you scale the mag register values to normalized units? The magnetometer resolution is 0.1 uT/LSB.

Considering my previous note (by dividing value per 10), measurements are okay (geomagnetic field range is [+-25uT ; -+65uT])

About the Z axis, I have a question, how did you check the range? Did you rotate the magnetometer is the same plan (drawing a circle with the magnetometer ) or did you move the sensor over all direction (drawing a sphere)?

By the way, it seems to be an offset on the Z axis. Did you use the embedded  offset correction in the magnetometer?

Anthony

0 Kudos
916 Views
tedhuntington1
Contributor II

Thanks Anthony,

Yes I see that I need to divide by 10 more (*0.03662 which is 1200/32767, I had *0.3662). But shouldn't the Z have a negative reading when pointing up?

I checked the Z range just by rotating it in 360 degrees around the X and Y axes.

So you think there may be an offset on the Z axis? I have not tried to use the embedded offset correction yet, but I will try and see what happens. But should the Z be in the same range as the X and Y, or is it normal to have the Z as being positive only?

0 Kudos
917 Views
anthonyduhamel
NXP Employee
NXP Employee

Hello,

No, you don't need to use those features yet.

If you rotate the device around Z axis, the Z magnetic filed should not change significantly because the geomagnetic field is horizontal.

Capture.PNG

If you rotate the sensor randomly thought all axis you get:

Capture.PNG

Z measurements are always positive, because there is offset/bias, we called it "Hard-Iron". It's why we calibrate the magnetometer.

The sensor fusion ​will correct that.

Picture below displays the extracted parameters.

Capture.PNG

Anthony

0 Kudos
916 Views
tedhuntington1
Contributor II

Thanks Anthony,

So the reason the Z readings are all positive is because the particles in the Earth's magnetic field are creating a magnetic field (a so-called "hard iron source") in the copper in the PCB under the sensor? Or perhaps the hard-iron source is coming from a magnetic field from my computers that are in the same room? I may take a look at sensor fusion, I am running Linux but have Windows too, I'm not sure how I can import my data into sensor fusion (perhaps comma or tab delimited?)- or possibly I will just subtract a hard iron offset of 19- to bring Z into -16 to +16, and X,Y would be -2 to bring it to -18 to +18.

Ted

0 Kudos
916 Views
anthonyduhamel
NXP Employee
NXP Employee

Ted,

Hard-Iron comes from permanently magnetized components located on the pcb plus magnetometer imperfections. I suggest you to read AN4247 & AN4246 (files attached) for furthers information on hard-iron distortions.

Yes you can subtract the hard-iron vector to the raw measurement vector to remove the bias but be careful about "static" calibration. Hard-iron vector can shift over time due to temperature changing, external magnetic fields disruptions coming close to the sensor and sensor position changes. 

FYI, FXOS8700CQ comes with a self magnetic calibration feature (m_acal field to set in M_CTRL_REG1 plus m_raw field to clear in M_CTRL_REG3).

Thanks,

Anthony

0 Kudos
916 Views
tedhuntington1
Contributor II

Thanks for the 2 links Anthony- it seems like a lot of calculating for my particular application. Of course I would prefer the device to not have hard-coded offsets and to calibrate itself to whatever location it is in.

One of these sensors will be on each segment of a two-leg humanoid robot- so I don't think they will be turning more than a few degrees in any dimension- hopefully that will be enough for the m_acal autocalibration to work. 

Ted

0 Kudos