Skip to content

Pr 4631 ported 4575 rc11 - #133

Open
vigneshm-debug wants to merge 40 commits into
airbound-develop-4.6.3from
pr-4631-ported-4575-rc11
Open

Pr 4631 ported 4575 rc11#133
vigneshm-debug wants to merge 40 commits into
airbound-develop-4.6.3from
pr-4631-ported-4575-rc11

Conversation

@vigneshm-debug

Copy link
Copy Markdown

Version : 4.6.3.1 rc-9 (This version of 4.6.3.1 includes fixes till 4.5.7.5 rc11)

akshar-airbound and others added 30 commits July 3, 2026 06:52
* Airbound 4.5.7.2 - hf1 stable release (#37)

* [AIRB-76] Plane: Handle tailsitter back transition abort with force transition complete (#2)

* Plane: Handle tailsitter back transition abort with force transition complete

* Add logs for stabilize controller output for rpy

* Update version to dev and add force backtrans abort in string

* github: update workflows to use actions/upload-artifact@v4

* Always weathervane for tailsitters in RTL pos1 (#4)

* Freeze climb rate pos controller (#12)

* Freeze climb rate during RTL phases

* Expose time to freeze crt before land descent as param

* Add current timestamp to logging

* Disable vh power if negative

* Add desphi logging

* Remove unused fixed wing attitude logs

* Fix unit in docstring for param

* Add weathervane checks in firmware basis pitch (#15)

* Add airbound lua scripts in firmware

* Update init log of airbound lua scripts

* Add gps, vfgain, wvane lua scripts

* Update init test lua script log

* Update version string to 4.5.7.1

* Add ahrs pitch to PHID logging to check

* Add setter for weathervane gain

* Change weathervaning gain basis pitch.

* Change variable names for wvane gain setting

* Remove wvane autochange lua script from firmware

* Fix tailsitter fw transition timeout issue by resampling initial pitch

* Change wvane gain upper pitch limit to 91

* Rename version to 4.5.7.1 - rc1

* Revert fw transition timeout discontinuity check

* Increase AHRS_PITCH_HI_WVANE_DEG to 95

* Initial pitch discontinuity bug fix, by checking the difference

* Expose wvane gain pitch consts as params

* Add check for pitch error to freeze crt during land descent

* Add break statement for pitch error crt freezing

* Change version to rc7

* Add a third segment for wvane gain/2 basis ahrs pitch wvane mid param

* Change versiont to rc8

* Scale weathervane gain linearly between mid and low ahrs pitch limits

* Change version to rc9

* Remove pitch based crt freezing

* Change version to rc10

* Update parachute lua script default channel and expose servo min max

* Update version to rc11

---------

Co-authored-by: Manuraj P M <[email protected]>

* Update version to 4.5.7.1

* Update last_pos2_ms time for non-rtl modes to freeze climb rate (#19)

* Update last_pos2_ms time for non-rtl modes to freeze climb rate

* Move set climb rate 0 for pos2 height control out of tailsitter check

* Ardupilot 4.5.7: Change Synthetic airspeed estimation algorithm from EK3 to DCM (#25)

* Add control surface checks lua script

* Update parachute lua script log

* Add door auto control script

* Update version.h

* Add wvane lo threshold to pix6c defaults param file

* Add all airbound params to defaults.parm with q_tailsit_wv ones as readonly

* Reduce default param list basis recent flights

* Update version.h

* Change EK3 airspeed estimate source from EK3 to DCM
Update version.h

---------

Co-authored-by: Mayank Joneja <[email protected]>

* Handle pitch beyond +/- 90 degrees by mapping to 180 degree (#32)

* Modify Pixhawk6C-bdshot default parameter list

- Update version.h to rc4
- Update default params in lua scripts

* Handle gimbal lock singularity specifically for pitch in ahrs view

* Update version to rc5

* Add simple ahrs pitch based check to correct att pitch beyond 90

* Add rot matrix based check for nose down belly up/down

* Swap pitch corrections in ahrs view

---------

Co-authored-by: akshar-airbound <[email protected]>

* Update version to 4.5.7.2

* Add attitude logging and fix doors script for extreme pitch (#33)

* Modify Pixhawk6C-bdshot default parameter list

- Update version.h to rc4
- Update default params in lua scripts

* Handle gimbal lock singularity specifically for pitch in ahrs view

* Update version to rc5

* Add simple ahrs pitch based check to correct att pitch beyond 90

* Add rot matrix based check for nose down belly up/down

* Swap pitch corrections in ahrs view

* Add logging for ahrs view compensation

* Fix logging of pitch before and after compensation

* Add logging for att target axis angle

* Add logging of att body and error quat as axis angle

* Add flags for belly up/down and nose down in logs

* Update version to rc6

* Change version to 4.5.7.3 rc1

* Change mode check for landing phase for doors script

* Check valid landing mission commands

* Add check for vtol land descent from quadplane

* Force doors open under takeoff alt_trig_m and don't check for transitions during takeoff

* Add a landing latch flag to only trigger doors basis modes

* Initialize servo pwm open close based on specific defaults

* Update version to 4.5.7.2 hf1

* Update version to v4.5.7.2 - hf1

* Fix vtol flight check logic basis latch

* Add global override param for doors auto logic

* Fix num params for door script

* Fix docstring for ATPC logging

---------

Co-authored-by: akshar-airbound <[email protected]>

---------

Co-authored-by: Manuraj P M <[email protected]>
Co-authored-by: akshar-airbound <[email protected]>

* Update airbound-stable to 4.5.7.4-hf3 (#97)

* Add 4.5.7.4 hf1 with PWM to RPM conversion factor as a parameter. (#79)

* Expose the PWM to RPM conversion factor as a parameter

* Update the version to V4.5.7.4 -hf1

* default.param:Update the parameter

---------

Co-authored-by: Manuraj P M <[email protected]>

* Update autobailout and autoparadeploy parameters to ensure effective bailout and paradeploy behaviour (#81)

* autobailout.lua: Changed default parameter values of AUTOB_PIT_TOUT, AUTOB_PARA_ANG, AUTOB_PARA_TOUT
AUTOB_PIT_TOUT = 500 -> 200
AUTOB_PARA_ANG = -45 -> -15
AUTOB_PARA_TOUT = 200 -> 100

* Changed version name: V4.5.7.4 -hf1 + autob parm chg

* autobailout.lua: modified valid AUTOB_PARA_ANG thresholds from (-50,-40) to (-50,-10)

* autobailout.lua: Fix gcs message

---------

Co-authored-by: akshar-airbound <[email protected]>

* Change version.h to 4.5.7.4 hf1

* Fix weathervane control slope based scale calculation error when control effort is between Q_TAILSIT_CE_LO and Q_TAILSIT_CE_HI (#82)

* Fix weathervane control slope based scale calculation error when control effort is between Q_TAILSIT_CE_LO and Q_TAILSIT_CE_HI

* Pixhawk6C-bdshot/scripts: Add vibration monitoring script and rename autobailout script filename

---------

Co-authored-by: akshar-airbound <[email protected]>

* Update version to 4.5.7.4 hf2

* Rename ab_autobailout.lua back to autobailout.lua for hf3 (#84)

* Update version.h to 4.5.7.4 hf3

---------

Co-authored-by: Manuraj-PM <[email protected]>
Co-authored-by: Manuraj P M <[email protected]>
Co-authored-by: akshar-airbound <[email protected]>
Co-authored-by: Mayank Joneja <[email protected]>

* Remove redundant control surface check script (#98)

Co-authored-by: akshar-airbound <[email protected]>

* Add thrust vectoring desaturation and halved PID gain parameters (#99)

* Fix weathervane control slope based scale calculation error when control effort is between Q_TAILSIT_CE_LO and Q_TAILSIT_CE_HI (#82)

* Fix weathervane control slope based scale calculation error when control effort is between Q_TAILSIT_CE_LO and Q_TAILSIT_CE_HI

* Pixhawk6C-bdshot/scripts: Add vibration monitoring script and rename autobailout script filename

---------

Co-authored-by: akshar-airbound <[email protected]>

* Rename ab_autobailout.lua back to autobailout.lua for hf3 (#84)

* Update the version to V4.5.7.4 -hf1

* /AP_MotorsTailsitter.cpp:Update the desaturation logic

* Update the version to Airbound ArduPlane V4.5.7.5 -rc1 - Controller desaturation

* Update version to V4.5.7.4 -hf4 - Controller desaturation

* Reset yaw I term when disabling yaw control

* Update the angle p gains of roll and yaw axes

* Update the version to Airbound ArduPlane V4.5.7.4 -hf4 - Controller desat+ Half gain

* Update the fixed wing parameters

---------

Co-authored-by: akshar-airbound <[email protected]>
Co-authored-by: Mayank Joneja <[email protected]>
Co-authored-by: Manuraj P M <[email protected]>

* Add function to check tailsitter backtransition in quadplane class
Add lua bindings exposing above function for lua scripting

* autobailout.lua:Removed debug gcs strings

* Changed version to 4.5.7.4-hf3 + new autobailout
changed default value of parameter AUTOB_BTRN_DLY to 2500

* autobailout.lua: remove unused variables

* quadplane.cpp: add time argument to vtol transition function

* autobailout.lua: increase loop rate from 10 to 20 Hz
defaults.parm: Change param name TECS_SPD_WEIGHT to TECS_SPDWEIGHT

* Changed version name

* autobailoout.lua:Renamed variable

* Remove hardcoded yaw controller disabling when thrust angle exceeds 60deg

* 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

* fixed a bug

* Reduce weathervane gain during pos1 pos2 repositioning

* Change version name to Airbound V4.5.7.5 - stabfixB

* Change parameter value TECS_SYNAIRSPEED 0 -> 1

* Revert yaw rate controller disabling based on thrust error angle threshold

* Changed Q_LAND_ALTCHG: 1.5 and Q_LND_DET_TIM: 200

---------

Co-authored-by: Mayank Joneja <[email protected]>
Co-authored-by: Manuraj P M <[email protected]>
Co-authored-by: Manuraj-PM <[email protected]>
Co-authored-by: akshar-airbound <[email protected]>
Co-authored-by: Stefard100 <[email protected]>
Co-authored-by: vigneshm <[email protected]>
* Add configuration options for the embedded parameter struct

* Modify the GPS auto switching script for more robust checks
- Use the vertical accuracy along with the satellite count for switching between GPS instances
- Use separate minimum and maximum thresholds for switching as a form of hysteresis
- Check for VTOL/landing mission commands in Auto mode
- Set the run interval to 1 second

* Add check to make sure both GPS instances exist
- Check for the existance of both GPS instances before running the GPS instance switching logic

* Remove unnecesary guard from the numsats assignment
Replace mentions of hacc in the comments

* Fix auto disarm parameters and disable autodisarm monitor after motor disarm

* Add code to restore desired pitch to 0 when actual pitch exceeds Q_A_RELX_HI

* In Copter Attitude controller
Change yaw control disable thrust angle error limit from 60 to 90
Change linear scale yaw control thrust angle error limit from (45, 60) to (60, 90)

* Change version to 4.5.7.5 - rc2-fixes

---------

Co-authored-by: Atharva Sawant <[email protected]>
Co-authored-by: akshar-airbound <[email protected]>
- 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
…ut, ATI logging and default parameters are set
… prompt, recv guard, CPIN scoping, buf.dp clear, TX_RATE)
@vigneshm-debug vigneshm-debug self-assigned this Jul 24, 2026
@vigneshm-debug
vigneshm-debug requested a review from botmayank July 24, 2026 07:12
@greptile-apps

greptile-apps Bot commented Jul 24, 2026

Copy link
Copy Markdown

Greptile Summary

This PR ports fixes from 4.5.7.5 rc11 into the 4.6.3.1 branch, covering four major areas: landing detection refactoring (parameterised timeout / disarm watchdog), attitude-control relaxation rework (hysteresis thresholds, LPF factor, per-axis pitch clip), expanded Lua scripting bindings for attitude telemetry, and updated Lua scripts (autobailout overhaul, GPS failover hysteresis).

  • Landing detection (quadplane.cpp): land_detector signature changed to use the new LND_DET_TIM parameter (default 200 ms); a disarm-watchdog alert is added to check_land_complete.
  • Attitude relaxation (AC_AttitudeControl.cpp): old roll+pitch relaxation replaced with a single-axis pitch-only LPF scheme with high/low hysteresis thresholds and a new PIT_CLIP_MAX hard limit.
  • Autobailout (autobailout.lua): complete rewrite to detect pitch exceedance on the VTOL-frame axis using sliding-window statistics and predicted angle, with configurable auto-resume.
  • GPS failover (ab_gps_mode.lua): adds VACC hysteresis and Auto-mode VTOL-phase awareness.

Confidence Score: 2/5

Not ready to merge — outstanding issues from prior reviews remain unresolved in the landing-detection timeout path and the AC_AttitudeControl static-local state, both of which directly affect flight safety.

The landing state-machine has two confirmed defects: the 200 ms LND_DET_TIM default (far below the 4–6 s hard-coded values it replaces) can trigger premature land-complete, and the !motors->armed() early return blocks QPOS_LAND_COMPLETE after a manual disarm in LAND_FINAL. The attitude-relaxation rewrite introduces static locals for relaxation_factor_lpf and _att_relax_active that survive disarm/re-arm cycles, causing unexpected pitch suppression at the start of the next flight. These were flagged in prior reviews and have not been addressed by the current commit.

Files Needing Attention: ArduPlane/quadplane.cpp (landing detection timeout and disarm watchdog logic) and libraries/AC_AttitudeControl/AC_AttitudeControl.cpp (static local state persistence across arm cycles)

Important Files Changed

Filename Overview
ArduPlane/quadplane.cpp Adds LND_DET_TIM / DARM_WDG_T parameters, refactors land_detector() to be parameterised, adds disarm watchdog in check_land_complete; previously-flagged issues (timeout regression, post-disarm state-machine block) are present.
libraries/AC_AttitudeControl/AC_AttitudeControl.cpp Attitude-relaxation logic fully replaced with hysteresis + LPF scheme; static locals persist across arm/disarm cycles (previously flagged). Thrust-error branches now consistently use the local ang_vel_body, resolving a previous reviewer concern.
ArduPlane/tailsitter.cpp Expands PHID log message with extra_elevator and position_pitch_sp fields; HAL_LOGGING_ENABLED guard correctly restored (previous issue addressed). Removes set_tailsitter_back_transition_done call consistent with attitude-control rework.
libraries/AP_Scripting/lua_bindings.cpp Adds four new Lua C bindings (qp_att_desired, qp_att_actual, qp_angle_rate, qp_rate_pid_info) guarded by ArduPlane + QUADPLANE macros. Slight API inconsistency in lua_get_actual_euler_cd (uses lua_settable instead of lua_setfield), but functionally correct.
libraries/AP_HAL_ChibiOS/hwdef/Pixhawk6C-bdshot/scripts/autobailout.lua Complete rewrite: sliding-window pitch statistics, VTOL-frame pitch detection using new Lua attitude bindings, configurable auto-resume with attempt limit. is_vtol_flight assigned without local (previously flagged).
libraries/AP_HAL_ChibiOS/hwdef/Pixhawk6C-bdshot/defaults.parm PTCH_LIM_MIN_DEG and TECS_PITCH_MIN changed from -20° to -5°, significantly restricting FW nose-down authority; RELX_* parameter names updated to match renamed AP_Param entries.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[QPOS_LAND_DESCEND] -->|check_land_final: alt < land_final_alt\nor land_detector fires| B[QPOS_LAND_FINAL]
    B --> C{check_land_complete}
    C -->|!motors armed| D[return false — state stuck]
    C -->|lower_limit_start_ms != 0\n& wdg_start_ms == 0| E[Start DARM_WDG_T watchdog]
    E --> F{elapsed >= wdg_t?}
    F -->|Yes| G[GCS EMERGENCY msg\nreset wdg timer\nNO auto-disarm]
    F -->|No| H{land_detector\nLND_DET_TIM 200ms}
    C --> H
    H -->|height change > detect_alt_change\nor timeout not elapsed| I[return false]
    H -->|Landed| J[QPOS_LAND_COMPLETE\ndisarm]

    style D fill:#ff9999
    style G fill:#ffcc99
    style J fill:#99ff99
Loading

Reviews (7): Last reviewed commit: "Version changed to 4.6.3.1-rc9-lte_fixes" | Re-trigger Greptile

Comment thread ArduPlane/tailsitter.cpp Outdated
Comment thread ArduPlane/quadplane.cpp
@vigneshm-debug

Copy link
Copy Markdown
Author

@greptile

Comment thread ArduPlane/quadplane.cpp
Comment thread libraries/AC_AttitudeControl/AC_AttitudeControl.cpp Outdated
@vigneshm-debug

Copy link
Copy Markdown
Author

@greptile

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.

3 participants