Browse Source

Implement BABYSTEPPING for COREXY and COREXZ

Scott Lahteine 8 years ago
parent
commit
e5fd43f343

+ 11
- 0
Marlin/Conditionals.h View File

269
   #define Z_MAX_LENGTH (Z_MAX_POS - (Z_MIN_POS))
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
    * SCARA
283
    * SCARA
273
    */
284
    */
274
   #if ENABLED(SCARA)
285
   #if ENABLED(SCARA)

+ 1
- 1
Marlin/Configuration_adv.h View File

370
 //#define BABYSTEPPING
370
 //#define BABYSTEPPING
371
 #if ENABLED(BABYSTEPPING)
371
 #if ENABLED(BABYSTEPPING)
372
   #define BABYSTEP_XY  //not only z, but also XY in the menu. more clutter, more functions
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
   #define BABYSTEP_INVERT_Z false  //true for inverse movements in Z
374
   #define BABYSTEP_INVERT_Z false  //true for inverse movements in Z
375
   #define BABYSTEP_MULTIPLICATOR 1 //faster movements
375
   #define BABYSTEP_MULTIPLICATOR 1 //faster movements
376
 #endif
376
 #endif

+ 0
- 3
Marlin/SanityCheck.h View File

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

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

370
 //#define BABYSTEPPING
370
 //#define BABYSTEPPING
371
 #if ENABLED(BABYSTEPPING)
371
 #if ENABLED(BABYSTEPPING)
372
   #define BABYSTEP_XY  //not only z, but also XY in the menu. more clutter, more functions
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
   #define BABYSTEP_INVERT_Z false  //true for inverse movements in Z
374
   #define BABYSTEP_INVERT_Z false  //true for inverse movements in Z
375
   #define BABYSTEP_MULTIPLICATOR 1 //faster movements
375
   #define BABYSTEP_MULTIPLICATOR 1 //faster movements
376
 #endif
376
 #endif

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

370
 //#define BABYSTEPPING
370
 //#define BABYSTEPPING
371
 #if ENABLED(BABYSTEPPING)
371
 #if ENABLED(BABYSTEPPING)
372
   #define BABYSTEP_XY  //not only z, but also XY in the menu. more clutter, more functions
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
   #define BABYSTEP_INVERT_Z false  //true for inverse movements in Z
374
   #define BABYSTEP_INVERT_Z false  //true for inverse movements in Z
375
   #define BABYSTEP_MULTIPLICATOR 1 //faster movements
375
   #define BABYSTEP_MULTIPLICATOR 1 //faster movements
376
 #endif
376
 #endif

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

370
 //#define BABYSTEPPING
370
 //#define BABYSTEPPING
371
 #if ENABLED(BABYSTEPPING)
371
 #if ENABLED(BABYSTEPPING)
372
   #define BABYSTEP_XY  //not only z, but also XY in the menu. more clutter, more functions
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
   #define BABYSTEP_INVERT_Z false  //true for inverse movements in Z
374
   #define BABYSTEP_INVERT_Z false  //true for inverse movements in Z
375
   #define BABYSTEP_MULTIPLICATOR 1 //faster movements
375
   #define BABYSTEP_MULTIPLICATOR 1 //faster movements
376
 #endif
376
 #endif

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

375
 #define BABYSTEPPING
375
 #define BABYSTEPPING
376
 #if ENABLED(BABYSTEPPING)
376
 #if ENABLED(BABYSTEPPING)
377
   #define BABYSTEP_XY  //not only z, but also XY in the menu. more clutter, more functions
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
   #define BABYSTEP_INVERT_Z false  //true for inverse movements in Z
379
   #define BABYSTEP_INVERT_Z false  //true for inverse movements in Z
380
   #define BABYSTEP_MULTIPLICATOR 1 //faster movements
380
   #define BABYSTEP_MULTIPLICATOR 1 //faster movements
381
 #endif
381
 #endif

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

370
 //#define BABYSTEPPING
370
 //#define BABYSTEPPING
371
 #if ENABLED(BABYSTEPPING)
371
 #if ENABLED(BABYSTEPPING)
372
   #define BABYSTEP_XY  //not only z, but also XY in the menu. more clutter, more functions
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
   #define BABYSTEP_INVERT_Z false  //true for inverse movements in Z
374
   #define BABYSTEP_INVERT_Z false  //true for inverse movements in Z
375
   #define BABYSTEP_MULTIPLICATOR 1 //faster movements
375
   #define BABYSTEP_MULTIPLICATOR 1 //faster movements
376
 #endif
376
 #endif

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

370
 //#define BABYSTEPPING
370
 //#define BABYSTEPPING
371
 #if ENABLED(BABYSTEPPING)
371
 #if ENABLED(BABYSTEPPING)
372
   #define BABYSTEP_XY  //not only z, but also XY in the menu. more clutter, more functions
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
   #define BABYSTEP_INVERT_Z false  //true for inverse movements in Z
374
   #define BABYSTEP_INVERT_Z false  //true for inverse movements in Z
375
   #define BABYSTEP_MULTIPLICATOR 1 //faster movements
375
   #define BABYSTEP_MULTIPLICATOR 1 //faster movements
376
 #endif
376
 #endif

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

378
 //#define BABYSTEPPING
378
 //#define BABYSTEPPING
379
 #if ENABLED(BABYSTEPPING)
379
 #if ENABLED(BABYSTEPPING)
380
   #define BABYSTEP_XY  //not only z, but also XY in the menu. more clutter, more functions
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
   #define BABYSTEP_INVERT_Z false  //true for inverse movements in Z
382
   #define BABYSTEP_INVERT_Z false  //true for inverse movements in Z
383
   #define BABYSTEP_MULTIPLICATOR 1 //faster movements
383
   #define BABYSTEP_MULTIPLICATOR 1 //faster movements
384
 #endif
384
 #endif

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

370
 //#define BABYSTEPPING
370
 //#define BABYSTEPPING
371
 #if ENABLED(BABYSTEPPING)
371
 #if ENABLED(BABYSTEPPING)
372
   #define BABYSTEP_XY  //not only z, but also XY in the menu. more clutter, more functions
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
   #define BABYSTEP_INVERT_Z false  //true for inverse movements in Z
374
   #define BABYSTEP_INVERT_Z false  //true for inverse movements in Z
375
   #define BABYSTEP_MULTIPLICATOR 1 //faster movements
375
   #define BABYSTEP_MULTIPLICATOR 1 //faster movements
376
 #endif
376
 #endif

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

372
 //#define BABYSTEPPING
372
 //#define BABYSTEPPING
373
 #if ENABLED(BABYSTEPPING)
373
 #if ENABLED(BABYSTEPPING)
374
   #define BABYSTEP_XY  //not only z, but also XY in the menu. more clutter, more functions
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
   #define BABYSTEP_INVERT_Z false  //true for inverse movements in Z
376
   #define BABYSTEP_INVERT_Z false  //true for inverse movements in Z
377
   #define BABYSTEP_MULTIPLICATOR 1 //faster movements
377
   #define BABYSTEP_MULTIPLICATOR 1 //faster movements
378
 #endif
378
 #endif

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

372
 //#define BABYSTEPPING
372
 //#define BABYSTEPPING
373
 #if ENABLED(BABYSTEPPING)
373
 #if ENABLED(BABYSTEPPING)
374
   #define BABYSTEP_XY  //not only z, but also XY in the menu. more clutter, more functions
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
   #define BABYSTEP_INVERT_Z false  //true for inverse movements in Z
376
   #define BABYSTEP_INVERT_Z false  //true for inverse movements in Z
377
   #define BABYSTEP_MULTIPLICATOR 1 //faster movements
377
   #define BABYSTEP_MULTIPLICATOR 1 //faster movements
378
 #endif
378
 #endif

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

371
 //#define BABYSTEPPING
371
 //#define BABYSTEPPING
372
 #if ENABLED(BABYSTEPPING)
372
 #if ENABLED(BABYSTEPPING)
373
   #define BABYSTEP_XY  //not only z, but also XY in the menu. more clutter, more functions
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
   #define BABYSTEP_INVERT_Z false  //true for inverse movements in Z
375
   #define BABYSTEP_INVERT_Z false  //true for inverse movements in Z
376
   #define BABYSTEP_MULTIPLICATOR 1 //faster movements
376
   #define BABYSTEP_MULTIPLICATOR 1 //faster movements
377
 #endif
377
 #endif

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

375
 //#define BABYSTEPPING
375
 //#define BABYSTEPPING
376
 #if ENABLED(BABYSTEPPING)
376
 #if ENABLED(BABYSTEPPING)
377
   #define BABYSTEP_XY  //not only z, but also XY in the menu. more clutter, more functions
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
   #define BABYSTEP_INVERT_Z false  //true for inverse movements in Z
379
   #define BABYSTEP_INVERT_Z false  //true for inverse movements in Z
380
   #define BABYSTEP_MULTIPLICATOR 1 //faster movements
380
   #define BABYSTEP_MULTIPLICATOR 1 //faster movements
381
 #endif
381
 #endif

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

370
 //#define BABYSTEPPING
370
 //#define BABYSTEPPING
371
 #if ENABLED(BABYSTEPPING)
371
 #if ENABLED(BABYSTEPPING)
372
   #define BABYSTEP_XY  //not only z, but also XY in the menu. more clutter, more functions
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
   #define BABYSTEP_INVERT_Z false  //true for inverse movements in Z
374
   #define BABYSTEP_INVERT_Z false  //true for inverse movements in Z
375
   #define BABYSTEP_MULTIPLICATOR 1 //faster movements
375
   #define BABYSTEP_MULTIPLICATOR 1 //faster movements
376
 #endif
376
 #endif

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

370
 //#define BABYSTEPPING
370
 //#define BABYSTEPPING
371
 #if ENABLED(BABYSTEPPING)
371
 #if ENABLED(BABYSTEPPING)
372
   #define BABYSTEP_XY  //not only z, but also XY in the menu. more clutter, more functions
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
   #define BABYSTEP_INVERT_Z false  //true for inverse movements in Z
374
   #define BABYSTEP_INVERT_Z false  //true for inverse movements in Z
375
   #define BABYSTEP_MULTIPLICATOR 1 //faster movements
375
   #define BABYSTEP_MULTIPLICATOR 1 //faster movements
376
 #endif
376
 #endif

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

370
 //#define BABYSTEPPING
370
 //#define BABYSTEPPING
371
 #if ENABLED(BABYSTEPPING)
371
 #if ENABLED(BABYSTEPPING)
372
   #define BABYSTEP_XY  //not only z, but also XY in the menu. more clutter, more functions
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
   #define BABYSTEP_INVERT_Z false  //true for inverse movements in Z
374
   #define BABYSTEP_INVERT_Z false  //true for inverse movements in Z
375
   #define BABYSTEP_MULTIPLICATOR 1 //faster movements
375
   #define BABYSTEP_MULTIPLICATOR 1 //faster movements
376
 #endif
376
 #endif

+ 0
- 6
Marlin/stepper.cpp View File

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
 void enable_endstops(bool check) { check_endstops = check; }
292
 void enable_endstops(bool check) { check_endstops = check; }
299
 
293
 
300
 // Check endstops - Called from ISR!
294
 // Check endstops - Called from ISR!

+ 31
- 5
Marlin/ultralcd.cpp View File

483
   lcd_return_to_status();
483
   lcd_return_to_status();
484
 }
484
 }
485
 
485
 
486
-
487
 #if ENABLED(BABYSTEPPING)
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
     ENCODER_DIRECTION_NORMAL(); 
489
     ENCODER_DIRECTION_NORMAL(); 
491
     if (encoderPosition != 0) {
490
     if (encoderPosition != 0) {
492
-      babystepsTodo[axis] += (BABYSTEP_MULTIPLICATOR) * (int)encoderPosition;
493
       encoderPosition = 0;
491
       encoderPosition = 0;
494
       lcdDrawUpdate = 1;
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
     if (lcdDrawUpdate) lcd_implementation_drawedit(msg, (char*)"");
519
     if (lcdDrawUpdate) lcd_implementation_drawedit(msg, (char*)"");
497
     if (LCD_CLICKED) lcd_goto_previous_menu();
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
   static void lcd_babystep_z() { _lcd_babystep(Z_AXIS, PSTR(MSG_BABYSTEPPING_Z)); }
527
   static void lcd_babystep_z() { _lcd_babystep(Z_AXIS, PSTR(MSG_BABYSTEPPING_Z)); }
502
 
528
 
503
 #endif //BABYSTEPPING
529
 #endif //BABYSTEPPING

Loading…
Cancel
Save