Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX (tool change + toolchange prime + migration) #26494

Merged
merged 1 commit into from
Dec 6, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion Marlin/src/module/tool_change.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1028,7 +1028,7 @@ void fast_line_to_current(const AxisEnum fr_axis) { _line_to_current(fr_axis, 0.
if (!too_cold(active_extruder)) {
destination = current_position; // Remember the old position

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

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

// Clone previous position
extruder_cutting_recover(destination.e); // Cutting recover

// Retract if previously retracted
#if ENABLED(FWRETRACT)
if (fwretract.retracted[active_extruder])
unscaled_e_move(-fwretract.settings.retract_length, fwretract.settings.retract_feedrate_mm_s);
#endif

// If resume_position is negative
if (current_position.e < 0) unscaled_e_move(current_position.e, MMM_TO_MMS(toolchange_settings.retract_speed));
Copy link
Member

Choose a reason for hiding this comment

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

Does this depend in any way on the slicer preceding E moves with G29 E0 or anything like that? I believe most slicers do this by default at the end of every layer to prevent E from growing large and losing precision, but it is not guaranteed.


planner.synchronize();
planner.set_e_position_mm(current_position.e); // Extruder primed and ready
}
}

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

// If resume_position is negative
if (resume_current_e < 0) unscaled_e_move(resume_current_e, MMM_TO_MMS(toolchange_settings.retract_speed));

// If no available extruder
if (EXTRUDERS < 2 || active_extruder >= EXTRUDERS - 2 || active_extruder == migration.last)
migration.automode = false;
Expand Down
Loading