Describe the bug
Px4 entered into HOLD mode due to a bug in the RTL time failsafe on fixed-wing platform.
v1.16.1
Description: Px4 entered into HOLD (loiter) mode at T+129s into log (this was commanded) and tried to ascend up to the set loiter altitude. nav_state changes from 0 (manual) to 4 (HOLD).
Params set to "do nothing" but auto entry into HOLD mode occurred, see relevant params below:
Battery failsafe parameters:
BAT_LOW_THR: 15%
BAT_CRIT_THR: 5%
BAT_EMERGEN_THR: 3%
COM_LOW_BAT_ACT: 0 (Warning Only)
RTL failsafe parameters:
COM_FLTT_LOW_ACT: 0 (no action)
COM_FAIL_ACT_T: 5 (seconds)
RTL_TIME_FACTOR: 1.1
RTL_TIME_MARGIN: 100 (seconds)
At T+129 the Battery Low Remaining Failsafe is triggered because the RTL_time_estimate (50.9s) drops below safe_time_estimate (156s). COM_FLTT_LOW_ACT is set to 0 (no action) and COM_FAIL_ACT_T is set to a delay of 5 seconds, so nothing should happen. But the delay triggers an IF statement in failsafe/framework.cpp, setting _current_delay = _current_start_delay. Further below, because _current_delay > 0, mode gets hard set to HOLD mode at line 484. So, even through aircraft was on the ground for auto-takeoff testing, the mode changed to HOLD mode and the aircraft attempted to takeoff (to achieve HOLD altitude setpoint).
Temporary resolution: Set COM_FLTT_LOW_ACT to 1 (warning). Documentation is not clear on this (it allows value of 0 (None)).
Steps to reproduce on benchtop:
- Have GCS running and connected to vehicle wirelessly Have vehicle fed by Benchtop Power supply
- Start at ~22.0V (full battery)
- Arm
- Go to Manual Mode
- Reduce Voltage until Battery Warning in announced (~21.0V)
- Blow into Pitot (Nothing will happen)
- Drop voltage to ~10-9% (~20.3V)
- Blow into Pitot Tube
- Aircraft will go into "Hold" until you stop blowing into pitot tube
- Able to repeat as long as air is blown into pitot (Px4 thinks there is flight)
Flight Log / Additional Information
Log Link: https://review.px4.io/plot_app?log=7906f58a-397e-42a0-9339-d91f9df36927
Firmware Version: v1.16.1 (RC) (94cb2012)
Hardware: PX4_FMU_V6C
Describe the bug
Px4 entered into HOLD mode due to a bug in the RTL time failsafe on fixed-wing platform.
v1.16.1
Description: Px4 entered into HOLD (loiter) mode at T+129s into log (this was commanded) and tried to ascend up to the set loiter altitude. nav_state changes from 0 (manual) to 4 (HOLD).
Params set to "do nothing" but auto entry into HOLD mode occurred, see relevant params below:
Battery failsafe parameters:
BAT_LOW_THR: 15%BAT_CRIT_THR: 5%BAT_EMERGEN_THR: 3%COM_LOW_BAT_ACT: 0 (Warning Only)RTL failsafe parameters:
COM_FLTT_LOW_ACT: 0 (no action)COM_FAIL_ACT_T: 5 (seconds)RTL_TIME_FACTOR: 1.1RTL_TIME_MARGIN: 100 (seconds)At T+129 the Battery Low Remaining Failsafe is triggered because the
RTL_time_estimate(50.9s) drops belowsafe_time_estimate(156s).COM_FLTT_LOW_ACTis set to 0 (no action) andCOM_FAIL_ACT_Tis set to a delay of 5 seconds, so nothing should happen. But the delay triggers an IF statement in failsafe/framework.cpp, setting_current_delay = _current_start_delay. Further below, because_current_delay > 0, mode gets hard set to HOLD mode at line 484. So, even through aircraft was on the ground for auto-takeoff testing, the mode changed to HOLD mode and the aircraft attempted to takeoff (to achieve HOLD altitude setpoint).Temporary resolution: Set
COM_FLTT_LOW_ACTto 1 (warning). Documentation is not clear on this (it allows value of 0 (None)).Steps to reproduce on benchtop:
Flight Log / Additional Information
Log Link: https://review.px4.io/plot_app?log=7906f58a-397e-42a0-9339-d91f9df36927
Firmware Version: v1.16.1 (RC) (94cb2012)
Hardware: PX4_FMU_V6C