Magnetometer calibration and dual mags
« on: October 22, 2016, 06:08:32 am »
I have a technical question about magnetometers.  In the magnetometer calibration screen, it shows a percentage for internal and aux mags. If the percentage goes below 5%, the alarm color turns green.  Can someone explain to me what specifically this percentage is?  Is it percent error?  If so, how does it know what the measurement error is?  Is it based off the difference between the mag and the gyro?

Also, I was wondering about having dual magnetometers, one on board, and one aux.  Does that make the overall mag reading more accurate?  Does one mag make up for when the other mag is getting errors?

Thanks
  -Macphyter

f5soh

  • *****
  • 4572
    • LibrePilot
Re: Magnetometer calibration and dual mags
« Reply #1 on: October 22, 2016, 11:16:29 am »
Mag error compare the expected Mag vector at location according to World Mag Model (magBe) and the measured vector.

In GCS the calc is here:
https://bitbucket.org/librepilot/librepilot/src/2b392babb8377b784976da4d5c4b6fa5b676e159/ground/gcs/src/plugins/config/configrevowidget.cpp?at=next&fileviewer=file-view-default#configrevowidget.cpp-672

You can find similar calc in firmware side for alarms.

Re: Magnetometer calibration and dual mags
« Reply #2 on: October 23, 2016, 07:43:17 am »
OK, thanks.  So in the case of dual magnetometers, one on-board and one aux mag, is it simply a matter of choosing a reading from the one that has the smallest error?


Re: Magnetometer calibration and dual mags
« Reply #4 on: November 08, 2016, 08:01:40 pm »
Generally aux mag is mounted farther away from the high current cables that cause mag interference and so the aux mag is more accurate.

You can set the firmware to use both sources, but I believe that generally that means you are mixing a bad signal with a good signal and you should probably just use the good signal.

joani

  • **
  • 57
Re: Magnetometer calibration and dual mags
« Reply #5 on: December 26, 2016, 01:21:55 am »
To see if I understand that of the position of the auxiliary mag, you say that the mag aux chip can be inverted, looking back, down, soldered inside the gps capsule? That's why the orientation of it should say 0; 0 ; 0 in the three axes so that it is in position with respect to the front: and the tro chip mag, which is in the plate, that is oriented forward as when the controller board, goes hand in hand with the orientation of the same?? If so, I have already calibrated it but it trembles in the gsc

Re: Magnetometer calibration and dual mags
« Reply #6 on: December 26, 2016, 05:09:55 am »
A few degrees of tremble is normal.
Different GPS/mag mount the mag chip differently or have a CPU that automatically translates the way it is mounted to 0,0,0.

joani

  • **
  • 57
Re: Magnetometer calibration and dual mags
« Reply #7 on: December 28, 2016, 12:48:48 am »
Friend, but why does gsc tremble, why is the magnetometer constantly taking values ​​from magnetic fields?


Re: Magnetometer calibration and dual mags
« Reply #8 on: December 28, 2016, 11:40:02 am »
All the sensors tremble if you look closely enough.  :)  I could make guesses, but I haven't researched the reason.  A few degrees of tremble is normal.  The baro is worse than the mags.

To avoid using the mag in the FC because it is so close to the fields from the high power wiring, you should select "auxonly" for "mag usage" in Attitude -> Magetometer

The part that bothers me more than the tremble is that INS13 leans a little bit too.  You can have Basic set up to be very level and hover in Attitude mode without drift, but when you switch to INS13 it is no longer so nicely level and it drifts a little.

There is a way to adjust INS13 so that it is level (doesn't drift in Attitude mode).
https://librepilot.atlassian.net/wiki/display/LPDOC/Aux+Mag+Setup+and+Calibration
Look for the section titled "Fine Tuning Your Hover To Stop Drift (Not Required)"

joani

  • **
  • 57
Re: Magnetometer calibration and dual mags
« Reply #9 on: December 28, 2016, 11:45:55 pm »
Dude, if it were that alone and could take off there would be no problem, the thing is that the drone can not unseat, it goes everywhere it hits against the walls, it breaks all the helices, it deteriorates on all sides I can not find the solution , Which does not happen in the other modes. They work very well but the assisted modes do not know how they behave: the truth that I do not understand

joani

  • **
  • 57
Re: Magnetometer calibration and dual mags
« Reply #10 on: December 28, 2016, 11:51:57 pm »
Friend now that I learned what he told me about assisted modes at the end !! Jejej.Que only used in the primary modes, what is the gps used in these modes?, For example attitude attitude, axislook, normal, that will improve the gps in that mode?, If the use is less quiet The wind, only the wind carries it everywhere, the GPS leaves it quiet, serious as a poshold ??Happy new year my friend


« Last Edit: December 30, 2016, 10:13:49 pm by joani »

Re: Magnetometer calibration and dual mags
« Reply #11 on: December 29, 2016, 05:57:43 pm »
:)

You should not fly INS13 / GPS modes indoors.  GPS signal is not reliable indoors (multipath), especially when moving.  There is an INS13Indoors, but I would probably recommend Complementary+Mag instead of that.  You should not even fly Attitude mode with INS13 inside the house.

You should use INS13 and have Attitude mode and VelocityRoam on your flight switch.  Fly outside only.  Choose open field for this first flight.  First flight of day let it sit at takeoff location with power on for 15 minutes before takeoff because GPS almanac can take up to 12 minutes to download.  This may not be required, but let's get one good flight to start with.  I usually only wait for good green GPS and then another minute.  Take off in Attitude mode and get nice hover.  Switch to VelocityRoam mode and be instantly ready to switch back to Attitude mode if it moves.  It should stay right there.

How far off is the GCS flight data display from showing vertical?  How much tremble?  Maybe make a video of that so we can see if the amount you have looks normal to us.
« Last Edit: December 29, 2016, 06:05:03 pm by TheOtherCliff »