From c39c55d75679bbbbf184a4dc4a236387b3019d52 Mon Sep 17 00:00:00 2001 From: Jason Smith Date: Thu, 31 Dec 2020 13:41:14 -0800 Subject: [PATCH 01/15] Do not move to UBL point before ubl_map_screen This allows for kinematic machines to search for a reachable point before trying to move the nozzle. --- Marlin/src/lcd/menu/menu_ubl.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/Marlin/src/lcd/menu/menu_ubl.cpp b/Marlin/src/lcd/menu/menu_ubl.cpp index eb19e96626c0..95159794a534 100644 --- a/Marlin/src/lcd/menu/menu_ubl.cpp +++ b/Marlin/src/lcd/menu/menu_ubl.cpp @@ -513,9 +513,6 @@ void _ubl_map_screen_homing() { if (all_axes_homed()) { ubl.lcd_map_control = true; // Return to the map screen after editing Z ui.goto_screen(ubl_map_screen, grid_index(x_plot, y_plot)); // Pre-set the encoder value - ui.manual_move.menu_scale = 0; // Immediate move - ubl_map_move_to_xy(); // Move to current mesh point - ui.manual_move.menu_scale = 1; // Delayed moves } } From 81b20bf502a0e7bdfe5a283e3bc4cf663e16bc36 Mon Sep 17 00:00:00 2001 From: Jason Smith Date: Thu, 31 Dec 2020 13:42:38 -0800 Subject: [PATCH 02/15] Fix AxisEnum type mismatch --- Marlin/src/lcd/marlinui.cpp | 12 ++++++------ Marlin/src/lcd/marlinui.h | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Marlin/src/lcd/marlinui.cpp b/Marlin/src/lcd/marlinui.cpp index fb37643cd2c8..3d35719604f5 100644 --- a/Marlin/src/lcd/marlinui.cpp +++ b/Marlin/src/lcd/marlinui.cpp @@ -687,7 +687,7 @@ void MarlinUI::quick_feedback(const bool clear_buttons/*=true*/) { TERN_(IS_KINEMATIC, float ManualMove::offset = 0); TERN_(IS_KINEMATIC, bool ManualMove::processing = false); TERN_(MULTI_MANUAL, int8_t ManualMove::e_index = 0); - uint8_t ManualMove::axis = (uint8_t)NO_AXIS; + AxisEnum ManualMove::axis = NO_AXIS; /** * If a manual move has been posted and its time has arrived, and if the planner @@ -713,9 +713,9 @@ void MarlinUI::quick_feedback(const bool clear_buttons/*=true*/) { if (processing) return; // Prevent re-entry from idle() calls // Add a manual move to the queue? - if (axis != (uint8_t)NO_AXIS && ELAPSED(millis(), start_time) && !planner.is_full()) { + if (axis != NO_AXIS && ELAPSED(millis(), start_time) && !planner.is_full()) { - const feedRate_t fr_mm_s = (uint8_t(axis) <= E_AXIS) ? manual_feedrate_mm_s[axis] : XY_PROBE_FEEDRATE_MM_S; + const feedRate_t fr_mm_s = (axis <= E_AXIS) ? manual_feedrate_mm_s[axis] : XY_PROBE_FEEDRATE_MM_S; #if IS_KINEMATIC @@ -730,7 +730,7 @@ void MarlinUI::quick_feedback(const bool clear_buttons/*=true*/) { // Reset for the next move offset = 0; - axis = (uint8_t)NO_AXIS; + axis = NO_AXIS; // DELTA and SCARA machines use segmented moves, which could fill the planner during the call to // move_to_destination. This will cause idle() to be called, which can then call this function while the @@ -749,7 +749,7 @@ void MarlinUI::quick_feedback(const bool clear_buttons/*=true*/) { //SERIAL_ECHOLNPAIR("Add planner.move with Axis ", int(axis), " at FR ", fr_mm_s); - axis = (uint8_t)NO_AXIS; + axis = NO_AXIS; #endif } @@ -767,7 +767,7 @@ void MarlinUI::quick_feedback(const bool clear_buttons/*=true*/) { if (move_axis == E_AXIS) e_index = eindex >= 0 ? eindex : active_extruder; #endif start_time = millis() + (menu_scale < 0.99f ? 0UL : 250UL); // delay for bigger moves - axis = (uint8_t)move_axis; + axis = move_axis; //SERIAL_ECHOLNPAIR("Post Move with Axis ", int(axis), " soon."); } diff --git a/Marlin/src/lcd/marlinui.h b/Marlin/src/lcd/marlinui.h index e162dbdd2e2c..97e401e55409 100644 --- a/Marlin/src/lcd/marlinui.h +++ b/Marlin/src/lcd/marlinui.h @@ -276,7 +276,7 @@ #else static int8_t constexpr e_index = 0; #endif - static uint8_t axis; + static AxisEnum axis; static void task(); static void soon(AxisEnum axis #if MULTI_MANUAL From 8a8340b47a7cfc73fad991247f509ac7c254062c Mon Sep 17 00:00:00 2001 From: Jason Smith Date: Thu, 31 Dec 2020 13:43:37 -0800 Subject: [PATCH 03/15] Minor cleanup --- Marlin/src/lcd/marlinui.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Marlin/src/lcd/marlinui.cpp b/Marlin/src/lcd/marlinui.cpp index 3d35719604f5..e81606f51e04 100644 --- a/Marlin/src/lcd/marlinui.cpp +++ b/Marlin/src/lcd/marlinui.cpp @@ -720,7 +720,7 @@ void MarlinUI::quick_feedback(const bool clear_buttons/*=true*/) { #if IS_KINEMATIC #if HAS_MULTI_EXTRUDER - const int8_t old_extruder = active_extruder; + REMEMBER(active_extruder); if (axis == E_AXIS) active_extruder = e_index; #endif @@ -740,8 +740,6 @@ void MarlinUI::quick_feedback(const bool clear_buttons/*=true*/) { prepare_internal_move_to_destination(fr_mm_s); // will set current_position from destination processing = false; - TERN_(HAS_MULTI_EXTRUDER, active_extruder = old_extruder); - #else // For Cartesian / Core motion simply move to the current_position From 7a5d5cd95e41f59d2be1cdf498bf8c6d846e7844 Mon Sep 17 00:00:00 2001 From: Jason Smith Date: Thu, 31 Dec 2020 13:44:01 -0800 Subject: [PATCH 04/15] Fix kinematic manual move corruption --- Marlin/src/lcd/marlinui.cpp | 10 ++++++++-- Marlin/src/lcd/marlinui.h | 7 +++++++ Marlin/src/lcd/menu/menu_ubl.cpp | 7 +++---- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/Marlin/src/lcd/marlinui.cpp b/Marlin/src/lcd/marlinui.cpp index e81606f51e04..5e04b122f18a 100644 --- a/Marlin/src/lcd/marlinui.cpp +++ b/Marlin/src/lcd/marlinui.cpp @@ -685,6 +685,7 @@ void MarlinUI::quick_feedback(const bool clear_buttons/*=true*/) { millis_t ManualMove::start_time = 0; float ManualMove::menu_scale = 1; TERN_(IS_KINEMATIC, float ManualMove::offset = 0); + TERN_(IS_KINEMATIC, xyze_pos_t ManualMove::all_axes_destination = {0}); TERN_(IS_KINEMATIC, bool ManualMove::processing = false); TERN_(MULTI_MANUAL, int8_t ManualMove::e_index = 0); AxisEnum ManualMove::axis = NO_AXIS; @@ -725,8 +726,13 @@ void MarlinUI::quick_feedback(const bool clear_buttons/*=true*/) { #endif // Apply a linear offset to a single axis - destination = current_position; - if (axis <= XYZE) destination[axis] += offset; + if (axis == ALL_AXES) { + destination = all_axes_destination; + } + else if (axis <= XYZE) { + destination = current_position; + destination[axis] += offset; + } // Reset for the next move offset = 0; diff --git a/Marlin/src/lcd/marlinui.h b/Marlin/src/lcd/marlinui.h index 97e401e55409..48ebafa60985 100644 --- a/Marlin/src/lcd/marlinui.h +++ b/Marlin/src/lcd/marlinui.h @@ -262,11 +262,18 @@ // Manual Movement class class ManualMove { + TERN_(IS_KINEMATIC, static xyze_pos_t all_axes_destination); public: static millis_t start_time; static float menu_scale; TERN_(IS_KINEMATIC, static float offset); #if IS_KINEMATIC + template + void set_destination(const T& dest) { + all_axes_destination = current_position; + all_axes_destination.set(dest); + } + static bool processing; #else static bool constexpr processing = false; diff --git a/Marlin/src/lcd/menu/menu_ubl.cpp b/Marlin/src/lcd/menu/menu_ubl.cpp index 95159794a534..f5ce9f781794 100644 --- a/Marlin/src/lcd/menu/menu_ubl.cpp +++ b/Marlin/src/lcd/menu/menu_ubl.cpp @@ -422,10 +422,9 @@ void ubl_map_move_to_xy() { } #endif - // Set the nozzle position to the mesh point - current_position.set(ubl.mesh_index_to_xpos(x_plot), ubl.mesh_index_to_ypos(y_plot)); - - // Use the built-in manual move handler + // Use the built-in manual move handler to move to the mesh point. + const xy_pos_t xy = { ubl.mesh_index_to_xpos(x_plot), ubl.mesh_index_to_ypos(y_plot) }; + ui.manual_move.set_destination(xy); ui.manual_move.soon(ALL_AXES); } From 91cc2af74e4259ece23efddd72f919b6d86cec4a Mon Sep 17 00:00:00 2001 From: Jason Smith Date: Thu, 31 Dec 2020 14:15:20 -0800 Subject: [PATCH 05/15] Add missing include --- Marlin/src/lcd/marlinui.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Marlin/src/lcd/marlinui.h b/Marlin/src/lcd/marlinui.h index 48ebafa60985..ecc5e92593ae 100644 --- a/Marlin/src/lcd/marlinui.h +++ b/Marlin/src/lcd/marlinui.h @@ -23,6 +23,8 @@ #include "../inc/MarlinConfig.h" +#include "../module/motion.h" + #if HAS_BUZZER #include "../libs/buzzer.h" #endif From be86cc54170bd6400c17ad9059b7bc53a37a5e0b Mon Sep 17 00:00:00 2001 From: Jason Smith Date: Thu, 31 Dec 2020 15:32:43 -0800 Subject: [PATCH 06/15] Fix Cartesian build --- Marlin/src/lcd/marlinui.h | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/Marlin/src/lcd/marlinui.h b/Marlin/src/lcd/marlinui.h index ecc5e92593ae..26b5ed0ca4bd 100644 --- a/Marlin/src/lcd/marlinui.h +++ b/Marlin/src/lcd/marlinui.h @@ -269,13 +269,19 @@ static millis_t start_time; static float menu_scale; TERN_(IS_KINEMATIC, static float offset); - #if IS_KINEMATIC - template - void set_destination(const T& dest) { + template + void set_destination(const T& dest) { + #if IS_KINEMATIC + // Moves are segmented, so the entire move is not submitted at once. + // Using a separate variable prevents corrupting the in-progress move. all_axes_destination = current_position; all_axes_destination.set(dest); - } - + #else + // Moves are submitted as single line to the planner using buffer_line. + current_position.set(dest); + #endif + } + #if IS_KINEMATIC static bool processing; #else static bool constexpr processing = false; From c5aac14ec1009acb3791b3baf66afc1dc0d2cdd2 Mon Sep 17 00:00:00 2001 From: Jason Smith Date: Thu, 31 Dec 2020 16:55:07 -0800 Subject: [PATCH 07/15] Fix move to initial mesh point. --- Marlin/src/lcd/menu/menu_ubl.cpp | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/Marlin/src/lcd/menu/menu_ubl.cpp b/Marlin/src/lcd/menu/menu_ubl.cpp index f5ce9f781794..32a38b7e692f 100644 --- a/Marlin/src/lcd/menu/menu_ubl.cpp +++ b/Marlin/src/lcd/menu/menu_ubl.cpp @@ -413,19 +413,22 @@ void _lcd_ubl_map_edit_cmd() { * UBL LCD Map Movement */ void ubl_map_move_to_xy() { + const xy_pos_t xy = { ubl.mesh_index_to_xpos(x_plot), ubl.mesh_index_to_ypos(y_plot) }; - #if ENABLED(DELTA) - if (current_position.z > delta_clip_start_height) { // Make sure the delta has fully free motion - destination = current_position; - destination.z = delta_clip_start_height; - prepare_internal_fast_move_to_destination(homing_feedrate(Z_AXIS)); // Set current_position from destination - } - #endif + // Some printers have unreachable areas in the mesh. Skip the move if unreachable. + if (position_is_reachable(xy)) { + #if ENABLED(DELTA) + if (current_position.z > delta_clip_start_height) { // Make sure the delta has fully free motion + destination = current_position; + destination.z = delta_clip_start_height; + prepare_internal_fast_move_to_destination(homing_feedrate(Z_AXIS)); // Set current_position from destination + } + #endif - // Use the built-in manual move handler to move to the mesh point. - const xy_pos_t xy = { ubl.mesh_index_to_xpos(x_plot), ubl.mesh_index_to_ypos(y_plot) }; - ui.manual_move.set_destination(xy); - ui.manual_move.soon(ALL_AXES); + // Use the built-in manual move handler to move to the mesh point. + ui.manual_move.set_destination(xy); + ui.manual_move.soon(ALL_AXES); + } } inline int32_t grid_index(const uint8_t x, const uint8_t y) { @@ -512,6 +515,9 @@ void _ubl_map_screen_homing() { if (all_axes_homed()) { ubl.lcd_map_control = true; // Return to the map screen after editing Z ui.goto_screen(ubl_map_screen, grid_index(x_plot, y_plot)); // Pre-set the encoder value + ui.manual_move.menu_scale = 0; // Immediate move + ubl_map_move_to_xy(); // Move to current mesh point + ui.manual_move.menu_scale = 1; // Delayed moves } } From 91f17acd61745b4096898674bae9670595d259b2 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 1 Jan 2021 18:50:42 -0600 Subject: [PATCH 08/15] Update marlinui.cpp --- Marlin/src/lcd/marlinui.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Marlin/src/lcd/marlinui.cpp b/Marlin/src/lcd/marlinui.cpp index 5e04b122f18a..f74effc2cdad 100644 --- a/Marlin/src/lcd/marlinui.cpp +++ b/Marlin/src/lcd/marlinui.cpp @@ -684,9 +684,11 @@ void MarlinUI::quick_feedback(const bool clear_buttons/*=true*/) { millis_t ManualMove::start_time = 0; float ManualMove::menu_scale = 1; - TERN_(IS_KINEMATIC, float ManualMove::offset = 0); - TERN_(IS_KINEMATIC, xyze_pos_t ManualMove::all_axes_destination = {0}); - TERN_(IS_KINEMATIC, bool ManualMove::processing = false); + #if IS_KINEMATIC + float ManualMove::offset = 0; + xyze_pos_t ManualMove::all_axes_destination = { 0 }; + bool ManualMove::processing = false; + #endif TERN_(MULTI_MANUAL, int8_t ManualMove::e_index = 0); AxisEnum ManualMove::axis = NO_AXIS; From c1e941e940a5c206bdb7ba2dbc77c77939df49f1 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 1 Jan 2021 19:00:24 -0600 Subject: [PATCH 09/15] privatize more --- Marlin/src/lcd/marlinui.h | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/Marlin/src/lcd/marlinui.h b/Marlin/src/lcd/marlinui.h index 26b5ed0ca4bd..a926dd58f45d 100644 --- a/Marlin/src/lcd/marlinui.h +++ b/Marlin/src/lcd/marlinui.h @@ -264,9 +264,16 @@ // Manual Movement class class ManualMove { + private: + static AxisEnum axis; + #if MULTI_MANUAL + static int8_t e_index; + #else + static int8_t constexpr e_index = 0; + #endif + static millis_t start_time; TERN_(IS_KINEMATIC, static xyze_pos_t all_axes_destination); public: - static millis_t start_time; static float menu_scale; TERN_(IS_KINEMATIC, static float offset); template @@ -286,12 +293,6 @@ #else static bool constexpr processing = false; #endif - #if MULTI_MANUAL - static int8_t e_index; - #else - static int8_t constexpr e_index = 0; - #endif - static AxisEnum axis; static void task(); static void soon(AxisEnum axis #if MULTI_MANUAL From c6dd3f76b416e4405b90c3477ce5bb51ef16a940 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 1 Jan 2021 19:06:41 -0600 Subject: [PATCH 10/15] tweak --- Marlin/src/lcd/marlinui.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Marlin/src/lcd/marlinui.cpp b/Marlin/src/lcd/marlinui.cpp index f74effc2cdad..1b962573c21b 100644 --- a/Marlin/src/lcd/marlinui.cpp +++ b/Marlin/src/lcd/marlinui.cpp @@ -728,9 +728,8 @@ void MarlinUI::quick_feedback(const bool clear_buttons/*=true*/) { #endif // Apply a linear offset to a single axis - if (axis == ALL_AXES) { + if (axis == ALL_AXES) destination = all_axes_destination; - } else if (axis <= XYZE) { destination = current_position; destination[axis] += offset; From c423a646ba3b23cb969b322d85bc27b2d5dc5c47 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 1 Jan 2021 19:23:13 -0600 Subject: [PATCH 11/15] fix remember --- Marlin/src/lcd/marlinui.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/lcd/marlinui.cpp b/Marlin/src/lcd/marlinui.cpp index 1b962573c21b..e59b72f47d8a 100644 --- a/Marlin/src/lcd/marlinui.cpp +++ b/Marlin/src/lcd/marlinui.cpp @@ -723,7 +723,7 @@ void MarlinUI::quick_feedback(const bool clear_buttons/*=true*/) { #if IS_KINEMATIC #if HAS_MULTI_EXTRUDER - REMEMBER(active_extruder); + REMEMBER(ae, active_extruder); if (axis == E_AXIS) active_extruder = e_index; #endif From 4cf46bfa66eea16014ae7df554f3920af7c615e6 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 1 Jan 2021 19:32:07 -0600 Subject: [PATCH 12/15] semi-related tweak --- Marlin/src/lcd/tft/ui_480x320.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Marlin/src/lcd/tft/ui_480x320.cpp b/Marlin/src/lcd/tft/ui_480x320.cpp index f7955fb1bd59..b6ffb4592f63 100644 --- a/Marlin/src/lcd/tft/ui_480x320.cpp +++ b/Marlin/src/lcd/tft/ui_480x320.cpp @@ -867,17 +867,16 @@ static void moveAxis(AxisEnum axis, const int8_t direction) { NOMORE(ui.manual_move.offset, max - current_position[axis]); #else current_position[axis] += diff; + const char *msg = PSTR(""); // clear the error if (direction < 0 && current_position[axis] < min) { current_position[axis] = min; - drawMessage(GET_TEXT(MSG_LCD_SOFT_ENDSTOPS)); + msg = GET_TEXT(MSG_LCD_SOFT_ENDSTOPS); } else if (direction > 0 && current_position[axis] > max) { current_position[axis] = max; - drawMessage(GET_TEXT(MSG_LCD_SOFT_ENDSTOPS)); - } - else { - drawMessage(""); // clear the error + msg = GET_TEXT(MSG_LCD_SOFT_ENDSTOPS); } + drawMessage(msg); #endif ui.manual_move.soon(axis From 38fb4c7db5a9046480acca124a058dca45bd6395 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 1 Jan 2021 20:01:53 -0600 Subject: [PATCH 13/15] Use prepare_internal_move_to_destination --- Marlin/src/feature/fwretract.cpp | 2 +- Marlin/src/lcd/marlinui.cpp | 15 ++++----------- Marlin/src/lcd/marlinui.h | 17 +---------------- Marlin/src/lcd/menu/menu_ubl.cpp | 26 ++++++++++++++------------ 4 files changed, 20 insertions(+), 40 deletions(-) diff --git a/Marlin/src/feature/fwretract.cpp b/Marlin/src/feature/fwretract.cpp index e5c52562a9ad..2a71af11d67d 100644 --- a/Marlin/src/feature/fwretract.cpp +++ b/Marlin/src/feature/fwretract.cpp @@ -139,7 +139,7 @@ void FWRetract::retract(const bool retracting if (retracting) { // Retract by moving from a faux E position back to the current E position current_retract[active_extruder] = base_retract; - prepare_internal_move_to_destination( // set current to destination + prepare_internal_move_to_destination( // set current from destination settings.retract_feedrate_mm_s * TERN1(RETRACT_SYNC_MIXING, (MIXING_STEPPERS)) ); diff --git a/Marlin/src/lcd/marlinui.cpp b/Marlin/src/lcd/marlinui.cpp index e59b72f47d8a..3c2f930e68ab 100644 --- a/Marlin/src/lcd/marlinui.cpp +++ b/Marlin/src/lcd/marlinui.cpp @@ -684,11 +684,8 @@ void MarlinUI::quick_feedback(const bool clear_buttons/*=true*/) { millis_t ManualMove::start_time = 0; float ManualMove::menu_scale = 1; - #if IS_KINEMATIC - float ManualMove::offset = 0; - xyze_pos_t ManualMove::all_axes_destination = { 0 }; - bool ManualMove::processing = false; - #endif + TERN_(IS_KINEMATIC, float ManualMove::offset = 0); + TERN_(IS_KINEMATIC, bool ManualMove::processing = false); TERN_(MULTI_MANUAL, int8_t ManualMove::e_index = 0); AxisEnum ManualMove::axis = NO_AXIS; @@ -728,12 +725,8 @@ void MarlinUI::quick_feedback(const bool clear_buttons/*=true*/) { #endif // Apply a linear offset to a single axis - if (axis == ALL_AXES) - destination = all_axes_destination; - else if (axis <= XYZE) { - destination = current_position; - destination[axis] += offset; - } + destination = current_position; + if (axis <= XYZE) destination[axis] += offset; // Reset for the next move offset = 0; diff --git a/Marlin/src/lcd/marlinui.h b/Marlin/src/lcd/marlinui.h index a926dd58f45d..6f9e636e4252 100644 --- a/Marlin/src/lcd/marlinui.h +++ b/Marlin/src/lcd/marlinui.h @@ -23,8 +23,6 @@ #include "../inc/MarlinConfig.h" -#include "../module/motion.h" - #if HAS_BUZZER #include "../libs/buzzer.h" #endif @@ -271,23 +269,10 @@ #else static int8_t constexpr e_index = 0; #endif - static millis_t start_time; - TERN_(IS_KINEMATIC, static xyze_pos_t all_axes_destination); public: + static millis_t start_time; static float menu_scale; TERN_(IS_KINEMATIC, static float offset); - template - void set_destination(const T& dest) { - #if IS_KINEMATIC - // Moves are segmented, so the entire move is not submitted at once. - // Using a separate variable prevents corrupting the in-progress move. - all_axes_destination = current_position; - all_axes_destination.set(dest); - #else - // Moves are submitted as single line to the planner using buffer_line. - current_position.set(dest); - #endif - } #if IS_KINEMATIC static bool processing; #else diff --git a/Marlin/src/lcd/menu/menu_ubl.cpp b/Marlin/src/lcd/menu/menu_ubl.cpp index 32a38b7e692f..001ee48b6218 100644 --- a/Marlin/src/lcd/menu/menu_ubl.cpp +++ b/Marlin/src/lcd/menu/menu_ubl.cpp @@ -416,19 +416,21 @@ void ubl_map_move_to_xy() { const xy_pos_t xy = { ubl.mesh_index_to_xpos(x_plot), ubl.mesh_index_to_ypos(y_plot) }; // Some printers have unreachable areas in the mesh. Skip the move if unreachable. - if (position_is_reachable(xy)) { - #if ENABLED(DELTA) - if (current_position.z > delta_clip_start_height) { // Make sure the delta has fully free motion - destination = current_position; - destination.z = delta_clip_start_height; - prepare_internal_fast_move_to_destination(homing_feedrate(Z_AXIS)); // Set current_position from destination - } - #endif + if (!position_is_reachable(xy)) return; - // Use the built-in manual move handler to move to the mesh point. - ui.manual_move.set_destination(xy); - ui.manual_move.soon(ALL_AXES); - } + #if ENABLED(DELTA) + if (current_position.z > delta_clip_start_height) { // Make sure the delta has fully free motion + destination = current_position; + destination.z = delta_clip_start_height; + prepare_internal_fast_move_to_destination(homing_feedrate(Z_AXIS)); // Set current_position from destination + } + #endif + + // Set the nozzle position to the mesh point + destination.set(ubl.mesh_index_to_xpos(x_plot), ubl.mesh_index_to_ypos(y_plot)); + + constexpr feedRate_t fr_mm_s = MMM_TO_MMS(XY_PROBE_SPEED); + prepare_internal_move_to_destination(fr_mm_s); // Set current_position from destination } inline int32_t grid_index(const uint8_t x, const uint8_t y) { From 9a69b971d4a2899bcd82c9af75d58ae7725fa406 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 1 Jan 2021 20:03:43 -0600 Subject: [PATCH 14/15] etc --- Marlin/src/lcd/marlinui.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/lcd/marlinui.h b/Marlin/src/lcd/marlinui.h index 6f9e636e4252..d7285927a305 100644 --- a/Marlin/src/lcd/marlinui.h +++ b/Marlin/src/lcd/marlinui.h @@ -269,8 +269,8 @@ #else static int8_t constexpr e_index = 0; #endif - public: static millis_t start_time; + public: static float menu_scale; TERN_(IS_KINEMATIC, static float offset); #if IS_KINEMATIC From ee24d11a19051eea405728862252cd826c57e355 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 1 Jan 2021 20:04:56 -0600 Subject: [PATCH 15/15] update comment --- Marlin/src/lcd/menu/menu_ubl.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Marlin/src/lcd/menu/menu_ubl.cpp b/Marlin/src/lcd/menu/menu_ubl.cpp index 001ee48b6218..9b7841671792 100644 --- a/Marlin/src/lcd/menu/menu_ubl.cpp +++ b/Marlin/src/lcd/menu/menu_ubl.cpp @@ -426,9 +426,8 @@ void ubl_map_move_to_xy() { } #endif - // Set the nozzle position to the mesh point + // Do an internal move to the mesh point destination.set(ubl.mesh_index_to_xpos(x_plot), ubl.mesh_index_to_ypos(y_plot)); - constexpr feedRate_t fr_mm_s = MMM_TO_MMS(XY_PROBE_SPEED); prepare_internal_move_to_destination(fr_mm_s); // Set current_position from destination }