feat: add auxiliary part cooling fan support - #805
Open
ndotzbgt wants to merge 6 commits into
Open
Conversation
Add an independently controlled secondary part cooling fan (e.g. OrcaSlicer "Auxiliary Part Cooling Fan"): - config/hardware/fans/aux_fan.cfg / aux_fan_tachometer.cfg with an optional tachometer safety check - START_AUX_FAN / STOP_AUX_FAN macros plus M106/M107 P2 bridge for OrcaSlicer compatibility - integration in start/end/cancel print and control macros: chamber venting, heatsoak spread, and post-print run-down cooling - new aux fan variables and pinout documentation Also add a config validation pipeline for CI: - tests/lint_jinja.py reusing Klipper's exact Jinja2 environment to syntax-check templated macro blocks - tests/config_check.py assembling a full reference config and loading it with a real klippy (standard + tachometer variants) - .github/workflows/validate.yml running both
Collaborator
|
Thank you for your contribution. I see a few problems with this PR:
|
added 2 commits
August 15, 2026 15:22
…atsoak safety - Re-enable tach monitoring after end-print/cancel run-down fan starts - Replace M106/M107 rename_existing with SET_FAN_SPEED + 'fan' in printer guard (no [fan] dependency) - Re-enable tach monitoring before chamber vent in START_PRINT - Add aux_fan_vent_temp > 0 guard to prevent room temp false trigger - Stop aux fan at end of _MODULE_HEATSOAK_BED as safety net - Clean up _STOP_AUX_FAN_DELAYED to stop tach loop - Fix variable ordering in _AUX_FAN_CHECK
…om all [fan] configs Moves the M106/M107 OrcaSlicer P2 bridge to a separate file (fan_bridge.cfg) that uses rename_existing (required by Klipper for command overrides) and is included only from config files that define [fan]. This includes: - config/hardware/fans/part_fan.cfg - config/hardware/fans/part_fan_tachometer.cfg - All 25 toolhead board templates that define [fan] Users without [fan] (e.g. Chube conduction) no longer get a config load error from rename_existing. Toolhead board users retain P2 bridge support. The bridge also checks aux_fan_enabled before routing P2, so it's safe to include even when no aux fan is configured.
Collaborator
|
Hey, it looks like there are still some of the bugs I mentioned earlier open in this pull request and the new design with every file that has a And same as the other changes you had in before, the axis twist compensation needs to be in a separate PR |
…rtional min_rpm - Re-enable tach monitoring BEFORE starting the post-print/cancel aux fan so it is monitored from the moment it spins up (was disabled in _MODULE_TURN_OFF_FANS and only re-enabled after the fan was running) - Add fallback M106/M107 macros in aux_fan.cfg that route OrcaSlicer P2 commands to SET_FAN_SPEED and forward P0/bare to M106.1/M107.1 when fan_bridge.cfg is loaded, or silently ignore otherwise. This makes the M106 bridge work on machines without a [fan] section (e.g. Chube conduction hotends) where fan_bridge.cfg was never included - Scale _AUX_FAN_CHECK min_rpm proportionally with target fan speed (1000 RPM at full, 200 RPM floor) so low aux_fan_soak_speed values don't false-positive and cancel the print - Both standard and tachometer config_check variants pass
ndotzbgt
force-pushed
the
feat/aux-fan-part-cooling
branch
from
August 22, 2026 03:08
a7a5377 to
933109c
Compare
Remove the fan_bridge.cfg include from all 25 toolhead board templates. The fallback M106/M107 in aux_fan.cfg now handle OrcaSlicer P2 routing for all configurations. fan_bridge.cfg (with rename_existing) is only included from part_fan.cfg/part_fan_tachometer.cfg, where [fan] is always present. Toolhead board users who also need bare M106/M107 forwarding to the native part fan can add a one-line include in their printer.cfg. Document this in fan_bridge.cfg, aux_fan.cfg, and the printer.cfg template. Addresses maintainer feedback about brittleness and maintenance burden of requiring every [fan]-defining file to include fan_bridge.cfg.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds an independently controlled secondary part cooling fan (e.g. the OrcaSlicer "Auxiliary Part Cooling Fan", addressed as
M106 P2/M107 P2), complementing the existingPART_FAN.Changes
config/hardware/fans/):aux_fan.cfgandaux_fan_tachometer.cfg(the latter addsAUX_FAN_TACHOmonitoring with the same safety checks as the base fans). Wired pins use the newAUX_FAN/AUX_FAN_TACHOboard_pins aliases.macros/hardware_functions/aux_fan.cfg):START_AUX_FAN/STOP_AUX_FAN, a delayed stop macro, the tachometer background check loop, and anM106/M107override that forwardsP2to the aux fan and keepsP0/ bare calls fully compatible with existing slicers.start_print: vent the chamber if it is above the configured temperature before heating, and optionally spread heat during the soak.end_print/cancel_print: optional post-print run-down to cool the bed faster and help recirculating filters/exhaust.control: clean shutdown onPRINT_STOP.variable_aux_fan_*settings invariables.cfg, include lines inprinter.cfg, andAUX_FAN/AUX_FAN_TACHOpinout documentation.Validation
Added a CI pipeline:
tests/lint_jinja.pysyntax-checks every templated block with Klipper's own Jinja2 environment, andtests/config_check.pyassembles a full reference config and loads it with a real klippy (standard and aux-fan-tachometer variants), run by.github/workflows/validate.yml.Verified locally: 279/279 templates pass, both klippy config loads pass (only the expected "no MCU connected" step fails), and an injected broken template fails the checks.
Enabling
Uncomment
[include config/hardware/fans/aux_fan.cfg](oraux_fan_tachometer.cfg) inuser_templates/printer.cfg, defineAUX_FAN(and optionallyAUX_FAN_TACHO) pins inmcu.cfg, and tune thevariable_aux_fan_*settings inuser_templates/variables.cfg.