From 50a732360acf54d53cbd8daccafd807b8db64f43 Mon Sep 17 00:00:00 2001 From: AnHardt Date: Mon, 30 Mar 2015 13:35:03 +0200 Subject: [PATCH 1/2] Replace extrudemultiply by extruder_multiply[active_extruder] Fix for #1460. Seems to work with only one extruder. Can't test this myself with more. --- Marlin/Marlin.h | 1 - Marlin/Marlin_main.cpp | 5 ++--- Marlin/dogm_lcd_implementation.h | 2 +- Marlin/planner.cpp | 4 ++-- Marlin/ultralcd.cpp | 2 +- 5 files changed, 6 insertions(+), 8 deletions(-) diff --git a/Marlin/Marlin.h b/Marlin/Marlin.h index 46720d9a3..45a94e82e 100644 --- a/Marlin/Marlin.h +++ b/Marlin/Marlin.h @@ -229,7 +229,6 @@ void refresh_cmd_timeout(void); extern float homing_feedrate[]; extern bool axis_relative_modes[]; extern int feedmultiply; -extern int extrudemultiply; // Sets extrude multiply factor (in percent) for all extruders extern bool volumetric_enabled; extern int extruder_multiply[EXTRUDERS]; // sets extrude multiply factor (in percent) for each extruder individually extern float filament_size[EXTRUDERS]; // cross-sectional area of filament (in millimeters), typically around 1.75 or 2.85, 0 disables the volumetric calculations for the extruder. diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 6802a8251..0a8a613c5 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -210,7 +210,6 @@ int homing_bump_divisor[] = HOMING_BUMP_DIVISOR; bool axis_relative_modes[] = AXIS_RELATIVE_MODES; int feedmultiply = 100; //100->1 200->2 int saved_feedmultiply; -int extrudemultiply = 100; //100->1 200->2 int extruder_multiply[EXTRUDERS] = ARRAY_BY_EXTRUDERS(100, 100, 100, 100); bool volumetric_enabled = false; float filament_size[EXTRUDERS] = ARRAY_BY_EXTRUDERS(DEFAULT_NOMINAL_FILAMENT_DIA, DEFAULT_NOMINAL_FILAMENT_DIA, DEFAULT_NOMINAL_FILAMENT_DIA, DEFAULT_NOMINAL_FILAMENT_DIA); @@ -3776,7 +3775,7 @@ inline void gcode_M221() { extruder_multiply[tmp_extruder] = sval; } else { - extrudemultiply = sval; + extruder_multiply[active_extruder] = sval; } } } @@ -4213,7 +4212,7 @@ inline void gcode_M400() { st_synchronize(); } //SERIAL_PROTOCOLPGM("Filament dia (measured mm):"); //SERIAL_PROTOCOL(filament_width_meas); //SERIAL_PROTOCOLPGM("Extrusion ratio(%):"); - //SERIAL_PROTOCOL(extrudemultiply); + //SERIAL_PROTOCOL(extruder_multiply[active_extruder]); } /** diff --git a/Marlin/dogm_lcd_implementation.h b/Marlin/dogm_lcd_implementation.h index 89cd5e835..b3dbd2166 100644 --- a/Marlin/dogm_lcd_implementation.h +++ b/Marlin/dogm_lcd_implementation.h @@ -369,7 +369,7 @@ static void lcd_implementation_status_screen() { lcd_printPGM(PSTR("dia:")); lcd_print(ftostr12ns(filament_width_meas)); lcd_printPGM(PSTR(" factor:")); - lcd_print(itostr3(extrudemultiply)); + lcd_print(itostr3(extruder_multiply[active_extruder])); lcd_print('%'); } #endif diff --git a/Marlin/planner.cpp b/Marlin/planner.cpp index 786527d0d..d98ef63d4 100644 --- a/Marlin/planner.cpp +++ b/Marlin/planner.cpp @@ -545,7 +545,7 @@ float junction_deviation = 0.1; block->steps[Z_AXIS] = labs(dz); block->steps[E_AXIS] = labs(de); block->steps[E_AXIS] *= volumetric_multiplier[active_extruder]; - block->steps[E_AXIS] *= extrudemultiply; + block->steps[E_AXIS] *= extruder_multiply[active_extruder]; block->steps[E_AXIS] /= 100; block->step_event_count = max(block->steps[X_AXIS], max(block->steps[Y_AXIS], max(block->steps[Z_AXIS], block->steps[E_AXIS]))); @@ -679,7 +679,7 @@ float junction_deviation = 0.1; delta_mm[Y_AXIS] = dy / axis_steps_per_unit[Y_AXIS]; #endif delta_mm[Z_AXIS] = dz / axis_steps_per_unit[Z_AXIS]; - delta_mm[E_AXIS] = (de / axis_steps_per_unit[E_AXIS]) * volumetric_multiplier[active_extruder] * extrudemultiply / 100.0; + delta_mm[E_AXIS] = (de / axis_steps_per_unit[E_AXIS]) * volumetric_multiplier[active_extruder] * extruder_multiply[active_extruder] / 100.0; if (block->steps[X_AXIS] <= dropsegments && block->steps[Y_AXIS] <= dropsegments && block->steps[Z_AXIS] <= dropsegments) { block->millimeters = fabs(delta_mm[E_AXIS]); diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index c85f8e14d..58a66973f 100644 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -485,7 +485,7 @@ static void lcd_tune_menu() { MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_BED, &target_temperature_bed, 0, BED_MAXTEMP - 15); #endif MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_FAN_SPEED, &fanSpeed, 0, 255); - MENU_ITEM_EDIT(int3, MSG_FLOW, &extrudemultiply, 10, 999); + MENU_ITEM_EDIT(int3, MSG_FLOW, &extruder_multiply[active_extruder], 10, 999); MENU_ITEM_EDIT(int3, MSG_FLOW MSG_F0, &extruder_multiply[0], 10, 999); #if TEMP_SENSOR_1 != 0 MENU_ITEM_EDIT(int3, MSG_FLOW MSG_F1, &extruder_multiply[1], 10, 999); From 9ac7dc675effc3ecda5b529e835b5ec1b36c9d95 Mon Sep 17 00:00:00 2001 From: AnHardt Date: Mon, 30 Mar 2015 16:56:21 +0200 Subject: [PATCH 2/2] Make filament display on dogm_... same as hitachi... Thanks @MagoKimbra. --- Marlin/dogm_lcd_implementation.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/dogm_lcd_implementation.h b/Marlin/dogm_lcd_implementation.h index b3dbd2166..63e99bd3a 100644 --- a/Marlin/dogm_lcd_implementation.h +++ b/Marlin/dogm_lcd_implementation.h @@ -369,7 +369,7 @@ static void lcd_implementation_status_screen() { lcd_printPGM(PSTR("dia:")); lcd_print(ftostr12ns(filament_width_meas)); lcd_printPGM(PSTR(" factor:")); - lcd_print(itostr3(extruder_multiply[active_extruder])); + lcd_print(itostr3(volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM])); lcd_print('%'); } #endif