Skip to content

fix(vtol_att_control/standard): Align MC weight schedule in airspeed-less transition with airspeed - #29995

Open
mbjd wants to merge 10 commits into
mainfrom
pr-fix-standard-vtol-transition-blending
Open

mbjd wants to merge 10 commits into
mainfrom
pr-fix-standard-vtol-transition-blending

Conversation

@mbjd

@mbjd mbjd commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Problem

The standard VTOL transitions to FW behave quite differently depending on whether airspeed is used or not:

  • With airspeed: Full MC weight up to VT_ARSP_BLEND (8 m/s), then blend linearly until VT_ARSP_TRANS (10 m/s)
    • So we accelerate significantly with full MC rate control, and only blend once FW control becomes effective, which can be directly tuned with FW_AIRSPD_BLEND
  • Without airspeed: Blending starts immediately and is complete at VT_TRANS_MIN_TM (2 sec)
    • So we are at complete FW rate control quite early, and have to either accelerate very hard (especially unsafe with no airspeed) or set a higher min time
    • This has unwanted side effects: When we do have airspeed we force a long transition even if airspeed is high enough very early (starting in headwind / at speed)

Solution

  • Base commit: retune the gz_standard_vtol front transition to match realistic airframes, so that it actually completes in VT_F_TR_OL_TM.
    • Could split out if preferred
  • Fix commit: Derive a blending schedule that mimics the airspeed-enabled one
    • Estimate airspeed by assuming constant acceleration from 0 to VT_ARSP_TRANS over VT_F_TR_OL_TM
    • Evaluate the airspeed-feedback blending schedule at this airspeed

This is not 100% the same as the actual airspeed schedule (initial throttle ramp up is ignored, and typically acceleration is high initially and then decreases due to drag) but much more useful than the current one.

Changelog

fix(vtol): Standard VTOL airframes without airspeed measurement keep MC rate control active for a longer time in transition to FW, improving rate tracking.
 - Before: MC control decreases linearly from transition start to VT_TRANS_MIN_TM
 - Now: MC control initially kept at 100%, then blended down linearly between VT_ARSP_BLEND and VT_ARSP_TRANS, with a proxy airspeed based on assuming constant acceleration from 0 to VT_ARSP_TRANS during VT_F_TR_OL_TM

Open to suggestions for a better release note...

Context

  • Would be a nice followup to also test this stuff some more. Various VTOL transitions are routinely broken by random parameter changes, and I'm not sure if airspeed-less transitions have ever been systematically tested. Also unit tests on vtol_att_control are sparse.
  • The "obvious" refactor stacked on top, removing some more inconsistencies and reducing duplication and almost-duplication: fix(vtol_att_control): unify front transition MC weight blending #30023. Changes some additional behaviour, so I am opening this minimal fix first.

Testing

Various sim transitions

Before

On main with default tuning: Transition with airspeed completes in about 1.5 seconds, reaching 1.5g of forward acceleration. Blending (8 to 10 m/s) of the MC weight basically does not happen, MC control stays fully effective.

image

Transition without airspeed takes the full 6 seconds (VT_F_TR_OL_TM) at 100% throttle, unsurprisingly overspeeds. Also, MC control is ramped out before FW control is effective, leading to rate tracking error:

image

After first commit (re-tuning transition)

With airspeed: works nicely both in terms of airspeed after transition and rate tracking during transition

image

Without airspeed: Works in terms of airspeed but rate tracking is bad because MC weight fades away too early

image

After second commit (blending change)

With airspeed: exactly the same as expected, code is refactored only cosmetically

image

Without airspeed: weight fades away later, more smoothly (time instead of airspeed which has a low sample rate), and the rate tracking error during transition is gone:

image

@github-actions github-actions Bot added kind:bug Something is broken or behaving incorrectly. vehicle:vtol VTOL-specific behavior. scope:control Rate, attitude, position, allocation, or actuator control. labels Nov 24, 2026
@github-actions

github-actions Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

🔎 Flash and RAM Analysis

Target Flash Δ Flash Total Static RAM Δ Static RAM Total
px4_fmu-v2 (F4) +8 B (+0.00%) 97.73% +0 B (+0.00%) 10.29%
px4_fmu-v5x (F7) -48 B (-0.00%) 96.12% +0 B (+0.00%) 21.95%
px4_fmu-v6x (H7) -32 B (-0.00%) 97.61% +0 B (+0.00%) 10.63%
px4_io-v2 (F1) +0 B (+0.00%) 70.78% +0 B (+0.00%) 54.39%

px4_io-v2 firmware image, which an FMU flashes to its IO at boot: unchanged.

px4_fmu-v2 — Bloaty section/symbol breakdown
     VM SIZE    
 -------------- 
  +0.0%      +8    .text
  +0.0%      +8    TOTAL

px4_fmu-v5x — Bloaty section/symbol breakdown
     VM SIZE    
 -------------- 
  -0.0%     -48    .text
    +0.0%     +80    g_cromfs_image
    +125%     +20    VtolType::getOpenLoopFrontTransitionTime()
    -4.8%      -4    Standard::Standard()
    -4.5%      -4    write_user_stack.constprop.0
   -15.1%    -140    Standard::update_transition_state()
  -0.0%     -48    TOTAL

px4_fmu-v6x — Bloaty section/symbol breakdown
     VM SIZE    
 -------------- 
  -0.0%     -32    .text
    +0.1%     +92    g_cromfs_image
    +125%     +20    VtolType::getOpenLoopFrontTransitionTime()
    +4.8%      +4    FlightTask
    +0.9%      +2    exec_builtin
    -2.9%      -2    up_saveusercontext
    -4.8%      -4    Standard::Standard()
    -4.5%      -4    write_user_stack.constprop.0
   -15.1%    -140    Standard::update_transition_state()
  -0.0%     -32    TOTAL

px4_io-v2 — Bloaty section/symbol breakdown
     VM SIZE    
 -------------- 
  [ = ]       0    TOTAL

Updated: 2026-11-25T17:55:18

@mbjd
mbjd requested a balanced review from Copilot and removed request for Copilot November 24, 2026 11:11
@github-actions

Copy link
Copy Markdown
Contributor

No broken links found in changed files.

mbjd added 2 commits November 25, 2026 10:01
Previously it would give full throttle, comleting the transition in
about 4s. This tuning accelerates more gently and realistically, and
also matches VT_F_TRANS_OL_TM of 6 (default) seconds exactly.
…tion like with airspeed

Without airspeed, the multicopter weight reached zero at half of
VT_TRANS_MIN_TM, while the transition only ends at VT_F_TR_OL_TM. In
between, the vehicle flew at transition throttle with the lift motors off
and without speed feedback, which stalls when VT_TRANS_MIN_TM is tuned
short for the case with airspeed.

Without airspeed feedback, use the airspeed expected at constant
acceleration that reaches VT_ARSP_TRANS at VT_F_TR_OL_TM, and blend with
it exactly as with a measured airspeed.

Assisted-by: Claude:claude-opus-5-5
@mbjd
mbjd force-pushed the pr-fix-standard-vtol-transition-blending branch from 2f28287 to c4e7635 Compare November 25, 2026 09:15
@mbjd mbjd changed the title fix(vtol_att_control/standard): Ramp down MC weight only after min time fix(vtol_att_control/standard): Align MC weight schedule in airspeed-less with airspeed Nov 25, 2026
@mbjd
mbjd added this pull request to stack #30024 November 25, 2026 10:24
@mbjd
mbjd marked this pull request as ready for review November 25, 2026 10:33
@mbjd mbjd changed the title fix(vtol_att_control/standard): Align MC weight schedule in airspeed-less with airspeed fix(vtol_att_control/standard): Align MC weight schedule in airspeed-less transition with airspeed Nov 25, 2026

This specifies the duration of the front transition in seconds when no airspeed feedback is available (e.g. no airspeed sensor present).
It should be set to a value which ensures that the vehicle reaches a high enough airspeed to complete the transition, e.g. airspeed should exceed [VT_ARSP_TRANS](../advanced_config/parameter_reference.md#VT_ARSP_TRANS).
Without airspeed feedback, multirotor control is blended out linearly over the part of this time in which the airspeed would be between [VT_ARSP_BLEND](../advanced_config/parameter_reference.md#VT_ARSP_BLEND) and [VT_ARSP_TRANS](../advanced_config/parameter_reference.md#VT_ARSP_TRANS) at constant acceleration.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
Without airspeed feedback, multirotor control is blended out linearly over the part of this time in which the airspeed would be between [VT_ARSP_BLEND](../advanced_config/parameter_reference.md#VT_ARSP_BLEND) and [VT_ARSP_TRANS](../advanced_config/parameter_reference.md#VT_ARSP_TRANS) at constant acceleration.
Without airspeed feedback, the airspeed is assumed to increase linearly from 0 to VT_ARSP_TRANS over VT_F_TR_OL_TM. The multicopter control blending then follows from this predicted airspeed, e.g. linear blending while it is between VT_ARSP_BLEND and VT_ARSP_TRANS.

short: Airspeed-less front transition time (open loop)
long: |-
The duration of the front transition when there is no airspeed feedback available.
Multicopter control is blended out over the part of this time in which the airspeed would be between VT_ARSP_BLEND and VT_ARSP_TRANS at constant acceleration.

@RomanBapst RomanBapst Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
Multicopter control is blended out over the part of this time in which the airspeed would be between VT_ARSP_BLEND and VT_ARSP_TRANS at constant acceleration.
Without airspeed feedback, the airspeed is assumed to increase at a constant rate over this time. Multicopter control is blended out while this assumed airspeed is between VT_ARSP_BLEND and VT_ARSP_TRANS.

RomanBapst
RomanBapst previously approved these changes Nov 25, 2026
mbjd added 2 commits November 25, 2026 16:19
Easy way to pervent very bad misconfiguration. min and max are
hardcoded, AFAIK we cannot get them automatically, so will have to keep
in sync.
There were a lot of lines to do essentially what math::interpolate would
do in one step.
…etpoint in one line

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Balduin <balduin@auterion.com>
@ThomasRigi

Copy link
Copy Markdown
Member

I think this is an elegant improvement! 👍

I find the split with #30023 a bit weird. I would have united the tiltrotor airspeedless blending already in this PR. Either the new acceleration-based version is better, or the existing time_trans_open_loop_margin is better. But in both cases I'd prefer to have something unified directly. Unless there's something I'm missing that would make one better for one type and the other for the other type. (I have to admit that I'm not familiar with how tiltrotor transitions work.)

Another point : There's a quadchute that's based around not reaching VT_ARSP_BLEND within VT_F_TR_OL_TM. Wouldn't it be better to use VT_TRANS_MIN_TM instead ? Can definitely be handled in another PR (#30023 ?), just wanted to mention it here because there might be a new tuning of VT_F_TR_OL_TM based off this PR that all of a sudden affects a quadchute behaviour.

Similarly, in the docs for VT_TRANS_MIN_TM it's recommended to add 30% to the normal transition duration. I find that a weird recommendation. Again a side note, not really for this PR but an extension to my previous point.

VT_F_TR_OL_TM should be the time that you expect a normal transition to take (with margins to be safe for airspeedless), so having +30% of the normal transition duration for VT_TRANS_MIN_TM kind of collides with that. So let's add the margin to VT_F_TR_OL_TM and treat VT_TRANS_MIN_TM as a sanity-check (but not sufficient on its own). In this light it would make more sense to use this for the quadchute-check in combination with VT_ARSP_BLEND. And too high values of VT_TRANS_MIN_TM force transitions to overspeed when starting in high headwind.


I also have some other ideas for estimating the airspeed based on the momentary lift (around #29776), but that's definitely for the longer-term and only for airframes that have been correctly configured, so it's definitely good to have a decent baseline for all airframes first. Just throwing the idea out for now, hope I will find the time to actually test it on a drone at some point, but won't be any time soon I fear.

@JonasPerolini JonasPerolini left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks @mbjd, added minor comments (including a Claude one that I did not check), none blocking.

Comment on lines 657 to -699
float VtolType::getMinimumFrontTransitionTime() const
{
return getFrontTransitionTimeFactor() * _param_vt_trans_min_tm.get();
return getFrontTransitionTimeFactor() * math::constrain(_param_vt_trans_min_tm.get(), 0.f, 20.f);
}

float VtolType::getFrontTransitionTimeout() const
{
return getFrontTransitionTimeFactor() * _param_vt_trans_timeout.get();
return getFrontTransitionTimeFactor() * math::constrain(_param_vt_trans_timeout.get(), 0.1f, 30.f);
}

float VtolType::getOpenLoopFrontTransitionTime() const
{
return getFrontTransitionTimeFactor() * _param_vt_f_tr_ol_tm.get();
return getFrontTransitionTimeFactor() * math::constrain(_param_vt_f_tr_ol_tm.get(), 1.f, 30.f);
}
float VtolType::getTransitionAirspeed() const
{
// Since the stall airspeed increases with vehicle weight, we increase the transition airspeed
// by the same factor.
return sqrtf(getWeightRatio()) * _param_vt_arsp_trans.get();
return sqrtf(getWeightRatio()) * math::constrain(_param_vt_arsp_trans.get(), 0.f, 30.f);
}

float VtolType::getFrontTransitionThrottle() const
{
// Thrust needs to scale with weight_ratio to keep the acceleration weight-independent. Assuming
// a quadratic throttle -> thrust map, this requires scaling the throttle by sqrt(weight_ratio).
return math::min(sqrtf(getWeightRatio()) * _param_vt_f_trans_thr.get(), 1.0f);
return math::min(sqrtf(getWeightRatio()) * math::constrain(_param_vt_f_trans_thr.get(), 0.f, 1.f), 1.0f);
}

float VtolType::getWeightRatio() const
{
float weight_ratio = 1.0f;

if (_param_weight_base.get() > FLT_EPSILON && _param_weight_gross.get() > FLT_EPSILON) {
weight_ratio = math::constrain(_param_weight_gross.get() /
_param_weight_base.get(), kMinWeightRatio, kMaxWeightRatio);
}

return weight_ratio;
}

float VtolType::getBlendAirspeed() const
{
return _param_vt_arsp_blend.get();

@JonasPerolini JonasPerolini Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Are those hard constraints necessary? e.g.math::constrain(_param_vt_arsp_blend.get(), 0.f, 30.f);

From my understanding having min, max values in the param.yaml was enough because you need a couple of extra clicks to overwrite those min, max at which point you know (I hope) what you're doing.

E.g. 5020_xplane_alia250 (#22493) sets VT_ARSP_TRANS 40, VT_F_TR_OL_TM 55 and VT_TRANS_TIMEOUT 100, which all become 30 now.

@mbjd mbjd Nov 25, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fight it out with @RomanBapst :) #29995 (comment)

But yeah, generally it's probably fine to not constrain if behaviour continues sensibly (e.g. does not result in 1/0 or infinite loops) and also the already common idiomatic pattern. Advanced users can do whatever they want in the mavlink console while simple settings from the GS are protected by limits there.

@mbjd

mbjd commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor Author

@ThomasRigi thanks for your detailed feedback!

I find the split with #30023 a bit weird.

Fair. My reasons for it are:

  • We don't have a tiltrotor to test on currently and I have zero experience with them generally
  • This is a small isolated change and the other is a somewhat substantial refactor in a module without tests

But we can also do it in one. Let's see, if this one grows it becomes easier to do it all in one step anyway.

There's a quadchute that's based around not reaching VT_ARSP_BLEND within VT_F_TR_OL_TM. Wouldn't it be better to use VT_TRANS_MIN_TM instead

I would not say so. Currently theyse two are separate concepts:

  • MIN_TM = earliest time we are allowed to conclude transition to FW
  • OL_TM = time we expect the transition to take without airspeed meassurements

If we couple them in this way we disallow the IMO valid use case of:

  • Very low MIN_TM - if starting in headwind or at speed the transition could be very short (if measuring airspeed)
  • Pretty high ARSP_BLEND - keeping MC motors on for longer is pretty safe (might burn too much energy) compared to turning off earlier (might lose rate tracking)

and in fact the defaults (ARSP_BLEND=8, ARSP_TRANS=10, MIN_TM=2, OL_TM=6) would then quadchute if accelerating linearly (because 3.33 m/s < 8 m/s).

in the docs for VT_TRANS_MIN_TM it's recommended to add 30%

This is indeed pretty weird, I think it should be "subtract +/- 30%" (with +/- meaning approximately not positive or negative)? But we could probably trim it down do just "the shortest possible time a transition to FW can take". Maybe we could even entirely remove the min time (if we measure airspeed and are at airspeeds suitable for FW, does it hurt to skip the transition or have it be only one cycle?)

VT_F_TR_OL_TM should be the time that you expect a normal transition to take (with margins to be safe for airspeedless),

The question is in what direction does the margin go? If your trim is close to min, or your plane naturally pulls up when overspeeding, you might prefer overspeeding, while if your trim is far above min it might be just fine to underspeed a bit after the transition. Maybe we should replace the docs explicitly by these considerations.

And too high values of VT_TRANS_MIN_TM force transitions to overspeed when starting in high headwind.

If you don't measure airspeed there is generally nothing protecting you against too strong headwinds or tailwinds and probably the safest is to transition in altitude mode after drifting with 0 relative wind.

In general I'd propose:

  • min time: only gates the earliest possible exit time, remove blending gate
  • OL time: the expected duration of a transition to FW. Whether users want to err on the high or low side depends on their use case.

mbjd added 5 commits November 25, 2026 17:52
…transition time

This more cleanly separates parameters:
 - MIN_TM = earliest possible time we can switch to FW
 - ARSP_BLEND = airspeed at which we start blending

without weird exceptions. This also removes a discontinuous step of the
MC weight if we surpass the blend airspeed before the min time.

This behaviour was not documented anywhere, so docs don't change.
 - Remove incorrect 'Set 0 to disable'
 - Instead give the correct version and clarify what disabling means
 - Explain new airspeedless schedule here and nowhere else
describe airspeedless blending schedule only in airspeedless specific
docs page
If 0 we could divide by 0. Other params are only used for comparisons
etc, so we don't need to constrain to the param limit.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind:bug Something is broken or behaving incorrectly. scope:control Rate, attitude, position, allocation, or actuator control. vehicle:vtol VTOL-specific behavior.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants