Add filament presence check at start of print
A new menu setting is added to configure how strict the check should be. - None: No check is performed - Warning (default): The user is warned about missing and is prompted to continue with Yes/No. If No is selected, the print is aborted. If no user input is given (e.g. from host printing) then the warning will expire in 30 seconds and assume the Yes option was selected - Strict: If the filament is not detected when a print is started, it is immediately canceled. The check is currently performed on G-codes: M24 and M75. Starting a SD print and Host print respectively.
This commit is contained in:
parent
055f601ad3
commit
bf72ecc3f9
|
|
@ -5224,6 +5224,18 @@ void process_commands()
|
|||
lcd_resume_print();
|
||||
else
|
||||
{
|
||||
if (!MMU2::mmu2.Enabled()) {
|
||||
// Check if the filament is present before starting a print.
|
||||
// When MMU is enabled, this is not necessary and the G-code file
|
||||
// should always tell the MMU which filament to load.
|
||||
filament_presence_check();
|
||||
|
||||
if (lcd_commands_type == LcdCommands::StopPrint) {
|
||||
// Print job was canceled
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!card.get_sdpos())
|
||||
{
|
||||
// A new print has started from scratch, reset stats
|
||||
|
|
@ -5854,6 +5866,18 @@ Sigma_Exit:
|
|||
*/
|
||||
case 75:
|
||||
{
|
||||
if (!MMU2::mmu2.Enabled()) {
|
||||
// Check if the filament is present before starting a host print.
|
||||
// When MMU is enabled, this is not necessary and the G-code file
|
||||
// should always tell the MMU which filament to load.
|
||||
filament_presence_check();
|
||||
|
||||
if (lcd_commands_type == LcdCommands::StopPrint) {
|
||||
// Print job was canceled
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
print_job_timer.start();
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -246,7 +246,9 @@ static_assert(sizeof(Sheets) == EEPROM_SHEETS_SIZEOF, "Sizeof(Sheets) is not EEP
|
|||
| ^ | ^ | ^ | 01h 1 | ^ | MMU cutter: __enabled__ | ^ | ^
|
||||
| ^ | ^ | ^ | 02h 2 | ^ | MMU cutter: __always__ | ^ | ^
|
||||
| 0x0DAE 3502 | uint16 | EEPROM_UVLO_MESH_BED_LEVELING_FULL | ??? | ff ffh 65535 | Saved MBL points | Power Panic | D3 Ax0dae C288
|
||||
| 0x0DAD 3501 | uint8 | _EEPROM_FREE_NR9_ | ??? | ffh 255 | _Free EEPROM space_ | _free space_ | D3 Ax0dad C1
|
||||
| 0x0DAD 3501 | uint8 | EEPROM_CHECK_FILAMENT | 01h 1 | ffh 255 | Check mode for filament is: __warn__ | LCD menu | D3 Ax0dad C1
|
||||
| ^ | ^ | ^ | 02h 2 | ^ | Check mode for filament is: __strict__ | ^ | ^
|
||||
| ^ | ^ | ^ | 00h 0 | ^ | Check mode for filament is: __none__ | ^ | ^
|
||||
| 0x0DAC 3500 | bool | EEPROM_MBL_MAGNET_ELIMINATION | 01h 1 | ffh 255 | Mesh bed leveling does: __ignores__ magnets | LCD menu | D3 Ax0dac C1
|
||||
| ^ | ^ | ^ | 00h 0 | ^ | Mesh bed leveling does: __NOT ignores__ magnets | ^ | ^
|
||||
| 0x0DAB 3499 | uint8 | EEPROM_MBL_POINTS_NR | 03h 3 | ffh 255 | Mesh bed leveling points: __3x3__ | LCD menu | D3 Ax0dab C1
|
||||
|
|
@ -585,9 +587,9 @@ static_assert(sizeof(Sheets) == EEPROM_SHEETS_SIZEOF, "Sizeof(Sheets) is not EEP
|
|||
#define EEPROM_MMU_CUTTER_ENABLED (EEPROM_MMU_LOAD_FAIL - 1) // bool
|
||||
#define EEPROM_UVLO_MESH_BED_LEVELING_FULL (EEPROM_MMU_CUTTER_ENABLED - 12*12*2) //allow 12 calibration points for future expansion
|
||||
|
||||
#define _EEPROM_FREE_NR9_ (EEPROM_UVLO_MESH_BED_LEVELING_FULL-1) // uint8_t
|
||||
#define EEPROM_CHECK_FILAMENT (EEPROM_UVLO_MESH_BED_LEVELING_FULL-1) // uint8_t
|
||||
|
||||
#define EEPROM_MBL_MAGNET_ELIMINATION (_EEPROM_FREE_NR9_ - 1)
|
||||
#define EEPROM_MBL_MAGNET_ELIMINATION (EEPROM_CHECK_FILAMENT - 1)
|
||||
#define EEPROM_MBL_POINTS_NR (EEPROM_MBL_MAGNET_ELIMINATION -1) //uint8_t number of points in one exis for mesh bed leveling
|
||||
#define EEPROM_MBL_PROBE_NR (EEPROM_MBL_POINTS_NR-1) //number of measurements for each point
|
||||
|
||||
|
|
|
|||
|
|
@ -155,6 +155,8 @@ const char MSG_GCODE_NEWER_FIRMWARE_CONTINUE[] PROGMEM_I1 = ISTR("G-code sliced
|
|||
const char MSG_GCODE_NEWER_FIRMWARE_CANCELLED[] PROGMEM_I1 = ISTR("G-code sliced for a newer firmware. Please update the firmware. Print cancelled."); ////MSG_GCODE_NEWER_FIRMWARE_CANCELLED c=20 r=8
|
||||
const char MSG_GCODE_DIFF_CONTINUE[] PROGMEM_I1 = ISTR("G-code sliced for a different level. Continue?"); ////MSG_GCODE_DIFF_CONTINUE c=20 r=3
|
||||
const char MSG_GCODE_DIFF_CANCELLED[] PROGMEM_I1 = ISTR("G-code sliced for a different level. Please re-slice the model again. Print cancelled."); ////MSG_GCODE_DIFF_CANCELLED c=20 r=8
|
||||
const char MSG_MISSING_FILAMENT_CONTINUE[] PROGMEM_I1 = ISTR("There is no filament loaded. Continue?"); ////MSG_MISSING_FILAMENT_CONTINUE c=20 r=3;
|
||||
const char MSG_MISSING_FILAMENT_CANCELLED[] PROGMEM_I1 = ISTR("There is no filament loaded. Print cancelled."); ////MSG_MISSING_FILAMENT_CANCELLED c=20 r=8
|
||||
const char MSG_NOZZLE_DIFFERS_CONTINUE[] PROGMEM_I1 = ISTR("Nozzle diameter differs from the G-code. Continue?"); ////MSG_NOZZLE_DIFFERS_CONTINUE c=20 r=3
|
||||
const char MSG_NOZZLE_DIFFERS_CANCELLED[] PROGMEM_I1 = ISTR("Nozzle diameter differs from the G-code. Please check the value in settings. Print cancelled."); ////MSG_NOZZLE_DIFFERS_CANCELLED c=20 r=8
|
||||
const char MSG_NOZZLE_DIAMETER[] PROGMEM_I1 = ISTR("Nozzle d."); ////MSG_NOZZLE_DIAMETER c=10
|
||||
|
|
|
|||
|
|
@ -157,6 +157,8 @@ extern const char MSG_GCODE_NEWER_FIRMWARE_CONTINUE[];
|
|||
extern const char MSG_GCODE_NEWER_FIRMWARE_CANCELLED[];
|
||||
extern const char MSG_GCODE_DIFF_CONTINUE[];
|
||||
extern const char MSG_GCODE_DIFF_CANCELLED[];
|
||||
extern const char MSG_MISSING_FILAMENT_CONTINUE[];
|
||||
extern const char MSG_MISSING_FILAMENT_CANCELLED[];
|
||||
extern const char MSG_NOZZLE_DIFFERS_CONTINUE[];
|
||||
extern const char MSG_NOZZLE_DIFFERS_CANCELLED[];
|
||||
extern const char MSG_NOZZLE_DIAMETER[];
|
||||
|
|
|
|||
|
|
@ -4372,6 +4372,45 @@ do\
|
|||
}\
|
||||
while (0)
|
||||
|
||||
static void lcd_check_filament_set(void)
|
||||
{
|
||||
switch(oCheckFilament)
|
||||
{
|
||||
case ClCheckFilament::_None:
|
||||
oCheckFilament=ClCheckFilament::_Warn;
|
||||
break;
|
||||
case ClCheckFilament::_Warn:
|
||||
oCheckFilament=ClCheckFilament::_Strict;
|
||||
break;
|
||||
case ClCheckFilament::_Strict:
|
||||
oCheckFilament=ClCheckFilament::_None;
|
||||
break;
|
||||
default:
|
||||
oCheckFilament=ClCheckFilament::_None;
|
||||
}
|
||||
eeprom_update_byte_notify((uint8_t*)EEPROM_CHECK_FILAMENT,(uint8_t)oCheckFilament);
|
||||
}
|
||||
|
||||
#define SETTINGS_CHECK_FILAMENT \
|
||||
do\
|
||||
{\
|
||||
switch(oCheckFilament)\
|
||||
{\
|
||||
case ClCheckFilament::_None:\
|
||||
MENU_ITEM_TOGGLE_P(MSG_FILAMENT, _T(MSG_NONE), lcd_check_filament_set);\
|
||||
break;\
|
||||
case ClCheckFilament::_Warn:\
|
||||
MENU_ITEM_TOGGLE_P(MSG_FILAMENT, _T(MSG_WARN), lcd_check_filament_set);\
|
||||
break;\
|
||||
case ClCheckFilament::_Strict:\
|
||||
MENU_ITEM_TOGGLE_P(MSG_FILAMENT, _T(MSG_STRICT), lcd_check_filament_set);\
|
||||
break;\
|
||||
default:\
|
||||
MENU_ITEM_TOGGLE_P(MSG_FILAMENT, _T(MSG_NONE), lcd_check_filament_set);\
|
||||
}\
|
||||
}\
|
||||
while (0)
|
||||
|
||||
static void lcd_checking_menu(void)
|
||||
{
|
||||
MENU_BEGIN();
|
||||
|
|
@ -4379,6 +4418,7 @@ static void lcd_checking_menu(void)
|
|||
SETTINGS_MODE;
|
||||
SETTINGS_MODEL;
|
||||
SETTINGS_VERSION;
|
||||
SETTINGS_CHECK_FILAMENT;
|
||||
MENU_END();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -245,6 +245,7 @@ ClCheckMode oCheckMode;
|
|||
ClCheckModel oCheckModel;
|
||||
ClCheckVersion oCheckVersion;
|
||||
ClCheckGcode oCheckGcode;
|
||||
ClCheckFilament oCheckFilament;
|
||||
|
||||
void fCheckModeInit() {
|
||||
oCheckMode = (ClCheckMode)eeprom_init_default_byte((uint8_t *)EEPROM_CHECK_MODE, (uint8_t)ClCheckMode::_Warn);
|
||||
|
|
@ -260,6 +261,7 @@ void fCheckModeInit() {
|
|||
oCheckModel = (ClCheckModel)eeprom_init_default_byte((uint8_t *)EEPROM_CHECK_MODEL, (uint8_t)ClCheckModel::_Warn);
|
||||
oCheckVersion = (ClCheckVersion)eeprom_init_default_byte((uint8_t *)EEPROM_CHECK_VERSION, (uint8_t)ClCheckVersion::_Warn);
|
||||
oCheckGcode = (ClCheckGcode)eeprom_init_default_byte((uint8_t *)EEPROM_CHECK_GCODE, (uint8_t)ClCheckGcode::_Warn);
|
||||
oCheckFilament = (ClCheckFilament)eeprom_init_default_byte((uint8_t *)EEPROM_CHECK_FILAMENT, (uint8_t)ClCheckFilament::_Warn);
|
||||
}
|
||||
|
||||
static void render_M862_warnings(const char* warning, const char* strict, uint8_t check)
|
||||
|
|
@ -369,6 +371,21 @@ void fw_version_check(const char *pVersion) {
|
|||
);
|
||||
}
|
||||
|
||||
void filament_presence_check() {
|
||||
if (fsensor.isEnabled() && !fsensor.getFilamentPresent())
|
||||
{
|
||||
if (oCheckFilament == ClCheckFilament::_None)
|
||||
return;
|
||||
|
||||
render_M862_warnings(
|
||||
_T(MSG_MISSING_FILAMENT_CONTINUE)
|
||||
,_T(MSG_MISSING_FILAMENT_CANCELLED)
|
||||
,(uint8_t)oCheckFilament
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void gcode_level_check(uint16_t nGcodeLevel) {
|
||||
if (oCheckGcode == ClCheckGcode::_None)
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -79,6 +79,14 @@ enum class ClCheckGcode:uint_least8_t
|
|||
_Undef=EEPROM_EMPTY_VALUE
|
||||
};
|
||||
|
||||
enum class ClCheckFilament:uint_least8_t
|
||||
{
|
||||
_None,
|
||||
_Warn,
|
||||
_Strict,
|
||||
_Undef=EEPROM_EMPTY_VALUE
|
||||
};
|
||||
|
||||
#define COMPARE_VALUE_EQUAL (((uint8_t)ClCompareValue::_Equal<<6)+((uint8_t)ClCompareValue::_Equal<<4)+((uint8_t)ClCompareValue::_Equal<<2)+((uint8_t)ClCompareValue::_Equal))
|
||||
enum class ClCompareValue:uint_least8_t
|
||||
{
|
||||
|
|
@ -132,12 +140,14 @@ extern ClCheckMode oCheckMode;
|
|||
extern ClCheckModel oCheckModel;
|
||||
extern ClCheckVersion oCheckVersion;
|
||||
extern ClCheckGcode oCheckGcode;
|
||||
extern ClCheckFilament oCheckFilament;
|
||||
|
||||
void fCheckModeInit();
|
||||
void nozzle_diameter_check(uint16_t nDiameter);
|
||||
void printer_model_check(uint16_t nPrinterModel, uint16_t actualPrinterModel);
|
||||
void printer_smodel_check(const char *pStrPos, const char *actualPrinterSModel);
|
||||
void fw_version_check(const char *pVersion);
|
||||
void filament_presence_check();
|
||||
void gcode_level_check(uint16_t nGcodeLevel);
|
||||
|
||||
uint16_t nPrinterType(bool bMMu);
|
||||
|
|
|
|||
Loading…
Reference in New Issue