diydrones/ardupilot — pull request #1569 by priseborough (2014-11-03 22:05:49+00:00)
Title: AP_TECS : Reduce throttle undershoot after underperforming climb

This reduces a potential cause of low airspeed and stalling after a prolonged climb where the plane is unable to keep up with the TECS climb rate.

If the plane is unable to achieve the climb and gets significantly below the internal TECS demanded climb profile, the the PD term will be a large value at the top of climb, and will take some time to reduce due to the upstream rate limiter. This means that the integrator state could be pushed to a very low value and effectively cause the throttle to sit on the lower limit for longer than desired after levelling out. This could have contributed to one reported incidence of a stall following a sustained climb, see attached plots which show the integrator state pegged at a low value during climb.

![top of climb stall event](https://cloud.githubusercontent.com/assets/3596952/4890753/c1adaea6-63a1-11e4-8f46-ca55186586d5.png)

![top of climb stall event - throttle response](https://cloud.githubusercontent.com/assets/3596952/4890804/42cac186-63a2-11e4-9798-4675f4fe28f2.png)

In this instance the user had a very underpowered setup and a slow throttle slew rate of 30, was operating just 4 m/s above stall speed, and demanded a negative height change during the recovery, however it is worth adding additional protection. This patch will reduce the time required for the throttle to come off the bottom stop in this type of situation.