Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #23540, Eliminate unwanted Z movement when parking head #23568

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions Marlin/src/feature/pause.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@
#include "../module/printcounter.h"
#include "../module/temperature.h"

#if ENABLED(AUTO_BED_LEVELING_UBL)
#include "bedlevel/bedlevel.h"
#endif

#if ENABLED(FWRETRACT)
#include "fwretract.h"
#endif
Expand Down Expand Up @@ -440,7 +444,15 @@ bool pause_print(const_float_t retract, const xyz_pos_t &park_point, const bool
// Initial retract before move to filament change position
if (retract && thermalManager.hotEnoughToExtrude(active_extruder)) {
DEBUG_ECHOLNPGM("... retract:", retract);

#if ENABLED(AUTO_BED_LEVELING_UBL)
const bool leveling_was_enabled = planner.leveling_active; // save leveling state
set_bed_leveling_enabled(false); // turn off leveling
#endif

unscaled_e_move(retract, PAUSE_PARK_RETRACT_FEEDRATE);

TERN_(AUTO_BED_LEVELING_UBL, set_bed_leveling_enabled(leveling_was_enabled)); // restore leveling
}

// If axes don't need to home then the nozzle can park
Expand Down Expand Up @@ -640,9 +652,16 @@ void resume_print(const_float_t slow_load_length/*=0*/, const_float_t fast_load_
prepare_internal_move_to_destination(NOZZLE_PARK_Z_FEEDRATE);
}

#if ENABLED(AUTO_BED_LEVELING_UBL)
const bool leveling_was_enabled = planner.leveling_active; // save leveling state
set_bed_leveling_enabled(false); // turn off leveling
#endif

// Unretract
unscaled_e_move(PAUSE_PARK_RETRACT_LENGTH, feedRate_t(PAUSE_PARK_RETRACT_FEEDRATE));

TERN_(AUTO_BED_LEVELING_UBL, set_bed_leveling_enabled(leveling_was_enabled)); // restore leveling

// Intelligent resuming
#if ENABLED(FWRETRACT)
// If retracted before goto pause
Expand Down