Skip to content
Closed
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
14 changes: 4 additions & 10 deletions Marlin/src/module/tool_change.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ inline void invalid_extruder_error(const uint8_t e) {
const float xhome = x_home_pos(active_extruder);
if (dual_x_carriage_mode == DXC_AUTO_PARK_MODE
&& IsRunning()
&& (delayed_move_time || current_position[X_AXIS] != xhome)
&& (delayed_move_time || current_position[X_AXIS] != xhome) && !no_move
) {
float raised_z = current_position[Z_AXIS] + toolchange_settings.z_raise;
#if ENABLED(MAX_SOFTWARE_ENDSTOPS)
Expand All @@ -401,14 +401,14 @@ inline void invalid_extruder_error(const uint8_t e) {

planner.buffer_line(CUR_X, CUR_Y, raised_z, CUR_E, planner.settings.max_feedrate_mm_s[Z_AXIS], active_extruder);
planner.buffer_line(xhome, CUR_Y, raised_z, CUR_E, planner.settings.max_feedrate_mm_s[X_AXIS], active_extruder);
planner.buffer_line(xhome, CUR_Y, CUR_Z, CUR_E, planner.settings.max_feedrate_mm_s[Z_AXIS], active_extruder);

planner.synchronize();
}

// Apply Y & Z extruder offset (X offset is used as home pos with Dual X)
current_position[Y_AXIS] -= hotend_offset[Y_AXIS][active_extruder] - hotend_offset[Y_AXIS][tmp_extruder];
current_position[Z_AXIS] -= hotend_offset[Z_AXIS][active_extruder] - hotend_offset[Z_AXIS][tmp_extruder];
current_position[Z_AXIS] += TOOLCHANGE_ZRAISE;

// Activate the new extruder ahead of calling set_axis_is_at_home!
active_extruder = tmp_extruder;
Expand All @@ -431,12 +431,8 @@ inline void invalid_extruder_error(const uint8_t e) {
inactive_extruder_x_pos = destination[X_AXIS];
break;
case DXC_AUTO_PARK_MODE:
// record raised toolhead position for use by unpark
// record current raised toolhead position for use by unpark
COPY(raised_parked_position, current_position);
raised_parked_position[Z_AXIS] += toolchange_settings.z_raise;
#if ENABLED(MAX_SOFTWARE_ENDSTOPS)
NOMORE(raised_parked_position[Z_AXIS], soft_endstop_max[Z_AXIS]);
#endif
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

As I recall the reason we added this limit on Z movement was that someone complained about the lack of it. Maybe we should continue to include it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This raise move is being applied in the conditional above covered by a limit statement already. Since the z lower is not being performed between tools, the 2nd z raise is not necessary any longer. Were taking the current position as is, and no longer modifying it so the check is redundant.

active_extruder_parked = true;
delayed_move_time = 0;
break;
Expand All @@ -448,8 +444,6 @@ inline void invalid_extruder_error(const uint8_t e) {
DEBUG_POS("New extruder (parked)", current_position);
}
#endif

// No extra case for HAS_ABL in DUAL_X_CARRIAGE. Does that mean they don't work together?
}

#endif // DUAL_X_CARRIAGE
Expand Down Expand Up @@ -585,7 +579,7 @@ void tool_change(const uint8_t tmp_extruder, const float fr_mm_s/*=0.0*/, bool n

// Raise, move, and lower again
if (safe_to_move && !no_move && IsRunning()) {
#if DISABLED(SWITCHING_NOZZLE)
#if DISABLED(SWITCHING_NOZZLE) && DISABLED(DUAL_X_CARRIAGE)
// Do a small lift to avoid the workpiece in the move back (below)
current_position[Z_AXIS] += toolchange_settings.z_raise;
planner.buffer_line(current_position, planner.settings.max_feedrate_mm_s[Z_AXIS], active_extruder);
Expand Down