Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
10 changes: 6 additions & 4 deletions Marlin/src/feature/pause.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 12 additions & 4 deletions Marlin/src/gcode/feature/pause/M701_M702.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,12 @@ void GcodeSuite::M701() {
#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));
if (park_point.z > 0) {
destination = current_position;
destination.z += park_point.z;
NOMORE(destination.z, Z_MAX_POS);
prepare_internal_move_to_destination(NOZZLE_PARK_Z_FEEDRATE);
}

// Load filament
#if HAS_PRUSA_MMU2
Expand All @@ -113,8 +117,12 @@ 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));
if (park_point.z > 0) {
destination = current_position;
destination.z -= park_point.z;
NOLESS(destination.z, 0);
prepare_internal_move_to_destination(NOZZLE_PARK_Z_FEEDRATE);
}

#if HAS_MULTI_EXTRUDER && (HAS_PRUSA_MMU1 || !HAS_MMU)
// Restore toolhead if it was changed
Expand Down
6 changes: 3 additions & 3 deletions Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -668,9 +668,9 @@ void MarlinUI::draw_status_screen() {
//

lcd.setCursor(0, 0);
_draw_axis_value(X_AXIS, ftostr4sign(LOGICAL_X_POSITION(current_position[X_AXIS])), blink); lcd.write(' ');
_draw_axis_value(Y_AXIS, ftostr4sign(LOGICAL_Y_POSITION(current_position[Y_AXIS])), blink); lcd.write(' ');
_draw_axis_value(Z_AXIS, ftostr52sp(LOGICAL_Z_POSITION(current_position[Z_AXIS])), blink);
_draw_axis_value(X_AXIS, ftostr4sign(LOGICAL_X_POSITION(current_position.x)), blink); lcd.write(' ');
_draw_axis_value(Y_AXIS, ftostr4sign(LOGICAL_Y_POSITION(current_position.y)), blink); lcd.write(' ');
_draw_axis_value(Z_AXIS, ftostr52sp(LOGICAL_Z_POSITION(current_position.z)), blink);

#if HAS_LEVELING && !HAS_HEATED_BED
lcd.write(planner.leveling_active || blink ? '_' : ' ');
Expand Down
12 changes: 10 additions & 2 deletions Marlin/src/lcd/extui/lib/dgus/mks/DGUSDisplayDef.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,17 @@ 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 = current_position.z + mks_park_pos.z;
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;

Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/lcd/extui/lib/mks_ui/draw_printing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ void disp_print_time() {

void disp_fan_Zpos() {
char str_1[16];
sprintf_P(public_buf_l, PSTR("%s"), dtostrf(current_position[Z_AXIS], 1, 3, str_1));
sprintf_P(public_buf_l, PSTR("%s"), dtostrf(current_position.z, 1, 3, str_1));
lv_label_set_text(labelZpos, public_buf_l);
}

Expand Down
10 changes: 5 additions & 5 deletions Marlin/src/lcd/extui/ui_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -870,19 +870,19 @@ namespace ExtUI {
const feedRate_t old_feedrate = feedrate_mm_s;
const float x_target = MESH_MIN_X + pos.x * (MESH_X_DIST),
y_target = MESH_MIN_Y + pos.y * (MESH_Y_DIST);
if (x_target != current_position[X_AXIS] || y_target != current_position[Y_AXIS]) {
if (x_target != current_position.x || y_target != current_position.y) {
// If moving across bed, raise nozzle to safe height over bed
feedrate_mm_s = Z_PROBE_FEEDRATE_FAST;
destination = current_position;
destination[Z_AXIS] = Z_CLEARANCE_BETWEEN_PROBES;
destination.z = Z_CLEARANCE_BETWEEN_PROBES;
prepare_line_to_destination();
feedrate_mm_s = XY_PROBE_FEEDRATE;
destination[X_AXIS] = x_target;
destination[Y_AXIS] = y_target;
destination.x = x_target;
destination.y = y_target;
prepare_line_to_destination();
}
feedrate_mm_s = Z_PROBE_FEEDRATE_FAST;
destination[Z_AXIS] = z;
destination.z = z;
prepare_line_to_destination();
feedrate_mm_s = old_feedrate;
#else
Expand Down
5 changes: 3 additions & 2 deletions Marlin/src/module/tool_change.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down