#15764·betaflight

Autopilot landing: touchdown detection and ground effect follow-ups from #15661

Author: blckmnCreated Sep 26, 2026Updated Sep 28, 2026

Follow-up from #15563 and #15661 by @dmitrii-galantsev. #15763 fixes the landing target running out on landings started high (#15651). These parts of #15661 are not on master and need a landing log on current master before we settle on a design, since #15584 changed the estimator underneath them.

  1. Mid-air disarm latch. updateLanding() in flight_plan_nav.c latches landingDescentEstablished on a single descending sample. After that, any quiet period of ap_landing_detection_time disarms with DISARM_REASON_LANDING at any height. Gating the quiet check on isBelowLandingAltitude() stops that, but it is measured against the arming altitude, so a landing site more than ap_landing_altitude_m above the arming point (or altitude drift of that size) would never disarm.
  2. Ground contact does not end the descent. Touchdown is only the quiet velocity timer, which resets on any transient, so a craft bouncing or skittering on its feet can keep near hover thrust on the ground and ground effect can lift it again. With landing_disarm_threshold at its default of 0 nothing else disarms an autopilot landing. #15661 inferred contact from impact (accelerometer amplitude plus jerk), a stalled descent or a timeout, then bled throttle to ap_throttle_min. ap_landing_throttle_threshold exists in the autopilot PG but nothing reads it, so a throttle based contact signal may be the simpler route and would not depend on altitude above the arming point.
  3. Ground effect sink. A phantom baro plunge near the ground can drive D and launch the craft. #15661 bounded the sink D acts on during a landing, fitted to one blackbox captured before #15584.

What would help: blackbox logs of Flight Plan or GPS rescue landings on current master with baro and debug_mode = AUTOPILOT_ALTITUDE, ideally including a landing on ground higher than the arming point. The author's tests and simulation are on the #15661 branch.