Browse Source

Header and pins changes to support 5 extruders

Scott Lahteine 8 years ago
parent
commit
04050237f0

+ 10
- 0
Marlin/Marlin.h View File

113
   #define disable_e2() NOOP
113
   #define disable_e2() NOOP
114
   #define  enable_e3() NOOP
114
   #define  enable_e3() NOOP
115
   #define disable_e3() NOOP
115
   #define disable_e3() NOOP
116
+  #define  enable_e4() NOOP
117
+  #define disable_e4() NOOP
116
 
118
 
117
 #else // !MIXING_EXTRUDER
119
 #else // !MIXING_EXTRUDER
118
 
120
 
148
     #define disable_e3() NOOP
150
     #define disable_e3() NOOP
149
   #endif
151
   #endif
150
 
152
 
153
+  #if E_STEPPERS > 4 && HAS_E4_ENABLE
154
+    #define  enable_e4() E4_ENABLE_WRITE( E_ENABLE_ON)
155
+    #define disable_e4() E4_ENABLE_WRITE(!E_ENABLE_ON)
156
+  #else
157
+    #define  enable_e4() NOOP
158
+    #define disable_e4() NOOP
159
+  #endif
160
+
151
 #endif // !MIXING_EXTRUDER
161
 #endif // !MIXING_EXTRUDER
152
 
162
 
153
 #if ENABLED(G38_PROBE_TARGET)
163
 #if ENABLED(G38_PROBE_TARGET)

+ 2
- 0
Marlin/enum.h View File

106
   MeasureTemp_2,
106
   MeasureTemp_2,
107
   PrepareTemp_3,
107
   PrepareTemp_3,
108
   MeasureTemp_3,
108
   MeasureTemp_3,
109
+  PrepareTemp_4,
110
+  MeasureTemp_4,
109
   Prepare_FILWIDTH,
111
   Prepare_FILWIDTH,
110
   Measure_FILWIDTH,
112
   Measure_FILWIDTH,
111
   StartupDelay // Startup, delay initial temp reading a tiny bit so the hardware can settle
113
   StartupDelay // Startup, delay initial temp reading a tiny bit so the hardware can settle

+ 5
- 0
Marlin/language.h View File

268
 #define MSG_H2 "2"
268
 #define MSG_H2 "2"
269
 #define MSG_H3 "3"
269
 #define MSG_H3 "3"
270
 #define MSG_H4 "4"
270
 #define MSG_H4 "4"
271
+#define MSG_H5 "5"
271
 #define MSG_N1 " 1"
272
 #define MSG_N1 " 1"
272
 #define MSG_N2 " 2"
273
 #define MSG_N2 " 2"
273
 #define MSG_N3 " 3"
274
 #define MSG_N3 " 3"
274
 #define MSG_N4 " 4"
275
 #define MSG_N4 " 4"
276
+#define MSG_N5 " 5"
275
 #define MSG_E1 "E1"
277
 #define MSG_E1 "E1"
276
 #define MSG_E2 "E2"
278
 #define MSG_E2 "E2"
277
 #define MSG_E3 "E3"
279
 #define MSG_E3 "E3"
278
 #define MSG_E4 "E4"
280
 #define MSG_E4 "E4"
281
+#define MSG_E5 "E5"
279
 #define MSG_MOVE_E1 "1"
282
 #define MSG_MOVE_E1 "1"
280
 #define MSG_MOVE_E2 "2"
283
 #define MSG_MOVE_E2 "2"
281
 #define MSG_MOVE_E3 "3"
284
 #define MSG_MOVE_E3 "3"
282
 #define MSG_MOVE_E4 "4"
285
 #define MSG_MOVE_E4 "4"
286
+#define MSG_MOVE_E5 "5"
283
 #define MSG_DIAM_E1 " 1"
287
 #define MSG_DIAM_E1 " 1"
284
 #define MSG_DIAM_E2 " 2"
288
 #define MSG_DIAM_E2 " 2"
285
 #define MSG_DIAM_E3 " 3"
289
 #define MSG_DIAM_E3 " 3"
286
 #define MSG_DIAM_E4 " 4"
290
 #define MSG_DIAM_E4 " 4"
291
+#define MSG_DIAM_E5 " 5"
287
 
292
 
288
 #include INCLUDE_LANGUAGE
293
 #include INCLUDE_LANGUAGE
289
 
294
 

+ 6
- 4
Marlin/macros.h View File

128
 
128
 
129
 #define CEILING(x,y) (((x) + (y) - 1) / (y))
129
 #define CEILING(x,y) (((x) + (y) - 1) / (y))
130
 
130
 
131
-#define MIN3(a, b, c)    min(min(a, b), c)
132
-#define MIN4(a, b, c, d) min(min(a, b), min(c, d))
133
-#define MAX3(a, b, c)    max(max(a, b), c)
134
-#define MAX4(a, b, c, d) max(max(a, b), max(c, d))
131
+#define MIN3(a, b, c)       min(min(a, b), c)
132
+#define MIN4(a, b, c, d)    min(MIN3(a, b, c), d)
133
+#define MIN5(a, b, c, d, e) min(MIN4(a, b, c, d), e)
134
+#define MAX3(a, b, c)       max(max(a, b), c)
135
+#define MAX4(a, b, c, d)    max(MAX3(a, b, c), d)
136
+#define MAX5(a, b, c, d, e) max(MAX4(a, b, c, d), e)
135
 
137
 
136
 #define UNEAR_ZERO(x) ((x) < 0.000001)
138
 #define UNEAR_ZERO(x) ((x) < 0.000001)
137
 #define NEAR_ZERO(x) WITHIN(x, -0.000001, 0.000001)
139
 #define NEAR_ZERO(x) WITHIN(x, -0.000001, 0.000001)

+ 15
- 12
Marlin/pins.h View File

252
 #ifndef TEMP_3_PIN
252
 #ifndef TEMP_3_PIN
253
   #define TEMP_3_PIN -1
253
   #define TEMP_3_PIN -1
254
 #endif
254
 #endif
255
+#ifndef TEMP_4_PIN
256
+  #define TEMP_4_PIN -1
257
+#endif
255
 #ifndef TEMP_BED_PIN
258
 #ifndef TEMP_BED_PIN
256
   #define TEMP_BED_PIN -1
259
   #define TEMP_BED_PIN -1
257
 #endif
260
 #endif
279
 #endif
282
 #endif
280
 
283
 
281
 #ifndef MAX_EXTRUDERS
284
 #ifndef MAX_EXTRUDERS
282
-  #define MAX_EXTRUDERS 4
285
+  #define MAX_EXTRUDERS 5
283
 #endif
286
 #endif
284
 
287
 
285
 // Marlin needs to account for pins that equal -1
288
 // Marlin needs to account for pins that equal -1
320
       #if EXTRUDERS > 4
323
       #if EXTRUDERS > 4
321
         #undef _E4_PINS
324
         #undef _E4_PINS
322
         #define _E4_PINS E4_STEP_PIN, E4_DIR_PIN, E4_ENABLE_PIN,
325
         #define _E4_PINS E4_STEP_PIN, E4_DIR_PIN, E4_ENABLE_PIN,
323
-      #endif
324
-    #endif
325
-  #endif
326
-#endif
326
+      #endif // EXTRUDERS > 4
327
+    #endif // EXTRUDERS > 3
328
+  #endif // EXTRUDERS > 2
329
+#endif // EXTRUDERS > 1
327
 
330
 
328
 #define _H0_PINS HEATER_0_PIN, E0_AUTO_FAN_PIN, marlinAnalogInputToDigitalPin(TEMP_0_PIN),
331
 #define _H0_PINS HEATER_0_PIN, E0_AUTO_FAN_PIN, marlinAnalogInputToDigitalPin(TEMP_0_PIN),
329
 #define _H1_PINS
332
 #define _H1_PINS
343
       #if HOTENDS > 4
346
       #if HOTENDS > 4
344
         #undef _H4_PINS
347
         #undef _H4_PINS
345
         #define _H4_PINS HEATER_4_PIN, marlinAnalogInputToDigitalPin(TEMP_4_PIN),
348
         #define _H4_PINS HEATER_4_PIN, marlinAnalogInputToDigitalPin(TEMP_4_PIN),
346
-      #endif
347
-    #endif
348
-  #endif
349
+      #endif // HOTENDS > 4
350
+    #endif // HOTENDS > 3
351
+  #endif // HOTENDS > 2
349
 #elif ENABLED(MIXING_EXTRUDER)
352
 #elif ENABLED(MIXING_EXTRUDER)
350
   #undef _E1_PINS
353
   #undef _E1_PINS
351
   #define _E1_PINS E1_STEP_PIN, E1_DIR_PIN, E1_ENABLE_PIN,
354
   #define _E1_PINS E1_STEP_PIN, E1_DIR_PIN, E1_ENABLE_PIN,
358
       #if MIXING_STEPPERS > 4
361
       #if MIXING_STEPPERS > 4
359
         #undef _E4_PINS
362
         #undef _E4_PINS
360
         #define _E4_PINS E4_STEP_PIN, E4_DIR_PIN, E4_ENABLE_PIN,
363
         #define _E4_PINS E4_STEP_PIN, E4_DIR_PIN, E4_ENABLE_PIN,
361
-      #endif
362
-    #endif
363
-  #endif
364
-#endif
364
+      #endif // MIXING_STEPPERS > 4
365
+    #endif // MIXING_STEPPERS > 3
366
+  #endif // MIXING_STEPPERS > 2
367
+#endif // MIXING_STEPPERS > 1
365
 
368
 
366
 #define BED_PINS HEATER_BED_PIN, marlinAnalogInputToDigitalPin(TEMP_BED_PIN),
369
 #define BED_PINS HEATER_BED_PIN, marlinAnalogInputToDigitalPin(TEMP_BED_PIN),
367
 
370
 

+ 4
- 0
Marlin/pins_AZTEEG_X3_PRO.h View File

24
  * AZTEEG_X3_PRO (Arduino Mega) pin assignments
24
  * AZTEEG_X3_PRO (Arduino Mega) pin assignments
25
  */
25
  */
26
 
26
 
27
+#if HOTENDS > 5 || E_STEPPERS > 5
28
+  #error "Azteeg X3 Pro supports up to 5 hotends / E-steppers. Comment out this line to continue."
29
+#endif
30
+
27
 #define BOARD_NAME "Azteeg X3 Pro"
31
 #define BOARD_NAME "Azteeg X3 Pro"
28
 
32
 
29
 #include "pins_RAMPS.h"
33
 #include "pins_RAMPS.h"

+ 9
- 1
Marlin/stepper_indirection.h View File

388
   #define E_STEP_WRITE(v) E0_STEP_WRITE(v)
388
   #define E_STEP_WRITE(v) E0_STEP_WRITE(v)
389
   #define NORM_E_DIR() E0_DIR_WRITE(current_block->active_extruder ?  INVERT_E0_DIR : !INVERT_E0_DIR)
389
   #define NORM_E_DIR() E0_DIR_WRITE(current_block->active_extruder ?  INVERT_E0_DIR : !INVERT_E0_DIR)
390
   #define  REV_E_DIR() E0_DIR_WRITE(current_block->active_extruder ? !INVERT_E0_DIR :  INVERT_E0_DIR)
390
   #define  REV_E_DIR() E0_DIR_WRITE(current_block->active_extruder ? !INVERT_E0_DIR :  INVERT_E0_DIR)
391
+#elif EXTRUDERS > 4
392
+  #define E_STEP_WRITE(v) { switch (current_block->active_extruder) { case 0: E0_STEP_WRITE(v); break; case 1: E1_STEP_WRITE(v); break; case 2: E2_STEP_WRITE(v); break; case 3: E3_STEP_WRITE(v); break; case 4: E4_STEP_WRITE(v); } }
393
+  #define NORM_E_DIR() { switch (current_block->active_extruder) { case 0: E0_DIR_WRITE(!INVERT_E0_DIR); break; case 1: E1_DIR_WRITE(!INVERT_E1_DIR); break; case 2: E2_DIR_WRITE(!INVERT_E2_DIR); break; case 3: E3_DIR_WRITE(!INVERT_E3_DIR); break; case 4: E4_DIR_WRITE(!INVERT_E4_DIR); } }
394
+  #define REV_E_DIR() { switch (current_block->active_extruder) { case 0: E0_DIR_WRITE(INVERT_E0_DIR); break; case 1: E1_DIR_WRITE(INVERT_E1_DIR); break; case 2: E2_DIR_WRITE(INVERT_E2_DIR); break; case 3: E3_DIR_WRITE(INVERT_E3_DIR); break; case 4: E4_DIR_WRITE(INVERT_E4_DIR); } }
391
 #elif EXTRUDERS > 3
395
 #elif EXTRUDERS > 3
392
   #define E_STEP_WRITE(v) { switch (current_block->active_extruder) { case 0: E0_STEP_WRITE(v); break; case 1: E1_STEP_WRITE(v); break; case 2: E2_STEP_WRITE(v); break; case 3: E3_STEP_WRITE(v); } }
396
   #define E_STEP_WRITE(v) { switch (current_block->active_extruder) { case 0: E0_STEP_WRITE(v); break; case 1: E1_STEP_WRITE(v); break; case 2: E2_STEP_WRITE(v); break; case 3: E3_STEP_WRITE(v); } }
393
   #define NORM_E_DIR() { switch (current_block->active_extruder) { case 0: E0_DIR_WRITE(!INVERT_E0_DIR); break; case 1: E1_DIR_WRITE(!INVERT_E1_DIR); break; case 2: E2_DIR_WRITE(!INVERT_E2_DIR); break; case 3: E3_DIR_WRITE(!INVERT_E3_DIR); } }
397
   #define NORM_E_DIR() { switch (current_block->active_extruder) { case 0: E0_DIR_WRITE(!INVERT_E0_DIR); break; case 1: E1_DIR_WRITE(!INVERT_E1_DIR); break; case 2: E2_DIR_WRITE(!INVERT_E2_DIR); break; case 3: E3_DIR_WRITE(!INVERT_E3_DIR); } }
408
   #endif
412
   #endif
409
 #elif ENABLED(MIXING_EXTRUDER)
413
 #elif ENABLED(MIXING_EXTRUDER)
410
   #define E_STEP_WRITE(v) NOOP /* not used for mixing extruders! */
414
   #define E_STEP_WRITE(v) NOOP /* not used for mixing extruders! */
411
-  #if MIXING_STEPPERS > 3
415
+  #if MIXING_STEPPERS > 4
416
+    #define En_STEP_WRITE(n,v) { switch (n) { case 0: E0_STEP_WRITE(v); break; case 1: E1_STEP_WRITE(v); break; case 2: E2_STEP_WRITE(v); break; case 3: E3_STEP_WRITE(v); break; case 4: E4_STEP_WRITE(v); } }
417
+    #define NORM_E_DIR() { E0_DIR_WRITE(!INVERT_E0_DIR); E1_DIR_WRITE(!INVERT_E1_DIR); E2_DIR_WRITE(!INVERT_E2_DIR); E3_DIR_WRITE(!INVERT_E3_DIR); E4_DIR_WRITE(!INVERT_E4_DIR); }
418
+    #define REV_E_DIR()  { E0_DIR_WRITE( INVERT_E0_DIR); E1_DIR_WRITE( INVERT_E1_DIR); E2_DIR_WRITE( INVERT_E2_DIR); E3_DIR_WRITE( INVERT_E3_DIR); E4_DIR_WRITE( INVERT_E4_DIR); }
419
+  #elif MIXING_STEPPERS > 3
412
     #define En_STEP_WRITE(n,v) { switch (n) { case 0: E0_STEP_WRITE(v); break; case 1: E1_STEP_WRITE(v); break; case 2: E2_STEP_WRITE(v); break; case 3: E3_STEP_WRITE(v); } }
420
     #define En_STEP_WRITE(n,v) { switch (n) { case 0: E0_STEP_WRITE(v); break; case 1: E1_STEP_WRITE(v); break; case 2: E2_STEP_WRITE(v); break; case 3: E3_STEP_WRITE(v); } }
413
     #define NORM_E_DIR() { E0_DIR_WRITE(!INVERT_E0_DIR); E1_DIR_WRITE(!INVERT_E1_DIR); E2_DIR_WRITE(!INVERT_E2_DIR); E3_DIR_WRITE(!INVERT_E3_DIR); }
421
     #define NORM_E_DIR() { E0_DIR_WRITE(!INVERT_E0_DIR); E1_DIR_WRITE(!INVERT_E1_DIR); E2_DIR_WRITE(!INVERT_E2_DIR); E3_DIR_WRITE(!INVERT_E3_DIR); }
414
     #define REV_E_DIR()  { E0_DIR_WRITE( INVERT_E0_DIR); E1_DIR_WRITE( INVERT_E1_DIR); E2_DIR_WRITE( INVERT_E2_DIR); E3_DIR_WRITE( INVERT_E3_DIR); }
422
     #define REV_E_DIR()  { E0_DIR_WRITE( INVERT_E0_DIR); E1_DIR_WRITE( INVERT_E1_DIR); E2_DIR_WRITE( INVERT_E2_DIR); E3_DIR_WRITE( INVERT_E3_DIR); }

+ 4
- 0
Marlin/thermistortable_20.h View File

39
   #define HEATER_3_RAW_HI_TEMP 16383
39
   #define HEATER_3_RAW_HI_TEMP 16383
40
   #define HEATER_3_RAW_LO_TEMP 0
40
   #define HEATER_3_RAW_LO_TEMP 0
41
 #endif
41
 #endif
42
+#if (THERMISTORHEATER_4 == 20)
43
+  #define HEATER_4_RAW_HI_TEMP 16383
44
+  #define HEATER_4_RAW_LO_TEMP 0
45
+#endif
42
 #if (THERMISTORBED == 20)
46
 #if (THERMISTORBED == 20)
43
   #define HEATER_BED_RAW_HI_TEMP 16383
47
   #define HEATER_BED_RAW_HI_TEMP 16383
44
   #define HEATER_BED_RAW_LO_TEMP 0
48
   #define HEATER_BED_RAW_LO_TEMP 0

+ 11
- 1
Marlin/thermistortables.h View File

28
 
28
 
29
 #define OVERSAMPLENR 16
29
 #define OVERSAMPLENR 16
30
 
30
 
31
-#define ANY_THERMISTOR_IS(n) (THERMISTORHEATER_0 == n || THERMISTORHEATER_1 == n || THERMISTORHEATER_2 == n || THERMISTORHEATER_3 == n || THERMISTORBED == n)
31
+#define ANY_THERMISTOR_IS(n) (THERMISTORHEATER_0 == n || THERMISTORHEATER_1 == n || THERMISTORHEATER_2 == n || THERMISTORHEATER_3 == n || THERMISTORHEATER_4 == n || THERMISTORBED == n)
32
 
32
 
33
 // Pt1000 and Pt100 handling
33
 // Pt1000 and Pt100 handling
34
 //
34
 //
168
   #define HEATER_3_TEMPTABLE_LEN 0
168
   #define HEATER_3_TEMPTABLE_LEN 0
169
 #endif
169
 #endif
170
 
170
 
171
+#ifdef THERMISTORHEATER_4
172
+  #define HEATER_4_TEMPTABLE TT_NAME(THERMISTORHEATER_4)
173
+  #define HEATER_4_TEMPTABLE_LEN COUNT(HEATER_4_TEMPTABLE)
174
+#elif defined(HEATER_4_USES_THERMISTOR)
175
+  #error "No heater 4 thermistor table specified"
176
+#else
177
+  #define HEATER_4_TEMPTABLE NULL
178
+  #define HEATER_4_TEMPTABLE_LEN 0
179
+#endif
180
+
171
 #ifdef THERMISTORBED
181
 #ifdef THERMISTORBED
172
   #define BEDTEMPTABLE TT_NAME(THERMISTORBED)
182
   #define BEDTEMPTABLE TT_NAME(THERMISTORBED)
173
   #define BEDTEMPTABLE_LEN COUNT(BEDTEMPTABLE)
183
   #define BEDTEMPTABLE_LEN COUNT(BEDTEMPTABLE)

Loading…
Cancel
Save