Skip to content

Commit

Permalink
Raise Z while preheating when auto/[un]loading the filament
Browse files Browse the repository at this point in the history
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 prusa3d#2761
  • Loading branch information
wavexx committed Oct 28, 2020
1 parent 2103d2f commit 5f23474
Showing 1 changed file with 36 additions and 25 deletions.
61 changes: 36 additions & 25 deletions Firmware/ultralcd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2412,42 +2412,53 @@ 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);
bFilamentWaitingFlag = false;
}
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;
Expand Down

0 comments on commit 5f23474

Please sign in to comment.