diff --git a/docs/en/config_vtol/vtol_quad_configuration.md b/docs/en/config_vtol/vtol_quad_configuration.md index 07ac0479412..4d8729cd19b 100644 --- a/docs/en/config_vtol/vtol_quad_configuration.md +++ b/docs/en/config_vtol/vtol_quad_configuration.md @@ -89,6 +89,8 @@ Parameter: [VT_F_TR_OL_TM](../advanced_config/parameter_reference.md#VT_F_TR_OL_ This specifies the duration of the front transition in seconds when no airspeed feedback is available (e.g. no airspeed sensor present). It should be set to a value which ensures that the vehicle reaches a high enough airspeed to complete the transition, e.g. airspeed should exceed [VT_ARSP_TRANS](../advanced_config/parameter_reference.md#VT_ARSP_TRANS). +Without airspeed feedback, multirotor control is blended out linearly over the part of this time in which the airspeed would be between [VT_ARSP_BLEND](../advanced_config/parameter_reference.md#VT_ARSP_BLEND) and [VT_ARSP_TRANS](../advanced_config/parameter_reference.md#VT_ARSP_TRANS) at constant acceleration. +For example, with `VT_ARSP_BLEND` = 8 m/s, `VT_ARSP_TRANS` = 10 m/s and this time set to 10 s, blending runs from 8 s to 10 s. #### Transition Timeout diff --git a/docs/en/config_vtol/vtol_without_airspeed_sensor.md b/docs/en/config_vtol/vtol_without_airspeed_sensor.md index dbcfc56ec23..20a7c8fdaff 100644 --- a/docs/en/config_vtol/vtol_without_airspeed_sensor.md +++ b/docs/en/config_vtol/vtol_without_airspeed_sensor.md @@ -42,7 +42,7 @@ Examine the throttle level (thrust) when the vehicle is level (no or little pitc The initial value to use as cruise speed should be the highest thrust applied during a roll or ascend, the thrust during level flight should be considered the minimum value if you decide to further tune down your speed. Also take note of the time it took for a front transition to complete. -This will be used to set the minimum transition time. +This will be used to set the open-loop transition time. For safety reasons you should add +- 30% to this time. Finally take note of the groundspeed during cruise flight. @@ -60,7 +60,8 @@ Note that QGC scales this from `1..100` and the thrust value from the log is sca So a thrust of 0.65 should be entered as 65. For safety reasons it is recommended to add +- 10% throttle to the determined value for testing a first flight. -Set the minimum front transition time ([VT_TRANS_MIN_TM](../advanced_config/parameter_reference.md#VT_TRANS_MIN_TM)) to the number of seconds determined from the reference flight and add +- 30% for safety. +Set the open-loop front transition time ([VT_F_TR_OL_TM](../advanced_config/parameter_reference.md#VT_F_TR_OL_TM)) to the number of seconds determined from the reference flight and add +- 30% for safety. +The multicopter motors are ramped down during the last part of this time, starting at the fraction [VT_ARSP_BLEND](../advanced_config/parameter_reference.md#VT_ARSP_BLEND) divided by [VT_ARSP_TRANS](../advanced_config/parameter_reference.md#VT_ARSP_TRANS) of it (e.g. after 8 s of 10 s with 8 m/s and 10 m/s). ### Optional Recommended Parameters @@ -100,5 +101,5 @@ The relevant parameters are: - [SYS_HAS_NUM_ASPD](../advanced_config/parameter_reference.md#SYS_HAS_NUM_ASPD) - [EKF2_EN](../advanced_config/parameter_reference.md#EKF2_EN) (1), [ATT_EN](../advanced_config/parameter_reference.md#ATT_EN) (0), [LPE_EN](../advanced_config/parameter_reference.md#LPE_EN) (0) - [FW_THR_TRIM](../advanced_config/parameter_reference.md#FW_THR_TRIM): determined (e.g. 70%) -- [VT_TRANS_MIN_TM](../advanced_config/parameter_reference.md#VT_TRANS_MIN_TM): determined (e.g. 10 seconds) +- [VT_F_TR_OL_TM](../advanced_config/parameter_reference.md#VT_F_TR_OL_TM): determined (e.g. 10 seconds) - [VT_FW_MIN_ALT](../advanced_config/parameter_reference.md#VT_FW_MIN_ALT): 15 diff --git a/src/modules/vtol_att_control/standard.cpp b/src/modules/vtol_att_control/standard.cpp index 3966db91ccd..4e56865b216 100644 --- a/src/modules/vtol_att_control/standard.cpp +++ b/src/modules/vtol_att_control/standard.cpp @@ -157,20 +157,20 @@ void Standard::update_transition_state() _airspeed_trans_blend_margin = getTransitionAirspeed() - getBlendAirspeed(); + float airspeed = _attc->get_calibrated_airspeed(); + + if (!PX4_ISFINITE(airspeed)) { + // without airspeed feedback assume constant acceleration, reaching the transition airspeed at the open-loop time + airspeed = getTransitionAirspeed() * _time_since_trans_start / getOpenLoopFrontTransitionTime(); + } + // do blending of mc and fw controls if a blending airspeed has been provided and the minimum transition time has passed if (_airspeed_trans_blend_margin > 0.0f && - PX4_ISFINITE(_attc->get_calibrated_airspeed()) && - _attc->get_calibrated_airspeed() > 0.0f && - _attc->get_calibrated_airspeed() >= getBlendAirspeed() && + airspeed > 0.0f && + airspeed >= getBlendAirspeed() && _time_since_trans_start > getMinimumFrontTransitionTime()) { - mc_weight = 1.0f - fabsf(_attc->get_calibrated_airspeed() - getBlendAirspeed()) / - _airspeed_trans_blend_margin; - // time based blending when no airspeed sensor is set - - } else if (!PX4_ISFINITE(_attc->get_calibrated_airspeed())) { - mc_weight = 1.0f - _time_since_trans_start / getMinimumFrontTransitionTime(); - mc_weight = math::constrain(2.0f * mc_weight, 0.0f, 1.0f); + mc_weight = 1.0f - fabsf(airspeed - getBlendAirspeed()) / _airspeed_trans_blend_margin; } // ramp up FW_PSP_OFF diff --git a/src/modules/vtol_att_control/vtol_att_control_params.yaml b/src/modules/vtol_att_control/vtol_att_control_params.yaml index e2f0885a87f..e8afd8dd318 100644 --- a/src/modules/vtol_att_control/vtol_att_control_params.yaml +++ b/src/modules/vtol_att_control/vtol_att_control_params.yaml @@ -202,6 +202,7 @@ parameters: short: Airspeed-less front transition time (open loop) long: |- The duration of the front transition when there is no airspeed feedback available. + Multicopter control is blended out over the part of this time in which the airspeed would be between VT_ARSP_BLEND and VT_ARSP_TRANS at constant acceleration. When airspeed is used, transition timeout is declared if airspeed does not reach VT_ARSP_BLEND after this time. type: float