diff --git a/ArduPlane/Parameters.cpp b/ArduPlane/Parameters.cpp index 4da8435d3a899..da07c22643b95 100644 --- a/ArduPlane/Parameters.cpp +++ b/ArduPlane/Parameters.cpp @@ -1245,6 +1245,15 @@ const AP_Param::GroupInfo ParametersG2::var_info[] = { AP_SUBGROUPINFO(precland, "PLND_", 35, ParametersG2, AC_PrecLand), #endif + // @Param: TKOFF_THR_MIN + // @DisplayName: takeoff minimum throttle + // @Description: The minimum throttle to use in takeoff or in a quadpane forward transition in automatic throttle modes. This can be useful to ensure faster takeoffs or transitions on aircraft where the normal throttle control leads to a slow takeoff or transition. Set to zero to disable. + // @Units: % + // @Range: 0 100 + // @Increment: 1 + // @User: Standard + AP_GROUPINFO("TKOFF_THR_MIN", 36, ParametersG2, takeoff_throttle_min, 0), + AP_GROUPEND }; diff --git a/ArduPlane/Parameters.h b/ArduPlane/Parameters.h index ba89c45772811..e751475ddac14 100644 --- a/ArduPlane/Parameters.h +++ b/ArduPlane/Parameters.h @@ -574,6 +574,8 @@ class ParametersG2 { AP_Int8 axis_bitmask; // axes to be autotuned + AP_Int8 takeoff_throttle_min; + // just to make compilation easier when all things are compiled out... uint8_t unused_integer; }; diff --git a/ArduPlane/servos.cpp b/ArduPlane/servos.cpp index cc4d4dde104e3..bc3857801f7ea 100644 --- a/ArduPlane/servos.cpp +++ b/ArduPlane/servos.cpp @@ -540,7 +540,21 @@ float Plane::apply_throttle_limits(float throttle_in) throttle_watt_limiter(min_throttle, max_throttle); #endif - return constrain_float(throttle_in, min_throttle, max_throttle); + auto throttle = constrain_float(throttle_in, min_throttle, max_throttle); + + /* + apply TKOFF_THR_MIN if enabled and in an auto-throttle forward + transition + */ + if (use_takeoff_throttle_max) { + const auto tmin_thr = g2.takeoff_throttle_min; + if (tmin_thr > throttle) { + throttle = MAX(throttle, tmin_thr); + TECS_controller.reset_throttle_I(); + } + } + + return throttle; } /*