AC_AutoTune: added lower limit on scaler reduction

This commit is contained in:
Andrew Tridgell 2018-12-22 14:37:21 +11:00
parent b897551e0b
commit e66a360e27

View File

@ -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;