Copter lost control during Auto Mode

First time analyzing a log. Can someone tell me why my copter a 3DR-Y6 lost control.
Was 3rd flight on a clear cold day,about 20F. Winds 5-10 knots.
Log is attached.

Again-what happened?
And how do I prevent it in the future?

Thanks
Kurt B.

So first off, “lose control” can mean lots of things - I could not tell if you meant that you had crashed, or if you had a flyaway, etc, so I had to look at a few things.

It looks like the copter’s inertial navigation solution went bad on your second battery, with xy errors over 15m. There were no GPS glitches. This suggests two possibilities:

  1. Vibration. Accelerometers must be accurate for INAV to work.
  • It is hard to analyze this given only a tlog, as it is providing acceleration data at about 2hz due to your parameters. I suspect it could be a contributing factor, as it looks pretty rough. I’d estimate noise magnitude at x=1m/s^2, y=4m/s^2, z=2m/s^2. How is your APM mounted?
  1. Yaw inaccuracy (compass problems). Sources of compass inaccuracy are incorrect compass orientation or compass_orient parameter, incorrect declination parameter, incorrect compass offset parameters, and magnetic fields from the power distribution.
  • Your optimal offsets seem to have changed between your two flights. Your offsets were great the first flight, not so great the second flight. This problem represents a 45 degree yaw error, which means that a huge amount of acceleration is being applied to the wrong axis in inertial nav. What changed between flights? In any case, you should redo your calibration.
  • You are picking up some magnetic field from the power distribution. You haven’t run the compassmot procedure, which would help a lot. You will have about 20-30% interference at full throttle. Where have you mounted your compass? Is it on the included four nylon spacers?

Additionally, you’ve set your iNAV_TC_XY and INAV_TC_Z parameters to slightly higher than default. This weights the accelerometers more and the GPS less, causing the copter to be more susceptible to these effects. These are time constants, and error in position delta measured by accelerometers is quadratic in time. (3/2.5)^2 is 1.44 and (7/5)^2 is 1.96, so I’m guessing your XY errors were 45% larger than it would have been otherwise and your Z was 96% larger than it would’ve been otherwise.