power panic in absolute mode fixed, but some e steps are probably missing

This commit is contained in:
PavelSindler 2017-11-29 14:05:47 +01:00
parent 26cdb75cf7
commit 74441ce3a1

View File

@ -7108,7 +7108,8 @@ void uvlo_()
planner_abort_hard(); planner_abort_hard();
// Store the current extruder position. // Store the current extruder position.
eeprom_update_float((float*)(EEPROM_UVLO_CURRENT_POSITION_E), st_get_position_mm(E_AXIS)); // eeprom_update_float((float*)(EEPROM_UVLO_CURRENT_POSITION_E), st_get_position_mm(E_AXIS));
eeprom_update_float((float*)(EEPROM_UVLO_CURRENT_POSITION_E), current_position[E_AXIS]);
eeprom_update_byte((uint8_t*)EEPROM_UVLO_E_ABS, axis_relative_modes[3]?0:1); eeprom_update_byte((uint8_t*)EEPROM_UVLO_E_ABS, axis_relative_modes[3]?0:1);
// Clean the input command queue. // Clean the input command queue.
@ -7259,16 +7260,6 @@ void recover_print(uint8_t automatic) {
enquecommand_P(PSTR("G1 E5 F120")); //Extrude some filament to stabilize pessure enquecommand_P(PSTR("G1 E5 F120")); //Extrude some filament to stabilize pessure
} }
enquecommand_P(PSTR("G1 E" STRINGIFY(-DEFAULT_RETRACTION)" F480")); enquecommand_P(PSTR("G1 E" STRINGIFY(-DEFAULT_RETRACTION)" F480"));
if (eeprom_read_byte((uint8_t*)EEPROM_UVLO_E_ABS))
{
float extruder_abs_pos = eeprom_read_float((float*)(EEPROM_UVLO_CURRENT_POSITION_E));
enquecommand_P(PSTR("M82")); //E axis abslute mode
// current_position[E_AXIS] = extruder_abs_pos;
// plan_set_e_position(extruder_abs_pos);
sprintf_P(cmd, PSTR("G92 E"));
dtostrf(extruder_abs_pos, 6, 3, cmd + strlen(cmd));
enquecommand(cmd);
}
// Mark the power panic status as inactive. // Mark the power panic status as inactive.
eeprom_update_byte((uint8_t*)EEPROM_UVLO, 0); eeprom_update_byte((uint8_t*)EEPROM_UVLO, 0);
@ -7405,6 +7396,16 @@ void restore_print_from_eeprom() {
// Set the feedrate saved at the power panic. // Set the feedrate saved at the power panic.
sprintf_P(cmd, PSTR("G1 F%d"), feedrate_rec); sprintf_P(cmd, PSTR("G1 F%d"), feedrate_rec);
enquecommand(cmd); enquecommand(cmd);
if (eeprom_read_byte((uint8_t*)EEPROM_UVLO_E_ABS))
{
float extruder_abs_pos = eeprom_read_float((float*)(EEPROM_UVLO_CURRENT_POSITION_E));
enquecommand_P(PSTR("M82")); //E axis abslute mode
// current_position[E_AXIS] = extruder_abs_pos;
// plan_set_e_position(extruder_abs_pos);
sprintf_P(cmd, PSTR("G92 E"));
dtostrf(extruder_abs_pos, 6, 3, cmd + strlen(cmd));
enquecommand(cmd);
}
// Set the fan speed saved at the power panic. // Set the fan speed saved at the power panic.
strcpy_P(cmd, PSTR("M106 S")); strcpy_P(cmd, PSTR("M106 S"));
strcat(cmd, itostr3(int(fan_speed_rec))); strcat(cmd, itostr3(int(fan_speed_rec)));