mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-03 06:28:27 -04:00
Plane: added Q_TAILSIT_THSCMX
this provides more flexibility in tailsitter throttle scaling
This commit is contained in:
parent
ac5fb07b2c
commit
eb7f752ec5
@ -352,6 +352,13 @@ const AP_Param::GroupInfo QuadPlane::var_info2[] = {
|
|||||||
// @Path: ../libraries/AC_WPNav/AC_Loiter.cpp
|
// @Path: ../libraries/AC_WPNav/AC_Loiter.cpp
|
||||||
AP_SUBGROUPPTR(loiter_nav, "LOIT_", 2, QuadPlane, AC_Loiter),
|
AP_SUBGROUPPTR(loiter_nav, "LOIT_", 2, QuadPlane, AC_Loiter),
|
||||||
|
|
||||||
|
// @Param: TAILSIT_THSCMX
|
||||||
|
// @DisplayName: Maximum control throttle scaling value
|
||||||
|
// @Description: Maximum value of throttle scaling for tailsitter velocity scaling, reduce this value to remove low thorottle D ossilaitons
|
||||||
|
// @Range: 1 5
|
||||||
|
// @User: Standard
|
||||||
|
AP_GROUPINFO("TAILSIT_THSCMX", 3, QuadPlane, tailsitter.throttle_scale_max, 5),
|
||||||
|
|
||||||
AP_GROUPEND
|
AP_GROUPEND
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -401,6 +401,7 @@ private:
|
|||||||
AP_Float vectored_forward_gain;
|
AP_Float vectored_forward_gain;
|
||||||
AP_Float vectored_hover_gain;
|
AP_Float vectored_hover_gain;
|
||||||
AP_Float vectored_hover_power;
|
AP_Float vectored_hover_power;
|
||||||
|
AP_Float throttle_scale_max;
|
||||||
} tailsitter;
|
} tailsitter;
|
||||||
|
|
||||||
// the attitude view of the VTOL attitude controller
|
// the attitude view of the VTOL attitude controller
|
||||||
|
@ -209,13 +209,14 @@ void QuadPlane::tailsitter_speed_scaling(void)
|
|||||||
{
|
{
|
||||||
const float hover_throttle = motors->get_throttle_hover();
|
const float hover_throttle = motors->get_throttle_hover();
|
||||||
const float throttle = motors->get_throttle();
|
const float throttle = motors->get_throttle();
|
||||||
const float scaling_max = 5;
|
float scaling;
|
||||||
float scaling = 1;
|
|
||||||
if (is_zero(throttle)) {
|
if (is_zero(throttle)) {
|
||||||
scaling = scaling_max;
|
scaling = tailsitter.throttle_scale_max;
|
||||||
} else {
|
} else {
|
||||||
scaling = constrain_float(hover_throttle / throttle, 1/scaling_max, scaling_max);
|
scaling = constrain_float(hover_throttle / throttle, 0, tailsitter.throttle_scale_max);
|
||||||
}
|
}
|
||||||
|
|
||||||
const SRV_Channel::Aux_servo_function_t functions[2] = {
|
const SRV_Channel::Aux_servo_function_t functions[2] = {
|
||||||
SRV_Channel::Aux_servo_function_t::k_aileron,
|
SRV_Channel::Aux_servo_function_t::k_aileron,
|
||||||
SRV_Channel::Aux_servo_function_t::k_elevator};
|
SRV_Channel::Aux_servo_function_t::k_elevator};
|
||||||
|
Loading…
Reference in New Issue
Block a user