Ver código fonte

Fix CoreXY Homing Routine.

Fixed how stepper ISR figure it out when the head (extruder) is going to
Min or Max direction.
Added Homing to Max Endstops.
alexborro 10 anos atrás
pai
commit
afc737ca0c
3 arquivos alterados com 20 adições e 13 exclusões
  1. 0
    5
      Marlin/Configuration.h
  2. 10
    2
      Marlin/planner.cpp
  3. 10
    6
      Marlin/stepper.cpp

+ 0
- 5
Marlin/Configuration.h Ver arquivo

326
 //#define DISABLE_MAX_ENDSTOPS
326
 //#define DISABLE_MAX_ENDSTOPS
327
 //#define DISABLE_MIN_ENDSTOPS
327
 //#define DISABLE_MIN_ENDSTOPS
328
 
328
 
329
-// Disable max endstops for compatibility with endstop checking routine
330
-#if defined(COREXY) && !defined(DISABLE_MAX_ENDSTOPS)
331
-  #define DISABLE_MAX_ENDSTOPS
332
-#endif
333
-
334
 // For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1
329
 // For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1
335
 #define X_ENABLE_ON 0
330
 #define X_ENABLE_ON 0
336
 #define Y_ENABLE_ON 0
331
 #define Y_ENABLE_ON 0

+ 10
- 2
Marlin/planner.cpp Ver arquivo

629
     block->direction_bits |= (1<<Y_AXIS); 
629
     block->direction_bits |= (1<<Y_AXIS); 
630
   }
630
   }
631
 #else
631
 #else
632
+  if (target[X_AXIS] < position[X_AXIS])
633
+  {
634
+    block->direction_bits |= (1<<X_HEAD); //AlexBorro: Save the real Extruder (head) direction in X Axis
635
+  }
636
+  if (target[Y_AXIS] < position[Y_AXIS])
637
+  {
638
+    block->direction_bits |= (1<<Y_HEAD); //AlexBorro: Save the real Extruder (head) direction in Y Axis
639
+  }
632
   if ((target[X_AXIS]-position[X_AXIS]) + (target[Y_AXIS]-position[Y_AXIS]) < 0)
640
   if ((target[X_AXIS]-position[X_AXIS]) + (target[Y_AXIS]-position[Y_AXIS]) < 0)
633
   {
641
   {
634
-    block->direction_bits |= (1<<X_AXIS); 
642
+    block->direction_bits |= (1<<X_AXIS); //AlexBorro: Motor A direction (Incorrectly implemented as X_AXIS)
635
   }
643
   }
636
   if ((target[X_AXIS]-position[X_AXIS]) - (target[Y_AXIS]-position[Y_AXIS]) < 0)
644
   if ((target[X_AXIS]-position[X_AXIS]) - (target[Y_AXIS]-position[Y_AXIS]) < 0)
637
   {
645
   {
638
-    block->direction_bits |= (1<<Y_AXIS); 
646
+    block->direction_bits |= (1<<Y_AXIS); //AlexBorro: Motor B direction (Incorrectly implemented as Y_AXIS)
639
   }
647
   }
640
 #endif
648
 #endif
641
   if (target[Z_AXIS] < position[Z_AXIS])
649
   if (target[Z_AXIS] < position[Z_AXIS])

+ 10
- 6
Marlin/stepper.cpp Ver arquivo

401
 
401
 
402
     // Set direction en check limit switches
402
     // Set direction en check limit switches
403
     #ifndef COREXY
403
     #ifndef COREXY
404
-    if ((out_bits & (1<<X_AXIS)) != 0) {   // stepping along -X axis
404
+    if ((out_bits & (1<<X_AXIS)) != 0)   // stepping along -X axis
405
     #else
405
     #else
406
-    if ((((out_bits & (1<<X_AXIS)) != 0)&&(out_bits & (1<<Y_AXIS)) != 0)) {   //-X occurs for -A and -B
406
+    if ((out_bits & (1<<X_HEAD)) != 0)   //AlexBorro: Head direction in -X axis for CoreXY bots.
407
     #endif
407
     #endif
408
+    {
408
       CHECK_ENDSTOPS
409
       CHECK_ENDSTOPS
409
       {
410
       {
410
         #ifdef DUAL_X_CARRIAGE
411
         #ifdef DUAL_X_CARRIAGE
425
         }
426
         }
426
       }
427
       }
427
     }
428
     }
428
-    else { // +direction
429
+    else 
430
+    { // +direction
429
       CHECK_ENDSTOPS
431
       CHECK_ENDSTOPS
430
       {
432
       {
431
         #ifdef DUAL_X_CARRIAGE
433
         #ifdef DUAL_X_CARRIAGE
448
     }
450
     }
449
 
451
 
450
     #ifndef COREXY
452
     #ifndef COREXY
451
-    if ((out_bits & (1<<Y_AXIS)) != 0) {   // -direction
453
+    if ((out_bits & (1<<Y_AXIS)) != 0)   // -direction
452
     #else
454
     #else
453
-    if ((((out_bits & (1<<X_AXIS)) != 0)&&(out_bits & (1<<Y_AXIS)) == 0)) {   // -Y occurs for -A and +B
455
+    if ((out_bits & (1<<Y_HEAD)) != 0)  //AlexBorro: Head direction in -Y axis for CoreXY bots.
454
     #endif
456
     #endif
457
+    {
455
       CHECK_ENDSTOPS
458
       CHECK_ENDSTOPS
456
       {
459
       {
457
         #if defined(Y_MIN_PIN) && Y_MIN_PIN > -1
460
         #if defined(Y_MIN_PIN) && Y_MIN_PIN > -1
465
         #endif
468
         #endif
466
       }
469
       }
467
     }
470
     }
468
-    else { // +direction
471
+    else 
472
+    { // +direction
469
       CHECK_ENDSTOPS
473
       CHECK_ENDSTOPS
470
       {
474
       {
471
         #if defined(Y_MAX_PIN) && Y_MAX_PIN > -1
475
         #if defined(Y_MAX_PIN) && Y_MAX_PIN > -1

Carregando…
Cancelar
Salvar