Skip to content

Commit b4d3e1d

Browse files
✨ More Nozzle Park move options (MarlinFirmware#23158)
Co-authored-by: Scott Lahteine <[email protected]>
1 parent 26e4f70 commit b4d3e1d

File tree

3 files changed

+17
-7
lines changed

3 files changed

+17
-7
lines changed

Marlin/Configuration.h

+1-2
Original file line numberDiff line numberDiff line change
@@ -1913,8 +1913,7 @@
19131913
#if ENABLED(NOZZLE_PARK_FEATURE)
19141914
// Specify a park position as { X, Y, Z_raise }
19151915
#define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 }
1916-
//#define NOZZLE_PARK_X_ONLY // X move only is required to park
1917-
//#define NOZZLE_PARK_Y_ONLY // Y move only is required to park
1916+
#define NOZZLE_PARK_MOVE 0 // Park motion: 0 = XY Move, 1 = X Only, 2 = Y Only, 3 = X before Y, 4 = Y before X
19181917
#define NOZZLE_PARK_Z_RAISE_MIN 2 // (mm) Always raise Z by at least this distance
19191918
#define NOZZLE_PARK_XY_FEEDRATE 100 // (mm/s) X and Y axes feedrate (also used for delta Z axis)
19201919
#define NOZZLE_PARK_Z_FEEDRATE 5 // (mm/s) Z axis feedrate (not used for delta printers)

Marlin/src/inc/SanityCheck.h

+4
Original file line numberDiff line numberDiff line change
@@ -609,6 +609,10 @@
609609
#error "LCD_SCREEN_ROT_270 is now LCD_SCREEN_ROTATE with a value of 270."
610610
#elif defined(DEFAULT_LCD_BRIGHTNESS)
611611
#error "DEFAULT_LCD_BRIGHTNESS is now LCD_BRIGHTNESS_DEFAULT."
612+
#elif defined(NOZZLE_PARK_X_ONLY)
613+
#error "NOZZLE_PARK_X_ONLY is now NOZZLE_PARK_MOVE 1."
614+
#elif defined(NOZZLE_PARK_Y_ONLY)
615+
#error "NOZZLE_PARK_X_ONLY is now NOZZLE_PARK_MOVE 2."
612616
#endif
613617

614618
constexpr float arm[] = AXIS_RELATIVE_MODES;

Marlin/src/libs/nozzle.cpp

+12-5
Original file line numberDiff line numberDiff line change
@@ -254,11 +254,18 @@ Nozzle nozzle;
254254
break;
255255
}
256256

257-
do_blocking_move_to_xy(
258-
TERN(NOZZLE_PARK_Y_ONLY, current_position, park).x,
259-
TERN(NOZZLE_PARK_X_ONLY, current_position, park).y,
260-
fr_xy
261-
);
257+
#ifndef NOZZLE_PARK_MOVE
258+
#define NOZZLE_PARK_MOVE 0
259+
#endif
260+
switch (NOZZLE_PARK_MOVE) {
261+
case 0: do_blocking_move_to_xy(park, fr_xy); break;
262+
case 1: do_blocking_move_to_x(park.x, fr_xy); break;
263+
case 2: do_blocking_move_to_y(park.y, fr_xy); break;
264+
case 3: do_blocking_move_to_x(park.x, fr_xy);
265+
do_blocking_move_to_y(park.y, fr_xy); break;
266+
case 4: do_blocking_move_to_y(park.y, fr_xy);
267+
do_blocking_move_to_x(park.x, fr_xy); break;
268+
}
262269

263270
report_current_position();
264271
}

0 commit comments

Comments
 (0)