Browse Source

Merge pull request #3808 from thinkyhead/rc_singlenozzle

SINGLENOZZLE
Scott Lahteine 9 years ago
parent
commit
89e630b2fb

+ 10
- 0
Marlin/Conditionals.h View File

540
   #define ARRAY_BY_EXTRUDERS1(v1) ARRAY_BY_EXTRUDERS(v1, v1, v1, v1)
540
   #define ARRAY_BY_EXTRUDERS1(v1) ARRAY_BY_EXTRUDERS(v1, v1, v1, v1)
541
 
541
 
542
   /**
542
   /**
543
+   * With SINGLENOZZLE all "extruders" are in the same place
544
+   */
545
+  #if ENABLED(SINGLENOZZLE)
546
+    #undef EXTRUDER_OFFSET_X
547
+    #undef EXTRUDER_OFFSET_Y
548
+    #define EXTRUDER_OFFSET_X { 0 }
549
+    #define EXTRUDER_OFFSET_Y { 0 }
550
+  #endif
551
+
552
+  /**
543
    * Z_DUAL_ENDSTOPS endstop reassignment
553
    * Z_DUAL_ENDSTOPS endstop reassignment
544
    */
554
    */
545
   #if ENABLED(Z_DUAL_ENDSTOPS)
555
   #if ENABLED(Z_DUAL_ENDSTOPS)

+ 3
- 0
Marlin/Configuration.h View File

120
 // :[1,2,3,4]
120
 // :[1,2,3,4]
121
 #define EXTRUDERS 1
121
 #define EXTRUDERS 1
122
 
122
 
123
+// For Cyclops or any "multi-extruder" that shares a single nozzle.
124
+//#define SINGLENOZZLE
125
+
123
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
126
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
124
 // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
127
 // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
125
 // For the other hotends it is their distance from the extruder 0 hotend.
128
 // For the other hotends it is their distance from the extruder 0 hotend.

+ 3
- 1
Marlin/SanityCheck.h View File

149
     #error "EXTRUDERS must be 1 with Z_DUAL_STEPPER_DRIVERS."
149
     #error "EXTRUDERS must be 1 with Z_DUAL_STEPPER_DRIVERS."
150
   #endif
150
   #endif
151
 
151
 
152
-#endif // EXTRUDERS > 1
152
+#elif ENABLED(SINGLENOZZLE)
153
+  #error "SINGLENOZZLE requires 2 or more EXTRUDERS."
154
+#endif
153
 
155
 
154
 /**
156
 /**
155
  * Limited number of servos
157
  * Limited number of servos

+ 3
- 0
Marlin/example_configurations/Felix/Configuration.h View File

120
 // :[1,2,3,4]
120
 // :[1,2,3,4]
121
 #define EXTRUDERS 1
121
 #define EXTRUDERS 1
122
 
122
 
123
+// For Cyclops or any "multi-extruder" that shares a single nozzle.
124
+//#define SINGLENOZZLE
125
+
123
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
126
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
124
 // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
127
 // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
125
 // For the other hotends it is their distance from the extruder 0 hotend.
128
 // For the other hotends it is their distance from the extruder 0 hotend.

+ 3
- 0
Marlin/example_configurations/Felix/DUAL/Configuration.h View File

120
 // :[1,2,3,4]
120
 // :[1,2,3,4]
121
 #define EXTRUDERS 2
121
 #define EXTRUDERS 2
122
 
122
 
123
+// For Cyclops or any "multi-extruder" that shares a single nozzle.
124
+//#define SINGLENOZZLE
125
+
123
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
126
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
124
 // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
127
 // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
125
 // For the other hotends it is their distance from the extruder 0 hotend.
128
 // For the other hotends it is their distance from the extruder 0 hotend.

+ 3
- 0
Marlin/example_configurations/Hephestos/Configuration.h View File

123
 // :[1,2,3,4]
123
 // :[1,2,3,4]
124
 #define EXTRUDERS 1
124
 #define EXTRUDERS 1
125
 
125
 
126
+// For Cyclops or any "multi-extruder" that shares a single nozzle.
127
+//#define SINGLENOZZLE
128
+
126
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
129
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
127
 // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
130
 // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
128
 // For the other hotends it is their distance from the extruder 0 hotend.
131
 // For the other hotends it is their distance from the extruder 0 hotend.

+ 3
- 0
Marlin/example_configurations/Hephestos_2/Configuration.h View File

120
 // :[1,2,3,4]
120
 // :[1,2,3,4]
121
 #define EXTRUDERS 1
121
 #define EXTRUDERS 1
122
 
122
 
123
+// For Cyclops or any "multi-extruder" that shares a single nozzle.
124
+//#define SINGLENOZZLE
125
+
123
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
126
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
124
 // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
127
 // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
125
 // For the other hotends it is their distance from the extruder 0 hotend.
128
 // For the other hotends it is their distance from the extruder 0 hotend.

+ 3
- 0
Marlin/example_configurations/K8200/Configuration.h View File

127
 // :[1,2,3,4]
127
 // :[1,2,3,4]
128
 #define EXTRUDERS 1
128
 #define EXTRUDERS 1
129
 
129
 
130
+// For Cyclops or any "multi-extruder" that shares a single nozzle.
131
+//#define SINGLENOZZLE
132
+
130
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
133
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
131
 // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
134
 // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
132
 // For the other hotends it is their distance from the extruder 0 hotend.
135
 // For the other hotends it is their distance from the extruder 0 hotend.

+ 3
- 0
Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h View File

120
 // :[1,2,3,4]
120
 // :[1,2,3,4]
121
 #define EXTRUDERS 1
121
 #define EXTRUDERS 1
122
 
122
 
123
+// For Cyclops or any "multi-extruder" that shares a single nozzle.
124
+//#define SINGLENOZZLE
125
+
123
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
126
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
124
 // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
127
 // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
125
 // For the other hotends it is their distance from the extruder 0 hotend.
128
 // For the other hotends it is their distance from the extruder 0 hotend.

+ 3
- 0
Marlin/example_configurations/RigidBot/Configuration.h View File

120
 // :[1,2,3,4]
120
 // :[1,2,3,4]
121
 #define EXTRUDERS 1  // Single extruder. Set to 2 for dual extruders
121
 #define EXTRUDERS 1  // Single extruder. Set to 2 for dual extruders
122
 
122
 
123
+// For Cyclops or any "multi-extruder" that shares a single nozzle.
124
+//#define SINGLENOZZLE
125
+
123
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
126
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
124
 // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
127
 // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
125
 // For the other hotends it is their distance from the extruder 0 hotend.
128
 // For the other hotends it is their distance from the extruder 0 hotend.

+ 3
- 0
Marlin/example_configurations/SCARA/Configuration.h View File

145
 // :[1,2,3,4]
145
 // :[1,2,3,4]
146
 #define EXTRUDERS 1
146
 #define EXTRUDERS 1
147
 
147
 
148
+// For Cyclops or any "multi-extruder" that shares a single nozzle.
149
+//#define SINGLENOZZLE
150
+
148
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
151
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
149
 // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
152
 // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
150
 // For the other hotends it is their distance from the extruder 0 hotend.
153
 // For the other hotends it is their distance from the extruder 0 hotend.

+ 3
- 0
Marlin/example_configurations/TAZ4/Configuration.h View File

120
 // :[1,2,3,4]
120
 // :[1,2,3,4]
121
 #define EXTRUDERS 1
121
 #define EXTRUDERS 1
122
 
122
 
123
+// For Cyclops or any "multi-extruder" that shares a single nozzle.
124
+//#define SINGLENOZZLE
125
+
123
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
126
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
124
 // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
127
 // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
125
 // For the other hotends it is their distance from the extruder 0 hotend.
128
 // For the other hotends it is their distance from the extruder 0 hotend.

+ 3
- 0
Marlin/example_configurations/WITBOX/Configuration.h View File

123
 // :[1,2,3,4]
123
 // :[1,2,3,4]
124
 #define EXTRUDERS 1
124
 #define EXTRUDERS 1
125
 
125
 
126
+// For Cyclops or any "multi-extruder" that shares a single nozzle.
127
+//#define SINGLENOZZLE
128
+
126
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
129
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
127
 // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
130
 // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
128
 // For the other hotends it is their distance from the extruder 0 hotend.
131
 // For the other hotends it is their distance from the extruder 0 hotend.

+ 3
- 0
Marlin/example_configurations/adafruit/ST7565/Configuration.h View File

120
 // :[1,2,3,4]
120
 // :[1,2,3,4]
121
 #define EXTRUDERS 1
121
 #define EXTRUDERS 1
122
 
122
 
123
+// For Cyclops or any "multi-extruder" that shares a single nozzle.
124
+//#define SINGLENOZZLE
125
+
123
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
126
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
124
 // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
127
 // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
125
 // For the other hotends it is their distance from the extruder 0 hotend.
128
 // For the other hotends it is their distance from the extruder 0 hotend.

+ 3
- 0
Marlin/example_configurations/delta/biv2.5/Configuration.h View File

120
 // :[1,2,3,4]
120
 // :[1,2,3,4]
121
 #define EXTRUDERS 2
121
 #define EXTRUDERS 2
122
 
122
 
123
+// For Cyclops or any "multi-extruder" that shares a single nozzle.
124
+//#define SINGLENOZZLE
125
+
123
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
126
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
124
 // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
127
 // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
125
 // For the other hotends it is their distance from the extruder 0 hotend.
128
 // For the other hotends it is their distance from the extruder 0 hotend.

+ 3
- 0
Marlin/example_configurations/delta/generic/Configuration.h View File

120
 // :[1,2,3,4]
120
 // :[1,2,3,4]
121
 #define EXTRUDERS 1
121
 #define EXTRUDERS 1
122
 
122
 
123
+// For Cyclops or any "multi-extruder" that shares a single nozzle.
124
+//#define SINGLENOZZLE
125
+
123
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
126
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
124
 // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
127
 // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
125
 // For the other hotends it is their distance from the extruder 0 hotend.
128
 // For the other hotends it is their distance from the extruder 0 hotend.

+ 3
- 0
Marlin/example_configurations/delta/kossel_mini/Configuration.h View File

120
 // :[1,2,3,4]
120
 // :[1,2,3,4]
121
 #define EXTRUDERS 1
121
 #define EXTRUDERS 1
122
 
122
 
123
+// For Cyclops or any "multi-extruder" that shares a single nozzle.
124
+//#define SINGLENOZZLE
125
+
123
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
126
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
124
 // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
127
 // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
125
 // For the other hotends it is their distance from the extruder 0 hotend.
128
 // For the other hotends it is their distance from the extruder 0 hotend.

+ 3
- 0
Marlin/example_configurations/delta/kossel_pro/Configuration.h View File

126
 // :[1,2,3,4]
126
 // :[1,2,3,4]
127
 #define EXTRUDERS 1
127
 #define EXTRUDERS 1
128
 
128
 
129
+// For Cyclops or any "multi-extruder" that shares a single nozzle.
130
+//#define SINGLENOZZLE
131
+
129
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
132
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
130
 // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
133
 // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
131
 // For the other hotends it is their distance from the extruder 0 hotend.
134
 // For the other hotends it is their distance from the extruder 0 hotend.

+ 3
- 0
Marlin/example_configurations/delta/kossel_xl/Configuration.h View File

113
 // :[1,2,3,4]
113
 // :[1,2,3,4]
114
 #define EXTRUDERS 1
114
 #define EXTRUDERS 1
115
 
115
 
116
+// For Cyclops or any "multi-extruder" that shares a single nozzle.
117
+//#define SINGLENOZZLE
118
+
116
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
119
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
117
 // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
120
 // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
118
 // For the other hotends it is their distance from the extruder 0 hotend.
121
 // For the other hotends it is their distance from the extruder 0 hotend.

+ 3
- 0
Marlin/example_configurations/makibox/Configuration.h View File

120
 // :[1,2,3,4]
120
 // :[1,2,3,4]
121
 #define EXTRUDERS 1
121
 #define EXTRUDERS 1
122
 
122
 
123
+// For Cyclops or any "multi-extruder" that shares a single nozzle.
124
+//#define SINGLENOZZLE
125
+
123
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
126
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
124
 // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
127
 // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
125
 // For the other hotends it is their distance from the extruder 0 hotend.
128
 // For the other hotends it is their distance from the extruder 0 hotend.

+ 3
- 0
Marlin/example_configurations/tvrrug/Round2/Configuration.h View File

120
 // :[1,2,3,4]
120
 // :[1,2,3,4]
121
 #define EXTRUDERS 1
121
 #define EXTRUDERS 1
122
 
122
 
123
+// For Cyclops or any "multi-extruder" that shares a single nozzle.
124
+//#define SINGLENOZZLE
125
+
123
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
126
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
124
 // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
127
 // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
125
 // For the other hotends it is their distance from the extruder 0 hotend.
128
 // For the other hotends it is their distance from the extruder 0 hotend.

+ 16
- 6
Marlin/temperature.cpp View File

417
 
417
 
418
         pid_output = pTerm[e] + iTerm[e] - dTerm[e];
418
         pid_output = pTerm[e] + iTerm[e] - dTerm[e];
419
 
419
 
420
+        #if ENABLED(SINGLENOZZLE)
421
+          #define _NOZZLE_TEST     true
422
+          #define _NOZZLE_EXTRUDER active_extruder
423
+          #define _CTERM_INDEX     0
424
+        #else
425
+          #define _NOZZLE_TEST     e == active_extruder
426
+          #define _NOZZLE_EXTRUDER e
427
+          #define _CTERM_INDEX     e
428
+        #endif
429
+
420
         #if ENABLED(PID_ADD_EXTRUSION_RATE)
430
         #if ENABLED(PID_ADD_EXTRUSION_RATE)
421
-          cTerm[e] = 0;
422
-          if (e == active_extruder) {
431
+          cTerm[_CTERM_INDEX] = 0;
432
+          if (_NOZZLE_TEST) {
423
             long e_position = stepper.position(E_AXIS);
433
             long e_position = stepper.position(E_AXIS);
424
-            if (e_position > last_position[e]) {
425
-              lpq[lpq_ptr++] = e_position - last_position[e];
426
-              last_position[e] = e_position;
434
+            if (e_position > last_position[_NOZZLE_EXTRUDER]) {
435
+              lpq[lpq_ptr++] = e_position - last_position[_NOZZLE_EXTRUDER];
436
+              last_position[_NOZZLE_EXTRUDER] = e_position;
427
             }
437
             }
428
             else {
438
             else {
429
               lpq[lpq_ptr++] = 0;
439
               lpq[lpq_ptr++] = 0;
430
             }
440
             }
431
             if (lpq_ptr >= lpq_len) lpq_ptr = 0;
441
             if (lpq_ptr >= lpq_len) lpq_ptr = 0;
432
-            cTerm[e] = (lpq[lpq_ptr] / planner.axis_steps_per_unit[E_AXIS]) * PID_PARAM(Kc, e);
442
+            cTerm[_CTERM_INDEX] = (lpq[lpq_ptr] / planner.axis_steps_per_unit[E_AXIS]) * PID_PARAM(Kc, e);
433
             pid_output += cTerm[e];
443
             pid_output += cTerm[e];
434
           }
444
           }
435
         #endif //PID_ADD_EXTRUSION_RATE
445
         #endif //PID_ADD_EXTRUSION_RATE

Loading…
Cancel
Save