From 73cc1c9c8a51689c0945791054dcf5658ad57050 Mon Sep 17 00:00:00 2001 From: Robert Pelnar Date: Tue, 26 Sep 2017 03:21:33 +0200 Subject: [PATCH] =?UTF-8?q?initial=20state=20of=20crash=20detect=20and=20f?= =?UTF-8?q?ilament=20sensor=20is=20ON=20slowed=20down=20return=20speed=20f?= =?UTF-8?q?rom=20crash=20detect=20after=20home=20Added=20babystep=20apply?= =?UTF-8?q?=20after=20return=20from=20crash=20detect=20(don=E2=80=99t=20kn?= =?UTF-8?q?ow=20if=20it=E2=80=99s=20accurate)=20Added=20D10=20to=20set=20m?= =?UTF-8?q?achine=20to=20XYZ=20correctly=20calibrated=20Added=20resume=20d?= =?UTF-8?q?ebug=20directive=20to=20mask=20additional=20menu=20item?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Firmware/Marlin_main.cpp | 13 +++++++++---- Firmware/tmc2130.cpp | 2 +- Firmware/ultralcd.cpp | 6 ++++-- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index 3b77c51a..4b849416 100644 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -586,6 +586,7 @@ void crashdet_stop_and_save_print() void crashdet_restore_print_and_continue() { restore_print_from_ram_and_continue(0); //XYZ = orig, E - no change + babystep_apply(); } @@ -614,7 +615,7 @@ void fsensor_restore_print_and_continue() } -bool fsensor_enabled = false; +bool fsensor_enabled = true; bool fsensor_ignore_error = true; bool fsensor_M600 = false; long fsensor_prev_pos_e = 0; @@ -1053,10 +1054,11 @@ void setup() eeprom_write_byte((uint8_t*)EEPROM_UVLO, 0); } -#ifndef DEBUG_DISABLE_STARTMSGS check_babystep(); //checking if Z babystep is in allowed range setup_uvlo_interrupt(); +#ifndef DEBUG_DISABLE_STARTMSGS + if (calibration_status() == CALIBRATION_STATUS_ASSEMBLED || calibration_status() == CALIBRATION_STATUS_UNKNOWN) { // Reset the babystepping values, so the printer will not move the Z axis up when the babystepping is enabled. @@ -5754,6 +5756,9 @@ case 404: //M404 Enter the nominal filament width (3mm, 1.75mm ) N<3.0> or disp MYSERIAL.print("selectedSerialPort = "); MYSERIAL.println(selectedSerialPort, DEC); break; + case 10: // D10 - Tell the printer that XYZ calibration went OK + calibration_status_store(CALIBRATION_STATUS_LIVE_ADJUST); + break; case 999: { MYSERIAL.println("D999 - crash"); @@ -7298,7 +7303,7 @@ void stop_and_save_print_to_ram(float z_move, float e_move) // card.closefile(); saved_printing = true; sei(); - if ((z_move != 0) || (e_move != 0)) { // extruder and z move + if ((z_move != 0) || (e_move != 0)) { // extruder or z move #if 1 // Rather than calling plan_buffer_line directly, push the move into the command queue, char buf[48]; @@ -7332,7 +7337,7 @@ void restore_print_from_ram_and_continue(float e_move) feedrate = saved_feedrate2; //restore feedrate float e = saved_pos[E_AXIS] - e_move; plan_set_e_position(e); - plan_buffer_line(saved_pos[X_AXIS], saved_pos[Y_AXIS], saved_pos[Z_AXIS], saved_pos[E_AXIS], homing_feedrate[Z_AXIS], active_extruder); + plan_buffer_line(saved_pos[X_AXIS], saved_pos[Y_AXIS], saved_pos[Z_AXIS], saved_pos[E_AXIS], homing_feedrate[Z_AXIS]/10, active_extruder); st_synchronize(); memcpy(current_position, saved_pos, sizeof(saved_pos)); memcpy(destination, current_position, sizeof(destination)); diff --git a/Firmware/tmc2130.cpp b/Firmware/tmc2130.cpp index 6fe8adba..f320c952 100644 --- a/Firmware/tmc2130.cpp +++ b/Firmware/tmc2130.cpp @@ -56,7 +56,7 @@ uint32_t tmc2130_sg_pos[4] = {0, 0, 0, 0}; uint8_t sg_homing_axes_mask = 0x00; -bool tmc2130_sg_stop_on_crash = false; +bool tmc2130_sg_stop_on_crash = true; bool tmc2130_sg_crash = false; uint8_t tmc2130_diag_mask = 0x00; uint16_t tmc2130_sg_err[4] = {0, 0, 0, 0}; diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index 54b88ef2..77196d8b 100644 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -105,9 +105,9 @@ int8_t SDscrool = 0; int8_t SilentModeMenu = 0; -int8_t FSensorStateMenu = 0; +int8_t FSensorStateMenu = 1; -int8_t CrashDetectMenu = 0; +int8_t CrashDetectMenu = 1; extern void fsensor_enable(); extern void fsensor_disable(); @@ -3869,10 +3869,12 @@ static void lcd_main_menu() MENU_ITEM(back, MSG_WATCH, lcd_status_screen); +#ifdef RESUME_DEBUG if (!saved_printing) MENU_ITEM(function, PSTR("tst - Save"), lcd_menu_test_save); else MENU_ITEM(function, PSTR("tst - Restore"), lcd_menu_test_restore); +#ifdef //RESUME_DEBUG #ifdef TMC2130_DEBUG MENU_ITEM(function, PSTR("recover print"), recover_print);