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
This commit is contained in:
Guðni Már Gilbert 2022-07-03 16:21:48 +00:00 committed by D.R.racer
parent ba52430e1d
commit 80c640deb9
3 changed files with 24 additions and 8 deletions

View File

@ -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();

View File

@ -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);

View File

@ -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
}