1
0
mirror of https://github.com/MarlinFirmware/Marlin.git synced 2024-11-27 13:56:24 +00:00

Fix Resume Print with UBL (#21564)

Co-authored-by: Scott Lahteine <github@thinkyhead.com>
This commit is contained in:
espr14 2021-04-13 03:10:21 +02:00 committed by Scott Lahteine
parent 5ab64708c5
commit fb7bdabb70
4 changed files with 32 additions and 13 deletions

View File

@ -597,11 +597,13 @@ void resume_print(const_float_t slow_load_length/*=0*/, const_float_t fast_load_
unscaled_e_move(-(PAUSE_PARK_RETRACT_LENGTH), feedRate_t(PAUSE_PARK_RETRACT_FEEDRATE));
if (!axes_should_home()) {
// Move XY to starting position, then Z
do_blocking_move_to_xy(resume_position, feedRate_t(NOZZLE_PARK_XY_FEEDRATE));
// Move XY back to saved position
destination.set(resume_position.x, resume_position.y, current_position.z);
prepare_internal_move_to_destination(NOZZLE_PARK_XY_FEEDRATE);
// Move Z_AXIS to saved position
do_blocking_move_to_z(resume_position.z, feedRate_t(NOZZLE_PARK_Z_FEEDRATE));
// Move Z back to saved position
destination.z = resume_position.z;
prepare_internal_move_to_destination(NOZZLE_PARK_Z_FEEDRATE);
}
// Unretract

View File

@ -88,9 +88,17 @@ void GcodeSuite::M701() {
tool_change(target_extruder, false);
#endif
// Lift Z axis
if (park_point.z > 0)
do_blocking_move_to_z(_MIN(current_position.z + park_point.z, Z_MAX_POS), feedRate_t(NOZZLE_PARK_Z_FEEDRATE));
auto move_z_by = [](const_float_t zdist) {
if (zdist) {
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
#if HAS_PRUSA_MMU2
@ -113,8 +121,7 @@ void GcodeSuite::M701() {
#endif
// Restore Z axis
if (park_point.z > 0)
do_blocking_move_to_z(_MAX(current_position.z - park_point.z, 0), feedRate_t(NOZZLE_PARK_Z_FEEDRATE));
move_z_by(-park_raise);
#if HAS_MULTI_EXTRUDER && (HAS_PRUSA_MMU1 || !HAS_MMU)
// Restore toolhead if it was changed

View File

@ -75,9 +75,18 @@ xyz_pos_t position_before_pause;
void MKS_pause_print_move() {
queue.exhaust();
position_before_pause = current_position;
do_blocking_move_to(X_MIN_POS + mks_park_pos.x, Y_MIN_POS + mks_park_pos.y, current_position.z + mks_park_pos.z);
destination.z = _MIN(current_position.z + mks_park_pos.z, Z_MAX_POS);
prepare_internal_move_to_destination(NOZZLE_PARK_Z_FEEDRATE);
destination.set(X_MIN_POS + mks_park_pos.x, Y_MIN_POS + mks_park_pos.y);
prepare_internal_move_to_destination(NOZZLE_PARK_XY_FEEDRATE);
}
void MKS_resume_print_move() {
destination.set(position_before_pause.x, position_before_pause.y);
prepare_internal_move_to_destination(NOZZLE_PARK_XY_FEEDRATE);
destination.z = position_before_pause.z;
prepare_internal_move_to_destination(NOZZLE_PARK_Z_FEEDRATE);
}
void MKS_resume_print_move() { do_blocking_move_to(position_before_pause); }
float z_offset_add = 0;

View File

@ -836,9 +836,10 @@ inline void fast_line_to_current(const AxisEnum fr_axis) { _line_to_current(fr_a
#if ENABLED(TOOLCHANGE_PARK)
if (ok) {
#if ENABLED(TOOLCHANGE_NO_RETURN)
do_blocking_move_to_z(destination.z, planner.settings.max_feedrate_mm_s[Z_AXIS]);
destination.set(current_position.x, current_position.y);
prepare_internal_move_to_destination(planner.settings.max_feedrate_mm_s[Z_AXIS]);
#else
do_blocking_move_to(destination, MMM_TO_MMS(TOOLCHANGE_PARK_XY_FEEDRATE));
prepare_internal_move_to_destination(MMM_TO_MMS(TOOLCHANGE_PARK_XY_FEEDRATE));
#endif
}
#endif