Browse Source

M166 Gradients, LCD Menu for 2-channel Mixer (Geeetech A10M/A20M) (#13022)

Scott Lahteine 6 years ago
parent
commit
6de3d34378
No account linked to committer's email address
100 changed files with 9435 additions and 43 deletions
  1. 4
    0
      Marlin/Configuration.h
  2. 4
    0
      Marlin/src/config/default/Configuration.h
  3. 4
    0
      Marlin/src/config/examples/3DFabXYZ/Migbot/Configuration.h
  4. 4
    0
      Marlin/src/config/examples/AlephObjects/TAZ4/Configuration.h
  5. 4
    0
      Marlin/src/config/examples/AliExpress/CL-260/Configuration.h
  6. 4
    0
      Marlin/src/config/examples/Anet/A2/Configuration.h
  7. 4
    0
      Marlin/src/config/examples/Anet/A2plus/Configuration.h
  8. 4
    0
      Marlin/src/config/examples/Anet/A6/Configuration.h
  9. 4
    0
      Marlin/src/config/examples/Anet/A8/Configuration.h
  10. 4
    0
      Marlin/src/config/examples/AnyCubic/i3/Configuration.h
  11. 4
    0
      Marlin/src/config/examples/ArmEd/Configuration.h
  12. 4
    0
      Marlin/src/config/examples/Azteeg/X5GT/Configuration.h
  13. 4
    0
      Marlin/src/config/examples/BIBO/TouchX/cyclops/Configuration.h
  14. 4
    0
      Marlin/src/config/examples/BIBO/TouchX/default/Configuration.h
  15. 4
    0
      Marlin/src/config/examples/BQ/Hephestos/Configuration.h
  16. 4
    0
      Marlin/src/config/examples/BQ/Hephestos_2/Configuration.h
  17. 4
    0
      Marlin/src/config/examples/BQ/WITBOX/Configuration.h
  18. 4
    0
      Marlin/src/config/examples/Cartesio/Configuration.h
  19. 4
    0
      Marlin/src/config/examples/Creality/CR-10/Configuration.h
  20. 4
    0
      Marlin/src/config/examples/Creality/CR-10S/Configuration.h
  21. 4
    0
      Marlin/src/config/examples/Creality/CR-10mini/Configuration.h
  22. 4
    0
      Marlin/src/config/examples/Creality/CR-8/Configuration.h
  23. 4
    0
      Marlin/src/config/examples/Creality/Ender-2/Configuration.h
  24. 4
    0
      Marlin/src/config/examples/Creality/Ender-3/Configuration.h
  25. 4
    0
      Marlin/src/config/examples/Creality/Ender-4/Configuration.h
  26. 4
    0
      Marlin/src/config/examples/Einstart-S/Configuration.h
  27. 4
    0
      Marlin/src/config/examples/Felix/Configuration.h
  28. 4
    0
      Marlin/src/config/examples/Felix/DUAL/Configuration.h
  29. 4
    0
      Marlin/src/config/examples/FlashForge/CreatorPro/Configuration.h
  30. 4
    0
      Marlin/src/config/examples/FolgerTech/i3-2020/Configuration.h
  31. 4
    0
      Marlin/src/config/examples/Formbot/Raptor/Configuration.h
  32. 4
    0
      Marlin/src/config/examples/Formbot/T_Rex_2+/Configuration.h
  33. 4
    0
      Marlin/src/config/examples/Formbot/T_Rex_3/Configuration.h
  34. 2093
    0
      Marlin/src/config/examples/Geeetech/A10M/Configuration.h
  35. 2243
    0
      Marlin/src/config/examples/Geeetech/A10M/Configuration_adv.h
  36. 2097
    0
      Marlin/src/config/examples/Geeetech/A20M/Configuration.h
  37. 2243
    0
      Marlin/src/config/examples/Geeetech/A20M/Configuration_adv.h
  38. 4
    0
      Marlin/src/config/examples/Geeetech/GT2560/Configuration.h
  39. 4
    0
      Marlin/src/config/examples/Geeetech/I3_Pro_X-GT2560/Configuration.h
  40. 4
    0
      Marlin/src/config/examples/Geeetech/MeCreator2/Configuration.h
  41. 4
    0
      Marlin/src/config/examples/Geeetech/Prusa i3 Pro B/bltouch/Configuration.h
  42. 4
    0
      Marlin/src/config/examples/Geeetech/Prusa i3 Pro B/noprobe/Configuration.h
  43. 4
    0
      Marlin/src/config/examples/Geeetech/Prusa i3 Pro C/Configuration.h
  44. 4
    0
      Marlin/src/config/examples/Geeetech/Prusa i3 Pro W/Configuration.h
  45. 4
    0
      Marlin/src/config/examples/Infitary/i3-M508/Configuration.h
  46. 4
    0
      Marlin/src/config/examples/JGAurora/A5/Configuration.h
  47. 4
    0
      Marlin/src/config/examples/MakerParts/Configuration.h
  48. 4
    0
      Marlin/src/config/examples/Malyan/M150/Configuration.h
  49. 4
    0
      Marlin/src/config/examples/Malyan/M200/Configuration.h
  50. 4
    0
      Marlin/src/config/examples/Micromake/C1/basic/Configuration.h
  51. 4
    0
      Marlin/src/config/examples/Micromake/C1/enhanced/Configuration.h
  52. 4
    0
      Marlin/src/config/examples/Mks/Robin/Configuration.h
  53. 4
    0
      Marlin/src/config/examples/Mks/Sbase/Configuration.h
  54. 4
    0
      Marlin/src/config/examples/RapideLite/RL200/Configuration.h
  55. 4
    0
      Marlin/src/config/examples/RepRapPro/Huxley/Configuration.h
  56. 4
    0
      Marlin/src/config/examples/RepRapWorld/Megatronics/Configuration.h
  57. 4
    0
      Marlin/src/config/examples/RigidBot/Configuration.h
  58. 4
    0
      Marlin/src/config/examples/SCARA/Configuration.h
  59. 4
    0
      Marlin/src/config/examples/STM32F10/Configuration.h
  60. 4
    0
      Marlin/src/config/examples/STM32F4/Configuration.h
  61. 4
    0
      Marlin/src/config/examples/Sanguinololu/Configuration.h
  62. 4
    0
      Marlin/src/config/examples/TheBorg/Configuration.h
  63. 4
    0
      Marlin/src/config/examples/TinyBoy2/Configuration.h
  64. 4
    0
      Marlin/src/config/examples/Tronxy/X1/Configuration.h
  65. 4
    0
      Marlin/src/config/examples/Tronxy/X3A/Configuration.h
  66. 4
    0
      Marlin/src/config/examples/Tronxy/X5S/Configuration.h
  67. 4
    0
      Marlin/src/config/examples/Tronxy/XY100/Configuration.h
  68. 4
    0
      Marlin/src/config/examples/UltiMachine/Archim1/Configuration.h
  69. 4
    0
      Marlin/src/config/examples/UltiMachine/Archim2/Configuration.h
  70. 4
    0
      Marlin/src/config/examples/VORONDesign/Configuration.h
  71. 4
    0
      Marlin/src/config/examples/Velleman/K8200/Configuration.h
  72. 4
    0
      Marlin/src/config/examples/Velleman/K8400/Configuration.h
  73. 4
    0
      Marlin/src/config/examples/Velleman/K8400/Dual-head/Configuration.h
  74. 4
    0
      Marlin/src/config/examples/WASP/PowerWASP/Configuration.h
  75. 4
    0
      Marlin/src/config/examples/Wanhao/Duplicator 6/Configuration.h
  76. 4
    0
      Marlin/src/config/examples/adafruit/ST7565/Configuration.h
  77. 4
    0
      Marlin/src/config/examples/delta/Anycubic/Kossel/Configuration.h
  78. 4
    0
      Marlin/src/config/examples/delta/FLSUN/auto_calibrate/Configuration.h
  79. 4
    0
      Marlin/src/config/examples/delta/FLSUN/kossel/Configuration.h
  80. 4
    0
      Marlin/src/config/examples/delta/FLSUN/kossel_mini/Configuration.h
  81. 4
    0
      Marlin/src/config/examples/delta/Geeetech/Rostock 301/Configuration.h
  82. 4
    0
      Marlin/src/config/examples/delta/Hatchbox_Alpha/Configuration.h
  83. 4
    0
      Marlin/src/config/examples/delta/MKS/SBASE/Configuration.h
  84. 4
    0
      Marlin/src/config/examples/delta/Tevo Little Monster/Configuration.h
  85. 4
    0
      Marlin/src/config/examples/delta/generic/Configuration.h
  86. 4
    0
      Marlin/src/config/examples/delta/kossel_mini/Configuration.h
  87. 4
    0
      Marlin/src/config/examples/delta/kossel_pro/Configuration.h
  88. 4
    0
      Marlin/src/config/examples/delta/kossel_xl/Configuration.h
  89. 4
    0
      Marlin/src/config/examples/gCreate/gMax1.5+/Configuration.h
  90. 4
    0
      Marlin/src/config/examples/makibox/Configuration.h
  91. 4
    0
      Marlin/src/config/examples/stm32f103ret6/Configuration.h
  92. 4
    0
      Marlin/src/config/examples/tvrrug/Round2/Configuration.h
  93. 4
    0
      Marlin/src/config/examples/wt150/Configuration.h
  94. 89
    9
      Marlin/src/feature/mixing.cpp
  95. 185
    28
      Marlin/src/feature/mixing.h
  96. 8
    0
      Marlin/src/feature/power_loss_recovery.cpp
  97. 13
    0
      Marlin/src/feature/power_loss_recovery.h
  98. 8
    6
      Marlin/src/gcode/feature/mixing/M163-M165.cpp
  99. 100
    0
      Marlin/src/gcode/feature/mixing/M166.cpp
  100. 0
    0
      Marlin/src/gcode/gcode.cpp

+ 4
- 0
Marlin/Configuration.h View File

@@ -271,6 +271,10 @@
271 271
   #define MIXING_STEPPERS 2        // Number of steppers in your mixing extruder
272 272
   #define MIXING_VIRTUAL_TOOLS 16  // Use the Virtual Tool method with M163 and M164
273 273
   //#define DIRECT_MIXING_IN_G1    // Allow ABCDHI mix factors in G1 movement commands
274
+  //#define GRADIENT_MIX           // Support for gradient mixing with M166 and LCD
275
+  #if ENABLED(GRADIENT_MIX)
276
+    //#define GRADIENT_VTOOL       // Add M166 T to use a V-tool index as a Gradient alias
277
+  #endif
274 278
 #endif
275 279
 
276 280
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).

+ 4
- 0
Marlin/src/config/default/Configuration.h View File

@@ -271,6 +271,10 @@
271 271
   #define MIXING_STEPPERS 2        // Number of steppers in your mixing extruder
272 272
   #define MIXING_VIRTUAL_TOOLS 16  // Use the Virtual Tool method with M163 and M164
273 273
   //#define DIRECT_MIXING_IN_G1    // Allow ABCDHI mix factors in G1 movement commands
274
+  //#define GRADIENT_MIX           // Support for gradient mixing with M166 and LCD
275
+  #if ENABLED(GRADIENT_MIX)
276
+    //#define GRADIENT_VTOOL       // Add M166 T to use a V-tool index as a Gradient alias
277
+  #endif
274 278
 #endif
275 279
 
276 280
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).

+ 4
- 0
Marlin/src/config/examples/3DFabXYZ/Migbot/Configuration.h View File

@@ -271,6 +271,10 @@
271 271
   #define MIXING_STEPPERS 2        // Number of steppers in your mixing extruder
272 272
   #define MIXING_VIRTUAL_TOOLS 16  // Use the Virtual Tool method with M163 and M164
273 273
   //#define DIRECT_MIXING_IN_G1    // Allow ABCDHI mix factors in G1 movement commands
274
+  //#define GRADIENT_MIX           // Support for gradient mixing with M166 and LCD
275
+  #if ENABLED(GRADIENT_MIX)
276
+    //#define GRADIENT_VTOOL       // Add M166 T to use a V-tool index as a Gradient alias
277
+  #endif
274 278
 #endif
275 279
 
276 280
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).

+ 4
- 0
Marlin/src/config/examples/AlephObjects/TAZ4/Configuration.h View File

@@ -271,6 +271,10 @@
271 271
   #define MIXING_STEPPERS 2        // Number of steppers in your mixing extruder
272 272
   #define MIXING_VIRTUAL_TOOLS 16  // Use the Virtual Tool method with M163 and M164
273 273
   //#define DIRECT_MIXING_IN_G1    // Allow ABCDHI mix factors in G1 movement commands
274
+  //#define GRADIENT_MIX           // Support for gradient mixing with M166 and LCD
275
+  #if ENABLED(GRADIENT_MIX)
276
+    //#define GRADIENT_VTOOL       // Add M166 T to use a V-tool index as a Gradient alias
277
+  #endif
274 278
 #endif
275 279
 
276 280
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).

+ 4
- 0
Marlin/src/config/examples/AliExpress/CL-260/Configuration.h View File

@@ -271,6 +271,10 @@
271 271
   #define MIXING_STEPPERS 2        // Number of steppers in your mixing extruder
272 272
   #define MIXING_VIRTUAL_TOOLS 16  // Use the Virtual Tool method with M163 and M164
273 273
   //#define DIRECT_MIXING_IN_G1    // Allow ABCDHI mix factors in G1 movement commands
274
+  //#define GRADIENT_MIX           // Support for gradient mixing with M166 and LCD
275
+  #if ENABLED(GRADIENT_MIX)
276
+    //#define GRADIENT_VTOOL       // Add M166 T to use a V-tool index as a Gradient alias
277
+  #endif
274 278
 #endif
275 279
 
276 280
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).

+ 4
- 0
Marlin/src/config/examples/Anet/A2/Configuration.h View File

@@ -271,6 +271,10 @@
271 271
   #define MIXING_STEPPERS 2        // Number of steppers in your mixing extruder
272 272
   #define MIXING_VIRTUAL_TOOLS 16  // Use the Virtual Tool method with M163 and M164
273 273
   //#define DIRECT_MIXING_IN_G1    // Allow ABCDHI mix factors in G1 movement commands
274
+  //#define GRADIENT_MIX           // Support for gradient mixing with M166 and LCD
275
+  #if ENABLED(GRADIENT_MIX)
276
+    //#define GRADIENT_VTOOL       // Add M166 T to use a V-tool index as a Gradient alias
277
+  #endif
274 278
 #endif
275 279
 
276 280
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).

+ 4
- 0
Marlin/src/config/examples/Anet/A2plus/Configuration.h View File

@@ -271,6 +271,10 @@
271 271
   #define MIXING_STEPPERS 2        // Number of steppers in your mixing extruder
272 272
   #define MIXING_VIRTUAL_TOOLS 16  // Use the Virtual Tool method with M163 and M164
273 273
   //#define DIRECT_MIXING_IN_G1    // Allow ABCDHI mix factors in G1 movement commands
274
+  //#define GRADIENT_MIX           // Support for gradient mixing with M166 and LCD
275
+  #if ENABLED(GRADIENT_MIX)
276
+    //#define GRADIENT_VTOOL       // Add M166 T to use a V-tool index as a Gradient alias
277
+  #endif
274 278
 #endif
275 279
 
276 280
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).

+ 4
- 0
Marlin/src/config/examples/Anet/A6/Configuration.h View File

@@ -271,6 +271,10 @@
271 271
   #define MIXING_STEPPERS 2        // Number of steppers in your mixing extruder
272 272
   #define MIXING_VIRTUAL_TOOLS 16  // Use the Virtual Tool method with M163 and M164
273 273
   //#define DIRECT_MIXING_IN_G1    // Allow ABCDHI mix factors in G1 movement commands
274
+  //#define GRADIENT_MIX           // Support for gradient mixing with M166 and LCD
275
+  #if ENABLED(GRADIENT_MIX)
276
+    //#define GRADIENT_VTOOL       // Add M166 T to use a V-tool index as a Gradient alias
277
+  #endif
274 278
 #endif
275 279
 
276 280
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).

+ 4
- 0
Marlin/src/config/examples/Anet/A8/Configuration.h View File

@@ -272,6 +272,10 @@
272 272
   #define MIXING_STEPPERS 2        // Number of steppers in your mixing extruder
273 273
   #define MIXING_VIRTUAL_TOOLS 16  // Use the Virtual Tool method with M163 and M164
274 274
   //#define DIRECT_MIXING_IN_G1    // Allow ABCDHI mix factors in G1 movement commands
275
+  //#define GRADIENT_MIX           // Support for gradient mixing with M166 and LCD
276
+  #if ENABLED(GRADIENT_MIX)
277
+    //#define GRADIENT_VTOOL       // Add M166 T to use a V-tool index as a Gradient alias
278
+  #endif
275 279
 #endif
276 280
 
277 281
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).

+ 4
- 0
Marlin/src/config/examples/AnyCubic/i3/Configuration.h View File

@@ -272,6 +272,10 @@
272 272
   #define MIXING_STEPPERS 2        // Number of steppers in your mixing extruder
273 273
   #define MIXING_VIRTUAL_TOOLS 16  // Use the Virtual Tool method with M163 and M164
274 274
   //#define DIRECT_MIXING_IN_G1    // Allow ABCDHI mix factors in G1 movement commands
275
+  //#define GRADIENT_MIX           // Support for gradient mixing with M166 and LCD
276
+  #if ENABLED(GRADIENT_MIX)
277
+    //#define GRADIENT_VTOOL       // Add M166 T to use a V-tool index as a Gradient alias
278
+  #endif
275 279
 #endif
276 280
 
277 281
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).

+ 4
- 0
Marlin/src/config/examples/ArmEd/Configuration.h View File

@@ -271,6 +271,10 @@
271 271
   #define MIXING_STEPPERS 2        // Number of steppers in your mixing extruder
272 272
   #define MIXING_VIRTUAL_TOOLS 16  // Use the Virtual Tool method with M163 and M164
273 273
   //#define DIRECT_MIXING_IN_G1    // Allow ABCDHI mix factors in G1 movement commands
274
+  //#define GRADIENT_MIX           // Support for gradient mixing with M166 and LCD
275
+  #if ENABLED(GRADIENT_MIX)
276
+    //#define GRADIENT_VTOOL       // Add M166 T to use a V-tool index as a Gradient alias
277
+  #endif
274 278
 #endif
275 279
 
276 280
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).

+ 4
- 0
Marlin/src/config/examples/Azteeg/X5GT/Configuration.h View File

@@ -271,6 +271,10 @@
271 271
   #define MIXING_STEPPERS 2        // Number of steppers in your mixing extruder
272 272
   #define MIXING_VIRTUAL_TOOLS 16  // Use the Virtual Tool method with M163 and M164
273 273
   //#define DIRECT_MIXING_IN_G1    // Allow ABCDHI mix factors in G1 movement commands
274
+  //#define GRADIENT_MIX           // Support for gradient mixing with M166 and LCD
275
+  #if ENABLED(GRADIENT_MIX)
276
+    //#define GRADIENT_VTOOL       // Add M166 T to use a V-tool index as a Gradient alias
277
+  #endif
274 278
 #endif
275 279
 
276 280
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).

+ 4
- 0
Marlin/src/config/examples/BIBO/TouchX/cyclops/Configuration.h View File

@@ -271,6 +271,10 @@
271 271
   #define MIXING_STEPPERS 2        // Number of steppers in your mixing extruder
272 272
   #define MIXING_VIRTUAL_TOOLS 16  // Use the Virtual Tool method with M163 and M164
273 273
   //#define DIRECT_MIXING_IN_G1    // Allow ABCDHI mix factors in G1 movement commands
274
+  //#define GRADIENT_MIX           // Support for gradient mixing with M166 and LCD
275
+  #if ENABLED(GRADIENT_MIX)
276
+    //#define GRADIENT_VTOOL       // Add M166 T to use a V-tool index as a Gradient alias
277
+  #endif
274 278
 #endif
275 279
 
276 280
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).

+ 4
- 0
Marlin/src/config/examples/BIBO/TouchX/default/Configuration.h View File

@@ -271,6 +271,10 @@
271 271
   #define MIXING_STEPPERS 2        // Number of steppers in your mixing extruder
272 272
   #define MIXING_VIRTUAL_TOOLS 16  // Use the Virtual Tool method with M163 and M164
273 273
   //#define DIRECT_MIXING_IN_G1    // Allow ABCDHI mix factors in G1 movement commands
274
+  //#define GRADIENT_MIX           // Support for gradient mixing with M166 and LCD
275
+  #if ENABLED(GRADIENT_MIX)
276
+    //#define GRADIENT_VTOOL       // Add M166 T to use a V-tool index as a Gradient alias
277
+  #endif
274 278
 #endif
275 279
 
276 280
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).

+ 4
- 0
Marlin/src/config/examples/BQ/Hephestos/Configuration.h View File

@@ -271,6 +271,10 @@
271 271
   #define MIXING_STEPPERS 2        // Number of steppers in your mixing extruder
272 272
   #define MIXING_VIRTUAL_TOOLS 16  // Use the Virtual Tool method with M163 and M164
273 273
   //#define DIRECT_MIXING_IN_G1    // Allow ABCDHI mix factors in G1 movement commands
274
+  //#define GRADIENT_MIX           // Support for gradient mixing with M166 and LCD
275
+  #if ENABLED(GRADIENT_MIX)
276
+    //#define GRADIENT_VTOOL       // Add M166 T to use a V-tool index as a Gradient alias
277
+  #endif
274 278
 #endif
275 279
 
276 280
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).

+ 4
- 0
Marlin/src/config/examples/BQ/Hephestos_2/Configuration.h View File

@@ -279,6 +279,10 @@
279 279
   #define MIXING_STEPPERS 2        // Number of steppers in your mixing extruder
280 280
   #define MIXING_VIRTUAL_TOOLS 16  // Use the Virtual Tool method with M163 and M164
281 281
   //#define DIRECT_MIXING_IN_G1    // Allow ABCDHI mix factors in G1 movement commands
282
+  //#define GRADIENT_MIX           // Support for gradient mixing with M166 and LCD
283
+  #if ENABLED(GRADIENT_MIX)
284
+    //#define GRADIENT_VTOOL       // Add M166 T to use a V-tool index as a Gradient alias
285
+  #endif
282 286
 #endif
283 287
 
284 288
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).

+ 4
- 0
Marlin/src/config/examples/BQ/WITBOX/Configuration.h View File

@@ -271,6 +271,10 @@
271 271
   #define MIXING_STEPPERS 2        // Number of steppers in your mixing extruder
272 272
   #define MIXING_VIRTUAL_TOOLS 16  // Use the Virtual Tool method with M163 and M164
273 273
   //#define DIRECT_MIXING_IN_G1    // Allow ABCDHI mix factors in G1 movement commands
274
+  //#define GRADIENT_MIX           // Support for gradient mixing with M166 and LCD
275
+  #if ENABLED(GRADIENT_MIX)
276
+    //#define GRADIENT_VTOOL       // Add M166 T to use a V-tool index as a Gradient alias
277
+  #endif
274 278
 #endif
275 279
 
276 280
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).

+ 4
- 0
Marlin/src/config/examples/Cartesio/Configuration.h View File

@@ -272,6 +272,10 @@
272 272
   #define MIXING_STEPPERS 2        // Number of steppers in your mixing extruder
273 273
   #define MIXING_VIRTUAL_TOOLS 16  // Use the Virtual Tool method with M163 and M164
274 274
   //#define DIRECT_MIXING_IN_G1    // Allow ABCDHI mix factors in G1 movement commands
275
+  //#define GRADIENT_MIX           // Support for gradient mixing with M166 and LCD
276
+  #if ENABLED(GRADIENT_MIX)
277
+    //#define GRADIENT_VTOOL       // Add M166 T to use a V-tool index as a Gradient alias
278
+  #endif
275 279
 #endif
276 280
 
277 281
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).

+ 4
- 0
Marlin/src/config/examples/Creality/CR-10/Configuration.h View File

@@ -271,6 +271,10 @@
271 271
   #define MIXING_STEPPERS 2        // Number of steppers in your mixing extruder
272 272
   #define MIXING_VIRTUAL_TOOLS 16  // Use the Virtual Tool method with M163 and M164
273 273
   //#define DIRECT_MIXING_IN_G1    // Allow ABCDHI mix factors in G1 movement commands
274
+  //#define GRADIENT_MIX           // Support for gradient mixing with M166 and LCD
275
+  #if ENABLED(GRADIENT_MIX)
276
+    //#define GRADIENT_VTOOL       // Add M166 T to use a V-tool index as a Gradient alias
277
+  #endif
274 278
 #endif
275 279
 
276 280
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).

+ 4
- 0
Marlin/src/config/examples/Creality/CR-10S/Configuration.h View File

@@ -271,6 +271,10 @@
271 271
   #define MIXING_STEPPERS 2        // Number of steppers in your mixing extruder
272 272
   #define MIXING_VIRTUAL_TOOLS 16  // Use the Virtual Tool method with M163 and M164
273 273
   //#define DIRECT_MIXING_IN_G1    // Allow ABCDHI mix factors in G1 movement commands
274
+  //#define GRADIENT_MIX           // Support for gradient mixing with M166 and LCD
275
+  #if ENABLED(GRADIENT_MIX)
276
+    //#define GRADIENT_VTOOL       // Add M166 T to use a V-tool index as a Gradient alias
277
+  #endif
274 278
 #endif
275 279
 
276 280
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).

+ 4
- 0
Marlin/src/config/examples/Creality/CR-10mini/Configuration.h View File

@@ -280,6 +280,10 @@
280 280
   #define MIXING_STEPPERS 2        // Number of steppers in your mixing extruder
281 281
   #define MIXING_VIRTUAL_TOOLS 16  // Use the Virtual Tool method with M163 and M164
282 282
   //#define DIRECT_MIXING_IN_G1    // Allow ABCDHI mix factors in G1 movement commands
283
+  //#define GRADIENT_MIX           // Support for gradient mixing with M166 and LCD
284
+  #if ENABLED(GRADIENT_MIX)
285
+    //#define GRADIENT_VTOOL       // Add M166 T to use a V-tool index as a Gradient alias
286
+  #endif
283 287
 #endif
284 288
 
285 289
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).

+ 4
- 0
Marlin/src/config/examples/Creality/CR-8/Configuration.h View File

@@ -271,6 +271,10 @@
271 271
   #define MIXING_STEPPERS 2        // Number of steppers in your mixing extruder
272 272
   #define MIXING_VIRTUAL_TOOLS 16  // Use the Virtual Tool method with M163 and M164
273 273
   //#define DIRECT_MIXING_IN_G1    // Allow ABCDHI mix factors in G1 movement commands
274
+  //#define GRADIENT_MIX           // Support for gradient mixing with M166 and LCD
275
+  #if ENABLED(GRADIENT_MIX)
276
+    //#define GRADIENT_VTOOL       // Add M166 T to use a V-tool index as a Gradient alias
277
+  #endif
274 278
 #endif
275 279
 
276 280
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).

+ 4
- 0
Marlin/src/config/examples/Creality/Ender-2/Configuration.h View File

@@ -271,6 +271,10 @@
271 271
   #define MIXING_STEPPERS 2        // Number of steppers in your mixing extruder
272 272
   #define MIXING_VIRTUAL_TOOLS 16  // Use the Virtual Tool method with M163 and M164
273 273
   //#define DIRECT_MIXING_IN_G1    // Allow ABCDHI mix factors in G1 movement commands
274
+  //#define GRADIENT_MIX           // Support for gradient mixing with M166 and LCD
275
+  #if ENABLED(GRADIENT_MIX)
276
+    //#define GRADIENT_VTOOL       // Add M166 T to use a V-tool index as a Gradient alias
277
+  #endif
274 278
 #endif
275 279
 
276 280
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).

+ 4
- 0
Marlin/src/config/examples/Creality/Ender-3/Configuration.h View File

@@ -271,6 +271,10 @@
271 271
   #define MIXING_STEPPERS 2        // Number of steppers in your mixing extruder
272 272
   #define MIXING_VIRTUAL_TOOLS 16  // Use the Virtual Tool method with M163 and M164
273 273
   //#define DIRECT_MIXING_IN_G1    // Allow ABCDHI mix factors in G1 movement commands
274
+  //#define GRADIENT_MIX           // Support for gradient mixing with M166 and LCD
275
+  #if ENABLED(GRADIENT_MIX)
276
+    //#define GRADIENT_VTOOL       // Add M166 T to use a V-tool index as a Gradient alias
277
+  #endif
274 278
 #endif
275 279
 
276 280
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).

+ 4
- 0
Marlin/src/config/examples/Creality/Ender-4/Configuration.h View File

@@ -271,6 +271,10 @@
271 271
   #define MIXING_STEPPERS 2        // Number of steppers in your mixing extruder
272 272
   #define MIXING_VIRTUAL_TOOLS 16  // Use the Virtual Tool method with M163 and M164
273 273
   //#define DIRECT_MIXING_IN_G1    // Allow ABCDHI mix factors in G1 movement commands
274
+  //#define GRADIENT_MIX           // Support for gradient mixing with M166 and LCD
275
+  #if ENABLED(GRADIENT_MIX)
276
+    //#define GRADIENT_VTOOL       // Add M166 T to use a V-tool index as a Gradient alias
277
+  #endif
274 278
 #endif
275 279
 
276 280
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).

+ 4
- 0
Marlin/src/config/examples/Einstart-S/Configuration.h View File

@@ -271,6 +271,10 @@
271 271
   #define MIXING_STEPPERS 2        // Number of steppers in your mixing extruder
272 272
   #define MIXING_VIRTUAL_TOOLS 16  // Use the Virtual Tool method with M163 and M164
273 273
   //#define DIRECT_MIXING_IN_G1    // Allow ABCDHI mix factors in G1 movement commands
274
+  //#define GRADIENT_MIX           // Support for gradient mixing with M166 and LCD
275
+  #if ENABLED(GRADIENT_MIX)
276
+    //#define GRADIENT_VTOOL       // Add M166 T to use a V-tool index as a Gradient alias
277
+  #endif
274 278
 #endif
275 279
 
276 280
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).

+ 4
- 0
Marlin/src/config/examples/Felix/Configuration.h View File

@@ -271,6 +271,10 @@
271 271
   #define MIXING_STEPPERS 2        // Number of steppers in your mixing extruder
272 272
   #define MIXING_VIRTUAL_TOOLS 16  // Use the Virtual Tool method with M163 and M164
273 273
   //#define DIRECT_MIXING_IN_G1    // Allow ABCDHI mix factors in G1 movement commands
274
+  //#define GRADIENT_MIX           // Support for gradient mixing with M166 and LCD
275
+  #if ENABLED(GRADIENT_MIX)
276
+    //#define GRADIENT_VTOOL       // Add M166 T to use a V-tool index as a Gradient alias
277
+  #endif
274 278
 #endif
275 279
 
276 280
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).

+ 4
- 0
Marlin/src/config/examples/Felix/DUAL/Configuration.h View File

@@ -271,6 +271,10 @@
271 271
   #define MIXING_STEPPERS 2        // Number of steppers in your mixing extruder
272 272
   #define MIXING_VIRTUAL_TOOLS 16  // Use the Virtual Tool method with M163 and M164
273 273
   //#define DIRECT_MIXING_IN_G1    // Allow ABCDHI mix factors in G1 movement commands
274
+  //#define GRADIENT_MIX           // Support for gradient mixing with M166 and LCD
275
+  #if ENABLED(GRADIENT_MIX)
276
+    //#define GRADIENT_VTOOL       // Add M166 T to use a V-tool index as a Gradient alias
277
+  #endif
274 278
 #endif
275 279
 
276 280
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).

+ 4
- 0
Marlin/src/config/examples/FlashForge/CreatorPro/Configuration.h View File

@@ -271,6 +271,10 @@
271 271
   #define MIXING_STEPPERS 2        // Number of steppers in your mixing extruder
272 272
   #define MIXING_VIRTUAL_TOOLS 16  // Use the Virtual Tool method with M163 and M164
273 273
   //#define DIRECT_MIXING_IN_G1    // Allow ABCDHI mix factors in G1 movement commands
274
+  //#define GRADIENT_MIX           // Support for gradient mixing with M166 and LCD
275
+  #if ENABLED(GRADIENT_MIX)
276
+    //#define GRADIENT_VTOOL       // Add M166 T to use a V-tool index as a Gradient alias
277
+  #endif
274 278
 #endif
275 279
 
276 280
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).

+ 4
- 0
Marlin/src/config/examples/FolgerTech/i3-2020/Configuration.h View File

@@ -271,6 +271,10 @@
271 271
   #define MIXING_STEPPERS 2        // Number of steppers in your mixing extruder
272 272
   #define MIXING_VIRTUAL_TOOLS 16  // Use the Virtual Tool method with M163 and M164
273 273
   //#define DIRECT_MIXING_IN_G1    // Allow ABCDHI mix factors in G1 movement commands
274
+  //#define GRADIENT_MIX           // Support for gradient mixing with M166 and LCD
275
+  #if ENABLED(GRADIENT_MIX)
276
+    //#define GRADIENT_VTOOL       // Add M166 T to use a V-tool index as a Gradient alias
277
+  #endif
274 278
 #endif
275 279
 
276 280
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).

+ 4
- 0
Marlin/src/config/examples/Formbot/Raptor/Configuration.h View File

@@ -312,6 +312,10 @@
312 312
   #define MIXING_STEPPERS 2        // Number of steppers in your mixing extruder
313 313
   #define MIXING_VIRTUAL_TOOLS 16  // Use the Virtual Tool method with M163 and M164
314 314
   //#define DIRECT_MIXING_IN_G1    // Allow ABCDHI mix factors in G1 movement commands
315
+  //#define GRADIENT_MIX           // Support for gradient mixing with M166 and LCD
316
+  #if ENABLED(GRADIENT_MIX)
317
+    //#define GRADIENT_VTOOL       // Add M166 T to use a V-tool index as a Gradient alias
318
+  #endif
315 319
 #endif
316 320
 
317 321
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).

+ 4
- 0
Marlin/src/config/examples/Formbot/T_Rex_2+/Configuration.h View File

@@ -274,6 +274,10 @@
274 274
   #define MIXING_STEPPERS 2        // Number of steppers in your mixing extruder
275 275
   #define MIXING_VIRTUAL_TOOLS 16  // Use the Virtual Tool method with M163 and M164
276 276
   //#define DIRECT_MIXING_IN_G1    // Allow ABCDHI mix factors in G1 movement commands
277
+  //#define GRADIENT_MIX           // Support for gradient mixing with M166 and LCD
278
+  #if ENABLED(GRADIENT_MIX)
279
+    //#define GRADIENT_VTOOL       // Add M166 T to use a V-tool index as a Gradient alias
280
+  #endif
277 281
 #endif
278 282
 
279 283
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).

+ 4
- 0
Marlin/src/config/examples/Formbot/T_Rex_3/Configuration.h View File

@@ -275,6 +275,10 @@
275 275
   #define MIXING_STEPPERS 2        // Number of steppers in your mixing extruder
276 276
   #define MIXING_VIRTUAL_TOOLS 16  // Use the Virtual Tool method with M163 and M164
277 277
   //#define DIRECT_MIXING_IN_G1    // Allow ABCDHI mix factors in G1 movement commands
278
+  //#define GRADIENT_MIX           // Support for gradient mixing with M166 and LCD
279
+  #if ENABLED(GRADIENT_MIX)
280
+    //#define GRADIENT_VTOOL       // Add M166 T to use a V-tool index as a Gradient alias
281
+  #endif
278 282
 #endif
279 283
 
280 284
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).

+ 2093
- 0
Marlin/src/config/examples/Geeetech/A10M/Configuration.h
File diff suppressed because it is too large
View File


+ 2243
- 0
Marlin/src/config/examples/Geeetech/A10M/Configuration_adv.h
File diff suppressed because it is too large
View File


+ 2097
- 0
Marlin/src/config/examples/Geeetech/A20M/Configuration.h
File diff suppressed because it is too large
View File


+ 2243
- 0
Marlin/src/config/examples/Geeetech/A20M/Configuration_adv.h
File diff suppressed because it is too large
View File


+ 4
- 0
Marlin/src/config/examples/Geeetech/GT2560/Configuration.h View File

@@ -271,6 +271,10 @@
271 271
   #define MIXING_STEPPERS 2        // Number of steppers in your mixing extruder
272 272
   #define MIXING_VIRTUAL_TOOLS 16  // Use the Virtual Tool method with M163 and M164
273 273
   //#define DIRECT_MIXING_IN_G1    // Allow ABCDHI mix factors in G1 movement commands
274
+  //#define GRADIENT_MIX           // Support for gradient mixing with M166 and LCD
275
+  #if ENABLED(GRADIENT_MIX)
276
+    //#define GRADIENT_VTOOL       // Add M166 T to use a V-tool index as a Gradient alias
277
+  #endif
274 278
 #endif
275 279
 
276 280
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).

+ 4
- 0
Marlin/src/config/examples/Geeetech/I3_Pro_X-GT2560/Configuration.h View File

@@ -271,6 +271,10 @@
271 271
   #define MIXING_STEPPERS 2        // Number of steppers in your mixing extruder
272 272
   #define MIXING_VIRTUAL_TOOLS 16  // Use the Virtual Tool method with M163 and M164
273 273
   //#define DIRECT_MIXING_IN_G1    // Allow ABCDHI mix factors in G1 movement commands
274
+  //#define GRADIENT_MIX           // Support for gradient mixing with M166 and LCD
275
+  #if ENABLED(GRADIENT_MIX)
276
+    //#define GRADIENT_VTOOL       // Add M166 T to use a V-tool index as a Gradient alias
277
+  #endif
274 278
 #endif
275 279
 
276 280
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).

+ 4
- 0
Marlin/src/config/examples/Geeetech/MeCreator2/Configuration.h View File

@@ -271,6 +271,10 @@
271 271
   #define MIXING_STEPPERS 2        // Number of steppers in your mixing extruder
272 272
   #define MIXING_VIRTUAL_TOOLS 16  // Use the Virtual Tool method with M163 and M164
273 273
   //#define DIRECT_MIXING_IN_G1    // Allow ABCDHI mix factors in G1 movement commands
274
+  //#define GRADIENT_MIX           // Support for gradient mixing with M166 and LCD
275
+  #if ENABLED(GRADIENT_MIX)
276
+    //#define GRADIENT_VTOOL       // Add M166 T to use a V-tool index as a Gradient alias
277
+  #endif
274 278
 #endif
275 279
 
276 280
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).

+ 4
- 0
Marlin/src/config/examples/Geeetech/Prusa i3 Pro B/bltouch/Configuration.h View File

@@ -271,6 +271,10 @@
271 271
   #define MIXING_STEPPERS 2        // Number of steppers in your mixing extruder
272 272
   #define MIXING_VIRTUAL_TOOLS 16  // Use the Virtual Tool method with M163 and M164
273 273
   //#define DIRECT_MIXING_IN_G1    // Allow ABCDHI mix factors in G1 movement commands
274
+  //#define GRADIENT_MIX           // Support for gradient mixing with M166 and LCD
275
+  #if ENABLED(GRADIENT_MIX)
276
+    //#define GRADIENT_VTOOL       // Add M166 T to use a V-tool index as a Gradient alias
277
+  #endif
274 278
 #endif
275 279
 
276 280
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).

+ 4
- 0
Marlin/src/config/examples/Geeetech/Prusa i3 Pro B/noprobe/Configuration.h View File

@@ -271,6 +271,10 @@
271 271
   #define MIXING_STEPPERS 2        // Number of steppers in your mixing extruder
272 272
   #define MIXING_VIRTUAL_TOOLS 16  // Use the Virtual Tool method with M163 and M164
273 273
   //#define DIRECT_MIXING_IN_G1    // Allow ABCDHI mix factors in G1 movement commands
274
+  //#define GRADIENT_MIX           // Support for gradient mixing with M166 and LCD
275
+  #if ENABLED(GRADIENT_MIX)
276
+    //#define GRADIENT_VTOOL       // Add M166 T to use a V-tool index as a Gradient alias
277
+  #endif
274 278
 #endif
275 279
 
276 280
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).

+ 4
- 0
Marlin/src/config/examples/Geeetech/Prusa i3 Pro C/Configuration.h View File

@@ -271,6 +271,10 @@
271 271
   #define MIXING_STEPPERS 2        // Number of steppers in your mixing extruder
272 272
   #define MIXING_VIRTUAL_TOOLS 16  // Use the Virtual Tool method with M163 and M164
273 273
   //#define DIRECT_MIXING_IN_G1    // Allow ABCDHI mix factors in G1 movement commands
274
+  //#define GRADIENT_MIX           // Support for gradient mixing with M166 and LCD
275
+  #if ENABLED(GRADIENT_MIX)
276
+    //#define GRADIENT_VTOOL       // Add M166 T to use a V-tool index as a Gradient alias
277
+  #endif
274 278
 #endif
275 279
 
276 280
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).

+ 4
- 0
Marlin/src/config/examples/Geeetech/Prusa i3 Pro W/Configuration.h View File

@@ -271,6 +271,10 @@
271 271
   #define MIXING_STEPPERS 2        // Number of steppers in your mixing extruder
272 272
   #define MIXING_VIRTUAL_TOOLS 16  // Use the Virtual Tool method with M163 and M164
273 273
   //#define DIRECT_MIXING_IN_G1    // Allow ABCDHI mix factors in G1 movement commands
274
+  //#define GRADIENT_MIX           // Support for gradient mixing with M166 and LCD
275
+  #if ENABLED(GRADIENT_MIX)
276
+    //#define GRADIENT_VTOOL       // Add M166 T to use a V-tool index as a Gradient alias
277
+  #endif
274 278
 #endif
275 279
 
276 280
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).

+ 4
- 0
Marlin/src/config/examples/Infitary/i3-M508/Configuration.h View File

@@ -271,6 +271,10 @@
271 271
   #define MIXING_STEPPERS 2        // Number of steppers in your mixing extruder
272 272
   #define MIXING_VIRTUAL_TOOLS 16  // Use the Virtual Tool method with M163 and M164
273 273
   //#define DIRECT_MIXING_IN_G1    // Allow ABCDHI mix factors in G1 movement commands
274
+  //#define GRADIENT_MIX           // Support for gradient mixing with M166 and LCD
275
+  #if ENABLED(GRADIENT_MIX)
276
+    //#define GRADIENT_VTOOL       // Add M166 T to use a V-tool index as a Gradient alias
277
+  #endif
274 278
 #endif
275 279
 
276 280
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).

+ 4
- 0
Marlin/src/config/examples/JGAurora/A5/Configuration.h View File

@@ -276,6 +276,10 @@
276 276
   #define MIXING_STEPPERS 2        // Number of steppers in your mixing extruder
277 277
   #define MIXING_VIRTUAL_TOOLS 16  // Use the Virtual Tool method with M163 and M164
278 278
   //#define DIRECT_MIXING_IN_G1    // Allow ABCDHI mix factors in G1 movement commands
279
+  //#define GRADIENT_MIX           // Support for gradient mixing with M166 and LCD
280
+  #if ENABLED(GRADIENT_MIX)
281
+    //#define GRADIENT_VTOOL       // Add M166 T to use a V-tool index as a Gradient alias
282
+  #endif
279 283
 #endif
280 284
 
281 285
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).

+ 4
- 0
Marlin/src/config/examples/MakerParts/Configuration.h View File

@@ -291,6 +291,10 @@
291 291
   #define MIXING_STEPPERS 2        // Number of steppers in your mixing extruder
292 292
   #define MIXING_VIRTUAL_TOOLS 16  // Use the Virtual Tool method with M163 and M164
293 293
   //#define DIRECT_MIXING_IN_G1    // Allow ABCDHI mix factors in G1 movement commands
294
+  //#define GRADIENT_MIX           // Support for gradient mixing with M166 and LCD
295
+  #if ENABLED(GRADIENT_MIX)
296
+    //#define GRADIENT_VTOOL       // Add M166 T to use a V-tool index as a Gradient alias
297
+  #endif
294 298
 #endif
295 299
 
296 300
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).

+ 4
- 0
Marlin/src/config/examples/Malyan/M150/Configuration.h View File

@@ -276,6 +276,10 @@
276 276
   #define MIXING_STEPPERS 2        // Number of steppers in your mixing extruder
277 277
   #define MIXING_VIRTUAL_TOOLS 16  // Use the Virtual Tool method with M163 and M164
278 278
   //#define DIRECT_MIXING_IN_G1    // Allow ABCDHI mix factors in G1 movement commands
279
+  //#define GRADIENT_MIX           // Support for gradient mixing with M166 and LCD
280
+  #if ENABLED(GRADIENT_MIX)
281
+    //#define GRADIENT_VTOOL       // Add M166 T to use a V-tool index as a Gradient alias
282
+  #endif
279 283
 #endif
280 284
 
281 285
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).

+ 4
- 0
Marlin/src/config/examples/Malyan/M200/Configuration.h View File

@@ -271,6 +271,10 @@
271 271
   #define MIXING_STEPPERS 2        // Number of steppers in your mixing extruder
272 272
   #define MIXING_VIRTUAL_TOOLS 16  // Use the Virtual Tool method with M163 and M164
273 273
   //#define DIRECT_MIXING_IN_G1    // Allow ABCDHI mix factors in G1 movement commands
274
+  //#define GRADIENT_MIX           // Support for gradient mixing with M166 and LCD
275
+  #if ENABLED(GRADIENT_MIX)
276
+    //#define GRADIENT_VTOOL       // Add M166 T to use a V-tool index as a Gradient alias
277
+  #endif
274 278
 #endif
275 279
 
276 280
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).

+ 4
- 0
Marlin/src/config/examples/Micromake/C1/basic/Configuration.h View File

@@ -271,6 +271,10 @@
271 271
   #define MIXING_STEPPERS 2        // Number of steppers in your mixing extruder
272 272
   #define MIXING_VIRTUAL_TOOLS 16  // Use the Virtual Tool method with M163 and M164
273 273
   //#define DIRECT_MIXING_IN_G1    // Allow ABCDHI mix factors in G1 movement commands
274
+  //#define GRADIENT_MIX           // Support for gradient mixing with M166 and LCD
275
+  #if ENABLED(GRADIENT_MIX)
276
+    //#define GRADIENT_VTOOL       // Add M166 T to use a V-tool index as a Gradient alias
277
+  #endif
274 278
 #endif
275 279
 
276 280
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).

+ 4
- 0
Marlin/src/config/examples/Micromake/C1/enhanced/Configuration.h View File

@@ -271,6 +271,10 @@
271 271
   #define MIXING_STEPPERS 2        // Number of steppers in your mixing extruder
272 272
   #define MIXING_VIRTUAL_TOOLS 16  // Use the Virtual Tool method with M163 and M164
273 273
   //#define DIRECT_MIXING_IN_G1    // Allow ABCDHI mix factors in G1 movement commands
274
+  //#define GRADIENT_MIX           // Support for gradient mixing with M166 and LCD
275
+  #if ENABLED(GRADIENT_MIX)
276
+    //#define GRADIENT_VTOOL       // Add M166 T to use a V-tool index as a Gradient alias
277
+  #endif
274 278
 #endif
275 279
 
276 280
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).

+ 4
- 0
Marlin/src/config/examples/Mks/Robin/Configuration.h View File

@@ -272,6 +272,10 @@
272 272
   #define MIXING_STEPPERS 2        // Number of steppers in your mixing extruder
273 273
   #define MIXING_VIRTUAL_TOOLS 16  // Use the Virtual Tool method with M163 and M164
274 274
   //#define DIRECT_MIXING_IN_G1    // Allow ABCDHI mix factors in G1 movement commands
275
+  //#define GRADIENT_MIX           // Support for gradient mixing with M166 and LCD
276
+  #if ENABLED(GRADIENT_MIX)
277
+    //#define GRADIENT_VTOOL       // Add M166 T to use a V-tool index as a Gradient alias
278
+  #endif
275 279
 #endif
276 280
 
277 281
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).

+ 4
- 0
Marlin/src/config/examples/Mks/Sbase/Configuration.h View File

@@ -271,6 +271,10 @@
271 271
   #define MIXING_STEPPERS 2        // Number of steppers in your mixing extruder
272 272
   #define MIXING_VIRTUAL_TOOLS 16  // Use the Virtual Tool method with M163 and M164
273 273
   //#define DIRECT_MIXING_IN_G1    // Allow ABCDHI mix factors in G1 movement commands
274
+  //#define GRADIENT_MIX           // Support for gradient mixing with M166 and LCD
275
+  #if ENABLED(GRADIENT_MIX)
276
+    //#define GRADIENT_VTOOL       // Add M166 T to use a V-tool index as a Gradient alias
277
+  #endif
274 278
 #endif
275 279
 
276 280
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).

+ 4
- 0
Marlin/src/config/examples/RapideLite/RL200/Configuration.h View File

@@ -271,6 +271,10 @@
271 271
   #define MIXING_STEPPERS 2        // Number of steppers in your mixing extruder
272 272
   #define MIXING_VIRTUAL_TOOLS 16  // Use the Virtual Tool method with M163 and M164
273 273
   //#define DIRECT_MIXING_IN_G1    // Allow ABCDHI mix factors in G1 movement commands
274
+  //#define GRADIENT_MIX           // Support for gradient mixing with M166 and LCD
275
+  #if ENABLED(GRADIENT_MIX)
276
+    //#define GRADIENT_VTOOL       // Add M166 T to use a V-tool index as a Gradient alias
277
+  #endif
274 278
 #endif
275 279
 
276 280
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).

+ 4
- 0
Marlin/src/config/examples/RepRapPro/Huxley/Configuration.h View File

@@ -271,6 +271,10 @@
271 271
   #define MIXING_STEPPERS 2        // Number of steppers in your mixing extruder
272 272
   #define MIXING_VIRTUAL_TOOLS 16  // Use the Virtual Tool method with M163 and M164
273 273
   //#define DIRECT_MIXING_IN_G1    // Allow ABCDHI mix factors in G1 movement commands
274
+  //#define GRADIENT_MIX           // Support for gradient mixing with M166 and LCD
275
+  #if ENABLED(GRADIENT_MIX)
276
+    //#define GRADIENT_VTOOL       // Add M166 T to use a V-tool index as a Gradient alias
277
+  #endif
274 278
 #endif
275 279
 
276 280
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).

+ 4
- 0
Marlin/src/config/examples/RepRapWorld/Megatronics/Configuration.h View File

@@ -271,6 +271,10 @@
271 271
   #define MIXING_STEPPERS 2        // Number of steppers in your mixing extruder
272 272
   #define MIXING_VIRTUAL_TOOLS 16  // Use the Virtual Tool method with M163 and M164
273 273
   //#define DIRECT_MIXING_IN_G1    // Allow ABCDHI mix factors in G1 movement commands
274
+  //#define GRADIENT_MIX           // Support for gradient mixing with M166 and LCD
275
+  #if ENABLED(GRADIENT_MIX)
276
+    //#define GRADIENT_VTOOL       // Add M166 T to use a V-tool index as a Gradient alias
277
+  #endif
274 278
 #endif
275 279
 
276 280
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).

+ 4
- 0
Marlin/src/config/examples/RigidBot/Configuration.h View File

@@ -274,6 +274,10 @@
274 274
   #define MIXING_STEPPERS 2        // Number of steppers in your mixing extruder
275 275
   #define MIXING_VIRTUAL_TOOLS 16  // Use the Virtual Tool method with M163 and M164
276 276
   //#define DIRECT_MIXING_IN_G1    // Allow ABCDHI mix factors in G1 movement commands
277
+  //#define GRADIENT_MIX           // Support for gradient mixing with M166 and LCD
278
+  #if ENABLED(GRADIENT_MIX)
279
+    //#define GRADIENT_VTOOL       // Add M166 T to use a V-tool index as a Gradient alias
280
+  #endif
277 281
 #endif
278 282
 
279 283
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).

+ 4
- 0
Marlin/src/config/examples/SCARA/Configuration.h View File

@@ -302,6 +302,10 @@
302 302
   #define MIXING_STEPPERS 2        // Number of steppers in your mixing extruder
303 303
   #define MIXING_VIRTUAL_TOOLS 16  // Use the Virtual Tool method with M163 and M164
304 304
   //#define DIRECT_MIXING_IN_G1    // Allow ABCDHI mix factors in G1 movement commands
305
+  //#define GRADIENT_MIX           // Support for gradient mixing with M166 and LCD
306
+  #if ENABLED(GRADIENT_MIX)
307
+    //#define GRADIENT_VTOOL       // Add M166 T to use a V-tool index as a Gradient alias
308
+  #endif
305 309
 #endif
306 310
 
307 311
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).

+ 4
- 0
Marlin/src/config/examples/STM32F10/Configuration.h View File

@@ -271,6 +271,10 @@
271 271
   #define MIXING_STEPPERS 2        // Number of steppers in your mixing extruder
272 272
   #define MIXING_VIRTUAL_TOOLS 16  // Use the Virtual Tool method with M163 and M164
273 273
   //#define DIRECT_MIXING_IN_G1    // Allow ABCDHI mix factors in G1 movement commands
274
+  //#define GRADIENT_MIX           // Support for gradient mixing with M166 and LCD
275
+  #if ENABLED(GRADIENT_MIX)
276
+    //#define GRADIENT_VTOOL       // Add M166 T to use a V-tool index as a Gradient alias
277
+  #endif
274 278
 #endif
275 279
 
276 280
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).

+ 4
- 0
Marlin/src/config/examples/STM32F4/Configuration.h View File

@@ -271,6 +271,10 @@
271 271
   #define MIXING_STEPPERS 2        // Number of steppers in your mixing extruder
272 272
   #define MIXING_VIRTUAL_TOOLS 16  // Use the Virtual Tool method with M163 and M164
273 273
   //#define DIRECT_MIXING_IN_G1    // Allow ABCDHI mix factors in G1 movement commands
274
+  //#define GRADIENT_MIX           // Support for gradient mixing with M166 and LCD
275
+  #if ENABLED(GRADIENT_MIX)
276
+    //#define GRADIENT_VTOOL       // Add M166 T to use a V-tool index as a Gradient alias
277
+  #endif
274 278
 #endif
275 279
 
276 280
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).

+ 4
- 0
Marlin/src/config/examples/Sanguinololu/Configuration.h View File

@@ -271,6 +271,10 @@
271 271
   #define MIXING_STEPPERS 2        // Number of steppers in your mixing extruder
272 272
   #define MIXING_VIRTUAL_TOOLS 16  // Use the Virtual Tool method with M163 and M164
273 273
   //#define DIRECT_MIXING_IN_G1    // Allow ABCDHI mix factors in G1 movement commands
274
+  //#define GRADIENT_MIX           // Support for gradient mixing with M166 and LCD
275
+  #if ENABLED(GRADIENT_MIX)
276
+    //#define GRADIENT_VTOOL       // Add M166 T to use a V-tool index as a Gradient alias
277
+  #endif
274 278
 #endif
275 279
 
276 280
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).

+ 4
- 0
Marlin/src/config/examples/TheBorg/Configuration.h View File

@@ -271,6 +271,10 @@
271 271
   #define MIXING_STEPPERS 2        // Number of steppers in your mixing extruder
272 272
   #define MIXING_VIRTUAL_TOOLS 16  // Use the Virtual Tool method with M163 and M164
273 273
   //#define DIRECT_MIXING_IN_G1    // Allow ABCDHI mix factors in G1 movement commands
274
+  //#define GRADIENT_MIX           // Support for gradient mixing with M166 and LCD
275
+  #if ENABLED(GRADIENT_MIX)
276
+    //#define GRADIENT_VTOOL       // Add M166 T to use a V-tool index as a Gradient alias
277
+  #endif
274 278
 #endif
275 279
 
276 280
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).

+ 4
- 0
Marlin/src/config/examples/TinyBoy2/Configuration.h View File

@@ -293,6 +293,10 @@
293 293
   #define MIXING_STEPPERS 2        // Number of steppers in your mixing extruder
294 294
   #define MIXING_VIRTUAL_TOOLS 16  // Use the Virtual Tool method with M163 and M164
295 295
   //#define DIRECT_MIXING_IN_G1    // Allow ABCDHI mix factors in G1 movement commands
296
+  //#define GRADIENT_MIX           // Support for gradient mixing with M166 and LCD
297
+  #if ENABLED(GRADIENT_MIX)
298
+    //#define GRADIENT_VTOOL       // Add M166 T to use a V-tool index as a Gradient alias
299
+  #endif
296 300
 #endif
297 301
 
298 302
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).

+ 4
- 0
Marlin/src/config/examples/Tronxy/X1/Configuration.h View File

@@ -271,6 +271,10 @@
271 271
   #define MIXING_STEPPERS 2        // Number of steppers in your mixing extruder
272 272
   #define MIXING_VIRTUAL_TOOLS 16  // Use the Virtual Tool method with M163 and M164
273 273
   //#define DIRECT_MIXING_IN_G1    // Allow ABCDHI mix factors in G1 movement commands
274
+  //#define GRADIENT_MIX           // Support for gradient mixing with M166 and LCD
275
+  #if ENABLED(GRADIENT_MIX)
276
+    //#define GRADIENT_VTOOL       // Add M166 T to use a V-tool index as a Gradient alias
277
+  #endif
274 278
 #endif
275 279
 
276 280
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).

+ 4
- 0
Marlin/src/config/examples/Tronxy/X3A/Configuration.h View File

@@ -271,6 +271,10 @@
271 271
   #define MIXING_STEPPERS 2        // Number of steppers in your mixing extruder
272 272
   #define MIXING_VIRTUAL_TOOLS 16  // Use the Virtual Tool method with M163 and M164
273 273
   //#define DIRECT_MIXING_IN_G1    // Allow ABCDHI mix factors in G1 movement commands
274
+  //#define GRADIENT_MIX           // Support for gradient mixing with M166 and LCD
275
+  #if ENABLED(GRADIENT_MIX)
276
+    //#define GRADIENT_VTOOL       // Add M166 T to use a V-tool index as a Gradient alias
277
+  #endif
274 278
 #endif
275 279
 
276 280
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).

+ 4
- 0
Marlin/src/config/examples/Tronxy/X5S/Configuration.h View File

@@ -271,6 +271,10 @@
271 271
   #define MIXING_STEPPERS 2        // Number of steppers in your mixing extruder
272 272
   #define MIXING_VIRTUAL_TOOLS 16  // Use the Virtual Tool method with M163 and M164
273 273
   //#define DIRECT_MIXING_IN_G1    // Allow ABCDHI mix factors in G1 movement commands
274
+  //#define GRADIENT_MIX           // Support for gradient mixing with M166 and LCD
275
+  #if ENABLED(GRADIENT_MIX)
276
+    //#define GRADIENT_VTOOL       // Add M166 T to use a V-tool index as a Gradient alias
277
+  #endif
274 278
 #endif
275 279
 
276 280
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).

+ 4
- 0
Marlin/src/config/examples/Tronxy/XY100/Configuration.h View File

@@ -271,6 +271,10 @@
271 271
   #define MIXING_STEPPERS 2        // Number of steppers in your mixing extruder
272 272
   #define MIXING_VIRTUAL_TOOLS 16  // Use the Virtual Tool method with M163 and M164
273 273
   //#define DIRECT_MIXING_IN_G1    // Allow ABCDHI mix factors in G1 movement commands
274
+  //#define GRADIENT_MIX           // Support for gradient mixing with M166 and LCD
275
+  #if ENABLED(GRADIENT_MIX)
276
+    //#define GRADIENT_VTOOL       // Add M166 T to use a V-tool index as a Gradient alias
277
+  #endif
274 278
 #endif
275 279
 
276 280
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).

+ 4
- 0
Marlin/src/config/examples/UltiMachine/Archim1/Configuration.h View File

@@ -271,6 +271,10 @@
271 271
   #define MIXING_STEPPERS 2        // Number of steppers in your mixing extruder
272 272
   #define MIXING_VIRTUAL_TOOLS 16  // Use the Virtual Tool method with M163 and M164
273 273
   //#define DIRECT_MIXING_IN_G1    // Allow ABCDHI mix factors in G1 movement commands
274
+  //#define GRADIENT_MIX           // Support for gradient mixing with M166 and LCD
275
+  #if ENABLED(GRADIENT_MIX)
276
+    //#define GRADIENT_VTOOL       // Add M166 T to use a V-tool index as a Gradient alias
277
+  #endif
274 278
 #endif
275 279
 
276 280
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).

+ 4
- 0
Marlin/src/config/examples/UltiMachine/Archim2/Configuration.h View File

@@ -271,6 +271,10 @@
271 271
   #define MIXING_STEPPERS 2        // Number of steppers in your mixing extruder
272 272
   #define MIXING_VIRTUAL_TOOLS 16  // Use the Virtual Tool method with M163 and M164
273 273
   //#define DIRECT_MIXING_IN_G1    // Allow ABCDHI mix factors in G1 movement commands
274
+  //#define GRADIENT_MIX           // Support for gradient mixing with M166 and LCD
275
+  #if ENABLED(GRADIENT_MIX)
276
+    //#define GRADIENT_VTOOL       // Add M166 T to use a V-tool index as a Gradient alias
277
+  #endif
274 278
 #endif
275 279
 
276 280
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).

+ 4
- 0
Marlin/src/config/examples/VORONDesign/Configuration.h View File

@@ -271,6 +271,10 @@
271 271
   #define MIXING_STEPPERS 2        // Number of steppers in your mixing extruder
272 272
   #define MIXING_VIRTUAL_TOOLS 16  // Use the Virtual Tool method with M163 and M164
273 273
   //#define DIRECT_MIXING_IN_G1    // Allow ABCDHI mix factors in G1 movement commands
274
+  //#define GRADIENT_MIX           // Support for gradient mixing with M166 and LCD
275
+  #if ENABLED(GRADIENT_MIX)
276
+    //#define GRADIENT_VTOOL       // Add M166 T to use a V-tool index as a Gradient alias
277
+  #endif
274 278
 #endif
275 279
 
276 280
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).

+ 4
- 0
Marlin/src/config/examples/Velleman/K8200/Configuration.h View File

@@ -291,6 +291,10 @@
291 291
   #define MIXING_STEPPERS 2        // Number of steppers in your mixing extruder
292 292
   #define MIXING_VIRTUAL_TOOLS 16  // Use the Virtual Tool method with M163 and M164
293 293
   //#define DIRECT_MIXING_IN_G1    // Allow ABCDHI mix factors in G1 movement commands
294
+  //#define GRADIENT_MIX           // Support for gradient mixing with M166 and LCD
295
+  #if ENABLED(GRADIENT_MIX)
296
+    //#define GRADIENT_VTOOL       // Add M166 T to use a V-tool index as a Gradient alias
297
+  #endif
294 298
 #endif
295 299
 
296 300
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).

+ 4
- 0
Marlin/src/config/examples/Velleman/K8400/Configuration.h View File

@@ -271,6 +271,10 @@
271 271
   #define MIXING_STEPPERS 2        // Number of steppers in your mixing extruder
272 272
   #define MIXING_VIRTUAL_TOOLS 16  // Use the Virtual Tool method with M163 and M164
273 273
   //#define DIRECT_MIXING_IN_G1    // Allow ABCDHI mix factors in G1 movement commands
274
+  //#define GRADIENT_MIX           // Support for gradient mixing with M166 and LCD
275
+  #if ENABLED(GRADIENT_MIX)
276
+    //#define GRADIENT_VTOOL       // Add M166 T to use a V-tool index as a Gradient alias
277
+  #endif
274 278
 #endif
275 279
 
276 280
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).

+ 4
- 0
Marlin/src/config/examples/Velleman/K8400/Dual-head/Configuration.h View File

@@ -271,6 +271,10 @@
271 271
   #define MIXING_STEPPERS 2        // Number of steppers in your mixing extruder
272 272
   #define MIXING_VIRTUAL_TOOLS 16  // Use the Virtual Tool method with M163 and M164
273 273
   //#define DIRECT_MIXING_IN_G1    // Allow ABCDHI mix factors in G1 movement commands
274
+  //#define GRADIENT_MIX           // Support for gradient mixing with M166 and LCD
275
+  #if ENABLED(GRADIENT_MIX)
276
+    //#define GRADIENT_VTOOL       // Add M166 T to use a V-tool index as a Gradient alias
277
+  #endif
274 278
 #endif
275 279
 
276 280
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).

+ 4
- 0
Marlin/src/config/examples/WASP/PowerWASP/Configuration.h View File

@@ -290,6 +290,10 @@
290 290
   #define MIXING_STEPPERS 2        // Number of steppers in your mixing extruder
291 291
   #define MIXING_VIRTUAL_TOOLS 16  // Use the Virtual Tool method with M163 and M164
292 292
   //#define DIRECT_MIXING_IN_G1    // Allow ABCDHI mix factors in G1 movement commands
293
+  //#define GRADIENT_MIX           // Support for gradient mixing with M166 and LCD
294
+  #if ENABLED(GRADIENT_MIX)
295
+    //#define GRADIENT_VTOOL       // Add M166 T to use a V-tool index as a Gradient alias
296
+  #endif
293 297
 #endif
294 298
 
295 299
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).

+ 4
- 0
Marlin/src/config/examples/Wanhao/Duplicator 6/Configuration.h View File

@@ -271,6 +271,10 @@
271 271
   #define MIXING_STEPPERS 2        // Number of steppers in your mixing extruder
272 272
   #define MIXING_VIRTUAL_TOOLS 16  // Use the Virtual Tool method with M163 and M164
273 273
   //#define DIRECT_MIXING_IN_G1    // Allow ABCDHI mix factors in G1 movement commands
274
+  //#define GRADIENT_MIX           // Support for gradient mixing with M166 and LCD
275
+  #if ENABLED(GRADIENT_MIX)
276
+    //#define GRADIENT_VTOOL       // Add M166 T to use a V-tool index as a Gradient alias
277
+  #endif
274 278
 #endif
275 279
 
276 280
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).

+ 4
- 0
Marlin/src/config/examples/adafruit/ST7565/Configuration.h View File

@@ -271,6 +271,10 @@
271 271
   #define MIXING_STEPPERS 2        // Number of steppers in your mixing extruder
272 272
   #define MIXING_VIRTUAL_TOOLS 16  // Use the Virtual Tool method with M163 and M164
273 273
   //#define DIRECT_MIXING_IN_G1    // Allow ABCDHI mix factors in G1 movement commands
274
+  //#define GRADIENT_MIX           // Support for gradient mixing with M166 and LCD
275
+  #if ENABLED(GRADIENT_MIX)
276
+    //#define GRADIENT_VTOOL       // Add M166 T to use a V-tool index as a Gradient alias
277
+  #endif
274 278
 #endif
275 279
 
276 280
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).

+ 4
- 0
Marlin/src/config/examples/delta/Anycubic/Kossel/Configuration.h View File

@@ -286,6 +286,10 @@
286 286
   #define MIXING_STEPPERS 2        // Number of steppers in your mixing extruder
287 287
   #define MIXING_VIRTUAL_TOOLS 16  // Use the Virtual Tool method with M163 and M164
288 288
   //#define DIRECT_MIXING_IN_G1    // Allow ABCDHI mix factors in G1 movement commands
289
+  //#define GRADIENT_MIX           // Support for gradient mixing with M166 and LCD
290
+  #if ENABLED(GRADIENT_MIX)
291
+    //#define GRADIENT_VTOOL       // Add M166 T to use a V-tool index as a Gradient alias
292
+  #endif
289 293
 #endif
290 294
 
291 295
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).

+ 4
- 0
Marlin/src/config/examples/delta/FLSUN/auto_calibrate/Configuration.h View File

@@ -271,6 +271,10 @@
271 271
   #define MIXING_STEPPERS 2        // Number of steppers in your mixing extruder
272 272
   #define MIXING_VIRTUAL_TOOLS 16  // Use the Virtual Tool method with M163 and M164
273 273
   //#define DIRECT_MIXING_IN_G1    // Allow ABCDHI mix factors in G1 movement commands
274
+  //#define GRADIENT_MIX           // Support for gradient mixing with M166 and LCD
275
+  #if ENABLED(GRADIENT_MIX)
276
+    //#define GRADIENT_VTOOL       // Add M166 T to use a V-tool index as a Gradient alias
277
+  #endif
274 278
 #endif
275 279
 
276 280
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).

+ 4
- 0
Marlin/src/config/examples/delta/FLSUN/kossel/Configuration.h View File

@@ -271,6 +271,10 @@
271 271
   #define MIXING_STEPPERS 2        // Number of steppers in your mixing extruder
272 272
   #define MIXING_VIRTUAL_TOOLS 16  // Use the Virtual Tool method with M163 and M164
273 273
   //#define DIRECT_MIXING_IN_G1    // Allow ABCDHI mix factors in G1 movement commands
274
+  //#define GRADIENT_MIX           // Support for gradient mixing with M166 and LCD
275
+  #if ENABLED(GRADIENT_MIX)
276
+    //#define GRADIENT_VTOOL       // Add M166 T to use a V-tool index as a Gradient alias
277
+  #endif
274 278
 #endif
275 279
 
276 280
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).

+ 4
- 0
Marlin/src/config/examples/delta/FLSUN/kossel_mini/Configuration.h View File

@@ -271,6 +271,10 @@
271 271
   #define MIXING_STEPPERS 2        // Number of steppers in your mixing extruder
272 272
   #define MIXING_VIRTUAL_TOOLS 16  // Use the Virtual Tool method with M163 and M164
273 273
   //#define DIRECT_MIXING_IN_G1    // Allow ABCDHI mix factors in G1 movement commands
274
+  //#define GRADIENT_MIX           // Support for gradient mixing with M166 and LCD
275
+  #if ENABLED(GRADIENT_MIX)
276
+    //#define GRADIENT_VTOOL       // Add M166 T to use a V-tool index as a Gradient alias
277
+  #endif
274 278
 #endif
275 279
 
276 280
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).

+ 4
- 0
Marlin/src/config/examples/delta/Geeetech/Rostock 301/Configuration.h View File

@@ -271,6 +271,10 @@
271 271
   #define MIXING_STEPPERS 3        // Number of steppers in your mixing extruder
272 272
   #define MIXING_VIRTUAL_TOOLS 16  // Use the Virtual Tool method with M163 and M164
273 273
   //#define DIRECT_MIXING_IN_G1    // Allow ABCDHI mix factors in G1 movement commands
274
+  //#define GRADIENT_MIX           // Support for gradient mixing with M166 and LCD
275
+  #if ENABLED(GRADIENT_MIX)
276
+    //#define GRADIENT_VTOOL       // Add M166 T to use a V-tool index as a Gradient alias
277
+  #endif
274 278
 #endif
275 279
 
276 280
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).

+ 4
- 0
Marlin/src/config/examples/delta/Hatchbox_Alpha/Configuration.h View File

@@ -276,6 +276,10 @@
276 276
   #define MIXING_STEPPERS 2        // Number of steppers in your mixing extruder
277 277
   #define MIXING_VIRTUAL_TOOLS 16  // Use the Virtual Tool method with M163 and M164
278 278
   //#define DIRECT_MIXING_IN_G1    // Allow ABCDHI mix factors in G1 movement commands
279
+  //#define GRADIENT_MIX           // Support for gradient mixing with M166 and LCD
280
+  #if ENABLED(GRADIENT_MIX)
281
+    //#define GRADIENT_VTOOL       // Add M166 T to use a V-tool index as a Gradient alias
282
+  #endif
279 283
 #endif
280 284
 
281 285
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).

+ 4
- 0
Marlin/src/config/examples/delta/MKS/SBASE/Configuration.h View File

@@ -271,6 +271,10 @@
271 271
   #define MIXING_STEPPERS 2        // Number of steppers in your mixing extruder
272 272
   #define MIXING_VIRTUAL_TOOLS 16  // Use the Virtual Tool method with M163 and M164
273 273
   //#define DIRECT_MIXING_IN_G1    // Allow ABCDHI mix factors in G1 movement commands
274
+  //#define GRADIENT_MIX           // Support for gradient mixing with M166 and LCD
275
+  #if ENABLED(GRADIENT_MIX)
276
+    //#define GRADIENT_VTOOL       // Add M166 T to use a V-tool index as a Gradient alias
277
+  #endif
274 278
 #endif
275 279
 
276 280
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).

+ 4
- 0
Marlin/src/config/examples/delta/Tevo Little Monster/Configuration.h View File

@@ -271,6 +271,10 @@
271 271
   #define MIXING_STEPPERS 2        // Number of steppers in your mixing extruder
272 272
   #define MIXING_VIRTUAL_TOOLS 16  // Use the Virtual Tool method with M163 and M164
273 273
   //#define DIRECT_MIXING_IN_G1    // Allow ABCDHI mix factors in G1 movement commands
274
+  //#define GRADIENT_MIX           // Support for gradient mixing with M166 and LCD
275
+  #if ENABLED(GRADIENT_MIX)
276
+    //#define GRADIENT_VTOOL       // Add M166 T to use a V-tool index as a Gradient alias
277
+  #endif
274 278
 #endif
275 279
 
276 280
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).

+ 4
- 0
Marlin/src/config/examples/delta/generic/Configuration.h View File

@@ -271,6 +271,10 @@
271 271
   #define MIXING_STEPPERS 2        // Number of steppers in your mixing extruder
272 272
   #define MIXING_VIRTUAL_TOOLS 16  // Use the Virtual Tool method with M163 and M164
273 273
   //#define DIRECT_MIXING_IN_G1    // Allow ABCDHI mix factors in G1 movement commands
274
+  //#define GRADIENT_MIX           // Support for gradient mixing with M166 and LCD
275
+  #if ENABLED(GRADIENT_MIX)
276
+    //#define GRADIENT_VTOOL       // Add M166 T to use a V-tool index as a Gradient alias
277
+  #endif
274 278
 #endif
275 279
 
276 280
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).

+ 4
- 0
Marlin/src/config/examples/delta/kossel_mini/Configuration.h View File

@@ -271,6 +271,10 @@
271 271
   #define MIXING_STEPPERS 2        // Number of steppers in your mixing extruder
272 272
   #define MIXING_VIRTUAL_TOOLS 16  // Use the Virtual Tool method with M163 and M164
273 273
   //#define DIRECT_MIXING_IN_G1    // Allow ABCDHI mix factors in G1 movement commands
274
+  //#define GRADIENT_MIX           // Support for gradient mixing with M166 and LCD
275
+  #if ENABLED(GRADIENT_MIX)
276
+    //#define GRADIENT_VTOOL       // Add M166 T to use a V-tool index as a Gradient alias
277
+  #endif
274 278
 #endif
275 279
 
276 280
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).

+ 4
- 0
Marlin/src/config/examples/delta/kossel_pro/Configuration.h View File

@@ -275,6 +275,10 @@
275 275
   #define MIXING_STEPPERS 2        // Number of steppers in your mixing extruder
276 276
   #define MIXING_VIRTUAL_TOOLS 16  // Use the Virtual Tool method with M163 and M164
277 277
   //#define DIRECT_MIXING_IN_G1    // Allow ABCDHI mix factors in G1 movement commands
278
+  //#define GRADIENT_MIX           // Support for gradient mixing with M166 and LCD
279
+  #if ENABLED(GRADIENT_MIX)
280
+    //#define GRADIENT_VTOOL       // Add M166 T to use a V-tool index as a Gradient alias
281
+  #endif
278 282
 #endif
279 283
 
280 284
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).

+ 4
- 0
Marlin/src/config/examples/delta/kossel_xl/Configuration.h View File

@@ -271,6 +271,10 @@
271 271
   #define MIXING_STEPPERS 2        // Number of steppers in your mixing extruder
272 272
   #define MIXING_VIRTUAL_TOOLS 16  // Use the Virtual Tool method with M163 and M164
273 273
   //#define DIRECT_MIXING_IN_G1    // Allow ABCDHI mix factors in G1 movement commands
274
+  //#define GRADIENT_MIX           // Support for gradient mixing with M166 and LCD
275
+  #if ENABLED(GRADIENT_MIX)
276
+    //#define GRADIENT_VTOOL       // Add M166 T to use a V-tool index as a Gradient alias
277
+  #endif
274 278
 #endif
275 279
 
276 280
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).

+ 4
- 0
Marlin/src/config/examples/gCreate/gMax1.5+/Configuration.h View File

@@ -276,6 +276,10 @@
276 276
   #define MIXING_STEPPERS 2        // Number of steppers in your mixing extruder
277 277
   #define MIXING_VIRTUAL_TOOLS 16  // Use the Virtual Tool method with M163 and M164
278 278
   //#define DIRECT_MIXING_IN_G1    // Allow ABCDHI mix factors in G1 movement commands
279
+  //#define GRADIENT_MIX           // Support for gradient mixing with M166 and LCD
280
+  #if ENABLED(GRADIENT_MIX)
281
+    //#define GRADIENT_VTOOL       // Add M166 T to use a V-tool index as a Gradient alias
282
+  #endif
279 283
 #endif
280 284
 
281 285
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).

+ 4
- 0
Marlin/src/config/examples/makibox/Configuration.h View File

@@ -271,6 +271,10 @@
271 271
   #define MIXING_STEPPERS 2        // Number of steppers in your mixing extruder
272 272
   #define MIXING_VIRTUAL_TOOLS 16  // Use the Virtual Tool method with M163 and M164
273 273
   //#define DIRECT_MIXING_IN_G1    // Allow ABCDHI mix factors in G1 movement commands
274
+  //#define GRADIENT_MIX           // Support for gradient mixing with M166 and LCD
275
+  #if ENABLED(GRADIENT_MIX)
276
+    //#define GRADIENT_VTOOL       // Add M166 T to use a V-tool index as a Gradient alias
277
+  #endif
274 278
 #endif
275 279
 
276 280
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).

+ 4
- 0
Marlin/src/config/examples/stm32f103ret6/Configuration.h View File

@@ -271,6 +271,10 @@
271 271
   #define MIXING_STEPPERS 3        // Number of steppers in your mixing extruder
272 272
   #define MIXING_VIRTUAL_TOOLS 16  // Use the Virtual Tool method with M163 and M164
273 273
   //#define DIRECT_MIXING_IN_G1    // Allow ABCDHI mix factors in G1 movement commands
274
+  //#define GRADIENT_MIX           // Support for gradient mixing with M166 and LCD
275
+  #if ENABLED(GRADIENT_MIX)
276
+    //#define GRADIENT_VTOOL       // Add M166 T to use a V-tool index as a Gradient alias
277
+  #endif
274 278
 #endif
275 279
 
276 280
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).

+ 4
- 0
Marlin/src/config/examples/tvrrug/Round2/Configuration.h View File

@@ -271,6 +271,10 @@
271 271
   #define MIXING_STEPPERS 2        // Number of steppers in your mixing extruder
272 272
   #define MIXING_VIRTUAL_TOOLS 16  // Use the Virtual Tool method with M163 and M164
273 273
   //#define DIRECT_MIXING_IN_G1    // Allow ABCDHI mix factors in G1 movement commands
274
+  //#define GRADIENT_MIX           // Support for gradient mixing with M166 and LCD
275
+  #if ENABLED(GRADIENT_MIX)
276
+    //#define GRADIENT_VTOOL       // Add M166 T to use a V-tool index as a Gradient alias
277
+  #endif
274 278
 #endif
275 279
 
276 280
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).

+ 4
- 0
Marlin/src/config/examples/wt150/Configuration.h View File

@@ -271,6 +271,10 @@
271 271
   #define MIXING_STEPPERS 2        // Number of steppers in your mixing extruder
272 272
   #define MIXING_VIRTUAL_TOOLS 16  // Use the Virtual Tool method with M163 and M164
273 273
   //#define DIRECT_MIXING_IN_G1    // Allow ABCDHI mix factors in G1 movement commands
274
+  //#define GRADIENT_MIX           // Support for gradient mixing with M166 and LCD
275
+  #if ENABLED(GRADIENT_MIX)
276
+    //#define GRADIENT_VTOOL       // Add M166 T to use a V-tool index as a Gradient alias
277
+  #endif
274 278
 #endif
275 279
 
276 280
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).

+ 89
- 9
Marlin/src/feature/mixing.cpp View File

@@ -35,14 +35,18 @@ Mixer mixer;
35 35
 #endif
36 36
 
37 37
 // Used up to Planner level
38
-uint_fast8_t Mixer::selected_vtool = 0;
39
-float        Mixer::collector[MIXING_STEPPERS]; // mix proportion. 0.0 = off, otherwise <= COLOR_A_MASK.
40
-mixer_comp_t Mixer::color[NR_MIXING_VIRTUAL_TOOLS][MIXING_STEPPERS];
38
+uint_fast8_t  Mixer::selected_vtool = 0;
39
+float         Mixer::collector[MIXING_STEPPERS]; // mix proportion. 0.0 = off, otherwise <= COLOR_A_MASK.
40
+mixer_comp_t  Mixer::color[NR_MIXING_VIRTUAL_TOOLS][MIXING_STEPPERS];
41 41
 
42 42
 // Used in Stepper
43
-int_fast8_t  Mixer::runner = 0;
44
-mixer_comp_t Mixer::s_color[MIXING_STEPPERS];
45
-mixer_accu_t Mixer::accu[MIXING_STEPPERS] = { 0 };
43
+int_fast8_t   Mixer::runner = 0;
44
+mixer_comp_t  Mixer::s_color[MIXING_STEPPERS];
45
+mixer_accu_t  Mixer::accu[MIXING_STEPPERS] = { 0 };
46
+
47
+#if DUAL_MIXING_EXTRUDER || ENABLED(GRADIENT_MIX)
48
+  mixer_perc_t Mixer::mix[MIXING_STEPPERS];
49
+#endif
46 50
 
47 51
 void Mixer::normalize(const uint8_t tool_index) {
48 52
   float cmax = 0;
@@ -66,9 +70,8 @@ void Mixer::normalize(const uint8_t tool_index) {
66 70
   #endif
67 71
 
68 72
   // Scale all values so their maximum is COLOR_A_MASK
69
-  const float inverse_max = RECIPROCAL(cmax);
70
-  MIXER_STEPPER_LOOP(i)
71
-    color[tool_index][i] = collector[i] * COLOR_A_MASK * inverse_max;
73
+  const float scale = float(COLOR_A_MASK) / cmax;
74
+  MIXER_STEPPER_LOOP(i) color[tool_index][i] = collector[i] * scale;
72 75
 
73 76
   #ifdef MIXER_NORMALIZER_DEBUG
74 77
     csum = 0;
@@ -86,6 +89,10 @@ void Mixer::normalize(const uint8_t tool_index) {
86 89
     }
87 90
     SERIAL_ECHOLNPGM("]");
88 91
   #endif
92
+
93
+  #if ENABLED(GRADIENT_MIX)
94
+    refresh_gradient();
95
+  #endif
89 96
 }
90 97
 
91 98
 void Mixer::reset_vtools() {
@@ -115,6 +122,79 @@ void Mixer::init() {
115 122
   #endif
116 123
 
117 124
   ZERO(collector);
125
+
126
+  #if DUAL_MIXING_EXTRUDER || ENABLED(GRADIENT_MIX)
127
+    update_mix_from_vtool();
128
+  #endif
129
+
130
+  #if ENABLED(GRADIENT_MIX)
131
+    update_gradient_for_planner_z();
132
+  #endif
118 133
 }
119 134
 
135
+void Mixer::refresh_collector(const float proportion/*=1.0*/, const uint8_t t/*=selected_vtool*/) {
136
+  float csum = 0, cmax = 0;
137
+  MIXER_STEPPER_LOOP(i) {
138
+    const float v = color[t][i];
139
+    cmax = MAX(cmax, v);
140
+    csum += v;
141
+  }
142
+  //SERIAL_ECHOPAIR("Mixer::refresh_collector(", proportion);
143
+  //SERIAL_ECHOPAIR(", ", int(t));
144
+  //SERIAL_ECHOPAIR(") cmax=", cmax);
145
+  //SERIAL_ECHOPAIR("  csum=", csum);
146
+  //SERIAL_ECHOPGM("  color");
147
+  const float inv_prop = proportion / csum;
148
+  MIXER_STEPPER_LOOP(i) {
149
+    collector[i] = color[t][i] * inv_prop;
150
+    //SERIAL_ECHOPAIR(" [", int(t));
151
+    //SERIAL_ECHOPAIR("][", int(i));
152
+    //SERIAL_ECHOPAIR("] = ", int(color[t][i]));
153
+    //SERIAL_ECHOPAIR(" (", collector[i]);
154
+    //SERIAL_ECHOPGM(")  ");
155
+  }
156
+  //SERIAL_EOL();
157
+}
158
+
159
+#if ENABLED(GRADIENT_MIX)
160
+
161
+  #include "../module/motion.h"
162
+  #include "../module/planner.h"
163
+
164
+  gradient_t Mixer::gradient = {
165
+    false,    // enabled
166
+    {0},      // color (array)
167
+    0, 0,     // start_z, end_z
168
+    0, 1,     // start_vtool, end_vtool
169
+    {0}, {0}  // start_mix[], end_mix[]
170
+    #if ENABLED(GRADIENT_VTOOL)
171
+      , -1    // vtool_index
172
+    #endif
173
+  };
174
+
175
+  float Mixer::prev_z; // = 0
176
+
177
+  void Mixer::update_gradient_for_z(const float z) {
178
+    if (z == prev_z) return;
179
+    prev_z = z;
180
+
181
+    const float slice = gradient.end_z - gradient.start_z;
182
+
183
+    float pct = (z - gradient.start_z) / slice;
184
+    NOLESS(pct, 0.0f); NOMORE(pct, 1.0f);
185
+
186
+    MIXER_STEPPER_LOOP(i) {
187
+      const mixer_perc_t sm = gradient.start_mix[i];
188
+      mix[i] = sm + (gradient.end_mix[i] - sm) * pct;
189
+    }
190
+
191
+    copy_mix_to_color(gradient.color);
192
+  }
193
+
194
+  void Mixer::update_gradient_for_planner_z() {
195
+    update_gradient_for_z(planner.get_axis_position_mm(Z_AXIS));
196
+  }
197
+
198
+#endif // GRADIENT_MIX
199
+
120 200
 #endif // MIXING_EXTRUDER

+ 185
- 28
Marlin/src/feature/mixing.h View File

@@ -23,42 +23,70 @@
23 23
 
24 24
 #include "../inc/MarlinConfig.h"
25 25
 
26
-#ifdef __AVR__
26
+//#define MIXER_NORMALIZER_DEBUG
27
+
28
+#if !defined(__AVR__) // || DUAL_MIXING_EXTRUDER
29
+  // Use 16-bit (or fastest) data for the integer mix factors
30
+  typedef uint_fast16_t mixer_comp_t;
31
+  typedef uint_fast16_t mixer_accu_t;
32
+  #define COLOR_A_MASK 0x8000
33
+  #define COLOR_MASK 0x7FFF
34
+#else
35
+  // Use 8-bit data for the integer mix factors
36
+  // Exactness is sacrificed for speed
27 37
   #define MIXER_ACCU_SIGNED
28 38
   typedef uint8_t mixer_comp_t;
29 39
   typedef int8_t mixer_accu_t;
30 40
   #define COLOR_A_MASK 0x80
31 41
   #define COLOR_MASK 0x7F
32
-#else
33
-  typedef uint_fast16_t mixer_comp_t;
34
-  typedef uint_fast16_t mixer_accu_t;
35
-  #define COLOR_A_MASK 0x8000
36
-  #define COLOR_MASK 0x7FFF
37 42
 #endif
38 43
 
44
+typedef int8_t mixer_perc_t;
45
+
39 46
 #ifndef MIXING_VIRTUAL_TOOLS
40 47
   #define MIXING_VIRTUAL_TOOLS 1
41 48
 #endif
42 49
 
43
-#ifdef RETRACT_SYNC_MIXING
44
-  #define NR_MIXING_VIRTUAL_TOOLS (MIXING_VIRTUAL_TOOLS + 1)
45
-  #define MIXER_AUTORETRACT_TOOL MIXING_VIRTUAL_TOOLS
46
-  #if NR_MIXING_VIRTUAL_TOOLS > 254
47
-    #error "MIXING_VIRTUAL_TOOLS must be <= 254!"
50
+enum MixTool {
51
+  FIRST_USER_VIRTUAL_TOOL = 0,
52
+  LAST_USER_VIRTUAL_TOOL = MIXING_VIRTUAL_TOOLS - 1,
53
+  NR_USER_VIRTUAL_TOOLS,
54
+  #ifdef RETRACT_SYNC_MIXING
55
+    MIXER_AUTORETRACT_TOOL = NR_USER_VIRTUAL_TOOLS,
56
+    NR_MIXING_VIRTUAL_TOOLS
57
+  #else
58
+    NR_MIXING_VIRTUAL_TOOLS = NR_USER_VIRTUAL_TOOLS
48 59
   #endif
60
+};
61
+
62
+#ifdef RETRACT_SYNC_MIXING
63
+  static_assert(NR_MIXING_VIRTUAL_TOOLS <= 254, "MIXING_VIRTUAL_TOOLS must be <= 254!");
49 64
 #else
50
-  #define NR_MIXING_VIRTUAL_TOOLS (MIXING_VIRTUAL_TOOLS)
51
-  #if NR_MIXING_VIRTUAL_TOOLS > 255
52
-    #error "MIXING_VIRTUAL_TOOLS must be <= 255!"
53
-  #endif
65
+  static_assert(NR_MIXING_VIRTUAL_TOOLS <= 255, "MIXING_VIRTUAL_TOOLS must be <= 255!");
54 66
 #endif
55 67
 
56 68
 #define MIXER_STEPPER_LOOP(VAR) \
57 69
   for (uint_fast8_t VAR = 0; VAR < MIXING_STEPPERS; VAR++)
58 70
 
59
-#define MIXER_BLOCK_FIELD      mixer_comp_t b_color[MIXING_STEPPERS]
60
-#define MIXER_POPULATE_BLOCK() mixer.populate_block(block->b_color)
61
-#define MIXER_STEPPER_SETUP()  mixer.stepper_setup(current_block->b_color)
71
+#define MIXER_BLOCK_FIELD       mixer_comp_t b_color[MIXING_STEPPERS]
72
+#define MIXER_POPULATE_BLOCK()  mixer.populate_block(block->b_color)
73
+#define MIXER_STEPPER_SETUP()   mixer.stepper_setup(current_block->b_color)
74
+
75
+#if ENABLED(GRADIENT_MIX)
76
+
77
+  typedef struct {
78
+    bool enabled;                         // This gradient is enabled
79
+    mixer_comp_t color[MIXING_STEPPERS];  // The current gradient color
80
+    float start_z, end_z;                 // Region for gradient
81
+    int8_t start_vtool, end_vtool;        // Start and end virtual tools
82
+    mixer_perc_t start_mix[MIXING_STEPPERS],   // Start and end mixes from those tools
83
+                 end_mix[MIXING_STEPPERS];
84
+    #if ENABLED(GRADIENT_VTOOL)
85
+      int8_t vtool_index;                 // Use this virtual tool number as index
86
+    #endif
87
+  } gradient_t;
88
+
89
+#endif
62 90
 
63 91
 /**
64 92
  * @brief Mixer class
@@ -67,27 +95,157 @@
67 95
 class Mixer {
68 96
   public:
69 97
 
70
-  static void init();
98
+  static float collector[MIXING_STEPPERS];    // M163 components, also editable from LCD
99
+
100
+  static void init(); // Populate colors at boot time
71 101
 
72 102
   static void reset_vtools();
103
+  static void refresh_collector(const float proportion=1.0, const uint8_t t=selected_vtool);
73 104
 
74 105
   // Used up to Planner level
106
+  FORCE_INLINE static void set_collector(const uint8_t c, const float f) { collector[c] = MAX(f, 0.0f); }
107
+
75 108
   static void normalize(const uint8_t tool_index);
109
+  FORCE_INLINE static void normalize() { normalize(selected_vtool); }
110
+
76 111
   FORCE_INLINE static uint8_t get_current_vtool() { return selected_vtool; }
77
-  FORCE_INLINE static void T(const uint_fast8_t c) { selected_vtool = c; }
78
-  FORCE_INLINE static void set_collector(const uint8_t c, const float f) { collector[c] = f; }
112
+
113
+  FORCE_INLINE static void T(const uint_fast8_t c) {
114
+    selected_vtool = c;
115
+    #if ENABLED(GRADIENT_VTOOL)
116
+      refresh_gradient();
117
+    #endif
118
+    #if DUAL_MIXING_EXTRUDER
119
+      update_mix_from_vtool();
120
+    #endif
121
+  }
79 122
 
80 123
   // Used when dealing with blocks
81
-  FORCE_INLINE static void populate_block(mixer_comp_t b_color[]) {
82
-    uint_fast8_t j = get_current_vtool();
83
-    MIXER_STEPPER_LOOP(i) b_color[i] = color[j][i];
124
+  FORCE_INLINE static void populate_block(mixer_comp_t b_color[MIXING_STEPPERS]) {
125
+    #if ENABLED(GRADIENT_MIX)
126
+      if (gradient.enabled) {
127
+        MIXER_STEPPER_LOOP(i) b_color[i] = gradient.color[i];
128
+        return;
129
+      }
130
+    #endif
131
+    MIXER_STEPPER_LOOP(i) b_color[i] = color[selected_vtool][i];
84 132
   }
85
-  FORCE_INLINE static void stepper_setup(mixer_comp_t b_color[]) { MIXER_STEPPER_LOOP(i) s_color[i] = b_color[i]; }
133
+
134
+  FORCE_INLINE static void stepper_setup(mixer_comp_t b_color[MIXING_STEPPERS]) {
135
+    MIXER_STEPPER_LOOP(i) s_color[i] = b_color[i];
136
+  }
137
+
138
+  #if DUAL_MIXING_EXTRUDER || ENABLED(GRADIENT_MIX)
139
+
140
+    static mixer_perc_t mix[MIXING_STEPPERS];  // Scratch array for the Mix in proportion to 100
141
+
142
+    static inline void copy_mix_to_color(mixer_comp_t (&tcolor)[MIXING_STEPPERS]) {
143
+      // Scale each component to the largest one in terms of COLOR_A_MASK
144
+      // So the largest component will be COLOR_A_MASK and the other will be in proportion to it
145
+      const float scale = (COLOR_A_MASK) * RECIPROCAL(float(MAX(mix[0], mix[1])));
146
+
147
+      // Scale all values so their maximum is COLOR_A_MASK
148
+      MIXER_STEPPER_LOOP(i) tcolor[i] = mix[i] * scale;
149
+
150
+      #ifdef MIXER_NORMALIZER_DEBUG
151
+        SERIAL_ECHOPAIR("Mix [", int(mix[0]));
152
+        SERIAL_ECHOPAIR(", ", int(mix[1]));
153
+        SERIAL_ECHOPAIR("] to Color [", int(tcolor[0]));
154
+        SERIAL_ECHOPAIR(", ", int(tcolor[1]));
155
+        SERIAL_ECHOLNPGM("]");
156
+      #endif
157
+    }
158
+
159
+    static inline void update_mix_from_vtool(const uint8_t j=selected_vtool) {
160
+      float ctot = 0;
161
+      MIXER_STEPPER_LOOP(i) ctot += color[j][i];
162
+      //MIXER_STEPPER_LOOP(i) mix[i] = 100.0f * color[j][i] / ctot;
163
+      mix[0] = mixer_perc_t(100.0f * color[j][0] / ctot);
164
+      mix[1] = 100 - mix[0];
165
+      #ifdef MIXER_NORMALIZER_DEBUG
166
+        SERIAL_ECHOPAIR("V-tool ", int(j));
167
+        SERIAL_ECHOPAIR(" [", int(color[j][0]));
168
+        SERIAL_ECHOPAIR(", ", int(color[j][1]));
169
+        SERIAL_ECHOPAIR("] to Mix [", int(mix[0]));
170
+        SERIAL_ECHOPAIR(", ", int(mix[1]));
171
+        SERIAL_ECHOLNPGM("]");
172
+      #endif
173
+    }
174
+
175
+  #endif // DUAL_MIXING_EXTRUDER || GRADIENT_MIX
176
+
177
+  #if DUAL_MIXING_EXTRUDER
178
+
179
+    // Update the virtual tool from an edited mix
180
+    static inline void update_vtool_from_mix() {
181
+      copy_mix_to_color(color[selected_vtool]);
182
+      #if ENABLED(GRADIENT_MIX)
183
+        refresh_gradient();
184
+      #endif
185
+      // MIXER_STEPPER_LOOP(i) collector[i] = mix[i];
186
+      // normalize();
187
+    }
188
+
189
+  #endif // DUAL_MIXING_EXTRUDER
190
+
191
+  #if ENABLED(GRADIENT_MIX)
192
+
193
+    static gradient_t gradient;
194
+    static float prev_z;
195
+
196
+    // Update the current mix from the gradient for a given Z
197
+    static void update_gradient_for_z(const float z);
198
+    static void update_gradient_for_planner_z();
199
+    static inline void gradient_control(const float z) {
200
+      if (gradient.enabled) {
201
+        if (z >= gradient.end_z)
202
+          T(gradient.end_vtool);
203
+        else
204
+          update_gradient_for_z(z);
205
+      }
206
+    }
207
+
208
+    static inline void update_mix_from_gradient() {
209
+      float ctot = 0;
210
+      MIXER_STEPPER_LOOP(i) ctot += gradient.color[i];
211
+      mix[0] = (mixer_perc_t)CEIL(100.0f * gradient.color[0] / ctot);
212
+      mix[1] = 100 - mix[0];
213
+      #ifdef MIXER_NORMALIZER_DEBUG
214
+        SERIAL_ECHOPAIR("Gradient [", int(gradient.color[0]));
215
+        SERIAL_ECHOPAIR(", ", int(gradient.color[1]));
216
+        SERIAL_ECHOPAIR("] to Mix [", int(mix[0]));
217
+        SERIAL_ECHOPAIR(", ", int(mix[1]));
218
+        SERIAL_ECHOLNPGM("]");
219
+      #endif
220
+    }
221
+
222
+    // Refresh the gradient after a change
223
+    static void refresh_gradient() {
224
+      #if ENABLED(GRADIENT_VTOOL)
225
+        const bool is_grd = (selected_vtool == gradient.vtool_index);
226
+      #else
227
+        constexpr bool is_grd = true;
228
+      #endif
229
+      gradient.enabled = is_grd && gradient.start_vtool != gradient.end_vtool && gradient.start_z < gradient.end_z;
230
+      if (gradient.enabled) {
231
+        mixer_perc_t mix_bak[MIXING_STEPPERS];
232
+        COPY(mix_bak, mix);
233
+        update_mix_from_vtool(gradient.start_vtool);
234
+        COPY(gradient.start_mix, mix);
235
+        update_mix_from_vtool(gradient.end_vtool);
236
+        COPY(gradient.end_mix, mix);
237
+        update_gradient_for_planner_z();
238
+        COPY(mix, mix_bak);
239
+        prev_z = -1;
240
+      }
241
+    }
242
+
243
+  #endif // GRADIENT_MIX
86 244
 
87 245
   // Used in Stepper
88 246
   FORCE_INLINE static uint8_t get_stepper() { return runner; }
89 247
   FORCE_INLINE static uint8_t get_next_stepper() {
90
-    do {
248
+    for (;;) {
91 249
       if (--runner < 0) runner = MIXING_STEPPERS - 1;
92 250
       accu[runner] += s_color[runner];
93 251
       if (
@@ -100,14 +258,13 @@ class Mixer {
100 258
         accu[runner] &= COLOR_MASK;
101 259
         return runner;
102 260
       }
103
-    } while( true );
261
+    }
104 262
   }
105 263
 
106 264
   private:
107 265
 
108 266
   // Used up to Planner level
109 267
   static uint_fast8_t selected_vtool;
110
-  static float        collector[MIXING_STEPPERS];
111 268
   static mixer_comp_t color[NR_MIXING_VIRTUAL_TOOLS][MIXING_STEPPERS];
112 269
 
113 270
   // Used in Stepper

+ 8
- 0
Marlin/src/feature/power_loss_recovery.cpp View File

@@ -176,6 +176,10 @@ void PrintJobRecovery::save(const bool force/*=false*/, const bool save_queue/*=
176 176
       );
177 177
     #endif
178 178
 
179
+    #if ENABLED(GRADIENT_MIX)
180
+      memcpy(&info.gradient, &mixer.gradient, sizeof(info.gradient));
181
+    #endif
182
+
179 183
     #if ENABLED(FWRETRACT)
180 184
       COPY(info.retract, fwretract.current_retract);
181 185
       info.retract_hop = fwretract.current_hop;
@@ -305,6 +309,10 @@ void PrintJobRecovery::resume() {
305 309
     }
306 310
   #endif
307 311
 
312
+  #if ENABLED(GRADIENT_MIX)
313
+    memcpy(&mixer.gradient, &info.gradient, sizeof(info.gradient));
314
+  #endif
315
+
308 316
   // Restore Z (plus raise) and E positions with G92.0
309 317
   dtostrf(info.current_position[Z_AXIS] + RECOVERY_ZRAISE, 1, 3, str_1);
310 318
   dtostrf(info.current_position[E_AXIS]

+ 13
- 0
Marlin/src/feature/power_loss_recovery.h View File

@@ -28,6 +28,10 @@
28 28
 #include "../sd/cardreader.h"
29 29
 #include "../inc/MarlinConfigPre.h"
30 30
 
31
+#if ENABLED(MIXING_EXTRUDER)
32
+  #include "../feature/mixing.h"
33
+#endif
34
+
31 35
 #define SAVE_INFO_INTERVAL_MS 0
32 36
 //#define SAVE_EACH_CMD_MODE
33 37
 //#define DEBUG_POWER_LOSS_RECOVERY
@@ -63,6 +67,15 @@ typedef struct {
63 67
     float retract[EXTRUDERS], retract_hop;
64 68
   #endif
65 69
 
70
+  // Mixing extruder and gradient
71
+  #if ENABLED(MIXING_EXTRUDER)
72
+    //uint_fast8_t selected_vtool;
73
+    //mixer_comp_t color[NR_MIXING_VIRTUAL_TOOLS][MIXING_STEPPERS];
74
+    #if ENABLED(GRADIENT_MIX)
75
+      gradient_t gradient;
76
+    #endif
77
+  #endif
78
+
66 79
   // Command queue
67 80
   uint8_t commands_in_queue, cmd_queue_index_r;
68 81
   char command_queue[BUFSIZE][MAX_CMD_SIZE];

+ 8
- 6
Marlin/src/gcode/feature/mixing/M163-M165.cpp View File

@@ -38,7 +38,7 @@
38 38
 void GcodeSuite::M163() {
39 39
   const int mix_index = parser.intval('S');
40 40
   if (mix_index < MIXING_STEPPERS)
41
-    mixer.set_collector(mix_index, MAX(parser.floatval('P'), 0.0));
41
+    mixer.set_collector(mix_index, parser.floatval('P'));
42 42
 }
43 43
 
44 44
 /**
@@ -53,10 +53,12 @@ void GcodeSuite::M164() {
53 53
   #else
54 54
     constexpr int tool_index = 0;
55 55
   #endif
56
-  if (WITHIN(tool_index, 0, MIXING_VIRTUAL_TOOLS - 1))
57
-    mixer.normalize(tool_index);
56
+  if (tool_index >= 0) {
57
+    if (tool_index < MIXING_VIRTUAL_TOOLS)
58
+      mixer.normalize(tool_index);
59
+  }
58 60
   else
59
-    mixer.normalize(mixer.get_current_vtool());
61
+    mixer.normalize();
60 62
 }
61 63
 
62 64
 #if ENABLED(DIRECT_MIXING_IN_G1)
@@ -95,7 +97,7 @@ void GcodeSuite::M164() {
95 97
     MIXER_STEPPER_LOOP(i) {
96 98
       if (parser.seenval(mixing_codes[i])) {
97 99
         SBI(mix_bits, i);
98
-        mixer.set_collector(i, MAX(parser.value_float(), 0.0f));
100
+        mixer.set_collector(i, parser.value_float());
99 101
       }
100 102
     }
101 103
     // If any mixing factors were included, clear the rest
@@ -103,7 +105,7 @@ void GcodeSuite::M164() {
103 105
     if (mix_bits) {
104 106
       MIXER_STEPPER_LOOP(i)
105 107
         if (!TEST(mix_bits, i)) mixer.set_collector(i, 0.0f);
106
-      mixer.normalize(mixer.get_current_vtool());
108
+      mixer.normalize();
107 109
     }
108 110
   }
109 111
 

+ 100
- 0
Marlin/src/gcode/feature/mixing/M166.cpp View File

@@ -0,0 +1,100 @@
1
+/**
2
+ * Marlin 3D Printer Firmware
3
+ * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4
+ *
5
+ * Based on Sprinter and grbl.
6
+ * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
7
+ *
8
+ * This program is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
20
+ *
21
+ */
22
+
23
+#include "../../../inc/MarlinConfig.h"
24
+
25
+#if ENABLED(GRADIENT_MIX)
26
+
27
+#include "../../gcode.h"
28
+#include "../../../module/motion.h"
29
+#include "../../../module/planner.h"
30
+#include "../../../feature/mixing.h"
31
+
32
+inline void echo_mix() {
33
+  SERIAL_ECHOPAIR(" (", int(mixer.mix[0]));
34
+  SERIAL_ECHOPAIR("%|", int(mixer.mix[1]));
35
+  SERIAL_ECHOPGM("%)");
36
+}
37
+
38
+inline void echo_zt(const int t, const float &z) {
39
+  mixer.update_mix_from_vtool(t);
40
+  SERIAL_ECHOPAIR(" Z", z);
41
+  SERIAL_ECHOPAIR(" T", t);
42
+  echo_mix();
43
+}
44
+
45
+/**
46
+ * M166: Set a simple gradient mix for a two-component mixer
47
+ *       based on the Geeetech A10M implementation by Jone Liu.
48
+ *
49
+ *   S[bool]  - Enable / disable gradients
50
+ *   A[float] - Starting Z for the gradient
51
+ *   Z[float] - Ending Z for the gradient. (Must be greater than the starting Z.)
52
+ *   I[index] - V-Tool to use as the starting mix.
53
+ *   J[index] - V-Tool to use as the ending mix.
54
+ *
55
+ *   T[index] - A V-Tool index to use as an alias for the Gradient (Requires GRADIENT_VTOOL)
56
+ *              T with no index clears the setting. Note: This can match the I or J value.
57
+ *
58
+ * Example: M166 S1 A0 Z20 I0 J1
59
+ */
60
+void GcodeSuite::M166() {
61
+  if (parser.seenval('A')) mixer.gradient.start_z = parser.value_float();
62
+  if (parser.seenval('Z')) mixer.gradient.end_z = parser.value_float();
63
+  if (parser.seenval('I')) mixer.gradient.start_vtool = (uint8_t)constrain(parser.value_int(), 0, MIXING_VIRTUAL_TOOLS);
64
+  if (parser.seenval('J')) mixer.gradient.end_vtool = (uint8_t)constrain(parser.value_int(), 0, MIXING_VIRTUAL_TOOLS);
65
+
66
+  #if ENABLED(GRADIENT_VTOOL)
67
+    if (parser.seen('T')) mixer.gradient.vtool_index = parser.byteval('T', -1);
68
+  #endif
69
+
70
+  if (parser.seen('S')) mixer.gradient.enabled = parser.value_bool();
71
+
72
+  SERIAL_ECHOPGM("Gradient Mix ");
73
+  serialprint_onoff(mixer.gradient.enabled);
74
+
75
+  if (mixer.gradient.enabled) {
76
+
77
+    mixer.refresh_gradient();
78
+
79
+    #if ENABLED(GRADIENT_VTOOL)
80
+      if (mixer.gradient.vtool_index >= 0) {
81
+        SERIAL_ECHOPAIR(" (T", int(mixer.gradient.vtool_index));
82
+        SERIAL_CHAR(')');
83
+      }
84
+    #endif
85
+
86
+    SERIAL_ECHOPGM(" ; Start");
87
+    echo_zt(mixer.gradient.start_vtool, mixer.gradient.start_z);
88
+
89
+    SERIAL_ECHOPGM(" ; End");
90
+    echo_zt(mixer.gradient.end_vtool, mixer.gradient.end_z);
91
+
92
+    mixer.update_mix_from_gradient();
93
+    SERIAL_ECHOPAIR(" ; Current Z", planner.get_axis_position_mm(Z_AXIS));
94
+    echo_mix();
95
+  }
96
+
97
+  SERIAL_EOL();
98
+}
99
+
100
+#endif // GRADIENT_MIX

+ 0
- 0
Marlin/src/gcode/gcode.cpp View File


Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save