Browse Source

Merge pull request #8357 from tcm0116/1.1.x-M600

[1.1.x] Normalize load/unload length in M600
Scott Lahteine 7 years ago
parent
commit
972248c333
No account linked to committer's email address

+ 0
- 6
Marlin/Marlin.h View File

215
 #define MMS_SCALED(MM_S) ((MM_S)*feedrate_percentage*0.01)
215
 #define MMS_SCALED(MM_S) ((MM_S)*feedrate_percentage*0.01)
216
 
216
 
217
 extern bool axis_relative_modes[];
217
 extern bool axis_relative_modes[];
218
-extern bool volumetric_enabled;
219
-extern int16_t flow_percentage[EXTRUDERS]; // Extrusion factor for each extruder
220
-extern float filament_size[EXTRUDERS]; // cross-sectional area of filament (in millimeters), typically around 1.75 or 2.85, 0 disables the volumetric calculations for the extruder.
221
-extern float volumetric_multiplier[EXTRUDERS]; // reciprocal of cross-sectional area of filament (in square millimeters), stored this way to reduce computational burden in planner
222
 extern bool axis_known_position[XYZ];
218
 extern bool axis_known_position[XYZ];
223
 extern bool axis_homed[XYZ];
219
 extern bool axis_homed[XYZ];
224
 extern volatile bool wait_for_heatup;
220
 extern volatile bool wait_for_heatup;
427
   extern float mixing_factor[MIXING_STEPPERS];
423
   extern float mixing_factor[MIXING_STEPPERS];
428
 #endif
424
 #endif
429
 
425
 
430
-void calculate_volumetric_multipliers();
431
-
432
 /**
426
 /**
433
  * Blocking movement and shorthand functions
427
  * Blocking movement and shorthand functions
434
  */
428
  */

+ 29
- 47
Marlin/Marlin_main.cpp View File

452
 
452
 
453
 float feedrate_mm_s = MMM_TO_MMS(1500.0);
453
 float feedrate_mm_s = MMM_TO_MMS(1500.0);
454
 static float saved_feedrate_mm_s;
454
 static float saved_feedrate_mm_s;
455
-int16_t feedrate_percentage = 100, saved_feedrate_percentage,
456
-    flow_percentage[EXTRUDERS] = ARRAY_BY_EXTRUDERS1(100);
455
+int16_t feedrate_percentage = 100, saved_feedrate_percentage;
457
 
456
 
458
 // Initialized by settings.load()
457
 // Initialized by settings.load()
459
-bool axis_relative_modes[] = AXIS_RELATIVE_MODES,
460
-     volumetric_enabled;
461
-float filament_size[EXTRUDERS], volumetric_multiplier[EXTRUDERS];
458
+bool axis_relative_modes[] = AXIS_RELATIVE_MODES;
462
 
459
 
463
 #if HAS_WORKSPACE_OFFSET
460
 #if HAS_WORKSPACE_OFFSET
464
   #if HAS_POSITION_SHIFT
461
   #if HAS_POSITION_SHIFT
2417
       : !position_is_reachable_by_probe(rx, ry)
2414
       : !position_is_reachable_by_probe(rx, ry)
2418
     ) return NAN;
2415
     ) return NAN;
2419
 
2416
 
2420
-    const float old_feedrate_mm_s = feedrate_mm_s;
2421
-
2422
-    #if ENABLED(DELTA)
2423
-      if (current_position[Z_AXIS] > delta_clip_start_height)
2424
-        do_blocking_move_to_z(delta_clip_start_height);
2425
-    #endif
2426
-
2427
-    feedrate_mm_s = XY_PROBE_FEEDRATE_MM_S;
2428
-
2429
     // Move the probe to the given XY
2417
     // Move the probe to the given XY
2430
-    do_blocking_move_to_xy(nx, ny);
2418
+    do_blocking_move_to_xy(nx, ny, XY_PROBE_FEEDRATE_MM_S);
2431
 
2419
 
2432
     float measured_z = NAN;
2420
     float measured_z = NAN;
2433
     if (!DEPLOY_PROBE()) {
2421
     if (!DEPLOY_PROBE()) {
2453
       if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("<<< probe_pt");
2441
       if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("<<< probe_pt");
2454
     #endif
2442
     #endif
2455
 
2443
 
2456
-    feedrate_mm_s = old_feedrate_mm_s;
2457
-
2458
     if (isnan(measured_z)) {
2444
     if (isnan(measured_z)) {
2459
       LCD_MESSAGEPGM(MSG_ERR_PROBING_FAILED);
2445
       LCD_MESSAGEPGM(MSG_ERR_PROBING_FAILED);
2460
       SERIAL_ERROR_START();
2446
       SERIAL_ERROR_START();
3226
     set_destination_from_current();
3212
     set_destination_from_current();
3227
     stepper.synchronize();  // Wait for buffered moves to complete
3213
     stepper.synchronize();  // Wait for buffered moves to complete
3228
 
3214
 
3229
-    const float renormalize = 100.0 / flow_percentage[active_extruder] / volumetric_multiplier[active_extruder];
3215
+    const float renormalize = 1.0 / planner.e_factor[active_extruder];
3230
 
3216
 
3231
     if (retracting) {
3217
     if (retracting) {
3232
       // Retract by moving from a faux E position back to the current E position
3218
       // Retract by moving from a faux E position back to the current E position
6553
   #endif
6539
   #endif
6554
 
6540
 
6555
   void do_pause_e_move(const float &length, const float fr) {
6541
   void do_pause_e_move(const float &length, const float fr) {
6556
-    current_position[E_AXIS] += length;
6542
+    current_position[E_AXIS] += length / planner.e_factor[active_extruder];
6557
     set_destination_from_current();
6543
     set_destination_from_current();
6558
     RUNPLAN(fr);
6544
     RUNPLAN(fr);
6559
     stepper.synchronize();
6545
     stepper.synchronize();
8832
     // setting any extruder filament size disables volumetric on the assumption that
8818
     // setting any extruder filament size disables volumetric on the assumption that
8833
     // slicers either generate in extruder values as cubic mm or as as filament feeds
8819
     // slicers either generate in extruder values as cubic mm or as as filament feeds
8834
     // for all extruders
8820
     // for all extruders
8835
-    volumetric_enabled = (parser.value_linear_units() != 0.0);
8836
-    if (volumetric_enabled) {
8837
-      filament_size[target_extruder] = parser.value_linear_units();
8821
+    if ( (parser.volumetric_enabled = (parser.value_linear_units() != 0.0)) ) {
8822
+      planner.filament_size[target_extruder] = parser.value_linear_units();
8838
       // make sure all extruders have some sane value for the filament size
8823
       // make sure all extruders have some sane value for the filament size
8839
-      for (uint8_t i = 0; i < COUNT(filament_size); i++)
8840
-        if (! filament_size[i]) filament_size[i] = DEFAULT_NOMINAL_FILAMENT_DIA;
8824
+      for (uint8_t i = 0; i < COUNT(planner.filament_size); i++)
8825
+        if (!planner.filament_size[i]) planner.filament_size[i] = DEFAULT_NOMINAL_FILAMENT_DIA;
8841
     }
8826
     }
8842
   }
8827
   }
8843
-  calculate_volumetric_multipliers();
8828
+  planner.calculate_volumetric_multipliers();
8844
 }
8829
 }
8845
 
8830
 
8846
 /**
8831
 /**
9201
  */
9186
  */
9202
 inline void gcode_M221() {
9187
 inline void gcode_M221() {
9203
   if (get_target_extruder_from_command(221)) return;
9188
   if (get_target_extruder_from_command(221)) return;
9204
-  if (parser.seenval('S'))
9205
-    flow_percentage[target_extruder] = parser.value_int();
9189
+  if (parser.seenval('S')) {
9190
+    planner.flow_percentage[target_extruder] = parser.value_int();
9191
+    planner.refresh_e_factor(target_extruder);
9192
+  }
9206
 }
9193
 }
9207
 
9194
 
9208
 /**
9195
 /**
9735
     //SERIAL_PROTOCOLPGM("Filament dia (measured mm):");
9722
     //SERIAL_PROTOCOLPGM("Filament dia (measured mm):");
9736
     //SERIAL_PROTOCOL(filament_width_meas);
9723
     //SERIAL_PROTOCOL(filament_width_meas);
9737
     //SERIAL_PROTOCOLPGM("Extrusion ratio(%):");
9724
     //SERIAL_PROTOCOLPGM("Extrusion ratio(%):");
9738
-    //SERIAL_PROTOCOL(flow_percentage[active_extruder]);
9725
+    //SERIAL_PROTOCOL(planner.flow_percentage[active_extruder]);
9739
   }
9726
   }
9740
 
9727
 
9741
   /**
9728
   /**
9743
    */
9730
    */
9744
   inline void gcode_M406() {
9731
   inline void gcode_M406() {
9745
     filament_sensor = false;
9732
     filament_sensor = false;
9746
-    calculate_volumetric_multipliers();   // Restore correct 'volumetric_multiplier' value
9733
+    planner.calculate_volumetric_multipliers();   // Restore correct 'volumetric_multiplier' value
9747
   }
9734
   }
9748
 
9735
 
9749
   /**
9736
   /**
12947
  *
12934
  *
12948
  * This may result in several calls to planner.buffer_line to
12935
  * This may result in several calls to planner.buffer_line to
12949
  * do smaller moves for DELTA, SCARA, mesh moves, etc.
12936
  * do smaller moves for DELTA, SCARA, mesh moves, etc.
12937
+ *
12938
+ * Make sure current_position[E] and destination[E] are good
12939
+ * before calling or cold/lengthy extrusion may get missed.
12950
  */
12940
  */
12951
 void prepare_move_to_destination() {
12941
 void prepare_move_to_destination() {
12952
   clamp_to_software_endstops(destination);
12942
   clamp_to_software_endstops(destination);
12953
   refresh_cmd_timeout();
12943
   refresh_cmd_timeout();
12954
 
12944
 
12955
-  #if ENABLED(PREVENT_COLD_EXTRUSION)
12945
+  #if ENABLED(PREVENT_COLD_EXTRUSION) || ENABLED(PREVENT_LENGTHY_EXTRUDE)
12956
 
12946
 
12957
     if (!DEBUGGING(DRYRUN)) {
12947
     if (!DEBUGGING(DRYRUN)) {
12958
       if (destination[E_AXIS] != current_position[E_AXIS]) {
12948
       if (destination[E_AXIS] != current_position[E_AXIS]) {
12959
-        if (thermalManager.tooColdToExtrude(active_extruder)) {
12960
-          current_position[E_AXIS] = destination[E_AXIS]; // Behave as if the move really took place, but ignore E part
12961
-          SERIAL_ECHO_START();
12962
-          SERIAL_ECHOLNPGM(MSG_ERR_COLD_EXTRUDE_STOP);
12963
-        }
12949
+        #if ENABLED(PREVENT_COLD_EXTRUSION)
12950
+          if (thermalManager.tooColdToExtrude(active_extruder)) {
12951
+            current_position[E_AXIS] = destination[E_AXIS]; // Behave as if the move really took place, but ignore E part
12952
+            SERIAL_ECHO_START();
12953
+            SERIAL_ECHOLNPGM(MSG_ERR_COLD_EXTRUDE_STOP);
12954
+          }
12955
+        #endif // PREVENT_COLD_EXTRUSION
12964
         #if ENABLED(PREVENT_LENGTHY_EXTRUDE)
12956
         #if ENABLED(PREVENT_LENGTHY_EXTRUDE)
12965
-          if (destination[E_AXIS] - current_position[E_AXIS] > EXTRUDE_MAXLENGTH) {
12957
+          if (FABS(destination[E_AXIS] - current_position[E_AXIS]) * planner.e_factor[active_extruder] > (EXTRUDE_MAXLENGTH)) {
12966
             current_position[E_AXIS] = destination[E_AXIS]; // Behave as if the move really took place, but ignore E part
12958
             current_position[E_AXIS] = destination[E_AXIS]; // Behave as if the move really took place, but ignore E part
12967
             SERIAL_ECHO_START();
12959
             SERIAL_ECHO_START();
12968
             SERIAL_ECHOLNPGM(MSG_ERR_LONG_EXTRUDE_STOP);
12960
             SERIAL_ECHOLNPGM(MSG_ERR_LONG_EXTRUDE_STOP);
12969
           }
12961
           }
12970
-        #endif
12962
+        #endif // PREVENT_LENGTHY_EXTRUDE
12971
       }
12963
       }
12972
     }
12964
     }
12973
 
12965
 
13382
 
13374
 
13383
 #endif // FAST_PWM_FAN
13375
 #endif // FAST_PWM_FAN
13384
 
13376
 
13385
-float calculate_volumetric_multiplier(const float diameter) {
13386
-  if (!volumetric_enabled || diameter == 0) return 1.0;
13387
-  return 1.0 / (M_PI * sq(diameter * 0.5));
13388
-}
13389
-
13390
-void calculate_volumetric_multipliers() {
13391
-  for (uint8_t i = 0; i < COUNT(filament_size); i++)
13392
-    volumetric_multiplier[i] = calculate_volumetric_multiplier(filament_size[i]);
13393
-}
13394
-
13395
 void enable_all_steppers() {
13377
 void enable_all_steppers() {
13396
   enable_X();
13378
   enable_X();
13397
   enable_Y();
13379
   enable_Y();

+ 19
- 22
Marlin/configuration_store.cpp View File

138
  *  533  M208 R    swap_retract_recover_feedrate_mm_s (float)
138
  *  533  M208 R    swap_retract_recover_feedrate_mm_s (float)
139
  *
139
  *
140
  * Volumetric Extrusion:                            21 bytes
140
  * Volumetric Extrusion:                            21 bytes
141
- *  537  M200 D    volumetric_enabled               (bool)
142
- *  538  M200 T D  filament_size                    (float x5) (T0..3)
141
+ *  537  M200 D    parser.volumetric_enabled        (bool)
142
+ *  538  M200 T D  planner.filament_size            (float x5) (T0..3)
143
  *
143
  *
144
  * HAVE_TMC2130:                                    22 bytes
144
  * HAVE_TMC2130:                                    22 bytes
145
  *  558  M906 X    Stepper X current                (uint16_t)
145
  *  558  M906 X    Stepper X current                (uint16_t)
188
 #include "temperature.h"
188
 #include "temperature.h"
189
 #include "ultralcd.h"
189
 #include "ultralcd.h"
190
 #include "stepper.h"
190
 #include "stepper.h"
191
-
192
-#if ENABLED(INCH_MODE_SUPPORT) || (ENABLED(ULTIPANEL) && ENABLED(TEMPERATURE_UNITS_SUPPORT))
193
-  #include "gcode.h"
194
-#endif
191
+#include "gcode.h"
195
 
192
 
196
 #if ENABLED(MESH_BED_LEVELING)
193
 #if ENABLED(MESH_BED_LEVELING)
197
   #include "mesh_bed_leveling.h"
194
   #include "mesh_bed_leveling.h"
238
     thermalManager.updatePID();
235
     thermalManager.updatePID();
239
   #endif
236
   #endif
240
 
237
 
241
-  calculate_volumetric_multipliers();
238
+  planner.calculate_volumetric_multipliers();
242
 
239
 
243
   #if HAS_HOME_OFFSET || ENABLED(DUAL_X_CARRIAGE)
240
   #if HAS_HOME_OFFSET || ENABLED(DUAL_X_CARRIAGE)
244
     // Software endstops depend on home_offset
241
     // Software endstops depend on home_offset
569
     EEPROM_WRITE(swap_retract_recover_length);
566
     EEPROM_WRITE(swap_retract_recover_length);
570
     EEPROM_WRITE(swap_retract_recover_feedrate_mm_s);
567
     EEPROM_WRITE(swap_retract_recover_feedrate_mm_s);
571
 
568
 
572
-    EEPROM_WRITE(volumetric_enabled);
569
+    EEPROM_WRITE(parser.volumetric_enabled);
573
 
570
 
574
     // Save filament sizes
571
     // Save filament sizes
575
     for (uint8_t q = 0; q < MAX_EXTRUDERS; q++) {
572
     for (uint8_t q = 0; q < MAX_EXTRUDERS; q++) {
576
-      if (q < COUNT(filament_size)) dummy = filament_size[q];
573
+      if (q < COUNT(planner.filament_size)) dummy = planner.filament_size[q];
577
       EEPROM_WRITE(dummy);
574
       EEPROM_WRITE(dummy);
578
     }
575
     }
579
 
576
 
1018
       // Volumetric & Filament Size
1015
       // Volumetric & Filament Size
1019
       //
1016
       //
1020
 
1017
 
1021
-      EEPROM_READ(volumetric_enabled);
1018
+      EEPROM_READ(parser.volumetric_enabled);
1022
       for (uint8_t q = 0; q < MAX_EXTRUDERS; q++) {
1019
       for (uint8_t q = 0; q < MAX_EXTRUDERS; q++) {
1023
         EEPROM_READ(dummy);
1020
         EEPROM_READ(dummy);
1024
-        if (q < COUNT(filament_size)) filament_size[q] = dummy;
1021
+        if (q < COUNT(planner.filament_size)) planner.filament_size[q] = dummy;
1025
       }
1022
       }
1026
 
1023
 
1027
       //
1024
       //
1424
     swap_retract_recover_feedrate_mm_s = RETRACT_RECOVER_FEEDRATE_SWAP;
1421
     swap_retract_recover_feedrate_mm_s = RETRACT_RECOVER_FEEDRATE_SWAP;
1425
   #endif // FWRETRACT
1422
   #endif // FWRETRACT
1426
 
1423
 
1427
-  volumetric_enabled =
1424
+  parser.volumetric_enabled =
1428
     #if ENABLED(VOLUMETRIC_DEFAULT_ON)
1425
     #if ENABLED(VOLUMETRIC_DEFAULT_ON)
1429
       true
1426
       true
1430
     #else
1427
     #else
1431
       false
1428
       false
1432
     #endif
1429
     #endif
1433
   ;
1430
   ;
1434
-  for (uint8_t q = 0; q < COUNT(filament_size); q++)
1435
-    filament_size[q] = DEFAULT_NOMINAL_FILAMENT_DIA;
1431
+  for (uint8_t q = 0; q < COUNT(planner.filament_size); q++)
1432
+    planner.filament_size[q] = DEFAULT_NOMINAL_FILAMENT_DIA;
1436
 
1433
 
1437
   endstops.enable_globally(
1434
   endstops.enable_globally(
1438
     #if ENABLED(ENDSTOPS_ALWAYS_ON_DEFAULT)
1435
     #if ENABLED(ENDSTOPS_ALWAYS_ON_DEFAULT)
1515
     CONFIG_ECHO_START;
1512
     CONFIG_ECHO_START;
1516
     #if ENABLED(INCH_MODE_SUPPORT)
1513
     #if ENABLED(INCH_MODE_SUPPORT)
1517
       #define LINEAR_UNIT(N) ((N) / parser.linear_unit_factor)
1514
       #define LINEAR_UNIT(N) ((N) / parser.linear_unit_factor)
1518
-      #define VOLUMETRIC_UNIT(N) ((N) / (volumetric_enabled ? parser.volumetric_unit_factor : parser.linear_unit_factor))
1515
+      #define VOLUMETRIC_UNIT(N) ((N) / (parser.volumetric_enabled ? parser.volumetric_unit_factor : parser.linear_unit_factor))
1519
       SERIAL_ECHOPGM("  G2");
1516
       SERIAL_ECHOPGM("  G2");
1520
       SERIAL_CHAR(parser.linear_unit_factor == 1.0 ? '1' : '0');
1517
       SERIAL_CHAR(parser.linear_unit_factor == 1.0 ? '1' : '0');
1521
       SERIAL_ECHOPGM(" ; Units in ");
1518
       SERIAL_ECHOPGM(" ; Units in ");
1552
     if (!forReplay) {
1549
     if (!forReplay) {
1553
       CONFIG_ECHO_START;
1550
       CONFIG_ECHO_START;
1554
       SERIAL_ECHOPGM("Filament settings:");
1551
       SERIAL_ECHOPGM("Filament settings:");
1555
-      if (volumetric_enabled)
1552
+      if (parser.volumetric_enabled)
1556
         SERIAL_EOL();
1553
         SERIAL_EOL();
1557
       else
1554
       else
1558
         SERIAL_ECHOLNPGM(" Disabled");
1555
         SERIAL_ECHOLNPGM(" Disabled");
1559
     }
1556
     }
1560
 
1557
 
1561
     CONFIG_ECHO_START;
1558
     CONFIG_ECHO_START;
1562
-    SERIAL_ECHOPAIR("  M200 D", filament_size[0]);
1559
+    SERIAL_ECHOPAIR("  M200 D", planner.filament_size[0]);
1563
     SERIAL_EOL();
1560
     SERIAL_EOL();
1564
     #if EXTRUDERS > 1
1561
     #if EXTRUDERS > 1
1565
       CONFIG_ECHO_START;
1562
       CONFIG_ECHO_START;
1566
-      SERIAL_ECHOPAIR("  M200 T1 D", filament_size[1]);
1563
+      SERIAL_ECHOPAIR("  M200 T1 D", planner.filament_size[1]);
1567
       SERIAL_EOL();
1564
       SERIAL_EOL();
1568
       #if EXTRUDERS > 2
1565
       #if EXTRUDERS > 2
1569
         CONFIG_ECHO_START;
1566
         CONFIG_ECHO_START;
1570
-        SERIAL_ECHOPAIR("  M200 T2 D", filament_size[2]);
1567
+        SERIAL_ECHOPAIR("  M200 T2 D", planner.filament_size[2]);
1571
         SERIAL_EOL();
1568
         SERIAL_EOL();
1572
         #if EXTRUDERS > 3
1569
         #if EXTRUDERS > 3
1573
           CONFIG_ECHO_START;
1570
           CONFIG_ECHO_START;
1574
-          SERIAL_ECHOPAIR("  M200 T3 D", filament_size[3]);
1571
+          SERIAL_ECHOPAIR("  M200 T3 D", planner.filament_size[3]);
1575
           SERIAL_EOL();
1572
           SERIAL_EOL();
1576
           #if EXTRUDERS > 4
1573
           #if EXTRUDERS > 4
1577
             CONFIG_ECHO_START;
1574
             CONFIG_ECHO_START;
1578
-            SERIAL_ECHOPAIR("  M200 T4 D", filament_size[4]);
1575
+            SERIAL_ECHOPAIR("  M200 T4 D", planner.filament_size[4]);
1579
             SERIAL_EOL();
1576
             SERIAL_EOL();
1580
           #endif // EXTRUDERS > 4
1577
           #endif // EXTRUDERS > 4
1581
         #endif // EXTRUDERS > 3
1578
         #endif // EXTRUDERS > 3
1582
       #endif // EXTRUDERS > 2
1579
       #endif // EXTRUDERS > 2
1583
     #endif // EXTRUDERS > 1
1580
     #endif // EXTRUDERS > 1
1584
 
1581
 
1585
-    if (!volumetric_enabled) {
1582
+    if (!parser.volumetric_enabled) {
1586
       CONFIG_ECHO_START;
1583
       CONFIG_ECHO_START;
1587
       SERIAL_ECHOLNPGM("  M200 D0");
1584
       SERIAL_ECHOLNPGM("  M200 D0");
1588
     }
1585
     }

+ 2
- 0
Marlin/gcode.cpp View File

32
 // Must be declared for allocation and to satisfy the linker
32
 // Must be declared for allocation and to satisfy the linker
33
 // Zero values need no initialization.
33
 // Zero values need no initialization.
34
 
34
 
35
+bool GCodeParser::volumetric_enabled;
36
+
35
 #if ENABLED(INCH_MODE_SUPPORT)
37
 #if ENABLED(INCH_MODE_SUPPORT)
36
   float GCodeParser::linear_unit_factor, GCodeParser::volumetric_unit_factor;
38
   float GCodeParser::linear_unit_factor, GCodeParser::volumetric_unit_factor;
37
 #endif
39
 #endif

+ 2
- 4
Marlin/gcode.h View File

44
   #include "serial.h"
44
   #include "serial.h"
45
 #endif
45
 #endif
46
 
46
 
47
-#if ENABLED(INCH_MODE_SUPPORT)
48
-  extern bool volumetric_enabled;
49
-#endif
50
-
51
 /**
47
 /**
52
  * GCode parser
48
  * GCode parser
53
  *
49
  *
76
 
72
 
77
   // Global states for GCode-level units features
73
   // Global states for GCode-level units features
78
 
74
 
75
+  static bool volumetric_enabled;
76
+
79
   #if ENABLED(INCH_MODE_SUPPORT)
77
   #if ENABLED(INCH_MODE_SUPPORT)
80
     static float linear_unit_factor, volumetric_unit_factor;
78
     static float linear_unit_factor, volumetric_unit_factor;
81
   #endif
79
   #endif

+ 36
- 16
Marlin/planner.cpp View File

91
   uint8_t Planner::last_extruder = 0;     // Respond to extruder change
91
   uint8_t Planner::last_extruder = 0;     // Respond to extruder change
92
 #endif
92
 #endif
93
 
93
 
94
+int16_t Planner::flow_percentage[EXTRUDERS] = ARRAY_BY_EXTRUDERS1(100); // Extrusion factor for each extruder
95
+
96
+float Planner::e_factor[EXTRUDERS],               // The flow percentage and volumetric multiplier combine to scale E movement
97
+      Planner::filament_size[EXTRUDERS],          // diameter of filament (in millimeters), typically around 1.75 or 2.85, 0 disables the volumetric calculations for the extruder
98
+      Planner::volumetric_multiplier[EXTRUDERS];  // Reciprocal of cross-sectional area of filament (in mm^2). Pre-calculated to reduce computation in the planner
99
+
94
 uint32_t Planner::max_acceleration_steps_per_s2[XYZE_N],
100
 uint32_t Planner::max_acceleration_steps_per_s2[XYZE_N],
95
          Planner::max_acceleration_mm_per_s2[XYZE_N]; // Use M201 to override by software
101
          Planner::max_acceleration_mm_per_s2[XYZE_N]; // Use M201 to override by software
96
 
102
 
521
   #endif
527
   #endif
522
 }
528
 }
523
 
529
 
530
+inline float calculate_volumetric_multiplier(const float &diameter) {
531
+  if (!parser.volumetric_enabled || diameter == 0) return 1.0;
532
+  return 1.0 / CIRCLE_AREA(diameter * 0.5);
533
+}
534
+
535
+void Planner::calculate_volumetric_multipliers() {
536
+  for (uint8_t i = 0; i < COUNT(filament_size); i++) {
537
+    volumetric_multiplier[i] = calculate_volumetric_multiplier(filament_size[i]);
538
+    refresh_e_factor(i);
539
+  }
540
+}
541
+
524
 #if PLANNER_LEVELING
542
 #if PLANNER_LEVELING
525
   /**
543
   /**
526
    * rx, ry, rz - cartesian position in mm
544
    * rx, ry, rz - cartesian position in mm
720
   long de = target[E_AXIS] - position[E_AXIS];
738
   long de = target[E_AXIS] - position[E_AXIS];
721
 
739
 
722
   #if ENABLED(LIN_ADVANCE)
740
   #if ENABLED(LIN_ADVANCE)
723
-    float de_float = e - position_float[E_AXIS];
741
+    float de_float = e - position_float[E_AXIS]; // Should this include e_factor?
724
   #endif
742
   #endif
725
 
743
 
726
-  #if ENABLED(PREVENT_COLD_EXTRUSION)
744
+  #if ENABLED(PREVENT_COLD_EXTRUSION) || ENABLED(PREVENT_LENGTHY_EXTRUDE)
727
     if (de) {
745
     if (de) {
728
-      if (thermalManager.tooColdToExtrude(extruder)) {
729
-        position[E_AXIS] = target[E_AXIS]; // Behave as if the move really took place, but ignore E part
730
-        de = 0; // no difference
731
-        #if ENABLED(LIN_ADVANCE)
732
-          position_float[E_AXIS] = e;
733
-          de_float = 0;
734
-        #endif
735
-        SERIAL_ECHO_START();
736
-        SERIAL_ECHOLNPGM(MSG_ERR_COLD_EXTRUDE_STOP);
737
-      }
746
+      #if ENABLED(PREVENT_COLD_EXTRUSION)
747
+        if (thermalManager.tooColdToExtrude(extruder)) {
748
+          position[E_AXIS] = target[E_AXIS]; // Behave as if the move really took place, but ignore E part
749
+          de = 0; // no difference
750
+          #if ENABLED(LIN_ADVANCE)
751
+            position_float[E_AXIS] = e;
752
+            de_float = 0;
753
+          #endif
754
+          SERIAL_ECHO_START();
755
+          SERIAL_ECHOLNPGM(MSG_ERR_COLD_EXTRUDE_STOP);
756
+        }
757
+      #endif // PREVENT_COLD_EXTRUSION
738
       #if ENABLED(PREVENT_LENGTHY_EXTRUDE)
758
       #if ENABLED(PREVENT_LENGTHY_EXTRUDE)
739
-        if (labs(de) > (int32_t)axis_steps_per_mm[E_AXIS_N] * (EXTRUDE_MAXLENGTH)) { // It's not important to get max. extrusion length in a precision < 1mm, so save some cycles and cast to int
759
+        if (labs(de * e_factor[extruder]) > (int32_t)axis_steps_per_mm[E_AXIS_N] * (EXTRUDE_MAXLENGTH)) { // It's not important to get max. extrusion length in a precision < 1mm, so save some cycles and cast to int
740
           position[E_AXIS] = target[E_AXIS]; // Behave as if the move really took place, but ignore E part
760
           position[E_AXIS] = target[E_AXIS]; // Behave as if the move really took place, but ignore E part
741
           de = 0; // no difference
761
           de = 0; // no difference
742
           #if ENABLED(LIN_ADVANCE)
762
           #if ENABLED(LIN_ADVANCE)
746
           SERIAL_ECHO_START();
766
           SERIAL_ECHO_START();
747
           SERIAL_ECHOLNPGM(MSG_ERR_LONG_EXTRUDE_STOP);
767
           SERIAL_ECHOLNPGM(MSG_ERR_LONG_EXTRUDE_STOP);
748
         }
768
         }
749
-      #endif
769
+      #endif // PREVENT_LENGTHY_EXTRUDE
750
     }
770
     }
751
-  #endif
771
+  #endif // PREVENT_COLD_EXTRUSION || PREVENT_LENGTHY_EXTRUDE
752
 
772
 
753
   // Compute direction bit-mask for this block
773
   // Compute direction bit-mask for this block
754
   uint8_t dm = 0;
774
   uint8_t dm = 0;
777
   #endif
797
   #endif
778
   if (de < 0) SBI(dm, E_AXIS);
798
   if (de < 0) SBI(dm, E_AXIS);
779
 
799
 
780
-  const float esteps_float = de * volumetric_multiplier[extruder] * flow_percentage[extruder] * 0.01;
800
+  const float esteps_float = de * e_factor[extruder];
781
   const int32_t esteps = abs(esteps_float) + 0.5;
801
   const int32_t esteps = abs(esteps_float) + 0.5;
782
 
802
 
783
   // Calculate the buffer head after we push this byte
803
   // Calculate the buffer head after we push this byte

+ 13
- 0
Marlin/planner.h View File

140
       static uint8_t last_extruder;             // Respond to extruder change
140
       static uint8_t last_extruder;             // Respond to extruder change
141
     #endif
141
     #endif
142
 
142
 
143
+    static int16_t flow_percentage[EXTRUDERS]; // Extrusion factor for each extruder
144
+
145
+    static float e_factor[EXTRUDERS],               // The flow percentage and volumetric multiplier combine to scale E movement
146
+                 filament_size[EXTRUDERS],          // diameter of filament (in millimeters), typically around 1.75 or 2.85, 0 disables the volumetric calculations for the extruder
147
+                 volumetric_multiplier[EXTRUDERS];  // Reciprocal of cross-sectional area of filament (in mm^2). Pre-calculated to reduce computation in the planner
148
+                                                    // May be auto-adjusted by a filament width sensor
149
+
143
     static float max_feedrate_mm_s[XYZE_N],     // Max speeds in mm per second
150
     static float max_feedrate_mm_s[XYZE_N],     // Max speeds in mm per second
144
                  axis_steps_per_mm[XYZE_N],
151
                  axis_steps_per_mm[XYZE_N],
145
                  steps_to_mm[XYZE_N];
152
                  steps_to_mm[XYZE_N];
236
     static void reset_acceleration_rates();
243
     static void reset_acceleration_rates();
237
     static void refresh_positioning();
244
     static void refresh_positioning();
238
 
245
 
246
+    FORCE_INLINE static void refresh_e_factor(const uint8_t e) {
247
+      e_factor[e] = volumetric_multiplier[e] * flow_percentage[e] * 0.01;
248
+    }
249
+
239
     // Manage fans, paste pressure, etc.
250
     // Manage fans, paste pressure, etc.
240
     static void check_axes_activity();
251
     static void check_axes_activity();
241
 
252
 
253
+    static void calculate_volumetric_multipliers();
254
+
242
     /**
255
     /**
243
      * Number of moves currently in the planner
256
      * Number of moves currently in the planner
244
      */
257
      */

+ 2
- 1
Marlin/temperature.cpp View File

815
       // Get the delayed info and add 100 to reconstitute to a percent of
815
       // Get the delayed info and add 100 to reconstitute to a percent of
816
       // the nominal filament diameter then square it to get an area
816
       // the nominal filament diameter then square it to get an area
817
       const float vmroot = measurement_delay[meas_shift_index] * 0.01 + 1.0;
817
       const float vmroot = measurement_delay[meas_shift_index] * 0.01 + 1.0;
818
-      volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM] = vmroot <= 0.1 ? 0.01 : sq(vmroot);
818
+      planner.volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM] = vmroot <= 0.1 ? 0.01 : sq(vmroot);
819
+      planner.refresh_e_factor(FILAMENT_SENSOR_EXTRUDER_NUM);
819
     }
820
     }
820
   #endif // FILAMENT_WIDTH_SENSOR
821
   #endif // FILAMENT_WIDTH_SENSOR
821
 
822
 

+ 8
- 15
Marlin/ubl_G29.cpp View File

466
             //
466
             //
467
             SERIAL_PROTOCOLLNPGM("Manually probing unreachable mesh locations.");
467
             SERIAL_PROTOCOLLNPGM("Manually probing unreachable mesh locations.");
468
             do_blocking_move_to_z(Z_CLEARANCE_BETWEEN_PROBES);
468
             do_blocking_move_to_z(Z_CLEARANCE_BETWEEN_PROBES);
469
+
469
             if (!g29_x_flag && !g29_y_flag) {
470
             if (!g29_x_flag && !g29_y_flag) {
470
               /**
471
               /**
471
                * Use a good default location for the path.
472
                * Use a good default location for the path.
911
       has_control_of_lcd_panel = true;
912
       has_control_of_lcd_panel = true;
912
       save_ubl_active_state_and_disable();   // Disable bed level correction for probing
913
       save_ubl_active_state_and_disable();   // Disable bed level correction for probing
913
 
914
 
914
-      do_blocking_move_to_z(in_height);
915
-      do_blocking_move_to_xy(0.5 * (MESH_MAX_X - (MESH_MIN_X)), 0.5 * (MESH_MAX_Y - (MESH_MIN_Y)));
915
+      do_blocking_move_to(0.5 * (MESH_MAX_X - (MESH_MIN_X)), 0.5 * (MESH_MAX_Y - (MESH_MIN_Y)), in_height);
916
         //, min(planner.max_feedrate_mm_s[X_AXIS], planner.max_feedrate_mm_s[Y_AXIS]) / 2.0);
916
         //, min(planner.max_feedrate_mm_s[X_AXIS], planner.max_feedrate_mm_s[Y_AXIS]) / 2.0);
917
       stepper.synchronize();
917
       stepper.synchronize();
918
 
918
 
955
       has_control_of_lcd_panel = true;
955
       has_control_of_lcd_panel = true;
956
 
956
 
957
       save_ubl_active_state_and_disable();   // we don't do bed level correction because we want the raw data when we probe
957
       save_ubl_active_state_and_disable();   // we don't do bed level correction because we want the raw data when we probe
958
-      do_blocking_move_to_z(Z_CLEARANCE_BETWEEN_PROBES);
959
-      do_blocking_move_to_xy(rx, ry);
958
+      do_blocking_move_to(rx, ry, Z_CLEARANCE_BETWEEN_PROBES);
960
 
959
 
961
       lcd_return_to_status();
960
       lcd_return_to_status();
962
 
961
 
971
 
970
 
972
         if (!position_is_reachable(xProbe, yProbe)) break; // SHOULD NOT OCCUR (find_closest_mesh_point only returns reachable points)
971
         if (!position_is_reachable(xProbe, yProbe)) break; // SHOULD NOT OCCUR (find_closest_mesh_point only returns reachable points)
973
 
972
 
974
-        do_blocking_move_to_z(Z_CLEARANCE_BETWEEN_PROBES);
975
-
976
         LCD_MESSAGEPGM(MSG_UBL_MOVING_TO_NEXT);
973
         LCD_MESSAGEPGM(MSG_UBL_MOVING_TO_NEXT);
977
 
974
 
978
-        do_blocking_move_to_xy(xProbe, yProbe);
975
+        do_blocking_move_to(xProbe, yProbe, Z_CLEARANCE_BETWEEN_PROBES);
979
         do_blocking_move_to_z(z_clearance);
976
         do_blocking_move_to_z(z_clearance);
980
 
977
 
981
         KEEPALIVE_STATE(PAUSED_FOR_USER);
978
         KEEPALIVE_STATE(PAUSED_FOR_USER);
1032
 
1029
 
1033
       restore_ubl_active_state_and_leave();
1030
       restore_ubl_active_state_and_leave();
1034
       KEEPALIVE_STATE(IN_HANDLER);
1031
       KEEPALIVE_STATE(IN_HANDLER);
1035
-      do_blocking_move_to_z(Z_CLEARANCE_DEPLOY_PROBE);
1036
-      do_blocking_move_to_xy(rx, ry);
1032
+      do_blocking_move_to(rx, ry, Z_CLEARANCE_DEPLOY_PROBE);
1037
     }
1033
     }
1038
   #endif // NEWPANEL
1034
   #endif // NEWPANEL
1039
 
1035
 
1486
 
1482
 
1487
       LCD_MESSAGEPGM(MSG_UBL_FINE_TUNE_MESH);
1483
       LCD_MESSAGEPGM(MSG_UBL_FINE_TUNE_MESH);
1488
 
1484
 
1489
-      do_blocking_move_to_z(Z_CLEARANCE_BETWEEN_PROBES);
1490
-      do_blocking_move_to_xy(rx, ry);
1485
+      do_blocking_move_to(rx, ry, Z_CLEARANCE_BETWEEN_PROBES);
1491
 
1486
 
1492
       uint16_t not_done[16];
1487
       uint16_t not_done[16];
1493
       memset(not_done, 0xFF, sizeof(not_done));
1488
       memset(not_done, 0xFF, sizeof(not_done));
1510
         if (isnan(new_z)) // if the mesh point is invalid, set it to 0.0 so it can be edited
1505
         if (isnan(new_z)) // if the mesh point is invalid, set it to 0.0 so it can be edited
1511
           new_z = 0.0;
1506
           new_z = 0.0;
1512
 
1507
 
1513
-        do_blocking_move_to_z(Z_CLEARANCE_BETWEEN_PROBES);    // Move the nozzle to where we are going to edit
1514
-        do_blocking_move_to_xy(rawx, rawy);
1508
+        do_blocking_move_to(rawx, rawy, Z_CLEARANCE_BETWEEN_PROBES); // Move the nozzle to the edit point
1515
 
1509
 
1516
         new_z = FLOOR(new_z * 1000.0) * 0.001; // Chop off digits after the 1000ths place
1510
         new_z = FLOOR(new_z * 1000.0) * 0.001; // Chop off digits after the 1000ths place
1517
 
1511
 
1571
 
1565
 
1572
       if (do_ubl_mesh_map) display_map(g29_map_type);
1566
       if (do_ubl_mesh_map) display_map(g29_map_type);
1573
       restore_ubl_active_state_and_leave();
1567
       restore_ubl_active_state_and_leave();
1574
-      do_blocking_move_to_z(Z_CLEARANCE_BETWEEN_PROBES);
1575
 
1568
 
1576
-      do_blocking_move_to_xy(rx, ry);
1569
+      do_blocking_move_to(rx, ry, Z_CLEARANCE_BETWEEN_PROBES);
1577
 
1570
 
1578
       LCD_MESSAGEPGM(MSG_UBL_DONE_EDITING_MESH);
1571
       LCD_MESSAGEPGM(MSG_UBL_DONE_EDITING_MESH);
1579
       SERIAL_ECHOLNPGM("Done Editing Mesh");
1572
       SERIAL_ECHOLNPGM("Done Editing Mesh");

+ 32
- 15
Marlin/ultralcd.cpp View File

33
 #include "stepper.h"
33
 #include "stepper.h"
34
 #include "configuration_store.h"
34
 #include "configuration_store.h"
35
 #include "utility.h"
35
 #include "utility.h"
36
+#include "gcode.h"
36
 
37
 
37
 #if HAS_BUZZER && DISABLED(LCD_USE_I2C_BUZZER)
38
 #if HAS_BUZZER && DISABLED(LCD_USE_I2C_BUZZER)
38
   #include "buzzer.h"
39
   #include "buzzer.h"
1248
     #endif
1249
     #endif
1249
   #endif
1250
   #endif
1250
 
1251
 
1252
+  // Refresh the E factor after changing flow
1253
+  inline void _lcd_refresh_e_factor_0() { planner.refresh_e_factor(0); }
1254
+  #if EXTRUDERS > 1
1255
+    inline void _lcd_refresh_e_factor() { planner.refresh_e_factor(active_extruder); }
1256
+    inline void _lcd_refresh_e_factor_1() { planner.refresh_e_factor(1); }
1257
+    #if EXTRUDERS > 2
1258
+      inline void _lcd_refresh_e_factor_2() { planner.refresh_e_factor(2); }
1259
+      #if EXTRUDERS > 3
1260
+        inline void _lcd_refresh_e_factor_3() { planner.refresh_e_factor(3); }
1261
+        #if EXTRUDERS > 4
1262
+          inline void _lcd_refresh_e_factor_4() { planner.refresh_e_factor(4); }
1263
+        #endif // EXTRUDERS > 4
1264
+      #endif // EXTRUDERS > 3
1265
+    #endif // EXTRUDERS > 2
1266
+  #endif // EXTRUDERS > 1
1267
+
1251
   /**
1268
   /**
1252
    *
1269
    *
1253
    * "Tune" submenu
1270
    * "Tune" submenu
1327
     // Flow [1-5]:
1344
     // Flow [1-5]:
1328
     //
1345
     //
1329
     #if EXTRUDERS == 1
1346
     #if EXTRUDERS == 1
1330
-      MENU_ITEM_EDIT(int3, MSG_FLOW, &flow_percentage[0], 10, 999);
1347
+      MENU_ITEM_EDIT_CALLBACK(int3, MSG_FLOW, &planner.flow_percentage[0], 10, 999, _lcd_refresh_e_factor_0);
1331
     #else // EXTRUDERS > 1
1348
     #else // EXTRUDERS > 1
1332
-      MENU_ITEM_EDIT(int3, MSG_FLOW, &flow_percentage[active_extruder], 10, 999);
1333
-      MENU_ITEM_EDIT(int3, MSG_FLOW MSG_N1, &flow_percentage[0], 10, 999);
1334
-      MENU_ITEM_EDIT(int3, MSG_FLOW MSG_N2, &flow_percentage[1], 10, 999);
1349
+      MENU_ITEM_EDIT_CALLBACK(int3, MSG_FLOW, &planner.flow_percentage[active_extruder], 10, 999, _lcd_refresh_e_factor);
1350
+      MENU_ITEM_EDIT_CALLBACK(int3, MSG_FLOW MSG_N1, &planner.flow_percentage[0], 10, 999, _lcd_refresh_e_factor_0);
1351
+      MENU_ITEM_EDIT_CALLBACK(int3, MSG_FLOW MSG_N2, &planner.flow_percentage[1], 10, 999, _lcd_refresh_e_factor_1);
1335
       #if EXTRUDERS > 2
1352
       #if EXTRUDERS > 2
1336
-        MENU_ITEM_EDIT(int3, MSG_FLOW MSG_N3, &flow_percentage[2], 10, 999);
1353
+        MENU_ITEM_EDIT_CALLBACK(int3, MSG_FLOW MSG_N3, &planner.flow_percentage[2], 10, 999, _lcd_refresh_e_factor_2);
1337
         #if EXTRUDERS > 3
1354
         #if EXTRUDERS > 3
1338
-          MENU_ITEM_EDIT(int3, MSG_FLOW MSG_N4, &flow_percentage[3], 10, 999);
1355
+          MENU_ITEM_EDIT_CALLBACK(int3, MSG_FLOW MSG_N4, &planner.flow_percentage[3], 10, 999, _lcd_refresh_e_factor_3);
1339
           #if EXTRUDERS > 4
1356
           #if EXTRUDERS > 4
1340
-            MENU_ITEM_EDIT(int3, MSG_FLOW MSG_N5, &flow_percentage[4], 10, 999);
1357
+            MENU_ITEM_EDIT_CALLBACK(int3, MSG_FLOW MSG_N5, &planner.flow_percentage[4], 10, 999, _lcd_refresh_e_factor_4);
1341
           #endif // EXTRUDERS > 4
1358
           #endif // EXTRUDERS > 4
1342
         #endif // EXTRUDERS > 3
1359
         #endif // EXTRUDERS > 3
1343
       #endif // EXTRUDERS > 2
1360
       #endif // EXTRUDERS > 2
3678
       MENU_ITEM_EDIT(float3, MSG_ADVANCE_K, &planner.extruder_advance_k, 0, 999);
3695
       MENU_ITEM_EDIT(float3, MSG_ADVANCE_K, &planner.extruder_advance_k, 0, 999);
3679
     #endif
3696
     #endif
3680
 
3697
 
3681
-    MENU_ITEM_EDIT_CALLBACK(bool, MSG_VOLUMETRIC_ENABLED, &volumetric_enabled, calculate_volumetric_multipliers);
3698
+    MENU_ITEM_EDIT_CALLBACK(bool, MSG_VOLUMETRIC_ENABLED, &parser.volumetric_enabled, planner.calculate_volumetric_multipliers);
3682
 
3699
 
3683
-    if (volumetric_enabled) {
3700
+    if (parser.volumetric_enabled) {
3684
       #if EXTRUDERS == 1
3701
       #if EXTRUDERS == 1
3685
-        MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_DIAM, &filament_size[0], 1.5, 3.25, calculate_volumetric_multipliers);
3702
+        MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_DIAM, &planner.filament_size[0], 1.5, 3.25, planner.calculate_volumetric_multipliers);
3686
       #else // EXTRUDERS > 1
3703
       #else // EXTRUDERS > 1
3687
-        MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_DIAM MSG_DIAM_E1, &filament_size[0], 1.5, 3.25, calculate_volumetric_multipliers);
3688
-        MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_DIAM MSG_DIAM_E2, &filament_size[1], 1.5, 3.25, calculate_volumetric_multipliers);
3704
+        MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_DIAM MSG_DIAM_E1, &planner.filament_size[0], 1.5, 3.25, planner.calculate_volumetric_multipliers);
3705
+        MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_DIAM MSG_DIAM_E2, &planner.filament_size[1], 1.5, 3.25, planner.calculate_volumetric_multipliers);
3689
         #if EXTRUDERS > 2
3706
         #if EXTRUDERS > 2
3690
-          MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_DIAM MSG_DIAM_E3, &filament_size[2], 1.5, 3.25, calculate_volumetric_multipliers);
3707
+          MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_DIAM MSG_DIAM_E3, &planner.filament_size[2], 1.5, 3.25, planner.calculate_volumetric_multipliers);
3691
           #if EXTRUDERS > 3
3708
           #if EXTRUDERS > 3
3692
-            MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_DIAM MSG_DIAM_E4, &filament_size[3], 1.5, 3.25, calculate_volumetric_multipliers);
3709
+            MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_DIAM MSG_DIAM_E4, &planner.filament_size[3], 1.5, 3.25, planner.calculate_volumetric_multipliers);
3693
             #if EXTRUDERS > 4
3710
             #if EXTRUDERS > 4
3694
-              MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_DIAM MSG_DIAM_E5, &filament_size[4], 1.5, 3.25, calculate_volumetric_multipliers);
3711
+              MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_DIAM MSG_DIAM_E5, &planner.filament_size[4], 1.5, 3.25, planner.calculate_volumetric_multipliers);
3695
             #endif // EXTRUDERS > 4
3712
             #endif // EXTRUDERS > 4
3696
           #endif // EXTRUDERS > 3
3713
           #endif // EXTRUDERS > 3
3697
         #endif // EXTRUDERS > 2
3714
         #endif // EXTRUDERS > 2

+ 2
- 2
Marlin/ultralcd_impl_DOGM.h View File

650
     strcpy(zstring, ftostr52sp(FIXFLOAT(LOGICAL_Z_POSITION(current_position[Z_AXIS]))));
650
     strcpy(zstring, ftostr52sp(FIXFLOAT(LOGICAL_Z_POSITION(current_position[Z_AXIS]))));
651
     #if ENABLED(FILAMENT_LCD_DISPLAY) && DISABLED(SDSUPPORT)
651
     #if ENABLED(FILAMENT_LCD_DISPLAY) && DISABLED(SDSUPPORT)
652
       strcpy(wstring, ftostr12ns(filament_width_meas));
652
       strcpy(wstring, ftostr12ns(filament_width_meas));
653
-      strcpy(mstring, itostr3(100.0 * volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM]));
653
+      strcpy(mstring, itostr3(100.0 * planner.volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM]));
654
     #endif
654
     #endif
655
   }
655
   }
656
 
656
 
739
         lcd_print(ftostr12ns(filament_width_meas));
739
         lcd_print(ftostr12ns(filament_width_meas));
740
         lcd_printPGM(PSTR("  " LCD_STR_FILAM_MUL));
740
         lcd_printPGM(PSTR("  " LCD_STR_FILAM_MUL));
741
         u8g.print(':');
741
         u8g.print(':');
742
-        lcd_print(itostr3(100.0 * volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM]));
742
+        lcd_print(itostr3(100.0 * planner.volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM]));
743
         u8g.print('%');
743
         u8g.print('%');
744
       }
744
       }
745
     #else
745
     #else

+ 1
- 1
Marlin/ultralcd_impl_HD44780.h View File

857
       lcd_printPGM(PSTR("Dia "));
857
       lcd_printPGM(PSTR("Dia "));
858
       lcd.print(ftostr12ns(filament_width_meas));
858
       lcd.print(ftostr12ns(filament_width_meas));
859
       lcd_printPGM(PSTR(" V"));
859
       lcd_printPGM(PSTR(" V"));
860
-      lcd.print(itostr3(100.0 * volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM]));
860
+      lcd.print(itostr3(100.0 * planner.volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM]));
861
       lcd.write('%');
861
       lcd.write('%');
862
       return;
862
       return;
863
     }
863
     }

Loading…
Cancel
Save