Repository navigation
fix(vtol_att_control/standard): Align MC weight schedule in airspeed-less transition with airspeed - #29995
fix(vtol_att_control/standard): Align MC weight schedule in airspeed-less transition with airspeed#29995mbjd wants to merge 10 commits into
Conversation
🔎 Flash and RAM Analysis
px4_io-v2 firmware image, which an FMU flashes to its IO at boot: unchanged. px4_fmu-v2 — Bloaty section/symbol breakdownpx4_fmu-v5x — Bloaty section/symbol breakdownpx4_fmu-v6x — Bloaty section/symbol breakdownpx4_io-v2 — Bloaty section/symbol breakdownUpdated: 2026-11-25T17:55:18 |
|
No broken links found in changed files. |
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
2f28287 to
c4e7635
Compare
|
|
||
| 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. |
There was a problem hiding this comment.
| 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. |
There was a problem hiding this comment.
| 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. |
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>
|
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 Another point : There's a quadchute that's based around not reaching Similarly, in the docs for
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
left a comment
There was a problem hiding this comment.
Thanks @mbjd, added minor comments (including a Claude one that I did not check), none blocking.
| 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(); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
|
@ThomasRigi thanks for your detailed feedback!
Fair. My reasons for it are:
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.
I would not say so. Currently theyse two are separate concepts:
If we couple them in this way we disallow the IMO valid use case of:
and in fact the defaults (
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?)
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.
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:
|
…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
This reverts commit 6893410.
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.
Problem
The standard VTOL transitions to FW behave quite differently depending on whether airspeed is used or not:
VT_ARSP_BLEND(8 m/s), then blend linearly untilVT_ARSP_TRANS(10 m/s)FW_AIRSPD_BLENDVT_TRANS_MIN_TM(2 sec)Solution
gz_standard_vtolfront transition to match realistic airframes, so that it actually completes inVT_F_TR_OL_TM.VT_ARSP_TRANSoverVT_F_TR_OL_TMThis 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
Open to suggestions for a better release note...
Context
vtol_att_controlare sparse.Testing
Various sim transitions
gz_standard_vtolFW_USE_AIRSPD=0to disable airspeed if indicatedBefore
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.
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:After first commit (re-tuning transition)
With airspeed: works nicely both in terms of airspeed after transition and rate tracking during transition
Without airspeed: Works in terms of airspeed but rate tracking is bad because MC weight fades away too early
After second commit (blending change)
With airspeed: exactly the same as expected, code is refactored only cosmetically
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: