Plane: correct extened range airspeed scailing limits

This commit is contained in:
Iampete1 2022-09-03 18:34:23 +01:00 committed by Andrew Tridgell
parent 3610d36fce
commit 5a53e22886
1 changed files with 4 additions and 4 deletions

View File

@ -12,14 +12,14 @@ float Plane::calc_speed_scaler(void)
if (aspeed > auto_state.highest_airspeed && hal.util->get_soft_armed()) {
auto_state.highest_airspeed = aspeed;
}
// ensure we have scaling over the full configured airspeed
const float scale_min = MIN(0.5, g.scaling_speed / (2.0 * aparm.airspeed_max));
const float scale_max = MAX(2.0, g.scaling_speed / (0.7 * aparm.airspeed_min));
if (aspeed > 0.0001f) {
speed_scaler = g.scaling_speed / aspeed;
} else {
speed_scaler = 2.0;
speed_scaler = scale_max;
}
// ensure we have scaling over the full configured airspeed
float scale_min = MIN(0.5, (0.5 * aparm.airspeed_min) / g.scaling_speed);
float scale_max = MAX(2.0, (1.5 * aparm.airspeed_max) / g.scaling_speed);
speed_scaler = constrain_float(speed_scaler, scale_min, scale_max);
#if HAL_QUADPLANE_ENABLED