Przeglądaj źródła

PFW-1373

Fix the unload procedure when the user has paused a print
then stopped the print after the temperature has reached below 175°C
Now the E-motor will move as expected
Guðni Már Gilbert 2 lat temu
rodzic
commit
80c640deb9
3 zmienionych plików z 24 dodań i 8 usunięć
  1. 1 0
      Firmware/Marlin.h
  2. 11 7
      Firmware/Marlin_main.cpp
  3. 12 1
      Firmware/ultralcd.cpp

+ 1 - 0
Firmware/Marlin.h

@@ -414,6 +414,7 @@ extern void print_physical_coordinates();
 extern void print_mesh_bed_leveling_table();
 
 extern void stop_and_save_print_to_ram(float z_move, float e_move);
+void restore_extruder_temperture_from_ram();
 extern void restore_print_from_ram_and_continue(float e_move);
 extern void cancel_saved_printing();
 

+ 11 - 7
Firmware/Marlin_main.cpp

@@ -11172,6 +11172,16 @@ void stop_and_save_print_to_ram(float z_move, float e_move)
   }
 }
 
+void restore_extruder_temperture_from_ram() {
+    if (degTargetHotend(saved_active_extruder) != saved_extruder_temperature)
+    {
+        setTargetHotendSafe(saved_extruder_temperature, saved_active_extruder);
+        heating_status = HeatingStatus::EXTRUDER_HEATING;
+        wait_for_heater(_millis(), saved_active_extruder);
+        heating_status = HeatingStatus::EXTRUDER_HEATING_COMPLETE;
+    }
+}
+
 //! @brief Restore print from ram
 //!
 //! Restore print saved by stop_and_save_print_to_ram(). Is blocking, restores
@@ -11198,13 +11208,7 @@ void restore_print_from_ram_and_continue(float e_move)
 	// restore active_extruder
 	active_extruder = saved_active_extruder;
 	fanSpeed = saved_fan_speed;
-	if (degTargetHotend(saved_active_extruder) != saved_extruder_temperature)
-	{
-		setTargetHotendSafe(saved_extruder_temperature, saved_active_extruder);
-		heating_status = HeatingStatus::EXTRUDER_HEATING;
-		wait_for_heater(_millis(), saved_active_extruder);
-		heating_status = HeatingStatus::EXTRUDER_HEATING_COMPLETE;
-	}
+	restore_extruder_temperture_from_ram();
 	axis_relative_modes ^= (-saved_extruder_relative_mode ^ axis_relative_modes) & E_AXIS_MASK;
 	float e = saved_pos[E_AXIS] - e_move;
 	plan_set_e_position(e);

+ 12 - 1
Firmware/ultralcd.cpp

@@ -6005,7 +6005,18 @@ void print_stop()
         fanSpeed = 0;
     }
 
-    if (MMU2::mmu2.Enabled()) MMU2::mmu2.unload(); //M702 C
+    if (MMU2::mmu2.Enabled())
+    {
+        if (isPrintPaused)
+        {
+            // Restore temperature saved in ram after pausing print
+            restore_extruder_temperture_from_ram();
+        }
+        MMU2::mmu2.unload(); //M702 C
+    }
+
+    lcd_cooldown(); //turns off heaters and fan; goes to status screen.
+
     finishAndDisableSteppers(); //M84
     axis_relative_modes = E_AXIS_MASK; //XYZ absolute, E relative
 }