Skip to content

feat(actuators): Control Flaps from AUX channel#26913

Merged
ttechnick merged 4 commits intomainfrom
pr-flaps-aux-channel
Apr 2, 2026
Merged

feat(actuators): Control Flaps from AUX channel#26913
ttechnick merged 4 commits intomainfrom
pr-flaps-aux-channel

Conversation

@ttechnick
Copy link
Copy Markdown
Member

Solved Problem

So far, the flaps are controlled via the Flaps channel on the RC, while the spoilers are controlled from that same Flaps channel, or AUX1.

Solution

  1. Make it possible to control the spoilers from all AUX channels, not just the first one .
  2. Add a param FW_FLAPS_MAN, which is used to define the manual source of the flaps channel, much like the spoilers.

The intent behind this is to unify the two mechanisms, and at some point also remove the RC_MAP_FLAPS parameter.

Changelog Entry

For release notes:

Feature: Control Flaps via AUX channels
New parameter: FW_FLAPS_MAN
Documentation: Added a section about manual Flaps/Spoiler source. 

Test coverage

Tested on Hardware.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 31, 2026

/en/config/actuators.md

  • CurrentFileMissingAnchor: [Generic Actuator Control with RC](#generic-actuator-control-with-rc): anchor doesn't match any heading id or element id

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 31, 2026

🔎 FLASH Analysis

px4_fmu-v5x [Total VM Diff: 264 byte (0.01 %)]
    FILE SIZE        VM SIZE    
--------------  -------------- 
+0.0%    +248  +0.0%    +248    .text
  +3.6%     +80  +3.6%     +80    FixedwingRateControl::Run()
  +0.0%     +32  +0.0%     +32    [section .text]
  +0.0%     +32  +0.0%     +32    g_cromfs_image
  +1.2%     +20  +1.2%     +20    FixedwingRateControl::FixedwingRateControl()
  +2.5%     +12  +2.5%     +12    FixedwingRateControl::updateParamsImpl()
 -97.6%      +8 -97.6%      +8    [2 Others]
  +0.0%      +8  +0.0%      +8    px4::parameters
   +33%      +4   +33%      +4    ConstLayer::contains()
   +17%      +4   +17%      +4    ConstLayer::get()
  +2.6%      +4  +2.6%      +4    param_find_internal()
   +25%      +4   +25%      +4    param_for_index
  +4.8%      +4  +4.8%      +4    param_for_used_index
  +3.7%      +4  +3.7%      +4    param_get_used_index
  +1.3%      +4  +1.3%      +4    param_hash_check
  +2.1%      +4  +2.1%      +4    param_import_callback()
  +1.2%      +4  +1.2%      +4    param_reset_internal()
  +0.7%      +4  +0.7%      +4    param_set_internal()
  +7.7%      +4  +7.7%      +4    param_set_used
   +20%      +4   +20%      +4    param_type
  +8.3%      +4  +8.3%      +4    param_used
  +0.9%      +4  +0.9%      +4    param_value_is_default
+0.1%     +16  +0.1%     +16    .ramfunc
  +1.7%      +4  +1.7%      +4    param_get
  +1.4%      +4  +1.4%      +4    param_get_default_value
   +33%      +4   +33%      +4    param_get_index
  +9.1%      +4  +9.1%      +4    param_get_system_default_value
+0.0%     +55  [ = ]       0    .debug_abbrev
+0.0% +2.76Ki  [ = ]       0    .debug_info
+0.0%    +370  [ = ]       0    .debug_line
 -80.0%      -4  [ = ]       0    [Unmapped]
  +0.0%    +374  [ = ]       0    [section .debug_line]
+0.0%    +416  [ = ]       0    .debug_loclists
-0.0%      -6  [ = ]       0    .debug_rnglists
  [NEW]      +2  [ = ]       0    [Unmapped]
  -0.0%      -8  [ = ]       0    [section .debug_rnglists]
+0.0%    +950  [ = ]       0    .debug_str
+0.0%     +80  [ = ]       0    .symtab
 -33.3%     -16  [ = ]       0    ConstLayer::contains()
   +50%     +16  [ = ]       0    ConstLayer::store()
   +60%     +96  [ = ]       0    FixedwingRateControl::Run()
  +0.6%     +64  [ = ]       0    [section .symtab]
 -40.0%     -32  [ = ]       0    ___ZN39ControlAllocationSequentialDesaturation23computeDesaturationGainERKN6matrix6VectorIfLj16EEES4__veneer
   +67%     +32  [ = ]       0    __up_block_task_veneer
 -50.0%     -16  [ = ]       0    param_for_index
  -7.7%     -16  [ = ]       0    param_get_cplusplus()
 -50.0%     -16  [ = ]       0    param_get_index
 -50.0%     -32  [ = ]       0    param_hash_check
   +50%     +16  [ = ]       0    px4::parameters_volatile
  -1.9%     -16  [ = ]       0    px4::wq_configurations::nav_and_controllers
-2.6%    -264  [ = ]       0    [Unmapped]
+0.0% +4.58Ki  +0.0%    +264    TOTAL

px4_fmu-v6x [Total VM Diff: 48 byte (0 %)]
    FILE SIZE        VM SIZE    
--------------  -------------- 
+0.0%     +48  +0.0%     +48    .text
  +3.6%     +80  +3.6%     +80    FixedwingRateControl::Run()
  +0.0%     +28  +0.0%     +28    [section .text]
  +1.2%     +20  +1.2%     +20    FixedwingRateControl::FixedwingRateControl()
  +0.0%     +20  +0.0%     +20    g_cromfs_image
  +2.5%     +12  +2.5%     +12    FixedwingRateControl::updateParamsImpl()
  +0.1%      +8  +0.1%      +8    px4::parameters
  +4.8%      +4  +4.8%      +4    FlightTask
  +0.4%      +4  +0.4%      +4    Mavlink::Mavlink()
  -5.6%      -4  -5.6%      -4    ConstLayer::containedAsBitset()
 -25.0%      -4 -25.0%      -4    ConstLayer::contains()
 -14.3%      -4 -14.3%      -4    ConstLayer::get()
  -5.0%      -4  -5.0%      -4    MavlinkStreamESCStatus::new_instance()
 -30.8%      -4 -30.8%      -4    g_nullstring
  -2.5%      -4  -2.5%      -4    param_find_internal()
 -20.0%      -4 -20.0%      -4    param_for_index
  -4.5%      -4  -4.5%      -4    param_for_used_index
  -1.8%      -4  -1.8%      -4    param_foreach
  -1.7%      -4  -1.7%      -4    param_get
  -2.6%      -8  -2.6%      -8    param_hash_check
  -4.5%     -20  -4.5%     -20    param_reset_specific
 -101.9%     -60 -101.9%     -60    [15 Others]
+0.0%     +55  [ = ]       0    .debug_abbrev
-0.0%     -20  [ = ]       0    .debug_frame
+0.0% +2.68Ki  [ = ]       0    .debug_info
+0.0%    +245  [ = ]       0    .debug_line
  +250%      +5  [ = ]       0    [Unmapped]
  +0.0%    +240  [ = ]       0    [section .debug_line]
+0.0%    +399  [ = ]       0    .debug_loclists
-0.0%     -25  [ = ]       0    .debug_rnglists
+0.0%    +962  [ = ]       0    .debug_str
-0.4%      -1  [ = ]       0    .shstrtab
+0.0%      +1  [ = ]       0    .strtab
  +0.0%      +1  [ = ]       0    do_not_explicitly_use_this_namespace::Param<>::update()
+0.0%     +80  [ = ]       0    .symtab
  +100%     +16  [ = ]       0    ConstLayer::containedAsBitset()
  +100%     +16  [ = ]       0    ConstLayer::contains()
 -33.3%     -16  [ = ]       0    ConstLayer::store()
   +25%     +16  [ = ]       0    DynamicSparseLayer::DynamicSparseLayer()
   +60%     +96  [ = ]       0    FixedwingRateControl::Run()
  -0.7%     -80  [ = ]       0    [section .symtab]
  +100%     +16  [ = ]       0    param_for_index
  +100%     +16  [ = ]       0    param_get_index
  +100%     +32  [ = ]       0    param_hash_check
 -25.0%     -16  [ = ]       0    param_import_internal()
  -1.9%     -16  [ = ]       0    px4::wq_configurations::nav_and_controllers
-1.0%     -48  [ = ]       0    [Unmapped]
+0.0% +4.34Ki  +0.0%     +48    TOTAL

Updated: 2026-04-02T09:07:21

@ttechnick ttechnick requested review from dakejahl and sfuhrer March 31, 2026 13:37
@ttechnick ttechnick force-pushed the pr-flaps-aux-channel branch from 5f233d6 to 936658d Compare March 31, 2026 13:37
@ttechnick ttechnick marked this pull request as ready for review March 31, 2026 13:39
Copy link
Copy Markdown
Contributor

@sfuhrer sfuhrer left a comment

Choose a reason for hiding this comment

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

Only have some documentation remarks, I agree with the feature.
Main driver is to enable flaps to be controlled over MAVLink.

You could then use set the RC channel to control the `AUX3` output using `RC_MAP_AUX5`.


### Flaps and Spoiler Control with RC
Copy link
Copy Markdown
Contributor

@hamishwillee hamishwillee Apr 1, 2026

Choose a reason for hiding this comment

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

  1. Is this supposed to be nested under ## Generic Actuator Control with RC? Assuming not, make this a level 2 heading.

  2. Can this go anywhere else? This topic is about generic actuator control and payloads. This does not fit. I'd even prefer this as a topic in actuator setup where you link to it.

  3. Can this work with Joysticks? I mean you say

    The preferred method to manually actuate spoilers and flaps is to map an RC switch to an AUX output (see Generic Actuator Control with RC)

    • But can you also map a joystick switch to AUX and if so we should link to how.
    • The linked topic above "Generic Actuator Control with RC" does not explain how to do so for a joystick.

    I expect you should update the topic above and this would all work.

  4. In this case you have presented as a preferred method and as a less preferred method that is going to be removed. Because of that removal I would present the first way as "the way to do it" and the alternative entirely inside an info block as "not recommended". So structure the first para like this:

    To manually actuate spoilers and flaps you should map an ...

    And the second bit would be like

    ::: warning
    It is also possible to define a flaps channel directly on the RC using RC_MAP_FLAPS. This channel can also be used to control the spoilers by setting FW_SPOILERS_MAN to Flaps channel. This method is not possible when the source for the manual control is MAVLink.
    Note that this method is not recommended and will be removed in a future release.
    :::

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

  1. I also do not like the place its at currently. Do you think placing it in the Actuators is better? @hamishwillee
  2. See above
  3. Yes. I renamed RC to Manual Control, which includes RC, Joystick, Mavlink etc.
  4. Makes sense to me, i`ll adjust the second bit.

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.

3. Yes. I renamed RC to Manual Control, which includes RC, Joystick, Mavlink etc.

I perhaps didn't make my point well enough. Where you say (see [Generic Actuator Control with RC](#generic-actuator-control-with-rc)) THAT topic is currently above this one. Have a look at it - it ONLY covers RC and it isn't clear how you would configure a Joystick for generic actuator control.

In other words, if you follow the link and you have a Joystick, you're stuck.

The solution is to make the "Generic Actuator Control with RC" also cover Joystick.

Hope that makes sense (and that I am not wrong!)

Copy link
Copy Markdown
Contributor

@hamishwillee hamishwillee Apr 2, 2026

Choose a reason for hiding this comment

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

I also do not like the place its at currently. Do you think placing it in the Actuators is better?

The current place feels wrong, while in the actuators section is at least relevant to the topic.

I see two options:

  1. There are a whole bunch of things that we might normally control manually, more than just flaps and spoilers. IN this case we'd create a new topic like "Manual Control of Flight surfaces" (or something that captures the "what you want to do" so it is searchable. Then include this as part of it.

  2. Move into #### Flap Scale and Spoiler Scale Configuration as a nested topic at the end.

    I'd probably remove the line you added there, mostly because I don't know what "channel setup" means"

    The channel setup of flaps and spoilers is described in Flaps and Spoiler Control with Manual Control.

    Instead I'd link in the comment I added here https://github.com/PX4/PX4-Autopilot/pull/26913/changes#r3026074836

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I moved it to the actuators, makes most sense to me.

ttechnick and others added 2 commits April 1, 2026 11:05
@ttechnick ttechnick force-pushed the pr-flaps-aux-channel branch from 6fae497 to 981fd4c Compare April 1, 2026 09:06
Co-authored-by: Hamish Willee <hamishwillee@gmail.com>
@ttechnick
Copy link
Copy Markdown
Member Author

As far as I can tell, the option to map AUX from joystick does not exist yet (but it should definitely).
So no need to adjust the documentation before the feature is added.

@sfuhrer
Copy link
Copy Markdown
Contributor

sfuhrer commented Apr 2, 2026

As far as I can tell, the option to map AUX from joystick does not exist yet (but it should definitely). So no need to adjust the documentation before the feature is added.

You mean it doesn't exist yet on the QGC side?

@ttechnick
Copy link
Copy Markdown
Member Author

You mean it doesn't exist yet on the QGC side?

Yes.
image

@ttechnick ttechnick enabled auto-merge (squash) April 2, 2026 09:48
@ttechnick ttechnick merged commit 76eca4b into main Apr 2, 2026
83 checks passed
@ttechnick ttechnick deleted the pr-flaps-aux-channel branch April 2, 2026 09:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants