Browse Source

Option to disable all volumetric extrusion

Scott Lahteine 6 years ago
parent
commit
933f76fda3

+ 13
- 6
Marlin/Configuration_adv.h View File

@@ -1365,13 +1365,20 @@
1365 1365
 #define EXTENDED_CAPABILITIES_REPORT
1366 1366
 
1367 1367
 /**
1368
- * Volumetric extrusion default state
1369
- * Activate to make volumetric extrusion the default method,
1370
- * with DEFAULT_NOMINAL_FILAMENT_DIA as the default diameter.
1371
- *
1372
- * M200 D0 to disable, M200 Dn to set a new diameter.
1368
+ * Disable all Volumetric extrusion options
1373 1369
  */
1374
-//#define VOLUMETRIC_DEFAULT_ON
1370
+//#define NO_VOLUMETRICS
1371
+
1372
+#if DISABLED(NO_VOLUMETRICS)
1373
+  /**
1374
+   * Volumetric extrusion default state
1375
+   * Activate to make volumetric extrusion the default method,
1376
+   * with DEFAULT_NOMINAL_FILAMENT_DIA as the default diameter.
1377
+   *
1378
+   * M200 D0 to disable, M200 Dn to set a new diameter.
1379
+   */
1380
+  //#define VOLUMETRIC_DEFAULT_ON
1381
+#endif
1375 1382
 
1376 1383
 /**
1377 1384
  * Enable this option for a leaner build of Marlin that removes all

+ 20
- 16
Marlin/src/gcode/config/M200-M205.cpp View File

@@ -24,25 +24,29 @@
24 24
 #include "../../Marlin.h"
25 25
 #include "../../module/planner.h"
26 26
 
27
-/**
28
- * M200: Set filament diameter and set E axis units to cubic units
29
- *
30
- *    T<extruder> - Optional extruder number. Current extruder if omitted.
31
- *    D<linear> - Diameter of the filament. Use "D0" to switch back to linear units on the E axis.
32
- */
33
-void GcodeSuite::M200() {
27
+#if DISABLED(NO_VOLUMETRICS)
28
+
29
+  /**
30
+   * M200: Set filament diameter and set E axis units to cubic units
31
+   *
32
+   *    T<extruder> - Optional extruder number. Current extruder if omitted.
33
+   *    D<linear> - Diameter of the filament. Use "D0" to switch back to linear units on the E axis.
34
+   */
35
+  void GcodeSuite::M200() {
34 36
 
35
-  if (get_target_extruder_from_command()) return;
37
+    if (get_target_extruder_from_command()) return;
36 38
 
37
-  if (parser.seen('D')) {
38
-    // setting any extruder filament size disables volumetric on the assumption that
39
-    // slicers either generate in extruder values as cubic mm or as as filament feeds
40
-    // for all extruders
41
-    if ( (parser.volumetric_enabled = (parser.value_linear_units() != 0.0)) )
42
-      planner.set_filament_size(target_extruder, parser.value_linear_units());
39
+    if (parser.seen('D')) {
40
+      // setting any extruder filament size disables volumetric on the assumption that
41
+      // slicers either generate in extruder values as cubic mm or as as filament feeds
42
+      // for all extruders
43
+      if ( (parser.volumetric_enabled = (parser.value_linear_units() != 0.0)) )
44
+        planner.set_filament_size(target_extruder, parser.value_linear_units());
45
+    }
46
+    planner.calculate_volumetric_multipliers();
43 47
   }
44
-  planner.calculate_volumetric_multipliers();
45
-}
48
+
49
+#endif // !NO_VOLUMETRICS
46 50
 
47 51
 /**
48 52
  * M201: Set max acceleration in units/s^2 for print moves (M201 X1000 Y1000)

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

@@ -465,9 +465,9 @@ void GcodeSuite::process_parsed_command() {
465 465
         #endif
466 466
       #endif
467 467
 
468
-      case 200: // M200: Set filament diameter, E to cubic units
469
-        M200();
470
-        break;
468
+      #if DISABLED(NO_VOLUMETRICS)
469
+        case 200: M200(); break;  // M200: Set filament diameter, E to cubic units
470
+      #endif
471 471
 
472 472
       case 201: M201(); break;  // M201: Set max acceleration for print moves (units/s^2)
473 473
 

+ 7
- 3
Marlin/src/inc/SanityCheck.h View File

@@ -894,15 +894,19 @@ static_assert(1 >= 0
894 894
  */
895 895
 #if ENABLED(DISABLE_X) || ENABLED(DISABLE_Y) || ENABLED(DISABLE_Z)
896 896
   #if ENABLED(HOME_AFTER_DEACTIVATE) || ENABLED(Z_SAFE_HOMING)
897
-    #error "DISABLE_[XYZ] not compatible with HOME_AFTER_DEACTIVATE or Z_SAFE_HOMING."
897
+    #error "DISABLE_[XYZ] is not compatible with HOME_AFTER_DEACTIVATE or Z_SAFE_HOMING."
898 898
   #endif
899 899
 #endif // DISABLE_[XYZ]
900 900
 
901 901
 /**
902 902
  * Filament Width Sensor
903 903
  */
904
-#if ENABLED(FILAMENT_WIDTH_SENSOR) && !HAS_FILAMENT_WIDTH_SENSOR
905
-  #error "FILAMENT_WIDTH_SENSOR requires a FILWIDTH_PIN to be defined."
904
+#if ENABLED(FILAMENT_WIDTH_SENSOR)
905
+  #if !HAS_FILAMENT_WIDTH_SENSOR
906
+    #error "FILAMENT_WIDTH_SENSOR requires a FILWIDTH_PIN to be defined."
907
+  #elif ENABLED(NO_VOLUMETRICS)
908
+    #error "FILAMENT_WIDTH_SENSOR requires NO_VOLUMETRICS to be disabled."
909
+  #endif
906 910
 #endif
907 911
 
908 912
 /**

+ 24
- 20
Marlin/src/lcd/ultralcd.cpp View File

@@ -3636,26 +3636,30 @@ void kill_screen(const char* lcd_msg) {
3636 3636
       MENU_ITEM_EDIT(float3, MSG_ADVANCE_K, &planner.extruder_advance_k, 0, 999);
3637 3637
     #endif
3638 3638
 
3639
-    MENU_ITEM_EDIT_CALLBACK(bool, MSG_VOLUMETRIC_ENABLED, &parser.volumetric_enabled, planner.calculate_volumetric_multipliers);
3640
-
3641
-    if (parser.volumetric_enabled) {
3642
-      #if EXTRUDERS == 1
3643
-        MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_DIAM, &planner.filament_size[0], 1.5, 3.25, planner.calculate_volumetric_multipliers);
3644
-      #else // EXTRUDERS > 1
3645
-        MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_DIAM, &planner.filament_size[active_extruder], 1.5, 3.25, planner.calculate_volumetric_multipliers);
3646
-        MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_DIAM MSG_DIAM_E1, &planner.filament_size[0], 1.5, 3.25, planner.calculate_volumetric_multipliers);
3647
-        MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_DIAM MSG_DIAM_E2, &planner.filament_size[1], 1.5, 3.25, planner.calculate_volumetric_multipliers);
3648
-        #if EXTRUDERS > 2
3649
-          MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_DIAM MSG_DIAM_E3, &planner.filament_size[2], 1.5, 3.25, planner.calculate_volumetric_multipliers);
3650
-          #if EXTRUDERS > 3
3651
-            MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_DIAM MSG_DIAM_E4, &planner.filament_size[3], 1.5, 3.25, planner.calculate_volumetric_multipliers);
3652
-            #if EXTRUDERS > 4
3653
-              MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_DIAM MSG_DIAM_E5, &planner.filament_size[4], 1.5, 3.25, planner.calculate_volumetric_multipliers);
3654
-            #endif // EXTRUDERS > 4
3655
-          #endif // EXTRUDERS > 3
3656
-        #endif // EXTRUDERS > 2
3657
-      #endif // EXTRUDERS > 1
3658
-    }
3639
+    #if DISABLED(NO_VOLUMETRICS)
3640
+
3641
+      MENU_ITEM_EDIT_CALLBACK(bool, MSG_VOLUMETRIC_ENABLED, &parser.volumetric_enabled, planner.calculate_volumetric_multipliers);
3642
+
3643
+      if (parser.volumetric_enabled) {
3644
+        #if EXTRUDERS == 1
3645
+          MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_DIAM, &planner.filament_size[0], 1.5, 3.25, planner.calculate_volumetric_multipliers);
3646
+        #else // EXTRUDERS > 1
3647
+          MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_DIAM, &planner.filament_size[active_extruder], 1.5, 3.25, planner.calculate_volumetric_multipliers);
3648
+          MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_DIAM MSG_DIAM_E1, &planner.filament_size[0], 1.5, 3.25, planner.calculate_volumetric_multipliers);
3649
+          MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_DIAM MSG_DIAM_E2, &planner.filament_size[1], 1.5, 3.25, planner.calculate_volumetric_multipliers);
3650
+          #if EXTRUDERS > 2
3651
+            MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_DIAM MSG_DIAM_E3, &planner.filament_size[2], 1.5, 3.25, planner.calculate_volumetric_multipliers);
3652
+            #if EXTRUDERS > 3
3653
+              MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_DIAM MSG_DIAM_E4, &planner.filament_size[3], 1.5, 3.25, planner.calculate_volumetric_multipliers);
3654
+              #if EXTRUDERS > 4
3655
+                MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_DIAM MSG_DIAM_E5, &planner.filament_size[4], 1.5, 3.25, planner.calculate_volumetric_multipliers);
3656
+              #endif // EXTRUDERS > 4
3657
+            #endif // EXTRUDERS > 3
3658
+          #endif // EXTRUDERS > 2
3659
+        #endif // EXTRUDERS > 1
3660
+      }
3661
+
3662
+    #endif // !NO_VOLUMETRICS
3659 3663
 
3660 3664
     END_MENU();
3661 3665
   }

+ 72
- 51
Marlin/src/module/configuration_store.cpp View File

@@ -239,7 +239,9 @@ void MarlinSettings::postprocess() {
239 239
     thermalManager.updatePID();
240 240
   #endif
241 241
 
242
-  planner.calculate_volumetric_multipliers();
242
+  #if DISABLED(NO_VOLUMETRICS)
243
+    planner.calculate_volumetric_multipliers();
244
+  #endif
243 245
 
244 246
   #if HAS_HOME_OFFSET || ENABLED(DUAL_X_CARRIAGE)
245 247
     // Software endstops depend on home_offset
@@ -538,13 +540,20 @@ void MarlinSettings::postprocess() {
538 540
       EEPROM_WRITE(fwretract.swap_retract_recover_feedrate_mm_s);
539 541
     #endif
540 542
 
541
-    EEPROM_WRITE(parser.volumetric_enabled);
543
+    //
544
+    // Volumetric & Filament Size
545
+    //
546
+    #if DISABLED(NO_VOLUMETRICS)
542 547
 
543
-    // Save filament sizes
544
-    for (uint8_t q = 0; q < MAX_EXTRUDERS; q++) {
545
-      if (q < COUNT(planner.filament_size)) dummy = planner.filament_size[q];
546
-      EEPROM_WRITE(dummy);
547
-    }
548
+      EEPROM_WRITE(parser.volumetric_enabled);
549
+
550
+      // Save filament sizes
551
+      for (uint8_t q = 0; q < MAX_EXTRUDERS; q++) {
552
+        if (q < COUNT(planner.filament_size)) dummy = planner.filament_size[q];
553
+        EEPROM_WRITE(dummy);
554
+      }
555
+
556
+    #endif
548 557
 
549 558
     // Save TMC2130 or TMC2208 Configuration, and placeholder values
550 559
     uint16_t val;
@@ -1028,12 +1037,16 @@ void MarlinSettings::postprocess() {
1028 1037
       //
1029 1038
       // Volumetric & Filament Size
1030 1039
       //
1040
+      #if DISABLED(NO_VOLUMETRICS)
1031 1041
 
1032
-      EEPROM_READ(parser.volumetric_enabled);
1033
-      for (uint8_t q = 0; q < MAX_EXTRUDERS; q++) {
1034
-        EEPROM_READ(dummy);
1035
-        if (q < COUNT(planner.filament_size)) planner.filament_size[q] = dummy;
1036
-      }
1042
+        EEPROM_READ(parser.volumetric_enabled);
1043
+
1044
+        for (uint8_t q = 0; q < MAX_EXTRUDERS; q++) {
1045
+          EEPROM_READ(dummy);
1046
+          if (q < COUNT(planner.filament_size)) planner.filament_size[q] = dummy;
1047
+        }
1048
+
1049
+      #endif
1037 1050
 
1038 1051
       //
1039 1052
       // TMC2130 Stepper Current
@@ -1484,15 +1497,19 @@ void MarlinSettings::reset() {
1484 1497
     fwretract.reset();
1485 1498
   #endif
1486 1499
 
1487
-  parser.volumetric_enabled =
1488
-    #if ENABLED(VOLUMETRIC_DEFAULT_ON)
1489
-      true
1490
-    #else
1491
-      false
1492
-    #endif
1493
-  ;
1494
-  for (uint8_t q = 0; q < COUNT(planner.filament_size); q++)
1495
-    planner.filament_size[q] = DEFAULT_NOMINAL_FILAMENT_DIA;
1500
+  #if DISABLED(NO_VOLUMETRICS)
1501
+
1502
+    parser.volumetric_enabled =
1503
+      #if ENABLED(VOLUMETRIC_DEFAULT_ON)
1504
+        true
1505
+      #else
1506
+        false
1507
+      #endif
1508
+    ;
1509
+    for (uint8_t q = 0; q < COUNT(planner.filament_size); q++)
1510
+      planner.filament_size[q] = DEFAULT_NOMINAL_FILAMENT_DIA;
1511
+
1512
+  #endif
1496 1513
 
1497 1514
   endstops.enable_globally(
1498 1515
     #if ENABLED(ENDSTOPS_ALWAYS_ON_DEFAULT)
@@ -1630,46 +1647,50 @@ void MarlinSettings::reset() {
1630 1647
 
1631 1648
     SERIAL_EOL();
1632 1649
 
1633
-    /**
1634
-     * Volumetric extrusion M200
1635
-     */
1636
-    if (!forReplay) {
1637
-      CONFIG_ECHO_START;
1638
-      SERIAL_ECHOPGM("Filament settings:");
1639
-      if (parser.volumetric_enabled)
1640
-        SERIAL_EOL();
1641
-      else
1642
-        SERIAL_ECHOLNPGM(" Disabled");
1643
-    }
1650
+    #if DISABLED(NO_VOLUMETRICS)
1651
+
1652
+      /**
1653
+       * Volumetric extrusion M200
1654
+       */
1655
+      if (!forReplay) {
1656
+        CONFIG_ECHO_START;
1657
+        SERIAL_ECHOPGM("Filament settings:");
1658
+        if (parser.volumetric_enabled)
1659
+          SERIAL_EOL();
1660
+        else
1661
+          SERIAL_ECHOLNPGM(" Disabled");
1662
+      }
1644 1663
 
1645
-    CONFIG_ECHO_START;
1646
-    SERIAL_ECHOPAIR("  M200 D", LINEAR_UNIT(planner.filament_size[0]));
1647
-    SERIAL_EOL();
1648
-    #if EXTRUDERS > 1
1649 1664
       CONFIG_ECHO_START;
1650
-      SERIAL_ECHOPAIR("  M200 T1 D", LINEAR_UNIT(planner.filament_size[1]));
1665
+      SERIAL_ECHOPAIR("  M200 D", LINEAR_UNIT(planner.filament_size[0]));
1651 1666
       SERIAL_EOL();
1652
-      #if EXTRUDERS > 2
1667
+      #if EXTRUDERS > 1
1653 1668
         CONFIG_ECHO_START;
1654
-        SERIAL_ECHOPAIR("  M200 T2 D", LINEAR_UNIT(planner.filament_size[2]));
1669
+        SERIAL_ECHOPAIR("  M200 T1 D", LINEAR_UNIT(planner.filament_size[1]));
1655 1670
         SERIAL_EOL();
1656
-        #if EXTRUDERS > 3
1671
+        #if EXTRUDERS > 2
1657 1672
           CONFIG_ECHO_START;
1658
-          SERIAL_ECHOPAIR("  M200 T3 D", LINEAR_UNIT(planner.filament_size[3]));
1673
+          SERIAL_ECHOPAIR("  M200 T2 D", LINEAR_UNIT(planner.filament_size[2]));
1659 1674
           SERIAL_EOL();
1660
-          #if EXTRUDERS > 4
1675
+          #if EXTRUDERS > 3
1661 1676
             CONFIG_ECHO_START;
1662
-            SERIAL_ECHOPAIR("  M200 T4 D", LINEAR_UNIT(planner.filament_size[4]));
1677
+            SERIAL_ECHOPAIR("  M200 T3 D", LINEAR_UNIT(planner.filament_size[3]));
1663 1678
             SERIAL_EOL();
1664
-          #endif // EXTRUDERS > 4
1665
-        #endif // EXTRUDERS > 3
1666
-      #endif // EXTRUDERS > 2
1667
-    #endif // EXTRUDERS > 1
1679
+            #if EXTRUDERS > 4
1680
+              CONFIG_ECHO_START;
1681
+              SERIAL_ECHOPAIR("  M200 T4 D", LINEAR_UNIT(planner.filament_size[4]));
1682
+              SERIAL_EOL();
1683
+            #endif // EXTRUDERS > 4
1684
+          #endif // EXTRUDERS > 3
1685
+        #endif // EXTRUDERS > 2
1686
+      #endif // EXTRUDERS > 1
1668 1687
 
1669
-    if (!parser.volumetric_enabled) {
1670
-      CONFIG_ECHO_START;
1671
-      SERIAL_ECHOLNPGM("  M200 D0");
1672
-    }
1688
+      if (!parser.volumetric_enabled) {
1689
+        CONFIG_ECHO_START;
1690
+        SERIAL_ECHOLNPGM("  M200 D0");
1691
+      }
1692
+
1693
+    #endif // !NO_VOLUMETRICS
1673 1694
 
1674 1695
     if (!forReplay) {
1675 1696
       CONFIG_ECHO_START;

+ 28
- 21
Marlin/src/module/planner.cpp View File

@@ -105,10 +105,13 @@ float Planner::max_feedrate_mm_s[XYZE_N], // Max speeds in mm per second
105 105
 
106 106
 int16_t Planner::flow_percentage[EXTRUDERS] = ARRAY_BY_EXTRUDERS1(100); // Extrusion factor for each extruder
107 107
 
108
-float Planner::e_factor[EXTRUDERS],               // The flow percentage and volumetric multiplier combine to scale E movement
109
-      Planner::filament_size[EXTRUDERS],          // diameter of filament (in millimeters), typically around 1.75 or 2.85, 0 disables the volumetric calculations for the extruder
110
-      Planner::volumetric_area_nominal = CIRCLE_AREA((DEFAULT_NOMINAL_FILAMENT_DIA) * 0.5), // Nominal cross-sectional area
111
-      Planner::volumetric_multiplier[EXTRUDERS];  // Reciprocal of cross-sectional area of filament (in mm^2). Pre-calculated to reduce computation in the planner
108
+float Planner::e_factor[EXTRUDERS];               // The flow percentage and volumetric multiplier combine to scale E movement
109
+
110
+#if DISABLED(NO_VOLUMETRICS)
111
+  float Planner::filament_size[EXTRUDERS],          // diameter of filament (in millimeters), typically around 1.75 or 2.85, 0 disables the volumetric calculations for the extruder
112
+        Planner::volumetric_area_nominal = CIRCLE_AREA((DEFAULT_NOMINAL_FILAMENT_DIA) * 0.5), // Nominal cross-sectional area
113
+        Planner::volumetric_multiplier[EXTRUDERS];  // Reciprocal of cross-sectional area of filament (in mm^2). Pre-calculated to reduce computation in the planner
114
+#endif
112 115
 
113 116
 uint32_t Planner::max_acceleration_steps_per_s2[XYZE_N],
114 117
          Planner::max_acceleration_mm_per_s2[XYZE_N]; // Use M201 to override by software
@@ -561,25 +564,29 @@ void Planner::check_axes_activity() {
561 564
   #endif
562 565
 }
563 566
 
564
-/**
565
- * Get a volumetric multiplier from a filament diameter.
566
- * This is the reciprocal of the circular cross-section area.
567
- * Return 1.0 with volumetric off or a diameter of 0.0.
568
- */
569
-inline float calculate_volumetric_multiplier(const float &diameter) {
570
-  return (parser.volumetric_enabled && diameter) ? 1.0 / CIRCLE_AREA(diameter * 0.5) : 1.0;
571
-}
567
+#if DISABLED(NO_VOLUMETRICS)
572 568
 
573
-/**
574
- * Convert the filament sizes into volumetric multipliers.
575
- * The multiplier converts a given E value into a length.
576
- */
577
-void Planner::calculate_volumetric_multipliers() {
578
-  for (uint8_t i = 0; i < COUNT(filament_size); i++) {
579
-    volumetric_multiplier[i] = calculate_volumetric_multiplier(filament_size[i]);
580
-    refresh_e_factor(i);
569
+  /**
570
+   * Get a volumetric multiplier from a filament diameter.
571
+   * This is the reciprocal of the circular cross-section area.
572
+   * Return 1.0 with volumetric off or a diameter of 0.0.
573
+   */
574
+  inline float calculate_volumetric_multiplier(const float &diameter) {
575
+    return (parser.volumetric_enabled && diameter) ? 1.0 / CIRCLE_AREA(diameter * 0.5) : 1.0;
581 576
   }
582
-}
577
+
578
+  /**
579
+   * Convert the filament sizes into volumetric multipliers.
580
+   * The multiplier converts a given E value into a length.
581
+   */
582
+  void Planner::calculate_volumetric_multipliers() {
583
+    for (uint8_t i = 0; i < COUNT(filament_size); i++) {
584
+      volumetric_multiplier[i] = calculate_volumetric_multiplier(filament_size[i]);
585
+      refresh_e_factor(i);
586
+    }
587
+  }
588
+
589
+#endif // !NO_VOLUMETRICS
583 590
 
584 591
 #if ENABLED(FILAMENT_WIDTH_SENSOR)
585 592
   /**

+ 23
- 12
Marlin/src/module/planner.h View File

@@ -159,11 +159,14 @@ class Planner {
159 159
 
160 160
     static int16_t flow_percentage[EXTRUDERS];      // Extrusion factor for each extruder
161 161
 
162
-    static float e_factor[EXTRUDERS],               // The flow percentage and volumetric multiplier combine to scale E movement
163
-                 filament_size[EXTRUDERS],          // diameter of filament (in millimeters), typically around 1.75 or 2.85, 0 disables the volumetric calculations for the extruder
164
-                 volumetric_area_nominal,           // Nominal cross-sectional area
165
-                 volumetric_multiplier[EXTRUDERS];  // Reciprocal of cross-sectional area of filament (in mm^2). Pre-calculated to reduce computation in the planner
166
-                                                    // May be auto-adjusted by a filament width sensor
162
+    static float e_factor[EXTRUDERS];               // The flow percentage and volumetric multiplier combine to scale E movement
163
+
164
+    #if DISABLED(NO_VOLUMETRICS)
165
+      static float filament_size[EXTRUDERS],          // diameter of filament (in millimeters), typically around 1.75 or 2.85, 0 disables the volumetric calculations for the extruder
166
+                   volumetric_area_nominal,           // Nominal cross-sectional area
167
+                   volumetric_multiplier[EXTRUDERS];  // Reciprocal of cross-sectional area of filament (in mm^2). Pre-calculated to reduce computation in the planner
168
+                                                      // May be auto-adjusted by a filament width sensor
169
+    #endif
167 170
 
168 171
     static float max_feedrate_mm_s[XYZE_N],         // Max speeds in mm per second
169 172
                  axis_steps_per_mm[XYZE_N],
@@ -277,7 +280,11 @@ class Planner {
277 280
     static void refresh_positioning();
278 281
 
279 282
     FORCE_INLINE static void refresh_e_factor(const uint8_t e) {
280
-      e_factor[e] = volumetric_multiplier[e] * flow_percentage[e] * 0.01;
283
+      e_factor[e] = (flow_percentage[e] * 0.01
284
+        #if DISABLED(NO_VOLUMETRICS)
285
+          * volumetric_multiplier[e]
286
+        #endif
287
+      );
281 288
     }
282 289
 
283 290
     // Manage fans, paste pressure, etc.
@@ -297,12 +304,16 @@ class Planner {
297 304
       void calculate_volumetric_for_width_sensor(const int8_t encoded_ratio);
298 305
     #endif
299 306
 
300
-    FORCE_INLINE static void set_filament_size(const uint8_t e, const float &v) {
301
-      filament_size[e] = v;
302
-      // make sure all extruders have some sane value for the filament size
303
-      for (uint8_t i = 0; i < COUNT(filament_size); i++)
304
-        if (!filament_size[i]) filament_size[i] = DEFAULT_NOMINAL_FILAMENT_DIA;
305
-    }
307
+    #if DISABLED(NO_VOLUMETRICS)
308
+
309
+      FORCE_INLINE static void set_filament_size(const uint8_t e, const float &v) {
310
+        filament_size[e] = v;
311
+        // make sure all extruders have some sane value for the filament size
312
+        for (uint8_t i = 0; i < COUNT(filament_size); i++)
313
+          if (!filament_size[i]) filament_size[i] = DEFAULT_NOMINAL_FILAMENT_DIA;
314
+      }
315
+
316
+    #endif
306 317
 
307 318
     #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
308 319
 

Loading…
Cancel
Save