Sfoglia il codice sorgente

Fixed merge conflicts

Erik van der Zalm 11 anni fa
parent
commit
457d8a0acb
3 ha cambiato i file con 54 aggiunte e 2 eliminazioni
  1. 15
    0
      Marlin/Configuration_adv.h
  2. 7
    2
      Marlin/Marlin.h
  3. 32
    0
      Marlin/stepper.cpp

+ 15
- 0
Marlin/Configuration_adv.h Vedi File

@@ -150,6 +150,21 @@
150 150
   #define EXTRUDERS 1
151 151
 #endif
152 152
 
153
+// Same again but for Y Axis.
154
+//#define Y_DUAL_STEPPER_DRIVERS
155
+
156
+// Define if the two Y drives need to rotate in opposite directions
157
+#define INVERT_Y2_VS_Y_DIR true
158
+
159
+#ifdef Y_DUAL_STEPPER_DRIVERS
160
+  #undef EXTRUDERS
161
+  #define EXTRUDERS 1
162
+#endif
163
+
164
+#ifdef Z_DUAL_STEPPER_DRIVERS && Y_DUAL_STEPPER_DRIVERS
165
+  #error "You cannot have dual drivers for both Y and Z"
166
+#endif 
167
+
153 168
 // Enable this for dual x-carriage printers. 
154 169
 // A dual x-carriage design has the advantage that the inactive extruder can be parked which
155 170
 // prevents hot-end ooze contaminating the print. It also reduces the weight of each x-carriage

+ 7
- 2
Marlin/Marlin.h Vedi File

@@ -109,8 +109,13 @@ void manage_inactivity();
109 109
 #endif
110 110
 
111 111
 #if defined(Y_ENABLE_PIN) && Y_ENABLE_PIN > -1
112
-  #define  enable_y() WRITE(Y_ENABLE_PIN, Y_ENABLE_ON)
113
-  #define disable_y() WRITE(Y_ENABLE_PIN,!Y_ENABLE_ON)
112
+  #ifdef Y_DUAL_STEPPER_DRIVERS
113
+    #define  enable_y() { WRITE(Y_ENABLE_PIN, Y_ENABLE_ON); WRITE(Y2_ENABLE_PIN,  Y_ENABLE_ON); }
114
+    #define disable_y() { WRITE(Y_ENABLE_PIN,!Y_ENABLE_ON); WRITE(Y2_ENABLE_PIN, !Y_ENABLE_ON); }
115
+  #else
116
+    #define  enable_y() WRITE(Y_ENABLE_PIN, Y_ENABLE_ON)
117
+    #define disable_y() WRITE(Y_ENABLE_PIN,!Y_ENABLE_ON)
118
+  #endif
114 119
 #else
115 120
   #define enable_y() ;
116 121
   #define disable_y() ;

+ 32
- 0
Marlin/stepper.cpp Vedi File

@@ -383,10 +383,20 @@ ISR(TIMER1_COMPA_vect)
383 383
     }
384 384
     if((out_bits & (1<<Y_AXIS))!=0){
385 385
       WRITE(Y_DIR_PIN, INVERT_Y_DIR);
386
+	  
387
+	  #ifdef Y_DUAL_STEPPER_DRIVERS
388
+	    WRITE(Y2_DIR_PIN, !(INVERT_Y_DIR == INVERT_Y2_VS_Y_DIR));
389
+	  #endif
390
+	  
386 391
       count_direction[Y_AXIS]=-1;
387 392
     }
388 393
     else{
389 394
       WRITE(Y_DIR_PIN, !INVERT_Y_DIR);
395
+	  
396
+	  #ifdef Y_DUAL_STEPPER_DRIVERS
397
+	    WRITE(Y2_DIR_PIN, (INVERT_Y_DIR == INVERT_Y2_VS_Y_DIR));
398
+	  #endif
399
+	  
390 400
       count_direction[Y_AXIS]=1;
391 401
     }
392 402
 
@@ -582,9 +592,18 @@ ISR(TIMER1_COMPA_vect)
582 592
         counter_y += current_block->steps_y;
583 593
         if (counter_y > 0) {
584 594
           WRITE(Y_STEP_PIN, !INVERT_Y_STEP_PIN);
595
+		  
596
+		  #ifdef Y_DUAL_STEPPER_DRIVERS
597
+			WRITE(Y2_STEP_PIN, !INVERT_Y_STEP_PIN);
598
+		  #endif
599
+		  
585 600
           counter_y -= current_block->step_event_count;
586 601
           count_position[Y_AXIS]+=count_direction[Y_AXIS];
587 602
           WRITE(Y_STEP_PIN, INVERT_Y_STEP_PIN);
603
+		  
604
+		  #ifdef Y_DUAL_STEPPER_DRIVERS
605
+			WRITE(Y2_STEP_PIN, INVERT_Y_STEP_PIN);
606
+		  #endif
588 607
         }
589 608
 
590 609
       counter_z += current_block->steps_z;
@@ -756,6 +775,10 @@ void st_init()
756 775
   #endif
757 776
   #if defined(Y_DIR_PIN) && Y_DIR_PIN > -1
758 777
     SET_OUTPUT(Y_DIR_PIN);
778
+		
779
+	#if defined(Y_DUAL_STEPPER_DRIVERS) && defined(Y2_DIR_PIN) && (Y2_DIR_PIN > -1)
780
+	  SET_OUTPUT(Y2_DIR_PIN);
781
+	#endif
759 782
   #endif
760 783
   #if defined(Z_DIR_PIN) && Z_DIR_PIN > -1
761 784
     SET_OUTPUT(Z_DIR_PIN);
@@ -787,6 +810,11 @@ void st_init()
787 810
   #if defined(Y_ENABLE_PIN) && Y_ENABLE_PIN > -1
788 811
     SET_OUTPUT(Y_ENABLE_PIN);
789 812
     if(!Y_ENABLE_ON) WRITE(Y_ENABLE_PIN,HIGH);
813
+	
814
+	#if defined(Y_DUAL_STEPPER_DRIVERS) && defined(Y2_ENABLE_PIN) && (Y2_ENABLE_PIN > -1)
815
+	  SET_OUTPUT(Y2_ENABLE_PIN);
816
+	  if(!Y_ENABLE_ON) WRITE(Y2_ENABLE_PIN,HIGH);
817
+	#endif
790 818
   #endif
791 819
   #if defined(Z_ENABLE_PIN) && Z_ENABLE_PIN > -1
792 820
     SET_OUTPUT(Z_ENABLE_PIN);
@@ -869,6 +897,10 @@ void st_init()
869 897
   #if defined(Y_STEP_PIN) && (Y_STEP_PIN > -1)
870 898
     SET_OUTPUT(Y_STEP_PIN);
871 899
     WRITE(Y_STEP_PIN,INVERT_Y_STEP_PIN);
900
+    #if defined(Y_DUAL_STEPPER_DRIVERS) && defined(Y2_STEP_PIN) && (Y2_STEP_PIN > -1)
901
+      SET_OUTPUT(Y2_STEP_PIN);
902
+      WRITE(Y2_STEP_PIN,INVERT_Y_STEP_PIN);
903
+    #endif
872 904
     disable_y();
873 905
   #endif
874 906
   #if defined(Z_STEP_PIN) && (Z_STEP_PIN > -1)

Loading…
Annulla
Salva