Copter: autotune bug fix to autotune_updating_p_up_d_down

This resolves an issue in which the D term could be reduced far lower than
it should have been.
This commit is contained in:
Leonard Hall 2016-08-04 21:30:03 +09:00 committed by Randy Mackay
parent 3b86ef71ca
commit 22422bd7b3
1 changed files with 1 additions and 1 deletions

View File

@ -1267,7 +1267,7 @@ void Copter::autotune_updating_p_up_d_down(float &tune_d, float tune_d_min, floa
autotune_state.ignore_next = 1; autotune_state.ignore_next = 1;
// if maximum measurement was greater than target so increment the success counter // if maximum measurement was greater than target so increment the success counter
autotune_counter++; autotune_counter++;
}else if ((measurement_max < target) && (measurement_max-measurement_min > measurement_max*g.autotune_aggressiveness) && (tune_d > tune_d_min)) { } else if ((measurement_max < target) && (measurement_max > target*(1.0f-AUTOTUNE_D_UP_DOWN_MARGIN)) && (measurement_max-measurement_min > measurement_max*g.autotune_aggressiveness) && (tune_d > tune_d_min)) {
// if bounce back was larger than the threshold so decrement the success counter // if bounce back was larger than the threshold so decrement the success counter
if (autotune_counter > 0 ) { if (autotune_counter > 0 ) {
autotune_counter--; autotune_counter--;