From 5f23474c95309b8a47a0bea92a88dbe3bbf25111 Mon Sep 17 00:00:00 2001 From: Yuri D'Elia Date: Wed, 28 Oct 2020 20:49:28 +0100 Subject: [PATCH 1/2] Raise Z while preheating when auto/[un]loading the filament Preheating already raised Z to avoid scorching the PEI sheet, as does filament loading/unloading to allow for excess material to be removed. However, when loading/autoloading/unloading via the LCD with a cold nozzle the preheating menu is performed before the carriage is raised, leaving the carriage close to the sheet while heating the nozzle. Pre-raise the carriage already while waiting, so that the subsequent move is automagically skipped. Set bFilamentWaitingFlag only once to perform both the LCD initialization and raising to the appropriate height. Should fix #2761 --- Firmware/ultralcd.cpp | 61 +++++++++++++++++++++++++------------------ 1 file changed, 36 insertions(+), 25 deletions(-) diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index 63fea0e3f..adb9f2c31 100755 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -2412,7 +2412,7 @@ void mFilamentItem(uint16_t nTemp, uint16_t nTempBed) case FilamentAction::None: case FilamentAction::Preheat: case FilamentAction::Lay1Cal: - + // handled earlier break; } if (bFilamentWaitingFlag) Sound_MakeSound(e_SOUND_TYPE_StandardPrompt); @@ -2420,34 +2420,45 @@ void mFilamentItem(uint16_t nTemp, uint16_t nTempBed) } else { - bFilamentWaitingFlag = true; lcd_set_cursor(0, 0); lcdui_print_temp(LCD_STR_THERMOMETER[0], (int) degHotend(0), (int) degTargetHotend(0)); - lcd_set_cursor(0, 1); - switch (eFilamentAction) + + if (!bFilamentWaitingFlag) { - case FilamentAction::Load: - case FilamentAction::AutoLoad: - case FilamentAction::MmuLoad: - lcd_puts_P(_i("Preheating to load")); ////MSG_ c=20 - break; - case FilamentAction::UnLoad: - case FilamentAction::MmuUnLoad: - lcd_puts_P(_i("Preheating to unload")); ////MSG_ c=20 - break; - case FilamentAction::MmuEject: - lcd_puts_P(_i("Preheating to eject")); ////MSG_ c=20 - break; - case FilamentAction::MmuCut: - lcd_puts_P(_i("Preheating to cut")); ////MSG_ c=20 - break; - case FilamentAction::None: - case FilamentAction::Preheat: - case FilamentAction::Lay1Cal: - break; + // First run after the filament preheat selection: + // setup the fixed LCD parts and raise Z as we wait + bFilamentWaitingFlag = true; + + lcd_set_cursor(0, 1); + switch (eFilamentAction) + { + case FilamentAction::Load: + case FilamentAction::AutoLoad: + case FilamentAction::MmuLoad: + lcd_puts_P(_i("Preheating to load")); ////MSG_ c=20 + raise_z_above(MIN_Z_FOR_LOAD); + break; + case FilamentAction::UnLoad: + case FilamentAction::MmuUnLoad: + lcd_puts_P(_i("Preheating to unload")); ////MSG_ c=20 + raise_z_above(MIN_Z_FOR_UNLOAD); + break; + case FilamentAction::MmuEject: + lcd_puts_P(_i("Preheating to eject")); ////MSG_ c=20 + break; + case FilamentAction::MmuCut: + lcd_puts_P(_i("Preheating to cut")); ////MSG_ c=20 + break; + case FilamentAction::None: + case FilamentAction::Preheat: + case FilamentAction::Lay1Cal: + // handled earlier + break; + } + lcd_set_cursor(0, 3); + lcd_puts_P(_i(">Cancel")); ////MSG_ c=20 r=1 } - lcd_set_cursor(0, 3); - lcd_puts_P(_i(">Cancel")); ////MSG_ c=20 r=1 + if (lcd_clicked()) { bFilamentWaitingFlag = false; From e28159122fcbff5e70d13325304a094d61fb9c2d Mon Sep 17 00:00:00 2001 From: Yuri D'Elia Date: Thu, 29 Oct 2020 15:14:17 +0100 Subject: [PATCH 2/2] Make MIN_Z_FOR_LOAD/UNLOAD the same When unloading + preheat immediately followed by a load, the carriage is raised first up to 20mm, then again to 50mm. With PR #2318 it makes sense to make more space for the extra extrusion anyway, so make them the same. This moves the carriage only once _while_ preheating, which is nice. --- Firmware/Configuration.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Firmware/Configuration.h b/Firmware/Configuration.h index a9bf23e99..58e3ee743 100644 --- a/Firmware/Configuration.h +++ b/Firmware/Configuration.h @@ -552,7 +552,7 @@ enum CalibrationStatus // Try to maintain a minimum distance from the bed even when Z is // unknown when doing the following operations #define MIN_Z_FOR_LOAD 50 -#define MIN_Z_FOR_UNLOAD 20 +#define MIN_Z_FOR_UNLOAD 50 #define MIN_Z_FOR_PREHEAT 10 #include "Configuration_adv.h"