MAG Cilibration

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

MAG Cilibration

1,132 Views
a8Chcx
Contributor V

Hi,

 

I did the manual calibration and saved the calibration data(10 element). After power on, I start using the saved data and works fine.

 

Then, after running a short time(20M), I can see the heading is off and I checked that it is using 4 element real-time data now.

After running a long time(around 1 hour), I can see the heading is back to normal. Now using 10 element again.

It there anyway to control when I want to use the new calibrated data? The real-time calibration should be running the same way as now...

 

Thanks,

 

Christie

Labels (1)
0 Kudos
5 Replies

748 Views
a8Chcx
Contributor V

Hi Mark,

Any idea how to do it?

Another question: If I stop running the calibration routine, the compass reading will be based on last calibrated data. If I am using saved calibration and do not run the calibration routine, it will always use the saved calibration data to calculate the heading?

I checked the MAG spec, there is no big difference on zero offset and temperature drifting, it will not cause more than 10 degree difference if I use it in the same environment and calibrated data, right?

For my application, there is no way to do fully calibration in 3 axes. And I found that it will make it worse if I don't do full round turn in 3 axes. It will get almost the same result if I do fully calibration as using the calibrated data.

Thanks,

Christie

0 Kudos

748 Views
michaelestanley
NXP Employee
NXP Employee

Christie,

The Fusion_task() function in mqx_tasks.c includes the code that initiates a new magnetic calibration.  Look for variable name "initiatemagcal".  You should be able to craft your own strategy for when to initiate, or not, magnetic calibration by tinkering with this section of code.

Mike

0 Kudos

748 Views
a8Chcx
Contributor V

Hi Mike,

If I turn off MAG background calibration, the heading is good after I run my system for a long time(>24 hours).

Then I power OFF/ON again, the heading is no big difference.

1) It is possible that the background calibration will cause the problem sometime because of environment inteference?

2) What is the maximum heading error that is caused by temperature based on Freescale MAG chip?

Thanks,

Christie

0 Kudos

748 Views
michaelestanley
NXP Employee
NXP Employee

Christie,

1) Yes, environmental interference can throw off the calibration.   The calibration routines assume the ambient field is constant and equal to the earth field.  If it is not constant, it can and will throw things off.

2) I expect the amount of heading error due to temperature variations to be orientation dependent.  The X and Y channels in the magnetic sensor are essentially identical elements, but rotated 90 degrees.  So when the device is horizontal, 1st order terms will cancel (recall that we're looking at the inverse tangent of the ratio).  The Z axis element has a different structure.   Any rotation from horizontal will include Z components in the measured fields, and we can't count on those varying in an identical fashion.  All of the above is complicated by the fact that many applications will include other components (i.e. speakers) which generate temperature-dependent fields.  The variations are endless and not something easily characterized for the general case.  All this is a long way of saying: you will have to evaluate your specific design to see how well it performs.

Regards,

Mike

0 Kudos

748 Views
a8Chcx
Contributor V

Thanks, Mike.

0 Kudos