|
@@ -88,9 +88,17 @@ void GcodeSuite::M701() {
|
88
|
88
|
tool_change(target_extruder, false);
|
89
|
89
|
#endif
|
90
|
90
|
|
91
|
|
- // Lift Z axis
|
92
|
|
- if (park_point.z > 0)
|
93
|
|
- do_blocking_move_to_z(_MIN(current_position.z + park_point.z, Z_MAX_POS), feedRate_t(NOZZLE_PARK_Z_FEEDRATE));
|
|
91
|
+ auto move_z_by = [](const_float_t zdist) {
|
|
92
|
+ if (zdist) {
|
|
93
|
+ destination = current_position;
|
|
94
|
+ destination.z += zdist;
|
|
95
|
+ prepare_internal_move_to_destination(NOZZLE_PARK_Z_FEEDRATE);
|
|
96
|
+ }
|
|
97
|
+ };
|
|
98
|
+
|
|
99
|
+ // Raise the Z axis (with max limit)
|
|
100
|
+ const float park_raise = _MIN(0, park_point.z, (Z_MAX_POS) - current_position.z);
|
|
101
|
+ move_z_by(park_raise);
|
94
|
102
|
|
95
|
103
|
// Load filament
|
96
|
104
|
#if HAS_PRUSA_MMU2
|
|
@@ -113,8 +121,7 @@ void GcodeSuite::M701() {
|
113
|
121
|
#endif
|
114
|
122
|
|
115
|
123
|
// Restore Z axis
|
116
|
|
- if (park_point.z > 0)
|
117
|
|
- do_blocking_move_to_z(_MAX(current_position.z - park_point.z, 0), feedRate_t(NOZZLE_PARK_Z_FEEDRATE));
|
|
124
|
+ move_z_by(-park_raise);
|
118
|
125
|
|
119
|
126
|
#if HAS_MULTI_EXTRUDER && (HAS_PRUSA_MMU1 || !HAS_MMU)
|
120
|
127
|
// Restore toolhead if it was changed
|