Skip to content

[Bug] auto entry into HOLD mode during auto-takeoff testing. #27554

@acsousa

Description

@acsousa

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:

  1. Have GCS running and connected to vehicle wirelessly Have vehicle fed by Benchtop Power supply
  2. Start at ~22.0V (full battery)
  3. Arm
  4. Go to Manual Mode
  5. Reduce Voltage until Battery Warning in announced (~21.0V)
  6. Blow into Pitot (Nothing will happen)
  7. Drop voltage to ~10-9% (~20.3V)
  8. Blow into Pitot Tube
  9. Aircraft will go into "Hold" until you stop blowing into pitot tube
  10. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    status:needs-triageAuto-assigned to new issues and removed after maintainers review it and assign the specific label.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions