Browse Source

Fix CoreXY homing bug introduced by PR #1606

The Check Endstop logic must be:

if (current_block->steps_x != current_block->steps_y || (TEST(out_bits,
X_AXIS) == TEST(out_bits, Y_AXIS)))
if (TEST(out_bits, X_HEAD))

not

if (TEST(out_bits, X_HEAD) && (current_block->steps_x !=
current_block->steps_y || (TEST(out_bits, X_AXIS) == TEST(out_bits,
Y_AXIS))))

Same applies for Y axis.
alexborro 9 years ago
parent
commit
cb676cdf39
1 changed files with 38 additions and 37 deletions
  1. 38
    37
      Marlin/stepper.cpp

+ 38
- 37
Marlin/stepper.cpp View File

@@ -413,48 +413,49 @@ ISR(TIMER1_COMPA_vect) {
413 413
       #else
414 414
         // Head direction in -X axis for CoreXY bots.
415 415
         // If DeltaX == -DeltaY, the movement is only in Y axis
416
-        if (TEST(out_bits, X_HEAD) && (current_block->steps_x != current_block->steps_y || (TEST(out_bits, X_AXIS) == TEST(out_bits, Y_AXIS))))
416
+        if (current_block->steps_x != current_block->steps_y || (TEST(out_bits, X_AXIS) == TEST(out_bits, Y_AXIS)))      
417
+            if (TEST(out_bits, X_HEAD))
417 418
       #endif
418
-        { // -direction
419
-          #ifdef DUAL_X_CARRIAGE
420
-            // with 2 x-carriages, endstops are only checked in the homing direction for the active extruder
421
-            if ((current_block->active_extruder == 0 && X_HOME_DIR == -1) || (current_block->active_extruder != 0 && X2_HOME_DIR == -1))
422
-          #endif          
423
-            {
424
-              #if defined(X_MIN_PIN) && X_MIN_PIN >= 0
425
-                UPDATE_ENDSTOP(x, X, min, MIN);
419
+            { // -direction
420
+              #ifdef DUAL_X_CARRIAGE
421
+                // with 2 x-carriages, endstops are only checked in the homing direction for the active extruder
422
+                if ((current_block->active_extruder == 0 && X_HOME_DIR == -1) || (current_block->active_extruder != 0 && X2_HOME_DIR == -1))
423
+              #endif          
424
+                {
425
+                  #if defined(X_MIN_PIN) && X_MIN_PIN >= 0
426
+                    UPDATE_ENDSTOP(x, X, min, MIN);
427
+                  #endif
428
+                }
429
+            }
430
+            else { // +direction
431
+              #ifdef DUAL_X_CARRIAGE
432
+                // with 2 x-carriages, endstops are only checked in the homing direction for the active extruder
433
+                if ((current_block->active_extruder == 0 && X_HOME_DIR == 1) || (current_block->active_extruder != 0 && X2_HOME_DIR == 1))
426 434
               #endif
435
+                {
436
+                  #if defined(X_MAX_PIN) && X_MAX_PIN >= 0
437
+                    UPDATE_ENDSTOP(x, X, max, MAX);
438
+                  #endif
439
+                }
427 440
             }
428
-        }
429
-        else { // +direction
430
-          #ifdef DUAL_X_CARRIAGE
431
-            // with 2 x-carriages, endstops are only checked in the homing direction for the active extruder
432
-            if ((current_block->active_extruder == 0 && X_HOME_DIR == 1) || (current_block->active_extruder != 0 && X2_HOME_DIR == 1))
433
-          #endif
434
-            {
435
-              #if defined(X_MAX_PIN) && X_MAX_PIN >= 0
436
-                UPDATE_ENDSTOP(x, X, max, MAX);
441
+      #ifndef COREXY
442
+        if (TEST(out_bits, Y_AXIS))   // -direction
443
+      #else
444
+        // Head direction in -Y axis for CoreXY bots.
445
+        // If DeltaX == DeltaY, the movement is only in X axis
446
+        if (current_block->steps_x != current_block->steps_y || (TEST(out_bits, X_AXIS) != TEST(out_bits, Y_AXIS)))
447
+            if (TEST(out_bits, Y_HEAD))             
448
+      #endif
449
+            { // -direction
450
+              #if defined(Y_MIN_PIN) && Y_MIN_PIN >= 0
451
+                UPDATE_ENDSTOP(y, Y, min, MIN);
452
+              #endif
453
+            }
454
+            else { // +direction
455
+              #if defined(Y_MAX_PIN) && Y_MAX_PIN >= 0
456
+                UPDATE_ENDSTOP(y, Y, max, MAX);
437 457
               #endif
438 458
             }
439
-        }
440
-
441
-        #ifndef COREXY
442
-          if (TEST(out_bits, Y_AXIS))   // -direction
443
-        #else
444
-          // Head direction in -Y axis for CoreXY bots.
445
-          // If DeltaX == DeltaY, the movement is only in X axis
446
-          if (TEST(out_bits, Y_HEAD) && (current_block->steps_x != current_block->steps_y || (TEST(out_bits, X_AXIS) != TEST(out_bits, Y_AXIS))))
447
-        #endif
448
-        { // -direction
449
-          #if defined(Y_MIN_PIN) && Y_MIN_PIN >= 0
450
-            UPDATE_ENDSTOP(y, Y, min, MIN);
451
-          #endif
452
-        }
453
-        else { // +direction
454
-          #if defined(Y_MAX_PIN) && Y_MAX_PIN >= 0
455
-            UPDATE_ENDSTOP(y, Y, max, MAX);
456
-          #endif
457
-        }
458 459
     }
459 460
 
460 461
     if (TEST(out_bits, Z_AXIS)) {   // -direction

Loading…
Cancel
Save