From 8bf0b496b97e3b1f8f390aa3fa97d7410eabf8ef Mon Sep 17 00:00:00 2001 From: Roxy-3D Date: Sat, 21 Jan 2017 16:10:57 -0700 Subject: [PATCH 1/6] Improve M600 with timeout, wait for heatup. --- Marlin/Configuration_adv.h | 6 +- Marlin/Marlin_main.cpp | 99 ++++++++++++++++++++++++--- Marlin/dogm_font_data_ISO10646_1_tr.h | 2 +- Marlin/endstops.cpp | 4 ++ Marlin/enum.h | 4 +- Marlin/language.h | 1 + Marlin/language_en.h | 21 +++++- Marlin/ultralcd.cpp | 73 +++++++++++++++++++- Marlin/ultralcd_impl_DOGM.h | 11 +++ Marlin/ultralcd_impl_HD44780.h | 8 +++ README.md | 1 + 11 files changed, 212 insertions(+), 18 deletions(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 0e12ba18d..36b238716 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -721,12 +721,16 @@ #define FILAMENT_CHANGE_LOAD_LENGTH 0 // Load filament length over hotend in mm // Longer length for bowden printers to fast load filament into whole bowden tube over the hotend, // Short or zero length for printers without bowden where loading is not used - #define FILAMENT_CHANGE_LOAD_FEEDRATE 10 // Load filament feedrate in mm/s - filament loading into the bowden tube can be fast + #define FILAMENT_CHANGE_LOAD_FEEDRATE 6 // Load filament feedrate in mm/s - filament loading into the bowden tube can be fast #define FILAMENT_CHANGE_EXTRUDE_LENGTH 50 // Extrude filament length in mm after filament is load over the hotend, // 0 to disable for manual extrusion // Filament can be extruded repeatedly from the filament exchange menu to fill the hotend, // or until outcoming filament color is not clear for filament color change #define FILAMENT_CHANGE_EXTRUDE_FEEDRATE 3 // Extrude filament feedrate in mm/s - must be slower than load feedrate + #define FILAMENT_CHANGE_NOZZLE_TIMEOUT 45L // Turn off nozzle if user doesn't change filament within this time limit in seconds + #define FILAMENT_CHANGE_NUMBER_OF_ALERT_BEEPS 5L // Number of alert beeps before printer goes quiet + #define STEPPER_MOTORS_DONT_TIMEOUT_DURING_FILAMENT_CHANGE // Enable to make stepper motors hold position during filament change even if it + // takes longer than DEFAULT_STEPPER_DEACTIVE_TIME #endif /******************************************************************************\ diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index e1cd4a4e6..2b72b1dc5 100755 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -7290,6 +7290,28 @@ inline void gcode_M503() { #if ENABLED(FILAMENT_CHANGE_FEATURE) + millis_t next_buzz = 0; + unsigned long int runout_beep = 0; + + void filament_change_beep() { + millis_t ms = millis(); + if (ms >= next_buzz) { + if (runout_beep <= FILAMENT_CHANGE_NUMBER_OF_ALERT_BEEPS ) { // Only beep as long as we are supposed to! + BUZZ(300, 2000); + next_buzz = ms + 2500; // Beep every 2.5s while waiting + runout_beep++; + } + else if (runout_beep > FILAMENT_CHANGE_NUMBER_OF_ALERT_BEEPS && + runout_beep <= (FILAMENT_CHANGE_NUMBER_OF_ALERT_BEEPS + 5)) { // End with a burst of short beeps + BUZZ(200, 2000); + next_buzz = ms + 400; // Beep + runout_beep++; + } + } + } + + bool busy_doing_M600 = false; + /** * M600: Pause for filament change * @@ -7310,6 +7332,8 @@ inline void gcode_M503() { return; } + busy_doing_M600 = true; // Stepper Motors can't timeout when this is set + // Show initial message and wait for synchronize steppers lcd_filament_change_show_message(FILAMENT_CHANGE_MESSAGE_INIT); stepper.synchronize(); @@ -7367,6 +7391,7 @@ inline void gcode_M503() { stepper.synchronize(); lcd_filament_change_show_message(FILAMENT_CHANGE_MESSAGE_UNLOAD); + idle(); // Unload filament if (code_seen('L')) destination[E_AXIS] += code_value_axis_units(E_AXIS); @@ -7384,23 +7409,66 @@ inline void gcode_M503() { disable_e3(); delay(100); - #if HAS_BUZZER - millis_t next_buzz = 0; - #endif + millis_t nozzle_timeout = millis() + FILAMENT_CHANGE_NOZZLE_TIMEOUT*1000L; + bool nozzle_timed_out = false; + float temps[4]; + int iii; // Wait for filament insert by user and press button lcd_filament_change_show_message(FILAMENT_CHANGE_MESSAGE_INSERT); - // LCD click or M108 will clear this - wait_for_user = true; + idle(); + + wait_for_user = true; // LCD click or M108 will clear this + next_buzz = 0; + runout_beep = 0; + for( iii=0; iii= next_buzz) { - BUZZ(300, 2000); - next_buzz = ms + 2500; // Beep every 2.5s while waiting + millis_t current_ms = millis(); + if (nozzle_timed_out == true) + lcd_filament_change_show_message(FILAMENT_CHANGE_MESSAGE_CLICK_TO_HEAT_NOZZLE); + #if HAS_BUZZER + filament_change_beep(); + #endif //HAS_BUZZER + + if (current_ms >= nozzle_timeout) { + if (nozzle_timed_out == false ) { + nozzle_timed_out = true; // if the nozzle time out happens, remember we turned off the nozzles. + for( iii=0; iii 3 ) { + lcd_filament_change_show_message(FILAMENT_CHANGE_MESSAGE_WAIT_FOR_NOZZLES_TO_HEAT); + goto KEEP_CHECKING_TEMPS; + } + } + + wait_for_user = true; // LCD click or M108 will clear this + next_buzz = 0; + runout_beep = 0; + while (wait_for_user) { + if (nozzle_timed_out == true) + lcd_filament_change_show_message(FILAMENT_CHANGE_MESSAGE_INSERT); + else break; + #if HAS_BUZZER + filament_change_beep(); #endif idle(true); } @@ -7408,6 +7476,8 @@ inline void gcode_M503() { // Show load message lcd_filament_change_show_message(FILAMENT_CHANGE_MESSAGE_LOAD); + idle(); + // Load filament if (code_seen('L')) destination[E_AXIS] -= code_value_axis_units(E_AXIS); #if defined(FILAMENT_CHANGE_LOAD_LENGTH) && FILAMENT_CHANGE_LOAD_LENGTH > 0 @@ -7459,6 +7529,7 @@ inline void gcode_M503() { // Show status screen lcd_filament_change_show_message(FILAMENT_CHANGE_MESSAGE_STATUS); + busy_doing_M600 = false; // Allow Stepper Motors to be turned off during inactivity } #endif // FILAMENT_CHANGE_FEATURE @@ -10073,7 +10144,13 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) { millis_t ms = millis(); if (max_inactive_time && ELAPSED(ms, previous_cmd_ms + max_inactive_time)) kill(PSTR(MSG_KILLED)); - + + #if ENABLED(FILAMENT_CHANGE_FEATURE) + #ifdef STEPPER_MOTORS_DONT_TIMEOUT_DURING_FILAMENT_CHANGE + if (busy_doing_M600 == false ) // We only allow the stepper motors to time out if + #endif // we are not in the middle of an M600 command. + #endif + if (stepper_inactive_time && ELAPSED(ms, previous_cmd_ms + stepper_inactive_time) && !ignore_stepper_queue && !planner.blocks_queued()) { #if ENABLED(DISABLE_INACTIVE_X) diff --git a/Marlin/dogm_font_data_ISO10646_1_tr.h b/Marlin/dogm_font_data_ISO10646_1_tr.h index 23d6ea88b..e32f59f95 100644 --- a/Marlin/dogm_font_data_ISO10646_1_tr.h +++ b/Marlin/dogm_font_data_ISO10646_1_tr.h @@ -31,7 +31,7 @@ X Font ascent = 7 descent=-1 Max Font ascent = 8 descent=-1 */ -#include "U8glib.h" +#include const u8g_fntpgm_uint8_t ISO10646_TR[2591] U8G_SECTION(".progmem.ISO10646_TR") = { 0,6,9,0,254,7,1,146,3,33,32,255,255,8,255,7, 255,0,0,0,6,0,0,1,7,7,6,2,0,128,128,128, diff --git a/Marlin/endstops.cpp b/Marlin/endstops.cpp index 659fc4052..545ca09c0 100644 --- a/Marlin/endstops.cpp +++ b/Marlin/endstops.cpp @@ -217,6 +217,10 @@ void Endstops::M119() { SERIAL_PROTOCOLPGM(MSG_Z_PROBE); SERIAL_PROTOCOLLN(((READ(Z_MIN_PROBE_PIN)^Z_MIN_PROBE_ENDSTOP_INVERTING) ? MSG_ENDSTOP_HIT : MSG_ENDSTOP_OPEN)); #endif + #if ENABLED(FILAMENT_RUNOUT_SENSOR) + SERIAL_PROTOCOLPGM(MSG_FILAMENT_RUNOUT_SENSOR); + SERIAL_PROTOCOLLN(((READ(FIL_RUNOUT_PIN)^FIL_RUNOUT_INVERTING) ? MSG_ENDSTOP_HIT : MSG_ENDSTOP_OPEN)); + #endif } // Endstops::M119 #if ENABLED(Z_DUAL_ENDSTOPS) diff --git a/Marlin/enum.h b/Marlin/enum.h index 23b1fd033..41b40063c 100644 --- a/Marlin/enum.h +++ b/Marlin/enum.h @@ -143,7 +143,9 @@ enum TempState { FILAMENT_CHANGE_MESSAGE_EXTRUDE, FILAMENT_CHANGE_MESSAGE_OPTION, FILAMENT_CHANGE_MESSAGE_RESUME, - FILAMENT_CHANGE_MESSAGE_STATUS + FILAMENT_CHANGE_MESSAGE_STATUS, + FILAMENT_CHANGE_MESSAGE_CLICK_TO_HEAT_NOZZLE, + FILAMENT_CHANGE_MESSAGE_WAIT_FOR_NOZZLES_TO_HEAT }; #endif #endif diff --git a/Marlin/language.h b/Marlin/language.h index 4fda75a9e..914d1dd6b 100644 --- a/Marlin/language.h +++ b/Marlin/language.h @@ -152,6 +152,7 @@ #define MSG_Z2_MIN "z2_min: " #define MSG_Z2_MAX "z2_max: " #define MSG_Z_PROBE "z_probe: " +#define MSG_FILAMENT_RUNOUT_SENSOR "filament_Runout_Sensor: " #define MSG_ERR_MATERIAL_INDEX "M145 S out of range (0-1)" #define MSG_ERR_M355_NONE "No case light" #define MSG_ERR_M421_PARAMETERS "M421 required parameters missing" diff --git a/Marlin/language_en.h b/Marlin/language_en.h index bea641641..a4f4abdac 100644 --- a/Marlin/language_en.h +++ b/Marlin/language_en.h @@ -33,6 +33,9 @@ #ifndef WELCOME_MSG #define WELCOME_MSG MACHINE_NAME _UxGT(" ready.") #endif +#ifndef MSG_BACK + #define MSG_BACK _UxGT("Back") +#endif #ifndef MSG_SD_INSERTED #define MSG_SD_INSERTED _UxGT("Card inserted") #endif @@ -486,7 +489,6 @@ #ifndef MSG_DELTA_CALIBRATE_CENTER #define MSG_DELTA_CALIBRATE_CENTER _UxGT("Calibrate Center") #endif - #ifndef MSG_INFO_MENU #define MSG_INFO_MENU _UxGT("About Printer") #endif @@ -583,6 +585,12 @@ #ifndef MSG_FILAMENT_CHANGE_OPTION_RESUME #define MSG_FILAMENT_CHANGE_OPTION_RESUME _UxGT("Resume print") #endif +#ifndef MSG_FILAMENT_CHANGE_MINTEMP + #define MSG_FILAMENT_CHANGE_MINTEMP _UxGT("Minimum Temp is ") +#endif +#ifndef MSG_FILAMENT_CHANGE_NOZZLE + #define MSG_FILAMENT_CHANGE_NOZZLE _UxGT(" Nozzle: ") +#endif // // Filament Change screens show up to 3 lines on a 4-line display @@ -603,6 +611,14 @@ #define MSG_FILAMENT_CHANGE_INSERT_2 _UxGT("and press button") #define MSG_FILAMENT_CHANGE_INSERT_3 _UxGT("to continue...") #endif + #ifndef MSG_FILAMENT_CHANGE_HEAT_1 + #define MSG_FILAMENT_CHANGE_HEAT_1 _UxGT("Press button to") + #define MSG_FILAMENT_CHANGE_HEAT_2 _UxGT("heat nozzle.") + #endif + #ifndef MSG_FILAMENT_CHANGE_HEATING_1 + #define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Heating nozzle") + #define MSG_FILAMENT_CHANGE_HEATING_2 _UxGT("Please wait...") + #endif #ifndef MSG_FILAMENT_CHANGE_LOAD_1 #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Wait for") #define MSG_FILAMENT_CHANGE_LOAD_2 _UxGT("filament load") @@ -625,6 +641,9 @@ #ifndef MSG_FILAMENT_CHANGE_INSERT_1 #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Insert and Click") #endif + #ifndef MSG_FILAMENT_CHANGE_HEATING_1 + #define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Heating...") + #endif #ifndef MSG_FILAMENT_CHANGE_LOAD_1 #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Loading...") #endif diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index 6b81fac83..0dd0a59d5 100755 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -54,6 +54,7 @@ char lcd_status_message[3 * (LCD_WIDTH) + 1] = WELCOME_MSG; // worst case is kan #if ENABLED(DOGLCD) #include "ultralcd_impl_DOGM.h" + #include #else #include "ultralcd_impl_HD44780.h" #endif @@ -151,6 +152,7 @@ uint16_t max_display_update_time = 0; void lcd_filament_change_unload_message(); void lcd_filament_change_insert_message(); void lcd_filament_change_load_message(); + void lcd_filament_change_heat_nozzle(); void lcd_filament_change_extrude_message(); void lcd_filament_change_resume_message(); #endif @@ -948,7 +950,8 @@ void kill_screen(const char* lcd_msg) { // Change filament // #if ENABLED(FILAMENT_CHANGE_FEATURE) - MENU_ITEM(function, MSG_FILAMENTCHANGE, lcd_enqueue_filament_change); + if (!thermalManager.tooColdToExtrude(active_extruder)) + MENU_ITEM(function, MSG_FILAMENTCHANGE, lcd_enqueue_filament_change); #endif END_MENU(); @@ -1384,11 +1387,13 @@ KeepDrawing: MENU_ITEM(function, MSG_PREHEAT_1, lcd_preheat_material1_hotend0); MENU_ITEM(function, MSG_PREHEAT_2, lcd_preheat_material2_hotend0); #endif + // // Change filament // #if ENABLED(FILAMENT_CHANGE_FEATURE) - MENU_ITEM(function, MSG_FILAMENTCHANGE, lcd_enqueue_filament_change); + if (!thermalManager.tooColdToExtrude(active_extruder)) + MENU_ITEM(function, MSG_FILAMENTCHANGE, lcd_enqueue_filament_change); #endif #endif @@ -2441,11 +2446,21 @@ KeepDrawing: } #endif // LCD_INFO_MENU + /** + * + * Filament Change Feature Screens + * + */ #if ENABLED(FILAMENT_CHANGE_FEATURE) + void lcd_filament_change_toocold_menu() { START_MENU(); STATIC_ITEM(MSG_HEATING_FAILED_LCD, true, true); - MENU_BACK(MSG_FILAMENTCHANGE); + STATIC_ITEM (MSG_FILAMENT_CHANGE_MINTEMP STRINGIFY(EXTRUDE_MINTEMP) ".", false, false); + MENU_BACK(MSG_BACK); + STATIC_ITEM (" "); + STATIC_ITEM(MSG_FILAMENT_CHANGE_NOZZLE, false, true); + lcd_implementation_hotend_status(); END_MENU(); } @@ -2478,6 +2493,8 @@ KeepDrawing: #ifdef MSG_FILAMENT_CHANGE_INIT_3 STATIC_ITEM(MSG_FILAMENT_CHANGE_INIT_3); #endif + STATIC_ITEM(MSG_FILAMENT_CHANGE_NOZZLE, false, true); + lcd_implementation_hotend_status(); END_SCREEN(); } @@ -2491,6 +2508,35 @@ KeepDrawing: #ifdef MSG_FILAMENT_CHANGE_UNLOAD_3 STATIC_ITEM(MSG_FILAMENT_CHANGE_UNLOAD_3); #endif + STATIC_ITEM (" "); + STATIC_ITEM(MSG_FILAMENT_CHANGE_NOZZLE, false, true); + lcd_implementation_hotend_status(); + END_SCREEN(); + } + + void lcd_filament_change_wait_for_nozzles_to_heat() { + START_SCREEN(); + STATIC_ITEM(MSG_FILAMENT_CHANGE_HEADER, true, true); + STATIC_ITEM(MSG_FILAMENT_CHANGE_HEATING_1); + #ifdef MSG_FILAMENT_CHANGE_HEATING_2 + STATIC_ITEM(MSG_FILAMENT_CHANGE_HEATING_2); + #endif + STATIC_ITEM(" "); + STATIC_ITEM(MSG_FILAMENT_CHANGE_NOZZLE, false, true); + lcd_implementation_hotend_status(); + END_SCREEN(); + } + + void lcd_filament_change_heat_nozzle() { + START_SCREEN(); + STATIC_ITEM(MSG_FILAMENT_CHANGE_HEADER, true, true); + STATIC_ITEM(MSG_FILAMENT_CHANGE_HEAT_1); + #ifdef MSG_FILAMENT_CHANGE_INSERT_2 + STATIC_ITEM(MSG_FILAMENT_CHANGE_HEAT_2); + #endif + STATIC_ITEM(" "); + STATIC_ITEM(MSG_FILAMENT_CHANGE_NOZZLE, false, true); + lcd_implementation_hotend_status(); END_SCREEN(); } @@ -2504,6 +2550,8 @@ KeepDrawing: #ifdef MSG_FILAMENT_CHANGE_INSERT_3 STATIC_ITEM(MSG_FILAMENT_CHANGE_INSERT_3); #endif + STATIC_ITEM(MSG_FILAMENT_CHANGE_NOZZLE, false, true); + lcd_implementation_hotend_status(); END_SCREEN(); } @@ -2517,6 +2565,9 @@ KeepDrawing: #ifdef MSG_FILAMENT_CHANGE_LOAD_3 STATIC_ITEM(MSG_FILAMENT_CHANGE_LOAD_3); #endif + STATIC_ITEM(" "); + STATIC_ITEM(MSG_FILAMENT_CHANGE_NOZZLE, false, true); + lcd_implementation_hotend_status(); END_SCREEN(); } @@ -2530,6 +2581,9 @@ KeepDrawing: #ifdef MSG_FILAMENT_CHANGE_EXTRUDE_3 STATIC_ITEM(MSG_FILAMENT_CHANGE_EXTRUDE_3); #endif + STATIC_ITEM(" "); + STATIC_ITEM(MSG_FILAMENT_CHANGE_NOZZLE, false, true); + lcd_implementation_hotend_status(); END_SCREEN(); } @@ -2550,20 +2604,33 @@ KeepDrawing: switch (message) { case FILAMENT_CHANGE_MESSAGE_INIT: defer_return_to_status = true; + lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT; lcd_goto_screen(lcd_filament_change_init_message); break; case FILAMENT_CHANGE_MESSAGE_UNLOAD: + lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT; lcd_goto_screen(lcd_filament_change_unload_message); break; case FILAMENT_CHANGE_MESSAGE_INSERT: + lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT; lcd_goto_screen(lcd_filament_change_insert_message); break; case FILAMENT_CHANGE_MESSAGE_LOAD: + lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT; lcd_goto_screen(lcd_filament_change_load_message); break; case FILAMENT_CHANGE_MESSAGE_EXTRUDE: + lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT; lcd_goto_screen(lcd_filament_change_extrude_message); break; + case FILAMENT_CHANGE_MESSAGE_CLICK_TO_HEAT_NOZZLE: + lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT; + lcd_goto_screen(lcd_filament_change_heat_nozzle); + break; + case FILAMENT_CHANGE_MESSAGE_WAIT_FOR_NOZZLES_TO_HEAT: + lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT; + lcd_goto_screen(lcd_filament_change_wait_for_nozzles_to_heat); + break; case FILAMENT_CHANGE_MESSAGE_OPTION: filament_change_menu_response = FILAMENT_CHANGE_RESPONSE_WAIT_FOR; lcd_goto_screen(lcd_filament_change_option_menu); diff --git a/Marlin/ultralcd_impl_DOGM.h b/Marlin/ultralcd_impl_DOGM.h index 2b51ea79c..cc1b709e8 100644 --- a/Marlin/ultralcd_impl_DOGM.h +++ b/Marlin/ultralcd_impl_DOGM.h @@ -379,6 +379,17 @@ FORCE_INLINE void _draw_axis_label(const AxisEnum axis, const char* const pstr, //#define DOGM_SD_PERCENT + +static void lcd_implementation_hotend_status() { + u8g.setPrintPos(58, 60); + lcd_print( (char) '0'+active_extruder ); + lcd_print( ' ' ); + lcd_print( ' ' ); + lcd_print(itostr3(thermalManager.degHotend(active_extruder))); + lcd_print('/'); + lcd_print(itostr3(thermalManager.degTargetHotend(active_extruder))); +} + static void lcd_implementation_status_screen() { bool blink = lcd_blink(); diff --git a/Marlin/ultralcd_impl_HD44780.h b/Marlin/ultralcd_impl_HD44780.h index 38edbc747..f4fa4795d 100644 --- a/Marlin/ultralcd_impl_HD44780.h +++ b/Marlin/ultralcd_impl_HD44780.h @@ -592,6 +592,14 @@ FORCE_INLINE void _draw_axis_label(const AxisEnum axis, const char* const pstr, #endif // LCD_PROGRESS_BAR +static void lcd_implementation_hotend_status() { + lcd.setCursor(10,3); + lcd.print(LCD_STR_THERMOMETER[active_extruder]); + lcd.print(itostr3(thermalManager.degHotend(active_extruder))); + lcd.print('/'); + lcd.print(itostr3(thermalManager.degTargetHotend(active_extruder))); +} + /** Possible status screens: 16x2 |000/000 B000/000| diff --git a/README.md b/README.md index 42e5cfa96..ad259a238 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,7 @@ The latest Release Candidate lives in the ["RC" branch](https://github.com/Marli ## Recent Changes - RCBugFix - Fixed broken MBL + - M600 heater timeout option - RC8 - 06 Dec 2016 - Major performance improvement for Graphical LCDs From 931914e6795829c6ad775e40dc9195627219fe99 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 10 Feb 2017 00:48:11 -0600 Subject: [PATCH 2/6] Apply M600 updates to all configs --- .../Cartesio/Configuration_adv.h | 63 +++++++++++-------- .../Felix/Configuration_adv.h | 6 +- .../Hephestos/Configuration_adv.h | 6 +- .../Hephestos_2/Configuration_adv.h | 6 +- .../K8200/Configuration_adv.h | 63 +++++++++++-------- .../K8400/Configuration_adv.h | 63 +++++++++++-------- .../RigidBot/Configuration_adv.h | 6 +- .../SCARA/Configuration_adv.h | 6 +- .../TAZ4/Configuration_adv.h | 63 +++++++++++-------- .../WITBOX/Configuration_adv.h | 6 +- .../delta/generic/Configuration_adv.h | 6 +- .../delta/kossel_mini/Configuration_adv.h | 6 +- .../delta/kossel_pro/Configuration_adv.h | 6 +- .../delta/kossel_xl/Configuration_adv.h | 6 +- .../makibox/Configuration_adv.h | 6 +- .../tvrrug/Round2/Configuration_adv.h | 6 +- 16 files changed, 204 insertions(+), 120 deletions(-) diff --git a/Marlin/example_configurations/Cartesio/Configuration_adv.h b/Marlin/example_configurations/Cartesio/Configuration_adv.h index 687dade67..eecbb25d2 100644 --- a/Marlin/example_configurations/Cartesio/Configuration_adv.h +++ b/Marlin/example_configurations/Cartesio/Configuration_adv.h @@ -695,33 +695,42 @@ #define RETRACT_RECOVER_FEEDRATE 8 //default feedrate for recovering from retraction (mm/s) #endif -// Add support for experimental filament exchange support M600; requires display -#if ENABLED(ULTIPANEL) - // #define FILAMENT_CHANGE_FEATURE // Enable filament exchange menu and M600 g-code (used for runout sensor too) - #if ENABLED(FILAMENT_CHANGE_FEATURE) - #define FILAMENT_CHANGE_X_POS 30 // X position of hotend - #define FILAMENT_CHANGE_Y_POS 10 // Y position of hotend - #define FILAMENT_CHANGE_Z_ADD 10 // Z addition of hotend (lift) - #define FILAMENT_CHANGE_XY_FEEDRATE 100 // X and Y axes feedrate in mm/s (also used for delta printers Z axis) - #define FILAMENT_CHANGE_Z_FEEDRATE 5 // Z axis feedrate in mm/s (not used for delta printers) - #define FILAMENT_CHANGE_RETRACT_LENGTH 1 // Initial retract in mm - // It is a short retract used immediately after print interrupt before move to filament exchange position - #define FILAMENT_CHANGE_RETRACT_FEEDRATE 60 // Initial retract feedrate in mm/s - //#define FILAMENT_CHANGE_UNLOAD_LENGTH 100 // Unload filament length from hotend in mm - // Longer length for bowden printers to unload filament from whole bowden tube, - // shorter lenght for printers without bowden to unload filament from extruder only, - // 0 to disable unloading for manual unloading - #define FILAMENT_CHANGE_UNLOAD_FEEDRATE 10 // Unload filament feedrate in mm/s - filament unloading can be fast - #define FILAMENT_CHANGE_LOAD_LENGTH 0 // Load filament length over hotend in mm - // Longer length for bowden printers to fast load filament into whole bowden tube over the hotend, - // Short or zero length for printers without bowden where loading is not used - #define FILAMENT_CHANGE_LOAD_FEEDRATE 10 // Load filament feedrate in mm/s - filament loading into the bowden tube can be fast - #define FILAMENT_CHANGE_EXTRUDE_LENGTH 50 // Extrude filament length in mm after filament is load over the hotend, - // 0 to disable for manual extrusion - // Filament can be extruded repeatedly from the filament exchange menu to fill the hotend, - // or until outcoming filament color is not clear for filament color change - #define FILAMENT_CHANGE_EXTRUDE_FEEDRATE 3 // Extrude filament feedrate in mm/s - must be slower than load feedrate - #endif +/** + * Filament Change + * Experimental filament change support. + * Adds the GCode M600 for initiating filament change. + * + * Requires an LCD display. + * This feature is required for the default FILAMENT_RUNOUT_SCRIPT. + */ +//#define FILAMENT_CHANGE_FEATURE +#if ENABLED(FILAMENT_CHANGE_FEATURE) + #define FILAMENT_CHANGE_X_POS 30 // X position of hotend + #define FILAMENT_CHANGE_Y_POS 10 // Y position of hotend + #define FILAMENT_CHANGE_Z_ADD 10 // Z addition of hotend (lift) + #define FILAMENT_CHANGE_XY_FEEDRATE 100 // X and Y axes feedrate in mm/s (also used for delta printers Z axis) + #define FILAMENT_CHANGE_Z_FEEDRATE 5 // Z axis feedrate in mm/s (not used for delta printers) + #define FILAMENT_CHANGE_RETRACT_LENGTH 1 // Initial retract in mm + // It is a short retract used immediately after print interrupt before move to filament exchange position + #define FILAMENT_CHANGE_RETRACT_FEEDRATE 60 // Initial retract feedrate in mm/s + //#define FILAMENT_CHANGE_UNLOAD_LENGTH 100 // Unload filament length from hotend in mm + // Longer length for bowden printers to unload filament from whole bowden tube, + // shorter lenght for printers without bowden to unload filament from extruder only, + // 0 to disable unloading for manual unloading + #define FILAMENT_CHANGE_UNLOAD_FEEDRATE 10 // Unload filament feedrate in mm/s - filament unloading can be fast + #define FILAMENT_CHANGE_LOAD_LENGTH 0 // Load filament length over hotend in mm + // Longer length for bowden printers to fast load filament into whole bowden tube over the hotend, + // Short or zero length for printers without bowden where loading is not used + #define FILAMENT_CHANGE_LOAD_FEEDRATE 6 // Load filament feedrate in mm/s - filament loading into the bowden tube can be fast + #define FILAMENT_CHANGE_EXTRUDE_LENGTH 50 // Extrude filament length in mm after filament is load over the hotend, + // 0 to disable for manual extrusion + // Filament can be extruded repeatedly from the filament exchange menu to fill the hotend, + // or until outcoming filament color is not clear for filament color change + #define FILAMENT_CHANGE_EXTRUDE_FEEDRATE 3 // Extrude filament feedrate in mm/s - must be slower than load feedrate + #define FILAMENT_CHANGE_NOZZLE_TIMEOUT 45L // Turn off nozzle if user doesn't change filament within this time limit in seconds + #define FILAMENT_CHANGE_NUMBER_OF_ALERT_BEEPS 5L // Number of alert beeps before printer goes quiet + #define FILAMENT_CHANGE_NO_STEPPER_TIMEOUT // Enable to have stepper motors hold position during filament change + // even if it takes longer than DEFAULT_STEPPER_DEACTIVE_TIME. #endif /******************************************************************************\ diff --git a/Marlin/example_configurations/Felix/Configuration_adv.h b/Marlin/example_configurations/Felix/Configuration_adv.h index 141879a94..d3b4aea9c 100644 --- a/Marlin/example_configurations/Felix/Configuration_adv.h +++ b/Marlin/example_configurations/Felix/Configuration_adv.h @@ -721,12 +721,16 @@ #define FILAMENT_CHANGE_LOAD_LENGTH 0 // Load filament length over hotend in mm // Longer length for bowden printers to fast load filament into whole bowden tube over the hotend, // Short or zero length for printers without bowden where loading is not used - #define FILAMENT_CHANGE_LOAD_FEEDRATE 10 // Load filament feedrate in mm/s - filament loading into the bowden tube can be fast + #define FILAMENT_CHANGE_LOAD_FEEDRATE 6 // Load filament feedrate in mm/s - filament loading into the bowden tube can be fast #define FILAMENT_CHANGE_EXTRUDE_LENGTH 50 // Extrude filament length in mm after filament is load over the hotend, // 0 to disable for manual extrusion // Filament can be extruded repeatedly from the filament exchange menu to fill the hotend, // or until outcoming filament color is not clear for filament color change #define FILAMENT_CHANGE_EXTRUDE_FEEDRATE 3 // Extrude filament feedrate in mm/s - must be slower than load feedrate + #define FILAMENT_CHANGE_NOZZLE_TIMEOUT 45L // Turn off nozzle if user doesn't change filament within this time limit in seconds + #define FILAMENT_CHANGE_NUMBER_OF_ALERT_BEEPS 5L // Number of alert beeps before printer goes quiet + #define FILAMENT_CHANGE_NO_STEPPER_TIMEOUT // Enable to have stepper motors hold position during filament change + // even if it takes longer than DEFAULT_STEPPER_DEACTIVE_TIME. #endif /******************************************************************************\ diff --git a/Marlin/example_configurations/Hephestos/Configuration_adv.h b/Marlin/example_configurations/Hephestos/Configuration_adv.h index c9cdf560e..b81ccf63b 100644 --- a/Marlin/example_configurations/Hephestos/Configuration_adv.h +++ b/Marlin/example_configurations/Hephestos/Configuration_adv.h @@ -721,12 +721,16 @@ #define FILAMENT_CHANGE_LOAD_LENGTH 0 // Load filament length over hotend in mm // Longer length for bowden printers to fast load filament into whole bowden tube over the hotend, // Short or zero length for printers without bowden where loading is not used - #define FILAMENT_CHANGE_LOAD_FEEDRATE 10 // Load filament feedrate in mm/s - filament loading into the bowden tube can be fast + #define FILAMENT_CHANGE_LOAD_FEEDRATE 6 // Load filament feedrate in mm/s - filament loading into the bowden tube can be fast #define FILAMENT_CHANGE_EXTRUDE_LENGTH 50 // Extrude filament length in mm after filament is load over the hotend, // 0 to disable for manual extrusion // Filament can be extruded repeatedly from the filament exchange menu to fill the hotend, // or until outcoming filament color is not clear for filament color change #define FILAMENT_CHANGE_EXTRUDE_FEEDRATE 3 // Extrude filament feedrate in mm/s - must be slower than load feedrate + #define FILAMENT_CHANGE_NOZZLE_TIMEOUT 45L // Turn off nozzle if user doesn't change filament within this time limit in seconds + #define FILAMENT_CHANGE_NUMBER_OF_ALERT_BEEPS 5L // Number of alert beeps before printer goes quiet + #define FILAMENT_CHANGE_NO_STEPPER_TIMEOUT // Enable to have stepper motors hold position during filament change + // even if it takes longer than DEFAULT_STEPPER_DEACTIVE_TIME. #endif /******************************************************************************\ diff --git a/Marlin/example_configurations/Hephestos_2/Configuration_adv.h b/Marlin/example_configurations/Hephestos_2/Configuration_adv.h index ceb0dfe37..6c37d27fd 100644 --- a/Marlin/example_configurations/Hephestos_2/Configuration_adv.h +++ b/Marlin/example_configurations/Hephestos_2/Configuration_adv.h @@ -704,12 +704,16 @@ #define FILAMENT_CHANGE_LOAD_LENGTH 0 // Load filament length over hotend in mm // Longer length for bowden printers to fast load filament into whole bowden tube over the hotend, // Short or zero length for printers without bowden where loading is not used - #define FILAMENT_CHANGE_LOAD_FEEDRATE 10 // Load filament feedrate in mm/s - filament loading into the bowden tube can be fast + #define FILAMENT_CHANGE_LOAD_FEEDRATE 6 // Load filament feedrate in mm/s - filament loading into the bowden tube can be fast #define FILAMENT_CHANGE_EXTRUDE_LENGTH 50 // Extrude filament length in mm after filament is load over the hotend, // 0 to disable for manual extrusion // Filament can be extruded repeatedly from the filament exchange menu to fill the hotend, // or until outcoming filament color is not clear for filament color change #define FILAMENT_CHANGE_EXTRUDE_FEEDRATE 3 // Extrude filament feedrate in mm/s - must be slower than load feedrate + #define FILAMENT_CHANGE_NOZZLE_TIMEOUT 45L // Turn off nozzle if user doesn't change filament within this time limit in seconds + #define FILAMENT_CHANGE_NUMBER_OF_ALERT_BEEPS 5L // Number of alert beeps before printer goes quiet + #define FILAMENT_CHANGE_NO_STEPPER_TIMEOUT // Enable to have stepper motors hold position during filament change + // even if it takes longer than DEFAULT_STEPPER_DEACTIVE_TIME. #endif /******************************************************************************\ diff --git a/Marlin/example_configurations/K8200/Configuration_adv.h b/Marlin/example_configurations/K8200/Configuration_adv.h index 1a84914b1..340dc9bfb 100644 --- a/Marlin/example_configurations/K8200/Configuration_adv.h +++ b/Marlin/example_configurations/K8200/Configuration_adv.h @@ -708,33 +708,42 @@ #define RETRACT_RECOVER_FEEDRATE 8 //default feedrate for recovering from retraction (mm/s) #endif -// Add support for experimental filament exchange support M600; requires display -#if ENABLED(ULTIPANEL) - #define FILAMENT_CHANGE_FEATURE // Enable filament exchange menu and M600 g-code (used for runout sensor too) - #if ENABLED(FILAMENT_CHANGE_FEATURE) - #define FILAMENT_CHANGE_X_POS (X_MAX_POS-3) // X position of hotend - #define FILAMENT_CHANGE_Y_POS 3 // Y position of hotend - #define FILAMENT_CHANGE_Z_ADD 10 // Z addition of hotend (lift) - #define FILAMENT_CHANGE_XY_FEEDRATE 100 // X and Y axes feedrate in mm/s (also used for delta printers Z axis) - #define FILAMENT_CHANGE_Z_FEEDRATE 5 // Z axis feedrate in mm/s (not used for delta printers) - #define FILAMENT_CHANGE_RETRACT_LENGTH 2 // Initial retract in mm - // It is a short retract used immediately after print interrupt before move to filament exchange position - #define FILAMENT_CHANGE_RETRACT_FEEDRATE 60 // Initial retract feedrate in mm/s - #define FILAMENT_CHANGE_UNLOAD_LENGTH 100 // Unload filament length from hotend in mm - // Longer length for bowden printers to unload filament from whole bowden tube, - // shorter lenght for printers without bowden to unload filament from extruder only, - // 0 to disable unloading for manual unloading - #define FILAMENT_CHANGE_UNLOAD_FEEDRATE 10 // Unload filament feedrate in mm/s - filament unloading can be fast - #define FILAMENT_CHANGE_LOAD_LENGTH 0 // Load filament length over hotend in mm - // Longer length for bowden printers to fast load filament into whole bowden tube over the hotend, - // Short or zero length for printers without bowden where loading is not used - #define FILAMENT_CHANGE_LOAD_FEEDRATE 10 // Load filament feedrate in mm/s - filament loading into the bowden tube can be fast - #define FILAMENT_CHANGE_EXTRUDE_LENGTH 50 // Extrude filament length in mm after filament is load over the hotend, - // 0 to disable for manual extrusion - // Filament can be extruded repeatedly from the filament exchange menu to fill the hotend, - // or until outcoming filament color is not clear for filament color change - #define FILAMENT_CHANGE_EXTRUDE_FEEDRATE 3 // Extrude filament feedrate in mm/s - must be slower than load feedrate - #endif +/** + * Filament Change + * Experimental filament change support. + * Adds the GCode M600 for initiating filament change. + * + * Requires an LCD display. + * This feature is required for the default FILAMENT_RUNOUT_SCRIPT. + */ +//#define FILAMENT_CHANGE_FEATURE +#if ENABLED(FILAMENT_CHANGE_FEATURE) + #define FILAMENT_CHANGE_X_POS (X_MAX_POS-3) // X position of hotend + #define FILAMENT_CHANGE_Y_POS 3 // Y position of hotend + #define FILAMENT_CHANGE_Z_ADD 10 // Z addition of hotend (lift) + #define FILAMENT_CHANGE_XY_FEEDRATE 100 // X and Y axes feedrate in mm/s (also used for delta printers Z axis) + #define FILAMENT_CHANGE_Z_FEEDRATE 5 // Z axis feedrate in mm/s (not used for delta printers) + #define FILAMENT_CHANGE_RETRACT_LENGTH 2 // Initial retract in mm + // It is a short retract used immediately after print interrupt before move to filament exchange position + #define FILAMENT_CHANGE_RETRACT_FEEDRATE 60 // Initial retract feedrate in mm/s + #define FILAMENT_CHANGE_UNLOAD_LENGTH 100 // Unload filament length from hotend in mm + // Longer length for bowden printers to unload filament from whole bowden tube, + // shorter lenght for printers without bowden to unload filament from extruder only, + // 0 to disable unloading for manual unloading + #define FILAMENT_CHANGE_UNLOAD_FEEDRATE 10 // Unload filament feedrate in mm/s - filament unloading can be fast + #define FILAMENT_CHANGE_LOAD_LENGTH 0 // Load filament length over hotend in mm + // Longer length for bowden printers to fast load filament into whole bowden tube over the hotend, + // Short or zero length for printers without bowden where loading is not used + #define FILAMENT_CHANGE_LOAD_FEEDRATE 6 // Load filament feedrate in mm/s - filament loading into the bowden tube can be fast + #define FILAMENT_CHANGE_EXTRUDE_LENGTH 50 // Extrude filament length in mm after filament is load over the hotend, + // 0 to disable for manual extrusion + // Filament can be extruded repeatedly from the filament exchange menu to fill the hotend, + // or until outcoming filament color is not clear for filament color change + #define FILAMENT_CHANGE_EXTRUDE_FEEDRATE 3 // Extrude filament feedrate in mm/s - must be slower than load feedrate + #define FILAMENT_CHANGE_NOZZLE_TIMEOUT 45L // Turn off nozzle if user doesn't change filament within this time limit in seconds + #define FILAMENT_CHANGE_NUMBER_OF_ALERT_BEEPS 5L // Number of alert beeps before printer goes quiet + #define FILAMENT_CHANGE_NO_STEPPER_TIMEOUT // Enable to have stepper motors hold position during filament change + // even if it takes longer than DEFAULT_STEPPER_DEACTIVE_TIME. #endif /******************************************************************************\ diff --git a/Marlin/example_configurations/K8400/Configuration_adv.h b/Marlin/example_configurations/K8400/Configuration_adv.h index 67f0ee668..33961eab5 100644 --- a/Marlin/example_configurations/K8400/Configuration_adv.h +++ b/Marlin/example_configurations/K8400/Configuration_adv.h @@ -695,33 +695,42 @@ #define RETRACT_RECOVER_FEEDRATE 8 //default feedrate for recovering from retraction (mm/s) #endif -// Add support for experimental filament exchange support M600; requires display -#if ENABLED(ULTIPANEL) - #define FILAMENT_CHANGE_FEATURE // Enable filament exchange menu and M600 g-code (used for runout sensor too) - #if ENABLED(FILAMENT_CHANGE_FEATURE) - #define FILAMENT_CHANGE_X_POS 100 // X position of hotend - #define FILAMENT_CHANGE_Y_POS 100 // Y position of hotend - #define FILAMENT_CHANGE_Z_ADD 20 // Z addition of hotend (lift) - #define FILAMENT_CHANGE_XY_FEEDRATE 100 // X and Y axes feedrate in mm/s (also used for delta printers Z axis) - #define FILAMENT_CHANGE_Z_FEEDRATE 5 // Z axis feedrate in mm/s (not used for delta printers) - #define FILAMENT_CHANGE_RETRACT_LENGTH 5 // Initial retract in mm - // It is a short retract used immediately after print interrupt before move to filament exchange position - #define FILAMENT_CHANGE_RETRACT_FEEDRATE 60 // Initial retract feedrate in mm/s - #define FILAMENT_CHANGE_UNLOAD_LENGTH 600 // Unload filament length from hotend in mm - // Longer length for bowden printers to unload filament from whole bowden tube, - // shorter lenght for printers without bowden to unload filament from extruder only, - // 0 to disable unloading for manual unloading - #define FILAMENT_CHANGE_UNLOAD_FEEDRATE 10 // Unload filament feedrate in mm/s - filament unloading can be fast - #define FILAMENT_CHANGE_LOAD_LENGTH 600 // Load filament length over hotend in mm - // Longer length for bowden printers to fast load filament into whole bowden tube over the hotend, - // Short or zero length for printers without bowden where loading is not used - #define FILAMENT_CHANGE_LOAD_FEEDRATE 10 // Load filament feedrate in mm/s - filament loading into the bowden tube can be fast - #define FILAMENT_CHANGE_EXTRUDE_LENGTH 100 // Extrude filament length in mm after filament is load over the hotend, - // 0 to disable for manual extrusion - // Filament can be extruded repeatedly from the filament exchange menu to fill the hotend, - // or until outcoming filament color is not clear for filament color change - #define FILAMENT_CHANGE_EXTRUDE_FEEDRATE 3 // Extrude filament feedrate in mm/s - must be slower than load feedrate - #endif +/** + * Filament Change + * Experimental filament change support. + * Adds the GCode M600 for initiating filament change. + * + * Requires an LCD display. + * This feature is required for the default FILAMENT_RUNOUT_SCRIPT. + */ +//#define FILAMENT_CHANGE_FEATURE +#if ENABLED(FILAMENT_CHANGE_FEATURE) + #define FILAMENT_CHANGE_X_POS 100 // X position of hotend + #define FILAMENT_CHANGE_Y_POS 100 // Y position of hotend + #define FILAMENT_CHANGE_Z_ADD 20 // Z addition of hotend (lift) + #define FILAMENT_CHANGE_XY_FEEDRATE 100 // X and Y axes feedrate in mm/s (also used for delta printers Z axis) + #define FILAMENT_CHANGE_Z_FEEDRATE 5 // Z axis feedrate in mm/s (not used for delta printers) + #define FILAMENT_CHANGE_RETRACT_LENGTH 5 // Initial retract in mm + // It is a short retract used immediately after print interrupt before move to filament exchange position + #define FILAMENT_CHANGE_RETRACT_FEEDRATE 60 // Initial retract feedrate in mm/s + #define FILAMENT_CHANGE_UNLOAD_LENGTH 600 // Unload filament length from hotend in mm + // Longer length for bowden printers to unload filament from whole bowden tube, + // shorter lenght for printers without bowden to unload filament from extruder only, + // 0 to disable unloading for manual unloading + #define FILAMENT_CHANGE_UNLOAD_FEEDRATE 10 // Unload filament feedrate in mm/s - filament unloading can be fast + #define FILAMENT_CHANGE_LOAD_LENGTH 0 // Load filament length over hotend in mm + // Longer length for bowden printers to fast load filament into whole bowden tube over the hotend, + // Short or zero length for printers without bowden where loading is not used + #define FILAMENT_CHANGE_LOAD_FEEDRATE 6 // Load filament feedrate in mm/s - filament loading into the bowden tube can be fast + #define FILAMENT_CHANGE_EXTRUDE_LENGTH 100 // Extrude filament length in mm after filament is load over the hotend, + // 0 to disable for manual extrusion + // Filament can be extruded repeatedly from the filament exchange menu to fill the hotend, + // or until outcoming filament color is not clear for filament color change + #define FILAMENT_CHANGE_EXTRUDE_FEEDRATE 3 // Extrude filament feedrate in mm/s - must be slower than load feedrate + #define FILAMENT_CHANGE_NOZZLE_TIMEOUT 45L // Turn off nozzle if user doesn't change filament within this time limit in seconds + #define FILAMENT_CHANGE_NUMBER_OF_ALERT_BEEPS 5L // Number of alert beeps before printer goes quiet + #define FILAMENT_CHANGE_NO_STEPPER_TIMEOUT // Enable to have stepper motors hold position during filament change + // even if it takes longer than DEFAULT_STEPPER_DEACTIVE_TIME. #endif /******************************************************************************\ diff --git a/Marlin/example_configurations/RigidBot/Configuration_adv.h b/Marlin/example_configurations/RigidBot/Configuration_adv.h index e501cb328..05830ca66 100644 --- a/Marlin/example_configurations/RigidBot/Configuration_adv.h +++ b/Marlin/example_configurations/RigidBot/Configuration_adv.h @@ -721,12 +721,16 @@ #define FILAMENT_CHANGE_LOAD_LENGTH 0 // Load filament length over hotend in mm // Longer length for bowden printers to fast load filament into whole bowden tube over the hotend, // Short or zero length for printers without bowden where loading is not used - #define FILAMENT_CHANGE_LOAD_FEEDRATE 10 // Load filament feedrate in mm/s - filament loading into the bowden tube can be fast + #define FILAMENT_CHANGE_LOAD_FEEDRATE 6 // Load filament feedrate in mm/s - filament loading into the bowden tube can be fast #define FILAMENT_CHANGE_EXTRUDE_LENGTH 50 // Extrude filament length in mm after filament is load over the hotend, // 0 to disable for manual extrusion // Filament can be extruded repeatedly from the filament exchange menu to fill the hotend, // or until outcoming filament color is not clear for filament color change #define FILAMENT_CHANGE_EXTRUDE_FEEDRATE 3 // Extrude filament feedrate in mm/s - must be slower than load feedrate + #define FILAMENT_CHANGE_NOZZLE_TIMEOUT 45L // Turn off nozzle if user doesn't change filament within this time limit in seconds + #define FILAMENT_CHANGE_NUMBER_OF_ALERT_BEEPS 5L // Number of alert beeps before printer goes quiet + #define FILAMENT_CHANGE_NO_STEPPER_TIMEOUT // Enable to have stepper motors hold position during filament change + // even if it takes longer than DEFAULT_STEPPER_DEACTIVE_TIME. #endif /******************************************************************************\ diff --git a/Marlin/example_configurations/SCARA/Configuration_adv.h b/Marlin/example_configurations/SCARA/Configuration_adv.h index deefbf142..812b72e61 100644 --- a/Marlin/example_configurations/SCARA/Configuration_adv.h +++ b/Marlin/example_configurations/SCARA/Configuration_adv.h @@ -721,12 +721,16 @@ #define FILAMENT_CHANGE_LOAD_LENGTH 0 // Load filament length over hotend in mm // Longer length for bowden printers to fast load filament into whole bowden tube over the hotend, // Short or zero length for printers without bowden where loading is not used - #define FILAMENT_CHANGE_LOAD_FEEDRATE 10 // Load filament feedrate in mm/s - filament loading into the bowden tube can be fast + #define FILAMENT_CHANGE_LOAD_FEEDRATE 6 // Load filament feedrate in mm/s - filament loading into the bowden tube can be fast #define FILAMENT_CHANGE_EXTRUDE_LENGTH 50 // Extrude filament length in mm after filament is load over the hotend, // 0 to disable for manual extrusion // Filament can be extruded repeatedly from the filament exchange menu to fill the hotend, // or until outcoming filament color is not clear for filament color change #define FILAMENT_CHANGE_EXTRUDE_FEEDRATE 3 // Extrude filament feedrate in mm/s - must be slower than load feedrate + #define FILAMENT_CHANGE_NOZZLE_TIMEOUT 45L // Turn off nozzle if user doesn't change filament within this time limit in seconds + #define FILAMENT_CHANGE_NUMBER_OF_ALERT_BEEPS 5L // Number of alert beeps before printer goes quiet + #define FILAMENT_CHANGE_NO_STEPPER_TIMEOUT // Enable to have stepper motors hold position during filament change + // even if it takes longer than DEFAULT_STEPPER_DEACTIVE_TIME. #endif /******************************************************************************\ diff --git a/Marlin/example_configurations/TAZ4/Configuration_adv.h b/Marlin/example_configurations/TAZ4/Configuration_adv.h index 816a45401..a0db6bf68 100644 --- a/Marlin/example_configurations/TAZ4/Configuration_adv.h +++ b/Marlin/example_configurations/TAZ4/Configuration_adv.h @@ -703,33 +703,42 @@ #define RETRACT_RECOVER_FEEDRATE 8 //default feedrate for recovering from retraction (mm/s) #endif -// Add support for experimental filament exchange support M600; requires display -#if ENABLED(ULTIPANEL) - #define FILAMENT_CHANGE_FEATURE // Enable filament exchange menu and M600 g-code (used for runout sensor too) - #if ENABLED(FILAMENT_CHANGE_FEATURE) - #define FILAMENT_CHANGE_X_POS 3 // X position of hotend - #define FILAMENT_CHANGE_Y_POS 3 // Y position of hotend - #define FILAMENT_CHANGE_Z_ADD 10 // Z addition of hotend (lift) - #define FILAMENT_CHANGE_XY_FEEDRATE 100 // X and Y axes feedrate in mm/s (also used for delta printers Z axis) - #define FILAMENT_CHANGE_Z_FEEDRATE 5 // Z axis feedrate in mm/s (not used for delta printers) - #define FILAMENT_CHANGE_RETRACT_LENGTH 2 // Initial retract in mm - // It is a short retract used immediately after print interrupt before move to filament exchange position - #define FILAMENT_CHANGE_RETRACT_FEEDRATE 60 // Initial retract feedrate in mm/s - #define FILAMENT_CHANGE_UNLOAD_LENGTH 100 // Unload filament length from hotend in mm - // Longer length for bowden printers to unload filament from whole bowden tube, - // shorter lenght for printers without bowden to unload filament from extruder only, - // 0 to disable unloading for manual unloading - #define FILAMENT_CHANGE_UNLOAD_FEEDRATE 10 // Unload filament feedrate in mm/s - filament unloading can be fast - #define FILAMENT_CHANGE_LOAD_LENGTH 0 // Load filament length over hotend in mm - // Longer length for bowden printers to fast load filament into whole bowden tube over the hotend, - // Short or zero length for printers without bowden where loading is not used - #define FILAMENT_CHANGE_LOAD_FEEDRATE 10 // Load filament feedrate in mm/s - filament loading into the bowden tube can be fast - #define FILAMENT_CHANGE_EXTRUDE_LENGTH 50 // Extrude filament length in mm after filament is load over the hotend, - // 0 to disable for manual extrusion - // Filament can be extruded repeatedly from the filament exchange menu to fill the hotend, - // or until outcoming filament color is not clear for filament color change - #define FILAMENT_CHANGE_EXTRUDE_FEEDRATE 3 // Extrude filament feedrate in mm/s - must be slower than load feedrate - #endif +/** + * Filament Change + * Experimental filament change support. + * Adds the GCode M600 for initiating filament change. + * + * Requires an LCD display. + * This feature is required for the default FILAMENT_RUNOUT_SCRIPT. + */ +//#define FILAMENT_CHANGE_FEATURE +#if ENABLED(FILAMENT_CHANGE_FEATURE) + #define FILAMENT_CHANGE_X_POS 3 // X position of hotend + #define FILAMENT_CHANGE_Y_POS 3 // Y position of hotend + #define FILAMENT_CHANGE_Z_ADD 10 // Z addition of hotend (lift) + #define FILAMENT_CHANGE_XY_FEEDRATE 100 // X and Y axes feedrate in mm/s (also used for delta printers Z axis) + #define FILAMENT_CHANGE_Z_FEEDRATE 5 // Z axis feedrate in mm/s (not used for delta printers) + #define FILAMENT_CHANGE_RETRACT_LENGTH 2 // Initial retract in mm + // It is a short retract used immediately after print interrupt before move to filament exchange position + #define FILAMENT_CHANGE_RETRACT_FEEDRATE 60 // Initial retract feedrate in mm/s + #define FILAMENT_CHANGE_UNLOAD_LENGTH 100 // Unload filament length from hotend in mm + // Longer length for bowden printers to unload filament from whole bowden tube, + // shorter lenght for printers without bowden to unload filament from extruder only, + // 0 to disable unloading for manual unloading + #define FILAMENT_CHANGE_UNLOAD_FEEDRATE 10 // Unload filament feedrate in mm/s - filament unloading can be fast + #define FILAMENT_CHANGE_LOAD_LENGTH 0 // Load filament length over hotend in mm + // Longer length for bowden printers to fast load filament into whole bowden tube over the hotend, + // Short or zero length for printers without bowden where loading is not used + #define FILAMENT_CHANGE_LOAD_FEEDRATE 6 // Load filament feedrate in mm/s - filament loading into the bowden tube can be fast + #define FILAMENT_CHANGE_EXTRUDE_LENGTH 50 // Extrude filament length in mm after filament is load over the hotend, + // 0 to disable for manual extrusion + // Filament can be extruded repeatedly from the filament exchange menu to fill the hotend, + // or until outcoming filament color is not clear for filament color change + #define FILAMENT_CHANGE_EXTRUDE_FEEDRATE 3 // Extrude filament feedrate in mm/s - must be slower than load feedrate + #define FILAMENT_CHANGE_NOZZLE_TIMEOUT 45L // Turn off nozzle if user doesn't change filament within this time limit in seconds + #define FILAMENT_CHANGE_NUMBER_OF_ALERT_BEEPS 5L // Number of alert beeps before printer goes quiet + #define FILAMENT_CHANGE_NO_STEPPER_TIMEOUT // Enable to have stepper motors hold position during filament change + // even if it takes longer than DEFAULT_STEPPER_DEACTIVE_TIME. #endif /******************************************************************************\ diff --git a/Marlin/example_configurations/WITBOX/Configuration_adv.h b/Marlin/example_configurations/WITBOX/Configuration_adv.h index c9cdf560e..b81ccf63b 100644 --- a/Marlin/example_configurations/WITBOX/Configuration_adv.h +++ b/Marlin/example_configurations/WITBOX/Configuration_adv.h @@ -721,12 +721,16 @@ #define FILAMENT_CHANGE_LOAD_LENGTH 0 // Load filament length over hotend in mm // Longer length for bowden printers to fast load filament into whole bowden tube over the hotend, // Short or zero length for printers without bowden where loading is not used - #define FILAMENT_CHANGE_LOAD_FEEDRATE 10 // Load filament feedrate in mm/s - filament loading into the bowden tube can be fast + #define FILAMENT_CHANGE_LOAD_FEEDRATE 6 // Load filament feedrate in mm/s - filament loading into the bowden tube can be fast #define FILAMENT_CHANGE_EXTRUDE_LENGTH 50 // Extrude filament length in mm after filament is load over the hotend, // 0 to disable for manual extrusion // Filament can be extruded repeatedly from the filament exchange menu to fill the hotend, // or until outcoming filament color is not clear for filament color change #define FILAMENT_CHANGE_EXTRUDE_FEEDRATE 3 // Extrude filament feedrate in mm/s - must be slower than load feedrate + #define FILAMENT_CHANGE_NOZZLE_TIMEOUT 45L // Turn off nozzle if user doesn't change filament within this time limit in seconds + #define FILAMENT_CHANGE_NUMBER_OF_ALERT_BEEPS 5L // Number of alert beeps before printer goes quiet + #define FILAMENT_CHANGE_NO_STEPPER_TIMEOUT // Enable to have stepper motors hold position during filament change + // even if it takes longer than DEFAULT_STEPPER_DEACTIVE_TIME. #endif /******************************************************************************\ diff --git a/Marlin/example_configurations/delta/generic/Configuration_adv.h b/Marlin/example_configurations/delta/generic/Configuration_adv.h index 668028969..ce06388eb 100644 --- a/Marlin/example_configurations/delta/generic/Configuration_adv.h +++ b/Marlin/example_configurations/delta/generic/Configuration_adv.h @@ -723,12 +723,16 @@ #define FILAMENT_CHANGE_LOAD_LENGTH 0 // Load filament length over hotend in mm // Longer length for bowden printers to fast load filament into whole bowden tube over the hotend, // Short or zero length for printers without bowden where loading is not used - #define FILAMENT_CHANGE_LOAD_FEEDRATE 10 // Load filament feedrate in mm/s - filament loading into the bowden tube can be fast + #define FILAMENT_CHANGE_LOAD_FEEDRATE 6 // Load filament feedrate in mm/s - filament loading into the bowden tube can be fast #define FILAMENT_CHANGE_EXTRUDE_LENGTH 50 // Extrude filament length in mm after filament is load over the hotend, // 0 to disable for manual extrusion // Filament can be extruded repeatedly from the filament exchange menu to fill the hotend, // or until outcoming filament color is not clear for filament color change #define FILAMENT_CHANGE_EXTRUDE_FEEDRATE 3 // Extrude filament feedrate in mm/s - must be slower than load feedrate + #define FILAMENT_CHANGE_NOZZLE_TIMEOUT 45L // Turn off nozzle if user doesn't change filament within this time limit in seconds + #define FILAMENT_CHANGE_NUMBER_OF_ALERT_BEEPS 5L // Number of alert beeps before printer goes quiet + #define FILAMENT_CHANGE_NO_STEPPER_TIMEOUT // Enable to have stepper motors hold position during filament change + // even if it takes longer than DEFAULT_STEPPER_DEACTIVE_TIME. #endif /******************************************************************************\ diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h index 668028969..ce06388eb 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h @@ -723,12 +723,16 @@ #define FILAMENT_CHANGE_LOAD_LENGTH 0 // Load filament length over hotend in mm // Longer length for bowden printers to fast load filament into whole bowden tube over the hotend, // Short or zero length for printers without bowden where loading is not used - #define FILAMENT_CHANGE_LOAD_FEEDRATE 10 // Load filament feedrate in mm/s - filament loading into the bowden tube can be fast + #define FILAMENT_CHANGE_LOAD_FEEDRATE 6 // Load filament feedrate in mm/s - filament loading into the bowden tube can be fast #define FILAMENT_CHANGE_EXTRUDE_LENGTH 50 // Extrude filament length in mm after filament is load over the hotend, // 0 to disable for manual extrusion // Filament can be extruded repeatedly from the filament exchange menu to fill the hotend, // or until outcoming filament color is not clear for filament color change #define FILAMENT_CHANGE_EXTRUDE_FEEDRATE 3 // Extrude filament feedrate in mm/s - must be slower than load feedrate + #define FILAMENT_CHANGE_NOZZLE_TIMEOUT 45L // Turn off nozzle if user doesn't change filament within this time limit in seconds + #define FILAMENT_CHANGE_NUMBER_OF_ALERT_BEEPS 5L // Number of alert beeps before printer goes quiet + #define FILAMENT_CHANGE_NO_STEPPER_TIMEOUT // Enable to have stepper motors hold position during filament change + // even if it takes longer than DEFAULT_STEPPER_DEACTIVE_TIME. #endif /******************************************************************************\ diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h index 7553e02fa..7837c48e3 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h @@ -728,12 +728,16 @@ #define FILAMENT_CHANGE_LOAD_LENGTH 0 // Load filament length over hotend in mm // Longer length for bowden printers to fast load filament into whole bowden tube over the hotend, // Short or zero length for printers without bowden where loading is not used - #define FILAMENT_CHANGE_LOAD_FEEDRATE 10 // Load filament feedrate in mm/s - filament loading into the bowden tube can be fast + #define FILAMENT_CHANGE_LOAD_FEEDRATE 6 // Load filament feedrate in mm/s - filament loading into the bowden tube can be fast #define FILAMENT_CHANGE_EXTRUDE_LENGTH 50 // Extrude filament length in mm after filament is load over the hotend, // 0 to disable for manual extrusion // Filament can be extruded repeatedly from the filament exchange menu to fill the hotend, // or until outcoming filament color is not clear for filament color change #define FILAMENT_CHANGE_EXTRUDE_FEEDRATE 3 // Extrude filament feedrate in mm/s - must be slower than load feedrate + #define FILAMENT_CHANGE_NOZZLE_TIMEOUT 45L // Turn off nozzle if user doesn't change filament within this time limit in seconds + #define FILAMENT_CHANGE_NUMBER_OF_ALERT_BEEPS 5L // Number of alert beeps before printer goes quiet + #define FILAMENT_CHANGE_NO_STEPPER_TIMEOUT // Enable to have stepper motors hold position during filament change + // even if it takes longer than DEFAULT_STEPPER_DEACTIVE_TIME. #endif /******************************************************************************\ diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h index 4ce2bd808..4741dd13e 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h @@ -723,12 +723,16 @@ #define FILAMENT_CHANGE_LOAD_LENGTH 0 // Load filament length over hotend in mm // Longer length for bowden printers to fast load filament into whole bowden tube over the hotend, // Short or zero length for printers without bowden where loading is not used - #define FILAMENT_CHANGE_LOAD_FEEDRATE 10 // Load filament feedrate in mm/s - filament loading into the bowden tube can be fast + #define FILAMENT_CHANGE_LOAD_FEEDRATE 6 // Load filament feedrate in mm/s - filament loading into the bowden tube can be fast #define FILAMENT_CHANGE_EXTRUDE_LENGTH 50 // Extrude filament length in mm after filament is load over the hotend, // 0 to disable for manual extrusion // Filament can be extruded repeatedly from the filament exchange menu to fill the hotend, // or until outcoming filament color is not clear for filament color change #define FILAMENT_CHANGE_EXTRUDE_FEEDRATE 3 // Extrude filament feedrate in mm/s - must be slower than load feedrate + #define FILAMENT_CHANGE_NOZZLE_TIMEOUT 45L // Turn off nozzle if user doesn't change filament within this time limit in seconds + #define FILAMENT_CHANGE_NUMBER_OF_ALERT_BEEPS 5L // Number of alert beeps before printer goes quiet + #define FILAMENT_CHANGE_NO_STEPPER_TIMEOUT // Enable to have stepper motors hold position during filament change + // even if it takes longer than DEFAULT_STEPPER_DEACTIVE_TIME. #endif /******************************************************************************\ diff --git a/Marlin/example_configurations/makibox/Configuration_adv.h b/Marlin/example_configurations/makibox/Configuration_adv.h index 34cc51e9e..26f68db5d 100644 --- a/Marlin/example_configurations/makibox/Configuration_adv.h +++ b/Marlin/example_configurations/makibox/Configuration_adv.h @@ -721,12 +721,16 @@ #define FILAMENT_CHANGE_LOAD_LENGTH 0 // Load filament length over hotend in mm // Longer length for bowden printers to fast load filament into whole bowden tube over the hotend, // Short or zero length for printers without bowden where loading is not used - #define FILAMENT_CHANGE_LOAD_FEEDRATE 10 // Load filament feedrate in mm/s - filament loading into the bowden tube can be fast + #define FILAMENT_CHANGE_LOAD_FEEDRATE 6 // Load filament feedrate in mm/s - filament loading into the bowden tube can be fast #define FILAMENT_CHANGE_EXTRUDE_LENGTH 50 // Extrude filament length in mm after filament is load over the hotend, // 0 to disable for manual extrusion // Filament can be extruded repeatedly from the filament exchange menu to fill the hotend, // or until outcoming filament color is not clear for filament color change #define FILAMENT_CHANGE_EXTRUDE_FEEDRATE 3 // Extrude filament feedrate in mm/s - must be slower than load feedrate + #define FILAMENT_CHANGE_NOZZLE_TIMEOUT 45L // Turn off nozzle if user doesn't change filament within this time limit in seconds + #define FILAMENT_CHANGE_NUMBER_OF_ALERT_BEEPS 5L // Number of alert beeps before printer goes quiet + #define FILAMENT_CHANGE_NO_STEPPER_TIMEOUT // Enable to have stepper motors hold position during filament change + // even if it takes longer than DEFAULT_STEPPER_DEACTIVE_TIME. #endif /******************************************************************************\ diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h b/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h index 8f9df52d3..70a6a76bc 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h @@ -721,12 +721,16 @@ #define FILAMENT_CHANGE_LOAD_LENGTH 0 // Load filament length over hotend in mm // Longer length for bowden printers to fast load filament into whole bowden tube over the hotend, // Short or zero length for printers without bowden where loading is not used - #define FILAMENT_CHANGE_LOAD_FEEDRATE 10 // Load filament feedrate in mm/s - filament loading into the bowden tube can be fast + #define FILAMENT_CHANGE_LOAD_FEEDRATE 6 // Load filament feedrate in mm/s - filament loading into the bowden tube can be fast #define FILAMENT_CHANGE_EXTRUDE_LENGTH 50 // Extrude filament length in mm after filament is load over the hotend, // 0 to disable for manual extrusion // Filament can be extruded repeatedly from the filament exchange menu to fill the hotend, // or until outcoming filament color is not clear for filament color change #define FILAMENT_CHANGE_EXTRUDE_FEEDRATE 3 // Extrude filament feedrate in mm/s - must be slower than load feedrate + #define FILAMENT_CHANGE_NOZZLE_TIMEOUT 45L // Turn off nozzle if user doesn't change filament within this time limit in seconds + #define FILAMENT_CHANGE_NUMBER_OF_ALERT_BEEPS 5L // Number of alert beeps before printer goes quiet + #define FILAMENT_CHANGE_NO_STEPPER_TIMEOUT // Enable to have stepper motors hold position during filament change + // even if it takes longer than DEFAULT_STEPPER_DEACTIVE_TIME. #endif /******************************************************************************\ From d9dcef8a874f2cce6740d515527126533239b840 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 10 Feb 2017 00:13:58 -0600 Subject: [PATCH 3/6] Spacing, coding standards --- Marlin/Configuration_adv.h | 6 +-- Marlin/Marlin_main.cpp | 76 ++++++++++++++++------------------ Marlin/ultralcd.cpp | 23 ++++------ Marlin/ultralcd_impl_DOGM.h | 6 +-- Marlin/ultralcd_impl_HD44780.h | 2 +- 5 files changed, 51 insertions(+), 62 deletions(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 36b238716..1f7ab4890 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -728,9 +728,9 @@ // or until outcoming filament color is not clear for filament color change #define FILAMENT_CHANGE_EXTRUDE_FEEDRATE 3 // Extrude filament feedrate in mm/s - must be slower than load feedrate #define FILAMENT_CHANGE_NOZZLE_TIMEOUT 45L // Turn off nozzle if user doesn't change filament within this time limit in seconds - #define FILAMENT_CHANGE_NUMBER_OF_ALERT_BEEPS 5L // Number of alert beeps before printer goes quiet - #define STEPPER_MOTORS_DONT_TIMEOUT_DURING_FILAMENT_CHANGE // Enable to make stepper motors hold position during filament change even if it - // takes longer than DEFAULT_STEPPER_DEACTIVE_TIME + #define FILAMENT_CHANGE_NUMBER_OF_ALERT_BEEPS 5L // Number of alert beeps before printer goes quiet + #define FILAMENT_CHANGE_NO_STEPPER_TIMEOUT // Enable to have stepper motors hold position during filament change + // even if it takes longer than DEFAULT_STEPPER_DEACTIVE_TIME. #endif /******************************************************************************\ diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 2b72b1dc5..3a93bc63e 100755 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -7310,7 +7310,7 @@ inline void gcode_M503() { } } - bool busy_doing_M600 = false; + static bool busy_doing_M600 = false; /** * M600: Pause for filament change @@ -7351,8 +7351,6 @@ inline void gcode_M503() { #define RUNPLAN(RATE_MM_S) line_to_destination(RATE_MM_S); #endif - KEEPALIVE_STATE(IN_HANDLER); - // Initial retract before move to filament change position if (code_seen('E')) destination[E_AXIS] += code_value_axis_units(E_AXIS); #if defined(FILAMENT_CHANGE_RETRACT_LENGTH) && FILAMENT_CHANGE_RETRACT_LENGTH > 0 @@ -7409,10 +7407,9 @@ inline void gcode_M503() { disable_e3(); delay(100); - millis_t nozzle_timeout = millis() + FILAMENT_CHANGE_NOZZLE_TIMEOUT*1000L; + millis_t nozzle_timeout = millis() + FILAMENT_CHANGE_NOZZLE_TIMEOUT * 1000L; bool nozzle_timed_out = false; float temps[4]; - int iii; // Wait for filament insert by user and press button lcd_filament_change_show_message(FILAMENT_CHANGE_MESSAGE_INSERT); @@ -7422,62 +7419,62 @@ inline void gcode_M503() { wait_for_user = true; // LCD click or M108 will clear this next_buzz = 0; runout_beep = 0; - for( iii=0; iii= nozzle_timeout) { - if (nozzle_timed_out == false ) { - nozzle_timed_out = true; // if the nozzle time out happens, remember we turned off the nozzles. - for( iii=0; iii 3 ) { - lcd_filament_change_show_message(FILAMENT_CHANGE_MESSAGE_WAIT_FOR_NOZZLES_TO_HEAT); - goto KEEP_CHECKING_TEMPS; + // Show "wait for heating" + lcd_filament_change_show_message(FILAMENT_CHANGE_MESSAGE_WAIT_FOR_NOZZLES_TO_HEAT); + + wait_for_heatup = true; + while (wait_for_heatup) { + idle(); + wait_for_heatup = false; + HOTEND_LOOP() { + if (abs(thermalManager.degHotend(e) - temps[e]) > 3) { + wait_for_heatup = true; + break; + } } } + // Show "insert filament" + if (nozzle_timed_out) + lcd_filament_change_show_message(FILAMENT_CHANGE_MESSAGE_INSERT); + wait_for_user = true; // LCD click or M108 will clear this next_buzz = 0; runout_beep = 0; - while (wait_for_user) { - if (nozzle_timed_out == true) - lcd_filament_change_show_message(FILAMENT_CHANGE_MESSAGE_INSERT); - else break; + while (wait_for_user && nozzle_timed_out) { #if HAS_BUZZER filament_change_beep(); #endif idle(true); } - // Show load message + // Show "load" message lcd_filament_change_show_message(FILAMENT_CHANGE_MESSAGE_LOAD); - idle(); - // Load filament if (code_seen('L')) destination[E_AXIS] -= code_value_axis_units(E_AXIS); #if defined(FILAMENT_CHANGE_LOAD_LENGTH) && FILAMENT_CHANGE_LOAD_LENGTH > 0 @@ -7504,8 +7501,6 @@ KEEP_CHECKING_TEMPS: lcd_filament_change_show_message(FILAMENT_CHANGE_MESSAGE_RESUME); - KEEPALIVE_STATE(IN_HANDLER); - // Set extruder to saved position destination[E_AXIS] = current_position[E_AXIS] = lastpos[E_AXIS]; planner.set_e_position_mm(current_position[E_AXIS]); @@ -10144,14 +10139,15 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) { millis_t ms = millis(); if (max_inactive_time && ELAPSED(ms, previous_cmd_ms + max_inactive_time)) kill(PSTR(MSG_KILLED)); - - #if ENABLED(FILAMENT_CHANGE_FEATURE) - #ifdef STEPPER_MOTORS_DONT_TIMEOUT_DURING_FILAMENT_CHANGE - if (busy_doing_M600 == false ) // We only allow the stepper motors to time out if - #endif // we are not in the middle of an M600 command. + + // Prevent steppers timing-out in the middle of M600 + #if ENABLED(FILAMENT_CHANGE_FEATURE) && ENABLED(FILAMENT_CHANGE_NO_STEPPER_TIMEOUT) + #define M600_TEST !busy_doing_M600 + #else + #define M600_TEST true #endif - if (stepper_inactive_time && ELAPSED(ms, previous_cmd_ms + stepper_inactive_time) + if (M600_TEST && stepper_inactive_time && ELAPSED(ms, previous_cmd_ms + stepper_inactive_time) && !ignore_stepper_queue && !planner.blocks_queued()) { #if ENABLED(DISABLE_INACTIVE_X) disable_x(); diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index 0dd0a59d5..b28880f61 100755 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -950,7 +950,7 @@ void kill_screen(const char* lcd_msg) { // Change filament // #if ENABLED(FILAMENT_CHANGE_FEATURE) - if (!thermalManager.tooColdToExtrude(active_extruder)) + if (!thermalManager.tooColdToExtrude(active_extruder)) MENU_ITEM(function, MSG_FILAMENTCHANGE, lcd_enqueue_filament_change); #endif @@ -2446,19 +2446,19 @@ KeepDrawing: } #endif // LCD_INFO_MENU - /** - * - * Filament Change Feature Screens - * - */ + /** + * + * Filament Change Feature Screens + * + */ #if ENABLED(FILAMENT_CHANGE_FEATURE) void lcd_filament_change_toocold_menu() { START_MENU(); STATIC_ITEM(MSG_HEATING_FAILED_LCD, true, true); - STATIC_ITEM (MSG_FILAMENT_CHANGE_MINTEMP STRINGIFY(EXTRUDE_MINTEMP) ".", false, false); + STATIC_ITEM(MSG_FILAMENT_CHANGE_MINTEMP STRINGIFY(EXTRUDE_MINTEMP) ".", false, false); MENU_BACK(MSG_BACK); - STATIC_ITEM (" "); + STATIC_ITEM(" "); STATIC_ITEM(MSG_FILAMENT_CHANGE_NOZZLE, false, true); lcd_implementation_hotend_status(); END_MENU(); @@ -2604,31 +2604,24 @@ KeepDrawing: switch (message) { case FILAMENT_CHANGE_MESSAGE_INIT: defer_return_to_status = true; - lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT; lcd_goto_screen(lcd_filament_change_init_message); break; case FILAMENT_CHANGE_MESSAGE_UNLOAD: - lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT; lcd_goto_screen(lcd_filament_change_unload_message); break; case FILAMENT_CHANGE_MESSAGE_INSERT: - lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT; lcd_goto_screen(lcd_filament_change_insert_message); break; case FILAMENT_CHANGE_MESSAGE_LOAD: - lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT; lcd_goto_screen(lcd_filament_change_load_message); break; case FILAMENT_CHANGE_MESSAGE_EXTRUDE: - lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT; lcd_goto_screen(lcd_filament_change_extrude_message); break; case FILAMENT_CHANGE_MESSAGE_CLICK_TO_HEAT_NOZZLE: - lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT; lcd_goto_screen(lcd_filament_change_heat_nozzle); break; case FILAMENT_CHANGE_MESSAGE_WAIT_FOR_NOZZLES_TO_HEAT: - lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT; lcd_goto_screen(lcd_filament_change_wait_for_nozzles_to_heat); break; case FILAMENT_CHANGE_MESSAGE_OPTION: diff --git a/Marlin/ultralcd_impl_DOGM.h b/Marlin/ultralcd_impl_DOGM.h index cc1b709e8..d5799b22e 100644 --- a/Marlin/ultralcd_impl_DOGM.h +++ b/Marlin/ultralcd_impl_DOGM.h @@ -382,9 +382,9 @@ FORCE_INLINE void _draw_axis_label(const AxisEnum axis, const char* const pstr, static void lcd_implementation_hotend_status() { u8g.setPrintPos(58, 60); - lcd_print( (char) '0'+active_extruder ); - lcd_print( ' ' ); - lcd_print( ' ' ); + lcd_print((char)('0' + active_extruder)); + lcd_print(' '); + lcd_print(' '); lcd_print(itostr3(thermalManager.degHotend(active_extruder))); lcd_print('/'); lcd_print(itostr3(thermalManager.degTargetHotend(active_extruder))); diff --git a/Marlin/ultralcd_impl_HD44780.h b/Marlin/ultralcd_impl_HD44780.h index f4fa4795d..786a0afdd 100644 --- a/Marlin/ultralcd_impl_HD44780.h +++ b/Marlin/ultralcd_impl_HD44780.h @@ -593,7 +593,7 @@ FORCE_INLINE void _draw_axis_label(const AxisEnum axis, const char* const pstr, #endif // LCD_PROGRESS_BAR static void lcd_implementation_hotend_status() { - lcd.setCursor(10,3); + lcd.setCursor(10, 3); lcd.print(LCD_STR_THERMOMETER[active_extruder]); lcd.print(itostr3(thermalManager.degHotend(active_extruder))); lcd.print('/'); From 8289ea1316853189a15e07129a08f500aa36405b Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 10 Feb 2017 00:30:12 -0600 Subject: [PATCH 4/6] Use a short name for the filament "endstop" --- Marlin/language.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/language.h b/Marlin/language.h index 914d1dd6b..da2be2587 100644 --- a/Marlin/language.h +++ b/Marlin/language.h @@ -152,7 +152,7 @@ #define MSG_Z2_MIN "z2_min: " #define MSG_Z2_MAX "z2_max: " #define MSG_Z_PROBE "z_probe: " -#define MSG_FILAMENT_RUNOUT_SENSOR "filament_Runout_Sensor: " +#define MSG_FILAMENT_RUNOUT_SENSOR "filament: " #define MSG_ERR_MATERIAL_INDEX "M145 S out of range (0-1)" #define MSG_ERR_M355_NONE "No case light" #define MSG_ERR_M421_PARAMETERS "M421 required parameters missing" From bfe6f71794875f7401e7f2d341279fed14eb8c76 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 10 Feb 2017 00:30:33 -0600 Subject: [PATCH 5/6] Simplify filament_change_beep function --- Marlin/Marlin_main.cpp | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 3a93bc63e..885e07c53 100755 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -7294,18 +7294,12 @@ inline void gcode_M503() { unsigned long int runout_beep = 0; void filament_change_beep() { - millis_t ms = millis(); - if (ms >= next_buzz) { - if (runout_beep <= FILAMENT_CHANGE_NUMBER_OF_ALERT_BEEPS ) { // Only beep as long as we are supposed to! - BUZZ(300, 2000); - next_buzz = ms + 2500; // Beep every 2.5s while waiting - runout_beep++; - } - else if (runout_beep > FILAMENT_CHANGE_NUMBER_OF_ALERT_BEEPS && - runout_beep <= (FILAMENT_CHANGE_NUMBER_OF_ALERT_BEEPS + 5)) { // End with a burst of short beeps - BUZZ(200, 2000); - next_buzz = ms + 400; // Beep - runout_beep++; + const millis_t ms = millis(); + if (ELAPSED(ms, next_buzz)) { + if (runout_beep <= FILAMENT_CHANGE_NUMBER_OF_ALERT_BEEPS + 5) { // Only beep as long as we're supposed to + next_buzz = ms + (runout_beep <= FILAMENT_CHANGE_NUMBER_OF_ALERT_BEEPS ? 2500 : 400); + BUZZ(300, 2000); + runout_beep++; } } } From 4578c573fefae108c32d5e4d76c5e36b66bedf42 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 15 Feb 2017 01:01:00 -0600 Subject: [PATCH 6/6] Pause the print job timer while in M600 --- Marlin/Marlin_main.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 885e07c53..dec556ad6 100755 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -7328,6 +7328,10 @@ inline void gcode_M503() { busy_doing_M600 = true; // Stepper Motors can't timeout when this is set + // Pause the print job timer + bool job_running = print_job_timer.isRunning(); + print_job_timer.pause(); + // Show initial message and wait for synchronize steppers lcd_filament_change_show_message(FILAMENT_CHANGE_MESSAGE_INIT); stepper.synchronize(); @@ -7518,6 +7522,10 @@ inline void gcode_M503() { // Show status screen lcd_filament_change_show_message(FILAMENT_CHANGE_MESSAGE_STATUS); + + // Resume the print job timer if it was running + if (job_running) print_job_timer.start(); + busy_doing_M600 = false; // Allow Stepper Motors to be turned off during inactivity }