Browse Source

Display volumetric ratio in terms of E mm

Scott Lahteine 7 years ago
parent
commit
bf6a1816b4

+ 1
- 0
Marlin/Marlin_main.cpp View File

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

+ 1
- 0
Marlin/planner.cpp View File

95
 
95
 
96
 float Planner::e_factor[EXTRUDERS],               // The flow percentage and volumetric multiplier combine to scale E movement
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
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
       Planner::volumetric_multiplier[EXTRUDERS];  // Reciprocal of cross-sectional area of filament (in mm^2). Pre-calculated to reduce computation in the planner
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
 uint32_t Planner::max_acceleration_steps_per_s2[XYZE_N],
101
 uint32_t Planner::max_acceleration_steps_per_s2[XYZE_N],

+ 1
- 0
Marlin/planner.h View File

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

+ 3
- 2
Marlin/temperature.cpp View File

814
 
814
 
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;
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
       planner.refresh_e_factor(FILAMENT_SENSOR_EXTRUDER_NUM);
820
       planner.refresh_e_factor(FILAMENT_SENSOR_EXTRUDER_NUM);
820
     }
821
     }
821
   #endif // FILAMENT_WIDTH_SENSOR
822
   #endif // FILAMENT_WIDTH_SENSOR

+ 1
- 4
Marlin/ultralcd_impl_DOGM.h View File

651
     #if ENABLED(FILAMENT_LCD_DISPLAY)
651
     #if ENABLED(FILAMENT_LCD_DISPLAY)
652
       strcpy(wstring, ftostr12ns(filament_width_meas));
652
       strcpy(wstring, ftostr12ns(filament_width_meas));
653
       if (parser.volumetric_enabled)
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
       else
655
       else
656
         strcpy_P(mstring, PSTR("---"));
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
     #endif
657
     #endif
661
   }
658
   }
662
 
659
 

+ 1
- 1
Marlin/ultralcd_impl_HD44780.h View File

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
       if (parser.volumetric_enabled) {
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
         lcd.write('%');
862
         lcd.write('%');
863
       }
863
       }
864
       else
864
       else

Loading…
Cancel
Save