Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 02c7da1

Browse files
studiodyneclassicrocker883
authored andcommittedDec 26, 2023
🐛 Fix tool-change E prime (MarlinFirmware#26494)
Followup to MarlinFirmware#17248
1 parent e73b058 commit 02c7da1

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed
 

‎Marlin/src/module/tool_change.cpp

+17-1
Original file line numberDiff line numberDiff line change
@@ -1028,7 +1028,7 @@ void fast_line_to_current(const AxisEnum fr_axis) { _line_to_current(fr_axis, 0.
10281028
if (!too_cold(active_extruder)) {
10291029
destination = current_position; // Remember the old position
10301030

1031-
const bool ok = TERN1(TOOLCHANGE_PARK, all_axes_homed() && toolchange_settings.enable_park);
1031+
const bool ok = TERN0(TOOLCHANGE_PARK, all_axes_homed() && toolchange_settings.enable_park);
10321032

10331033
#if HAS_FAN && TOOLCHANGE_FS_FAN >= 0
10341034
// Store and stop fan. Restored on any exit.
@@ -1080,7 +1080,20 @@ void fast_line_to_current(const AxisEnum fr_axis) { _line_to_current(fr_axis, 0.
10801080
}
10811081
#endif
10821082

1083+
// Clone previous position
10831084
extruder_cutting_recover(destination.e); // Cutting recover
1085+
1086+
// Retract if previously retracted
1087+
#if ENABLED(FWRETRACT)
1088+
if (fwretract.retracted[active_extruder])
1089+
unscaled_e_move(-fwretract.settings.retract_length, fwretract.settings.retract_feedrate_mm_s);
1090+
#endif
1091+
1092+
// If resume_position is negative
1093+
if (current_position.e < 0) unscaled_e_move(current_position.e, MMM_TO_MMS(toolchange_settings.retract_speed));
1094+
1095+
planner.synchronize();
1096+
planner.set_e_position_mm(current_position.e); // Extruder primed and ready
10841097
}
10851098
}
10861099

@@ -1597,6 +1610,9 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) {
15971610
unscaled_e_move(-fwretract.settings.retract_length, fwretract.settings.retract_feedrate_mm_s);
15981611
#endif
15991612

1613+
// If resume_position is negative
1614+
if (resume_current_e < 0) unscaled_e_move(resume_current_e, MMM_TO_MMS(toolchange_settings.retract_speed));
1615+
16001616
// If no available extruder
16011617
if (EXTRUDERS < 2 || active_extruder >= EXTRUDERS - 2 || active_extruder == migration.last)
16021618
migration.automode = false;

0 commit comments

Comments
 (0)
Please sign in to comment.