Selaa lähdekoodia

Merge pull request #1168 from boelle/Marlin_v1

Adding Support for Toshiba Stepper Drivers
galexander1 10 vuotta sitten
vanhempi
commit
2f9ed1777d
2 muutettua tiedostoa jossa 57 lisäystä ja 2 poistoa
  1. 4
    2
      Marlin/Configuration_adv.h
  2. 53
    0
      Marlin/stepper.cpp

+ 4
- 2
Marlin/Configuration_adv.h Näytä tiedosto

@@ -219,9 +219,11 @@
219 219
 //#define QUICK_HOME  //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially.
220 220
 
221 221
 #define AXIS_RELATIVE_MODES {false, false, false, false}
222
-
222
+#ifdef CONFIG_STEPPERS_TOSHIBA
223
+#define MAX_STEP_FREQUENCY 10000 // Max step frequency for Toshiba Stepper Controllers
224
+#else
223 225
 #define MAX_STEP_FREQUENCY 40000 // Max step frequency for Ultimaker (5000 pps / half step)
224
-
226
+#endif
225 227
 //By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step.
226 228
 #define INVERT_X_STEP_PIN false
227 229
 #define INVERT_Y_STEP_PIN false

+ 53
- 0
Marlin/stepper.cpp Näytä tiedosto

@@ -559,6 +559,58 @@ ISR(TIMER1_COMPA_vect)
559 559
       #endif //ADVANCE
560 560
 
561 561
         counter_x += current_block->steps_x;
562
+        #ifdef CONFIG_STEPPERS_TOSHIBA
563
+	/* The toshiba stepper controller require much longer pulses
564
+	 * tjerfore we 'stage' decompose the pulses between high, and
565
+	 * low instead of doing each in turn. The extra tests add enough
566
+	 * lag to allow it work with without needing NOPs */ 
567
+      if (counter_x > 0) {
568
+        WRITE(X_STEP_PIN, HIGH);
569
+      }
570
+
571
+      counter_y += current_block->steps_y;
572
+      if (counter_y > 0) {
573
+        WRITE(Y_STEP_PIN, HIGH);
574
+      }
575
+
576
+      counter_z += current_block->steps_z;
577
+      if (counter_z > 0) {
578
+        WRITE(Z_STEP_PIN, HIGH);
579
+      }
580
+
581
+      #ifndef ADVANCE
582
+        counter_e += current_block->steps_e;
583
+        if (counter_e > 0) {
584
+          WRITE_E_STEP(HIGH);
585
+        }
586
+      #endif //!ADVANCE
587
+
588
+      if (counter_x > 0) {
589
+        counter_x -= current_block->step_event_count;
590
+        count_position[X_AXIS]+=count_direction[X_AXIS];   
591
+        WRITE(X_STEP_PIN, LOW);
592
+      }
593
+
594
+      if (counter_y > 0) {
595
+        counter_y -= current_block->step_event_count;
596
+        count_position[Y_AXIS]+=count_direction[Y_AXIS];
597
+        WRITE(Y_STEP_PIN, LOW);
598
+      }
599
+
600
+      if (counter_z > 0) {
601
+        counter_z -= current_block->step_event_count;
602
+        count_position[Z_AXIS]+=count_direction[Z_AXIS];
603
+        WRITE(Z_STEP_PIN, LOW);
604
+      }
605
+
606
+      #ifndef ADVANCE
607
+        if (counter_e > 0) {
608
+          counter_e -= current_block->step_event_count;
609
+          count_position[E_AXIS]+=count_direction[E_AXIS];
610
+          WRITE_E_STEP(LOW);
611
+        }
612
+      #endif //!ADVANCE
613
+#else
562 614
         if (counter_x > 0) {
563 615
         #ifdef DUAL_X_CARRIAGE
564 616
           if (extruder_duplication_enabled){
@@ -635,6 +687,7 @@ ISR(TIMER1_COMPA_vect)
635 687
           WRITE_E_STEP(INVERT_E_STEP_PIN);
636 688
         }
637 689
       #endif //!ADVANCE
690
+      #endif
638 691
       step_events_completed += 1;
639 692
       if(step_events_completed >= current_block->step_event_count) break;
640 693
     }

Loading…
Peruuta
Tallenna