Skip to content

feat(heater): add more temp sources & heating modes#27398

Draft
alexcekay wants to merge 1 commit into
mainfrom
pr-heater-modes
Draft

feat(heater): add more temp sources & heating modes#27398
alexcekay wants to merge 1 commit into
mainfrom
pr-heater-modes

Conversation

@alexcekay
Copy link
Copy Markdown
Member

Solved Problem

This addresses multiple topics observed while developing a more complex heater

  • The current heater can only listen to sensor_accel.
  • Currently the update rate is limited by the refresh rate of a temperature source, which is problematic for temperature drivers with slow update rate
  • It is not possible to set the IMAX term (integrator clamp)
  • The design can not handle variable heater supply voltage

Solution

  • Add support to get temperature from sensor_hygrometer. The structure also allows adding more sources in the future
  • Add a HEATER_FAST_UPDATE_MODE to Kconfig. This allows using the last received temperature for up to a defined timeout where the heater will be turned off for safety reasons. The fast update is needed for slow temperature sources, otherwise the heater will be turned off most of the time and will not heat enough. If this is not set everything behaves as previously
  • Add a param to set the IMAX term
  • Add a HEATER${I}_NOM_V parameter. With this it is possible to set the nominal voltage the controller was designed. This is also the voltage the heater network can sustain with 100% duty cycle. A higher supply voltage will adapt the controller output accordingly to not overload the heater network. This requires reading supply voltage and will disable the heater when no supply voltage can be read. If the parameter is not set everything behaves as previously.

Test coverage

  • Tested the HEATER_FAST_UPDATE_MODE with a new product with a quite strong heater network

@github-actions github-actions Bot added kind:feature Request or change that adds new functionality. scope:drivers Device drivers and hardware interfaces. scope:uorb uORB messages, generated interfaces, or message translation. scope:parameters Parameter definitions, metadata, migration, or defaults. labels May 19, 2026
@github-actions
Copy link
Copy Markdown
Contributor

🔎 FLASH Analysis

px4_fmu-v5x [Total VM Diff: 1176 byte (0.06 %)]
    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.1% +1.15Ki  +0.1% +1.15Ki    .text
    +0.1%    +228  +0.1%    +228    g_cromfs_image
    +0.1%    +184  +0.1%    +184    [section .text]
     +47%    +180   +47%    +180    Heater::Run()
     +46%    +164   +46%    +164    Heater::Heater()
     +65%    +160   +65%    +160    Heater::initialize_topics()
    +0.5%     +72  +0.5%     +72    px4::parameters
     +46%     +64   +46%     +64    Heater::update_params()
    +0.3%     +64  +0.3%     +64    uORB::compressed_fields
     +17%     +20   +17%     +20    Heater::publish_status()
     +14%     +16   +14%     +16    Heater::~Heater()
    [NEW]     +12  [NEW]     +12    CSWTCH.87
     +25%      +8   +25%      +8    ___ZL19param_get_cplusplustPf.isra.0_veneer
    +0.4%      +8  +0.4%      +8    px4::parameters_type
    +4.8%      +4  +4.8%      +4    FlightTask
    +3.1%      +4  +3.1%      +4    Heater::start_instance()
    [DEL]     -12  [DEL]     -12    CSWTCH.69
  +0.0%     +99  [ = ]       0    .debug_abbrev
  +0.0%     +24  [ = ]       0    .debug_aranges
  +0.0%    +136  [ = ]       0    .debug_frame
  +0.1% +16.9Ki  [ = ]       0    .debug_info
  +0.0%    +791  [ = ]       0    .debug_line
     +67%      +2  [ = ]       0    [Unmapped]
    +0.0%    +789  [ = ]       0    [section .debug_line]
  +0.0%    +502  [ = ]       0    .debug_loclists
  +0.0%    +174  [ = ]       0    .debug_rnglists
     +50%      +1  [ = ]       0    [Unmapped]
    +0.0%    +173  [ = ]       0    [section .debug_rnglists]
  +0.0%    +544  [ = ]       0    .debug_str
  +0.0%     +80  [ = ]       0    .symtab
    [DEL]     -32  [ = ]       0    CSWTCH.69
    [NEW]     +32  [ = ]       0    CSWTCH.87
     +33%     +16  [ = ]       0    Heater::is_running_any()
   -50.0%     -16  [ = ]       0    Heater::update_params()
    +7.1%     +16  [ = ]       0    ___ZL19param_get_cplusplustPf.isra.0_veneer
     +50%     +16  [ = ]       0    ____errno_veneer
     +33%     +16  [ = ]       0    __hrt_elapsed_time_veneer
     +67%     +32  [ = ]       0    __memset_veneer
   -33.3%     -16  [ = ]       0    __pthread_mutex_lock_veneer
   -25.0%     -16  [ = ]       0    __stm32_req_complete_veneer
   -25.0%     -16  [ = ]       0    calculateCRC32()
     +30%     +48  [ = ]       0    param_get_cplusplus()
    +3.1%     +16  [ = ]       0    px4::wq_configurations::lp_default
    -5.3%     -16  [ = ]       0    uORB::PublicationMulti<>::advertise()
  -9.8% -1.15Ki  [ = ]       0    [Unmapped]
  +0.0% +19.2Ki  +0.1% +1.15Ki    TOTAL

px4_fmu-v6x [Total VM Diff: 1168 byte (0.06 %)]
    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.1% +1.14Ki  +0.1% +1.14Ki    .text
    +0.1%    +220  +0.1%    +220    g_cromfs_image
    +0.1%    +192  +0.1%    +192    [section .text]
     +47%    +180   +47%    +180    Heater::Run()
     +46%    +164   +46%    +164    Heater::Heater()
     +65%    +160   +65%    +160    Heater::initialize_topics()
    +0.5%     +72  +0.5%     +72    px4::parameters
     +46%     +64   +46%     +64    Heater::update_params()
    +0.3%     +64  +0.3%     +64    uORB::compressed_fields
     +17%     +20   +17%     +20    Heater::publish_status()
     +14%     +16   +14%     +16    Heater::~Heater()
    [NEW]     +12  [NEW]     +12    CSWTCH.87
    +0.5%      +8  +0.5%      +8    px4::parameters_type
     +30%      +6   +30%      +6    param_get_cplusplus()
    +7.7%      +4  +7.7%      +4    BMI088::init()
    +3.1%      +4  +3.1%      +4    Heater::start_instance()
    -0.6%      -2  -0.6%      -2    uORB::PublicationMulti<>::advertise()
    -4.5%      -4  -4.5%      -4    FlightTask
    [DEL]     -12  [DEL]     -12    CSWTCH.69
  +0.0%     +99  [ = ]       0    .debug_abbrev
  +0.0%     +24  [ = ]       0    .debug_aranges
  +0.0%    +136  [ = ]       0    .debug_frame
  +0.1% +16.3Ki  [ = ]       0    .debug_info
  +0.0%    +791  [ = ]       0    .debug_line
    [NEW]      +1  [ = ]       0    [Unmapped]
    +0.0%    +790  [ = ]       0    [section .debug_line]
  +0.0%    +627  [ = ]       0    .debug_loclists
  +0.0%    +173  [ = ]       0    .debug_rnglists
  +0.0%    +628  [ = ]       0    .debug_str
  +0.9%      +2  [ = ]       0    .shstrtab
  +0.0%      +2  [ = ]       0    .strtab
    [DEL]     -10  [ = ]       0    CSWTCH.69
    [NEW]     +10  [ = ]       0    CSWTCH.87
    +0.0%      +2  [ = ]       0    do_not_explicitly_use_this_namespace::Param<>::update()
  +0.0%     +32  [ = ]       0    .symtab
   -33.3%     -16  [ = ]       0    BMI088
   -20.0%     -16  [ = ]       0    BMI088::init()
    [DEL]     -32  [ = ]       0    CSWTCH.69
    [NEW]     +32  [ = ]       0    CSWTCH.87
     +33%     +16  [ = ]       0    Heater::is_running_any()
   -50.0%     -16  [ = ]       0    Heater::update_params()
    +0.3%     +32  [ = ]       0    [section .symtab]
     +20%     +32  [ = ]       0    param_get_cplusplus()
   +69% +2.86Ki  [ = ]       0    [Unmapped]
  +0.1% +22.8Ki  +0.1% +1.14Ki    TOTAL

Updated: 2026-05-19T16:48:40

Copy link
Copy Markdown
Contributor

@dakejahl dakejahl left a comment

Choose a reason for hiding this comment

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

Very nice. Share some logs once you have them

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:parameters Parameter definitions, metadata, migration, or defaults. scope:uorb uORB messages, generated interfaces, or message translation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants