Browse Source

Use _temp_error() for all errors thrown by different mechanisms

Now ending in an endless loop.
Tidy up the output format.
We now get:
ERRORTEXT ", system stopped! Heater_ID: " HEATERID

Where ERRORTEXT can be:
"Heating failed"
"Thermal Runaway"
"MAXTEMP triggered"
"MINTEMP triggered"
and soon
"Thermal Jump"

HEATERID can be
0, 1, 2 ,3 , "bed"

This messages are always followed by the common:
"Printer stopped due to errors. Fix the error and use M999 to restart. (Temperature is reset. Set it after restarting)"
AnHardt 10 years ago
parent
commit
70163dafb9
2 changed files with 18 additions and 25 deletions
  1. 9
    8
      Marlin/language.h
  2. 9
    17
      Marlin/temperature.cpp

+ 9
- 8
Marlin/language.h View File

222
 #define MSG_PID_DEBUG_PTERM                 " pTerm "
222
 #define MSG_PID_DEBUG_PTERM                 " pTerm "
223
 #define MSG_PID_DEBUG_ITERM                 " iTerm "
223
 #define MSG_PID_DEBUG_ITERM                 " iTerm "
224
 #define MSG_PID_DEBUG_DTERM                 " dTerm "
224
 #define MSG_PID_DEBUG_DTERM                 " dTerm "
225
-#define MSG_HEATING_FAILED                  "Heating failed"
226
-#define MSG_EXTRUDER_SWITCHED_OFF           "Extruder switched off. Temperature difference between temp sensors is too high !"
227
-
228
 #define MSG_INVALID_EXTRUDER_NUM            " - Invalid extruder number !"
225
 #define MSG_INVALID_EXTRUDER_NUM            " - Invalid extruder number !"
229
-#define MSG_THERMAL_RUNAWAY_STOP            "Thermal Runaway, system stopped! Heater_ID: "
230
-#define MSG_SWITCHED_OFF_MAX                " switched off. MAXTEMP triggered !!"
231
-#define MSG_MINTEMP_EXTRUDER_OFF            ": Extruder switched off. MINTEMP triggered !"
232
-#define MSG_MAXTEMP_EXTRUDER_OFF            ": Extruder" MSG_SWITCHED_OFF_MAX
233
-#define MSG_MAXTEMP_BED_OFF                 "Heated bed" MSG_SWITCHED_OFF_MAX
226
+
227
+#define MSG_HEATER_BED                      "bed"
228
+#define MSG_STOPPED_HEATER                  ", system stopped! Heater_ID: "
229
+#define MSG_REDUNDANCY                      "Heater switched off. Temperature difference between temp sensors is too high !"
230
+#define MSG_T_HEATING_FAILED                "Heating failed"
231
+#define MSG_T_THERMAL_RUNAWAY               "Thermal Runaway"
232
+#define MSG_T_MAXTEMP                       "MAXTEMP triggered"
233
+#define MSG_T_MINTEMP                       "MINTEMP triggered"
234
+
234
 
235
 
235
 // LCD Menu Messages
236
 // LCD Menu Messages
236
 
237
 

+ 9
- 17
Marlin/temperature.cpp View File

449
 inline void _temp_error(int e, const char *serial_msg, const char *lcd_msg) {
449
 inline void _temp_error(int e, const char *serial_msg, const char *lcd_msg) {
450
   if (IsRunning()) {
450
   if (IsRunning()) {
451
     SERIAL_ERROR_START;
451
     SERIAL_ERROR_START;
452
-    if (e >= 0) SERIAL_ERRORLN((int)e);
453
     serialprintPGM(serial_msg);
452
     serialprintPGM(serial_msg);
454
-    MYSERIAL.write('\n');
453
+    SERIAL_ERRORPGM(MSG_STOPPED_HEATER);
454
+    if (e >= 0) SERIAL_ERRORLN((int)e); else SERIAL_ERRORLNPGM(MSG_HEATER_BED);
455
     #ifdef ULTRA_LCD
455
     #ifdef ULTRA_LCD
456
       lcd_setalertstatuspgm(lcd_msg);
456
       lcd_setalertstatuspgm(lcd_msg);
457
     #endif
457
     #endif
458
   }
458
   }
459
   #ifndef BOGUS_TEMPERATURE_FAILSAFE_OVERRIDE
459
   #ifndef BOGUS_TEMPERATURE_FAILSAFE_OVERRIDE
460
+    disable_all_steppers();
460
     Stop();
461
     Stop();
462
+    while (true) lcd_update();
461
   #endif
463
   #endif
462
 }
464
 }
463
 
465
 
464
 void max_temp_error(uint8_t e) {
466
 void max_temp_error(uint8_t e) {
465
   disable_all_heaters();
467
   disable_all_heaters();
466
-  _temp_error(e, PSTR(MSG_MAXTEMP_EXTRUDER_OFF), PSTR(MSG_ERR_MAXTEMP));
468
+  _temp_error(e, PSTR(MSG_T_MAXTEMP), PSTR(MSG_ERR_MAXTEMP));
467
 }
469
 }
468
 void min_temp_error(uint8_t e) {
470
 void min_temp_error(uint8_t e) {
469
   disable_all_heaters();
471
   disable_all_heaters();
470
-  _temp_error(e, PSTR(MSG_MINTEMP_EXTRUDER_OFF), PSTR(MSG_ERR_MINTEMP));
472
+  _temp_error(e, PSTR(MSG_T_MINTEMP), PSTR(MSG_ERR_MINTEMP));
471
 }
473
 }
472
 void bed_max_temp_error(void) {
474
 void bed_max_temp_error(void) {
473
   #if HAS_HEATER_BED
475
   #if HAS_HEATER_BED
474
     WRITE_HEATER_BED(0);
476
     WRITE_HEATER_BED(0);
475
   #endif
477
   #endif
476
-  _temp_error(-1, PSTR(MSG_MAXTEMP_BED_OFF), PSTR(MSG_ERR_MAXTEMP_BED));
478
+  _temp_error(-1, PSTR(MSG_T_MAXTEMP), PSTR(MSG_ERR_MAXTEMP_BED));
477
 }
479
 }
478
 
480
 
479
 float get_pid_output(int e) {
481
 float get_pid_output(int e) {
627
         // Has it failed to increase enough?
629
         // Has it failed to increase enough?
628
         if (degHotend(e) < watch_target_temp[e]) {
630
         if (degHotend(e) < watch_target_temp[e]) {
629
           // Stop!
631
           // Stop!
630
-          disable_all_heaters();
631
-          _temp_error(e, PSTR(MSG_HEATING_FAILED), PSTR(MSG_HEATING_FAILED_LCD));
632
+          _temp_error(e, PSTR(MSG_T_HEATING_FAILED), PSTR(MSG_HEATING_FAILED_LCD));
632
         }
633
         }
633
         else {
634
         else {
634
           // Start again if the target is still far off
635
           // Start again if the target is still far off
1070
           *state = TRRunaway;
1071
           *state = TRRunaway;
1071
         break;
1072
         break;
1072
       case TRRunaway:
1073
       case TRRunaway:
1073
-        SERIAL_ERROR_START;
1074
-        SERIAL_ERRORLNPGM(MSG_THERMAL_RUNAWAY_STOP);
1075
-        if (heater_id < 0) SERIAL_ERRORLNPGM("bed"); else SERIAL_ERRORLN(heater_id);
1076
-        LCD_ALERTMESSAGEPGM(MSG_THERMAL_RUNAWAY);
1077
-        disable_all_heaters();
1078
-        disable_all_steppers();
1079
-        for (;;) {
1080
-          manage_heater();
1081
-          lcd_update();
1082
-        }
1074
+        _temp_error(heater_id, PSTR(MSG_T_THERMAL_RUNAWAY), PSTR(MSG_THERMAL_RUNAWAY));
1083
     }
1075
     }
1084
   }
1076
   }
1085
 
1077
 

Loading…
Cancel
Save