Minimum distance for GPS/compass from motors etc

My Hexacopter measures 530mm motor to motor across the diagonal. The GPS module is on a mast 130mm above the frame, a bit off-centre such that its slope distance to the two closest motors is 240mm (200mm horizontally). I would like to reduce the height of the mast significantly to reduce damage during handling and, possibly, reduce vibration.

Is there any rule of thumb regarding distance between motor and current-carrying components? If I just go ahead and, say, halve the mast height, is there a parameter in the log file that will tell me if the electrics are influencing the compass?

If you have current monitoring then Iā€™d say remount your compass as you want. Re-calibrate the compass as you normally would (with GPS lock, outside away from sources of interference). Then after you fly it run MagFit on the flight log. That will give you a proper calibration that takes the electrical noise into consideration.

Thanks Allister. I donā€™t have current monitoring. Iā€™ve checked out Magfit in the wiki and it sounds very complicated. Anyway, Iā€™ll try a shorter mast, recalibrate, and see how it performs in Loiter or Poshold modes, and then see if I can figure out how to use Magfit.

I replaced the tall, hinged, mast with a shorter (60mm) rigid one, and my test flights yesterday were so perfect (by my standards!) that Iā€™m not going to even try MagFit. The hex hovered for a full 9 minutes or so in PosHold mode without any noticeable drift or ā€˜toilet bowlingā€™, and landed within 2m of launch point on RTL. It also responded well to my inputs while in PosHold mode, and stopped quickly when I centred the sticks.

You should run Magfit anyway. Without current monitoring donā€™t select compass motor compensation. If like others you got as far as ā€œbuild/Sim Environmentā€ in the Wiki page and ran away you donā€™t need anything other than MAVExplorer and a icon for it on your desktop. Drop a log on it and follow the video guide. Nothing to it.

Edit-Actually there will be a new WebTools based Magfit live soon so if you are afraid of MAVEplorer this will be easier to use. All the WebTools run in a browser.

Like @dkemxr , I just run magfit in MavExplorer. But this new webtool sounds good!

@abenn1 , if you donā€™t want to install MavExplorer (but you shouldā€¦) then post a log here with a short flight. About 5 minutes, with a bunch of turns. Nothing crazy, but fly around for a while and make sure itā€™s traveling in all directions. A couple of figure-8s are good. Post the .bin file here and one of us can run magfit for you.

1 Like

Thanks guys. Sundayā€™s flights didnā€™t involve many turns, but Iā€™ll install MavExplorer later this week and see how it works.

As it happens I had some time this afternoon so installed MavExplorer on my workshop laptop, following the wiki instructions. But what I donā€™t find on the wiki is any advice on how to interpret the results once a log file is opened.

Hereā€™s the graph of compass readings from one of my hexcopter flights, but how do I know if itā€™s good or bad? If bad, what do I do about it?

Next flying day Iā€™ll do a few deliberate figure eights to get some decent data; this flight was mainly hanging out taking video of our flying field, though Iā€™m sure there was at least one 360 degree turn.

Hereā€™s the .bin file used for this exercise.

Nothing there other than zoom/window a section that doesnā€™t include take off and landing and then open the Magfit Tool. Watch the video again, you havenā€™t processed anything.

I plot the compass graph (graphs > Sensors > Compass > Compass) and youā€™ll get:

Look at the yellow line, and it should be more or less flat. You can see this one has some bumps and wiggles.

So I ran Magfit (reduction 10, Offsets on, Elliptical on, CMOT on) and I got these numbers

COMPASS_OFS_X -93
COMPASS_OFS_Y 2
COMPASS_OFS_Z -215
COMPASS_DIA_X 1.138
COMPASS_DIA_Y 1.085
COMPASS_DIA_Z 1.048
COMPASS_ODI_X -0.003
COMPASS_ODI_Y 0.074
COMPASS_ODI_Z 0.075
COMPASS_MOT_X -1.596
COMPASS_MOT_Y -1.982
COMPASS_MOT_Z 5.446
COMPASS_SCALE 1.00
COMPASS_MOTCT 2

Try it running your own numbers and see what comes up.

Youā€™ve lost me there Dave. That plot does include take off and landing, though I appreciate itā€™s only comparing GPS data with compass data without processing anything. The wiki page that I was looking at doesnā€™t have any video. Is there a better one for explanation of how to use it?

Iā€™ll run the graph you suggest this afternoon Allistair, and then run Magfit.

ā€¦

Yes. Magfit

Many thanks to both of you.

Iā€™ve just completed a Magfit run using the parameters you suggested Allister, and the output data are exactly the same as yours. The ā€˜correctedā€™ graph looks pretty good to me, if Iā€™m reading it correctly:

Having now read the wiki referenced by Dave I see that I should really make another flight specifically for MagFit, ensuring that I do some 360 degree turns, and filter the input data to exclude take-off and landing, before altering my compass parameters.

One last thing; since Iā€™m not using current monitoring, should I not leave COMPASS_MOTCT at 0, rather than 2 suggested by MagFit?

If you donā€™t have current monitoring then you might want to try running Magfit again, but this time without CMOT. See what numbers it gives you. If the corrected graph looks good then I would run those values on the drone. You can try a magfit specific test flight again and see how much the numbers change. In my experience as long as the initial flight log you used has some good 360 turns in it, then it should work just fine. But your mileage may vary so it doesnā€™t hurt to check.

Thanks Allistair, Iā€™m beginning to get the hang of it. I ran the same .bin file again but with CMOT unchecked, and some data are significantly different:

COMPASS_OFS_X -155 (was -93)
COMPASS_OFS_Y -69 (2)
COMPASS_OFS_Z -91 (-215)
COMPASS_DIA_X 1.136 (1.138)
COMPASS_DIA_Y 1.080 (1.085)
COMPASS_DIA_Z 1.178 (1.048)
COMPASS_ODI_X -0.005 (-0.003)
COMPASS_ODI_Y 0.107 (0.074)
COMPASS_ODI_Z 0.093 (0.075)
COMPASS_MOT_X 0.000
COMPASS_MOT_Y 0.000
COMPASS_MOT_Z 0.000
COMPASS_SCALE 1.00

Since I canā€™t be 100% sure I made any significant yaws during that flight, I will make another flight before I alter any of my params. Iā€™ll also then MagFit my three Arducopter helis even though they all seem to be flying well.

1 Like

ā€¦

Nice work Allan!

My experience with Magfit has been so good that I canā€™t figure out why I held out for so long. Once the drone is flying I run the calibration and done. Let us know how you make out.

I made a couple of flights in Stabilise mode with plenty of 360 degree rotations, and Iā€™ve since been away for a week, but now I canā€™t get MagFit to work:

Starting MavExplorer, getting the .bin file, and graphing it with Sensor > Compass > Compass selected is not a problem. I then use the magnifyer tool on the graph display to select only the part of the graph that doesnā€™t include take-off and landing.

When I then click on Tools > Magfit and select the settings recommended by Allistair 13 days ago and click on Run, I get a scolling stream of error messages in the black UI screen

Iā€™ve left it running for up to 10 minutes, but it just keeps going. Is my copy of the app corrupted, or am I doing something wrong?

Post a screenshot of the Magfit config page that is behind the Command terminal window.

Were there Yaw changes in that section you zoomed to?

Hereā€™s the config page. There were plenty of yaw changes during the flight in question.