Browse Source

Merge remote-tracking branch 'upstream/Marlin_v1' into delta-configuration

Conflicts:
	Marlin/Marlin_main.cpp
Jim Morris 12 years ago
parent
commit
b9d7ccf1cd
9 changed files with 1775 additions and 1551 deletions
  1. 1
    0
      Marlin/Configuration.h
  2. 25
    0
      Marlin/Configuration_adv.h
  3. 5
    1
      Marlin/Marlin.h
  4. 106
    11
      Marlin/Marlin_main.cpp
  5. 1537
    1506
      Marlin/language.h
  6. 24
    11
      Marlin/pins.h
  7. 66
    22
      Marlin/stepper.cpp
  8. 9
    0
      Marlin/ultralcd.cpp
  9. 2
    0
      README.md

+ 1
- 0
Marlin/Configuration.h View File

28
 // 3  = MEGA/RAMPS up to 1.2 = 3
28
 // 3  = MEGA/RAMPS up to 1.2 = 3
29
 // 33 = RAMPS 1.3 / 1.4 (Power outputs: Extruder, Fan, Bed)
29
 // 33 = RAMPS 1.3 / 1.4 (Power outputs: Extruder, Fan, Bed)
30
 // 34 = RAMPS 1.3 / 1.4 (Power outputs: Extruder0, Extruder1, Bed)
30
 // 34 = RAMPS 1.3 / 1.4 (Power outputs: Extruder0, Extruder1, Bed)
31
+// 35 = RAMPS 1.3 / 1.4 (Power outputs: Extruder, Fan, Fan)
31
 // 4  = Duemilanove w/ ATMega328P pin assignment
32
 // 4  = Duemilanove w/ ATMega328P pin assignment
32
 // 5  = Gen6
33
 // 5  = Gen6
33
 // 51 = Gen6 deluxe
34
 // 51 = Gen6 deluxe

+ 25
- 0
Marlin/Configuration_adv.h View File

146
   #define EXTRUDERS 1
146
   #define EXTRUDERS 1
147
 #endif
147
 #endif
148
 
148
 
149
+// Enable this for dual x-carriage printers. 
150
+// A dual x-carriage design has the advantage that the inactive extruder can be parked which
151
+// prevents hot-end ooze contaminating the print. It also reduces the weight of each x-carriage
152
+// allowing faster printing speeds.
153
+//#define DUAL_X_CARRIAGE
154
+#ifdef DUAL_X_CARRIAGE
155
+// Configuration for second X-carriage
156
+// Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop;
157
+// the second x-carriage always homes to the maximum endstop.
158
+#define X2_MIN_POS 88     // set minimum to ensure second x-carriage doesn't hit the parked first X-carriage
159
+#define X2_MAX_POS 350.45 // set maximum to the distance between toolheads when both heads are homed 
160
+#define X2_HOME_DIR 1     // the second X-carriage always homes to the maximum endstop position
161
+#define X2_HOME_POS X2_MAX_POS // default home position is the maximum carriage position 
162
+    // However: In this mode the EXTRUDER_OFFSET_X value for the second extruder provides a software 
163
+    // override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops
164
+    // without modifying the firmware (through the "M218 T1 X???" command).
165
+    // Remember: you should set the second extruder x-offset to 0 in your slicer.
166
+
167
+// Pins for second x-carriage stepper driver (defined here to avoid further complicating pins.h)
168
+#define X2_ENABLE_PIN 29
169
+#define X2_STEP_PIN 25
170
+#define X2_DIR_PIN 23
171
+
172
+#endif // DUAL_X_CARRIAGE
173
+    
149
 //homing hits the endstop, then retracts by this distance, before it tries to slowly bump again:
174
 //homing hits the endstop, then retracts by this distance, before it tries to slowly bump again:
150
 #define X_HOME_RETRACT_MM 5 
175
 #define X_HOME_RETRACT_MM 5 
151
 #define Y_HOME_RETRACT_MM 5
176
 #define Y_HOME_RETRACT_MM 5

+ 5
- 1
Marlin/Marlin.h View File

96
 
96
 
97
 void manage_inactivity();
97
 void manage_inactivity();
98
 
98
 
99
-#if defined(X_ENABLE_PIN) && X_ENABLE_PIN > -1
99
+#if defined(DUAL_X_CARRIAGE) && defined(X_ENABLE_PIN) && X_ENABLE_PIN > -1 \
100
+    && defined(X2_ENABLE_PIN) && X2_ENABLE_PIN > -1
101
+  #define  enable_x() do { WRITE(X_ENABLE_PIN, X_ENABLE_ON); WRITE(X2_ENABLE_PIN, X_ENABLE_ON); } while (0)
102
+  #define disable_x() do { WRITE(X_ENABLE_PIN,!X_ENABLE_ON); WRITE(X2_ENABLE_PIN,!X_ENABLE_ON); } while (0)
103
+#elif defined(X_ENABLE_PIN) && X_ENABLE_PIN > -1
100
   #define  enable_x() WRITE(X_ENABLE_PIN, X_ENABLE_ON)
104
   #define  enable_x() WRITE(X_ENABLE_PIN, X_ENABLE_ON)
101
   #define disable_x() WRITE(X_ENABLE_PIN,!X_ENABLE_ON)
105
   #define disable_x() WRITE(X_ENABLE_PIN,!X_ENABLE_ON)
102
 #else
106
 #else

+ 106
- 11
Marlin/Marlin_main.cpp View File

194
   float retract_recover_length=0, retract_recover_feedrate=8*60;
194
   float retract_recover_length=0, retract_recover_feedrate=8*60;
195
 #endif
195
 #endif
196
 
196
 
197
+#ifdef ULTIPANEL
198
+	bool powersupply = true;
199
+#endif
200
+
197
 //===========================================================================
201
 //===========================================================================
198
 //=============================private variables=============================
202
 //=============================private variables=============================
199
 //===========================================================================
203
 //===========================================================================
677
 XYZ_CONSTS_FROM_CONFIG(float, home_retract_mm, HOME_RETRACT_MM);
681
 XYZ_CONSTS_FROM_CONFIG(float, home_retract_mm, HOME_RETRACT_MM);
678
 XYZ_CONSTS_FROM_CONFIG(signed char, home_dir,  HOME_DIR);
682
 XYZ_CONSTS_FROM_CONFIG(signed char, home_dir,  HOME_DIR);
679
 
683
 
684
+#ifdef DUAL_X_CARRIAGE
685
+  #if EXTRUDERS == 1 || defined(COREXY) \
686
+      || !defined(X2_ENABLE_PIN) || !defined(X2_STEP_PIN) || !defined(X2_DIR_PIN) \
687
+      || !defined(X2_HOME_POS) || !defined(X2_MIN_POS) || !defined(X2_MAX_POS) \
688
+      || !defined(X_MAX_PIN) || X_MAX_PIN < 0
689
+    #error "Missing or invalid definitions for DUAL_X_CARRIAGE mode."
690
+  #endif
691
+  #if X_HOME_DIR != -1 || X2_HOME_DIR != 1
692
+    #error "Please use canonical x-carriage assignment" // the x-carriages are defined by their homing directions
693
+  #endif  
694
+    
695
+static float x_home_pos(int extruder) {
696
+  if (extruder == 0)
697
+    return base_home_pos(X_AXIS) + add_homeing[X_AXIS];
698
+  else
699
+    // In dual carriage mode the extruder offset provides an override of the
700
+    // second X-carriage offset when homed - otherwise X2_HOME_POS is used.
701
+    // This allow soft recalibration of the second extruder offset position without firmware reflash 
702
+    // (through the M218 command).
703
+    return (extruder_offset[X_AXIS][1] > 0) ? extruder_offset[X_AXIS][1] : X2_HOME_POS;
704
+}
705
+
706
+static int x_home_dir(int extruder) {
707
+  return (extruder == 0) ? X_HOME_DIR : X2_HOME_DIR;
708
+}
709
+
710
+static float inactive_x_carriage_pos = X2_MAX_POS;
711
+#endif     
712
+
680
 static void axis_is_at_home(int axis) {
713
 static void axis_is_at_home(int axis) {
714
+#ifdef DUAL_X_CARRIAGE
715
+  if (axis == X_AXIS && active_extruder != 0) {
716
+    current_position[X_AXIS] = x_home_pos(active_extruder);
717
+    min_pos[X_AXIS] =          X2_MIN_POS;
718
+    max_pos[X_AXIS] =          max(extruder_offset[X_AXIS][1], X2_MAX_POS);
719
+    return;
720
+  }
721
+#endif  
681
   current_position[axis] = base_home_pos(axis) + add_homeing[axis];
722
   current_position[axis] = base_home_pos(axis) + add_homeing[axis];
682
   min_pos[axis] =          base_min_pos(axis) + add_homeing[axis];
723
   min_pos[axis] =          base_min_pos(axis) + add_homeing[axis];
683
   max_pos[axis] =          base_max_pos(axis) + add_homeing[axis];
724
   max_pos[axis] =          base_max_pos(axis) + add_homeing[axis];
686
 static void homeaxis(int axis) {
727
 static void homeaxis(int axis) {
687
 #define HOMEAXIS_DO(LETTER) \
728
 #define HOMEAXIS_DO(LETTER) \
688
   ((LETTER##_MIN_PIN > -1 && LETTER##_HOME_DIR==-1) || (LETTER##_MAX_PIN > -1 && LETTER##_HOME_DIR==1))
729
   ((LETTER##_MIN_PIN > -1 && LETTER##_HOME_DIR==-1) || (LETTER##_MAX_PIN > -1 && LETTER##_HOME_DIR==1))
730
+
689
   if (axis==X_AXIS ? HOMEAXIS_DO(X) :
731
   if (axis==X_AXIS ? HOMEAXIS_DO(X) :
690
       axis==Y_AXIS ? HOMEAXIS_DO(Y) :
732
       axis==Y_AXIS ? HOMEAXIS_DO(Y) :
691
       axis==Z_AXIS ? HOMEAXIS_DO(Z) :
733
       axis==Z_AXIS ? HOMEAXIS_DO(Z) :
692
       0) {
734
       0) {
735
+    int axis_home_dir = home_dir(axis);
736
+#ifdef DUAL_X_CARRIAGE
737
+    if (axis == X_AXIS)
738
+      axis_home_dir = x_home_dir(active_extruder);
739
+#endif
693
 
740
 
694
     // Engage Servo endstop if enabled
741
     // Engage Servo endstop if enabled
695
     #ifdef SERVO_ENDSTOPS
742
     #ifdef SERVO_ENDSTOPS
700
       
747
       
701
     current_position[axis] = 0;
748
     current_position[axis] = 0;
702
     plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
749
     plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
703
-    destination[axis] = 1.5 * max_length(axis) * home_dir(axis);
750
+    destination[axis] = 1.5 * max_length(axis) * axis_home_dir;
704
     feedrate = homing_feedrate[axis];
751
     feedrate = homing_feedrate[axis];
705
     plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder);
752
     plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder);
706
     st_synchronize();
753
     st_synchronize();
707
 
754
 
708
     current_position[axis] = 0;
755
     current_position[axis] = 0;
709
     plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
756
     plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
710
-    destination[axis] = -home_retract_mm(axis) * home_dir(axis);
757
+    destination[axis] = -home_retract_mm(axis) * axis_home_dir;
711
     plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder);
758
     plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder);
712
     st_synchronize();
759
     st_synchronize();
713
 
760
 
714
-    destination[axis] = 2*home_retract_mm(axis) * home_dir(axis);
761
+    destination[axis] = 2*home_retract_mm(axis) * axis_home_dir;
715
 #ifdef DELTA
762
 #ifdef DELTA
716
     feedrate = homing_feedrate[axis]/10;
763
     feedrate = homing_feedrate[axis]/10;
717
 #else
764
 #else
855
 
902
 
856
 #else // NOT DELTA
903
 #else // NOT DELTA
857
 
904
 
858
-          home_all_axis = !((code_seen(axis_codes[0])) || (code_seen(axis_codes[1])) || (code_seen(axis_codes[2])));
905
+      home_all_axis = !((code_seen(axis_codes[0])) || (code_seen(axis_codes[1])) || (code_seen(axis_codes[2])));
859
 
906
 
860
       #if Z_HOME_DIR > 0                      // If homing away from BED do Z first
907
       #if Z_HOME_DIR > 0                      // If homing away from BED do Z first
861
       if((home_all_axis) || (code_seen(axis_codes[Z_AXIS]))) {
908
       if((home_all_axis) || (code_seen(axis_codes[Z_AXIS]))) {
868
       {
915
       {
869
         current_position[X_AXIS] = 0;current_position[Y_AXIS] = 0;
916
         current_position[X_AXIS] = 0;current_position[Y_AXIS] = 0;
870
 
917
 
918
+       #ifndef DUAL_X_CARRIAGE
919
+        int x_axis_home_dir = home_dir(X_AXIS);
920
+       #else
921
+        int x_axis_home_dir = x_home_dir(active_extruder);
922
+       #endif
923
+        
871
         plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
924
         plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
872
-        destination[X_AXIS] = 1.5 * X_MAX_LENGTH * X_HOME_DIR;destination[Y_AXIS] = 1.5 * Y_MAX_LENGTH * Y_HOME_DIR;
925
+        destination[X_AXIS] = 1.5 * max_length(X_AXIS) * x_axis_home_dir;destination[Y_AXIS] = 1.5 * max_length(Y_AXIS) * home_dir(Y_AXIS);
873
         feedrate = homing_feedrate[X_AXIS];
926
         feedrate = homing_feedrate[X_AXIS];
874
         if(homing_feedrate[Y_AXIS]<feedrate)
927
         if(homing_feedrate[Y_AXIS]<feedrate)
875
           feedrate =homing_feedrate[Y_AXIS];
928
           feedrate =homing_feedrate[Y_AXIS];
894
 
947
 
895
       if((home_all_axis) || (code_seen(axis_codes[X_AXIS])))
948
       if((home_all_axis) || (code_seen(axis_codes[X_AXIS])))
896
       {
949
       {
950
+      #ifdef DUAL_X_CARRIAGE
951
+        int tmp_extruder = active_extruder;
952
+        active_extruder = !active_extruder;
953
+        HOMEAXIS(X);
954
+        inactive_x_carriage_pos = current_position[X_AXIS];
955
+        active_extruder = tmp_extruder;
956
+      #endif         
897
         HOMEAXIS(X);
957
         HOMEAXIS(X);
898
       }
958
       }
899
 
959
 
926
         }
986
         }
927
       }
987
       }
928
       plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
988
       plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
929
-#endif // DELTA
989
+#endif // else DELTA
930
           
990
           
931
       #ifdef ENDSTOPS_ONLY_FOR_HOMING
991
       #ifdef ENDSTOPS_ONLY_FOR_HOMING
932
         enable_endstops(false);
992
         enable_endstops(false);
1338
     #endif
1398
     #endif
1339
 
1399
 
1340
     #if defined(PS_ON_PIN) && PS_ON_PIN > -1
1400
     #if defined(PS_ON_PIN) && PS_ON_PIN > -1
1341
-      case 80: // M80 - ATX Power On
1401
+      case 80: // M80 - Turn on Power Supply
1342
         SET_OUTPUT(PS_ON_PIN); //GND
1402
         SET_OUTPUT(PS_ON_PIN); //GND
1343
         WRITE(PS_ON_PIN, PS_ON_AWAKE);
1403
         WRITE(PS_ON_PIN, PS_ON_AWAKE);
1404
+        #ifdef ULTIPANEL
1405
+          powersupply = true;
1406
+          LCD_MESSAGEPGM(WELCOME_MSG);
1407
+          lcd_update();
1408
+        #endif
1344
         break;
1409
         break;
1345
       #endif
1410
       #endif
1346
-
1347
-      case 81: // M81 - ATX Power Off
1348
-
1411
+      
1412
+      case 81: // M81 - Turn off Power Supply
1413
+        disable_heater();
1414
+        st_synchronize();
1415
+        disable_e0();
1416
+        disable_e1();
1417
+        disable_e2();
1418
+        finishAndDisableSteppers();
1419
+        fanSpeed = 0;
1420
+        delay(1000); // Wait a little before to switch off
1349
       #if defined(SUICIDE_PIN) && SUICIDE_PIN > -1
1421
       #if defined(SUICIDE_PIN) && SUICIDE_PIN > -1
1350
         st_synchronize();
1422
         st_synchronize();
1351
         suicide();
1423
         suicide();
1353
         SET_OUTPUT(PS_ON_PIN);
1425
         SET_OUTPUT(PS_ON_PIN);
1354
         WRITE(PS_ON_PIN, PS_ON_ASLEEP);
1426
         WRITE(PS_ON_PIN, PS_ON_ASLEEP);
1355
       #endif
1427
       #endif
1356
-        break;
1428
+      #ifdef ULTIPANEL
1429
+        powersupply = false;
1430
+        LCD_MESSAGEPGM(MACHINE_NAME" "MSG_OFF".");
1431
+        lcd_update();
1432
+      #endif
1433
+	  break;
1357
 
1434
 
1358
     case 82:
1435
     case 82:
1359
       axis_relative_modes[3] = false;
1436
       axis_relative_modes[3] = false;
2005
       if(tmp_extruder != active_extruder) {
2082
       if(tmp_extruder != active_extruder) {
2006
         // Save current position to return to after applying extruder offset
2083
         // Save current position to return to after applying extruder offset
2007
         memcpy(destination, current_position, sizeof(destination));
2084
         memcpy(destination, current_position, sizeof(destination));
2085
+      #ifdef DUAL_X_CARRIAGE
2086
+        // only apply Y extruder offset in dual x carriage mode (x offset is already used in determining home pos)
2087
+        current_position[Y_AXIS] = current_position[Y_AXIS] -
2088
+                     extruder_offset[Y_AXIS][active_extruder] +
2089
+                     extruder_offset[Y_AXIS][tmp_extruder];
2090
+
2091
+        float tmp_x_pos = current_position[X_AXIS];
2092
+
2093
+        // Set the new active extruder and position
2094
+        active_extruder = tmp_extruder;
2095
+        axis_is_at_home(X_AXIS); //this function updates X min/max values.
2096
+        current_position[X_AXIS] = inactive_x_carriage_pos;
2097
+        inactive_x_carriage_pos = tmp_x_pos;      
2098
+      #else    
2008
         // Offset extruder (only by XY)
2099
         // Offset extruder (only by XY)
2009
         int i;
2100
         int i;
2010
         for(i = 0; i < 2; i++) {
2101
         for(i = 0; i < 2; i++) {
2014
         }
2105
         }
2015
         // Set the new active extruder and position
2106
         // Set the new active extruder and position
2016
         active_extruder = tmp_extruder;
2107
         active_extruder = tmp_extruder;
2108
+      #endif //else DUAL_X_CARRIAGE
2017
         plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
2109
         plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
2018
         // Move to the old position if 'F' was in the parameters
2110
         // Move to the old position if 'F' was in the parameters
2019
         if(make_move && Stopped == false) {
2111
         if(make_move && Stopped == false) {
2258
        || !READ(E2_ENABLE_PIN)
2350
        || !READ(E2_ENABLE_PIN)
2259
     #endif
2351
     #endif
2260
     #if EXTRUDER > 1
2352
     #if EXTRUDER > 1
2353
+      #if defined(X2_ENABLE_PIN) && X2_ENABLE_PIN > -1
2354
+       || !READ(X2_ENABLE_PIN)
2355
+      #endif
2261
        || !READ(E1_ENABLE_PIN)
2356
        || !READ(E1_ENABLE_PIN)
2262
     #endif
2357
     #endif
2263
        || !READ(E0_ENABLE_PIN)) //If any of the drivers are enabled...
2358
        || !READ(E0_ENABLE_PIN)) //If any of the drivers are enabled...

+ 1537
- 1506
Marlin/language.h
File diff suppressed because it is too large
View File


+ 24
- 11
Marlin/pins.h View File

298
 * Arduino Mega pin assignment
298
 * Arduino Mega pin assignment
299
 *
299
 *
300
 ****************************************************************************************/
300
 ****************************************************************************************/
301
-#if MOTHERBOARD == 3 || MOTHERBOARD == 33 || MOTHERBOARD == 34 || MOTHERBOARD == 77
301
+#if MOTHERBOARD == 3 || MOTHERBOARD == 33 || MOTHERBOARD == 34 || MOTHERBOARD == 35 || MOTHERBOARD == 77
302
 #define KNOWN_BOARD 1
302
 #define KNOWN_BOARD 1
303
 
303
 
304
 //////////////////FIX THIS//////////////
304
 //////////////////FIX THIS//////////////
314
 // #define RAMPS_V_1_0
314
 // #define RAMPS_V_1_0
315
 
315
 
316
 
316
 
317
-#if MOTHERBOARD == 33 || MOTHERBOARD == 34 || MOTHERBOARD == 77
317
+#if MOTHERBOARD == 33 || MOTHERBOARD == 34 || MOTHERBOARD == 35 || MOTHERBOARD == 77
318
 
318
 
319
   #define LARGE_FLASH true
319
   #define LARGE_FLASH true
320
   
320
   
392
     #define LED_PIN            13
392
     #define LED_PIN            13
393
   #endif
393
   #endif
394
 
394
 
395
-  #if MOTHERBOARD == 33
395
+  #if MOTHERBOARD == 33 || MOTHERBOARD == 35
396
     #define FAN_PIN            9 // (Sprinter config)
396
     #define FAN_PIN            9 // (Sprinter config)
397
   #else
397
   #else
398
     #define FAN_PIN            4 // IO pin. Buffer needed
398
     #define FAN_PIN            4 // IO pin. Buffer needed
401
   #if MOTHERBOARD == 77
401
   #if MOTHERBOARD == 77
402
     #define FAN_PIN            8 
402
     #define FAN_PIN            8 
403
   #endif
403
   #endif
404
+  
405
+  #if MOTHERBOARD == 35
406
+    #define CONTROLLERFAN_PIN  10 //Pin used for the fan to cool controller
407
+  #endif
404
 
408
 
405
   #define PS_ON_PIN          12
409
   #define PS_ON_PIN          12
406
 
410
 
410
     #define KILL_PIN           -1
414
     #define KILL_PIN           -1
411
   #endif
415
   #endif
412
 
416
 
413
-  #define HEATER_0_PIN       10   // EXTRUDER 1
417
+  #if MOTHERBOARD == 35
418
+    #define HEATER_0_PIN       8
419
+  #else
420
+    #define HEATER_0_PIN       10   // EXTRUDER 1
421
+  #endif
422
+
414
   #if MOTHERBOARD == 33 
423
   #if MOTHERBOARD == 33 
415
     #define HEATER_1_PIN       -1
424
     #define HEATER_1_PIN       -1
416
   #else
425
   #else
417
     #define HEATER_1_PIN       9    // EXTRUDER 2 (FAN On Sprinter)
426
     #define HEATER_1_PIN       9    // EXTRUDER 2 (FAN On Sprinter)
418
   #endif
427
   #endif
428
+
419
   #define HEATER_2_PIN       -1 
429
   #define HEATER_2_PIN       -1 
420
 
430
 
421
   #if MOTHERBOARD == 77
431
   #if MOTHERBOARD == 77
427
   #define TEMP_0_PIN         13   // ANALOG NUMBERING
437
   #define TEMP_0_PIN         13   // ANALOG NUMBERING
428
   #define TEMP_1_PIN         15   // ANALOG NUMBERING
438
   #define TEMP_1_PIN         15   // ANALOG NUMBERING
429
   #define TEMP_2_PIN         -1   // ANALOG NUMBERING
439
   #define TEMP_2_PIN         -1   // ANALOG NUMBERING
430
-  #if MOTHERBOARD == 77
431
-    #define HEATER_BED_PIN     9    // BED
440
+
441
+  #if MOTHERBOARD == 35
442
+    #define HEATER_BED_PIN     -1    // NO BED
432
   #else
443
   #else
433
-    #define HEATER_BED_PIN     8    // BED
444
+    #if MOTHERBOARD == 77
445
+      #define HEATER_BED_PIN     9    // BED
446
+    #else
447
+      #define HEATER_BED_PIN     8    // BED
448
+    #endif
434
   #endif
449
   #endif
435
   #define TEMP_BED_PIN       14   // ANALOG NUMBERING
450
   #define TEMP_BED_PIN       14   // ANALOG NUMBERING
436
 
451
 
578
 #define TEMP_2_PIN          -1   
593
 #define TEMP_2_PIN          -1   
579
 #define TEMP_BED_PIN        1    // MUST USE ANALOG INPUT NUMBERING NOT DIGITAL OUTPUT NUMBERING!!!!!!!!!
594
 #define TEMP_BED_PIN        1    // MUST USE ANALOG INPUT NUMBERING NOT DIGITAL OUTPUT NUMBERING!!!!!!!!!
580
 
595
 
581
-#endif // MOTHERBOARD == 33 || MOTHERBOARD == 34 || MOTHERBOARD == 77
596
+#endif // MOTHERBOARD == 33 || MOTHERBOARD == 34 || MOTHERBOARD == 35 || MOTHERBOARD == 77
582
 
597
 
583
 // SPI for Max6675 Thermocouple 
598
 // SPI for Max6675 Thermocouple 
584
 
599
 
592
   #define MAX6675_SS       49
607
   #define MAX6675_SS       49
593
 #endif
608
 #endif
594
 
609
 
595
-#endif //MOTHERBOARD == 3 || MOTHERBOARD == 33 || MOTHERBOARD == 34 || MOTHERBOARD == 77
596
-
597
-
610
+#endif //MOTHERBOARD == 3 || MOTHERBOARD == 33 || MOTHERBOARD == 34 || MOTHERBOARD == 35 || MOTHERBOARD == 77
598
 
611
 
599
 /****************************************************************************************
612
 /****************************************************************************************
600
 * Duemilanove w/ ATMega328P pin assignment
613
 * Duemilanove w/ ATMega328P pin assignment

+ 66
- 22
Marlin/stepper.cpp View File

348
 
348
 
349
     // Set the direction bits (X_AXIS=A_AXIS and Y_AXIS=B_AXIS for COREXY)
349
     // Set the direction bits (X_AXIS=A_AXIS and Y_AXIS=B_AXIS for COREXY)
350
     if((out_bits & (1<<X_AXIS))!=0){
350
     if((out_bits & (1<<X_AXIS))!=0){
351
-      WRITE(X_DIR_PIN, INVERT_X_DIR);
351
+      #ifdef DUAL_X_CARRIAGE
352
+      if (active_extruder != 0)
353
+        WRITE(X2_DIR_PIN,INVERT_X_DIR);
354
+      else
355
+      #endif        
356
+        WRITE(X_DIR_PIN, INVERT_X_DIR);
352
       count_direction[X_AXIS]=-1;
357
       count_direction[X_AXIS]=-1;
353
     }
358
     }
354
     else{
359
     else{
355
-      WRITE(X_DIR_PIN, !INVERT_X_DIR);
360
+      #ifdef DUAL_X_CARRIAGE
361
+      if (active_extruder != 0)
362
+        WRITE(X2_DIR_PIN,!INVERT_X_DIR);
363
+      else
364
+      #endif        
365
+        WRITE(X_DIR_PIN, !INVERT_X_DIR);
356
       count_direction[X_AXIS]=1;
366
       count_direction[X_AXIS]=1;
357
     }
367
     }
358
     if((out_bits & (1<<Y_AXIS))!=0){
368
     if((out_bits & (1<<Y_AXIS))!=0){
372
     #endif
382
     #endif
373
       CHECK_ENDSTOPS
383
       CHECK_ENDSTOPS
374
       {
384
       {
375
-        #if defined(X_MIN_PIN) && X_MIN_PIN > -1
376
-          bool x_min_endstop=(READ(X_MIN_PIN) != X_ENDSTOPS_INVERTING);
377
-          if(x_min_endstop && old_x_min_endstop && (current_block->steps_x > 0)) {
378
-            endstops_trigsteps[X_AXIS] = count_position[X_AXIS];
379
-            endstop_x_hit=true;
380
-            step_events_completed = current_block->step_event_count;
381
-          }
382
-          old_x_min_endstop = x_min_endstop;
383
-        #endif
385
+        #ifdef DUAL_X_CARRIAGE
386
+        // with 2 x-carriages, endstops are only checked in the homing direction for the active extruder
387
+        if ((active_extruder == 0 && X_HOME_DIR == -1) || (active_extruder != 0 && X2_HOME_DIR == -1))
388
+        #endif          
389
+        {
390
+          #if defined(X_MIN_PIN) && X_MIN_PIN > -1
391
+            bool x_min_endstop=(READ(X_MIN_PIN) != X_ENDSTOPS_INVERTING);
392
+            if(x_min_endstop && old_x_min_endstop && (current_block->steps_x > 0)) {
393
+              endstops_trigsteps[X_AXIS] = count_position[X_AXIS];
394
+              endstop_x_hit=true;
395
+              step_events_completed = current_block->step_event_count;
396
+            }
397
+            old_x_min_endstop = x_min_endstop;
398
+          #endif
399
+        }
384
       }
400
       }
385
     }
401
     }
386
     else { // +direction
402
     else { // +direction
387
       CHECK_ENDSTOPS 
403
       CHECK_ENDSTOPS 
388
       {
404
       {
389
-        #if defined(X_MAX_PIN) && X_MAX_PIN > -1
390
-          bool x_max_endstop=(READ(X_MAX_PIN) != X_ENDSTOPS_INVERTING);
391
-          if(x_max_endstop && old_x_max_endstop && (current_block->steps_x > 0)){
392
-            endstops_trigsteps[X_AXIS] = count_position[X_AXIS];
393
-            endstop_x_hit=true;
394
-            step_events_completed = current_block->step_event_count;
395
-          }
396
-          old_x_max_endstop = x_max_endstop;
397
-        #endif
405
+        #ifdef DUAL_X_CARRIAGE
406
+        // with 2 x-carriages, endstops are only checked in the homing direction for the active extruder
407
+        if ((active_extruder == 0 && X_HOME_DIR == 1) || (active_extruder != 0 && X2_HOME_DIR == 1))
408
+        #endif          
409
+        {
410
+          #if defined(X_MAX_PIN) && X_MAX_PIN > -1
411
+            bool x_max_endstop=(READ(X_MAX_PIN) != X_ENDSTOPS_INVERTING);
412
+            if(x_max_endstop && old_x_max_endstop && (current_block->steps_x > 0)){
413
+              endstops_trigsteps[X_AXIS] = count_position[X_AXIS];
414
+              endstop_x_hit=true;
415
+              step_events_completed = current_block->step_event_count;
416
+            }
417
+            old_x_max_endstop = x_max_endstop;
418
+          #endif
419
+        }  
398
       }
420
       }
399
     }
421
     }
400
 
422
 
507
 
529
 
508
         counter_x += current_block->steps_x;
530
         counter_x += current_block->steps_x;
509
         if (counter_x > 0) {
531
         if (counter_x > 0) {
510
-          WRITE(X_STEP_PIN, !INVERT_X_STEP_PIN);
532
+          #ifdef DUAL_X_CARRIAGE
533
+          if (active_extruder != 0)
534
+            WRITE(X2_STEP_PIN,!INVERT_X_STEP_PIN);
535
+          else
536
+          #endif        
537
+            WRITE(X_STEP_PIN, !INVERT_X_STEP_PIN);
511
           counter_x -= current_block->step_event_count;
538
           counter_x -= current_block->step_event_count;
512
           count_position[X_AXIS]+=count_direction[X_AXIS];   
539
           count_position[X_AXIS]+=count_direction[X_AXIS];   
513
-          WRITE(X_STEP_PIN, INVERT_X_STEP_PIN);
540
+          #ifdef DUAL_X_CARRIAGE
541
+          if (active_extruder != 0)
542
+            WRITE(X2_STEP_PIN,INVERT_X_STEP_PIN);
543
+          else
544
+          #endif        
545
+            WRITE(X_STEP_PIN, INVERT_X_STEP_PIN);
514
         }
546
         }
515
   
547
   
516
         counter_y += current_block->steps_y;
548
         counter_y += current_block->steps_y;
685
   #if defined(X_DIR_PIN) && X_DIR_PIN > -1
717
   #if defined(X_DIR_PIN) && X_DIR_PIN > -1
686
     SET_OUTPUT(X_DIR_PIN);
718
     SET_OUTPUT(X_DIR_PIN);
687
   #endif
719
   #endif
720
+  #if defined(X2_DIR_PIN) && X2_DIR_PIN > -1
721
+    SET_OUTPUT(X2_DIR_PIN);
722
+  #endif
688
   #if defined(Y_DIR_PIN) && Y_DIR_PIN > -1 
723
   #if defined(Y_DIR_PIN) && Y_DIR_PIN > -1 
689
     SET_OUTPUT(Y_DIR_PIN);
724
     SET_OUTPUT(Y_DIR_PIN);
690
   #endif
725
   #endif
711
     SET_OUTPUT(X_ENABLE_PIN);
746
     SET_OUTPUT(X_ENABLE_PIN);
712
     if(!X_ENABLE_ON) WRITE(X_ENABLE_PIN,HIGH);
747
     if(!X_ENABLE_ON) WRITE(X_ENABLE_PIN,HIGH);
713
   #endif
748
   #endif
749
+  #if defined(X2_ENABLE_PIN) && X2_ENABLE_PIN > -1
750
+    SET_OUTPUT(X2_ENABLE_PIN);
751
+    if(!X_ENABLE_ON) WRITE(X2_ENABLE_PIN,HIGH);
752
+  #endif
714
   #if defined(Y_ENABLE_PIN) && Y_ENABLE_PIN > -1
753
   #if defined(Y_ENABLE_PIN) && Y_ENABLE_PIN > -1
715
     SET_OUTPUT(Y_ENABLE_PIN);
754
     SET_OUTPUT(Y_ENABLE_PIN);
716
     if(!Y_ENABLE_ON) WRITE(Y_ENABLE_PIN,HIGH);
755
     if(!Y_ENABLE_ON) WRITE(Y_ENABLE_PIN,HIGH);
788
     WRITE(X_STEP_PIN,INVERT_X_STEP_PIN);
827
     WRITE(X_STEP_PIN,INVERT_X_STEP_PIN);
789
     disable_x();
828
     disable_x();
790
   #endif  
829
   #endif  
830
+  #if defined(X2_STEP_PIN) && (X2_STEP_PIN > -1) 
831
+    SET_OUTPUT(X2_STEP_PIN);
832
+    WRITE(X2_STEP_PIN,INVERT_X_STEP_PIN);
833
+    disable_x();
834
+  #endif  
791
   #if defined(Y_STEP_PIN) && (Y_STEP_PIN > -1) 
835
   #if defined(Y_STEP_PIN) && (Y_STEP_PIN > -1) 
792
     SET_OUTPUT(Y_STEP_PIN);
836
     SET_OUTPUT(Y_STEP_PIN);
793
     WRITE(Y_STEP_PIN,INVERT_Y_STEP_PIN);
837
     WRITE(Y_STEP_PIN,INVERT_Y_STEP_PIN);

+ 9
- 0
Marlin/ultralcd.cpp View File

40
 /* Different menus */
40
 /* Different menus */
41
 static void lcd_status_screen();
41
 static void lcd_status_screen();
42
 #ifdef ULTIPANEL
42
 #ifdef ULTIPANEL
43
+extern bool powersupply;
43
 static void lcd_main_menu();
44
 static void lcd_main_menu();
44
 static void lcd_tune_menu();
45
 static void lcd_tune_menu();
45
 static void lcd_prepare_menu();
46
 static void lcd_prepare_menu();
348
     MENU_ITEM(function, MSG_PREHEAT_PLA, lcd_preheat_pla);
349
     MENU_ITEM(function, MSG_PREHEAT_PLA, lcd_preheat_pla);
349
     MENU_ITEM(function, MSG_PREHEAT_ABS, lcd_preheat_abs);
350
     MENU_ITEM(function, MSG_PREHEAT_ABS, lcd_preheat_abs);
350
     MENU_ITEM(function, MSG_COOLDOWN, lcd_cooldown);
351
     MENU_ITEM(function, MSG_COOLDOWN, lcd_cooldown);
352
+#if PS_ON_PIN > -1
353
+    if (powersupply)
354
+    {
355
+        MENU_ITEM(gcode, MSG_SWITCH_PS_OFF, PSTR("M81"));
356
+    }else{
357
+        MENU_ITEM(gcode, MSG_SWITCH_PS_ON, PSTR("M80"));
358
+    }
359
+#endif
351
     MENU_ITEM(submenu, MSG_MOVE_AXIS, lcd_move_menu);
360
     MENU_ITEM(submenu, MSG_MOVE_AXIS, lcd_move_menu);
352
     END_MENU();
361
     END_MENU();
353
 }
362
 }

+ 2
- 0
README.md View File

41
 *   Heater power reporting. Useful for PID monitoring.
41
 *   Heater power reporting. Useful for PID monitoring.
42
 *   PID tuning
42
 *   PID tuning
43
 *   CoreXY kinematics (www.corexy.com/theory.html)
43
 *   CoreXY kinematics (www.corexy.com/theory.html)
44
+*   Delta kinematics
45
+*   Dual X-carriage support for multiple extruder systems
44
 *   Configurable serial port to support connection of wireless adaptors.
46
 *   Configurable serial port to support connection of wireless adaptors.
45
 *   Automatic operation of extruder/cold-end cooling fans based on nozzle temperature
47
 *   Automatic operation of extruder/cold-end cooling fans based on nozzle temperature
46
 *   RC Servo Support, specify angle or duration for continuous rotation servos.
48
 *   RC Servo Support, specify angle or duration for continuous rotation servos.

Loading…
Cancel
Save