Browse Source

Implement BABYSTEPPING for COREXY and COREXZ

Scott Lahteine 8 years ago
parent
commit
e5fd43f343

+ 11
- 0
Marlin/Conditionals.h View File

@@ -269,6 +269,17 @@
269 269
   #define Z_MAX_LENGTH (Z_MAX_POS - (Z_MIN_POS))
270 270
 
271 271
   /**
272
+   * CoreXY and CoreXZ
273
+   */
274
+  #if ENABLED(COREXY)
275
+    #define CORE_AXIS_2 B_AXIS
276
+    #define CORE_AXIS_3 Z_AXIS
277
+  #elif ENABLED(COREXZ)
278
+    #define CORE_AXIS_2 C_AXIS
279
+    #define CORE_AXIS_3 Y_AXIS
280
+  #endif
281
+
282
+  /**
272 283
    * SCARA
273 284
    */
274 285
   #if ENABLED(SCARA)

+ 1
- 1
Marlin/Configuration_adv.h View File

@@ -370,7 +370,7 @@
370 370
 //#define BABYSTEPPING
371 371
 #if ENABLED(BABYSTEPPING)
372 372
   #define BABYSTEP_XY  //not only z, but also XY in the menu. more clutter, more functions
373
-                       //not implemented for CoreXY and deltabots!
373
+                       //not implemented for deltabots!
374 374
   #define BABYSTEP_INVERT_Z false  //true for inverse movements in Z
375 375
   #define BABYSTEP_MULTIPLICATOR 1 //faster movements
376 376
 #endif

+ 0
- 3
Marlin/SanityCheck.h View File

@@ -32,9 +32,6 @@
32 32
  * Babystepping
33 33
  */
34 34
 #if ENABLED(BABYSTEPPING)
35
-  #if ENABLED(COREXY) && ENABLED(BABYSTEP_XY)
36
-    #error BABYSTEPPING only implemented for Z axis on CoreXY.
37
-  #endif
38 35
   #if ENABLED(SCARA)
39 36
     #error BABYSTEPPING is not implemented for SCARA yet.
40 37
   #endif

+ 1
- 1
Marlin/example_configurations/Felix/Configuration_adv.h View File

@@ -370,7 +370,7 @@
370 370
 //#define BABYSTEPPING
371 371
 #if ENABLED(BABYSTEPPING)
372 372
   #define BABYSTEP_XY  //not only z, but also XY in the menu. more clutter, more functions
373
-                       //not implemented for CoreXY and deltabots!
373
+                       //not implemented for deltabots!
374 374
   #define BABYSTEP_INVERT_Z false  //true for inverse movements in Z
375 375
   #define BABYSTEP_MULTIPLICATOR 1 //faster movements
376 376
 #endif

+ 1
- 1
Marlin/example_configurations/Hephestos/Configuration_adv.h View File

@@ -370,7 +370,7 @@
370 370
 //#define BABYSTEPPING
371 371
 #if ENABLED(BABYSTEPPING)
372 372
   #define BABYSTEP_XY  //not only z, but also XY in the menu. more clutter, more functions
373
-                       //not implemented for CoreXY and deltabots!
373
+                       //not implemented for deltabots!
374 374
   #define BABYSTEP_INVERT_Z false  //true for inverse movements in Z
375 375
   #define BABYSTEP_MULTIPLICATOR 1 //faster movements
376 376
 #endif

+ 1
- 1
Marlin/example_configurations/Hephestos_2/Configuration_adv.h View File

@@ -370,7 +370,7 @@
370 370
 //#define BABYSTEPPING
371 371
 #if ENABLED(BABYSTEPPING)
372 372
   #define BABYSTEP_XY  //not only z, but also XY in the menu. more clutter, more functions
373
-                       //not implemented for CoreXY and deltabots!
373
+                       //not implemented for deltabots!
374 374
   #define BABYSTEP_INVERT_Z false  //true for inverse movements in Z
375 375
   #define BABYSTEP_MULTIPLICATOR 1 //faster movements
376 376
 #endif

+ 1
- 1
Marlin/example_configurations/K8200/Configuration_adv.h View File

@@ -375,7 +375,7 @@
375 375
 #define BABYSTEPPING
376 376
 #if ENABLED(BABYSTEPPING)
377 377
   #define BABYSTEP_XY  //not only z, but also XY in the menu. more clutter, more functions
378
-                       //not implemented for CoreXY and deltabots!
378
+                       //not implemented for deltabots!
379 379
   #define BABYSTEP_INVERT_Z false  //true for inverse movements in Z
380 380
   #define BABYSTEP_MULTIPLICATOR 1 //faster movements
381 381
 #endif

+ 1
- 1
Marlin/example_configurations/RigidBot/Configuration_adv.h View File

@@ -370,7 +370,7 @@
370 370
 //#define BABYSTEPPING
371 371
 #if ENABLED(BABYSTEPPING)
372 372
   #define BABYSTEP_XY  //not only z, but also XY in the menu. more clutter, more functions
373
-                       //not implemented for CoreXY and deltabots!
373
+                       //not implemented for deltabots!
374 374
   #define BABYSTEP_INVERT_Z false  //true for inverse movements in Z
375 375
   #define BABYSTEP_MULTIPLICATOR 1 //faster movements
376 376
 #endif

+ 1
- 1
Marlin/example_configurations/SCARA/Configuration_adv.h View File

@@ -370,7 +370,7 @@
370 370
 //#define BABYSTEPPING
371 371
 #if ENABLED(BABYSTEPPING)
372 372
   #define BABYSTEP_XY  //not only z, but also XY in the menu. more clutter, more functions
373
-                       //not implemented for CoreXY and deltabots!
373
+                       //not implemented for deltabots!
374 374
   #define BABYSTEP_INVERT_Z false  //true for inverse movements in Z
375 375
   #define BABYSTEP_MULTIPLICATOR 1 //faster movements
376 376
 #endif

+ 1
- 1
Marlin/example_configurations/TAZ4/Configuration_adv.h View File

@@ -378,7 +378,7 @@
378 378
 //#define BABYSTEPPING
379 379
 #if ENABLED(BABYSTEPPING)
380 380
   #define BABYSTEP_XY  //not only z, but also XY in the menu. more clutter, more functions
381
-                       //not implemented for CoreXY and deltabots!
381
+                       //not implemented for deltabots!
382 382
   #define BABYSTEP_INVERT_Z false  //true for inverse movements in Z
383 383
   #define BABYSTEP_MULTIPLICATOR 1 //faster movements
384 384
 #endif

+ 1
- 1
Marlin/example_configurations/WITBOX/Configuration_adv.h View File

@@ -370,7 +370,7 @@
370 370
 //#define BABYSTEPPING
371 371
 #if ENABLED(BABYSTEPPING)
372 372
   #define BABYSTEP_XY  //not only z, but also XY in the menu. more clutter, more functions
373
-                       //not implemented for CoreXY and deltabots!
373
+                       //not implemented for deltabots!
374 374
   #define BABYSTEP_INVERT_Z false  //true for inverse movements in Z
375 375
   #define BABYSTEP_MULTIPLICATOR 1 //faster movements
376 376
 #endif

+ 1
- 1
Marlin/example_configurations/delta/biv2.5/Configuration_adv.h View File

@@ -372,7 +372,7 @@
372 372
 //#define BABYSTEPPING
373 373
 #if ENABLED(BABYSTEPPING)
374 374
   #define BABYSTEP_XY  //not only z, but also XY in the menu. more clutter, more functions
375
-                       //not implemented for CoreXY and deltabots!
375
+                       //not implemented for deltabots!
376 376
   #define BABYSTEP_INVERT_Z false  //true for inverse movements in Z
377 377
   #define BABYSTEP_MULTIPLICATOR 1 //faster movements
378 378
 #endif

+ 1
- 1
Marlin/example_configurations/delta/generic/Configuration_adv.h View File

@@ -372,7 +372,7 @@
372 372
 //#define BABYSTEPPING
373 373
 #if ENABLED(BABYSTEPPING)
374 374
   #define BABYSTEP_XY  //not only z, but also XY in the menu. more clutter, more functions
375
-                       //not implemented for CoreXY and deltabots!
375
+                       //not implemented for deltabots!
376 376
   #define BABYSTEP_INVERT_Z false  //true for inverse movements in Z
377 377
   #define BABYSTEP_MULTIPLICATOR 1 //faster movements
378 378
 #endif

+ 1
- 1
Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h View File

@@ -371,7 +371,7 @@
371 371
 //#define BABYSTEPPING
372 372
 #if ENABLED(BABYSTEPPING)
373 373
   #define BABYSTEP_XY  //not only z, but also XY in the menu. more clutter, more functions
374
-                       //not implemented for CoreXY and deltabots!
374
+                       //not implemented for deltabots!
375 375
   #define BABYSTEP_INVERT_Z false  //true for inverse movements in Z
376 376
   #define BABYSTEP_MULTIPLICATOR 1 //faster movements
377 377
 #endif

+ 1
- 1
Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h View File

@@ -375,7 +375,7 @@
375 375
 //#define BABYSTEPPING
376 376
 #if ENABLED(BABYSTEPPING)
377 377
   #define BABYSTEP_XY  //not only z, but also XY in the menu. more clutter, more functions
378
-                       //not implemented for CoreXY and deltabots!
378
+                       //not implemented for deltabots!
379 379
   #define BABYSTEP_INVERT_Z false  //true for inverse movements in Z
380 380
   #define BABYSTEP_MULTIPLICATOR 1 //faster movements
381 381
 #endif

+ 1
- 1
Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h View File

@@ -370,7 +370,7 @@
370 370
 //#define BABYSTEPPING
371 371
 #if ENABLED(BABYSTEPPING)
372 372
   #define BABYSTEP_XY  //not only z, but also XY in the menu. more clutter, more functions
373
-                       //not implemented for CoreXY and deltabots!
373
+                       //not implemented for deltabots!
374 374
   #define BABYSTEP_INVERT_Z false  //true for inverse movements in Z
375 375
   #define BABYSTEP_MULTIPLICATOR 1 //faster movements
376 376
 #endif

+ 1
- 1
Marlin/example_configurations/makibox/Configuration_adv.h View File

@@ -370,7 +370,7 @@
370 370
 //#define BABYSTEPPING
371 371
 #if ENABLED(BABYSTEPPING)
372 372
   #define BABYSTEP_XY  //not only z, but also XY in the menu. more clutter, more functions
373
-                       //not implemented for CoreXY and deltabots!
373
+                       //not implemented for deltabots!
374 374
   #define BABYSTEP_INVERT_Z false  //true for inverse movements in Z
375 375
   #define BABYSTEP_MULTIPLICATOR 1 //faster movements
376 376
 #endif

+ 1
- 1
Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h View File

@@ -370,7 +370,7 @@
370 370
 //#define BABYSTEPPING
371 371
 #if ENABLED(BABYSTEPPING)
372 372
   #define BABYSTEP_XY  //not only z, but also XY in the menu. more clutter, more functions
373
-                       //not implemented for CoreXY and deltabots!
373
+                       //not implemented for deltabots!
374 374
   #define BABYSTEP_INVERT_Z false  //true for inverse movements in Z
375 375
   #define BABYSTEP_MULTIPLICATOR 1 //faster movements
376 376
 #endif

+ 0
- 6
Marlin/stepper.cpp View File

@@ -289,12 +289,6 @@ void checkHitEndstops() {
289 289
   }
290 290
 }
291 291
 
292
-#if ENABLED(COREXY)
293
-  #define CORE_AXIS_2 B_AXIS
294
-#elif ENABLED(COREXZ)
295
-  #define CORE_AXIS_2 C_AXIS
296
-#endif
297
-
298 292
 void enable_endstops(bool check) { check_endstops = check; }
299 293
 
300 294
 // Check endstops - Called from ISR!

+ 31
- 5
Marlin/ultralcd.cpp View File

@@ -483,21 +483,47 @@ void lcd_set_home_offsets() {
483 483
   lcd_return_to_status();
484 484
 }
485 485
 
486
-
487 486
 #if ENABLED(BABYSTEPPING)
488 487
 
489
-  static void _lcd_babystep(int axis, const char* msg) {
488
+  static void _lcd_babystep(const int axis, const char* msg) {
490 489
     ENCODER_DIRECTION_NORMAL(); 
491 490
     if (encoderPosition != 0) {
492
-      babystepsTodo[axis] += (BABYSTEP_MULTIPLICATOR) * (int)encoderPosition;
493 491
       encoderPosition = 0;
494 492
       lcdDrawUpdate = 1;
493
+      int distance =  (int)encoderPosition * BABYSTEP_MULTIPLICATOR;
494
+      #if ENABLED(COREXY) || ENABLED(COREXZ)
495
+        #if ENABLED(BABYSTEP_XY)
496
+          switch(axis) {
497
+            case X_AXIS: // X on CoreXY and CoreXZ
498
+              babystepsTodo[A_AXIS] += distance * 2;
499
+              babystepsTodo[CORE_AXIS_2] += distance * 2;
500
+              break;
501
+            case CORE_AXIS_2: // Y on CoreXY, Z on CoreXZ
502
+              babystepsTodo[A_AXIS] += distance * 2;
503
+              babystepsTodo[CORE_AXIS_2] -= distance * 2;
504
+              break;
505
+            case CORE_AXIS_3: // Z on CoreXY, Y on CoreXZ
506
+              babystepsTodo[CORE_AXIS_3] += distance;
507
+              break;
508
+          }
509
+        #elif ENABLED(COREXZ)
510
+          babystepsTodo[A_AXIS] += distance * 2;
511
+          babystepsTodo[C_AXIS] -= distance * 2;
512
+        #else
513
+          babystepsTodo[Z_AXIS] += distance;
514
+        #endif
515
+      #else
516
+        babystepsTodo[axis] += distance;
517
+      #endif
495 518
     }
496 519
     if (lcdDrawUpdate) lcd_implementation_drawedit(msg, (char*)"");
497 520
     if (LCD_CLICKED) lcd_goto_previous_menu();
498 521
   }
499
-  static void lcd_babystep_x() { _lcd_babystep(X_AXIS, PSTR(MSG_BABYSTEPPING_X)); }
500
-  static void lcd_babystep_y() { _lcd_babystep(Y_AXIS, PSTR(MSG_BABYSTEPPING_Y)); }
522
+
523
+  #if ENABLED(BABYSTEP_XY)
524
+    static void lcd_babystep_x() { _lcd_babystep(X_AXIS, PSTR(MSG_BABYSTEPPING_X)); }
525
+    static void lcd_babystep_y() { _lcd_babystep(Y_AXIS, PSTR(MSG_BABYSTEPPING_Y)); }
526
+  #endif
501 527
   static void lcd_babystep_z() { _lcd_babystep(Z_AXIS, PSTR(MSG_BABYSTEPPING_Z)); }
502 528
 
503 529
 #endif //BABYSTEPPING

Loading…
Cancel
Save