Przeglądaj źródła

Option to set manual Babystepping distance in mm (#18503)

Co-authored-by: Scott Lahteine <github@thinkyhead.com>
cbteeple 4 lat temu
rodzic
commit
2c15a787c7
No account linked to committer's email address

+ 3
- 2
Marlin/Configuration_adv.h Wyświetl plik

@@ -1553,8 +1553,9 @@
1553 1553
   //#define BABYSTEP_WITHOUT_HOMING
1554 1554
   //#define BABYSTEP_XY                     // Also enable X/Y Babystepping. Not supported on DELTA!
1555 1555
   #define BABYSTEP_INVERT_Z false           // Change if Z babysteps should go the other way
1556
-  #define BABYSTEP_MULTIPLICATOR_Z  1       // Babysteps are very small. Increase for faster motion.
1557
-  #define BABYSTEP_MULTIPLICATOR_XY 1
1556
+  //#define BABYSTEP_MILLIMETER_UNITS       // Specify BABYSTEP_MULTIPLICATOR_(XY|Z) in mm instead of micro-steps
1557
+  #define BABYSTEP_MULTIPLICATOR_Z  1       // (steps or mm) Steps or millimeter distance for each Z babystep
1558
+  #define BABYSTEP_MULTIPLICATOR_XY 1       // (steps or mm) Steps or millimeter distance for each XY babystep
1558 1559
 
1559 1560
   //#define DOUBLECLICK_FOR_Z_BABYSTEPPING  // Double-click on the Status Screen for Z Babystepping.
1560 1561
   #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING)

+ 1
- 1
Marlin/src/lcd/menu/menu.cpp Wyświetl plik

@@ -343,7 +343,7 @@ void scroll_screen(const uint8_t limit, const bool is_menu) {
343 343
     ui.defer_status_screen();
344 344
     const bool do_probe = DISABLED(BABYSTEP_HOTEND_Z_OFFSET) || active_extruder == 0;
345 345
     if (ui.encoderPosition) {
346
-      const int16_t babystep_increment = int16_t(ui.encoderPosition) * (BABYSTEP_MULTIPLICATOR_Z);
346
+      const int16_t babystep_increment = int16_t(ui.encoderPosition) * (BABYSTEP_SIZE_Z);
347 347
       ui.encoderPosition = 0;
348 348
 
349 349
       const float diff = planner.steps_to_mm[Z_AXIS] * babystep_increment,

+ 11
- 0
Marlin/src/lcd/menu/menu.h Wyświetl plik

@@ -587,6 +587,17 @@ void _lcd_draw_homing();
587 587
   #else
588 588
     void lcd_babystep_z();
589 589
   #endif
590
+
591
+  #if ENABLED(BABYSTEP_MILLIMETER_UNITS)
592
+    #define BABYSTEP_SIZE_X int32_t((BABYSTEP_MULTIPLICATOR_XY) * planner.settings.axis_steps_per_mm[X_AXIS])
593
+    #define BABYSTEP_SIZE_Y int32_t((BABYSTEP_MULTIPLICATOR_XY) * planner.settings.axis_steps_per_mm[Y_AXIS])
594
+    #define BABYSTEP_SIZE_Z int32_t((BABYSTEP_MULTIPLICATOR_Z)  * planner.settings.axis_steps_per_mm[Z_AXIS])
595
+  #else
596
+    #define BABYSTEP_SIZE_X BABYSTEP_MULTIPLICATOR_XY
597
+    #define BABYSTEP_SIZE_Y BABYSTEP_MULTIPLICATOR_XY
598
+    #define BABYSTEP_SIZE_Z BABYSTEP_MULTIPLICATOR_Z
599
+  #endif
600
+
590 601
 #endif
591 602
 
592 603
 #if ENABLED(POWER_LOSS_RECOVERY)

+ 3
- 2
Marlin/src/lcd/menu/menu_tune.cpp Wyświetl plik

@@ -55,9 +55,10 @@
55 55
     if (ui.encoderPosition) {
56 56
       const int16_t steps = int16_t(ui.encoderPosition) * (
57 57
         #if ENABLED(BABYSTEP_XY)
58
-          axis != Z_AXIS ? BABYSTEP_MULTIPLICATOR_XY :
58
+          axis == X_AXIS ? BABYSTEP_SIZE_X :
59
+          axis == Y_AXIS ? BABYSTEP_SIZE_Y :
59 60
         #endif
60
-        BABYSTEP_MULTIPLICATOR_Z
61
+        BABYSTEP_SIZE_Z
61 62
       );
62 63
       ui.encoderPosition = 0;
63 64
       ui.refresh(LCDVIEW_REDRAW_NOW);

Ładowanie…
Anuluj
Zapisz