Takeoff magnetometer and magnets

I am using F765Wing on DartXL. Because plane has magnets for fixing cover close to GPS place (about 10sm), I disabled magnetometer. But when I using Takeoff mode, plane turn in more than 90 from original direction. I am confused. Should I try to switch on magnetometer? Or it’s bad idea, because I hear some have flyaway during RTL because of incorrect magnetometer reading?

I’m also investigating odd occurences in TAKEOFF mode without compass (see my thread here: TAKEOFF Mode - first attempt with odd results).

Could you add some links concerning flyaways with Arduplane caused by bad compass readings? Because I’m now considering activating the magnetometers on all planes.

As for the magnets, I guess it’s best to replace them with something else to hold the hatch when using a compass.

Video: Dangerous AutoTakeoff without a compass

I don’t remember where I read about it, maybe it doesn’t even apply to ardupilot. I only remember that the person lost the model due to the wrong orientation of the compass (in the opposite direction).

I have activated the compass, the direction it shows differs from the true one by 20 degrees. I hope ardupilot can correct this by GPS during flight. Or maybe it’s not important at all. Anyway takeoff without a compass is dangerous (see video above).

Your clip looks a bit like a mirrored version of my Auto Takeoff attempt without compass. What was the target altitude and distance?

As for 20 degrees off, you did do the compass calibration? It would be interesting to try without the hatch magnets to see if it makes any difference.

I also realized that on the plane I’d try compass on first, the GPS is close to the motor. This has never been a problem for GPS reception, but it’s probably not good for accurate compass readings either.

50m / 200m

Yes, of course

Hatch magnets strongly affect the magnetic field at the location of the GPS.
I think you are right, it is better to remove them.

Magnets do not affect GPS reception. There are stronger magnets in the motor than in the hatch, but the magnetic field is closed. Yes, it’s not good for accurate compass readings.

Exactly the same as my settings. The only difference is that my plane went to the right and yours to the left. Also mine made kind of a pause in climbing while yours climbed constantly. But still the similarity is definitely there.

Maybe it would be an option to get a GY-271/2 QMC5883L compass module for easy placement anywhere on the plane, far away from any magnets.

Hi @UnknownPilot

An external magnetometer installed on the wingtip is working very well for me even when using the stock canopy magnets on a ARwing 600 and ARwing 900.
The distance to other magnets and metal parts makes all the difference.

The installation is shown here:

Good luck

3 Likes

Thanks, that’s how I imagined it, although I’m surprised it can even be mounted vertically.

By the way, does it work with an OLED display on the same I2C bus?

1 Like

Hi @UnknownPilot,

All compass orientations from the parameter " COMPASS_ORIENT" link are allowed. The rest will be done by the compass calibration.

One more hint: before doing the compass calibration dance: Put the hatch with the magnets on. The compass still see the magnets.

No, I have not tried that.

1 Like

The OLED should have a different I2C address so the only problem should be reading the magnetometer at a slower frequency.

I also haven’t done this with ArduPilot but one of the main benefits of I2C is being able to use the same pins/bus with multiple devices.

1 Like

Thanks @VRquaeler and @ddegn, I received a GY-273 QMC5883L magnetometer in the meantime and will try it soon on the AR.Wing Mini hopefully.

As for the I2C frequency, does this mean I have to manually set it lower to make both display and compass work at the same time?

The “I2C frequency” usually refers to how fast the I2C clock line is pulsed while sending and receiving data. Different I2C devices can have different timing requirements but I don’t think this will be a problem in this case.

The frequency I was referring to was how often the magnetometer is read. I don’t know if this will be an issue or not. OLEDs can take a while to update. I think it’s safe to say writing data to an OLED takes more time than reading magnetometer data. If writing data to the OLED takes longer than the normal time interval between magnetometer reads, then the OLED will cause the flight controller to read the magnetometer less often.

I’m going to guess the software is smart enough to know how much priority it should give to the OLED vs the magnetometer. I doubt adding an OLED will cause a problem. I just wanted to mention the possibility in case adding the OLED causes a control issue.