I’ve had a relatively nice flight with a relatively fresh quadcopter build, worked beautifully until I tried to do the takeoff during the last part of the flight.
Looking at the logs it almost seems like there might be yaw imbalance, but why would it flip?
INS_HNTCH_OPTS should be 6 for this machine (bits “multi-source” absolutely necessary and “update at loop rate” desirable for an agile machine)
INS_HNTCH_BW is too high for an agile multirotor, should be maybe 1/5-th of INS_HNTCH_FREQ (which is 16) or maybe even smaller (I would set it to 1/10-th, or 8).
I would also say that INS_HNTCH_FREQ = 80 does not cover the range of propeller frequencies actually observed in the flight. During one of the parts of the flight in Stabilize you essentially had all propellers at minimum around 10 Hz, apparently due to a sharp direction change of a sort. To match that, you would like to have INS_HNTCH_FREQ = 8 and INS_HNTCH_BW something like 1.
I also observed that the error in desired vs actual pitch and roll increased, on average, from something like 1 degree to something like 1.5 degrees during the Stabilize segment and to 2 degrees after that. This makes me think that you had a vibration-caused hardware failure of a sort that was being prepared during the flight and triggered on the next lift-off. This is not a final conclusion yet, though.
Okay, I still don’t have an exact proven conclusion. It would be desirable to have a look at few photos of the quad to see what’s possible and what’s not, but the following picture of vibrations increasing in a step to values in 25-35, just after 07:23:24 at the start, suggests that something physically broke up, and the rest was just chaos.
What immediately preceded that was very poor (maybe even diverging) control in yaw. Pitch and roll were also bad but maybe not quite as bad.
If - and only if - the quad is made with round carbon fiber arms, the following would be consistent with what I observe to have happened:
at least one of the motor mounts was not secured well enough
over the course of the first part of the flight, in part due to quite high frame vibrations, this mount was slowly losing grip, which manifested in yaw control that was getting more and more sloppy over the course of the flight (check the green plot below), with other axes to follow
then, at the landing, the landing impact, or possibly handling of the vehicle after that, forced that mount severely out of the alignment, which was easier than before the flight because it got loose
at the next lift-off, this misalignment caused severe yaw difference; contrary to what one sees with misaligned but firmly mounted motors, this seems to change direction, but because the implied cause is the mount being loose, the change of direction may happen for many reasons
as the machine was trying to correct, something broke (either in that mount or maybe somewhere else) well enough to be observed via vibe logs.
It was an EKF issue causing a failsafe with Vibration Compensation activated. Attitude control becomes difficult, a crash can be the result. It’s called Vibration Compensation but all factors that effect the EKF health can cause it to trigger. In this case there was positional errors.