Przeglądaj źródła

Enable WATCH_TEMP_PERIOD by default

Scott Lahteine 10 lat temu
rodzic
commit
54deb9eea3

+ 2
- 2
Marlin/Configuration_adv.h Wyświetl plik

@@ -19,8 +19,8 @@
19 19
 // If the temperature has not increased at the end of that period, the target temperature is set to zero.
20 20
 // It can be reset with another M104/M109. This check is also only triggered if the target temperature and
21 21
 // the current temperature differ by at least 2x WATCH_TEMP_INCREASE
22
-//#define WATCH_TEMP_PERIOD 40000 //40 seconds
23
-//#define WATCH_TEMP_INCREASE 10  //Heat up at least 10 degree in 20 seconds
22
+#define WATCH_TEMP_PERIOD 10000 // 10 seconds
23
+#define WATCH_TEMP_INCREASE 2  // Heat up at least 2 degrees in 10 seconds
24 24
 
25 25
 #ifdef PIDTEMP
26 26
   // this adds an experimental additional term to the heating power, proportional to the extrusion speed.

+ 7
- 2
Marlin/Marlin_main.cpp Wyświetl plik

@@ -3166,7 +3166,10 @@ inline void gcode_M104() {
3166 3166
       if (dual_x_carriage_mode == DXC_DUPLICATION_MODE && target_extruder == 0)
3167 3167
         setTargetHotend1(temp == 0.0 ? 0.0 : temp + duplicate_extruder_temp_offset);
3168 3168
     #endif
3169
-    setWatch();
3169
+
3170
+    #ifdef WATCH_TEMP_PERIOD
3171
+      start_watching_heaters();
3172
+    #endif
3170 3173
   }
3171 3174
 }
3172 3175
 
@@ -3278,7 +3281,9 @@ inline void gcode_M109() {
3278 3281
     if (code_seen('B')) autotemp_max = code_value();
3279 3282
   #endif
3280 3283
 
3281
-  setWatch();
3284
+  #ifdef WATCH_TEMP_PERIOD
3285
+    start_watching_heaters();
3286
+  #endif
3282 3287
 
3283 3288
   millis_t temp_ms = millis();
3284 3289
 

+ 2
- 2
Marlin/configurator/config/Configuration_adv.h Wyświetl plik

@@ -19,8 +19,8 @@
19 19
 // If the temperature has not increased at the end of that period, the target temperature is set to zero.
20 20
 // It can be reset with another M104/M109. This check is also only triggered if the target temperature and
21 21
 // the current temperature differ by at least 2x WATCH_TEMP_INCREASE
22
-//#define WATCH_TEMP_PERIOD 40000 //40 seconds
23
-//#define WATCH_TEMP_INCREASE 10  //Heat up at least 10 degree in 20 seconds
22
+#define WATCH_TEMP_PERIOD 10000 // 10 seconds
23
+#define WATCH_TEMP_INCREASE 2  // Heat up at least 2 degrees in 10 seconds
24 24
 
25 25
 #ifdef PIDTEMP
26 26
   // this adds an experimental additional term to the heating power, proportional to the extrusion speed.

+ 2
- 2
Marlin/example_configurations/Felix/Configuration_adv.h Wyświetl plik

@@ -19,8 +19,8 @@
19 19
 // If the temperature has not increased at the end of that period, the target temperature is set to zero.
20 20
 // It can be reset with another M104/M109. This check is also only triggered if the target temperature and
21 21
 // the current temperature differ by at least 2x WATCH_TEMP_INCREASE
22
-//#define WATCH_TEMP_PERIOD 40000 //40 seconds
23
-//#define WATCH_TEMP_INCREASE 10  //Heat up at least 10 degree in 20 seconds
22
+#define WATCH_TEMP_PERIOD 10000 // 10 seconds
23
+#define WATCH_TEMP_INCREASE 2  // Heat up at least 2 degrees in 10 seconds
24 24
 
25 25
 #ifdef PIDTEMP
26 26
   // this adds an experimental additional term to the heating power, proportional to the extrusion speed.

+ 2
- 2
Marlin/example_configurations/Hephestos/Configuration_adv.h Wyświetl plik

@@ -19,8 +19,8 @@
19 19
 // If the temperature has not increased at the end of that period, the target temperature is set to zero.
20 20
 // It can be reset with another M104/M109. This check is also only triggered if the target temperature and
21 21
 // the current temperature differ by at least 2x WATCH_TEMP_INCREASE
22
-//#define WATCH_TEMP_PERIOD 40000 //40 seconds
23
-//#define WATCH_TEMP_INCREASE 10  //Heat up at least 10 degree in 20 seconds
22
+#define WATCH_TEMP_PERIOD 10000 // 10 seconds
23
+#define WATCH_TEMP_INCREASE 2  // Heat up at least 2 degrees in 10 seconds
24 24
 
25 25
 #ifdef PIDTEMP
26 26
   // this adds an experimental additional term to the heating power, proportional to the extrusion speed.

+ 2
- 2
Marlin/example_configurations/K8200/Configuration_adv.h Wyświetl plik

@@ -19,8 +19,8 @@
19 19
 // If the temperature has not increased at the end of that period, the target temperature is set to zero.
20 20
 // It can be reset with another M104/M109. This check is also only triggered if the target temperature and
21 21
 // the current temperature differ by at least 2x WATCH_TEMP_INCREASE
22
-//#define WATCH_TEMP_PERIOD 40000 //40 seconds
23
-//#define WATCH_TEMP_INCREASE 10  //Heat up at least 10 degree in 20 seconds
22
+#define WATCH_TEMP_PERIOD 10000 // 10 seconds
23
+#define WATCH_TEMP_INCREASE 2  // Heat up at least 2 degrees in 10 seconds
24 24
 
25 25
 #ifdef PIDTEMP
26 26
   // this adds an experimental additional term to the heating power, proportional to the extrusion speed.

+ 2
- 2
Marlin/example_configurations/SCARA/Configuration_adv.h Wyświetl plik

@@ -19,8 +19,8 @@
19 19
 // If the temperature has not increased at the end of that period, the target temperature is set to zero.
20 20
 // It can be reset with another M104/M109. This check is also only triggered if the target temperature and
21 21
 // the current temperature differ by at least 2x WATCH_TEMP_INCREASE
22
-//#define WATCH_TEMP_PERIOD 40000 //40 seconds
23
-//#define WATCH_TEMP_INCREASE 10  //Heat up at least 10 degree in 20 seconds
22
+#define WATCH_TEMP_PERIOD 10000 // 10 seconds
23
+#define WATCH_TEMP_INCREASE 2  // Heat up at least 2 degrees in 10 seconds
24 24
 
25 25
 #ifdef PIDTEMP
26 26
   // this adds an experimental additional term to the heating power, proportional to the extrusion speed.

+ 2
- 2
Marlin/example_configurations/WITBOX/Configuration_adv.h Wyświetl plik

@@ -19,8 +19,8 @@
19 19
 // If the temperature has not increased at the end of that period, the target temperature is set to zero.
20 20
 // It can be reset with another M104/M109. This check is also only triggered if the target temperature and
21 21
 // the current temperature differ by at least 2x WATCH_TEMP_INCREASE
22
-//#define WATCH_TEMP_PERIOD 40000 //40 seconds
23
-//#define WATCH_TEMP_INCREASE 10  //Heat up at least 10 degree in 20 seconds
22
+#define WATCH_TEMP_PERIOD 10000 // 10 seconds
23
+#define WATCH_TEMP_INCREASE 2  // Heat up at least 2 degrees in 10 seconds
24 24
 
25 25
 #ifdef PIDTEMP
26 26
   // this adds an experimental additional term to the heating power, proportional to the extrusion speed.

+ 2
- 2
Marlin/example_configurations/delta/generic/Configuration_adv.h Wyświetl plik

@@ -19,8 +19,8 @@
19 19
 // If the temperature has not increased at the end of that period, the target temperature is set to zero.
20 20
 // It can be reset with another M104/M109. This check is also only triggered if the target temperature and
21 21
 // the current temperature differ by at least 2x WATCH_TEMP_INCREASE
22
-//#define WATCH_TEMP_PERIOD 40000 //40 seconds
23
-//#define WATCH_TEMP_INCREASE 10  //Heat up at least 10 degree in 20 seconds
22
+#define WATCH_TEMP_PERIOD 10000 // 10 seconds
23
+#define WATCH_TEMP_INCREASE 2  // Heat up at least 2 degrees in 10 seconds
24 24
 
25 25
 #ifdef PIDTEMP
26 26
   // this adds an experimental additional term to the heating power, proportional to the extrusion speed.

+ 2
- 2
Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h Wyświetl plik

@@ -19,8 +19,8 @@
19 19
 // If the temperature has not increased at the end of that period, the target temperature is set to zero.
20 20
 // It can be reset with another M104/M109. This check is also only triggered if the target temperature and
21 21
 // the current temperature differ by at least 2x WATCH_TEMP_INCREASE
22
-//#define WATCH_TEMP_PERIOD 40000 //40 seconds
23
-//#define WATCH_TEMP_INCREASE 10  //Heat up at least 10 degree in 20 seconds
22
+#define WATCH_TEMP_PERIOD 10000 // 10 seconds
23
+#define WATCH_TEMP_INCREASE 2  // Heat up at least 2 degrees in 10 seconds
24 24
 
25 25
 #ifdef PIDTEMP
26 26
   // this adds an experimental additional term to the heating power, proportional to the extrusion speed.

+ 2
- 2
Marlin/example_configurations/makibox/Configuration_adv.h Wyświetl plik

@@ -19,8 +19,8 @@
19 19
 // If the temperature has not increased at the end of that period, the target temperature is set to zero.
20 20
 // It can be reset with another M104/M109. This check is also only triggered if the target temperature and
21 21
 // the current temperature differ by at least 2x WATCH_TEMP_INCREASE
22
-//#define WATCH_TEMP_PERIOD 40000 //40 seconds
23
-//#define WATCH_TEMP_INCREASE 10  //Heat up at least 10 degree in 20 seconds
22
+#define WATCH_TEMP_PERIOD 10000 // 10 seconds
23
+#define WATCH_TEMP_INCREASE 2  // Heat up at least 2 degrees in 10 seconds
24 24
 
25 25
 #ifdef PIDTEMP
26 26
   // this adds an experimental additional term to the heating power, proportional to the extrusion speed.

+ 2
- 2
Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h Wyświetl plik

@@ -19,8 +19,8 @@
19 19
 // If the temperature has not increased at the end of that period, the target temperature is set to zero.
20 20
 // It can be reset with another M104/M109. This check is also only triggered if the target temperature and
21 21
 // the current temperature differ by at least 2x WATCH_TEMP_INCREASE
22
-//#define WATCH_TEMP_PERIOD 40000 //40 seconds
23
-//#define WATCH_TEMP_INCREASE 10  //Heat up at least 10 degree in 20 seconds
22
+#define WATCH_TEMP_PERIOD 10000 // 10 seconds
23
+#define WATCH_TEMP_INCREASE 2  // Heat up at least 2 degrees in 10 seconds
24 24
 
25 25
 #ifdef PIDTEMP
26 26
   // this adds an experimental additional term to the heating power, proportional to the extrusion speed.

+ 20
- 19
Marlin/temperature.cpp Wyświetl plik

@@ -171,7 +171,7 @@ static float analog2tempBed(int raw);
171 171
 static void updateTemperaturesFromRawValues();
172 172
 
173 173
 #ifdef WATCH_TEMP_PERIOD
174
-  int watch_start_temp[EXTRUDERS] = { 0 };
174
+  int watch_target_temp[EXTRUDERS] = { 0 };
175 175
   millis_t watch_heater_next_ms[EXTRUDERS] = { 0 };
176 176
 #endif
177 177
 
@@ -625,11 +625,12 @@ void manage_heater() {
625 625
       // Is it time to check this extruder's heater?
626 626
       if (watch_heater_next_ms[e] && ms > watch_heater_next_ms[e]) {
627 627
         // Has it failed to increase enough?
628
-        if (degHotend(e) < watch_start_temp[e] + WATCH_TEMP_INCREASE) {
628
+        if (degHotend(e) < watch_target_temp[e]) {
629 629
           // Stop!
630 630
           _temp_error(e, MSG_HEATING_FAILED, MSG_HEATING_FAILED_LCD);
631 631
         }
632 632
         else {
633
+          // Only check once per M104/M109
633 634
           watch_heater_next_ms[e] = 0;
634 635
         }
635 636
       }
@@ -997,24 +998,24 @@ void tp_init() {
997 998
   #endif //BED_MAXTEMP
998 999
 }
999 1000
 
1000
-/**
1001
- * Start Heating Sanity Check for hotends that are below
1002
- * their target temperature by a configurable margin.
1003
- * This is called when the temperature is set. (M104, M109)
1004
- */
1005
-void setWatch() {
1006
-  #ifdef WATCH_TEMP_PERIOD
1007
-    millis_t ms = millis() + WATCH_TEMP_PERIOD;
1008
-    for (int e = 0; e < EXTRUDERS; e++) {
1009
-      if (degHotend(e) < degTargetHotend(e) - (WATCH_TEMP_INCREASE * 2)) {
1010
-        watch_start_temp[e] = degHotend(e);
1011
-        watch_heater_next_ms[e] = ms;
1001
+#ifdef WATCH_TEMP_PERIOD
1002
+  /**
1003
+   * Start Heating Sanity Check for hotends that are below
1004
+   * their target temperature by a configurable margin.
1005
+   * This is called when the temperature is set. (M104, M109)
1006
+   */
1007
+  void start_watching_heaters() {
1008
+      millis_t ms = millis() + WATCH_TEMP_PERIOD;
1009
+      for (int e = 0; e < EXTRUDERS; e++) {
1010
+        if (degHotend(e) < degTargetHotend(e) - (WATCH_TEMP_INCREASE * 2)) {
1011
+          watch_target_temp[e] = degHotend(e) + WATCH_TEMP_INCREASE;
1012
+          watch_heater_next_ms[e] = ms;
1013
+        }
1014
+        else
1015
+          watch_heater_next_ms[e] = 0;
1012 1016
       }
1013
-      else
1014
-        watch_heater_next_ms[e] = 0;
1015
-    }
1016
-  #endif
1017
-}
1017
+  }
1018
+#endif
1018 1019
 
1019 1020
 #if HAS_HEATER_THERMAL_PROTECTION || HAS_BED_THERMAL_PROTECTION
1020 1021
 

+ 4
- 1
Marlin/temperature.h Wyświetl plik

@@ -130,7 +130,6 @@ HOTEND_ROUTINES(0);
130 130
 
131 131
 int getHeaterPower(int heater);
132 132
 void disable_all_heaters();
133
-void setWatch();
134 133
 void updatePID();
135 134
 
136 135
 void PID_autotune(float temp, int extruder, int ncycles);
@@ -138,6 +137,10 @@ void PID_autotune(float temp, int extruder, int ncycles);
138 137
 void setExtruderAutoFanState(int pin, bool state);
139 138
 void checkExtruderAutoFans();
140 139
 
140
+#ifdef WATCH_TEMP_PERIOD
141
+  void start_watching_heaters();
142
+#endif
143
+
141 144
 FORCE_INLINE void autotempShutdown() {
142 145
   #ifdef AUTOTEMP
143 146
     if (autotemp_enabled) {

+ 3
- 1
Marlin/ultralcd.cpp Wyświetl plik

@@ -521,7 +521,9 @@ void _lcd_preheat(int endnum, const float temph, const float tempb, const int fa
521 521
   setTargetBed(tempb);
522 522
   fanSpeed = fan;
523 523
   lcd_return_to_status();
524
-  setWatch(); // heater sanity check timer
524
+  #ifdef WATCH_TEMP_PERIOD
525
+    start_watching_heaters();
526
+  #endif
525 527
 }
526 528
 void lcd_preheat_pla0() { _lcd_preheat(0, plaPreheatHotendTemp, plaPreheatHPBTemp, plaPreheatFanSpeed); }
527 529
 void lcd_preheat_abs0() { _lcd_preheat(0, absPreheatHotendTemp, absPreheatHPBTemp, absPreheatFanSpeed); }

Ładowanie…
Anuluj
Zapisz