Completely stumped

I am completely stumped as to what our issue is with this current plane.

We did the tuning and have the plane flying very well in FBWA. However, in any auto mode the compass goes completely crazy and the plane constantly turns in different directions and has no idea which way it is going due to it constantly thinking its pointing in different directions.

We get back compass health messages, however, it shoudk still not be effecting it this much. In RTL it does figure 8s.

I will post the logs soon so you can see as well. This is a genuine 3DR Pixhawk with the original GPS/compass module. Compass is properly calibrated and works perfect on the ground.

We also tested at different throttle levels on the ground and there was no issue.

The only things I can think of is we are using the BEC from one of the ESCs (it’s a twin motor aircraft) and maybe the BEC is causing interference that is messing with the compass?

Maybe it’s a GPS issue? Isn’t the GPS supposed to take over for heading if the compass is not working properly?

The GPS/compass is located on the tail and is well separated from the motors and ESCs. The only thing somewhat close is the telemetry radio, but, if that was the issue I would expect to see errors on the ground.

Any ideas are welcome. I will post .tlog and .bin soon

Here’s the logs.

Any help would be greatly appreciated

dropbox.com/s/gwl83xzieu0go … x.rar?dl=0

Magnetic interference according to the auto analysis is at 23% which should be no problem.

Mine was the same first time I tried auto flight. Figure of 8 loiters and random auto flight paths.

I ran autotune again and did a lot more than the 20 roll and pitches they suggest and its fine now.

It navigates perfectly, holds a nice circle on loiter and does what it’s told.

Just a little bit of fine tuning necessary on the roll settings but it’s 99% of the way sorted.

Thank you for the tip,

We have done auto tune a lot (atleast 60+ inputs) for both roll and pitch and it flies very well in FBWA. We can try it more but I’m still not sure why having the PIDs a bit low would effect the orientation of the plane so badly?

I’ve had planes in the past with the default PIDs fly in auto mode without issue, it wasn’t precise but didn’t do what we see today.

I had problems in auto before while the plane flew fine in fbwa-b.
I then saw that for nav/auto there are other params to tune the plane.

Searching for answers it came clear that if the following are not correct, that plane will behave strange in nav or auto modes

I’m no expert but I would check
-airspeed sensor calibrated
-correct cruise speed
-L1 period parameter

All of those look good. Did more tuning today but it didn’t help Te compass errors. Didn’t get a chance to try a different power source yet though. I’ve ran Ardupilot without airspeed sensors and never had problems.

I am really stumped. Unless it’s BEC interference or issues with the radio too close?

This problem can be seen in manual mode as well. the direction of the aircraft is always changing and we can bad compass health warnings in manual mode.

Since you have both internal and external compass you need to make sure they are both oriented correctly. If they disagree that will generate a bad compass health message and the autopilot won’t know which one is correct.

Make sure both the Pixhawk and external compass/GPS are aligned with each other.

When you do a compass cal do you see both calibration graphs. Also when I do the cal I always turn off the auto accept option and continue to calibrate until both graphs have data points aroud a complete sphere.

.

If all else fails contact 3DR tech support. They have been very helpful to me in the past.

The arrows on both the pixhawk and the GPS are facing forward and are both right side up. I do the same, turn off the auto accept and hit all the white dots on the circle.

The weird thing is, for one of the tests we disconnected the compass on the external GPS (unhooked the i2C cable) and the internal compass was 90 degrees off on the ground. So we redid the compass calibration with only the pixhawks internal one connected. However, once in the air we had the same issue of bad compass health and constant turning of the vehicle.

We are going to test more today. I put Arduplane 3.2.3 on and will use a 3s battery with the pixhawk power module to power the main power port on the pixhawk. I also installed a second GPS/compass so if that does not work I will try a different GPS/compass in a different location. I also brought the L1 nav from the original value of 20 down to 18 and now up to 22 to see if that helps.

If all of this fails, then I will be completely out of ideas. Maybe a different pixhawk to test or a Navio+.

You may have a defective unit. Contact 3DR and see what they say.

Figured it out finally! 3 days of going insane.

On our GPS extension cable there was a very small pointy piece of solder that broke through the heat shrink and was shorting two of the black wires for the GPS. This was causing the GPS to not act properly, although, we were getting 12 sats and an HDOP of 0.7! I think the short was actually making the HDOP lower than it truly is. We used a new cable and it works perfect. Flies like a dream and needs only a bit more tuning.

Thank you for the help. It’s been a crazy 3 days trying to figure out what the heck was happening. It’s weird that this was so hard to detect, especially since always getting the “BAD COMPASS HEALTh” error leading U.S. To think it was a compass issue and not a GPS issue.

Thanks again. Glad we got it sorted