Browse Source

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 9 years ago
parent
commit
afc737ca0c
3 changed files with 20 additions and 13 deletions
  1. 0
    5
      Marlin/Configuration.h
  2. 10
    2
      Marlin/planner.cpp
  3. 10
    6
      Marlin/stepper.cpp

+ 0
- 5
Marlin/Configuration.h View File

@@ -326,11 +326,6 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
326 326
 //#define DISABLE_MAX_ENDSTOPS
327 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 329
 // For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1
335 330
 #define X_ENABLE_ON 0
336 331
 #define Y_ENABLE_ON 0

+ 10
- 2
Marlin/planner.cpp View File

@@ -629,13 +629,21 @@ block->steps_y = labs((target[X_AXIS]-position[X_AXIS]) - (target[Y_AXIS]-positi
629 629
     block->direction_bits |= (1<<Y_AXIS); 
630 630
   }
631 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 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 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 648
 #endif
641 649
   if (target[Z_AXIS] < position[Z_AXIS])

+ 10
- 6
Marlin/stepper.cpp View File

@@ -401,10 +401,11 @@ ISR(TIMER1_COMPA_vect)
401 401
 
402 402
     // Set direction en check limit switches
403 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 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 407
     #endif
408
+    {
408 409
       CHECK_ENDSTOPS
409 410
       {
410 411
         #ifdef DUAL_X_CARRIAGE
@@ -425,7 +426,8 @@ ISR(TIMER1_COMPA_vect)
425 426
         }
426 427
       }
427 428
     }
428
-    else { // +direction
429
+    else 
430
+    { // +direction
429 431
       CHECK_ENDSTOPS
430 432
       {
431 433
         #ifdef DUAL_X_CARRIAGE
@@ -448,10 +450,11 @@ ISR(TIMER1_COMPA_vect)
448 450
     }
449 451
 
450 452
     #ifndef COREXY
451
-    if ((out_bits & (1<<Y_AXIS)) != 0) {   // -direction
453
+    if ((out_bits & (1<<Y_AXIS)) != 0)   // -direction
452 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 456
     #endif
457
+    {
455 458
       CHECK_ENDSTOPS
456 459
       {
457 460
         #if defined(Y_MIN_PIN) && Y_MIN_PIN > -1
@@ -465,7 +468,8 @@ ISR(TIMER1_COMPA_vect)
465 468
         #endif
466 469
       }
467 470
     }
468
-    else { // +direction
471
+    else 
472
+    { // +direction
469 473
       CHECK_ENDSTOPS
470 474
       {
471 475
         #if defined(Y_MAX_PIN) && Y_MAX_PIN > -1

Loading…
Cancel
Save