APM 2.6 with 3DR Ublox GPS/Magentic compass

Hi,

Performing some testing of the HMC5883L compass within the Ublox GPS unit.

I uploaded the example compass test sketch from the AP_Compass library, some output from the test sketch is given below.

I question the "Heading" value, for example the first output line shows a heading of 55.12 yet when I compare it with the reading from my Suunto Ambit GPS watch this gives a heading of 193 degrees.  I certainly know the rover is pointing (and placed Ublox with direction arrow) is pointing approximately South.

If I pick up and rotate the rover I would expect the heading to roll around through 360 and back, it does not.

I wonder how sensitive this unit is to placement and whether many of you mount the GPS unit away from metal chassis etc?

I need to understand more how tilt compensation can effect readings but after all if the compass arrow is pointing due South my understanding is the heading should be 180 regardless of tilt??

Compass library test

init done
Compass auto-detected as: HMC5883L
Heading: 55.12 (115,-165,-334) i2c error: 0 offsets(-57.50, 82.50, 167.00) t=312
Heading: 54.66 (117,-165,-334) i2c error: 0 offsets(-58.50, 82.50, 167.00) t=315
Heading: 54.89 (116,-165,-334) i2c error: 0 offsets(-58.50, 82.50, 167.00) t=263
Heading: 54.66 (117,-165,-333) i2c error: 0 offsets(-58.50, 82.50, 167.00) t=264
Heading: 55.05 (116,-166,-334) i2c error: 0 offsets(-58.50, 83.00, 167.00) t=263
Heading: 54.66 (117,-165,-333) i2c error: 0 offsets(-58.50, 83.00, 167.00) t=281
Heading: 54.89 (116,-165,-334) i2c error: 0 offsets(-58.50, 83.00, 167.00) t=263
Heading: 54.66 (117,-165,-333) i2c error: 0 offsets(-58.50, 83.00, 167.00) t=264
Heading: 54.89 (116,-165,-334) i2c error: 0 offsets(-58.50, 83.00, 167.00) t=308
Heading: 54.66 (117,-165,-333) i2c error: 0 offsets(-58.50, 83.00, 167.00) t=264
Heading: 54.89 (116,-165,-334) i2c error: 0 offsets(-58.50, 83.00, 167.00) t=264
Heading: 54.66 (117,-165,-334) i2c error: 0 offsets(-58.50, 83.00, 167.00) t=264

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Replies

  • Hi Thomas,

    Thanks for the response.  Just calibrated the compass in the MP, then viewing the orientations in the Flight Data view all appears great.

    Reload the example compass sketch and still get results as previously posted.  Note the orientation of the Ublox is same for both tests.  I don't know if the calibration remains when uploading another example sketch to the APM?  

    will continue investigating, thanks.

  • Admin

    @Jon-Paul,

    Did you previously calibrate the compass using the MP prior to performing this test of the library code? If not, then the library code probably does not know that the compass is upside down in the GPS/Compass module.

    I have two of the new GPS/Compass modules and they calibrate and perform as expected.

    Regards,

    TCIII ArduRover2 Developer

This reply was deleted.