mirror of
https://github.com/MarlinFirmware/Marlin.git
synced 2024-12-18 00:07:50 +00:00
Make singlenozzle tool-change honor no_move (#12056)
...Set no move earlier so it applies
This commit is contained in:
parent
d332fcb8fa
commit
3cb5517ddb
@ -493,6 +493,13 @@ void tool_change(const uint8_t tmp_extruder, const float fr_mm_s/*=0.0*/, bool n
|
|||||||
if (tmp_extruder >= EXTRUDERS)
|
if (tmp_extruder >= EXTRUDERS)
|
||||||
return invalid_extruder_error(tmp_extruder);
|
return invalid_extruder_error(tmp_extruder);
|
||||||
|
|
||||||
|
if (!no_move && !all_axes_homed()) {
|
||||||
|
no_move = true;
|
||||||
|
#if ENABLED(DEBUG_LEVELING_FEATURE)
|
||||||
|
if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("No move on toolchange");
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
#if HOTENDS > 1
|
#if HOTENDS > 1
|
||||||
|
|
||||||
const float old_feedrate_mm_s = fr_mm_s > 0.0 ? fr_mm_s : feedrate_mm_s;
|
const float old_feedrate_mm_s = fr_mm_s > 0.0 ? fr_mm_s : feedrate_mm_s;
|
||||||
@ -500,12 +507,6 @@ void tool_change(const uint8_t tmp_extruder, const float fr_mm_s/*=0.0*/, bool n
|
|||||||
feedrate_mm_s = fr_mm_s > 0.0 ? fr_mm_s : XY_PROBE_FEEDRATE_MM_S;
|
feedrate_mm_s = fr_mm_s > 0.0 ? fr_mm_s : XY_PROBE_FEEDRATE_MM_S;
|
||||||
|
|
||||||
if (tmp_extruder != active_extruder) {
|
if (tmp_extruder != active_extruder) {
|
||||||
if (!no_move && axis_unhomed_error()) {
|
|
||||||
no_move = true;
|
|
||||||
#if ENABLED(DEBUG_LEVELING_FEATURE)
|
|
||||||
if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("No move on toolchange");
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
#if ENABLED(DUAL_X_CARRIAGE)
|
#if ENABLED(DUAL_X_CARRIAGE)
|
||||||
|
|
||||||
@ -647,7 +648,7 @@ void tool_change(const uint8_t tmp_extruder, const float fr_mm_s/*=0.0*/, bool n
|
|||||||
#if ENABLED(SINGLENOZZLE)
|
#if ENABLED(SINGLENOZZLE)
|
||||||
|
|
||||||
#if ENABLED(PREVENT_COLD_EXTRUSION)
|
#if ENABLED(PREVENT_COLD_EXTRUSION)
|
||||||
if (!DEBUGGING(DRYRUN) && thermalManager.targetTooColdToExtrude(active_extruder)) {
|
if ((!DEBUGGING(DRYRUN) && thermalManager.targetTooColdToExtrude(active_extruder)) || sn_settings.swap_length == 0) {
|
||||||
SERIAL_ERROR_START();
|
SERIAL_ERROR_START();
|
||||||
SERIAL_ERRORLNPGM(MSG_HOTEND_TOO_COLD);
|
SERIAL_ERRORLNPGM(MSG_HOTEND_TOO_COLD);
|
||||||
active_extruder = tmp_extruder;
|
active_extruder = tmp_extruder;
|
||||||
@ -660,7 +661,7 @@ void tool_change(const uint8_t tmp_extruder, const float fr_mm_s/*=0.0*/, bool n
|
|||||||
fan_speed[0] = singlenozzle_fan_speed[tmp_extruder];
|
fan_speed[0] = singlenozzle_fan_speed[tmp_extruder];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
set_destination_from_current();
|
if (!no_move) set_destination_from_current();
|
||||||
|
|
||||||
if (sn_settings.swap_length) {
|
if (sn_settings.swap_length) {
|
||||||
#if ENABLED(ADVANCED_PAUSE_FEATURE)
|
#if ENABLED(ADVANCED_PAUSE_FEATURE)
|
||||||
@ -671,21 +672,23 @@ void tool_change(const uint8_t tmp_extruder, const float fr_mm_s/*=0.0*/, bool n
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
current_position[Z_AXIS] += (
|
if (!no_move) {
|
||||||
|
current_position[Z_AXIS] += (
|
||||||
|
#if ENABLED(SINGLENOZZLE_SWAP_PARK)
|
||||||
|
singlenozzle_change_point.z
|
||||||
|
#else
|
||||||
|
SINGLENOZZLE_TOOLCHANGE_ZRAISE
|
||||||
|
#endif
|
||||||
|
);
|
||||||
|
|
||||||
|
planner.buffer_line(current_position, planner.settings.max_feedrate_mm_s[Z_AXIS], active_extruder);
|
||||||
|
|
||||||
#if ENABLED(SINGLENOZZLE_SWAP_PARK)
|
#if ENABLED(SINGLENOZZLE_SWAP_PARK)
|
||||||
singlenozzle_change_point.z
|
current_position[X_AXIS] = singlenozzle_change_point.x;
|
||||||
#else
|
current_position[Y_AXIS] = singlenozzle_change_point.y;
|
||||||
SINGLENOZZLE_TOOLCHANGE_ZRAISE
|
planner.buffer_line(current_position, MMM_TO_MMS(SINGLENOZZLE_PARK_XY_FEEDRATE), active_extruder);
|
||||||
#endif
|
#endif
|
||||||
);
|
}
|
||||||
|
|
||||||
planner.buffer_line(current_position, planner.settings.max_feedrate_mm_s[Z_AXIS], active_extruder);
|
|
||||||
|
|
||||||
#if ENABLED(SINGLENOZZLE_SWAP_PARK)
|
|
||||||
current_position[X_AXIS] = singlenozzle_change_point.x;
|
|
||||||
current_position[Y_AXIS] = singlenozzle_change_point.y;
|
|
||||||
planner.buffer_line(current_position, MMM_TO_MMS(SINGLENOZZLE_PARK_XY_FEEDRATE), active_extruder);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
singlenozzle_temp[active_extruder] = thermalManager.target_temperature[0];
|
singlenozzle_temp[active_extruder] = thermalManager.target_temperature[0];
|
||||||
if (singlenozzle_temp[tmp_extruder] && singlenozzle_temp[tmp_extruder] != singlenozzle_temp[active_extruder]) {
|
if (singlenozzle_temp[tmp_extruder] && singlenozzle_temp[tmp_extruder] != singlenozzle_temp[active_extruder]) {
|
||||||
@ -707,14 +710,15 @@ void tool_change(const uint8_t tmp_extruder, const float fr_mm_s/*=0.0*/, bool n
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#if ENABLED(SINGLENOZZLE_SWAP_PARK)
|
if (!no_move) {
|
||||||
current_position[X_AXIS] = destination[X_AXIS];
|
#if ENABLED(SINGLENOZZLE_SWAP_PARK)
|
||||||
current_position[Y_AXIS] = destination[Y_AXIS];
|
current_position[X_AXIS] = destination[X_AXIS];
|
||||||
planner.buffer_line(current_position, MMM_TO_MMS(SINGLENOZZLE_PARK_XY_FEEDRATE), active_extruder);
|
current_position[Y_AXIS] = destination[Y_AXIS];
|
||||||
#endif
|
planner.buffer_line(current_position, MMM_TO_MMS(SINGLENOZZLE_PARK_XY_FEEDRATE), active_extruder);
|
||||||
|
#endif
|
||||||
do_blocking_move_to(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS]);
|
|
||||||
|
|
||||||
|
do_blocking_move_to(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS]);
|
||||||
|
}
|
||||||
#else // !SINGLENOZZLE
|
#else // !SINGLENOZZLE
|
||||||
|
|
||||||
active_extruder = tmp_extruder;
|
active_extruder = tmp_extruder;
|
||||||
|
Loading…
Reference in New Issue
Block a user