mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
Support negative thrust for back transition
This commit is contained in:
parent
59d81ee0f1
commit
e5a55cd142
@ -143,7 +143,7 @@ Standard::parameters_update()
|
||||
|
||||
/* reverse throttle */
|
||||
param_get(_params_handles_standard.reverse_throttle, &v);
|
||||
_params_standard.reverse_throttle = math::constrain(v, 0.0f, 1.0f);
|
||||
_params_standard.reverse_throttle = math::constrain(v, -1.0f, 1.0f);
|
||||
|
||||
/* mpc cruise speed */
|
||||
param_get(_params_handles_standard.mpc_xy_cruise, &_params_standard.mpc_xy_cruise);
|
||||
@ -186,13 +186,12 @@ void Standard::update_vtol_state()
|
||||
_flag_enable_mc_motors = true;
|
||||
_vtol_schedule.transition_start = hrt_absolute_time();
|
||||
|
||||
if (_params_handles_standard.reverse_output > FLT_EPSILON) {
|
||||
_pusher_throttle = _params_standard.reverse_throttle;
|
||||
_reverse_output = _params_standard.reverse_output;
|
||||
_pusher_throttle = _params_standard.reverse_throttle;
|
||||
_reverse_output = _params_standard.reverse_output;
|
||||
|
||||
} else {
|
||||
// prevent positive thrust without control channel activated
|
||||
if (_pusher_throttle > FLT_EPSILON && _reverse_output < 0.01f) {
|
||||
_pusher_throttle = 0.0f;
|
||||
_reverse_output = 0.0f;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -250,9 +250,10 @@ PARAM_DEFINE_FLOAT(VT_B_REV_OUT, 0.0f);
|
||||
|
||||
/**
|
||||
* Thottle output during back transition
|
||||
* This is only enabled when VT_B_REV_OUT is enabled and is used for active breaking with reverse thrust
|
||||
* For ESCs and mixers that support reverse thrust on low PWM values set this to a negative value to apply active breaking
|
||||
* For ESCs that support thrust reversal with a control channel please set VT_B_REV_OUT and set this to a positive value to apply active breaking
|
||||
*
|
||||
* @min 0
|
||||
* @min -1
|
||||
* @max 1
|
||||
* @increment 0.01
|
||||
* @decimal 2
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user