Heading errors

Home Forums Forums Technical Support for BerryIMU Heading errors


Viewing 5 posts - 16 through 20 (of 20 total)
  • Author
  • #16669


    Did this ever get resolved? I have spent the past 24 hours trying to solve this to no avail. Same issue.

    Calibrated compass headings to not reflect the actual 360 degree rotation of the compass. The plot of the output from “compass_tutorial01_basics” is attached (I rotated it many times around the z-axis). I then calibrated it by running the calibration program until the values didn’t change. In fact, I rotated the device 360 deg around all 3 principal axes, multiple times, during calibrations. The results are attached here (though, I seemed to get different results for even the same Magnetometer, if  I ran it again, changing nothing else…).

    I then updated the calib value definitions each time, in the compass_tutoria03.c script.

    Ultimately, I could never get it to work… The compass values, after calibration, would hover around some number that it appeared to randomly start at, plus/minus like 40 degrees (e.g., if it started streaming at 300 deg, then if you rotated it a full 360 degrees, you would only see values in the range of something like 260 – 340 degrees, thereabouts)

    Other worthwhile notes:

    •I have tried with both the BerryIMU v2 and the BerryGPS-IMU v4, connected to a Pi Zero, with the same poor results.
    •I also thought maybe there was a nearby magnetic field causing the errors, because I had the battery that was powering the device directly below a wood block that the rasp pi and berry were mounted to (see photo attached). So I unstrapped the battery, put it 10 ft away, and put the rasp pi on the wood block on a wooden table in the middle of my house, as far away from possible magnetic objects as possible. And STILL I got the same issue…

    Mark Williams

    When you do your calibration, are you doing it while it is attached to the battery as shown in the image?

    Mark --OzzMaker.com --



    I did the calibration both attached to the battery and with the battery 10 feet away, attached with a 10′ USB cable. and in the 10′ cable test case, I had it on a wooden table in the middle of my house away from as much metal as possible.

    There was no difference in the behavior of the heading in either case.

    Drew Davey


    I have been testing the same setup as ryanrsm above with the same result for compass headings. He performed the calibration away from any magnets/batteries with the same results. I added the ‘beforeCal’ line you suggested to Ben on the previous page to compass_tutorial03.c and I have attached some of my results as well as my calibration values. Please let me know if you have any suggestions.



    I also have the above issue. After calibration with the latest code, and all of these methods listed here, my heading is stuck fluttering back and forth between a range of about 40 degrees. Is there a resolution to this issue?

Viewing 5 posts - 16 through 20 (of 20 total)
  • You must be logged in to reply to this topic.

Blip, blop, bloop…