HMC5843 missalgined

Hello all,


I am trying to build myself a cheap tricopter using the arduIMU v2+ and a HMC5843 magnetometer. Due to my lacking soldering skills, I managed to solder the magnetometer somewhat skewed/tilted. My question is if I should try to desolder the sensor, therefore risk destroying both the sensor and the IMU, or just leave it as is? Since I have not started to play with software for the magnetometer I have no idea if, during calibration of the compass, I can cancel the misalignment of the magnetometer.





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

Join diydrones

Email me when people reply –


  • Developer

    Do you have a picture?  It would be good to see exactly how bad it is.


    If you're using the arduCopterNG code, a problem with the mag being rotated incorrectly could be corrected by setting the declination.  Look for "Additional Settings" near the bottom of the mag page wiki.


    What could be more problematic would be if it's sagging.  Magnetic north is nearly straight down so the Z component of the 3d vector the mag returns is large and sagging could cause it to affect the heading badly...but if you're feeling ambitous you could slightly modify this line in ArduCopterNG.pde

    AP_Compass.calculate(roll,pitch);  // Calculate heading

    You could add a constant to the roll and pitch to compensate.  For example this might compensate if the mag was soldered to the top of the oilpan but the back of the mag was sagging down by 10 degrees so it was close to touching the oilpan.



    ...or maybe it's just a lot easier to try to resolder it and if you break it, order another mag!

This reply was deleted.


Neville Rodrigues liked Neville Rodrigues's profile
Jun 30
Santiago Perez liked Santiago Perez's profile
Jun 21