Two silly unexplained crashes

Hello, I just had two fairly odd crashes in one day (no damage) but am completely baffled about why they happened. The .bin can be found at this link.

The log contains three (very) short flights, let me describe what happened.

This was the first test flight of a foamie Icon A5 with a Pixracer R15. The idea was to test all was well and autotune it.

The first flight (AUTOTUNE) was very unimpressive as the motor was weak and the elevator at full up was barely letting it climb so I closed the throttle and let it land.

After mucking about with the elevator horn to allow for larger up deflection, I tried again in AUTOTUNE. It took off, started gaining altitude then suddenly rolled hard right and crashed upside down. I had a look, it looked OK (it barely had time to gain any serious altitude, the moment it completed the roll it pretty much hit the ground) so I said what the hell, I would try again.

This time, I tried it in FBWA, in case it was AUTOTUNE related. The behaviour was exactly the same, hard roll to the right and crash after a few seconds.

After the crash, I had a look at the log in MP and Dronee Plotter, half expecting to see some naughtiness with the power supply causing the board to brown out but POWR.Vcc seems fine (ripples within 4.91 and 4.98 Volts).
Looking at the first (non crashy) flight, and plotting AETR.Ail and AHR2.Roll, it is evident that they are mirrored around the x-axis:

Looking at the first crashy flight, this seems to be the case also till after 19:1840, when it pulls all the stops and deflects the aileron fully in the correct (apparently) direction. There are a few frantic complete reversals after it has rolled over but that is probably because it was close to the 180 degree mark and the autopilot was trying to decide which way to unflip it:

Similar story with the second crash flight:

In both cases, it looks like all is going fine and then the whole thing flips for no reason despite the ailerons fully deflecting to aver it, at least if the log is to be believed.

One more thing that struck me as odd was that, when it was on the ground and upside down, the ailerons would not move when moving the Tx stick whereas the elevator would. However, when changing mode and then changing back, it went back to normal.

It looks very, very strange. I will try again at some point with a camera watching the ailerons to see what they are actually doing because I 'm not sure I can trust the log. Does anyone have any idea what I could be missing?

Sounds like you have a servo output reversed due to a reversed or channel on your Tx.
If you tested you control throws in manual it does’t mean they are correct in an auto mode like FBWA. You must test your control movement in FBWA as described in this wiki. Take off your prop and arm the plane. Check your servo movement by tilting your plane, don’t touch the control sticks. You may find the ailerons response is the wrong way.
http://ardupilot.org/plane/docs/guide-four-channel-plane.html#guide-four-channel-plane

The outputs were fine. I tested in manual and FBWA. Also, reversed servo output would have crashed it pretty much immediately the moment it left my hand. In this case, I had one whole flight of a few seconds (the first of three where it did not gain altitude fast enough and I eventually let it glide down) in AUTOTUNE (which behaves like FBWA) and it did a fine job of flying it till it landed. In the other two, which resulted in crashes, it flew fine for a few seconds in both cases and then suddenly it went berserk.

I have now taken the autopilot out and will try it in a Bixler to see if the problem persists across vehicles. I am wondering if it’s some electrical weirdness in the aileron servos since the frame is old and has had a few knocks and been in a box for quite a while.

Is the ahrs orientation correct?

Yes, to the best of my knowledge. I cannot test now since I have taken the autopilot out but I did all the checks, control surface deflections were OK, artificial horizon response was OK, everything seems normal. Also, the corrections to roll in the first few seconds were fine (and in the very first flight they were fine throughout), which is telling. I have flown with reversed ailerons in the past and once I switched from a manual takeoff to one of the autopilot assisted modes, all hell broke loose in a millisecond. In this case, the flight went fine for a few seconds, then suddenly had a stroke.

The reason I am suspecting something weird and electrical is that when upside down on the ground and in AUTOTUNE or FBWA, I could move the elevator but not the ailerons which were locked to one extreme of their range. I am not sure if this is expected behaviour of the autopilot or not.

Closing this thread. I did a flight using exactly the same autopilot setup but migrating it to a Bixler. Everything worked perfectly so I am narrowing the cause down to wiring in the aileron servos.

Closing the thread some, just in case it helps someone, somewhere, somewhen.

I had another day of multiple crashes and finally the penny dropped after seeing the exact same symptoms while trying a take off in MANUAL mode. The thread connecting all the crashes was full throttle on a newly installed motor with rather weak thrust for this airframe and significant elevator up while struggling to gain altitude.
My problem was a spin. There was nothing wrong with the aileron deflections or anything. I was just so focused on troubleshooting the electronics that I never even considered basic aerodynamics :man_facepalming: