Bläddra i källkod

Merge pull request #400 from PavelSindler/M600_update

M600 update
XPila 6 år sedan
förälder
incheckning
87ffb0b193

+ 2 - 0
Firmware/Configuration_prusa.h

@@ -552,6 +552,8 @@ const bool Z_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic o
 
 #define HEATBED_V2
 
+#define M600_TIMEOUT 600  //seconds
+
 //#define SUPPORT_VERBOSITY
 
 #endif //__CONFIGURATION_PRUSA_H

+ 74 - 9
Firmware/Marlin_main.cpp

@@ -5461,6 +5461,8 @@ case 404:  //M404 Enter the nominal filament width (3mm, 1.75mm ) N<3.0> or disp
         feedmultiplyBckp=feedmultiply;
         int8_t TooLowZ = 0;
 
+		float HotendTempBckp = degTargetHotend(active_extruder);
+		int fanSpeedBckp = fanSpeed;
         target[X_AXIS]=current_position[X_AXIS];
         target[Y_AXIS]=current_position[Y_AXIS];
         target[Z_AXIS]=current_position[Z_AXIS];
@@ -5530,11 +5532,14 @@ case 404:  //M404 Enter the nominal filament width (3mm, 1.75mm ) N<3.0> or disp
 		KEEPALIVE_STATE(PAUSED_FOR_USER);
 
 		uint8_t cnt = 0;
-		int counterBeep = 0;
+		int counterBeep = 0;	
+		fanSpeed = 0;
+		unsigned long waiting_start_time = millis();
+		uint8_t wait_for_user_state = 0;
 		lcd_display_message_fullscreen_P(MSG_PRESS_TO_UNLOAD);
-		while (!lcd_clicked()) {
+		while (!(wait_for_user_state == 0 && lcd_clicked())){
 
-			cnt++;
+			//cnt++;
 			manage_heater();
 			manage_inactivity(true);
 
@@ -5544,7 +5549,7 @@ case 404:  //M404 Enter the nominal filament width (3mm, 1.75mm ) N<3.0> or disp
 
 			#endif // SNMM*/
 
-			if (cnt == 0)
+			//if (cnt == 0)
 			{
 #if BEEPER > 0
 				if (counterBeep == 500) {
@@ -5557,6 +5562,7 @@ case 404:  //M404 Enter the nominal filament width (3mm, 1.75mm ) N<3.0> or disp
 				if (counterBeep == 20) {
 					WRITE(BEEPER, LOW);
 				}
+				
 				counterBeep++;
 #else
 #if !defined(LCD_FEEDBACK_FREQUENCY_HZ) || !defined(LCD_FEEDBACK_FREQUENCY_DURATION_MS)
@@ -5566,18 +5572,61 @@ case 404:  //M404 Enter the nominal filament width (3mm, 1.75mm ) N<3.0> or disp
 #endif
 #endif
 			}
+			
+			switch (wait_for_user_state) {
+			case 0: 
+				delay_keep_alive(4);
+
+				if (millis() > waiting_start_time + M600_TIMEOUT * 1000) {
+					lcd_display_message_fullscreen_P(MSG_PRESS_TO_PREHEAT);
+					wait_for_user_state = 1;
+					setTargetHotend(0, 0);
+					setTargetHotend(0, 1);
+					setTargetHotend(0, 2);
+					st_synchronize();
+					disable_e0();
+					disable_e1();
+					disable_e2();
+				}
+				break;
+			case 1:
+				delay_keep_alive(4);
+		
+				if (lcd_clicked()) {
+					setTargetHotend(HotendTempBckp, active_extruder);
+					lcd_wait_for_heater();
+
+					wait_for_user_state = 2;
+				}
+				break;
+			case 2:
+
+				if (abs(degTargetHotend(active_extruder) - degHotend(active_extruder)) < 1) {
+					lcd_display_message_fullscreen_P(MSG_PRESS_TO_UNLOAD);
+					waiting_start_time = millis();
+					wait_for_user_state = 0;
+				}
+				else {
+					counterBeep = 20; //beeper will be inactive during waiting for nozzle preheat
+					lcd.setCursor(1, 4);
+					lcd.print(ftostr3(degHotend(active_extruder)));
+				}
+				break;
+
+			}
 
 		}
 		WRITE(BEEPER, LOW);
 		
 		lcd_change_fil_state = 0;
-		while (lcd_change_fil_state == 0) {
+		
+
+		// Unload filament
 			lcd_display_message_fullscreen_P(MSG_UNLOADING_FILAMENT);
 			KEEPALIVE_STATE(IN_HANDLER);
 			custom_message = true;
 			lcd_setstatuspgm(MSG_UNLOADING_FILAMENT);
 
-			// Unload filament
 			if (code_seen('L'))
 			{
 				target[E_AXIS] += code_value();
@@ -5629,16 +5678,31 @@ case 404:  //M404 Enter the nominal filament width (3mm, 1.75mm ) N<3.0> or disp
 
 			//finish moves
 			st_synchronize();
+
+			lcd_display_message_fullscreen_P(MSG_PULL_OUT_FILAMENT);
+			
 			//disable extruder steppers so filament can be removed
 			disable_e0();
 			disable_e1();
 			disable_e2();
 			delay(100);
+			 
+			
+			WRITE(BEEPER, HIGH);
+			counterBeep = 0;
+			while(!lcd_clicked() && (counterBeep < 50)) {
+				if(counterBeep > 5) WRITE(BEEPER, LOW);
+				delay_keep_alive(100);
+				counterBeep++;
+			}
+			WRITE(BEEPER, LOW);
+
 			KEEPALIVE_STATE(PAUSED_FOR_USER);
-			lcd_change_fil_state = !lcd_show_fullscreen_message_yes_no_and_wait_P(MSG_UNLOAD_SUCCESSFULL, false, false);
+			lcd_change_fil_state = lcd_show_fullscreen_message_yes_no_and_wait_P(MSG_UNLOAD_SUCCESSFULL, false, true);
+			if (lcd_change_fil_state == 0) lcd_show_fullscreen_message_and_wait_P(MSG_CHECK_IDLER);
 			//lcd_return_to_status();
 			lcd_update_enable(true);
-		}
+		
         //Wait for user to insert filament
         lcd_wait_interact();
 		//load_filament_time = millis();
@@ -5772,6 +5836,7 @@ case 404:  //M404 Enter the nominal filament width (3mm, 1.75mm ) N<3.0> or disp
         
 
       //Not let's go back to print
+		fanSpeed = fanSpeedBckp;
 
       //Feed a little of filament to stabilize pressure
       target[E_AXIS]+= FILAMENTCHANGE_RECFEED;
@@ -6024,7 +6089,7 @@ case 404:  //M404 Enter the nominal filament width (3mm, 1.75mm ) N<3.0> or disp
         st_synchronize();
         current_position[E_AXIS] -= 20;
         plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], 5000 / 60, active_extruder);
-		st_synchronize();
+		st_synchronize();		
 		lcd_setstatuspgm(WELCOME_MSG);
 		custom_message = false;
 		custom_message_type = 0;

+ 23 - 2
Firmware/language_all.cpp

@@ -341,6 +341,13 @@ const char * const MSG_CHANGING_FILAMENT_LANG_TABLE[LANG_NUM] PROGMEM = {
 	MSG_CHANGING_FILAMENT_CZ
 };
 
+const char MSG_CHECK_IDLER_EN[] PROGMEM = "Please open idler and remove filament manually.";
+const char MSG_CHECK_IDLER_CZ[] PROGMEM = "Prosim otevrete idler a manualne odstrante filament.";
+const char * const MSG_CHECK_IDLER_LANG_TABLE[LANG_NUM] PROGMEM = {
+	MSG_CHECK_IDLER_EN,
+	MSG_CHECK_IDLER_CZ
+};
+
 const char MSG_CHOOSE_EXTRUDER_EN[] PROGMEM = "Choose extruder:";
 const char MSG_CHOOSE_EXTRUDER_CZ[] PROGMEM = "Vyberte extruder:";
 const char * const MSG_CHOOSE_EXTRUDER_LANG_TABLE[LANG_NUM] PROGMEM = {
@@ -1444,6 +1451,13 @@ const char * const MSG_PRESS_LANG_TABLE[LANG_NUM] PROGMEM = {
 	MSG_PRESS_CZ
 };
 
+const char MSG_PRESS_TO_PREHEAT_EN[] PROGMEM = "Press knob to preheat nozzle and continue.";
+const char MSG_PRESS_TO_PREHEAT_CZ[] PROGMEM = "Pro nahrati trysky a pokracovani stisknete tlacitko.";
+const char * const MSG_PRESS_TO_PREHEAT_LANG_TABLE[LANG_NUM] PROGMEM = {
+	MSG_PRESS_TO_PREHEAT_EN,
+	MSG_PRESS_TO_PREHEAT_CZ
+};
+
 const char MSG_PRESS_TO_UNLOAD_EN[] PROGMEM = "Please press the knob to unload filament";
 const char MSG_PRESS_TO_UNLOAD_CZ[] PROGMEM = "Pro vysunuti filamentu stisknete prosim tlacitko";
 const char * const MSG_PRESS_TO_UNLOAD_LANG_TABLE[LANG_NUM] PROGMEM = {
@@ -1491,6 +1505,13 @@ const char * const MSG_PRUSA3D_HOWTO_LANG_TABLE[LANG_NUM] PROGMEM = {
 	MSG_PRUSA3D_HOWTO_CZ
 };
 
+const char MSG_PULL_OUT_FILAMENT_EN[] PROGMEM = "Please pull out filament immediately";
+const char MSG_PULL_OUT_FILAMENT_CZ[] PROGMEM = "Prosim vyjmete urychlene filament";
+const char * const MSG_PULL_OUT_FILAMENT_LANG_TABLE[LANG_NUM] PROGMEM = {
+	MSG_PULL_OUT_FILAMENT_EN,
+	MSG_PULL_OUT_FILAMENT_CZ
+};
+
 const char MSG_REBOOT_EN[] PROGMEM = "Reboot the printer";
 const char MSG_REBOOT_CZ[] PROGMEM = "Restartujte tiskarnu";
 const char * const MSG_REBOOT_LANG_TABLE[LANG_NUM] PROGMEM = {
@@ -2207,8 +2228,8 @@ const char * const MSG_UNLOAD_FILAMENT_4_LANG_TABLE[LANG_NUM] PROGMEM = {
 	MSG_UNLOAD_FILAMENT_4_CZ
 };
 
-const char MSG_UNLOAD_SUCCESSFULL_EN[] PROGMEM = "Repeat unloading filament?";
-const char MSG_UNLOAD_SUCCESSFULL_CZ[] PROGMEM = "Opakovat vysunuti filamentu?";
+const char MSG_UNLOAD_SUCCESSFULL_EN[] PROGMEM = "Was filament successfully unloaded?";
+const char MSG_UNLOAD_SUCCESSFULL_CZ[] PROGMEM = "Bylo vysunuti filamentu uspesne?";
 const char * const MSG_UNLOAD_SUCCESSFULL_LANG_TABLE[LANG_NUM] PROGMEM = {
 	MSG_UNLOAD_SUCCESSFULL_EN,
 	MSG_UNLOAD_SUCCESSFULL_CZ

+ 6 - 0
Firmware/language_all.h

@@ -126,6 +126,8 @@ extern const char* const MSG_CHANGE_SUCCESS_LANG_TABLE[LANG_NUM];
 #define MSG_CHANGE_SUCCESS LANG_TABLE_SELECT(MSG_CHANGE_SUCCESS_LANG_TABLE)
 extern const char* const MSG_CHANGING_FILAMENT_LANG_TABLE[LANG_NUM];
 #define MSG_CHANGING_FILAMENT LANG_TABLE_SELECT(MSG_CHANGING_FILAMENT_LANG_TABLE)
+extern const char* const MSG_CHECK_IDLER_LANG_TABLE[LANG_NUM];
+#define MSG_CHECK_IDLER LANG_TABLE_SELECT(MSG_CHECK_IDLER_LANG_TABLE)
 extern const char* const MSG_CHOOSE_EXTRUDER_LANG_TABLE[LANG_NUM];
 #define MSG_CHOOSE_EXTRUDER LANG_TABLE_SELECT(MSG_CHOOSE_EXTRUDER_LANG_TABLE)
 extern const char* const MSG_CLEAN_NOZZLE_E_LANG_TABLE[LANG_NUM];
@@ -482,6 +484,8 @@ extern const char* const MSG_PREPARE_FILAMENT_LANG_TABLE[LANG_NUM];
 #define MSG_PREPARE_FILAMENT LANG_TABLE_SELECT(MSG_PREPARE_FILAMENT_LANG_TABLE)
 extern const char* const MSG_PRESS_LANG_TABLE[LANG_NUM];
 #define MSG_PRESS LANG_TABLE_SELECT(MSG_PRESS_LANG_TABLE)
+extern const char* const MSG_PRESS_TO_PREHEAT_LANG_TABLE[LANG_NUM];
+#define MSG_PRESS_TO_PREHEAT LANG_TABLE_SELECT(MSG_PRESS_TO_PREHEAT_LANG_TABLE)
 extern const char* const MSG_PRESS_TO_UNLOAD_LANG_TABLE[LANG_NUM];
 #define MSG_PRESS_TO_UNLOAD LANG_TABLE_SELECT(MSG_PRESS_TO_UNLOAD_LANG_TABLE)
 extern const char* const MSG_PRINTER_DISCONNECTED_LANG_TABLE[1];
@@ -496,6 +500,8 @@ extern const char* const MSG_PRUSA3D_FORUM_LANG_TABLE[LANG_NUM];
 #define MSG_PRUSA3D_FORUM LANG_TABLE_SELECT(MSG_PRUSA3D_FORUM_LANG_TABLE)
 extern const char* const MSG_PRUSA3D_HOWTO_LANG_TABLE[LANG_NUM];
 #define MSG_PRUSA3D_HOWTO LANG_TABLE_SELECT(MSG_PRUSA3D_HOWTO_LANG_TABLE)
+extern const char* const MSG_PULL_OUT_FILAMENT_LANG_TABLE[LANG_NUM];
+#define MSG_PULL_OUT_FILAMENT LANG_TABLE_SELECT(MSG_PULL_OUT_FILAMENT_LANG_TABLE)
 extern const char* const MSG_REBOOT_LANG_TABLE[LANG_NUM];
 #define MSG_REBOOT LANG_TABLE_SELECT(MSG_REBOOT_LANG_TABLE)
 extern const char* const MSG_RECOVERING_PRINT_LANG_TABLE[LANG_NUM];

+ 4 - 1
Firmware/language_cz.h

@@ -369,7 +369,10 @@ ve
 #define MSG_PLACE_STEEL_SHEET				"Umistete prosim tiskovy plat na heatbed"
 #define MSG_RECOVER_PRINT					"Detekovan vypadek proudu.Obnovit tisk?"
 #define MSG_PRESS_TO_UNLOAD					"Pro vysunuti filamentu stisknete prosim tlacitko"	
-#define MSG_UNLOAD_SUCCESSFULL				"Opakovat vysunuti filamentu?"
+#define MSG_UNLOAD_SUCCESSFULL				"Bylo vysunuti filamentu uspesne?"
+#define MSG_PRESS_TO_PREHEAT				"Pro nahrati trysky a pokracovani stisknete tlacitko."
+#define MSG_PULL_OUT_FILAMENT				"Prosim vyjmete urychlene filament"
+#define MSG_CHECK_IDLER						"Prosim otevrete idler a manualne odstrante filament."
 #define MSG_FILE_INCOMPLETE					"Soubor nekompletni. Pokracovat?"
 #define MSG_FILE_CNT						"Nektere soubory nebudou setrideny. Maximalni pocet souboru pro setrideni je 100."
 #define MSG_SORT_TIME						"Trideni     [Cas]"

+ 4 - 1
Firmware/language_en.h

@@ -385,7 +385,10 @@
 #define(length=17, lines=1) MSG_FSENS_AUTOLOAD_OFF				"F. autoload [off]"
 #define(length=17, lines=1) MSG_FSENS_AUTOLOAD_NA                "F. autoload [N/A]"
 #define(length=20, lines=4) MSG_PRESS_TO_UNLOAD					"Please press the knob to unload filament"
-#define(length=20, lines=2) MSG_UNLOAD_SUCCESSFULL				"Repeat unloading filament?"
+#define(length=20, lines=4) MSG_PRESS_TO_PREHEAT				"Press knob to preheat nozzle and continue."
+#define(length=20, lines=2) MSG_UNLOAD_SUCCESSFULL				"Was filament successfully unloaded?"
+#define(length=20, lines=4) MSG_CHECK_IDLER						"Please open idler and remove filament manually."
+#define(length=20, lines=4) MSG_PULL_OUT_FILAMENT				"Please pull out filament immediately"
 #define(length=20, lines=2) MSG_FILE_INCOMPLETE					"File incomplete. Continue anyway?"
 
 #define(length=20, lines=4) MSG_DEFAULT_SETTINGS_LOADED			"Default settings loaded"

+ 11 - 0
Firmware/ultralcd.cpp

@@ -2458,6 +2458,17 @@ void lcd_adjust_z() {
 
 }
 
+void lcd_wait_for_heater() {
+	lcd_display_message_fullscreen_P(MSG_WIZARD_HEATING);
+
+		lcd.setCursor(0, 4);
+		lcd.print(LCD_STR_THERMOMETER[0]);
+		lcd.print(ftostr3(degHotend(active_extruder)));
+		lcd.print("/");
+		lcd.print(ftostr3(degTargetHotend(active_extruder)));
+		lcd.print(LCD_STR_DEGREE);
+}
+
 void lcd_wait_for_cool_down() {
 	lcd_set_custom_characters_degree();
 	setTargetHotend(0,0);

+ 1 - 0
Firmware/ultralcd.h

@@ -258,6 +258,7 @@ void lcd_farm_sdcard_menu();
 void lcd_farm_sdcard_menu_w();
 //void get_description();
 
+void lcd_wait_for_heater();
 void lcd_wait_for_cool_down();
 void adjust_bed_reset();
 void lcd_extr_cal_reset();