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

View File

@ -769,6 +769,9 @@ void AC_AutoTune::control_attitude()
// reset counter // reset counter
counter = 0; counter = 0;
// reset scaling factor
step_scaler = 1;
// move to the next tuning type // move to the next tuning type
switch (tune_type) { switch (tune_type) {
case RD_UP: case RD_UP:
@ -898,6 +901,7 @@ void AC_AutoTune::backup_gains_and_initialise()
step_start_time_ms = AP_HAL::millis(); step_start_time_ms = AP_HAL::millis();
level_start_time_ms = step_start_time_ms; level_start_time_ms = step_start_time_ms;
tune_type = RD_UP; tune_type = RD_UP;
step_scaler = 1;
desired_yaw_cd = ahrs_view->yaw_sensor; desired_yaw_cd = ahrs_view->yaw_sensor;