Browse Source

Added CoreXY support (Thanks Ilan Moyer)

Erik van der Zalm 12 years ago
parent
commit
ea2c19f978
3 changed files with 16 additions and 14 deletions
  1. 6
    5
      Marlin/Configuration.h
  2. 9
    9
      Marlin/stepper.cpp
  3. 1
    0
      README.md

+ 6
- 5
Marlin/Configuration.h View File

35
 #define MOTHERBOARD 7
35
 #define MOTHERBOARD 7
36
 #endif
36
 #endif
37
 
37
 
38
-/// Comment out the following line to enable normal kinematics
39
 
38
 
40
-#define COREXY
41
 
39
 
42
 //===========================================================================
40
 //===========================================================================
43
 //=============================Thermal Settings  ============================
41
 //=============================Thermal Settings  ============================
131
 //=============================Mechanical Settings===========================
129
 //=============================Mechanical Settings===========================
132
 //===========================================================================
130
 //===========================================================================
133
 
131
 
132
+// Uncomment the following line to enable CoreXY kinematics
133
+// #define COREXY
134
+
134
 // corse Endstop Settings
135
 // corse Endstop Settings
135
 #define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors
136
 #define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors
136
 
137
 
172
 #define DISABLE_E false // For all extruders
173
 #define DISABLE_E false // For all extruders
173
 
174
 
174
 #define INVERT_X_DIR true    // for Mendel set to false, for Orca set to true
175
 #define INVERT_X_DIR true    // for Mendel set to false, for Orca set to true
175
-#define INVERT_Y_DIR true    // for Mendel set to true, for Orca set to false
176
+#define INVERT_Y_DIR false    // for Mendel set to true, for Orca set to false
176
 #define INVERT_Z_DIR true     // for Mendel set to false, for Orca set to true
177
 #define INVERT_Z_DIR true     // for Mendel set to false, for Orca set to true
177
 #define INVERT_E0_DIR false   // for direct drive extruder v9 set to true, for geared extruder set to false
178
 #define INVERT_E0_DIR false   // for direct drive extruder v9 set to true, for geared extruder set to false
178
 #define INVERT_E1_DIR false    // for direct drive extruder v9 set to true, for geared extruder set to false
179
 #define INVERT_E1_DIR false    // for direct drive extruder v9 set to true, for geared extruder set to false
184
 #define Y_HOME_DIR -1
185
 #define Y_HOME_DIR -1
185
 #define Z_HOME_DIR -1
186
 #define Z_HOME_DIR -1
186
 
187
 
187
-#define min_software_endstops false //If true, axis won't move to coordinates less than HOME_POS.
188
-#define max_software_endstops false  //If true, axis won't move to coordinates greater than the defined lengths below.
188
+#define min_software_endstops true //If true, axis won't move to coordinates less than HOME_POS.
189
+#define max_software_endstops true  //If true, axis won't move to coordinates greater than the defined lengths below.
189
 #define X_MAX_LENGTH 205
190
 #define X_MAX_LENGTH 205
190
 #define Y_MAX_LENGTH 205
191
 #define Y_MAX_LENGTH 205
191
 #define Z_MAX_LENGTH 200
192
 #define Z_MAX_LENGTH 200

+ 9
- 9
Marlin/stepper.cpp View File

488
         if (counter_x > 0) {
488
         if (counter_x > 0) {
489
           WRITE(X_STEP_PIN, HIGH);
489
           WRITE(X_STEP_PIN, HIGH);
490
           counter_x -= current_block->step_event_count;
490
           counter_x -= current_block->step_event_count;
491
-          WRITE(X_STEP_PIN, LOW);
492
           count_position[X_AXIS]+=count_direction[X_AXIS];   
491
           count_position[X_AXIS]+=count_direction[X_AXIS];   
492
+          WRITE(X_STEP_PIN, LOW);
493
         }
493
         }
494
   
494
   
495
         counter_y += current_block->steps_y;
495
         counter_y += current_block->steps_y;
496
         if (counter_y > 0) {
496
         if (counter_y > 0) {
497
           WRITE(Y_STEP_PIN, HIGH);
497
           WRITE(Y_STEP_PIN, HIGH);
498
-
498
+          counter_y -= current_block->step_event_count; 
499
+          count_position[Y_AXIS]+=count_direction[Y_AXIS];         
499
           WRITE(Y_STEP_PIN, LOW);
500
           WRITE(Y_STEP_PIN, LOW);
500
-
501
         }
501
         }
502
       #endif
502
       #endif
503
   
503
   
508
         if ((counter_x > 0)&&!(counter_y>0)){  //X step only
508
         if ((counter_x > 0)&&!(counter_y>0)){  //X step only
509
           WRITE(X_STEP_PIN, HIGH);
509
           WRITE(X_STEP_PIN, HIGH);
510
           WRITE(Y_STEP_PIN, HIGH);
510
           WRITE(Y_STEP_PIN, HIGH);
511
-          counter_x -= current_block->step_event_count;          
511
+          counter_x -= current_block->step_event_count; 
512
+          count_position[X_AXIS]+=count_direction[X_AXIS];         
512
           WRITE(X_STEP_PIN, LOW);
513
           WRITE(X_STEP_PIN, LOW);
513
           WRITE(Y_STEP_PIN, LOW);
514
           WRITE(Y_STEP_PIN, LOW);
514
-          count_position[X_AXIS]+=count_direction[X_AXIS];
515
         }
515
         }
516
         
516
         
517
         if (!(counter_x > 0)&&(counter_y>0)){  //Y step only
517
         if (!(counter_x > 0)&&(counter_y>0)){  //Y step only
518
           WRITE(X_STEP_PIN, HIGH);
518
           WRITE(X_STEP_PIN, HIGH);
519
           WRITE(Y_STEP_PIN, HIGH);
519
           WRITE(Y_STEP_PIN, HIGH);
520
-          counter_y -= current_block->step_event_count;          
520
+          counter_y -= current_block->step_event_count; 
521
+          count_position[Y_AXIS]+=count_direction[Y_AXIS];
521
           WRITE(X_STEP_PIN, LOW);
522
           WRITE(X_STEP_PIN, LOW);
522
           WRITE(Y_STEP_PIN, LOW);
523
           WRITE(Y_STEP_PIN, LOW);
523
-          count_position[Y_AXIS]+=count_direction[Y_AXIS];
524
         }        
524
         }        
525
         
525
         
526
         if ((counter_x > 0)&&(counter_y>0)){  //step in both axes
526
         if ((counter_x > 0)&&(counter_y>0)){  //step in both axes
553
       if (counter_z > 0) {
553
       if (counter_z > 0) {
554
         WRITE(Z_STEP_PIN, HIGH);
554
         WRITE(Z_STEP_PIN, HIGH);
555
         counter_z -= current_block->step_event_count;
555
         counter_z -= current_block->step_event_count;
556
-        WRITE(Z_STEP_PIN, LOW);
557
         count_position[Z_AXIS]+=count_direction[Z_AXIS];
556
         count_position[Z_AXIS]+=count_direction[Z_AXIS];
557
+        WRITE(Z_STEP_PIN, LOW);
558
       }
558
       }
559
 
559
 
560
       #ifndef ADVANCE
560
       #ifndef ADVANCE
562
         if (counter_e > 0) {
562
         if (counter_e > 0) {
563
           WRITE_E_STEP(HIGH);
563
           WRITE_E_STEP(HIGH);
564
           counter_e -= current_block->step_event_count;
564
           counter_e -= current_block->step_event_count;
565
-          WRITE_E_STEP(LOW);
566
           count_position[E_AXIS]+=count_direction[E_AXIS];
565
           count_position[E_AXIS]+=count_direction[E_AXIS];
566
+          WRITE_E_STEP(LOW);
567
         }
567
         }
568
       #endif //!ADVANCE
568
       #endif //!ADVANCE
569
       step_events_completed += 1;  
569
       step_events_completed += 1;  

+ 1
- 0
README.md View File

44
 *   Updated sdcardlib
44
 *   Updated sdcardlib
45
 *   Heater power reporting. Useful for PID monitoring.
45
 *   Heater power reporting. Useful for PID monitoring.
46
 *   PID tuning
46
 *   PID tuning
47
+*   CoreXY kinematics (www.corexy.com/theory.html)
47
 
48
 
48
 The default baudrate is 250000. This baudrate has less jitter and hence errors than the usual 115200 baud, but is less supported by drivers and host-environments.
49
 The default baudrate is 250000. This baudrate has less jitter and hence errors than the usual 115200 baud, but is less supported by drivers and host-environments.
49
 
50
 

Loading…
Cancel
Save