Selaa lähdekoodia

Display filwidth ratio in terms of E mm

Scott Lahteine 7 vuotta sitten
vanhempi
commit
60adc6ff02

+ 1
- 0
Marlin/src/gcode/feature/filwidth/M404-M407.cpp Näytä tiedosto

@@ -36,6 +36,7 @@
36 36
 void GcodeSuite::M404() {
37 37
   if (parser.seen('W')) {
38 38
     filament_width_nominal = parser.value_linear_units();
39
+    planner.volumetric_area_nominal = CIRCLE_AREA(filament_width_nominal * 0.5);
39 40
   }
40 41
   else {
41 42
     SERIAL_PROTOCOLPGM("Filament dia (nominal mm):");

+ 1
- 4
Marlin/src/lcd/ultralcd_impl_DOGM.h Näytä tiedosto

@@ -655,12 +655,9 @@ static void lcd_implementation_status_screen() {
655 655
     #if ENABLED(FILAMENT_LCD_DISPLAY)
656 656
       strcpy(wstring, ftostr12ns(filament_width_meas));
657 657
       if (parser.volumetric_enabled)
658
-        strcpy(mstring, itostr3(100.0 * filament_width_meas / filament_width_nominal));
658
+        strcpy(mstring, itostr3(100.0 * planner.volumetric_area_nominal / planner.volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM]));
659 659
       else
660 660
         strcpy_P(mstring, PSTR("---"));
661
-      // Alternatively, show the ratio between cross-sectional areas:
662
-      //strcpy(mstring, itostr3(100.0 / CIRCLE_AREA(filament_width_nominal * 0.5)
663
-      //                              / planner.volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM]));
664 661
     #endif
665 662
   }
666 663
 

+ 1
- 1
Marlin/src/lcd/ultralcd_impl_HD44780.h Näytä tiedosto

@@ -861,7 +861,7 @@ static void lcd_implementation_status_screen() {
861 861
       lcd.print(ftostr12ns(filament_width_meas));
862 862
       lcd_printPGM(PSTR(" V"));
863 863
       if (parser.volumetric_enabled) {
864
-        lcd.print(itostr3(100.0 * filament_width_meas / filament_width_nominal));
864
+        lcd.print(itostr3(100.0 * planner.volumetric_area_nominal / planner.volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM]));
865 865
         lcd.write('%');
866 866
       }
867 867
       else

+ 1
- 0
Marlin/src/module/planner.cpp Näytä tiedosto

@@ -108,6 +108,7 @@ int16_t Planner::flow_percentage[EXTRUDERS] = ARRAY_BY_EXTRUDERS1(100); // Extru
108 108
 // Initialized by settings.load()
109 109
 float Planner::e_factor[EXTRUDERS],              // The flow percentage and volumetric multiplier combine to scale E movement
110 110
       Planner::filament_size[EXTRUDERS],         // As a baseline for the multiplier, filament diameter
111
+      Planner::volumetric_area_nominal = CIRCLE_AREA((DEFAULT_NOMINAL_FILAMENT_DIA) * 0.5), // Nominal cross-sectional area
111 112
       Planner::volumetric_multiplier[EXTRUDERS]; // May be auto-adjusted by a filament width sensor
112 113
 
113 114
 uint32_t Planner::max_acceleration_steps_per_s2[XYZE_N],

+ 1
- 0
Marlin/src/module/planner.h Näytä tiedosto

@@ -148,6 +148,7 @@ class Planner {
148 148
 
149 149
     static float e_factor[EXTRUDERS],               // The flow percentage and volumetric multiplier combine to scale E movement
150 150
                  filament_size[EXTRUDERS],          // diameter of filament (in millimeters), typically around 1.75 or 2.85, 0 disables the volumetric calculations for the extruder
151
+                 volumetric_area_nominal,           // Nominal cross-sectional area
151 152
                  volumetric_multiplier[EXTRUDERS];  // Reciprocal of cross-sectional area of filament (in mm^2). Pre-calculated to reduce computation in the planner
152 153
                                                     // May be auto-adjusted by a filament width sensor
153 154
 

Loading…
Peruuta
Tallenna