Page 1 of 1

Calibrating 1044 compass with C++

Posted: Mon Jan 22, 2018 3:40 pm
by clydemcqueen
Hi, I'm using a 1044 on an RPi3 running Debian Jessie with the ROS Phidgets drivers. I've read the 1044 user guide, run the Linux compasscal program, and I've entered the data in the appropriate spot in the ROS launch files. Everything generally works. However, the compass accuracy isn't what I had hoped, so I'm attempting to improve it.

The compasscal program suggests the following: "You may wish to use a more accurate value for magnetic field strength as the number provided here is only an estimate."

The NOAA site is down today, so I used the NRCAN site to get the magnetic field strength for my location. The Windows app user guide seems to imply that I should plug these values into the app somehow, but I don't see any way to do that with compasscal. How do I generate the required 13 values using NRCAN or NOAA provided data?

Here's the NRCAN data for my location: ... rection=-1


Re: Calibrating 1044 compass with C++

Posted: Tue Jan 23, 2018 9:35 am
by mparadis
You want to take the "total" field value, which in the case of the NRCAN website is "F".

Take this number (53,525 nT) and convert to gauss: 53525 nT = 0.000053532 T = 0.53525 G. This is the "local field strength" needed by the compass calibration program, which will then output the 13 values after completing calibration.

Re: Calibrating 1044 compass with C++

Posted: Tue Jan 23, 2018 12:37 pm
by clydemcqueen
Thanks for the reply, @mparadis. Very helpful.

I don't see how to enter the local field strength in the command-line program, compass-calibrator-c-2.1.8. (I'm not running the GUI tool.)

But perhaps I don't need to... should I just replace the 1st argument in setCompassCorrectionParameters ("magField" in the README) w/ the NRCAN/NOAA field strength in gauss? In my case, compasscal generated estimates ranging from 0.468159 to 0.618421, but I would replace this with 0.53525.

Re: Calibrating 1044 compass with C++

Posted: Tue Jan 23, 2018 1:23 pm
by mparadis
Yes, that is correct. It took me a while to track down the command line example, but it looks like it can either estimate the local field strength, or you can use the one from the website as the first of the 13 parameters for setting the compass calibration parameters.