Merge pull request #1945 from NotaRobotexe/fan_er

fan error fix
This commit is contained in:
DRracer 2019-06-24 18:06:22 +02:00 committed by GitHub
commit c34701cc87
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 23 additions and 3 deletions

View File

@ -9387,6 +9387,11 @@ void restore_print_from_ram_and_continue(float e_move)
fanSpeed = saved_fanSpeed; fanSpeed = saved_fanSpeed;
float e = saved_pos[E_AXIS] - e_move; float e = saved_pos[E_AXIS] - e_move;
plan_set_e_position(e); plan_set_e_position(e);
#ifdef FANCHECK
fans_check_enabled = false;
#endif
//first move print head in XY to the saved position: //first move print head in XY to the saved position:
plan_buffer_line(saved_pos[X_AXIS], saved_pos[Y_AXIS], current_position[Z_AXIS], saved_pos[E_AXIS] - e_move, homing_feedrate[Z_AXIS]/13, active_extruder); plan_buffer_line(saved_pos[X_AXIS], saved_pos[Y_AXIS], current_position[Z_AXIS], saved_pos[E_AXIS] - e_move, homing_feedrate[Z_AXIS]/13, active_extruder);
st_synchronize(); st_synchronize();
@ -9397,6 +9402,10 @@ void restore_print_from_ram_and_continue(float e_move)
plan_buffer_line(saved_pos[X_AXIS], saved_pos[Y_AXIS], saved_pos[Z_AXIS], saved_pos[E_AXIS], 35, active_extruder); plan_buffer_line(saved_pos[X_AXIS], saved_pos[Y_AXIS], saved_pos[Z_AXIS], saved_pos[E_AXIS], 35, active_extruder);
st_synchronize(); st_synchronize();
#ifdef FANCHECK
fans_check_enabled = true;
#endif
memcpy(current_position, saved_pos, sizeof(saved_pos)); memcpy(current_position, saved_pos, sizeof(saved_pos));
memcpy(destination, current_position, sizeof(destination)); memcpy(destination, current_position, sizeof(destination));
if (saved_printing_type == PRINTING_TYPE_SD) { //was sd printing if (saved_printing_type == PRINTING_TYPE_SD) { //was sd printing

View File

@ -500,8 +500,9 @@ void checkFanSpeed()
max_print_fan_errors = 15; //15 seconds max_print_fan_errors = 15; //15 seconds
max_extruder_fan_errors = 5; //5 seconds max_extruder_fan_errors = 5; //5 seconds
#endif //FAN_SOFT_PWM #endif //FAN_SOFT_PWM
fans_check_enabled = (eeprom_read_byte((uint8_t*)EEPROM_FAN_CHECK_ENABLED) > 0); if(fans_check_enabled != false)
fans_check_enabled = (eeprom_read_byte((uint8_t*)EEPROM_FAN_CHECK_ENABLED) > 0);
static unsigned char fan_speed_errors[2] = { 0,0 }; static unsigned char fan_speed_errors[2] = { 0,0 };
#if (defined(FANCHECK) && defined(TACH_0) && (TACH_0 >-1)) #if (defined(FANCHECK) && defined(TACH_0) && (TACH_0 >-1))
if ((fan_speed[0] == 0) && (current_temperature[0] > EXTRUDER_AUTO_FAN_TEMPERATURE)) fan_speed_errors[0]++; if ((fan_speed[0] == 0) && (current_temperature[0] > EXTRUDER_AUTO_FAN_TEMPERATURE)) fan_speed_errors[0]++;
@ -560,6 +561,8 @@ void fanSpeedError(unsigned char _fan) {
else { else {
setTargetHotend0(0); setTargetHotend0(0);
SERIAL_ECHOLNPGM("// action:pause"); //for octoprint SERIAL_ECHOLNPGM("// action:pause"); //for octoprint
heating_status = 0;
fan_check_error = EFCE_REPORTED;
} }
switch (_fan) { switch (_fan) {
case 0: // extracting the same code from case 0 and case 1 into a function saves 72B case 0: // extracting the same code from case 0 and case 1 into a function saves 72B

View File

@ -6380,6 +6380,7 @@ static void lcd_test_menu()
void lcd_resume_print() void lcd_resume_print()
{ {
lcd_return_to_status(); lcd_return_to_status();
lcd_reset_alert_level();
lcd_setstatuspgm(_T(MSG_RESUMING_PRINT)); lcd_setstatuspgm(_T(MSG_RESUMING_PRINT));
lcd_reset_alert_level(); //for fan speed error lcd_reset_alert_level(); //for fan speed error
restore_print_from_ram_and_continue(0.0); restore_print_from_ram_and_continue(0.0);
@ -6485,7 +6486,14 @@ static void lcd_main_menu()
} }
else else
{ {
MENU_ITEM_SUBMENU_P(_i("Resume print"), lcd_resume_print);////MSG_RESUME_PRINT #ifdef FANCHECK
checkFanSpeed(); //Check manually to get most recent fan speed status
if(fan_check_error == EFCE_OK)
MENU_ITEM_SUBMENU_P(_i("Resume print"), lcd_resume_print);////MSG_RESUME_PRINT
#else
MENU_ITEM_SUBMENU_P(_i("Resume print"), lcd_resume_print);////MSG_RESUME_PRINT
#endif
} }
MENU_ITEM_SUBMENU_P(_T(MSG_STOP_PRINT), lcd_sdcard_stop); MENU_ITEM_SUBMENU_P(_T(MSG_STOP_PRINT), lcd_sdcard_stop);
} }