From ae6b34cfd0977ff258e60fec66eac724c41d65f0 Mon Sep 17 00:00:00 2001 From: studiodyne Date: Fri, 24 Apr 2020 21:39:26 +0200 Subject: [PATCH 1/4] Nozzle park x/y only axis --- Marlin/Configuration.h | 2 ++ Marlin/src/libs/nozzle.cpp | 9 ++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 2804d8ffef3e..03b50c2c4744 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -1501,6 +1501,8 @@ #if ENABLED(NOZZLE_PARK_FEATURE) // Specify a park position as { X, Y, Z_raise } #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 } + //#define NOZZLE_PARK_X_ONLY + //#define NOZZLE_PARK_Y_ONLY #define NOZZLE_PARK_XY_FEEDRATE 100 // (mm/s) X and Y axes feedrate (also used for delta Z axis) #define NOZZLE_PARK_Z_FEEDRATE 5 // (mm/s) Z axis feedrate (not used for delta printers) #endif diff --git a/Marlin/src/libs/nozzle.cpp b/Marlin/src/libs/nozzle.cpp index c691a7db3beb..052820952d52 100644 --- a/Marlin/src/libs/nozzle.cpp +++ b/Marlin/src/libs/nozzle.cpp @@ -181,7 +181,14 @@ Nozzle nozzle; do_blocking_move_to_z(_MAX(park.z, current_position.z), fr_z); } - do_blocking_move_to_xy(park, fr_xy); + #if EITHER(NOZZLE_PARK_X_ONLY , NOZZLE_PARK_Y_ONLY ) + xyz_pos_t park_ = park ; + TERN_( NOZZLE_PARK_X_ONLY, park_.y = current_position.y ); + TERN_( NOZZLE_PARK_Y_ONLY, park_.x = current_position.x ); + do_blocking_move_to_xy(park_ , fr_xy) ; + #else + do_blocking_move_to_xy(park_, fr_xy) ; + #endif report_current_position(); } From 8ba33e9f5cfea0171ae986e2e9680b18dd19a1ec Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 24 Apr 2020 23:11:01 -0500 Subject: [PATCH 2/4] Update nozzle.cpp --- Marlin/src/libs/nozzle.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/Marlin/src/libs/nozzle.cpp b/Marlin/src/libs/nozzle.cpp index 052820952d52..17cc626c9566 100644 --- a/Marlin/src/libs/nozzle.cpp +++ b/Marlin/src/libs/nozzle.cpp @@ -181,14 +181,10 @@ Nozzle nozzle; do_blocking_move_to_z(_MAX(park.z, current_position.z), fr_z); } - #if EITHER(NOZZLE_PARK_X_ONLY , NOZZLE_PARK_Y_ONLY ) - xyz_pos_t park_ = park ; - TERN_( NOZZLE_PARK_X_ONLY, park_.y = current_position.y ); - TERN_( NOZZLE_PARK_Y_ONLY, park_.x = current_position.x ); - do_blocking_move_to_xy(park_ , fr_xy) ; - #else - do_blocking_move_to_xy(park_, fr_xy) ; - #endif + xyz_pos_t park_ = park; + TERN_(NOZZLE_PARK_X_ONLY, park_.y = current_position.y); + TERN_(NOZZLE_PARK_Y_ONLY, park_.x = current_position.x); + do_blocking_move_to_xy(park_, fr_xy); report_current_position(); } From 4fff31cc79c6245aef6e1957fa921e3a93a5296e Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 24 Apr 2020 23:14:35 -0500 Subject: [PATCH 3/4] Update nozzle.cpp --- Marlin/src/libs/nozzle.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Marlin/src/libs/nozzle.cpp b/Marlin/src/libs/nozzle.cpp index 17cc626c9566..d19dfdd61759 100644 --- a/Marlin/src/libs/nozzle.cpp +++ b/Marlin/src/libs/nozzle.cpp @@ -181,10 +181,11 @@ Nozzle nozzle; do_blocking_move_to_z(_MAX(park.z, current_position.z), fr_z); } - xyz_pos_t park_ = park; - TERN_(NOZZLE_PARK_X_ONLY, park_.y = current_position.y); - TERN_(NOZZLE_PARK_Y_ONLY, park_.x = current_position.x); - do_blocking_move_to_xy(park_, fr_xy); + do_blocking_move_to_xy( + TERN(NOZZLE_PARK_Y_ONLY, current_position, park).x, + TERN(NOZZLE_PARK_X_ONLY, current_position, park).y, + fr_xy + ); report_current_position(); } From 6fdb63856550082b94e92f6f4809ded119a1ba1c Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 25 Apr 2020 10:42:19 -0500 Subject: [PATCH 4/4] Update Configuration.h --- Marlin/Configuration.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index cd24764c2452..a69cecf4a03b 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -1501,11 +1501,9 @@ #if ENABLED(NOZZLE_PARK_FEATURE) // Specify a park position as { X, Y, Z_raise } #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 } - //#define NOZZLE_PARK_X_ONLY - //#define NOZZLE_PARK_Y_ONLY - + //#define NOZZLE_PARK_X_ONLY // X move only is required to park + //#define NOZZLE_PARK_Y_ONLY // Y move only is required to park #define NOZZLE_PARK_Z_RAISE_MIN 2 // (mm) Always raise Z by at least this distance - #define NOZZLE_PARK_XY_FEEDRATE 100 // (mm/s) X and Y axes feedrate (also used for delta Z axis) #define NOZZLE_PARK_Z_FEEDRATE 5 // (mm/s) Z axis feedrate (not used for delta printers) #endif