1
0
mirror of https://github.com/MarlinFirmware/Marlin.git synced 2024-11-30 15:26:18 +00:00

Display volumetric ratio in terms of E mm

This commit is contained in:
Scott Lahteine 2017-11-18 06:27:00 -06:00
parent 4f05a66ee1
commit bf6a1816b4
6 changed files with 8 additions and 7 deletions

View File

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

View File

@ -95,6 +95,7 @@ int16_t Planner::flow_percentage[EXTRUDERS] = ARRAY_BY_EXTRUDERS1(100); // Extru
float Planner::e_factor[EXTRUDERS], // The flow percentage and volumetric multiplier combine to scale E movement float Planner::e_factor[EXTRUDERS], // The flow percentage and volumetric multiplier combine to scale E movement
Planner::filament_size[EXTRUDERS], // diameter of filament (in millimeters), typically around 1.75 or 2.85, 0 disables the volumetric calculations for the extruder Planner::filament_size[EXTRUDERS], // diameter of filament (in millimeters), typically around 1.75 or 2.85, 0 disables the volumetric calculations for the extruder
Planner::volumetric_area_nominal = CIRCLE_AREA((DEFAULT_NOMINAL_FILAMENT_DIA) * 0.5), // Nominal cross-sectional area
Planner::volumetric_multiplier[EXTRUDERS]; // Reciprocal of cross-sectional area of filament (in mm^2). Pre-calculated to reduce computation in the planner Planner::volumetric_multiplier[EXTRUDERS]; // Reciprocal of cross-sectional area of filament (in mm^2). Pre-calculated to reduce computation in the planner
uint32_t Planner::max_acceleration_steps_per_s2[XYZE_N], uint32_t Planner::max_acceleration_steps_per_s2[XYZE_N],

View File

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

View File

@ -814,8 +814,9 @@ void Temperature::manage_heater() {
// Get the delayed info and add 100 to reconstitute to a percent of // Get the delayed info and add 100 to reconstitute to a percent of
// the nominal filament diameter then square it to get an area // the nominal filament diameter then square it to get an area
const float vmroot = measurement_delay[meas_shift_index] * 0.01 + 1.0; float vmroot = measurement_delay[meas_shift_index] * 0.01 + 1.0;
planner.volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM] = vmroot <= 0.1 ? 0.01 : sq(vmroot); NOLESS(vmroot, 0.1);
planner.volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM] = 1.0 / CIRCLE_AREA(vmroot / 2);
planner.refresh_e_factor(FILAMENT_SENSOR_EXTRUDER_NUM); planner.refresh_e_factor(FILAMENT_SENSOR_EXTRUDER_NUM);
} }
#endif // FILAMENT_WIDTH_SENSOR #endif // FILAMENT_WIDTH_SENSOR

View File

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

View File

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