AC_AutoTune: reset step_scaler between tune types

This commit is contained in:
Andrew Tridgell 2018-12-22 11:03:18 +11:00
parent d6a23fd22a
commit d0bc1520f6
1 changed files with 4 additions and 0 deletions

View File

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