Skip to content

Pr airbound 4575 rc11 fixes - #132

Merged
akshar-airbound merged 24 commits into
airbound-developfrom
pr-airbound-4575-rc11-fixes
Jul 28, 2026
Merged

Pr airbound 4575 rc11 fixes#132
akshar-airbound merged 24 commits into
airbound-developfrom
pr-airbound-4575-rc11-fixes

Conversation

@akshar-airbound

@akshar-airbound akshar-airbound commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator
  • This PR adds multiple features/fixes.
    1. Clamping desired pitch in VTOL to 25
    2. New lua bindings to access desired angles/rates and actual angles/rates for scripting
    3. Reduce autodisarm time
    4. Fix feedforward scalar calculation when vtol thrust error angle remains between 60 deg and 90 deg
    5. Resume to previous mode post autobailout
    6. Trigger autobailout using rate based pitch prediction
    7. Limit autobailout resume count
    8. Fix for Door not closing in fixed wing flight and fix door script opening during takeoff issue
    9. Increased the Yaw angle P gain to 5 and Changed the Yaw rate controller gains
    10. Disable autobailout during auto-takeoff
  • All the release candidates from rc3 to rc11 have been bundled together in this PR

Notion Page:
https://app.notion.com/p/airbound/airbound-develop-add-4-5-7-5-rc11-features-3a521adf4be980f59aa4f2a9fb6e1913?source=copy_link

vigneshm-debug and others added 24 commits June 16, 2026 12:39
- AP_Scripting: expose rate PID info to Lua via get_rate_pid_info(axis)
- Adds lua_get_rate_pid_info() binding returning a table of PID fields
(P, I, D, FF, target, actual, error) for roll (0), pitch (1), or yaw (2)
rate controllers. Used to compute control effort (|P + D + FF|) from Lua.
- Add get_attitude_control() public accessor to QuadPlane
- Add despitch, roll and yaw
…ed pitch (#111)

* Remove controller desaturation in control effort
* Add desaturation logic for Desired servo tilt
* Add logging for VH Power
* Add hard limit for pitch angle setpoint
* Add new parameters in default.param
* Add logging for the position controller demanded pitch
---------

Co-authored-by: Manuraj P M <[email protected]>
* introduced parameter LND_DET_TIM that controls how many milliseconds before disarm is detected
* add disarm watchdog and disable weathervane after touchdown
* Weathervane disable logic changed
* expose land detection timing as params Q_LND_RELAX_MS and Q_LND_LLIM_MS
---------

Co-authored-by: Stefard100 <[email protected]>
* Fix feedforward_scalar calculation when thrust angle error exceeds limits in AC_AttitudeControl.cpp
* add resume after autobailout
@greptile-apps

greptile-apps Bot commented Jul 24, 2026

Copy link
Copy Markdown

Greptile Summary

This PR bundles rc3–rc11 changes for ArduPlane 4.5.7.5, covering VTOL flight safety improvements, a redesigned autobailout system, door-control script fixes, new Lua scripting bindings, PID tuning, and a feedforward scalar correction.

  • Autobailout redesign (autobailout.lua): adds rate-based pitch prediction, a rolling-window analytics buffer, mode-resume-on-recovery with a configurable count cap, and takeoff inhibit; the disable-via-negative-parameter guard checks the wrong variable (pitch_timeout instead of threshold), which can cause perpetual autobailout triggers if AUTOB_PIT_LIM is set negative following the in-code comment.
  • Attitude control (AC_AttitudeControl.cpp): adds a configurable VTOL pitch clamp (PIT_CLIP_MAX, default 25°) and corrects the feedforward scalar formula so it correctly fades from 1.0→0.0 across the 60°–90° thrust-error window instead of starting at 0.
  • Door script refactor (ab_door_auto_control.lua): replaces the landing-latch mechanism with a one_forward_transition_complete flag so doors only open in VTOL after the first fixed-wing transition has been confirmed, fixing the takeoff-open issue.

Confidence Score: 4/5

Safe to merge with one fix: the wrong-variable disable guard in autobailout.lua must be corrected before operators use negative AUTOB_PIT_LIM to disable monitoring.

The autobailout redesign is substantial and mostly well-structured. One concrete defect was found: is_vtol_pitch_exceeding_limit guards the disable path by checking pitch_timeout < 0 (AUTOB_PIT_TOUT) while the comment instructs operators to set AUTOB_PIT_LIM negative to disable—a negative limit makes math.abs(pitch) > threshold unconditionally true, causing perpetual autobailout triggers. The feedforward scalar fix and pitch-clamp addition are straightforward and correct. The door-script refactor logic is sound.

Files Needing Attention: autobailout.lua — the is_vtol_pitch_exceeding_limit disable guard checks the wrong parameter variable.

Important Files Changed

Filename Overview
ArduPlane/quadplane.cpp Removed now timestamp from tailsitter_in_vtol_transition(), dropping the 1-second post-FW-flight grace window (previously flagged).
libraries/AC_AttitudeControl/AC_AttitudeControl.cpp Adds VTOL pitch clamping via new PIT_CLIP_MAX parameter, and corrects the feedforward scalar formula to linearly fade from 1→0 over the TH2 to TH3 thrust-error range.
libraries/AP_Motors/AP_MotorsTailsitter.cpp Removed pitch/yaw tilt headroom constraint and limit.yaw flag; yaw integrator windup risk during saturation (previously flagged).
libraries/AP_HAL_ChibiOS/hwdef/Pixhawk6C-bdshot/scripts/autobailout.lua Major redesign adding rate-based pitch prediction, rolling window analytics, mode-resume-on-recovery, and takeoff inhibit. Contains a wrong-variable disable guard that causes constant autobailout if AUTOB_PIT_LIM is set negative per the comment.
libraries/AP_HAL_ChibiOS/hwdef/Pixhawk6C-bdshot/scripts/ab_door_auto_control.lua Replaces landing-latch mechanism with one_forward_transition_complete flag; doors now open in VTOL only after the first FW transition is confirmed.
libraries/AP_Scripting/lua_bindings.cpp Adds four new Lua bindings with correct nullptr guards, all returning a single table.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[update loop] --> B{autobailout_active?}
    B -- No --> C[is_vtol_pitch_exceeding_limit]
    B -- No --> D[is_predicted_vtol_pitch_exceeding_threshold]
    C -- true --> E[trigger_autobailout]
    D -- true --> E
    E --> F[set_mode QLoiter\nautobailout_active = true\npre_bailout_mode saved]
    B -- Yes --> G{current_mode == QLOITER?}
    G -- No --> H[Manual Override\nautobailout_active = false]
    G -- Yes --> I{post_bailout_samples >= WINDOW\navg_err < avg_lim\npeak_ang < peak_lim\nresume_count < max}
    I -- Yes --> J[set_mode pre_bailout_mode\nautobresume_count++]
    I -- No --> K[Stay in QLoiter]
    J --> L{PIT_LIM negative bug?}
    L -- AUTOB_PIT_LIM negative --> M[threshold < 0\nabs always > threshold\ninstant re-trigger]
    M --> E
Loading

Reviews (2): Last reviewed commit: "Change version 4.5.7.5-rc11-fixes" | Re-trigger Greptile

Comment thread libraries/AP_Motors/AP_MotorsTailsitter.cpp
Comment thread ArduPlane/quadplane.cpp
Comment thread libraries/AP_Scripting/docs/docs.lua
@akshar-airbound
akshar-airbound marked this pull request as draft July 28, 2026 10:31
@akshar-airbound akshar-airbound self-assigned this Jul 28, 2026
@akshar-airbound
akshar-airbound marked this pull request as ready for review July 28, 2026 11:29

@botmayank botmayank left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@akshar-airbound
akshar-airbound merged commit cfe9b0d into airbound-develop Jul 28, 2026
132 of 146 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants