Skip to content

Commit

Permalink
Plane: added TKOFF_THR_MIN
Browse files Browse the repository at this point in the history
this allows for a minimum throttle to be applied during a takeoff or a
forward transition in auto throttle modes. This is useful on high drag
aircraft where normal TECS throttle control results in a slow
transition or takeoff
  • Loading branch information
tridge committed Jun 2, 2024
1 parent eb8eeba commit dce2a93
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 1 deletion.
9 changes: 9 additions & 0 deletions ArduPlane/Parameters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
};

Expand Down
2 changes: 2 additions & 0 deletions ArduPlane/Parameters.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
Expand Down
16 changes: 15 additions & 1 deletion ArduPlane/servos.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/*
Expand Down

0 comments on commit dce2a93

Please sign in to comment.