changed Z axis recovery in power panic
This commit is contained in:
parent
8ceca8b9c6
commit
21f068b37a
1 changed files with 10 additions and 7 deletions
|
@ -6914,7 +6914,9 @@ void recover_print() {
|
|||
|
||||
target_temperature[active_extruder] = eeprom_read_byte((uint8_t*)EEPROM_UVLO_TARGET_HOTEND);
|
||||
target_temperature_bed = eeprom_read_byte((uint8_t*)EEPROM_UVLO_TARGET_BED);
|
||||
float z_pos = UVLO_Z_AXIS_SHIFT + eeprom_read_float((float*)(EEPROM_UVLO_CURRENT_POSITION_Z));
|
||||
float z_pos = eeprom_read_float((float*)(EEPROM_UVLO_CURRENT_POSITION_Z));
|
||||
z_pos = z_pos + UVLO_Z_AXIS_SHIFT;
|
||||
|
||||
|
||||
SERIAL_ECHOPGM("Target temperature:");
|
||||
MYSERIAL.println(target_temperature[0]);
|
||||
|
@ -6942,7 +6944,7 @@ void recover_print() {
|
|||
}
|
||||
|
||||
void restore_print_from_eeprom() {
|
||||
float x_rec, y_rec;
|
||||
float x_rec, y_rec, z_pos;
|
||||
int feedrate_rec;
|
||||
uint8_t fan_speed_rec;
|
||||
char cmd[30];
|
||||
|
@ -6951,6 +6953,7 @@ void restore_print_from_eeprom() {
|
|||
char str[5] = ".gco";
|
||||
x_rec = eeprom_read_float((float*)(EEPROM_UVLO_CURRENT_POSITION + 0));
|
||||
y_rec = eeprom_read_float((float*)(EEPROM_UVLO_CURRENT_POSITION + 4));
|
||||
z_pos = eeprom_read_float((float*)(EEPROM_UVLO_CURRENT_POSITION_Z));
|
||||
fan_speed_rec = eeprom_read_byte((uint8_t*)EEPROM_UVLO_FAN_SPEED);
|
||||
EEPROM_read_B(EEPROM_UVLO_FEEDRATE, &feedrate_rec);
|
||||
SERIAL_ECHOPGM("Feedrate:");
|
||||
|
@ -6974,16 +6977,16 @@ void restore_print_from_eeprom() {
|
|||
sprintf_P(cmd, PSTR("M26 S%lu"), position);
|
||||
|
||||
enquecommand(cmd);
|
||||
//enquecommand_P(PSTR("M83")); //E axis relative mode
|
||||
enquecommand_P(PSTR("M83")); //E axis relative mode
|
||||
strcpy(cmd, "G1 X");
|
||||
strcat(cmd, ftostr32(x_rec));
|
||||
strcat(cmd, " Y");
|
||||
strcat(cmd, ftostr32(y_rec));
|
||||
enquecommand(cmd);
|
||||
enquecommand_P(PSTR("G91")); //use relative coordinates
|
||||
enquecommand_P(PSTR("G1 Z" STRINGIFY(-UVLO_Z_AXIS_SHIFT)));
|
||||
enquecommand_P(PSTR("G90")); //use absolute coordinates
|
||||
enquecommand_P(PSTR("M83")); //E axis relative mode
|
||||
strcpy(cmd, "G1 Z");
|
||||
strcat(cmd, ftostr43(z_pos));
|
||||
enquecommand(cmd);
|
||||
|
||||
enquecommand_P(PSTR("G1 E" STRINGIFY(DEFAULT_RETRACTION)" F480"));
|
||||
enquecommand_P(PSTR("G1 E0.5"));
|
||||
sprintf_P(cmd, PSTR("G1 F%d"), feedrate_rec);
|
||||
|
|
Loading…
Reference in a new issue