Compass always off no matter what i do

Hi, so I’m flying a fixed wing with a pixhawk 2.1. I’m trying to fly with an external compass but no matter what compass I try to use, when getting prepped for flight they are always off around 10-15 degrees. Sometimes there will be a 30 degree difference. We are using a small flight strip that’s used for hobby stuff of this sort, and it’s aligned with magnetic north i believe(i might be wrong tho).

Is there anything I can do to fix this issue or are there are better compasses to buy that someone recommends. I also have the compass near the front of the fixed wing, away from most of the other electrical parts I have aboard.

You do not need a compass for a non vtol airplane. An airplane always flies forwards, so the GPS path is used to get a heading.

Isn’t a compass needed for the kalman filter though? Okay, lets just say that I need this external compass period. Are there better compasses to buy? Or maybe what can I do to stop the compass reading from shifting so much. Usually how it goes, is we test the compass before heading out to the field, and it’s pretty good. When we get out there is when it starts messing up. So I don’t know what else I can do at this point.

Are you calibrating or testing the compass at home where there’s possibly some magnetic interference? What about calibrating at the airfield, or a comparison against a old fahioned physical compass at each site ?

We calibrate it both times when at home/airfield. We haven’t used an “old-fashioned” compass for comparison. We have used some compass applications on our phones and compare our external compass reading to that on our phones.

This makes it sound like environmental differences are your problem, not the compass hardware.

These facts also support the hypothesis that the environment, not the compass itself, is causing your issue.

Have you done tests in various environments which suggest otherwise, that the hardware or software setup is causing your problem?

Not true, if there’s wind. But this assumption is “accurate enough” if the winds are low. Also, I believe you are right that the GPS path is used as additional information about heading by the ArduPilot software.

By flying forward I meant. it can not stop and reorient itself, without leaving a GPS “trail”, like copters and rovers can.
Maybe I am wrong, but even with side winds, the compass would show where the nose is pointing, while the GPS path would show the true direction of flight.

Ah, yes, this is correct. I had assumed “forward” meant “nose-direction” but you are correct that it could also mean “flight-path direction”

We have gone to a nearby empty parking lot solely to test if the compass was working fine or not. It did seem to work fine, as we tested it by running missions and just looking at if the plane stayed its course or veered off on the take off. We would stop it before actually taking off but it was just to test.

But now my question is, how would the environment affect it though? At the airfield we go to, we’re basically in the desert. At the parking lot, of course you have some lights and cars around. And at home, we basically have a lot electrical equipment laying around.

I’m not sure if I understand what your problem actually is. It sounds like perhaps the veering-on-takeoff is the real issue, is that correct?

If yes, that may (or may not!) be caused by the compass error… a dataflash log demonstrating the problem would help us to learn more. Do you have a dataflash (.bin) log?

If no… then I’m confused. Because it sounds like the compass works well in your parking lot, but then acts poorly at your airfield, despite the airfield being basically in the desert. Is that correct?

It is recommended to do the compass calibration as far away from any source of disturbance as possible. If you do the calibration with a lot of electrical equipment around and then move to a flying field free of any disturbance, the calibrated offsets might be wrong. Try to do the calibration at your flying field or fly the plane manually for a while and check
“learn offsets automatically”

For information I have pixhawk 2.1 cube with Here+ GPS and my heading is also off by about 15 degrees. I had it in a hexacopter and now it’s in a VTOL plane and had the same both times. With the plane I have so far only calibrated indoors because I’m waiting for a new long usb wire before I can calibrate outside. This may resolve problem but I just thought it was worth mentioning my problem as it was very similar.

Tried a compassmot calibration?