mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-12-03 15:00:47 +08:00
refactor(vtol_att_control): rename pusher failure to forward propulsion failure
The multicopter detection also checks the forward tilt of tiltrotors now, so "pusher failure" no longer fits. The quad-chute reason, its event, the VtolType latch and check, and the test fixture are renamed, and VT_EF_TIME, VT_EF_THROT and VT_EF_VEL_ERR move to vtol_att_control_params.yaml, as they are shared by both types. Parameter names stay. pusher_assist() keeps its name, as that is the name of the feature. Nothing of this is in a release yet. Assisted-by: Claude:claude-opus-5-5 Signed-off-by: jonas <jonspero@me.com>
This commit is contained in:
1 parent
218a1e0e27
commit
0d46711f17
11 files changed
+90
-90
No files matched your search
@@ -400,15 +400,15 @@ The parameters that control when the quad-chute will trigger are listed in the t
|
||||
| <a id="VT_FW_MIN_ALT"></a>[VT_FW_MIN_ALT](../advanced_config/parameter_reference.md#VT_FW_MIN_ALT) | Minimum altitude above Home for fixed-wing flight. When the altitude drops below this value in fixed-wing flight the vehicle a quad-chute is triggered. |
|
||||
| <a id="VT_FW_QC_R"></a>[VT_FW_QC_R](../advanced_config/parameter_reference.md#VT_FW_QC_R) | Absolute roll threshold for quad-chute triggering in FW mode. |
|
||||
| <a id="VT_FW_QC_P"></a>[VT_FW_QC_P](../advanced_config/parameter_reference.md#VT_FW_QC_P) | Absolute pitch threshold for quad-chute triggering in FW mode. |
|
||||
| <a id="VT_EF_TIME"></a>[VT_EF_TIME](../advanced_config/parameter_reference.md#VT_EF_TIME) | Pusher failure detection time for standard VTOLs and tiltrotors using pusher assist ([VT_FWD_THRUST_EN]): the pusher throttle, or the forward tilt of a tiltrotor. In multicopter mode, the failure detection triggers if, for this time, the pusher assist is above [VT_EF_THROT] but the forward velocity stays more than [VT_EF_VEL_ERR] below its setpoint. It blocks front transitions until reboot. A working pusher that cannot keep up, as in a strong headwind, may be reported too. A failure is only detected once pusher assist is needed. Prior to detection, a front transition will still be executed but fail. Set to 0 to disable; in flight this allows front transitions again. |
|
||||
| <a id="VT_EF_TIME"></a>[VT_EF_TIME](../advanced_config/parameter_reference.md#VT_EF_TIME) | Forward propulsion failure detection time for standard VTOLs and tiltrotors using pusher assist ([VT_FWD_THRUST_EN]): the pusher throttle, or the forward tilt of a tiltrotor. In multicopter mode, the failure detection triggers if, for this time, the pusher assist is above [VT_EF_THROT] but the forward velocity stays more than [VT_EF_VEL_ERR] below its setpoint. It blocks front transitions until reboot. A working pusher that cannot keep up, as in a strong headwind, may be reported too. A failure is only detected once pusher assist is needed. Prior to detection, a front transition will still be executed but fail. Set to 0 to disable; in flight this allows front transitions again. |
|
||||
|
||||
[VT_FWD_THRUST_EN]: ../advanced_config/parameter_reference.md#VT_FWD_THRUST_EN
|
||||
[VT_EF_THROT]: ../advanced_config/parameter_reference.md#VT_EF_THROT
|
||||
[VT_EF_VEL_ERR]: ../advanced_config/parameter_reference.md#VT_EF_VEL_ERR
|
||||
|
||||
### Pusher Failure Detection Tuning
|
||||
### Forward Propulsion Failure Detection Tuning
|
||||
|
||||
First estimates for the pusher failure detection parameters:
|
||||
First estimates for the forward propulsion failure detection parameters:
|
||||
|
||||
- [VT_EF_THROT]: about 80% of the highest pusher assist (pusher throttle, or forward tilt of a tiltrotor), `VT_FWD_THRUST_SC * (sin(VT_PITCH_MIN) + sin(MPC_TILTMAX_AIR))` (at most 0.9).
|
||||
With the defaults this is `0.7 * (sin(0°) + sin(45°)) = 0.49`, which gives the default of 0.4.
|
||||
@@ -420,7 +420,7 @@ To check them in flight:
|
||||
1. Set [SYS_FAILURE_EN](../advanced_config/parameter_reference.md#SYS_FAILURE_EN) and [CA_FAILURE_MODE](../advanced_config/parameter_reference.md#CA_FAILURE_MODE) to 1 for the test (motor failure injection requires both), and back to 0 afterwards.
|
||||
2. Fly a multicopter leg with pusher assist at your usual speed and at a safe altitude, for example in a mission.
|
||||
3. Stop the pusher with `failure motor wrong -i <n>` (see [System Failure Injection](../debug/failure_injection.md)), where `<n>` is the motor number of the pusher in the [actuator configuration](../config/actuators.md).
|
||||
A pusher failure should be reported `VT_EF_TIME` after the vehicle has slowed down.
|
||||
A forward propulsion failure should be reported `VT_EF_TIME` after the vehicle has slowed down.
|
||||
On a tiltrotor, skip this step: it would stop a lift motor, and a tilt failure cannot be injected. Only check the logs of normal flights, as described below.
|
||||
4. In the [flight log](../log/flight_log_analysis.md), check that after the failure the pusher assist throttle (`vehicle_thrust_setpoint` instance 0, `xyz[0]`; on a tiltrotor the forward tilt, `tiltrotor_extra_controls.collective_tilt_normalized_setpoint` minus `VT_TILT_MC`) rises above `VT_EF_THROT`, and the forward velocity (along the heading) falls more than `VT_EF_VEL_ERR` below its setpoint (`vx` and `vy` of `vehicle_local_position` and `vehicle_local_position_setpoint`).
|
||||
The position controller does not always demand the full `MPC_TILTMAX_AIR` vehicle tilt, especially when it is large, so the pusher assist throttle can stay below the estimate.
|
||||
|
||||
@@ -208,7 +208,7 @@ Please continue reading for [upgrade instructions](#upgrade-guide).
|
||||
|
||||
- After a [quad-chute](../config/safety.md#quad-chute-failsafe), Mission and VTOL Takeoff mode no longer command forward transitions and continue in multicopter mode. Before, a resumed mission commanded the next transition again, which also cleared the quad-chute, and with [COM_QC_ACT](../advanced_config/parameter_reference.md#COM_QC_ACT) set to Warning a quad-chute during a mission transition left the mission waiting at that item.
|
||||
- A [quad-chute](../config/safety.md#quad-chute-failsafe) commanded with `MAV_CMD_DO_VTOL_TRANSITION` (`param2` = 1) now only switches to multicopter mode, as it is not caused by a failure. It no longer executes [COM_QC_ACT](../advanced_config/parameter_reference.md#COM_QC_ACT) or requires a reboot before the next arming.
|
||||
- Standard VTOLs and tiltrotors using pusher assist ([VT_FWD_THRUST_EN](../advanced_config/parameter_reference.md#VT_FWD_THRUST_EN)) now detect a pusher failure in multicopter mode, when the forward velocity stays well below its setpoint although the pusher assist (the pusher throttle, or the forward tilt of a tiltrotor) is above [VT_EF_THROT](../advanced_config/parameter_reference.md#VT_EF_THROT). A detected failure is handled as a [quad-chute](../config/safety.md#quad-chute-failsafe) that blocks front transitions until reboot. Setting [VT_EF_TIME](../advanced_config/parameter_reference.md#VT_EF_TIME) to 0 disables the detection and, in flight, allows front transitions again.
|
||||
- Standard VTOLs and tiltrotors using pusher assist ([VT_FWD_THRUST_EN](../advanced_config/parameter_reference.md#VT_FWD_THRUST_EN)) now detect a forward propulsion failure in multicopter mode, when the forward velocity stays well below its setpoint although the pusher assist (the pusher throttle, or the forward tilt of a tiltrotor) is above [VT_EF_THROT](../advanced_config/parameter_reference.md#VT_EF_THROT). A detected failure is handled as a [quad-chute](../config/safety.md#quad-chute-failsafe) that blocks front transitions until reboot. Setting [VT_EF_TIME](../advanced_config/parameter_reference.md#VT_EF_TIME) to 0 disables the detection and, in flight, allows front transitions again.
|
||||
|
||||
### Fixed-wing
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ Standard::parameters_update()
|
||||
// make sure that pusher ramp in backtransition is smaller than back transition (max) duration
|
||||
_param_vt_b_trans_ramp.set(math::min(_param_vt_b_trans_ramp.get(), _param_vt_b_trans_dur.get()));
|
||||
|
||||
clearPusherFailureIfDisabled();
|
||||
clearForwardPropulsionFailureIfDisabled();
|
||||
}
|
||||
|
||||
void Standard::update_vtol_state()
|
||||
@@ -71,9 +71,9 @@ void Standard::update_vtol_state()
|
||||
* For the back transition the pusher motor is immediately stopped and rotors reactivated.
|
||||
*/
|
||||
|
||||
// without pusher a front transition would fail too, so this quad-chute stays until reboot
|
||||
if (_pusher_failed) {
|
||||
_attc->quadchute(QuadchuteReason::PusherFailure);
|
||||
// without forward propulsion a front transition would fail too, so this quad-chute stays until reboot
|
||||
if (_forward_propulsion_failed) {
|
||||
_attc->quadchute(QuadchuteReason::ForwardPropulsionFailure);
|
||||
}
|
||||
|
||||
float mc_weight = _mc_roll_weight;
|
||||
@@ -292,7 +292,7 @@ void Standard::update_mc_state()
|
||||
|
||||
_pusher_throttle = VtolType::pusher_assist();
|
||||
|
||||
_pusher_failed = _pusher_failed || isPusherFailureDetected(_pusher_throttle);
|
||||
_forward_propulsion_failed = _forward_propulsion_failed || isForwardPropulsionFailureDetected(_pusher_throttle);
|
||||
}
|
||||
|
||||
void Standard::update_fw_state()
|
||||
|
||||
@@ -60,43 +60,3 @@ parameters:
|
||||
min: 0
|
||||
increment: 0.01
|
||||
decimal: 2
|
||||
VT_EF_TIME:
|
||||
description:
|
||||
short: Pusher failure detection time
|
||||
long: A pusher failure is detected in multicopter mode when, for this time, the
|
||||
pusher assist is above VT_EF_THROT, but the forward velocity stays more than
|
||||
VT_EF_VEL_ERR below its setpoint. Pusher assist is the pusher throttle of a standard
|
||||
VTOL, or the forward tilt of a tiltrotor. It is handled as a quad-chute that blocks
|
||||
front transitions until reboot or until disabled. Only used by standard VTOLs and
|
||||
tiltrotors when VT_FWD_THRUST_EN is enabled. Set to 0 to disable.
|
||||
type: float
|
||||
default: 5.0
|
||||
unit: s
|
||||
min: 0.0
|
||||
max: 20.0
|
||||
increment: 0.1
|
||||
decimal: 1
|
||||
VT_EF_THROT:
|
||||
description:
|
||||
short: Pusher failure detection pusher assist threshold
|
||||
long: Pusher throttle of a standard VTOL, or forward tilt of a tiltrotor above VT_TILT_MC.
|
||||
Has to be below the highest pusher assist, which VT_FWD_THRUST_SC, VT_PITCH_MIN and
|
||||
MPC_TILTMAX_AIR set.
|
||||
type: float
|
||||
default: 0.4
|
||||
min: 0.0
|
||||
max: 0.9
|
||||
increment: 0.01
|
||||
decimal: 2
|
||||
VT_EF_VEL_ERR:
|
||||
description:
|
||||
short: Pusher failure detection forward velocity error
|
||||
long: Forward velocity setpoint minus forward velocity above which pusher assist
|
||||
above VT_EF_THROT is considered ineffective, see VT_EF_TIME.
|
||||
type: float
|
||||
default: 3.5
|
||||
unit: m/s
|
||||
min: 0.5
|
||||
max: 10.0
|
||||
increment: 0.1
|
||||
decimal: 1
|
||||
@@ -141,8 +141,8 @@ TEST_F(VtolQuadchutePusherTest, DetectedQuadchuteStopsPusherAssist)
|
||||
EXPECT_FALSE(PX4_ISFINITE(runCycle(attc, standard, true)));
|
||||
}
|
||||
|
||||
// Pusher failures detected in multicopter mode block front transitions until VT_EF_TIME is set to 0 or reboot.
|
||||
class VtolPusherFailureTest : public VtolQuadchutePusherTest
|
||||
// Forward propulsion failures detected in multicopter mode block front transitions until VT_EF_TIME is set to 0 or reboot.
|
||||
class VtolForwardPropulsionFailureTest : public VtolQuadchutePusherTest
|
||||
{
|
||||
protected:
|
||||
void SetUp() override
|
||||
@@ -198,7 +198,7 @@ protected:
|
||||
}
|
||||
};
|
||||
|
||||
TEST_F(VtolPusherFailureTest, NoForwardMotionIsPusherFailure)
|
||||
TEST_F(VtolForwardPropulsionFailureTest, NoForwardMotionIsForwardPropulsionFailure)
|
||||
{
|
||||
VtolAttitudeControl attc;
|
||||
Standard standard(&attc);
|
||||
@@ -208,7 +208,7 @@ TEST_F(VtolPusherFailureTest, NoForwardMotionIsPusherFailure)
|
||||
EXPECT_TRUE(attc.is_fixed_wing_system_failure());
|
||||
EXPECT_GE(flight_time, 100_ms); // not before VT_EF_TIME
|
||||
|
||||
// a front transition command clears the reason, the next update detects the latched pusher failure again
|
||||
// a front transition command clears the reason, the next update detects the latched forward propulsion failure again
|
||||
commandFrontTransition(attc);
|
||||
ASSERT_TRUE(attc.is_fixed_wing_requested());
|
||||
ASSERT_FALSE(attc.is_quadchute_active());
|
||||
@@ -217,7 +217,7 @@ TEST_F(VtolPusherFailureTest, NoForwardMotionIsPusherFailure)
|
||||
EXPECT_EQ(standard.get_mode(), mode::ROTARY_WING);
|
||||
}
|
||||
|
||||
TEST_F(VtolPusherFailureTest, DisablingDetectionAllowsFrontTransitions)
|
||||
TEST_F(VtolForwardPropulsionFailureTest, DisablingDetectionAllowsFrontTransitions)
|
||||
{
|
||||
VtolAttitudeControl attc;
|
||||
Standard standard(&attc);
|
||||
@@ -238,7 +238,7 @@ TEST_F(VtolPusherFailureTest, DisablingDetectionAllowsFrontTransitions)
|
||||
EXPECT_EQ(standard.get_mode(), mode::TRANSITION_TO_FW);
|
||||
}
|
||||
|
||||
TEST_F(VtolPusherFailureTest, PusherFailureReplacesCommandedQuadchute)
|
||||
TEST_F(VtolForwardPropulsionFailureTest, ForwardPropulsionFailureReplacesCommandedQuadchute)
|
||||
{
|
||||
VtolAttitudeControl attc;
|
||||
Standard standard(&attc);
|
||||
@@ -253,7 +253,7 @@ TEST_F(VtolPusherFailureTest, PusherFailureReplacesCommandedQuadchute)
|
||||
EXPECT_FALSE(PX4_ISFINITE(runCycle(attc, standard, true)));
|
||||
}
|
||||
|
||||
TEST_F(VtolPusherFailureTest, ForwardVelocityCloseToSetpointIsNoPusherFailure)
|
||||
TEST_F(VtolForwardPropulsionFailureTest, ForwardVelocityCloseToSetpointIsNoForwardPropulsionFailure)
|
||||
{
|
||||
VtolAttitudeControl attc;
|
||||
Standard standard(&attc);
|
||||
@@ -263,7 +263,7 @@ TEST_F(VtolPusherFailureTest, ForwardVelocityCloseToSetpointIsNoPusherFailure)
|
||||
EXPECT_FALSE(attc.is_fixed_wing_system_failure());
|
||||
}
|
||||
|
||||
TEST_F(VtolPusherFailureTest, MovingBackwardWhenHoldingPositionIsPusherFailure)
|
||||
TEST_F(VtolForwardPropulsionFailureTest, MovingBackwardWhenHoldingPositionIsForwardPropulsionFailure)
|
||||
{
|
||||
VtolAttitudeControl attc;
|
||||
Standard standard(&attc);
|
||||
@@ -273,7 +273,7 @@ TEST_F(VtolPusherFailureTest, MovingBackwardWhenHoldingPositionIsPusherFailure)
|
||||
EXPECT_TRUE(attc.is_fixed_wing_system_failure());
|
||||
}
|
||||
|
||||
TEST_F(VtolPusherFailureTest, PusherAssistBelowThresholdIsNoPusherFailure)
|
||||
TEST_F(VtolForwardPropulsionFailureTest, PusherAssistBelowThresholdIsNoForwardPropulsionFailure)
|
||||
{
|
||||
VtolAttitudeControl attc;
|
||||
Standard standard(&attc);
|
||||
@@ -284,14 +284,14 @@ TEST_F(VtolPusherFailureTest, PusherAssistBelowThresholdIsNoPusherFailure)
|
||||
}
|
||||
|
||||
// A tiltrotor assists with forward tilt instead of a pusher, which the same detection checks
|
||||
TEST_F(VtolPusherFailureTest, TiltrotorWithoutForwardMotionIsPusherFailure)
|
||||
TEST_F(VtolForwardPropulsionFailureTest, TiltrotorWithoutForwardMotionIsForwardPropulsionFailure)
|
||||
{
|
||||
VtolAttitudeControl attc;
|
||||
Tiltrotor tiltrotor(&attc);
|
||||
setHover(attc, 0.f);
|
||||
|
||||
fly(attc, tiltrotor, 2_s);
|
||||
EXPECT_EQ(quadchuteReason(attc), QuadchuteReason::PusherFailure);
|
||||
EXPECT_EQ(quadchuteReason(attc), QuadchuteReason::ForwardPropulsionFailure);
|
||||
EXPECT_FLOAT_EQ(tiltrotor.pusher_assist(), 0.f); // the tilt goes back to VT_TILT_MC
|
||||
|
||||
// latched: a front transition command does not start a transition
|
||||
@@ -302,7 +302,7 @@ TEST_F(VtolPusherFailureTest, TiltrotorWithoutForwardMotionIsPusherFailure)
|
||||
EXPECT_EQ(tiltrotor.get_mode(), mode::ROTARY_WING);
|
||||
}
|
||||
|
||||
TEST_F(VtolPusherFailureTest, TiltrotorTiltAssistBelowThresholdIsNoPusherFailure)
|
||||
TEST_F(VtolForwardPropulsionFailureTest, TiltrotorTiltAssistBelowThresholdIsNoForwardPropulsionFailure)
|
||||
{
|
||||
// only the tilt above VT_TILT_MC counts: 0.1 + 0.35 of tilt assist is still below VT_EF_THROT (0.4)
|
||||
const float tilt_mc = 0.1f;
|
||||
@@ -315,7 +315,7 @@ TEST_F(VtolPusherFailureTest, TiltrotorTiltAssistBelowThresholdIsNoPusherFailure
|
||||
EXPECT_FALSE(attc.is_fixed_wing_system_failure());
|
||||
}
|
||||
|
||||
TEST_F(VtolPusherFailureTest, TiltrotorDisablingDetectionAllowsFrontTransitions)
|
||||
TEST_F(VtolForwardPropulsionFailureTest, TiltrotorDisablingDetectionAllowsFrontTransitions)
|
||||
{
|
||||
VtolAttitudeControl attc;
|
||||
Tiltrotor tiltrotor(&attc);
|
||||
|
||||
@@ -58,7 +58,7 @@ Tiltrotor::parameters_update()
|
||||
{
|
||||
VtolType::updateParams();
|
||||
|
||||
clearPusherFailureIfDisabled();
|
||||
clearForwardPropulsionFailureIfDisabled();
|
||||
}
|
||||
|
||||
void Tiltrotor::update_vtol_state()
|
||||
@@ -69,9 +69,9 @@ void Tiltrotor::update_vtol_state()
|
||||
* forward completely. For the backtransition the motors simply rotate back.
|
||||
*/
|
||||
|
||||
// without forward tilt a front transition would fail too, so this quad-chute stays until reboot
|
||||
if (_pusher_failed) {
|
||||
_attc->quadchute(QuadchuteReason::PusherFailure);
|
||||
// without forward propulsion a front transition would fail too, so this quad-chute stays until reboot
|
||||
if (_forward_propulsion_failed) {
|
||||
_attc->quadchute(QuadchuteReason::ForwardPropulsionFailure);
|
||||
}
|
||||
|
||||
if (_attc->is_quadchute_active()) {
|
||||
@@ -202,7 +202,7 @@ void Tiltrotor::update_mc_state()
|
||||
_tilt_control = tilt_assist + _param_vt_tilt_mc.get();
|
||||
_mc_yaw_weight = 1.0f;
|
||||
|
||||
_pusher_failed = _pusher_failed || isPusherFailureDetected(tilt_assist);
|
||||
_forward_propulsion_failed = _forward_propulsion_failed || isForwardPropulsionFailureDetected(tilt_assist);
|
||||
}
|
||||
|
||||
void Tiltrotor::update_fw_state()
|
||||
|
||||
@@ -232,9 +232,9 @@ VtolAttitudeControl::quadchute(QuadchuteReason reason)
|
||||
"Quad-chute triggered due to maximum roll angle exceeded");
|
||||
break;
|
||||
|
||||
case QuadchuteReason::PusherFailure:
|
||||
events::send(events::ID("vtol_att_ctrl_quadchute_pusher"), events::Log::Critical,
|
||||
"Quad-chute triggered due to pusher failure");
|
||||
case QuadchuteReason::ForwardPropulsionFailure:
|
||||
events::send(events::ID("vtol_att_ctrl_quadchute_fwd_prop"), events::Log::Critical,
|
||||
"Quad-chute triggered due to forward propulsion failure");
|
||||
break;
|
||||
|
||||
case QuadchuteReason::None:
|
||||
|
||||
@@ -154,7 +154,7 @@ public:
|
||||
float get_calibrated_airspeed() { return _calibrated_airspeed; }
|
||||
|
||||
private:
|
||||
friend class VtolPusherFailureTest; // exercises front transition commands after a pusher failure
|
||||
friend class VtolForwardPropulsionFailureTest; // exercises front transition commands after a forward propulsion failure
|
||||
|
||||
void Run() override;
|
||||
uORB::SubscriptionCallbackWorkItem _vehicle_torque_setpoint_virtual_fw_sub{this, ORB_ID(vehicle_torque_setpoint_virtual_fw)};
|
||||
|
||||
@@ -302,3 +302,43 @@ parameters:
|
||||
max: 1
|
||||
decimal: 1
|
||||
increment: 0.1
|
||||
VT_EF_TIME:
|
||||
description:
|
||||
short: Forward propulsion failure detection time
|
||||
long: A forward propulsion failure is detected in multicopter mode when, for this
|
||||
time, the pusher assist is above VT_EF_THROT, but the forward velocity stays more
|
||||
than VT_EF_VEL_ERR below its setpoint. Pusher assist is the pusher throttle of a
|
||||
standard VTOL, or the forward tilt of a tiltrotor. It is handled as a quad-chute that
|
||||
blocks front transitions until reboot or until disabled. Only used by standard VTOLs
|
||||
and tiltrotors when VT_FWD_THRUST_EN is enabled. Set to 0 to disable.
|
||||
type: float
|
||||
default: 5.0
|
||||
unit: s
|
||||
min: 0.0
|
||||
max: 20.0
|
||||
increment: 0.1
|
||||
decimal: 1
|
||||
VT_EF_THROT:
|
||||
description:
|
||||
short: Forward propulsion failure detection assist threshold
|
||||
long: Pusher throttle of a standard VTOL, or forward tilt of a tiltrotor above VT_TILT_MC.
|
||||
Has to be below the highest pusher assist, which VT_FWD_THRUST_SC, VT_PITCH_MIN and
|
||||
MPC_TILTMAX_AIR set.
|
||||
type: float
|
||||
default: 0.4
|
||||
min: 0.0
|
||||
max: 0.9
|
||||
increment: 0.01
|
||||
decimal: 2
|
||||
VT_EF_VEL_ERR:
|
||||
description:
|
||||
short: Forward propulsion failure detection forward velocity error
|
||||
long: Forward velocity setpoint minus forward velocity above which pusher assist
|
||||
above VT_EF_THROT is considered ineffective, see VT_EF_TIME.
|
||||
type: float
|
||||
default: 3.5
|
||||
unit: m/s
|
||||
min: 0.5
|
||||
max: 10.0
|
||||
increment: 0.1
|
||||
decimal: 1
|
||||
@@ -162,8 +162,8 @@ void VtolType::update_transition_state()
|
||||
|
||||
_time_since_trans_start = (float)(t_now - _transition_start_timestamp) * 1e-6f;
|
||||
|
||||
// the pusher failure detection restarts in multicopter mode
|
||||
_pusher_failure_hysteresis.set_state_and_update(false, t_now);
|
||||
// the forward propulsion failure detection restarts in multicopter mode
|
||||
_forward_propulsion_failure_hysteresis.set_state_and_update(false, t_now);
|
||||
|
||||
check_quadchute_condition();
|
||||
|
||||
@@ -402,11 +402,11 @@ void VtolType::check_quadchute_condition()
|
||||
}
|
||||
}
|
||||
|
||||
bool VtolType::isPusherFailureDetected(float assist)
|
||||
bool VtolType::isForwardPropulsionFailureDetected(float assist)
|
||||
{
|
||||
bool pusher_ineffective = false;
|
||||
|
||||
if (isPusherFailureDetectionEnabled() && assist > _param_vt_ef_throt.get() && _local_pos->v_xy_valid) {
|
||||
if (isForwardPropulsionCheckEnabled() && assist > _param_vt_ef_throt.get() && _local_pos->v_xy_valid) {
|
||||
const Quatf q(_v_att->q);
|
||||
const float forward_vel = q.rotateVectorInverse(Vector3f(_local_pos->vx, _local_pos->vy, _local_pos->vz))(0);
|
||||
const float forward_vel_sp = q.rotateVectorInverse(Vector3f(_local_pos_sp->vx, _local_pos_sp->vy,
|
||||
@@ -416,16 +416,16 @@ bool VtolType::isPusherFailureDetected(float assist)
|
||||
pusher_ineffective = forward_vel_sp - forward_vel > _param_vt_ef_vel_err.get();
|
||||
}
|
||||
|
||||
_pusher_failure_hysteresis.set_hysteresis_time_from(false, (hrt_abstime)(1_s * math::max(_param_vt_ef_time.get(), 0.f)));
|
||||
_pusher_failure_hysteresis.set_state_and_update(pusher_ineffective, hrt_absolute_time());
|
||||
_forward_propulsion_failure_hysteresis.set_hysteresis_time_from(false, (hrt_abstime)(1_s * math::max(_param_vt_ef_time.get(), 0.f)));
|
||||
_forward_propulsion_failure_hysteresis.set_state_and_update(pusher_ineffective, hrt_absolute_time());
|
||||
|
||||
return _pusher_failure_hysteresis.get_state();
|
||||
return _forward_propulsion_failure_hysteresis.get_state();
|
||||
}
|
||||
|
||||
void VtolType::clearPusherFailureIfDisabled()
|
||||
void VtolType::clearForwardPropulsionFailureIfDisabled()
|
||||
{
|
||||
if (!isPusherFailureDetectionEnabled()) {
|
||||
_pusher_failed = false;
|
||||
if (!isForwardPropulsionCheckEnabled()) {
|
||||
_forward_propulsion_failed = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -93,7 +93,7 @@ enum class QuadchuteReason {
|
||||
TransitionAltitudeLoss,
|
||||
MaximumPitchExceeded,
|
||||
MaximumRollExceeded,
|
||||
PusherFailure,
|
||||
ForwardPropulsionFailure,
|
||||
};
|
||||
|
||||
class VtolAttitudeControl;
|
||||
@@ -330,17 +330,17 @@ protected:
|
||||
|
||||
int _altitude_reset_counter{0};
|
||||
|
||||
// multicopter pusher failure detection, on the pusher throttle of a standard VTOL or the forward tilt of a tiltrotor
|
||||
systemlib::Hysteresis _pusher_failure_hysteresis{false};
|
||||
bool _pusher_failed{false}; ///< latched until reboot or until the detection is disabled
|
||||
// multicopter forward propulsion failure detection, on the pusher throttle of a standard VTOL or the forward tilt of a tiltrotor
|
||||
systemlib::Hysteresis _forward_propulsion_failure_hysteresis{false};
|
||||
bool _forward_propulsion_failed{false}; ///< latched until reboot or until the detection is disabled
|
||||
|
||||
bool isPusherFailureDetectionEnabled() const { return _param_vt_ef_time.get() > FLT_EPSILON; }
|
||||
bool isForwardPropulsionCheckEnabled() const { return _param_vt_ef_time.get() > FLT_EPSILON; }
|
||||
|
||||
/** Pusher assist (from pusher_assist()) above VT_EF_THROT, but the forward velocity stays below its setpoint */
|
||||
bool isPusherFailureDetected(float assist);
|
||||
bool isForwardPropulsionFailureDetected(float assist);
|
||||
|
||||
/** Disabling the detection in flight clears a detected pusher failure, e.g. a false positive in strong wind */
|
||||
void clearPusherFailureIfDisabled();
|
||||
/** Disabling the detection in flight clears a detected forward propulsion failure, e.g. a false positive in strong wind */
|
||||
void clearForwardPropulsionFailureIfDisabled();
|
||||
|
||||
DEFINE_PARAMETERS_CUSTOM_PARENT(ModuleParams,
|
||||
(ParamBool<px4::params::VT_ELEV_MC_LOCK>) _param_vt_elev_mc_lock,
|
||||
|
||||
Reference in new issue
Block a user