From ca105493aa1cf5098e8ecac52197683d2de4bd17 Mon Sep 17 00:00:00 2001 From: Mathew Winters Date: Sun, 23 Aug 2020 09:20:37 +1200 Subject: [PATCH] NOZZLE_CLEAN_NO_Y (#18870) --- Marlin/Configuration.h | 5 ++++- Marlin/src/libs/nozzle.cpp | 15 ++++++++++++--- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 2639bcd97b..d23b69c02b 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -1604,9 +1604,12 @@ // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK - // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + // For a purge/clean station that's always at the gantry height (thus no Z move) //#define NOZZLE_CLEAN_NO_Z + // For a purge/clean station mounted on the X axis + //#define NOZZLE_CLEAN_NO_Y + // Explicit wipe G-code script applies to a G12 with no arguments. //#define WIPE_SEQUENCE_COMMANDS "G1 X-17 Y25 Z10 F4000\nG1 Z1\nM114\nG1 X-17 Y25\nG1 X-17 Y95\nG1 X-17 Y25\nG1 X-17 Y95\nG1 X-17 Y25\nG1 X-17 Y95\nG1 X-17 Y25\nG1 X-17 Y95\nG1 X-17 Y25\nG1 X-17 Y95\nG1 X-17 Y25\nG1 X-17 Y95\nG1 Z15\nM400\nG0 X-10.0 Y-9.0" diff --git a/Marlin/src/libs/nozzle.cpp b/Marlin/src/libs/nozzle.cpp index 21e6ffb7cd..f93e552481 100644 --- a/Marlin/src/libs/nozzle.cpp +++ b/Marlin/src/libs/nozzle.cpp @@ -46,15 +46,24 @@ Nozzle nozzle; // Move to the starting point #if ENABLED(NOZZLE_CLEAN_NO_Z) - do_blocking_move_to_xy(start); + #if ENABLED(NOZZLE_CLEAN_NO_Y) + do_blocking_move_to_x(start.x); + #else + do_blocking_move_to_xy(start); + #endif #else do_blocking_move_to(start); #endif // Start the stroke pattern LOOP_L_N(i, strokes >> 1) { - do_blocking_move_to_xy(end); - do_blocking_move_to_xy(start); + #if ENABLED(NOZZLE_CLEAN_NO_Y) + do_blocking_move_to_x(end.x); + do_blocking_move_to_x(start.x); + #else + do_blocking_move_to_xy(end); + do_blocking_move_to_xy(start); + #endif } TERN_(NOZZLE_CLEAN_GOBACK, do_blocking_move_to(oldpos));