Hi Dazza,
It looks like you have found significant number of problems with your setup, leaving only the explanation of the unexpected loss of power.
As John has said the important issues here are:
- Your roll pitch tuning was too high leaving your copter on the verge of an oscillation.
- Your copter is hovering at about 75 to 80% throttle.
The job of the roll and pitch pid loops is to keep the copter horizontal so that the thrust generated can be used to keep the copter flying. If the controller finds itself in a situation where it is losing control of roll and pitch, the motors may not be able to supply enough power to correct the problem. So the controller adjusts the throttle output to give the controllers the power they are asking for. This results in the best chance of regaining control and returning the copter to it’s commanded attitude. Once the copter is back under control the thrust can again be applied to keeping the copter up. This all happens in 1/100th of a second. The only way the throttle can remain low in this situation is if the PID loops continually ask for more power than the copter can provide at the commanded throttle setting. This is what the logs clearly show happened to you.
I hear you say, “but my copter was level, it was under control”. It looked like your copter was under control because it didn’t flip. But it was not under full control. The logs show that the copter was very quickly oscillating back and forth. And this was taking the stability patch to it’s limits to stop the copter losing control completely. To do this your throttle was being reduced because your cotper is heavily loaded.
So why did this happen then. Well first up, your gains mean that it only takes the slightest change to set your copter oscillating and that oscillation will be fast and difficult for you to see from the ground. It looks like something physically changed between the two flights on the log. This may have been a slight movement in one of the arms causing the yaw offset John mentioned (I would not be surprised if something is looser than it should be). However, what ever changed was enough to set the copter stability right on the edge. From here anything can make the difference, battery voltage, wind, airspeed, roll or pitch angle, temperature. In your case you had two instances, one in alt hold and one in RTL.
We can never say there isn’t any problem in the code that could contribute to a problem like this, we can say with complete confidence that this problem wasn’t caused by the code or the stability patch. In this case the code did exactly what it was intended to do. As a result, your copter landed with enough control to do only minor damage.
The reason we can talk with such authority about your flight, despite not being there, is because the logs have a great deal of information in them. This information is not subject to human memory or impression, it directly logs what is happening in the controller. This, combined with an intimate knowledge of the code, means there is no question about, for example, what throttle your copter is actually hovering at, just weather what you thought you were hovering at is correct.
This detailed logging feature is one of the most significant features of arducopter that is not available on other popular systems. If you learn to use it you will be able to find and correct the mistakes you are making, hopefully before they lead to a crash.
I would also suggest that you will make the people helping you feel more appreciated if you spend less time suggesting code problems, or insulting comparisons with other systems, when your mistakes are pointed out.