mirror of
https://github.com/MarlinFirmware/Marlin.git
synced 2025-01-22 17:52:57 +00:00
🐛 Fix Dual Servo Toolchange Z Creep (#27381)
This commit is contained in:
parent
6528109176
commit
b99a26d6ab
1 changed files with 11 additions and 11 deletions
|
@ -1225,8 +1225,6 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) {
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
TERN_(SWITCHING_NOZZLE_TWO_SERVOS, raise_nozzle(old_tool));
|
|
||||||
|
|
||||||
REMEMBER(fr, feedrate_mm_s, XY_PROBE_FEEDRATE_MM_S);
|
REMEMBER(fr, feedrate_mm_s, XY_PROBE_FEEDRATE_MM_S);
|
||||||
|
|
||||||
#if HAS_SOFTWARE_ENDSTOPS
|
#if HAS_SOFTWARE_ENDSTOPS
|
||||||
|
@ -1290,20 +1288,23 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) {
|
||||||
magnetic_switching_toolhead_tool_change(new_tool, no_move);
|
magnetic_switching_toolhead_tool_change(new_tool, no_move);
|
||||||
#elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) // Magnetic Switching ToolChanger
|
#elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) // Magnetic Switching ToolChanger
|
||||||
em_switching_toolhead_tool_change(new_tool, no_move);
|
em_switching_toolhead_tool_change(new_tool, no_move);
|
||||||
#elif ENABLED(SWITCHING_NOZZLE) && !SWITCHING_NOZZLE_TWO_SERVOS // Switching Nozzle (single servo)
|
#elif ENABLED(SWITCHING_NOZZLE) // Switching Nozzle
|
||||||
// Raise by a configured distance to avoid workpiece, except with
|
// Raise by a configured distance to avoid workpiece, except with
|
||||||
// SWITCHING_NOZZLE_TWO_SERVOS, as both nozzles will lift instead.
|
// SWITCHING_NOZZLE_TWO_SERVOS, as both nozzles will lift instead.
|
||||||
|
TERN_(SWITCHING_NOZZLE_TWO_SERVOS, raise_nozzle(old_tool));
|
||||||
if (!no_move) {
|
if (!no_move) {
|
||||||
const float newz = current_position.z + _MAX(-diff.z, 0.0);
|
const float newz = current_position.z + _MAX(-diff.z, 0.0);
|
||||||
|
|
||||||
// Check if Z has space to compensate at least z_offset, and if not, just abort now
|
// Check if Z has space to compensate at least z_offset, and if not, just abort now
|
||||||
const float maxz = _MIN(TERN(HAS_SOFTWARE_ENDSTOPS, soft_endstop.max.z, Z_MAX_POS), Z_MAX_POS);
|
const float maxz = _MIN(TERN(HAS_SOFTWARE_ENDSTOPS, soft_endstop.max.z, Z_MAX_POS), Z_MAX_POS);
|
||||||
if (newz > maxz) return;
|
if (newz > maxz) return;
|
||||||
|
|
||||||
current_position.z = _MIN(newz + toolchange_settings.z_raise, maxz);
|
current_position.z = _MIN(newz + toolchange_settings.z_raise, maxz);
|
||||||
fast_line_to_current(Z_AXIS);
|
fast_line_to_current(Z_AXIS);
|
||||||
}
|
}
|
||||||
move_nozzle_servo(new_tool);
|
#if SWITCHING_NOZZLE_TWO_SERVOS // Switching Nozzle with two servos
|
||||||
|
lower_nozzle(new_tool);
|
||||||
|
#else
|
||||||
|
move_nozzle_servo(new_tool);
|
||||||
|
#endif
|
||||||
#elif ANY(MECHANICAL_SWITCHING_EXTRUDER, MECHANICAL_SWITCHING_NOZZLE)
|
#elif ANY(MECHANICAL_SWITCHING_EXTRUDER, MECHANICAL_SWITCHING_NOZZLE)
|
||||||
if (!no_move) {
|
if (!no_move) {
|
||||||
current_position.z = _MIN(current_position.z + toolchange_settings.z_raise, _MIN(TERN(HAS_SOFTWARE_ENDSTOPS, soft_endstop.max.z, Z_MAX_POS), Z_MAX_POS));
|
current_position.z = _MIN(current_position.z + toolchange_settings.z_raise, _MIN(TERN(HAS_SOFTWARE_ENDSTOPS, soft_endstop.max.z, Z_MAX_POS), Z_MAX_POS));
|
||||||
|
@ -1372,7 +1373,7 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) {
|
||||||
#if ENABLED(TOOLCHANGE_PARK)
|
#if ENABLED(TOOLCHANGE_PARK)
|
||||||
if (toolchange_settings.enable_park) do_blocking_move_to_xy_z(destination, destination.z, MMM_TO_MMS(TOOLCHANGE_PARK_XY_FEEDRATE));
|
if (toolchange_settings.enable_park) do_blocking_move_to_xy_z(destination, destination.z, MMM_TO_MMS(TOOLCHANGE_PARK_XY_FEEDRATE));
|
||||||
#else
|
#else
|
||||||
do_blocking_move_to_xy(destination, planner.settings.max_feedrate_mm_s[X_AXIS]);
|
do_blocking_move_to_xy(destination, planner.settings.max_feedrate_mm_s[X_AXIS]* 0.5f);
|
||||||
|
|
||||||
// If using MECHANICAL_SWITCHING extruder/nozzle, set HOTEND_OFFSET in Z axis after running EVENT_GCODE_TOOLCHANGE below.
|
// If using MECHANICAL_SWITCHING extruder/nozzle, set HOTEND_OFFSET in Z axis after running EVENT_GCODE_TOOLCHANGE below.
|
||||||
#if NONE(MECHANICAL_SWITCHING_EXTRUDER, MECHANICAL_SWITCHING_NOZZLE)
|
#if NONE(MECHANICAL_SWITCHING_EXTRUDER, MECHANICAL_SWITCHING_NOZZLE)
|
||||||
|
@ -1405,7 +1406,7 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
TERN_(DUAL_X_CARRIAGE, idex_set_parked(false));
|
TERN_(DUAL_X_CARRIAGE, idex_set_parked(false));
|
||||||
}
|
} // should_move
|
||||||
|
|
||||||
#if HAS_SWITCHING_NOZZLE
|
#if HAS_SWITCHING_NOZZLE
|
||||||
// Move back down. (Including when the new tool is higher.)
|
// Move back down. (Including when the new tool is higher.)
|
||||||
|
@ -1413,8 +1414,6 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) {
|
||||||
do_blocking_move_to_z(destination.z, planner.settings.max_feedrate_mm_s[Z_AXIS]);
|
do_blocking_move_to_z(destination.z, planner.settings.max_feedrate_mm_s[Z_AXIS]);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
TERN_(SWITCHING_NOZZLE_TWO_SERVOS, lower_nozzle(new_tool));
|
|
||||||
|
|
||||||
} // (new_tool != old_tool)
|
} // (new_tool != old_tool)
|
||||||
|
|
||||||
planner.synchronize();
|
planner.synchronize();
|
||||||
|
@ -1510,7 +1509,8 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) {
|
||||||
if (TERN1(DUAL_X_CARRIAGE, dual_x_carriage_mode == DXC_AUTO_PARK_MODE))
|
if (TERN1(DUAL_X_CARRIAGE, dual_x_carriage_mode == DXC_AUTO_PARK_MODE))
|
||||||
gcode.process_subcommands_now(F(EVENT_GCODE_AFTER_TOOLCHANGE));
|
gcode.process_subcommands_now(F(EVENT_GCODE_AFTER_TOOLCHANGE));
|
||||||
#endif
|
#endif
|
||||||
}
|
|
||||||
|
} // !no_move
|
||||||
|
|
||||||
SERIAL_ECHOLNPGM(STR_ACTIVE_EXTRUDER, active_extruder);
|
SERIAL_ECHOLNPGM(STR_ACTIVE_EXTRUDER, active_extruder);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue