Inital Temp Model cal wizard

This commit is contained in:
3d-gussner 2022-11-17 15:19:35 +01:00
parent 12f6f34cf4
commit 7fe1a50899
4 changed files with 47 additions and 5 deletions

View File

@ -545,7 +545,12 @@ enum CalibrationStatus
// For the wizard: factory assembled, needs to run Z calibration.
CALIBRATION_STATUS_Z_CALIBRATION = 240,
// The XYZ calibration has been performed, now it remains to run the V2Calibration.gcode.
#ifdef TEMP_MODEL
// The XYZ calibration has been performed, needs to run Temp model calibration.
CALIBRATION_STATUS_TEMP_MODEL_CALIBRATION = 235,
#endif //TEMP_MODEL
// The XYZ calibration AND OR Temp model calibartion has been performed, now it remains to run the V2Calibration.gcode.
CALIBRATION_STATUS_LIVE_ADJUST = 230,
// Calibrated, ready to print.

View File

@ -1547,6 +1547,12 @@ void setup()
// Show the message.
lcd_show_fullscreen_message_and_wait_P(_T(MSG_FOLLOW_CALIBRATION_FLOW));
}
#ifdef TEMP_MODEL
else if (calibration_status() == CALIBRATION_STATUS_TEMP_MODEL_CALIBRATION) {
lcd_show_fullscreen_message_and_wait_P(_i("Temp model calibration not calibrated yet."));////MSG_TEMP_MODEL_NOT_CAL c=20 c=4
lcd_update_enable(true);
}
#endif //TEMP_MODEL
else if (calibration_status() == CALIBRATION_STATUS_LIVE_ADJUST) {
// Show the message.
lcd_show_fullscreen_message_and_wait_P(_T(MSG_BABYSTEP_Z_NOT_SET));
@ -3406,9 +3412,14 @@ bool gcode_M45(bool onlyZ, int8_t verbosity_level)
lcd_bed_calibration_show_result(result, point_too_far_mask);
if (result >= 0)
{
#ifdef TEMP_MODEL
calibration_status_store(CALIBRATION_STATUS_TEMP_MODEL_CALIBRATION);
if (eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE) != 1) lcd_show_fullscreen_message_and_wait_P(_i("Temp model calibration not calibrated yet."));
#else
// Calibration valid, the machine should be able to print. Advise the user to run the V2Calibration.gcode.
calibration_status_store(CALIBRATION_STATUS_LIVE_ADJUST);
if (eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE) != 1) lcd_show_fullscreen_message_and_wait_P(_T(MSG_BABYSTEP_Z_NOT_SET));
#endif //TEMP_MODEL
final_result = true;
}
}

View File

@ -1056,10 +1056,14 @@ void lcd_commands()
//if (lcd_commands_step == 1 && calibrated()) {
if (lcd_commands_step == 1 && temp_model_valid()) {
enquecommand_P(PSTR("M500"));
if (eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE) == 1) {
lcd_wizard(WizState::IsFil);
} else {
lcd_commands_step = 0;
lcd_commands_type = LcdCommands::Idle;
}
}
}
#endif //TEMP_MODEL
}
@ -4077,6 +4081,9 @@ void lcd_wizard(WizState state)
case CALIBRATION_STATUS_ASSEMBLED: state = S::Selftest; break; //run selftest
case CALIBRATION_STATUS_XYZ_CALIBRATION: state = S::Xyz; break; //run xyz cal.
case CALIBRATION_STATUS_Z_CALIBRATION: state = S::Z; break; //run z cal.
#ifdef TEMP_MODEL
case CALIBRATION_STATUS_TEMP_MODEL_CALIBRATION: state = S::TempModel; break; //run temp model cal.
#endif //TEMP_MODEL
case CALIBRATION_STATUS_LIVE_ADJUST: state = S::IsFil; break; //run live adjust
case CALIBRATION_STATUS_CALIBRATED: end = true; eeprom_update_byte((uint8_t*)EEPROM_WIZARD_ACTIVE, 0); break;
default: state = S::Selftest; break; //if calibration status is unknown, run wizard from the beginning
@ -4094,8 +4101,13 @@ void lcd_wizard(WizState state)
case S::Xyz:
lcd_show_fullscreen_message_and_wait_P(_i("I will run xyz calibration now. It will take approx. 12 mins."));////MSG_WIZARD_XYZ_CAL c=20 r=8
wizard_event = gcode_M45(false, 0);
if (wizard_event) state = S::IsFil;
else end = true;
if (wizard_event) {
#ifdef TEMP_MODEL
state = S::TempModel;
#else
state = S::IsFil;
#endif //TEMP_MODEL
} else end = true;
break;
case S::Z:
lcd_show_fullscreen_message_and_wait_P(_i("Please remove shipping helpers first."));////MSG_REMOVE_SHIPPING_HELPERS c=20 r=3
@ -4119,6 +4131,13 @@ void lcd_wizard(WizState state)
}
else end = true;
break;
#ifdef TEMP_MODEL
case S::TempModel:
lcd_show_fullscreen_message_and_wait_P(_i("Temp model cal. takes apporx. 12 mins."));////MSG_TM_CAL c=20 r=4
lcd_commands_type = LcdCommands::TempModel;
end = true; // Leave wizard temporarily for Temp model cal.
break;
#endif //TEMP_MODEL
case S::IsFil:
//start to preheat nozzle and bed to save some time later
setTargetHotend(PLA_PREHEAT_HOTEND_TEMP, 0);
@ -4195,6 +4214,10 @@ void lcd_wizard(WizState state)
case S::Z: //z cal.
msg = _T(MSG_WIZARD_CALIBRATION_FAILED);
break;
#ifdef TEMP_MODEL
case S::TempModel: //Temp model calibration
// break;
#endif //TEMP_MODEL
case S::Finish: //we are finished
msg = _T(MSG_WIZARD_DONE);

View File

@ -224,6 +224,9 @@ enum class WizState : uint8_t
Selftest, //!< self test
Xyz, //!< xyz calibration
Z, //!< z calibration
#ifdef TEMP_MODEL
TempModel, //!< Temp model calibration
#endif //TEMP_MODEL
IsFil, //!< Is filament loaded? First step of 1st layer calibration
PreheatPla, //!< waiting for preheat nozzle for PLA
Preheat, //!< Preheat for any material