Browse Source

✨ More Nozzle Park move options (#23158)

Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
John Robertson 2 years ago
parent
commit
b4d3e1da34
No account linked to committer's email address
3 changed files with 17 additions and 7 deletions
  1. 1
    2
      Marlin/Configuration.h
  2. 4
    0
      Marlin/src/inc/SanityCheck.h
  3. 12
    5
      Marlin/src/libs/nozzle.cpp

+ 1
- 2
Marlin/Configuration.h View File

@@ -1913,8 +1913,7 @@
1913 1913
 #if ENABLED(NOZZLE_PARK_FEATURE)
1914 1914
   // Specify a park position as { X, Y, Z_raise }
1915 1915
   #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
1918 1917
   #define NOZZLE_PARK_Z_RAISE_MIN   2   // (mm) Always raise Z by at least this distance
1919 1918
   #define NOZZLE_PARK_XY_FEEDRATE 100   // (mm/s) X and Y axes feedrate (also used for delta Z axis)
1920 1919
   #define NOZZLE_PARK_Z_FEEDRATE    5   // (mm/s) Z axis feedrate (not used for delta printers)

+ 4
- 0
Marlin/src/inc/SanityCheck.h View File

@@ -609,6 +609,10 @@
609 609
   #error "LCD_SCREEN_ROT_270 is now LCD_SCREEN_ROTATE with a value of 270."
610 610
 #elif defined(DEFAULT_LCD_BRIGHTNESS)
611 611
   #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."
612 616
 #endif
613 617
 
614 618
 constexpr float arm[] = AXIS_RELATIVE_MODES;

+ 12
- 5
Marlin/src/libs/nozzle.cpp View File

@@ -254,11 +254,18 @@ Nozzle nozzle;
254 254
         break;
255 255
     }
256 256
 
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
+    }
262 269
 
263 270
     report_current_position();
264 271
   }

Loading…
Cancel
Save