From d0bc1520f64a28f749fc4b42dd33c6adf513f774 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 22 Dec 2018 11:03:18 +1100 Subject: [PATCH] AC_AutoTune: reset step_scaler between tune types --- libraries/AC_AutoTune/AC_AutoTune.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libraries/AC_AutoTune/AC_AutoTune.cpp b/libraries/AC_AutoTune/AC_AutoTune.cpp index 16b4dcdd69..770bf7ca18 100644 --- a/libraries/AC_AutoTune/AC_AutoTune.cpp +++ b/libraries/AC_AutoTune/AC_AutoTune.cpp @@ -769,6 +769,9 @@ void AC_AutoTune::control_attitude() // reset counter counter = 0; + // reset scaling factor + step_scaler = 1; + // move to the next tuning type switch (tune_type) { case RD_UP: @@ -898,6 +901,7 @@ void AC_AutoTune::backup_gains_and_initialise() step_start_time_ms = AP_HAL::millis(); level_start_time_ms = step_start_time_ms; tune_type = RD_UP; + step_scaler = 1; desired_yaw_cd = ahrs_view->yaw_sensor;