Browse Source

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

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

+ 3
- 2
Marlin/Configuration_adv.h View File

1553
   //#define BABYSTEP_WITHOUT_HOMING
1553
   //#define BABYSTEP_WITHOUT_HOMING
1554
   //#define BABYSTEP_XY                     // Also enable X/Y Babystepping. Not supported on DELTA!
1554
   //#define BABYSTEP_XY                     // Also enable X/Y Babystepping. Not supported on DELTA!
1555
   #define BABYSTEP_INVERT_Z false           // Change if Z babysteps should go the other way
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
   //#define DOUBLECLICK_FOR_Z_BABYSTEPPING  // Double-click on the Status Screen for Z Babystepping.
1560
   //#define DOUBLECLICK_FOR_Z_BABYSTEPPING  // Double-click on the Status Screen for Z Babystepping.
1560
   #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING)
1561
   #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING)

+ 1
- 1
Marlin/src/lcd/menu/menu.cpp View File

343
     ui.defer_status_screen();
343
     ui.defer_status_screen();
344
     const bool do_probe = DISABLED(BABYSTEP_HOTEND_Z_OFFSET) || active_extruder == 0;
344
     const bool do_probe = DISABLED(BABYSTEP_HOTEND_Z_OFFSET) || active_extruder == 0;
345
     if (ui.encoderPosition) {
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
       ui.encoderPosition = 0;
347
       ui.encoderPosition = 0;
348
 
348
 
349
       const float diff = planner.steps_to_mm[Z_AXIS] * babystep_increment,
349
       const float diff = planner.steps_to_mm[Z_AXIS] * babystep_increment,

+ 11
- 0
Marlin/src/lcd/menu/menu.h View File

587
   #else
587
   #else
588
     void lcd_babystep_z();
588
     void lcd_babystep_z();
589
   #endif
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
 #endif
601
 #endif
591
 
602
 
592
 #if ENABLED(POWER_LOSS_RECOVERY)
603
 #if ENABLED(POWER_LOSS_RECOVERY)

+ 3
- 2
Marlin/src/lcd/menu/menu_tune.cpp View File

55
     if (ui.encoderPosition) {
55
     if (ui.encoderPosition) {
56
       const int16_t steps = int16_t(ui.encoderPosition) * (
56
       const int16_t steps = int16_t(ui.encoderPosition) * (
57
         #if ENABLED(BABYSTEP_XY)
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
         #endif
60
         #endif
60
-        BABYSTEP_MULTIPLICATOR_Z
61
+        BABYSTEP_SIZE_Z
61
       );
62
       );
62
       ui.encoderPosition = 0;
63
       ui.encoderPosition = 0;
63
       ui.refresh(LCDVIEW_REDRAW_NOW);
64
       ui.refresh(LCDVIEW_REDRAW_NOW);

Loading…
Cancel
Save