Add H2 AUX filtration override#11396
Conversation
|
This is now ready for maintainer review. GitHub Actions is awaiting maintainer approval before running the workflow. Local validation completed:
I have exported validation G-code samples for H2C, H2D, H2S, and X2D with the override enabled/disabled. I have not committed them because they are generated artifacts, but I can attach them if useful. Summary of observed output:
|
BenJule
left a comment
There was a problem hiding this comment.
Took a read through this (the approach and the gcode side, not a local build). It is cleanly done, a few notes in case they help.
What I like: the capability check lives in one place (supports_auxiliary_fan_filtration) and both the UI and gcode generation go through it, so they cannot drift apart. Default off and gated behind auxiliary_fan + support_cooling_filter means zero impact on anyone not opting in, and the layer path using max(normal aux, filtration speed) avoids fighting the normal cooling logic. Good that there are tests too, including the negative case that X2D does not pass the gate. Targeting the 0.4 nozzle template is also correct here, since the 0.6/0.8/0.2 machines inherit from it, so no nozzle variants are missed.
One thing worth raising: the gate hardcodes the model names (printer_model == "Bambu Lab H2C" || ...). It works today but it is brittle: a new H2 variant, a rename, or any future printer with the same mod needs a C++ change, and it splits "which printers can do this" between code and profiles. A machine-profile capability flag that this function reads instead would keep it data driven and let X2D / H2D Pro opt in later without touching code. Since X2D is excluded from V1 and the same MakerWorld filter mod exists for it, that may come up quickly.
Two practical points: CI has not run on the branch yet (no checks reported), so it would help to get a maintainer to trigger the workflows and confirm build/tests are green before review. And the real call here is probably policy rather than code, since this officially supports a user modified AUX path. The PR handles that about as responsibly as it can (opt in, off by default, clearly scoped, warned in the UI), so calling that out explicitly for whoever reviews might speed the decision.
I could not verify runtime behavior (no slicing on my end), this is a read of the diff and the gcode injection points.
|
I updated the PR to address the maintainability concern about hard-coded printer model names. The AUX filtration support gate is now profile-driven via For future printers, support can be added in profile data rather than C++ by:
This keeps UI visibility and G-code generation using the same shared capability check while avoiding a growing model-name allowlist in source code. |
Related issue: #11395
Summary
Add an opt-in, Advanced process setting that keeps the AUX fan running as a chamber recirculation filter on user-modified Bambu Lab H2C, H2D, and H2S printers.
This feature is specifically for printers whose AUX fan path has been physically modified to recirculate chamber air through a filter. It is not intended for an unmodified stock AUX part-cooling path.
Physical modification that motivated this work:
Problem
On a modified H2 printer, the AUX fan can be repurposed to pull chamber air through a HEPA/charcoal filter.
Bambu Studio still treats P2 as an ordinary auxiliary part-cooling fan. Normal cooling behavior can therefore turn it off during:
Users can force P2 on by overriding complete machine-start, machine-end, layer-change, and filament-change G-code fields in a custom printer preset. However, those copied fields stop inheriting future stock-template updates.
Solution
Add three process-level settings under:
Process → Others → AUX filtration overrideSettings:
enable_auxiliary_fan_filtrationauxiliary_fan_filtration_speedM106 P2 S178auxiliary_fan_filtration_post_timeAll settings are Advanced-only. The UI warns that the feature requires a user-modified AUX recirculation/filter path.
When disabled, normal stock AUX behavior is retained.
Supported printers
The feature is enabled only when all of the following are true:
auxiliary_fanis enabledsupport_cooling_filteris enabledprinter_modelis exactly one of:Bambu Lab H2CBambu Lab H2DBambu Lab H2SExplicitly excluded from V1:
The UI and G-code generation use the same shared capability gate.
G-code behavior
Startup
After the final stock P2-off operation and immediately before the nozzle-load/purge line:
{if auxiliary_fan_filtration_active} M106 P2 S{auxiliary_fan_filtration_speed_num} ; AUX filtration override {endif} ;===== nozzle load line ===============================Earlier calibration, chamber-control, homing, and leveling commands remain unchanged.
Generated layers
The effective AUX speed is:
The floor is applied after first-layer suppression and fan ramping.
This means:
Filament and tool changes
The stock P2 reset remains in place and filtration is immediately restored before material-switch operations:
There is no wait or material-switch command between the stock P2-off and recovery.
AMS, flushing, synchronization, tool selection, temperature, and detection commands are unchanged.
Machine end
The early stock P2 shutdown becomes conditional:
{if auxiliary_fan_filtration_active} M106 P2 S{auxiliary_fan_filtration_speed_num} ; AUX filtration override {else} M106 P2 S0 ; turn off remote part cooling fan {endif}P2 remains active through normal unloading, heater shutdown, safe movement, state reset, and stock purification.
Existing P3/P6/M145/M145.2 purification behavior is unchanged.
After stock purification and before the finish sound and motor disable:
{if auxiliary_fan_filtration_active} M106 P2 S{auxiliary_fan_filtration_speed_num} ; final AUX filtration dwell {if auxiliary_fan_filtration_post_time > 0} M400 S{auxiliary_fan_filtration_post_time} {endif} M106 P2 S0 ; turn off AUX filtration {endif}The post-print setting is a guaranteed final dwell, not total post-print P2 runtime. P2 may already have been running during the preceding shutdown and purification sequence.
No undocumented asynchronous timer or M106 parameter is introduced.
Validation
Completed locally on macOS:
libslic3r_guicompiled.M400 S60final dwellgit diff --checkpassed.Focused tests cover:
Full test executable limitation
The complete local test executables currently fail to compile before reaching the new AUX tests because of unrelated, pre-existing tests that are stale relative to current production APIs:
tests/libslic3r/test_3mf.cpptests/fff_print/test_gcodewriter.cppThe new AUX test translation units compile successfully. The GUI library and full application also build successfully.
Known limitations
Stock-template dependency
Final dwell and final P2 shutdown are emitted through the supported stock H2 machine-end templates. Custom H2 machine-end G-code that replaces the stock template would also need to include the new hook.
The intended usage is a process setting layered onto current stock H2 printer profiles.
Transient toolchange P2-off
Filament-change templates intentionally retain the stock:
This is followed immediately by the configured P2 recovery. No wait or material-switch operation occurs between the two commands.
Keeping the stock reset avoids changing undocumented toolchange assumptions while still restoring filtration before flushing and switching operations.
Internal template synchronization
The H2 template resources appear to be synchronized from Bambu’s internal custom-G-code source.
Equivalent changes may need to be applied to that source so a future automated template synchronization does not overwrite these hooks.
Reviewer notes
.pot,.po, or.mochanges are included in this draft. Translation resources appear to be regenerated by the localization pipeline.support_auxiliary_fan_filtration; future supported printers can opt in through profile data once their P2 AUX semantics and template hooks are verified.