Display filwidth ratio in terms of E mm

This commit is contained in:
Scott Lahteine 2017-11-18 07:01:49 -06:00
parent 6e533748eb
commit 60adc6ff02
5 changed files with 5 additions and 5 deletions

View file

@ -36,6 +36,7 @@
void GcodeSuite::M404() { void GcodeSuite::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

@ -655,12 +655,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

@ -861,7 +861,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

View file

@ -108,6 +108,7 @@ int16_t Planner::flow_percentage[EXTRUDERS] = ARRAY_BY_EXTRUDERS1(100); // Extru
// Initialized by settings.load() // Initialized by settings.load()
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], // As a baseline for the multiplier, filament diameter Planner::filament_size[EXTRUDERS], // As a baseline for the multiplier, filament diameter
Planner::volumetric_area_nominal = CIRCLE_AREA((DEFAULT_NOMINAL_FILAMENT_DIA) * 0.5), // Nominal cross-sectional area
Planner::volumetric_multiplier[EXTRUDERS]; // May be auto-adjusted by a filament width sensor Planner::volumetric_multiplier[EXTRUDERS]; // May be auto-adjusted by a filament width sensor
uint32_t Planner::max_acceleration_steps_per_s2[XYZE_N], uint32_t Planner::max_acceleration_steps_per_s2[XYZE_N],

View file

@ -148,6 +148,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