Calibrating 1044 compass with C++

C, C++, and Visual C++
Post Reply
clydemcqueen
Fresh meat
Posts: 2
Joined: Mon Jan 22, 2018 3:24 pm
Contact:

Calibrating 1044 compass with C++

Post 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: http://geomag.nrcan.gc.ca/calc/mfcal-r- ... rection=-1

Thanks.
User avatar
mparadis
Site Admin
Posts: 660
Joined: Fri Oct 28, 2011 12:17 pm
Contact:

Re: Calibrating 1044 compass with C++

Post 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.
clydemcqueen
Fresh meat
Posts: 2
Joined: Mon Jan 22, 2018 3:24 pm
Contact:

Re: Calibrating 1044 compass with C++

Post 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.
User avatar
mparadis
Site Admin
Posts: 660
Joined: Fri Oct 28, 2011 12:17 pm
Contact:

Re: Calibrating 1044 compass with C++

Post 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.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest