fix: ironing fan speed not restored after ironing ends - #659
Open
mwz-iot wants to merge 1 commit into
Open
Conversation
Root cause: CoolingBuffer::apply_layer_cooldown creates a fresh fan_speed_change_requests map per batch. When _IRONING_FAN_START is in batch N and _IRONING_FAN_END lands in batch N+1 (because ironing was the last extrusion role before a flush boundary), the END handler was gated on a flag that is always false in the new batch, so the fan speed was never restored. Fix 1: Remove the cross-batch gate condition on TYPE_IRONING_FAN_END. Fix 2: Sync m_current_fan_speed = m_fan_speed in the restore branch. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
zackaree-shen
approved these changes
Aug 4, 2026
bluetianyu
approved these changes
Aug 7, 2026
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.
Description
This PR fixes an issue where the part-cooling fan speed was not restored after an ironing path finished.
The ironing fan speed is a temporary override that should only apply while printing ironing paths. After leaving ironing, the fan should return to the speed calculated by the existing cooling logic.
Before this fix:
Expected behavior:
Root Cause
CoolingBuffer::apply_layer_cooldown()creates a newfan_speed_change_requestsmap for each CoolingBuffer processing batch.The original
TYPE_IRONING_FAN_ENDhandler required the current batch to contain both_IRONING_FAN_STARTand_IRONING_FAN_END.When ironing was the final extrusion role before a flush boundary, the markers could be split across two batches:
The map was recreated for batch N+1, so the
TYPE_IRONING_FAN_STARTflag was reset tofalse.As a result, the END handler was skipped, no restoring
M106command was generated, and subsequent non-ironing paths continued using the ironing fan speed.Changes
1. Process
TYPE_IRONING_FAN_ENDacross batch boundariesThe same-batch START condition was removed from the END handler.
A valid
_IRONING_FAN_ENDmarker can now restore the fan speed even when its matching START marker was processed in the previous batch.2. Synchronize the cached current fan speed
The restore branch now updates
m_current_fan_speedbefore emitting the restoring fan command:m_current_fan_speed = m_fan_speed; new_gcode += GCodeWriter::set_fan( m_config.gcode_flavor, m_fan_speed );This keeps the internal cached fan state consistent with the fan speed written to G-code.
The restored value is not hard-coded to
100%. It usesm_fan_speed, which is calculated by the existing cooling logic.Compatibility
This change does not modify:
There are no breaking changes or new external dependencies introduced by this PR.
Screenshots/Recordings/Graphs
Before
After an ironing path finished, subsequent non-ironing paths could continue using the ironing fan speed.
After
The fan speed is restored when leaving ironing, including when START and END are separated by a CoolingBuffer flush boundary.
Tests
Build
libslic3rRelease target successfully.libslic3r.lib.Manual Tests
100% normal → 50% ironing → 100% normal.70% normal → 50% ironing → 70% normal.100%.