Bläddra i källkod

Enable WATCH_TEMP_PERIOD by default

Scott Lahteine 10 år sedan
förälder
incheckning
54deb9eea3

+ 2
- 2
Marlin/Configuration_adv.h Visa fil

19
 // If the temperature has not increased at the end of that period, the target temperature is set to zero.
19
 // If the temperature has not increased at the end of that period, the target temperature is set to zero.
20
 // It can be reset with another M104/M109. This check is also only triggered if the target temperature and
20
 // It can be reset with another M104/M109. This check is also only triggered if the target temperature and
21
 // the current temperature differ by at least 2x WATCH_TEMP_INCREASE
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
 #ifdef PIDTEMP
25
 #ifdef PIDTEMP
26
   // this adds an experimental additional term to the heating power, proportional to the extrusion speed.
26
   // this adds an experimental additional term to the heating power, proportional to the extrusion speed.

+ 7
- 2
Marlin/Marlin_main.cpp Visa fil

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

+ 2
- 2
Marlin/configurator/config/Configuration_adv.h Visa fil

19
 // If the temperature has not increased at the end of that period, the target temperature is set to zero.
19
 // If the temperature has not increased at the end of that period, the target temperature is set to zero.
20
 // It can be reset with another M104/M109. This check is also only triggered if the target temperature and
20
 // It can be reset with another M104/M109. This check is also only triggered if the target temperature and
21
 // the current temperature differ by at least 2x WATCH_TEMP_INCREASE
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
 #ifdef PIDTEMP
25
 #ifdef PIDTEMP
26
   // this adds an experimental additional term to the heating power, proportional to the extrusion speed.
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 Visa fil

19
 // If the temperature has not increased at the end of that period, the target temperature is set to zero.
19
 // If the temperature has not increased at the end of that period, the target temperature is set to zero.
20
 // It can be reset with another M104/M109. This check is also only triggered if the target temperature and
20
 // It can be reset with another M104/M109. This check is also only triggered if the target temperature and
21
 // the current temperature differ by at least 2x WATCH_TEMP_INCREASE
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
 #ifdef PIDTEMP
25
 #ifdef PIDTEMP
26
   // this adds an experimental additional term to the heating power, proportional to the extrusion speed.
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 Visa fil

19
 // If the temperature has not increased at the end of that period, the target temperature is set to zero.
19
 // If the temperature has not increased at the end of that period, the target temperature is set to zero.
20
 // It can be reset with another M104/M109. This check is also only triggered if the target temperature and
20
 // It can be reset with another M104/M109. This check is also only triggered if the target temperature and
21
 // the current temperature differ by at least 2x WATCH_TEMP_INCREASE
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
 #ifdef PIDTEMP
25
 #ifdef PIDTEMP
26
   // this adds an experimental additional term to the heating power, proportional to the extrusion speed.
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 Visa fil

19
 // If the temperature has not increased at the end of that period, the target temperature is set to zero.
19
 // If the temperature has not increased at the end of that period, the target temperature is set to zero.
20
 // It can be reset with another M104/M109. This check is also only triggered if the target temperature and
20
 // It can be reset with another M104/M109. This check is also only triggered if the target temperature and
21
 // the current temperature differ by at least 2x WATCH_TEMP_INCREASE
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
 #ifdef PIDTEMP
25
 #ifdef PIDTEMP
26
   // this adds an experimental additional term to the heating power, proportional to the extrusion speed.
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 Visa fil

19
 // If the temperature has not increased at the end of that period, the target temperature is set to zero.
19
 // If the temperature has not increased at the end of that period, the target temperature is set to zero.
20
 // It can be reset with another M104/M109. This check is also only triggered if the target temperature and
20
 // It can be reset with another M104/M109. This check is also only triggered if the target temperature and
21
 // the current temperature differ by at least 2x WATCH_TEMP_INCREASE
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
 #ifdef PIDTEMP
25
 #ifdef PIDTEMP
26
   // this adds an experimental additional term to the heating power, proportional to the extrusion speed.
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 Visa fil

19
 // If the temperature has not increased at the end of that period, the target temperature is set to zero.
19
 // If the temperature has not increased at the end of that period, the target temperature is set to zero.
20
 // It can be reset with another M104/M109. This check is also only triggered if the target temperature and
20
 // It can be reset with another M104/M109. This check is also only triggered if the target temperature and
21
 // the current temperature differ by at least 2x WATCH_TEMP_INCREASE
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
 #ifdef PIDTEMP
25
 #ifdef PIDTEMP
26
   // this adds an experimental additional term to the heating power, proportional to the extrusion speed.
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 Visa fil

19
 // If the temperature has not increased at the end of that period, the target temperature is set to zero.
19
 // If the temperature has not increased at the end of that period, the target temperature is set to zero.
20
 // It can be reset with another M104/M109. This check is also only triggered if the target temperature and
20
 // It can be reset with another M104/M109. This check is also only triggered if the target temperature and
21
 // the current temperature differ by at least 2x WATCH_TEMP_INCREASE
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
 #ifdef PIDTEMP
25
 #ifdef PIDTEMP
26
   // this adds an experimental additional term to the heating power, proportional to the extrusion speed.
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 Visa fil

19
 // If the temperature has not increased at the end of that period, the target temperature is set to zero.
19
 // If the temperature has not increased at the end of that period, the target temperature is set to zero.
20
 // It can be reset with another M104/M109. This check is also only triggered if the target temperature and
20
 // It can be reset with another M104/M109. This check is also only triggered if the target temperature and
21
 // the current temperature differ by at least 2x WATCH_TEMP_INCREASE
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
 #ifdef PIDTEMP
25
 #ifdef PIDTEMP
26
   // this adds an experimental additional term to the heating power, proportional to the extrusion speed.
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 Visa fil

19
 // If the temperature has not increased at the end of that period, the target temperature is set to zero.
19
 // If the temperature has not increased at the end of that period, the target temperature is set to zero.
20
 // It can be reset with another M104/M109. This check is also only triggered if the target temperature and
20
 // It can be reset with another M104/M109. This check is also only triggered if the target temperature and
21
 // the current temperature differ by at least 2x WATCH_TEMP_INCREASE
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
 #ifdef PIDTEMP
25
 #ifdef PIDTEMP
26
   // this adds an experimental additional term to the heating power, proportional to the extrusion speed.
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 Visa fil

19
 // If the temperature has not increased at the end of that period, the target temperature is set to zero.
19
 // If the temperature has not increased at the end of that period, the target temperature is set to zero.
20
 // It can be reset with another M104/M109. This check is also only triggered if the target temperature and
20
 // It can be reset with another M104/M109. This check is also only triggered if the target temperature and
21
 // the current temperature differ by at least 2x WATCH_TEMP_INCREASE
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
 #ifdef PIDTEMP
25
 #ifdef PIDTEMP
26
   // this adds an experimental additional term to the heating power, proportional to the extrusion speed.
26
   // this adds an experimental additional term to the heating power, proportional to the extrusion speed.

+ 20
- 19
Marlin/temperature.cpp Visa fil

171
 static void updateTemperaturesFromRawValues();
171
 static void updateTemperaturesFromRawValues();
172
 
172
 
173
 #ifdef WATCH_TEMP_PERIOD
173
 #ifdef WATCH_TEMP_PERIOD
174
-  int watch_start_temp[EXTRUDERS] = { 0 };
174
+  int watch_target_temp[EXTRUDERS] = { 0 };
175
   millis_t watch_heater_next_ms[EXTRUDERS] = { 0 };
175
   millis_t watch_heater_next_ms[EXTRUDERS] = { 0 };
176
 #endif
176
 #endif
177
 
177
 
625
       // Is it time to check this extruder's heater?
625
       // Is it time to check this extruder's heater?
626
       if (watch_heater_next_ms[e] && ms > watch_heater_next_ms[e]) {
626
       if (watch_heater_next_ms[e] && ms > watch_heater_next_ms[e]) {
627
         // Has it failed to increase enough?
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
           // Stop!
629
           // Stop!
630
           _temp_error(e, MSG_HEATING_FAILED, MSG_HEATING_FAILED_LCD);
630
           _temp_error(e, MSG_HEATING_FAILED, MSG_HEATING_FAILED_LCD);
631
         }
631
         }
632
         else {
632
         else {
633
+          // Only check once per M104/M109
633
           watch_heater_next_ms[e] = 0;
634
           watch_heater_next_ms[e] = 0;
634
         }
635
         }
635
       }
636
       }
997
   #endif //BED_MAXTEMP
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
 #if HAS_HEATER_THERMAL_PROTECTION || HAS_BED_THERMAL_PROTECTION
1020
 #if HAS_HEATER_THERMAL_PROTECTION || HAS_BED_THERMAL_PROTECTION
1020
 
1021
 

+ 4
- 1
Marlin/temperature.h Visa fil

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

+ 3
- 1
Marlin/ultralcd.cpp Visa fil

521
   setTargetBed(tempb);
521
   setTargetBed(tempb);
522
   fanSpeed = fan;
522
   fanSpeed = fan;
523
   lcd_return_to_status();
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
 void lcd_preheat_pla0() { _lcd_preheat(0, plaPreheatHotendTemp, plaPreheatHPBTemp, plaPreheatFanSpeed); }
528
 void lcd_preheat_pla0() { _lcd_preheat(0, plaPreheatHotendTemp, plaPreheatHPBTemp, plaPreheatFanSpeed); }
527
 void lcd_preheat_abs0() { _lcd_preheat(0, absPreheatHotendTemp, absPreheatHPBTemp, absPreheatFanSpeed); }
529
 void lcd_preheat_abs0() { _lcd_preheat(0, absPreheatHotendTemp, absPreheatHPBTemp, absPreheatFanSpeed); }

Laddar…
Avbryt
Spara