Skip to content

feat(dynamic-notch-filter): support for RPM input for notch filter#27861

Draft
antoniomoreirakis wants to merge 6 commits into
PX4:mainfrom
antoniomoreirakis:pr-support_rpm_notch_filter
Draft

feat(dynamic-notch-filter): support for RPM input for notch filter#27861
antoniomoreirakis wants to merge 6 commits into
PX4:mainfrom
antoniomoreirakis:pr-support_rpm_notch_filter

Conversation

@antoniomoreirakis

@antoniomoreirakis antoniomoreirakis commented Jul 10, 2026

Copy link
Copy Markdown

Solved Problem

This PR is a 2nd attempt to implement a dynamic notch filter based on RPM.msg. A work first started by @mahima-yoga in this PR.

Solution

As Mahima stated, this PR adds filters for RPM feedback from Rpm.msg (applying the change @sfuhrer suggested, to use Rpm.msg instead of InternalCombustionEngineStatus.msg):

  • Identical to ESC RPM filter implementation
  • Can be disabled/enabled through existing bitmask param IMU_GYRO_DNF_EN
  • Supports multiple engines (up to 10. Limited by ORB_MULTI_MAX_INSTANCES).

Changelog Entry

For release notes:

Feature: Extend dynamic notch filter to accept RPM feedback

Test coverage

Still to be tested on hardware. Tested with SITL together with rpm_simulator.cpp, verifying that the filters were activated based on the data coming in from the simulator (OFC, when IMU_GYRO_DNF_EN == 4).

@github-actions github-actions Bot added the scope:sensors Sensor pipeline, calibration, voting, or sensor validation. label Jul 10, 2026
@antoniomoreirakis antoniomoreirakis changed the title dynamic-notch: support for RPM input for notch filter feat(dynamic-notch-filter): support for RPM input for notch filter Jul 10, 2026
@github-actions github-actions Bot added the kind:feature Request or change that adds new functionality. label Jul 10, 2026
@github-actions

github-actions Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

🔎 FLASH Analysis

px4_fmu-v5x [Total VM Diff: 2136 byte (0.11 %)]
    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.1% +1.77Ki  +0.1% +1.77Ki    .text
    [NEW]    +876  [NEW]    +876    sensors::VehicleAngularVelocity::UpdateDynamicNotchRotorRpm()
     +17%    +300   +17%    +300    sensors::VehicleAngularVelocity::ParametersUpdate()
    +0.1%    +200  +0.1%    +200    [section .text]
    [NEW]    +168  [NEW]    +168    sensors::VehicleAngularVelocity::DisableDynamicNotchRotorRpm()
     +13%    +116   +13%    +116    sensors::VehicleAngularVelocity::VehicleAngularVelocity()
     +14%     +52   +14%     +52    sensors::VehicleAngularVelocity::~VehicleAngularVelocity()
    +2.8%     +28  +2.8%     +28    sensors::VehicleAngularVelocity::ResetFilters()
     +14%     +24   +14%     +24    sensors::VehicleAngularVelocity::PrintStatus()
    +2.3%     +24  +2.3%     +24    sensors::VehicleAngularVelocity::Run()
    +0.0%     +12  +0.0%     +12    g_cromfs_image
    +4.8%      +4  +4.8%      +4    FlightTask
     +25%      +4   +25%      +4    sensors::VehicleGPSPosition::PrintStatus()
  +2.2%    +328  +2.2%    +328    .ramfunc
     +26%    +328   +26%    +328    sensors::VehicleAngularVelocity::FilterAngularVelocity()
  +0.0%     +74  [ = ]       0    .debug_abbrev
  +0.0%     +32  [ = ]       0    .debug_aranges
  +0.0%    +204  [ = ]       0    .debug_frame
  +0.0% +5.26Ki  [ = ]       0    .debug_info
  +0.1% +3.14Ki  [ = ]       0    .debug_line
    +100%      +2  [ = ]       0    [Unmapped]
    +0.1% +3.13Ki  [ = ]       0    [section .debug_line]
  +0.1% +1.95Ki  [ = ]       0    .debug_loclists
  +0.2%    +916  [ = ]       0    .debug_rnglists
    [NEW]      +3  [ = ]       0    [Unmapped]
    +0.2%    +913  [ = ]       0    [section .debug_rnglists]
  +0.0%    +859  [ = ]       0    .debug_str
  +0.8%      +2  [ = ]       0    .shstrtab
  +0.0%    +150  [ = ]       0    .strtab
   -32.7%     -16  [ = ]       0    __nxsched_add_prioritized_veneer
     +64%     +16  [ = ]       0    __up_unblock_task_veneer
    [NEW]     +74  [ = ]       0    sensors::VehicleAngularVelocity::DisableDynamicNotchRotorRpm()
    [NEW]     +76  [ = ]       0    sensors::VehicleAngularVelocity::UpdateDynamicNotchRotorRpm()
  +0.0%     +80  [ = ]       0    .symtab
   -20.0%     -16  [ = ]       0    ControlAllocationSequentialDesaturation::updateParameters()
    +0.3%     +32  [ = ]       0    [section .symtab]
   -40.0%     -32  [ = ]       0    __nxsched_add_prioritized_veneer
     +67%     +32  [ = ]       0    __up_unblock_task_veneer
    -1.9%     -16  [ = ]       0    px4::wq_configurations::nav_and_controllers
    [NEW]     +32  [ = ]       0    sensors::VehicleAngularVelocity::DisableDynamicNotchRotorRpm()
     +33%     +16  [ = ]       0    sensors::VehicleAngularVelocity::FilterAngularVelocity()
    +100%     +16  [ = ]       0    sensors::VehicleAngularVelocity::Stop()
    [NEW]     +48  [ = ]       0    sensors::VehicleAngularVelocity::UpdateDynamicNotchRotorRpm()
   -20.0%     -16  [ = ]       0    sensors::VehicleAngularVelocity::VehicleAngularVelocity()
   -33.3%     -16  [ = ]       0    sensors::VehicleGPSPosition::PrintStatus()
   +22% +1.91Ki  [ = ]       0    [Unmapped]
  +0.0% +16.6Ki  +0.1% +2.09Ki    TOTAL

px4_fmu-v6x [Total VM Diff: 2160 byte (0.11 %)]
    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.1% +2.11Ki  +0.1% +2.11Ki    .text
    [NEW]    +876  [NEW]    +876    sensors::VehicleAngularVelocity::UpdateDynamicNotchRotorRpm()
     +26%    +328   +26%    +328    sensors::VehicleAngularVelocity::FilterAngularVelocity()
     +17%    +300   +17%    +300    sensors::VehicleAngularVelocity::ParametersUpdate()
    +0.1%    +212  +0.1%    +212    [section .text]
    [NEW]    +168  [NEW]    +168    sensors::VehicleAngularVelocity::DisableDynamicNotchRotorRpm()
     +13%    +116   +13%    +116    sensors::VehicleAngularVelocity::VehicleAngularVelocity()
     +14%     +52   +14%     +52    sensors::VehicleAngularVelocity::~VehicleAngularVelocity()
    +2.8%     +28  +2.8%     +28    sensors::VehicleAngularVelocity::ResetFilters()
    +0.0%     +24  +0.0%     +24    g_cromfs_image
     +14%     +24   +14%     +24    sensors::VehicleAngularVelocity::PrintStatus()
    +2.3%     +24  +2.3%     +24    sensors::VehicleAngularVelocity::Run()
     +44%      +4   +44%      +4    g_nullstring
     +25%      +4   +25%      +4    sensors::VehicleGPSPosition::PrintStatus()
  +0.0%     +74  [ = ]       0    .debug_abbrev
  +0.0%     +32  [ = ]       0    .debug_aranges
  +0.0%    +204  [ = ]       0    .debug_frame
  +0.0% +5.26Ki  [ = ]       0    .debug_info
  +0.1% +3.13Ki  [ = ]       0    .debug_line
   -85.7%      -6  [ = ]       0    [Unmapped]
    +0.1% +3.13Ki  [ = ]       0    [section .debug_line]
  +0.1% +1.95Ki  [ = ]       0    .debug_loclists
  +0.2%    +916  [ = ]       0    .debug_rnglists
    [NEW]      +3  [ = ]       0    [Unmapped]
    +0.2%    +913  [ = ]       0    [section .debug_rnglists]
  +0.0%    +859  [ = ]       0    .debug_str
  -0.8%      -2  [ = ]       0    .shstrtab
  +0.0%    +150  [ = ]       0    .strtab
    [NEW]     +74  [ = ]       0    sensors::VehicleAngularVelocity::DisableDynamicNotchRotorRpm()
    [NEW]     +76  [ = ]       0    sensors::VehicleAngularVelocity::UpdateDynamicNotchRotorRpm()
  +0.0%     +80  [ = ]       0    .symtab
    -1.9%     -16  [ = ]       0    px4::wq_configurations::nav_and_controllers
    [NEW]     +32  [ = ]       0    sensors::VehicleAngularVelocity::DisableDynamicNotchRotorRpm()
     +67%     +32  [ = ]       0    sensors::VehicleAngularVelocity::FilterAngularVelocity()
    +100%     +16  [ = ]       0    sensors::VehicleAngularVelocity::Stop()
    [NEW]     +48  [ = ]       0    sensors::VehicleAngularVelocity::UpdateDynamicNotchRotorRpm()
   -20.0%     -16  [ = ]       0    sensors::VehicleAngularVelocity::VehicleAngularVelocity()
   -33.3%     -16  [ = ]       0    sensors::VehicleGPSPosition::PrintStatus()
   +33% +1.89Ki  [ = ]       0    [Unmapped]
  +0.0% +16.6Ki  +0.1% +2.11Ki    TOTAL

Updated: 2026-07-15T07:01:22

@github-actions github-actions Bot added the scope:drivers Device drivers and hardware interfaces. label Jul 10, 2026
mahima-yoga and others added 6 commits July 15, 2026 08:50
Signed-off-by: Antonio Moreira <antonio.moreira@auterion.com>
Signed-off-by: Antonio Moreira <antonio.moreira@auterion.com>
…es in loop

Signed-off-by: Antonio Moreira <antonio.moreira@auterion.com>
@antoniomoreirakis
antoniomoreirakis force-pushed the pr-support_rpm_notch_filter branch 3 times, most recently from 134d2cf to 6ed1c23 Compare July 15, 2026 06:53
@hamishwillee

Copy link
Copy Markdown
Contributor

Just make sure that the docs https://docs.px4.io/main/en/config_mc/filter_tuning#dynamic-notch-filters are updated if needed when this goes in. Ping me for review please on those.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind:feature Request or change that adds new functionality. scope:drivers Device drivers and hardware interfaces. scope:sensors Sensor pipeline, calibration, voting, or sensor validation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants