From 07cedd8a669fd104690a76055a315ca8ff3914b4 Mon Sep 17 00:00:00 2001
From: Andrew Tridgell <andrew@tridgell.net>
Date: Tue, 24 Jan 2017 17:59:28 +1100
Subject: [PATCH] Plane: prevent stability shutdown in transition

this prevents the vertical motors from shutting down while
transitioning if the desired throttle was too low at the start of the
transition
---
 ArduPlane/quadplane.cpp | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/ArduPlane/quadplane.cpp b/ArduPlane/quadplane.cpp
index f6a8c74904..9bd9733f60 100644
--- a/ArduPlane/quadplane.cpp
+++ b/ArduPlane/quadplane.cpp
@@ -1065,8 +1065,10 @@ void QuadPlane::update_transition(void)
         }
         float trans_time_ms = (float)transition_time_ms.get();
         float throttle_scaled = last_throttle * (trans_time_ms - (millis() - transition_start_ms)) / trans_time_ms;
-        if (throttle_scaled < 0) {
-            throttle_scaled = 0;
+        if (throttle_scaled < 0.01) {
+            // ensure we don't drop all the way to zero or the motors
+            // will stop stabilizing
+            throttle_scaled = 0.01;
         }
         assisted_flight = true;
         hold_stabilize(throttle_scaled);
-- 
GitLab