parent
de5f69b285
commit
9d2ef95f1d
@ -11558,9 +11558,9 @@ void tool_change(const uint8_t tmp_extruder, const float fr_mm_s/*=0.0*/, bool n
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if ENABLED(SWITCHING_NOZZLE)
|
#if ENABLED(SWITCHING_NOZZLE)
|
||||||
// Always raise by at least 0.3
|
// Always raise by at least 1 to avoid workpiece
|
||||||
const float z_diff = hotend_offset[Z_AXIS][active_extruder] - hotend_offset[Z_AXIS][tmp_extruder];
|
const float zdiff = hotend_offset[Z_AXIS][active_extruder] - hotend_offset[Z_AXIS][tmp_extruder];
|
||||||
current_position[Z_AXIS] += (z_diff > 0.0 ? z_diff : 0.0) + 0.3;
|
current_position[Z_AXIS] += (zdiff > 0.0 ? zdiff : 0.0) + 1;
|
||||||
planner.buffer_line_kinematic(current_position, planner.max_feedrate_mm_s[Z_AXIS], active_extruder);
|
planner.buffer_line_kinematic(current_position, planner.max_feedrate_mm_s[Z_AXIS], active_extruder);
|
||||||
move_nozzle_servo(tmp_extruder);
|
move_nozzle_servo(tmp_extruder);
|
||||||
#endif
|
#endif
|
||||||
@ -11585,6 +11585,11 @@ void tool_change(const uint8_t tmp_extruder, const float fr_mm_s/*=0.0*/, bool n
|
|||||||
|
|
||||||
#endif // !DUAL_X_CARRIAGE
|
#endif // !DUAL_X_CARRIAGE
|
||||||
|
|
||||||
|
#if ENABLED(SWITCHING_NOZZLE)
|
||||||
|
// The newly-selected extruder Z is actually at...
|
||||||
|
current_position[Z_AXIS] -= zdiff;
|
||||||
|
#endif
|
||||||
|
|
||||||
#if HAS_LEVELING
|
#if HAS_LEVELING
|
||||||
// Restore leveling to re-establish the logical position
|
// Restore leveling to re-establish the logical position
|
||||||
set_bed_leveling_enabled(leveling_was_active);
|
set_bed_leveling_enabled(leveling_was_active);
|
||||||
@ -11600,15 +11605,13 @@ void tool_change(const uint8_t tmp_extruder, const float fr_mm_s/*=0.0*/, bool n
|
|||||||
constexpr bool safe_to_move = true;
|
constexpr bool safe_to_move = true;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if ENABLED(SWITCHING_NOZZLE)
|
|
||||||
destination[Z_AXIS] += z_diff; // Include the Z restore with the "move back"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Raise, move, and lower again
|
// Raise, move, and lower again
|
||||||
if (safe_to_move && !no_move && IsRunning()) {
|
if (safe_to_move && !no_move && IsRunning()) {
|
||||||
|
#if DISABLED(SWITCHING_NOZZLE)
|
||||||
// Do a small lift to avoid the workpiece in the move back (below)
|
// Do a small lift to avoid the workpiece in the move back (below)
|
||||||
current_position[Z_AXIS] += 1.0;
|
current_position[Z_AXIS] += 1.0;
|
||||||
planner.buffer_line_kinematic(current_position, planner.max_feedrate_mm_s[Z_AXIS], active_extruder);
|
planner.buffer_line_kinematic(current_position, planner.max_feedrate_mm_s[Z_AXIS], active_extruder);
|
||||||
|
#endif
|
||||||
#if ENABLED(DEBUG_LEVELING_FEATURE)
|
#if ENABLED(DEBUG_LEVELING_FEATURE)
|
||||||
if (DEBUGGING(LEVELING)) DEBUG_POS("Move back", destination);
|
if (DEBUGGING(LEVELING)) DEBUG_POS("Move back", destination);
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user