APM loss of control In Stabilize

This was the 8th flight of the Quad but the first flight with the GPS connected.

I took off and tried to switch to alt hold when the quad dropped a bit and I had to switch to stabilize to save it. I switched to alt hold a little higher up when my friend read out DCM bad heading. I tried to get it down as quick as possible by switching to stabilize and throttling down.

Nothing responded after DCM bad heading, I throttled down on the controller and tried steering but there was no response. I panicked and asked my friend at the computer to disarm in case of a fly away. The mavlink said disarmed by the quad was still flying. It lost a prop in the tree, spiraled into another tree and then hit the ground pretty hard.
It seemed to be still armed after hitting the ground and still trying to fly despite being upside down and disconnected from almost everything.

I had broken 2 props, 3 motor mounts and a few screws in the frame had pulled out. I think I got away pretty lightly.

Since re-building it, I have not had a single problem with it, I can even loiter within a 1.5 meter radius on a windy day. I just wanted to know what happened to it, what I did wrong and what I can do in the future to prevent or deal with this.

Video of the flight.

Log of the flight. (374.2 KB)

Wow, where to begin here.

6 satellites and an average HDOP of 5.0 (and was at 10 at several points) won’t be good.

The most satellites you ever got was 6. GPS Glitches are in the logs. At some point the GPS failsafe was enabled.

However you failed to log a lot of important info in diagnosing these. No vibration logs (IMU). RCIN is logged but no RCOUT.

Looking at where the circling started (yawing) it coincides with an EKF2 error. Likely a compass issue. Did you calibrate the compasses?

I had calibrated the compass properly and verified that it was facing north, south, east and west as far as I could tell. I had also done the motor interference calibration.

This is the first time I have ever used apm and my first quad so I’m not sure how to toggle various logs.
I was under the impression that GPS failsafe should have never engaged under stabilize and alt hold.