Browse Source

M600 fixes

Thomas Moore 7 years ago
parent
commit
3d24c329af
2 changed files with 65 additions and 28 deletions
  1. 55
    23
      Marlin/Marlin_main.cpp
  2. 10
    5
      Marlin/ultralcd.cpp

+ 55
- 23
Marlin/Marlin_main.cpp View File

5866
       idle();
5866
       idle();
5867
       heaters_heating = false;
5867
       heaters_heating = false;
5868
       HOTEND_LOOP() {
5868
       HOTEND_LOOP() {
5869
-        if (thermalManager.degTargetHotend(e) && abs(thermalManager.degHotend(e) - thermalManager.degTargetHotend(e)) > 3) {
5869
+        if (thermalManager.degTargetHotend(e) && abs(thermalManager.degHotend(e) - thermalManager.degTargetHotend(e)) > TEMP_HYSTERESIS) {
5870
           heaters_heating = true;
5870
           heaters_heating = true;
5871
           #if ENABLED(ULTIPANEL)
5871
           #if ENABLED(ULTIPANEL)
5872
             lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_WAIT_FOR_NOZZLES_TO_HEAT);
5872
             lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_WAIT_FOR_NOZZLES_TO_HEAT);
5882
   ) {
5882
   ) {
5883
     if (move_away_flag) return false; // already paused
5883
     if (move_away_flag) return false; // already paused
5884
 
5884
 
5885
-    if (!DEBUGGING(DRYRUN) && unload_length != 0) {
5885
+    if (!DEBUGGING(DRYRUN) && (unload_length != 0 || retract != 0)) {
5886
       #if ENABLED(PREVENT_COLD_EXTRUSION)
5886
       #if ENABLED(PREVENT_COLD_EXTRUSION)
5887
         if (!thermalManager.allow_cold_extrude &&
5887
         if (!thermalManager.allow_cold_extrude &&
5888
             thermalManager.degTargetHotend(active_extruder) < thermalManager.extrude_min_temp) {
5888
             thermalManager.degTargetHotend(active_extruder) < thermalManager.extrude_min_temp) {
5919
     COPY(resume_position, current_position);
5919
     COPY(resume_position, current_position);
5920
     set_destination_to_current();
5920
     set_destination_to_current();
5921
 
5921
 
5922
-    // Initial retract before move to filament change position
5923
-    destination[E_AXIS] += retract;
5924
-
5925
-    RUNPLAN(PAUSE_PARK_RETRACT_FEEDRATE);
5922
+    if (retract) {
5923
+      // Initial retract before move to filament change position
5924
+      destination[E_AXIS] += retract;
5925
+      RUNPLAN(PAUSE_PARK_RETRACT_FEEDRATE);
5926
+    }
5926
 
5927
 
5927
     // Lift Z axis
5928
     // Lift Z axis
5928
     if (z_lift > 0) {
5929
     if (z_lift > 0) {
5951
       destination[E_AXIS] += unload_length;
5952
       destination[E_AXIS] += unload_length;
5952
       RUNPLAN(FILAMENT_CHANGE_UNLOAD_FEEDRATE);
5953
       RUNPLAN(FILAMENT_CHANGE_UNLOAD_FEEDRATE);
5953
       stepper.synchronize();
5954
       stepper.synchronize();
5955
+    }
5954
 
5956
 
5955
-      if (show_lcd) {
5956
-        #if ENABLED(ULTIPANEL)
5957
-          lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_INSERT);
5958
-        #endif
5959
-      }
5960
-
5961
-      #if HAS_BUZZER
5962
-        filament_change_beep(max_beep_count, true);
5957
+    if (show_lcd) {
5958
+      #if ENABLED(ULTIPANEL)
5959
+        lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_INSERT);
5963
       #endif
5960
       #endif
5964
-
5965
-      idle();
5966
     }
5961
     }
5967
 
5962
 
5968
-    // Disable extruders steppers for manual filament changing
5969
-    disable_e_steppers();
5970
-    safe_delay(100);
5963
+    #if HAS_BUZZER
5964
+      filament_change_beep(max_beep_count, true);
5965
+    #endif
5966
+
5967
+    idle();
5968
+
5969
+    // Disable extruders steppers for manual filament changing (only on boards that have separate ENABLE_PINS)
5970
+    #if E0_ENABLE_PIN != X_ENABLE_PIN && E1_ENABLE_PIN != Y_ENABLE_PIN
5971
+      disable_e_steppers();
5972
+      safe_delay(100);
5973
+    #endif
5971
 
5974
 
5972
     // Start the heater idle timers
5975
     // Start the heater idle timers
5973
     const millis_t nozzle_timeout = (millis_t)(PAUSE_PARK_NOZZLE_TIMEOUT) * 1000UL;
5976
     const millis_t nozzle_timeout = (millis_t)(PAUSE_PARK_NOZZLE_TIMEOUT) * 1000UL;
5989
         filament_change_beep(max_beep_count);
5992
         filament_change_beep(max_beep_count);
5990
       #endif
5993
       #endif
5991
 
5994
 
5995
+      // If the nozzle has timed out, wait for the user to press the button to re-heat the nozzle, then
5996
+      // re-heat the nozzle, re-show the insert screen, restart the idle timers, and start over
5992
       if (!nozzle_timed_out)
5997
       if (!nozzle_timed_out)
5993
         HOTEND_LOOP()
5998
         HOTEND_LOOP()
5994
           nozzle_timed_out |= thermalManager.is_heater_idle(e);
5999
           nozzle_timed_out |= thermalManager.is_heater_idle(e);
5995
 
6000
 
5996
-      #if ENABLED(ULTIPANEL)
5997
-        if (nozzle_timed_out)
6001
+      if (nozzle_timed_out) {
6002
+        #if ENABLED(ULTIPANEL)
5998
           lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_CLICK_TO_HEAT_NOZZLE);
6003
           lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_CLICK_TO_HEAT_NOZZLE);
5999
-      #endif
6004
+        #endif
6005
+
6006
+        // Wait for LCD click or M108
6007
+        while (wait_for_user) idle(true);
6008
+
6009
+        // Re-enable the heaters if they timed out
6010
+        HOTEND_LOOP() thermalManager.reset_heater_idle_timer(e);
6011
+
6012
+        // Wait for the heaters to reach the target temperatures
6013
+        ensure_safe_temperature();
6014
+
6015
+        #if ENABLED(ULTIPANEL)
6016
+          lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_INSERT);
6017
+        #endif
6018
+
6019
+        // Start the heater idle timers
6020
+        const millis_t nozzle_timeout = (millis_t)(PAUSE_PARK_NOZZLE_TIMEOUT) * 1000UL;
6021
+
6022
+        HOTEND_LOOP()
6023
+          thermalManager.start_heater_idle_timer(e, nozzle_timeout);
6024
+
6025
+        wait_for_user = true; /* Wait for user to load filament */
6026
+        nozzle_timed_out = false;
6027
+
6028
+        #if HAS_BUZZER
6029
+          filament_change_beep(max_beep_count, true);
6030
+        #endif
6031
+      }
6000
 
6032
 
6001
       idle(true);
6033
       idle(true);
6002
     }
6034
     }
7643
       if (parser.seen('X')) disable_X();
7675
       if (parser.seen('X')) disable_X();
7644
       if (parser.seen('Y')) disable_Y();
7676
       if (parser.seen('Y')) disable_Y();
7645
       if (parser.seen('Z')) disable_Z();
7677
       if (parser.seen('Z')) disable_Z();
7646
-      #if ((E0_ENABLE_PIN != X_ENABLE_PIN) && (E1_ENABLE_PIN != Y_ENABLE_PIN)) // Only enable on boards that have seperate ENABLE_PINS
7678
+      #if E0_ENABLE_PIN != X_ENABLE_PIN && E1_ENABLE_PIN != Y_ENABLE_PIN // Only enable on boards that have seperate ENABLE_PINS
7647
         if (parser.seen('E')) disable_e_steppers();
7679
         if (parser.seen('E')) disable_e_steppers();
7648
       #endif
7680
       #endif
7649
     }
7681
     }

+ 10
- 5
Marlin/ultralcd.cpp View File

1107
   #if ENABLED(ADVANCED_PAUSE_FEATURE)
1107
   #if ENABLED(ADVANCED_PAUSE_FEATURE)
1108
 
1108
 
1109
     void lcd_enqueue_filament_change() {
1109
     void lcd_enqueue_filament_change() {
1110
-      if (!DEBUGGING(DRYRUN) && thermalManager.tooColdToExtrude(active_extruder)) {
1111
-        lcd_save_previous_screen();
1112
-        lcd_goto_screen(lcd_advanced_pause_toocold_menu);
1113
-        return;
1114
-      }
1110
+
1111
+      #if ENABLED(PREVENT_COLD_EXTRUSION)
1112
+        if (!DEBUGGING(DRYRUN) && !thermalManager.allow_cold_extrude &&
1113
+            thermalManager.degTargetHotend(active_extruder) < thermalManager.extrude_min_temp) {
1114
+          lcd_save_previous_screen();
1115
+          lcd_goto_screen(lcd_advanced_pause_toocold_menu);
1116
+          return;
1117
+        }
1118
+      #endif
1119
+
1115
       lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_INIT);
1120
       lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_INIT);
1116
       enqueue_and_echo_commands_P(PSTR("M600 B0"));
1121
       enqueue_and_echo_commands_P(PSTR("M600 B0"));
1117
     }
1122
     }

Loading…
Cancel
Save