Skip to content

Conversation

@haumarco
Copy link
Contributor

@haumarco haumarco commented Oct 3, 2025

Solved Problem

The backtransition deceleration controller had two issues:

  • Commanded deceleration in the heading direction instead of opposite to velocity direction, causing irrelevant pitch commands when turning during backtransition
  • Used unfiltered acceleration measurements, could cause noisy pitch commands

The roll attitude setpoint was binary (100% FW) while the torque blending gradually transitioned from FW to MC based on mc_weight.

Solution

  • Correct Deceleration Direction: Changed acceleration direction from heading-based to velocity-based
  • Smooth Roll Blending: Roll attitude setpoint now blends based on mc_weight during backtransition
  • Acceleration Filtering: Added 50ms alpha filter to reduce noise in pitch commands
  • Position-based deceleration only active when position EPH < 10m

Changelog Entry

For release notes:
Bugfix: VTOL backtransition deceleration now uses velocity direction instead of heading
Feature: VTOL backtransition roll attitude blending

  • Deceleration now correctly pitches against velocity vector (handles drift/crosswind)
  • Roll attitude setpoint smoothly blends between FW and MC controllers
  • Added acceleration filtering for improved pitch stability
  • Position-based deceleration requires GPS accuracy < 10m

Test coverage

  • So far only SITL, will remove draft after flighttests

@haumarco haumarco requested review from bresch and mbjd October 3, 2025 14:07
@github-actions
Copy link

github-actions bot commented Oct 3, 2025

🔎 FLASH Analysis

px4_fmu-v5x [Total VM Diff: 256 byte (0.01 %)]
    FILE SIZE        VM SIZE    
--------------  -------------- 
+0.0%    +256  +0.0%    +256    .text
  [NEW]    +456  [NEW]    +456    FlightTaskTransition::computeBackTransitionTiltSetpoint()
   +29%     +68   +29%     +68    FlightTaskTransition::update()
  +7.7%     +64  +7.7%     +64    Standard::update_transition_state()
   +44%     +28   +44%     +28    FlightTaskTransition::activate()
  +7.4%     +16  +7.4%     +16    FlightTaskTransition::FlightTaskTransition()
  +1.1%     +12  +1.1%     +12    matrix::Matrix<>::operator=()
  +3.0%      +8  +3.0%      +8    FlightTask::_evaluateVehicleLocalPosition()
  +0.0%      +8  +0.0%      +8    [section .text]
  [DEL]    -404  [DEL]    -404    FlightTaskTransition::computeBackTranstionPitchSetpoint()
+0.0%    +106  [ = ]       0    .debug_abbrev
+0.0%     +32  [ = ]       0    .debug_aranges
+0.0%    +120  [ = ]       0    .debug_frame
+0.0% +4.75Ki  [ = ]       0    .debug_info
+0.0% +1.19Ki  [ = ]       0    .debug_line
  +300%      +3  [ = ]       0    [Unmapped]
  +0.0% +1.19Ki  [ = ]       0    [section .debug_line]
+0.1% +2.51Ki  [ = ]       0    .debug_loclists
+0.1%    +397  [ = ]       0    .debug_rnglists
+0.0%    +177  [ = ]       0    .debug_str
+0.0%     +48  [ = ]       0    .symtab
  [NEW]     +48  [ = ]       0    FlightTaskTransition::computeBackTransitionTiltSetpoint()
  [DEL]     -48  [ = ]       0    FlightTaskTransition::computeBackTranstionPitchSetpoint()
   +33%     +16  [ = ]       0    Standard::update_transition_state()
   +67%     +32  [ = ]       0    ___Z12get_orb_meta6ORB_ID_veneer
 -40.0%     -32  [ = ]       0    __stm32_configwaitints_veneer
  +1.9%     +32  [ = ]       0    matrix::Matrix<>::operator=()
-2.9%    -256  [ = ]       0    [Unmapped]
+0.0% +9.31Ki  +0.0%    +256    TOTAL

px4_fmu-v6x [Total VM Diff: 256 byte (0.01 %)]
    FILE SIZE        VM SIZE    
--------------  -------------- 
+0.0%    +256  +0.0%    +256    .text
  [NEW]    +456  [NEW]    +456    FlightTaskTransition::computeBackTransitionTiltSetpoint()
   +29%     +68   +29%     +68    FlightTaskTransition::update()
  +7.7%     +64  +7.7%     +64    Standard::update_transition_state()
   +44%     +28   +44%     +28    FlightTaskTransition::activate()
  +7.4%     +16  +7.4%     +16    FlightTaskTransition::FlightTaskTransition()
  +1.1%     +12  +1.1%     +12    matrix::Matrix<>::operator=()
  +3.0%      +8  +3.0%      +8    FlightTask::_evaluateVehicleLocalPosition()
  +0.0%      +8  +0.0%      +8    [section .text]
  [DEL]    -404  [DEL]    -404    FlightTaskTransition::computeBackTranstionPitchSetpoint()
+0.0%    +106  [ = ]       0    .debug_abbrev
+0.0%     +32  [ = ]       0    .debug_aranges
+0.0%    +120  [ = ]       0    .debug_frame
+0.0% +4.75Ki  [ = ]       0    .debug_info
+0.0% +1.19Ki  [ = ]       0    .debug_line
  +300%      +3  [ = ]       0    [Unmapped]
  +0.0% +1.19Ki  [ = ]       0    [section .debug_line]
+0.1% +2.51Ki  [ = ]       0    .debug_loclists
+0.1%    +395  [ = ]       0    .debug_rnglists
  [DEL]      -2  [ = ]       0    [Unmapped]
  +0.1%    +397  [ = ]       0    [section .debug_rnglists]
+0.0%    +171  [ = ]       0    .debug_str
+0.0%     +48  [ = ]       0    .symtab
  [NEW]     +48  [ = ]       0    FlightTaskTransition::computeBackTransitionTiltSetpoint()
  [DEL]     -48  [ = ]       0    FlightTaskTransition::computeBackTranstionPitchSetpoint()
   +33%     +16  [ = ]       0    Standard::update_transition_state()
  +1.9%     +32  [ = ]       0    matrix::Matrix<>::operator=()
-4.9%    -256  [ = ]       0    [Unmapped]
+0.0% +9.30Ki  +0.0%    +256    TOTAL

Updated: 2025-10-03T14:13:08

@mbjd mbjd requested a review from Copilot October 3, 2025 14:25
Copilot

This comment was marked as off-topic.

@mbjd
Copy link
Contributor

mbjd commented Oct 6, 2025

I like it generally.

  • I fully support the change from pitch to tilt setpoint, I see it as a clear improvement in the edge case of (very) bad yaw tracking in backtransitions.
  • The roll setpoint which is now continuously blended from FW to MC looks to me like an improvement from a gut feeling perspective, but it's hard to predict if that's actually going to translate to better real world behaviour. Am excited for the test results, especially with crosswind :)
  • I presume you have cases where without the additional alpha filter the pitch / elevator setpoints would be unacceptably noisy -- If not strictly necessary, I would vote against the alpha filter to keep complexity from increasing.

@sfuhrer sfuhrer requested review from sfuhrer and removed request for bresch October 15, 2025 11:01
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.

2 participants