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,6 +540,16 @@
540 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 553
    * Z_DUAL_ENDSTOPS endstop reassignment
544 554
    */
545 555
   #if ENABLED(Z_DUAL_ENDSTOPS)

+ 3
- 0
Marlin/Configuration.h View File

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

+ 3
- 1
Marlin/SanityCheck.h View File

@@ -149,7 +149,9 @@
149 149
     #error "EXTRUDERS must be 1 with Z_DUAL_STEPPER_DRIVERS."
150 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 157
  * Limited number of servos

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

@@ -120,6 +120,9 @@
120 120
 // :[1,2,3,4]
121 121
 #define EXTRUDERS 1
122 122
 
123
+// For Cyclops or any "multi-extruder" that shares a single nozzle.
124
+//#define SINGLENOZZLE
125
+
123 126
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
124 127
 // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
125 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,6 +120,9 @@
120 120
 // :[1,2,3,4]
121 121
 #define EXTRUDERS 2
122 122
 
123
+// For Cyclops or any "multi-extruder" that shares a single nozzle.
124
+//#define SINGLENOZZLE
125
+
123 126
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
124 127
 // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
125 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,6 +123,9 @@
123 123
 // :[1,2,3,4]
124 124
 #define EXTRUDERS 1
125 125
 
126
+// For Cyclops or any "multi-extruder" that shares a single nozzle.
127
+//#define SINGLENOZZLE
128
+
126 129
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
127 130
 // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
128 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,6 +120,9 @@
120 120
 // :[1,2,3,4]
121 121
 #define EXTRUDERS 1
122 122
 
123
+// For Cyclops or any "multi-extruder" that shares a single nozzle.
124
+//#define SINGLENOZZLE
125
+
123 126
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
124 127
 // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
125 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,6 +127,9 @@
127 127
 // :[1,2,3,4]
128 128
 #define EXTRUDERS 1
129 129
 
130
+// For Cyclops or any "multi-extruder" that shares a single nozzle.
131
+//#define SINGLENOZZLE
132
+
130 133
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
131 134
 // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
132 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,6 +120,9 @@
120 120
 // :[1,2,3,4]
121 121
 #define EXTRUDERS 1
122 122
 
123
+// For Cyclops or any "multi-extruder" that shares a single nozzle.
124
+//#define SINGLENOZZLE
125
+
123 126
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
124 127
 // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
125 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,6 +120,9 @@
120 120
 // :[1,2,3,4]
121 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 126
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
124 127
 // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
125 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,6 +145,9 @@
145 145
 // :[1,2,3,4]
146 146
 #define EXTRUDERS 1
147 147
 
148
+// For Cyclops or any "multi-extruder" that shares a single nozzle.
149
+//#define SINGLENOZZLE
150
+
148 151
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
149 152
 // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
150 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,6 +120,9 @@
120 120
 // :[1,2,3,4]
121 121
 #define EXTRUDERS 1
122 122
 
123
+// For Cyclops or any "multi-extruder" that shares a single nozzle.
124
+//#define SINGLENOZZLE
125
+
123 126
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
124 127
 // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
125 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,6 +123,9 @@
123 123
 // :[1,2,3,4]
124 124
 #define EXTRUDERS 1
125 125
 
126
+// For Cyclops or any "multi-extruder" that shares a single nozzle.
127
+//#define SINGLENOZZLE
128
+
126 129
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
127 130
 // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
128 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,6 +120,9 @@
120 120
 // :[1,2,3,4]
121 121
 #define EXTRUDERS 1
122 122
 
123
+// For Cyclops or any "multi-extruder" that shares a single nozzle.
124
+//#define SINGLENOZZLE
125
+
123 126
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
124 127
 // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
125 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,6 +120,9 @@
120 120
 // :[1,2,3,4]
121 121
 #define EXTRUDERS 2
122 122
 
123
+// For Cyclops or any "multi-extruder" that shares a single nozzle.
124
+//#define SINGLENOZZLE
125
+
123 126
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
124 127
 // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
125 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,6 +120,9 @@
120 120
 // :[1,2,3,4]
121 121
 #define EXTRUDERS 1
122 122
 
123
+// For Cyclops or any "multi-extruder" that shares a single nozzle.
124
+//#define SINGLENOZZLE
125
+
123 126
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
124 127
 // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
125 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,6 +120,9 @@
120 120
 // :[1,2,3,4]
121 121
 #define EXTRUDERS 1
122 122
 
123
+// For Cyclops or any "multi-extruder" that shares a single nozzle.
124
+//#define SINGLENOZZLE
125
+
123 126
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
124 127
 // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
125 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,6 +126,9 @@
126 126
 // :[1,2,3,4]
127 127
 #define EXTRUDERS 1
128 128
 
129
+// For Cyclops or any "multi-extruder" that shares a single nozzle.
130
+//#define SINGLENOZZLE
131
+
129 132
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
130 133
 // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
131 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,6 +113,9 @@
113 113
 // :[1,2,3,4]
114 114
 #define EXTRUDERS 1
115 115
 
116
+// For Cyclops or any "multi-extruder" that shares a single nozzle.
117
+//#define SINGLENOZZLE
118
+
116 119
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
117 120
 // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
118 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,6 +120,9 @@
120 120
 // :[1,2,3,4]
121 121
 #define EXTRUDERS 1
122 122
 
123
+// For Cyclops or any "multi-extruder" that shares a single nozzle.
124
+//#define SINGLENOZZLE
125
+
123 126
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
124 127
 // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
125 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,6 +120,9 @@
120 120
 // :[1,2,3,4]
121 121
 #define EXTRUDERS 1
122 122
 
123
+// For Cyclops or any "multi-extruder" that shares a single nozzle.
124
+//#define SINGLENOZZLE
125
+
123 126
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
124 127
 // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
125 128
 // For the other hotends it is their distance from the extruder 0 hotend.

+ 16
- 6
Marlin/temperature.cpp View File

@@ -417,19 +417,29 @@ float Temperature::get_pid_output(int e) {
417 417
 
418 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 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 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 438
             else {
429 439
               lpq[lpq_ptr++] = 0;
430 440
             }
431 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 443
             pid_output += cTerm[e];
434 444
           }
435 445
         #endif //PID_ADD_EXTRUSION_RATE

Loading…
Cancel
Save