Kaynağa Gözat

heating up santity, formarly knows as "watchdog", but renamed due to the existance of the real watchdog, works now.

Bernhard 13 yıl önce
ebeveyn
işleme
88ee053af0
3 değiştirilmiş dosya ile 25 ekleme ve 12 silme
  1. 5
    5
      Marlin/Configuration.h
  2. 16
    3
      Marlin/temperature.cpp
  3. 4
    4
      Marlin/temperature.h

+ 5
- 5
Marlin/Configuration.h Dosyayı Görüntüle

58
 
58
 
59
 #define BED_CHECK_INTERVAL 5000 //ms
59
 #define BED_CHECK_INTERVAL 5000 //ms
60
 
60
 
61
-//// Experimental watchdog and minimal temp
62
-// The watchdog waits for the watchperiod in milliseconds whenever an M104 or M109 increases the target temperature
63
-// If the temperature has not increased at the end of that period, the target temperature is set to zero. It can be reset with another M104/M109
64
-/// CURRENTLY NOT IMPLEMENTED AND UNUSEABLE
65
-//#define WATCHPERIOD 5000 //5 seconds
61
+//// Heating sanity check:
62
+// This waits for the watchperiod in milliseconds whenever an M104 or M109 increases the target temperature
63
+// If the temperature has not increased at the end of that period, the target temperature is set to zero. 
64
+// It can be reset with another M104/M109
65
+//#define WATCHPERIOD 20000 //20 seconds
66
 
66
 
67
 // Actual temperature must be close to target for this long before M109 returns success
67
 // Actual temperature must be close to target for this long before M109 returns success
68
 //#define TEMP_RESIDENCY_TIME 20  // (seconds)
68
 //#define TEMP_RESIDENCY_TIME 20  // (seconds)

+ 16
- 3
Marlin/temperature.cpp Dosyayı Görüntüle

88
 #endif //PIDTEMP
88
 #endif //PIDTEMP
89
   
89
   
90
 #ifdef WATCHPERIOD
90
 #ifdef WATCHPERIOD
91
-  static int watch_raw[3] = {-1000,-1000,-1000};
91
+  static int watch_oldtemp[3] = {0,0,0};
92
   static unsigned long watchmillis = 0;
92
   static unsigned long watchmillis = 0;
93
 #endif //WATCHPERIOD
93
 #endif //WATCHPERIOD
94
 
94
 
186
       WRITE(HEATER_0_PIN,LOW);
186
       WRITE(HEATER_0_PIN,LOW);
187
     }    
187
     }    
188
   #endif
188
   #endif
189
-    
189
+  
190
+  #ifdef WATCHPERIOD
191
+    if(watchmillis && millis() - watchmillis > WATCHPERIOD){
192
+        if(watch_oldtemp[TEMPSENSOR_HOTEND_0] >= degHotend(active_extruder)){
193
+            setTargetHotend(0,active_extruder);
194
+            LCD_MESSAGEPGM("Heating failed");
195
+            SERIAL_ECHO_START;
196
+            SERIAL_ECHOLN("Heating failed");
197
+        }else{
198
+            watchmillis = 0;
199
+        }
200
+    }
201
+  #endif
202
+  
190
   if(millis() - previous_millis_bed_heater < BED_CHECK_INTERVAL)
203
   if(millis() - previous_millis_bed_heater < BED_CHECK_INTERVAL)
191
     return;
204
     return;
192
   previous_millis_bed_heater = millis();
205
   previous_millis_bed_heater = millis();
426
   if(isHeatingHotend0())
439
   if(isHeatingHotend0())
427
   {
440
   {
428
     watchmillis = max(1,millis());
441
     watchmillis = max(1,millis());
429
-    watch_raw[TEMPSENSOR_HOTEND_0] = current_raw[TEMPSENSOR_HOTEND_0];
442
+    watch_oldtemp[TEMPSENSOR_HOTEND_0] = degHotend(0);
430
   }
443
   }
431
   else
444
   else
432
   {
445
   {

+ 4
- 4
Marlin/temperature.h Dosyayı Görüntüle

49
   extern float pid_setpoint ;
49
   extern float pid_setpoint ;
50
 #endif
50
 #endif
51
   
51
   
52
-#ifdef WATCHPERIOD
53
-  extern int watch_raw[3] ;
54
-  extern unsigned long watchmillis;
55
-#endif
52
+// #ifdef WATCHPERIOD
53
+//   extern int watch_raw[3] ;
54
+//   extern unsigned long watchmillis;
55
+// #endif
56
 
56
 
57
 
57
 
58
 
58
 

Loading…
İptal
Kaydet