|
@ -88,9 +88,17 @@ void GcodeSuite::M701() { |
|
|
tool_change(target_extruder, false); |
|
|
tool_change(target_extruder, false); |
|
|
#endif |
|
|
#endif |
|
|
|
|
|
|
|
|
// Lift Z axis
|
|
|
auto move_z_by = [](const_float_t zdist) { |
|
|
if (park_point.z > 0) |
|
|
if (zdist) { |
|
|
do_blocking_move_to_z(_MIN(current_position.z + park_point.z, Z_MAX_POS), feedRate_t(NOZZLE_PARK_Z_FEEDRATE)); |
|
|
destination = current_position; |
|
|
|
|
|
destination.z += zdist; |
|
|
|
|
|
prepare_internal_move_to_destination(NOZZLE_PARK_Z_FEEDRATE); |
|
|
|
|
|
} |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
// Raise the Z axis (with max limit)
|
|
|
|
|
|
const float park_raise = _MIN(0, park_point.z, (Z_MAX_POS) - current_position.z); |
|
|
|
|
|
move_z_by(park_raise); |
|
|
|
|
|
|
|
|
// Load filament
|
|
|
// Load filament
|
|
|
#if HAS_PRUSA_MMU2 |
|
|
#if HAS_PRUSA_MMU2 |
|
@ -113,8 +121,7 @@ void GcodeSuite::M701() { |
|
|
#endif |
|
|
#endif |
|
|
|
|
|
|
|
|
// Restore Z axis
|
|
|
// Restore Z axis
|
|
|
if (park_point.z > 0) |
|
|
move_z_by(-park_raise); |
|
|
do_blocking_move_to_z(_MAX(current_position.z - park_point.z, 0), feedRate_t(NOZZLE_PARK_Z_FEEDRATE)); |
|
|
|
|
|
|
|
|
|
|
|
#if HAS_MULTI_EXTRUDER && (HAS_PRUSA_MMU1 || !HAS_MMU) |
|
|
#if HAS_MULTI_EXTRUDER && (HAS_PRUSA_MMU1 || !HAS_MMU) |
|
|
// Restore toolhead if it was changed
|
|
|
// Restore toolhead if it was changed
|
|
|