Kaynağa Gözat

Display volumetric ratio in terms of E mm

Scott Lahteine 6 yıl önce
ebeveyn
işleme
bf6a1816b4

+ 1
- 0
Marlin/Marlin_main.cpp Dosyayı Görüntüle

@@ -9689,6 +9689,7 @@ inline void gcode_M400() { stepper.synchronize(); }
9689 9689
   inline void gcode_M404() {
9690 9690
     if (parser.seen('W')) {
9691 9691
       filament_width_nominal = parser.value_linear_units();
9692
+      planner.volumetric_area_nominal = CIRCLE_AREA(filament_width_nominal * 0.5);
9692 9693
     }
9693 9694
     else {
9694 9695
       SERIAL_PROTOCOLPGM("Filament dia (nominal mm):");

+ 1
- 0
Marlin/planner.cpp Dosyayı Görüntüle

@@ -95,6 +95,7 @@ int16_t Planner::flow_percentage[EXTRUDERS] = ARRAY_BY_EXTRUDERS1(100); // Extru
95 95
 
96 96
 float Planner::e_factor[EXTRUDERS],               // The flow percentage and volumetric multiplier combine to scale E movement
97 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_area_nominal = CIRCLE_AREA((DEFAULT_NOMINAL_FILAMENT_DIA) * 0.5), // Nominal cross-sectional area
98 99
       Planner::volumetric_multiplier[EXTRUDERS];  // Reciprocal of cross-sectional area of filament (in mm^2). Pre-calculated to reduce computation in the planner
99 100
 
100 101
 uint32_t Planner::max_acceleration_steps_per_s2[XYZE_N],

+ 1
- 0
Marlin/planner.h Dosyayı Görüntüle

@@ -144,6 +144,7 @@ class Planner {
144 144
 
145 145
     static float e_factor[EXTRUDERS],               // The flow percentage and volumetric multiplier combine to scale E movement
146 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_area_nominal,           // Nominal cross-sectional area
147 148
                  volumetric_multiplier[EXTRUDERS];  // Reciprocal of cross-sectional area of filament (in mm^2). Pre-calculated to reduce computation in the planner
148 149
                                                     // May be auto-adjusted by a filament width sensor
149 150
 

+ 3
- 2
Marlin/temperature.cpp Dosyayı Görüntüle

@@ -814,8 +814,9 @@ void Temperature::manage_heater() {
814 814
 
815 815
       // Get the delayed info and add 100 to reconstitute to a percent of
816 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;
818
-      planner.volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM] = vmroot <= 0.1 ? 0.01 : sq(vmroot);
817
+      float vmroot = measurement_delay[meas_shift_index] * 0.01 + 1.0;
818
+      NOLESS(vmroot, 0.1);
819
+      planner.volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM] = 1.0 / CIRCLE_AREA(vmroot / 2);
819 820
       planner.refresh_e_factor(FILAMENT_SENSOR_EXTRUDER_NUM);
820 821
     }
821 822
   #endif // FILAMENT_WIDTH_SENSOR

+ 1
- 4
Marlin/ultralcd_impl_DOGM.h Dosyayı Görüntüle

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

+ 1
- 1
Marlin/ultralcd_impl_HD44780.h Dosyayı Görüntüle

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

Loading…
İptal
Kaydet