From 373f7b34213704a3cfc7720c2526e66c63161feb Mon Sep 17 00:00:00 2001 From: Leonard Hall Date: Sun, 18 Feb 2024 11:10:10 +1030 Subject: [PATCH] Copter: Autotune: Little tweek to squash --- libraries/AC_AutoTune/AC_AutoTune_Multi.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/libraries/AC_AutoTune/AC_AutoTune_Multi.cpp b/libraries/AC_AutoTune/AC_AutoTune_Multi.cpp index 9d6dcea8b0f12c..a8b377fa211bdd 100644 --- a/libraries/AC_AutoTune/AC_AutoTune_Multi.cpp +++ b/libraries/AC_AutoTune/AC_AutoTune_Multi.cpp @@ -511,14 +511,14 @@ void AC_AutoTune_Multi::twitching_test_rate(float rate, float rate_target_max, f } // capture minimum measurement after the measurement has peaked (aka "bounce back") - if ((rate < meas_rate_min) && (meas_rate_max > rate_target_max * 0.5f)) { + if ((rate < meas_rate_min) && (meas_rate_max > rate_target_max * 0.25)) { // the measurement is bouncing back meas_rate_min = rate; } // calculate early stopping time based on the time it takes to get to 75% - if (meas_rate_max < rate_target_max * 0.75f) { - // the measurement not reached the 75% threshold yet + if (meas_rate_max < rate_target_max * 63.21) { + // the measurement not reached the 63.21% threshold yet step_time_limit_ms = (now - step_start_time_ms) * 3; step_time_limit_ms = MIN(step_time_limit_ms, AUTOTUNE_TESTING_STEP_TIMEOUT_MS); } @@ -574,7 +574,7 @@ void AC_AutoTune_Multi::twitching_test_angle(float angle, float rate, float angl } // capture minimum angle after we have reached a reasonable maximum angle - if ((angle < meas_angle_min) && (meas_angle_max > angle_target_max * 0.5f)) { + if ((angle < meas_angle_min) && (meas_angle_max > angle_target_max * 0.25)) { // the measurement is bouncing back meas_angle_min = angle; } @@ -593,8 +593,8 @@ void AC_AutoTune_Multi::twitching_test_angle(float angle, float rate, float angl } // calculate early stopping time based on the time it takes to get to 75% - if (meas_angle_max < angle_target_max * 0.75f) { - // the measurement not reached the 75% threshold yet + if (meas_angle_max < angle_target_max * 63.21) { + // the measurement not reached the 63.21% threshold yet step_time_limit_ms = (now - step_start_time_ms) * 3; step_time_limit_ms = MIN(step_time_limit_ms, AUTOTUNE_TESTING_STEP_TIMEOUT_MS); }