From e66a360e273188f100418aee8e18c6c2df8e299b Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 22 Dec 2018 14:37:21 +1100 Subject: [PATCH] AC_AutoTune: added lower limit on scaler reduction --- libraries/AC_AutoTune/AC_AutoTune.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/AC_AutoTune/AC_AutoTune.cpp b/libraries/AC_AutoTune/AC_AutoTune.cpp index 546d941d1e..afd381c7ed 100644 --- a/libraries/AC_AutoTune/AC_AutoTune.cpp +++ b/libraries/AC_AutoTune/AC_AutoTune.cpp @@ -1309,7 +1309,7 @@ void AC_AutoTune::twitching_test_rate(float rate, float rate_target_max, float & void AC_AutoTune::twitching_abort_rate(float angle, float rate, float angle_max, float meas_rate_min) { if (angle >= angle_max) { - if (is_equal(rate, meas_rate_min)) { + if (is_equal(rate, meas_rate_min) && step_scaler > 0.5) { // we have reached the angle limit before completing the measurement of maximum and minimum // reduce the maximum target rate step_scaler *= 0.9f;