Parcourir la source

Header and pins changes to support 5 extruders

Scott Lahteine il y a 7 ans
Parent
révision
04050237f0

+ 10
- 0
Marlin/Marlin.h Voir le fichier

@@ -113,6 +113,8 @@ void manage_inactivity(bool ignore_stepper_queue = false);
113 113
   #define disable_e2() NOOP
114 114
   #define  enable_e3() NOOP
115 115
   #define disable_e3() NOOP
116
+  #define  enable_e4() NOOP
117
+  #define disable_e4() NOOP
116 118
 
117 119
 #else // !MIXING_EXTRUDER
118 120
 
@@ -148,6 +150,14 @@ void manage_inactivity(bool ignore_stepper_queue = false);
148 150
     #define disable_e3() NOOP
149 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 161
 #endif // !MIXING_EXTRUDER
152 162
 
153 163
 #if ENABLED(G38_PROBE_TARGET)

+ 2
- 0
Marlin/enum.h Voir le fichier

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

+ 5
- 0
Marlin/language.h Voir le fichier

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

+ 6
- 4
Marlin/macros.h Voir le fichier

@@ -128,10 +128,12 @@
128 128
 
129 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 138
 #define UNEAR_ZERO(x) ((x) < 0.000001)
137 139
 #define NEAR_ZERO(x) WITHIN(x, -0.000001, 0.000001)

+ 15
- 12
Marlin/pins.h Voir le fichier

@@ -252,6 +252,9 @@
252 252
 #ifndef TEMP_3_PIN
253 253
   #define TEMP_3_PIN -1
254 254
 #endif
255
+#ifndef TEMP_4_PIN
256
+  #define TEMP_4_PIN -1
257
+#endif
255 258
 #ifndef TEMP_BED_PIN
256 259
   #define TEMP_BED_PIN -1
257 260
 #endif
@@ -279,7 +282,7 @@
279 282
 #endif
280 283
 
281 284
 #ifndef MAX_EXTRUDERS
282
-  #define MAX_EXTRUDERS 4
285
+  #define MAX_EXTRUDERS 5
283 286
 #endif
284 287
 
285 288
 // Marlin needs to account for pins that equal -1
@@ -320,10 +323,10 @@
320 323
       #if EXTRUDERS > 4
321 324
         #undef _E4_PINS
322 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 331
 #define _H0_PINS HEATER_0_PIN, E0_AUTO_FAN_PIN, marlinAnalogInputToDigitalPin(TEMP_0_PIN),
329 332
 #define _H1_PINS
@@ -343,9 +346,9 @@
343 346
       #if HOTENDS > 4
344 347
         #undef _H4_PINS
345 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 352
 #elif ENABLED(MIXING_EXTRUDER)
350 353
   #undef _E1_PINS
351 354
   #define _E1_PINS E1_STEP_PIN, E1_DIR_PIN, E1_ENABLE_PIN,
@@ -358,10 +361,10 @@
358 361
       #if MIXING_STEPPERS > 4
359 362
         #undef _E4_PINS
360 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 369
 #define BED_PINS HEATER_BED_PIN, marlinAnalogInputToDigitalPin(TEMP_BED_PIN),
367 370
 

+ 4
- 0
Marlin/pins_AZTEEG_X3_PRO.h Voir le fichier

@@ -24,6 +24,10 @@
24 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 31
 #define BOARD_NAME "Azteeg X3 Pro"
28 32
 
29 33
 #include "pins_RAMPS.h"

+ 9
- 1
Marlin/stepper_indirection.h Voir le fichier

@@ -388,6 +388,10 @@
388 388
   #define E_STEP_WRITE(v) E0_STEP_WRITE(v)
389 389
   #define NORM_E_DIR() E0_DIR_WRITE(current_block->active_extruder ?  INVERT_E0_DIR : !INVERT_E0_DIR)
390 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 395
 #elif EXTRUDERS > 3
392 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 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,7 +412,11 @@
408 412
   #endif
409 413
 #elif ENABLED(MIXING_EXTRUDER)
410 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 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 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 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 Voir le fichier

@@ -39,6 +39,10 @@
39 39
   #define HEATER_3_RAW_HI_TEMP 16383
40 40
   #define HEATER_3_RAW_LO_TEMP 0
41 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 46
 #if (THERMISTORBED == 20)
43 47
   #define HEATER_BED_RAW_HI_TEMP 16383
44 48
   #define HEATER_BED_RAW_LO_TEMP 0

+ 11
- 1
Marlin/thermistortables.h Voir le fichier

@@ -28,7 +28,7 @@
28 28
 
29 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 33
 // Pt1000 and Pt100 handling
34 34
 //
@@ -168,6 +168,16 @@
168 168
   #define HEATER_3_TEMPTABLE_LEN 0
169 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 181
 #ifdef THERMISTORBED
172 182
   #define BEDTEMPTABLE TT_NAME(THERMISTORBED)
173 183
   #define BEDTEMPTABLE_LEN COUNT(BEDTEMPTABLE)

Chargement…
Annuler
Enregistrer