Prompt user for Z calibration after failed MBL with yes-no screen
This commit is contained in:
parent
357b68cf76
commit
b58d2ecccb
|
|
@ -2772,7 +2772,10 @@ static void gcode_G80()
|
|||
static uint8_t g80_fail_cnt = 0;
|
||||
if (mesh_point != MESH_NUM_X_POINTS * MESH_NUM_Y_POINTS) {
|
||||
if (g80_fail_cnt++ >= 1) {
|
||||
kill(_T(MSG_MBL_FAILED_Z_CAL));
|
||||
print_stop();
|
||||
lcd_show_fullscreen_message_and_wait_P(_T(MSG_MBL_FAILED));
|
||||
lcd_z_calibration_prompt(false);
|
||||
goto exit;
|
||||
}
|
||||
Sound_MakeSound(e_SOUND_TYPE_StandardAlert);
|
||||
bool bState;
|
||||
|
|
@ -2817,44 +2820,47 @@ static void gcode_G80()
|
|||
#endif
|
||||
babystep_apply(); // Apply Z height correction aka baby stepping before mesh bed leveing gets activated.
|
||||
|
||||
// Apply the bed level correction to the mesh
|
||||
bool eeprom_bed_correction_valid = eeprom_read_byte((unsigned char*)EEPROM_BED_CORRECTION_VALID) == 1;
|
||||
auto bedCorrectHelper = [eeprom_bed_correction_valid] (char code, uint8_t *eep_address) -> int8_t {
|
||||
if (code_seen(code)) {
|
||||
// Verify value is within allowed range
|
||||
int16_t temp = code_value_short();
|
||||
if (abs(temp) > BED_ADJUSTMENT_UM_MAX) {
|
||||
printf_P(PSTR("%SExcessive bed leveling correction: %i microns\n"), errormagic, temp);
|
||||
} else {
|
||||
return (int8_t)temp; // Value is valid, use it
|
||||
{ // Apply the bed level correction to the mesh
|
||||
bool eeprom_bed_correction_valid = eeprom_read_byte((unsigned char*)EEPROM_BED_CORRECTION_VALID) == 1;
|
||||
auto bedCorrectHelper = [eeprom_bed_correction_valid] (char code, uint8_t *eep_address) -> int8_t {
|
||||
if (code_seen(code)) {
|
||||
// Verify value is within allowed range
|
||||
int16_t temp = code_value_short();
|
||||
if (abs(temp) > BED_ADJUSTMENT_UM_MAX) {
|
||||
printf_P(PSTR("%SExcessive bed leveling correction: %i microns\n"), errormagic, temp);
|
||||
} else {
|
||||
return (int8_t)temp; // Value is valid, use it
|
||||
}
|
||||
} else if (eeprom_bed_correction_valid) {
|
||||
return (int8_t)eeprom_read_byte(eep_address);
|
||||
}
|
||||
return 0;
|
||||
};
|
||||
const int8_t correction[4] = {
|
||||
bedCorrectHelper('L', (uint8_t*)EEPROM_BED_CORRECTION_LEFT),
|
||||
bedCorrectHelper('R', (uint8_t*)EEPROM_BED_CORRECTION_RIGHT),
|
||||
bedCorrectHelper('F', (uint8_t*)EEPROM_BED_CORRECTION_FRONT),
|
||||
bedCorrectHelper('B', (uint8_t*)EEPROM_BED_CORRECTION_REAR),
|
||||
};
|
||||
for (uint8_t row = 0; row < MESH_NUM_Y_POINTS; row++) {
|
||||
for (uint8_t col = 0; col < MESH_NUM_X_POINTS; col++) {
|
||||
constexpr float scaler = 0.001f / (MESH_NUM_X_POINTS - 1);
|
||||
mbl.z_values[row][col] += scaler * (
|
||||
+ correction[0] * (MESH_NUM_X_POINTS - 1 - col)
|
||||
+ correction[1] * col
|
||||
+ correction[2] * (MESH_NUM_Y_POINTS - 1 - row)
|
||||
+ correction[3] * row);
|
||||
}
|
||||
} else if (eeprom_bed_correction_valid) {
|
||||
return (int8_t)eeprom_read_byte(eep_address);
|
||||
}
|
||||
return 0;
|
||||
};
|
||||
const int8_t correction[4] = {
|
||||
bedCorrectHelper('L', (uint8_t*)EEPROM_BED_CORRECTION_LEFT),
|
||||
bedCorrectHelper('R', (uint8_t*)EEPROM_BED_CORRECTION_RIGHT),
|
||||
bedCorrectHelper('F', (uint8_t*)EEPROM_BED_CORRECTION_FRONT),
|
||||
bedCorrectHelper('B', (uint8_t*)EEPROM_BED_CORRECTION_REAR),
|
||||
};
|
||||
for (uint8_t row = 0; row < MESH_NUM_Y_POINTS; row++) {
|
||||
for (uint8_t col = 0; col < MESH_NUM_X_POINTS; col++) {
|
||||
constexpr float scaler = 0.001f / (MESH_NUM_X_POINTS - 1);
|
||||
mbl.z_values[row][col] += scaler * (
|
||||
+ correction[0] * (MESH_NUM_X_POINTS - 1 - col)
|
||||
+ correction[1] * col
|
||||
+ correction[2] * (MESH_NUM_Y_POINTS - 1 - row)
|
||||
+ correction[3] * row);
|
||||
}
|
||||
}
|
||||
|
||||
mbl.upsample_3x3(); //interpolation from 3x3 to 7x7 points using largrangian polynomials while using the same array z_values[iy][ix] for storing (just coppying measured data to new destination and interpolating between them)
|
||||
|
||||
uint8_t useMagnetCompensation = code_seen('M') ? code_value_uint8() : eeprom_read_byte((uint8_t*)EEPROM_MBL_MAGNET_ELIMINATION);
|
||||
if (nMeasPoints == 7 && useMagnetCompensation) {
|
||||
mbl_magnet_elimination();
|
||||
{ // apply magnet compensation
|
||||
uint8_t useMagnetCompensation = code_seen('M') ? code_value_uint8() : eeprom_read_byte((uint8_t*)EEPROM_MBL_MAGNET_ELIMINATION);
|
||||
if (nMeasPoints == 7 && useMagnetCompensation) {
|
||||
mbl_magnet_elimination();
|
||||
}
|
||||
}
|
||||
|
||||
mbl.active = 1; //activate mesh bed leveling
|
||||
|
|
@ -2874,6 +2880,7 @@ static void gcode_G80()
|
|||
plan_buffer_line_curposXYZE(400);
|
||||
}
|
||||
#endif // !PINDA_THERMISTOR
|
||||
exit:
|
||||
KEEPALIVE_STATE(NOT_BUSY);
|
||||
// Restore custom message state
|
||||
lcd_setstatuspgm(MSG_WELCOME);
|
||||
|
|
|
|||
|
|
@ -212,7 +212,7 @@ extern const char MSG_CHANGED_PRINTER [] PROGMEM_I1 = ISTR("Warning: printer typ
|
|||
extern const char MSG_CHANGED_BOTH [] PROGMEM_I1 = ISTR("Warning: both printer type and motherboard type changed."); ////MSG_CHANGED_BOTH c=20 r=4
|
||||
extern const char MSG_DEFAULT_SETTINGS_LOADED [] PROGMEM_I1 = ISTR("Old settings found. Default PID, Esteps etc. will be set."); ////MSG_DEFAULT_SETTINGS_LOADED c=20 r=6
|
||||
extern const char MSG_FORCE_SELFTEST [] PROGMEM_I1 = ISTR("Selftest will be run to calibrate accurate sensorless rehoming."); ////MSG_FORCE_SELFTEST c=20 r=8
|
||||
extern const char MSG_MBL_FAILED_Z_CAL [] PROGMEM_I1 = ISTR("Mesh bed leveling failed. Please run Z calibration."); ////MSG_MBL_FAILED_Z_CAL c=20 r=4
|
||||
extern const char MSG_MBL_FAILED [] PROGMEM_I1 = ISTR("Mesh bed leveling failed. Print canceled."); ////MSG_MBL_FAILED c=20 r=4
|
||||
extern const char MSG_ZLEVELING_ENFORCED [] PROGMEM_I1 = ISTR("Some problem encountered, Z-leveling enforced ..."); ////MSG_ZLEVELING_ENFORCED c=20 r=4
|
||||
extern const char MSG_UNLOAD_SUCCESSFUL [] PROGMEM_I1 = ISTR("Was filament unload successful?"); ////MSG_UNLOAD_SUCCESSFUL c=20 r=3
|
||||
extern const char MSG_CHECK_IDLER [] PROGMEM_I1 = ISTR("Please open idler and remove filament manually."); ////MSG_CHECK_IDLER c=20 r=4
|
||||
|
|
|
|||
|
|
@ -211,7 +211,7 @@ extern const char MSG_CHANGED_PRINTER [];
|
|||
extern const char MSG_CHANGED_BOTH [];
|
||||
extern const char MSG_DEFAULT_SETTINGS_LOADED [];
|
||||
extern const char MSG_FORCE_SELFTEST [];
|
||||
extern const char MSG_MBL_FAILED_Z_CAL [];
|
||||
extern const char MSG_MBL_FAILED [];
|
||||
extern const char MSG_ZLEVELING_ENFORCED [];
|
||||
extern const char MSG_UNLOAD_SUCCESSFUL [];
|
||||
extern const char MSG_CHECK_IDLER [];
|
||||
|
|
|
|||
|
|
@ -3748,6 +3748,12 @@ static void wizard_lay1cal_message(bool cold)
|
|||
_T(MSG_WIZARD_V2_CAL_2));
|
||||
}
|
||||
|
||||
void lcd_z_calibration_prompt(bool allowTimeouting) {
|
||||
uint8_t result = lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_Z_CALIBRATION_PROMPT), allowTimeouting, 0);
|
||||
if (result == LCD_LEFT_BUTTON_CHOICE) {
|
||||
lcd_mesh_calibration_z();
|
||||
}
|
||||
}
|
||||
|
||||
void prompt_steel_sheet_on_bed(bool wantedState) {
|
||||
#ifdef STEEL_SHEET
|
||||
|
|
@ -5546,10 +5552,7 @@ static void lcd_mesh_bed_leveling_settings()
|
|||
ON_MENU_LEAVE(
|
||||
// Prompt user to run Z calibration for best results with region MBL.
|
||||
if (points_nr == 7) {
|
||||
uint8_t result = lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_Z_CALIBRATION_PROMPT), true, 0);
|
||||
if (result == LCD_LEFT_BUTTON_CHOICE) {
|
||||
lcd_mesh_calibration_z();
|
||||
}
|
||||
lcd_z_calibration_prompt(true);
|
||||
}
|
||||
);
|
||||
MENU_ITEM_BACK_P(_T(MSG_SETTINGS));
|
||||
|
|
|
|||
|
|
@ -220,6 +220,7 @@ void lcd_temp_calibration_set();
|
|||
void lcd_language();
|
||||
#endif
|
||||
|
||||
void lcd_z_calibration_prompt(bool allowTimeouting);
|
||||
void prompt_steel_sheet_on_bed(bool wantedState);
|
||||
|
||||
void lcd_wizard();
|
||||
|
|
|
|||
|
|
@ -1203,9 +1203,9 @@ msgstr ""
|
|||
msgid "Mesh Bed Leveling"
|
||||
msgstr ""
|
||||
|
||||
#. MSG_MBL_FAILED_Z_CAL c=20 r=4
|
||||
#. MSG_MBL_FAILED c=20 r=4
|
||||
#: ../../Firmware/Marlin_main.cpp:3038 ../../Firmware/messages.cpp:203
|
||||
msgid "Mesh bed leveling failed. Please run Z calibration."
|
||||
msgid "Mesh bed leveling failed. Print canceled."
|
||||
msgstr ""
|
||||
|
||||
#. MSG_MODE c=6
|
||||
|
|
|
|||
|
|
@ -2551,10 +2551,10 @@ msgstr "Výměna filamentu M600. Vložte nový filament nebo vysuňte starý."
|
|||
msgid "Sensitivity"
|
||||
msgstr "Citlivost"
|
||||
|
||||
#. MSG_MBL_FAILED_Z_CAL c=20 r=4
|
||||
#. MSG_MBL_FAILED c=20 r=4
|
||||
#: ../../Firmware/Marlin_main.cpp:3038 ../../Firmware/messages.cpp:203
|
||||
msgid "Mesh bed leveling failed. Please run Z calibration."
|
||||
msgstr "Mesh Bed Leveling selhal. Spusťte kalibraci osy Z."
|
||||
msgid "Mesh bed leveling failed. Print canceled."
|
||||
msgstr "Mesh Bed Leveling selhal."
|
||||
|
||||
#. MSG_SET_READY c=18
|
||||
#: ../../Firmware/messages.cpp:105 ../../Firmware/ultralcd.cpp:5265
|
||||
|
|
|
|||
|
|
@ -2579,10 +2579,10 @@ msgstr ""
|
|||
msgid "Sensitivity"
|
||||
msgstr "Sensitivität"
|
||||
|
||||
#. MSG_MBL_FAILED_Z_CAL c=20 r=4
|
||||
#. MSG_MBL_FAILED c=20 r=4
|
||||
#: ../../Firmware/Marlin_main.cpp:3038 ../../Firmware/messages.cpp:203
|
||||
msgid "Mesh bed leveling failed. Please run Z calibration."
|
||||
msgstr "MeshBett Ausgleich fehlgeschlagen. Z Kalibrierung ausführen."
|
||||
msgid "Mesh bed leveling failed. Print canceled."
|
||||
msgstr "MeshBett Ausgleich fehlgeschlagen."
|
||||
|
||||
#. MSG_SET_READY c=18
|
||||
#: ../../Firmware/messages.cpp:105 ../../Firmware/ultralcd.cpp:5265
|
||||
|
|
|
|||
|
|
@ -2574,10 +2574,10 @@ msgstr ""
|
|||
msgid "Sensitivity"
|
||||
msgstr "Sensibilidad"
|
||||
|
||||
#. MSG_MBL_FAILED_Z_CAL c=20 r=4
|
||||
#. MSG_MBL_FAILED c=20 r=4
|
||||
#: ../../Firmware/Marlin_main.cpp:3038 ../../Firmware/messages.cpp:203
|
||||
msgid "Mesh bed leveling failed. Please run Z calibration."
|
||||
msgstr "Nivelación fallida. Ejecute la calibración Z."
|
||||
msgid "Mesh bed leveling failed. Print canceled."
|
||||
msgstr "Nivelación fallida."
|
||||
|
||||
#. MSG_SET_READY c=18
|
||||
#: ../../Firmware/messages.cpp:105 ../../Firmware/ultralcd.cpp:5265
|
||||
|
|
|
|||
|
|
@ -2586,10 +2586,10 @@ msgstr ""
|
|||
msgid "Sensitivity"
|
||||
msgstr "Sensibilité"
|
||||
|
||||
#. MSG_MBL_FAILED_Z_CAL c=20 r=4
|
||||
#. MSG_MBL_FAILED c=20 r=4
|
||||
#: ../../Firmware/Marlin_main.cpp:3038 ../../Firmware/messages.cpp:203
|
||||
msgid "Mesh bed leveling failed. Please run Z calibration."
|
||||
msgstr "Mesh bed leveling a échoué. Veuillez procéder à l'étalonnage Z."
|
||||
msgid "Mesh bed leveling failed. Print canceled."
|
||||
msgstr "Mesh bed leveling a échoué."
|
||||
|
||||
#. MSG_SET_READY c=18
|
||||
#: ../../Firmware/messages.cpp:105 ../../Firmware/ultralcd.cpp:5265
|
||||
|
|
|
|||
|
|
@ -2568,10 +2568,10 @@ msgstr "Promjena filamenta M600. Stavite novu nit ili izbacite staru."
|
|||
msgid "Sensitivity"
|
||||
msgstr "Osjetljivost"
|
||||
|
||||
#. MSG_MBL_FAILED_Z_CAL c=20 r=4
|
||||
#. MSG_MBL_FAILED c=20 r=4
|
||||
#: ../../Firmware/Marlin_main.cpp:3038 ../../Firmware/messages.cpp:203
|
||||
msgid "Mesh bed leveling failed. Please run Z calibration."
|
||||
msgstr "Niveliranje podloge nije uspijelo. Pokrenite Z kalibraciju."
|
||||
msgid "Mesh bed leveling failed. Print canceled."
|
||||
msgstr "Niveliranje podloge nije uspijelo."
|
||||
|
||||
#. MSG_SET_READY c=18
|
||||
#: ../../Firmware/messages.cpp:105 ../../Firmware/ultralcd.cpp:5265
|
||||
|
|
|
|||
|
|
@ -2573,10 +2573,10 @@ msgstr ""
|
|||
msgid "Sensitivity"
|
||||
msgstr "Érzékenység"
|
||||
|
||||
#. MSG_MBL_FAILED_Z_CAL c=20 r=4
|
||||
#. MSG_MBL_FAILED c=20 r=4
|
||||
#: ../../Firmware/Marlin_main.cpp:3038 ../../Firmware/messages.cpp:203
|
||||
msgid "Mesh bed leveling failed. Please run Z calibration."
|
||||
msgstr "Sikertelen asztal szintezés. Kérjük, futtasd a Z kalibrálást."
|
||||
msgid "Mesh bed leveling failed. Print canceled."
|
||||
msgstr "Sikertelen asztal szintezés."
|
||||
|
||||
#. MSG_SET_READY c=18
|
||||
#: ../../Firmware/messages.cpp:105 ../../Firmware/ultralcd.cpp:5265
|
||||
|
|
|
|||
|
|
@ -2574,10 +2574,10 @@ msgstr ""
|
|||
msgid "Sensitivity"
|
||||
msgstr "Sensibilità"
|
||||
|
||||
#. MSG_MBL_FAILED_Z_CAL c=20 r=4
|
||||
#. MSG_MBL_FAILED c=20 r=4
|
||||
#: ../../Firmware/Marlin_main.cpp:3038 ../../Firmware/messages.cpp:203
|
||||
msgid "Mesh bed leveling failed. Please run Z calibration."
|
||||
msgstr "Livellamento piano fallito. Si prega di eseguire la calibrazione Z."
|
||||
msgid "Mesh bed leveling failed. Print canceled."
|
||||
msgstr "Livellamento piano fallito."
|
||||
|
||||
#. MSG_SET_READY c=18
|
||||
#: ../../Firmware/messages.cpp:105 ../../Firmware/ultralcd.cpp:5265
|
||||
|
|
|
|||
|
|
@ -2576,10 +2576,10 @@ msgstr "M600-filamentwissel. Laad een nieuw filament of werp het oude uit."
|
|||
msgid "Sensitivity"
|
||||
msgstr "Sensitiviteit"
|
||||
|
||||
#. MSG_MBL_FAILED_Z_CAL c=20 r=4
|
||||
#. MSG_MBL_FAILED c=20 r=4
|
||||
#: ../../Firmware/Marlin_main.cpp:3038 ../../Firmware/messages.cpp:203
|
||||
msgid "Mesh bed leveling failed. Please run Z calibration."
|
||||
msgstr "Bed leveling mislukt. Voer de Z-kalibratie uit."
|
||||
msgid "Mesh bed leveling failed. Print canceled."
|
||||
msgstr "Bed leveling mislukt."
|
||||
|
||||
#. MSG_SET_READY c=18
|
||||
#: ../../Firmware/messages.cpp:105 ../../Firmware/ultralcd.cpp:5265
|
||||
|
|
|
|||
|
|
@ -2550,10 +2550,10 @@ msgstr "M600 filamentskifte. Sett inn en ny filament eller løs ut den gamle."
|
|||
msgid "Sensitivity"
|
||||
msgstr "Sensitivitet"
|
||||
|
||||
#. MSG_MBL_FAILED_Z_CAL c=20 r=4
|
||||
#. MSG_MBL_FAILED c=20 r=4
|
||||
#: ../../Firmware/Marlin_main.cpp:3038 ../../Firmware/messages.cpp:203
|
||||
msgid "Mesh bed leveling failed. Please run Z calibration."
|
||||
msgstr "Sengeplanering feilet. Kjør Z-kalibrering."
|
||||
msgid "Mesh bed leveling failed. Print canceled."
|
||||
msgstr "Sengeplanering feilet."
|
||||
|
||||
#. MSG_SET_READY c=18
|
||||
#: ../../Firmware/messages.cpp:105 ../../Firmware/ultralcd.cpp:5265
|
||||
|
|
|
|||
|
|
@ -2566,10 +2566,10 @@ msgstr "Załaduj nowy filament lub wyładuj poprzedni."
|
|||
msgid "Sensitivity"
|
||||
msgstr "Czułość"
|
||||
|
||||
#. MSG_MBL_FAILED_Z_CAL c=20 r=4
|
||||
#. MSG_MBL_FAILED c=20 r=4
|
||||
#: ../../Firmware/Marlin_main.cpp:3038 ../../Firmware/messages.cpp:203
|
||||
msgid "Mesh bed leveling failed. Please run Z calibration."
|
||||
msgstr "Poziomowanie stołu nieudane. Proszę uruchomić kalibrację Z."
|
||||
msgid "Mesh bed leveling failed. Print canceled."
|
||||
msgstr "Poziomowanie stołu nieudane."
|
||||
|
||||
#. MSG_SET_READY c=18
|
||||
#: ../../Firmware/messages.cpp:105 ../../Firmware/ultralcd.cpp:5265
|
||||
|
|
|
|||
|
|
@ -2575,10 +2575,10 @@ msgstr ""
|
|||
msgid "Sensitivity"
|
||||
msgstr "Sensibilitate"
|
||||
|
||||
#. MSG_MBL_FAILED_Z_CAL c=20 r=4
|
||||
#. MSG_MBL_FAILED c=20 r=4
|
||||
#: ../../Firmware/Marlin_main.cpp:3038 ../../Firmware/messages.cpp:203
|
||||
msgid "Mesh bed leveling failed. Please run Z calibration."
|
||||
msgstr "Nivelarea patului a eșuat. Rulează Calibrare Z."
|
||||
msgid "Mesh bed leveling failed. Print canceled."
|
||||
msgstr "Nivelarea patului a eșuat."
|
||||
|
||||
#. MSG_SET_READY c=18
|
||||
#: ../../Firmware/messages.cpp:105 ../../Firmware/ultralcd.cpp:5265
|
||||
|
|
|
|||
|
|
@ -2556,10 +2556,10 @@ msgstr "Výmena filamentu M600. Vložte nový filament alebo vysuňte starý."
|
|||
msgid "Sensitivity"
|
||||
msgstr "Citlivosť"
|
||||
|
||||
#. MSG_MBL_FAILED_Z_CAL c=20 r=4
|
||||
#. MSG_MBL_FAILED c=20 r=4
|
||||
#: ../../Firmware/Marlin_main.cpp:3038 ../../Firmware/messages.cpp:203
|
||||
msgid "Mesh bed leveling failed. Please run Z calibration."
|
||||
msgstr "Vyrovnanie platne zlyhalo. Spustite kalibráciu Z."
|
||||
msgid "Mesh bed leveling failed. Print canceled."
|
||||
msgstr "Vyrovnanie platne zlyhalo."
|
||||
|
||||
#. MSG_SET_READY c=18
|
||||
#: ../../Firmware/messages.cpp:105 ../../Firmware/ultralcd.cpp:5265
|
||||
|
|
|
|||
|
|
@ -2563,10 +2563,10 @@ msgstr "M600 filamentbyte. Ladda en ny filament eller mata ut den gamla."
|
|||
msgid "Sensitivity"
|
||||
msgstr "Känslighet"
|
||||
|
||||
#. MSG_MBL_FAILED_Z_CAL c=20 r=4
|
||||
#. MSG_MBL_FAILED c=20 r=4
|
||||
#: ../../Firmware/Marlin_main.cpp:3038 ../../Firmware/messages.cpp:203
|
||||
msgid "Mesh bed leveling failed. Please run Z calibration."
|
||||
msgstr "Bäddnivelleringen felade. Kör Z-kalibrering."
|
||||
msgid "Mesh bed leveling failed. Print canceled."
|
||||
msgstr "Bäddnivelleringen felade."
|
||||
|
||||
#. MSG_SET_READY c=18
|
||||
#: ../../Firmware/messages.cpp:105 ../../Firmware/ultralcd.cpp:5265
|
||||
|
|
|
|||
Loading…
Reference in New Issue