Przeglądaj źródła

Introduce temp watch protection for the bed

When setting the bed temp via M140/M190 if the thermistor does not read an increase of WATCH_BED_TEMP_INCREASE degrees by WATCH_BED_TEMP_PERIOD seconds then it will throw "Error:Heating failed, system stopped! Heater_ID: bed" and call the kill() function.

Conflicts:
	Marlin/Configuration_adv.h
gralco 9 lat temu
rodzic
commit
908229dbb3

+ 12
- 0
Marlin/Configuration_adv.h Wyświetl plik

87
 #if ENABLED(THERMAL_PROTECTION_BED)
87
 #if ENABLED(THERMAL_PROTECTION_BED)
88
   #define THERMAL_PROTECTION_BED_PERIOD 20    // Seconds
88
   #define THERMAL_PROTECTION_BED_PERIOD 20    // Seconds
89
   #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius
89
   #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius
90
+
91
+  /**
92
+   * Whenever an M140 or M190 increases the target temperature the firmware will wait for the
93
+   * WATCH_BED_TEMP_PERIOD to expire, and if the temperature hasn't increased by WATCH_BED_TEMP_INCREASE
94
+   * degrees, the machine is halted, requiring a hard reset. This test restarts with any M140/M190,
95
+   * but only if the current temperature is far enough below the target for a reliable test.
96
+   *
97
+   * If you get too many "Heating failed" errors, increase WATCH_BED_TEMP_PERIOD and/or decrease
98
+   * WATCH_BED_TEMP_INCREASE. (WATCH_BED_TEMP_INCREASE should not be below 2.)
99
+   */
100
+  #define WATCH_BED_TEMP_PERIOD 60                // Seconds
101
+  #define WATCH_BED_TEMP_INCREASE 2               // Degrees Celsius
90
 #endif
102
 #endif
91
 
103
 
92
 #if ENABLED(PIDTEMP)
104
 #if ENABLED(PIDTEMP)

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

87
 #if ENABLED(THERMAL_PROTECTION_BED)
87
 #if ENABLED(THERMAL_PROTECTION_BED)
88
   #define THERMAL_PROTECTION_BED_PERIOD 20    // Seconds
88
   #define THERMAL_PROTECTION_BED_PERIOD 20    // Seconds
89
   #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius
89
   #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius
90
+
91
+  /**
92
+   * Whenever an M140 or M190 increases the target temperature the firmware will wait for the
93
+   * WATCH_BED_TEMP_PERIOD to expire, and if the temperature hasn't increased by WATCH_BED_TEMP_INCREASE
94
+   * degrees, the machine is halted, requiring a hard reset. This test restarts with any M140/M190,
95
+   * but only if the current temperature is far enough below the target for a reliable test.
96
+   *
97
+   * If you get too many "Heating failed" errors, increase WATCH_BED_TEMP_PERIOD and/or decrease
98
+   * WATCH_BED_TEMP_INCREASE. (WATCH_BED_TEMP_INCREASE should not be below 2.)
99
+   */
100
+  #define WATCH_BED_TEMP_PERIOD 60                // Seconds
101
+  #define WATCH_BED_TEMP_INCREASE 2               // Degrees Celsius
90
 #endif
102
 #endif
91
 
103
 
92
 #if ENABLED(PIDTEMP)
104
 #if ENABLED(PIDTEMP)

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

87
 #if ENABLED(THERMAL_PROTECTION_BED)
87
 #if ENABLED(THERMAL_PROTECTION_BED)
88
   #define THERMAL_PROTECTION_BED_PERIOD 20    // Seconds
88
   #define THERMAL_PROTECTION_BED_PERIOD 20    // Seconds
89
   #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius
89
   #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius
90
+
91
+  /**
92
+   * Whenever an M140 or M190 increases the target temperature the firmware will wait for the
93
+   * WATCH_BED_TEMP_PERIOD to expire, and if the temperature hasn't increased by WATCH_BED_TEMP_INCREASE
94
+   * degrees, the machine is halted, requiring a hard reset. This test restarts with any M140/M190,
95
+   * but only if the current temperature is far enough below the target for a reliable test.
96
+   *
97
+   * If you get too many "Heating failed" errors, increase WATCH_BED_TEMP_PERIOD and/or decrease
98
+   * WATCH_BED_TEMP_INCREASE. (WATCH_BED_TEMP_INCREASE should not be below 2.)
99
+   */
100
+  #define WATCH_BED_TEMP_PERIOD 60                // Seconds
101
+  #define WATCH_BED_TEMP_INCREASE 2               // Degrees Celsius
90
 #endif
102
 #endif
91
 
103
 
92
 #if ENABLED(PIDTEMP)
104
 #if ENABLED(PIDTEMP)

+ 12
- 0
Marlin/example_configurations/Hephestos_2/Configuration_adv.h Wyświetl plik

87
 #if ENABLED(THERMAL_PROTECTION_BED)
87
 #if ENABLED(THERMAL_PROTECTION_BED)
88
   #define THERMAL_PROTECTION_BED_PERIOD 20    // Seconds
88
   #define THERMAL_PROTECTION_BED_PERIOD 20    // Seconds
89
   #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius
89
   #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius
90
+
91
+  /**
92
+   * Whenever an M140 or M190 increases the target temperature the firmware will wait for the
93
+   * WATCH_BED_TEMP_PERIOD to expire, and if the temperature hasn't increased by WATCH_BED_TEMP_INCREASE
94
+   * degrees, the machine is halted, requiring a hard reset. This test restarts with any M140/M190,
95
+   * but only if the current temperature is far enough below the target for a reliable test.
96
+   *
97
+   * If you get too many "Heating failed" errors, increase WATCH_BED_TEMP_PERIOD and/or decrease
98
+   * WATCH_BED_TEMP_INCREASE. (WATCH_BED_TEMP_INCREASE should not be below 2.)
99
+   */
100
+  #define WATCH_BED_TEMP_PERIOD 60                // Seconds
101
+  #define WATCH_BED_TEMP_INCREASE 2               // Degrees Celsius
90
 #endif
102
 #endif
91
 
103
 
92
 #if ENABLED(PIDTEMP)
104
 #if ENABLED(PIDTEMP)

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

93
 #if ENABLED(THERMAL_PROTECTION_BED)
93
 #if ENABLED(THERMAL_PROTECTION_BED)
94
   #define THERMAL_PROTECTION_BED_PERIOD 20    // Seconds
94
   #define THERMAL_PROTECTION_BED_PERIOD 20    // Seconds
95
   #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius
95
   #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius
96
+
97
+  /**
98
+   * Whenever an M140 or M190 increases the target temperature the firmware will wait for the
99
+   * WATCH_BED_TEMP_PERIOD to expire, and if the temperature hasn't increased by WATCH_BED_TEMP_INCREASE
100
+   * degrees, the machine is halted, requiring a hard reset. This test restarts with any M140/M190,
101
+   * but only if the current temperature is far enough below the target for a reliable test.
102
+   *
103
+   * If you get too many "Heating failed" errors, increase WATCH_BED_TEMP_PERIOD and/or decrease
104
+   * WATCH_BED_TEMP_INCREASE. (WATCH_BED_TEMP_INCREASE should not be below 2.)
105
+   */
106
+  #define WATCH_BED_TEMP_PERIOD 60                // Seconds
107
+  #define WATCH_BED_TEMP_INCREASE 2               // Degrees Celsius
96
 #endif
108
 #endif
97
 
109
 
98
 #if ENABLED(PIDTEMP)
110
 #if ENABLED(PIDTEMP)

+ 12
- 0
Marlin/example_configurations/RigidBot/Configuration_adv.h Wyświetl plik

87
 #if ENABLED(THERMAL_PROTECTION_BED)
87
 #if ENABLED(THERMAL_PROTECTION_BED)
88
   #define THERMAL_PROTECTION_BED_PERIOD 20    // Seconds
88
   #define THERMAL_PROTECTION_BED_PERIOD 20    // Seconds
89
   #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius
89
   #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius
90
+
91
+  /**
92
+   * Whenever an M140 or M190 increases the target temperature the firmware will wait for the
93
+   * WATCH_BED_TEMP_PERIOD to expire, and if the temperature hasn't increased by WATCH_BED_TEMP_INCREASE
94
+   * degrees, the machine is halted, requiring a hard reset. This test restarts with any M140/M190,
95
+   * but only if the current temperature is far enough below the target for a reliable test.
96
+   *
97
+   * If you get too many "Heating failed" errors, increase WATCH_BED_TEMP_PERIOD and/or decrease
98
+   * WATCH_BED_TEMP_INCREASE. (WATCH_BED_TEMP_INCREASE should not be below 2.)
99
+   */
100
+  #define WATCH_BED_TEMP_PERIOD 60                // Seconds
101
+  #define WATCH_BED_TEMP_INCREASE 2               // Degrees Celsius
90
 #endif
102
 #endif
91
 
103
 
92
 #if ENABLED(PIDTEMP)
104
 #if ENABLED(PIDTEMP)

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

87
 #if ENABLED(THERMAL_PROTECTION_BED)
87
 #if ENABLED(THERMAL_PROTECTION_BED)
88
   #define THERMAL_PROTECTION_BED_PERIOD 20    // Seconds
88
   #define THERMAL_PROTECTION_BED_PERIOD 20    // Seconds
89
   #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius
89
   #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius
90
+
91
+  /**
92
+   * Whenever an M140 or M190 increases the target temperature the firmware will wait for the
93
+   * WATCH_BED_TEMP_PERIOD to expire, and if the temperature hasn't increased by WATCH_BED_TEMP_INCREASE
94
+   * degrees, the machine is halted, requiring a hard reset. This test restarts with any M140/M190,
95
+   * but only if the current temperature is far enough below the target for a reliable test.
96
+   *
97
+   * If you get too many "Heating failed" errors, increase WATCH_BED_TEMP_PERIOD and/or decrease
98
+   * WATCH_BED_TEMP_INCREASE. (WATCH_BED_TEMP_INCREASE should not be below 2.)
99
+   */
100
+  #define WATCH_BED_TEMP_PERIOD 60                // Seconds
101
+  #define WATCH_BED_TEMP_INCREASE 2               // Degrees Celsius
90
 #endif
102
 #endif
91
 
103
 
92
 #if ENABLED(PIDTEMP)
104
 #if ENABLED(PIDTEMP)

+ 12
- 0
Marlin/example_configurations/TAZ4/Configuration_adv.h Wyświetl plik

87
 #if ENABLED(THERMAL_PROTECTION_BED)
87
 #if ENABLED(THERMAL_PROTECTION_BED)
88
   #define THERMAL_PROTECTION_BED_PERIOD 20    // Seconds
88
   #define THERMAL_PROTECTION_BED_PERIOD 20    // Seconds
89
   #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius
89
   #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius
90
+
91
+  /**
92
+   * Whenever an M140 or M190 increases the target temperature the firmware will wait for the
93
+   * WATCH_BED_TEMP_PERIOD to expire, and if the temperature hasn't increased by WATCH_BED_TEMP_INCREASE
94
+   * degrees, the machine is halted, requiring a hard reset. This test restarts with any M140/M190,
95
+   * but only if the current temperature is far enough below the target for a reliable test.
96
+   *
97
+   * If you get too many "Heating failed" errors, increase WATCH_BED_TEMP_PERIOD and/or decrease
98
+   * WATCH_BED_TEMP_INCREASE. (WATCH_BED_TEMP_INCREASE should not be below 2.)
99
+   */
100
+  #define WATCH_BED_TEMP_PERIOD 60                // Seconds
101
+  #define WATCH_BED_TEMP_INCREASE 2               // Degrees Celsius
90
 #endif
102
 #endif
91
 
103
 
92
 #if ENABLED(PIDTEMP)
104
 #if ENABLED(PIDTEMP)

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

87
 #if ENABLED(THERMAL_PROTECTION_BED)
87
 #if ENABLED(THERMAL_PROTECTION_BED)
88
   #define THERMAL_PROTECTION_BED_PERIOD 20    // Seconds
88
   #define THERMAL_PROTECTION_BED_PERIOD 20    // Seconds
89
   #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius
89
   #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius
90
+
91
+  /**
92
+   * Whenever an M140 or M190 increases the target temperature the firmware will wait for the
93
+   * WATCH_BED_TEMP_PERIOD to expire, and if the temperature hasn't increased by WATCH_BED_TEMP_INCREASE
94
+   * degrees, the machine is halted, requiring a hard reset. This test restarts with any M140/M190,
95
+   * but only if the current temperature is far enough below the target for a reliable test.
96
+   *
97
+   * If you get too many "Heating failed" errors, increase WATCH_BED_TEMP_PERIOD and/or decrease
98
+   * WATCH_BED_TEMP_INCREASE. (WATCH_BED_TEMP_INCREASE should not be below 2.)
99
+   */
100
+  #define WATCH_BED_TEMP_PERIOD 60                // Seconds
101
+  #define WATCH_BED_TEMP_INCREASE 2               // Degrees Celsius
90
 #endif
102
 #endif
91
 
103
 
92
 #if ENABLED(PIDTEMP)
104
 #if ENABLED(PIDTEMP)

+ 12
- 0
Marlin/example_configurations/delta/biv2.5/Configuration_adv.h Wyświetl plik

87
 #if ENABLED(THERMAL_PROTECTION_BED)
87
 #if ENABLED(THERMAL_PROTECTION_BED)
88
   #define THERMAL_PROTECTION_BED_PERIOD 120   // Seconds
88
   #define THERMAL_PROTECTION_BED_PERIOD 120   // Seconds
89
   #define THERMAL_PROTECTION_BED_HYSTERESIS 4 // Degrees Celsius
89
   #define THERMAL_PROTECTION_BED_HYSTERESIS 4 // Degrees Celsius
90
+
91
+  /**
92
+   * Whenever an M140 or M190 increases the target temperature the firmware will wait for the
93
+   * WATCH_BED_TEMP_PERIOD to expire, and if the temperature hasn't increased by WATCH_BED_TEMP_INCREASE
94
+   * degrees, the machine is halted, requiring a hard reset. This test restarts with any M140/M190,
95
+   * but only if the current temperature is far enough below the target for a reliable test.
96
+   *
97
+   * If you get too many "Heating failed" errors, increase WATCH_BED_TEMP_PERIOD and/or decrease
98
+   * WATCH_BED_TEMP_INCREASE. (WATCH_BED_TEMP_INCREASE should not be below 2.)
99
+   */
100
+  #define WATCH_BED_TEMP_PERIOD 60                // Seconds
101
+  #define WATCH_BED_TEMP_INCREASE 2               // Degrees Celsius
90
 #endif
102
 #endif
91
 
103
 
92
 #if ENABLED(PIDTEMP)
104
 #if ENABLED(PIDTEMP)

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

87
 #if ENABLED(THERMAL_PROTECTION_BED)
87
 #if ENABLED(THERMAL_PROTECTION_BED)
88
   #define THERMAL_PROTECTION_BED_PERIOD 20    // Seconds
88
   #define THERMAL_PROTECTION_BED_PERIOD 20    // Seconds
89
   #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius
89
   #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius
90
+
91
+  /**
92
+   * Whenever an M140 or M190 increases the target temperature the firmware will wait for the
93
+   * WATCH_BED_TEMP_PERIOD to expire, and if the temperature hasn't increased by WATCH_BED_TEMP_INCREASE
94
+   * degrees, the machine is halted, requiring a hard reset. This test restarts with any M140/M190,
95
+   * but only if the current temperature is far enough below the target for a reliable test.
96
+   *
97
+   * If you get too many "Heating failed" errors, increase WATCH_BED_TEMP_PERIOD and/or decrease
98
+   * WATCH_BED_TEMP_INCREASE. (WATCH_BED_TEMP_INCREASE should not be below 2.)
99
+   */
100
+  #define WATCH_BED_TEMP_PERIOD 60                // Seconds
101
+  #define WATCH_BED_TEMP_INCREASE 2               // Degrees Celsius
90
 #endif
102
 #endif
91
 
103
 
92
 #if ENABLED(PIDTEMP)
104
 #if ENABLED(PIDTEMP)

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

87
 #if ENABLED(THERMAL_PROTECTION_BED)
87
 #if ENABLED(THERMAL_PROTECTION_BED)
88
   #define THERMAL_PROTECTION_BED_PERIOD 20    // Seconds
88
   #define THERMAL_PROTECTION_BED_PERIOD 20    // Seconds
89
   #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius
89
   #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius
90
+
91
+  /**
92
+   * Whenever an M140 or M190 increases the target temperature the firmware will wait for the
93
+   * WATCH_BED_TEMP_PERIOD to expire, and if the temperature hasn't increased by WATCH_BED_TEMP_INCREASE
94
+   * degrees, the machine is halted, requiring a hard reset. This test restarts with any M140/M190,
95
+   * but only if the current temperature is far enough below the target for a reliable test.
96
+   *
97
+   * If you get too many "Heating failed" errors, increase WATCH_BED_TEMP_PERIOD and/or decrease
98
+   * WATCH_BED_TEMP_INCREASE. (WATCH_BED_TEMP_INCREASE should not be below 2.)
99
+   */
100
+  #define WATCH_BED_TEMP_PERIOD 60                // Seconds
101
+  #define WATCH_BED_TEMP_INCREASE 2               // Degrees Celsius
90
 #endif
102
 #endif
91
 
103
 
92
 #if ENABLED(PIDTEMP)
104
 #if ENABLED(PIDTEMP)

+ 12
- 0
Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h Wyświetl plik

92
 #if ENABLED(THERMAL_PROTECTION_BED)
92
 #if ENABLED(THERMAL_PROTECTION_BED)
93
   #define THERMAL_PROTECTION_BED_PERIOD 20    // Seconds
93
   #define THERMAL_PROTECTION_BED_PERIOD 20    // Seconds
94
   #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius
94
   #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius
95
+
96
+  /**
97
+   * Whenever an M140 or M190 increases the target temperature the firmware will wait for the
98
+   * WATCH_BED_TEMP_PERIOD to expire, and if the temperature hasn't increased by WATCH_BED_TEMP_INCREASE
99
+   * degrees, the machine is halted, requiring a hard reset. This test restarts with any M140/M190,
100
+   * but only if the current temperature is far enough below the target for a reliable test.
101
+   *
102
+   * If you get too many "Heating failed" errors, increase WATCH_BED_TEMP_PERIOD and/or decrease
103
+   * WATCH_BED_TEMP_INCREASE. (WATCH_BED_TEMP_INCREASE should not be below 2.)
104
+   */
105
+  #define WATCH_BED_TEMP_PERIOD 60                // Seconds
106
+  #define WATCH_BED_TEMP_INCREASE 2               // Degrees Celsius
95
 #endif
107
 #endif
96
 
108
 
97
 #if ENABLED(PIDTEMP)
109
 #if ENABLED(PIDTEMP)

+ 12
- 0
Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h Wyświetl plik

87
 #if ENABLED(THERMAL_PROTECTION_BED)
87
 #if ENABLED(THERMAL_PROTECTION_BED)
88
   #define THERMAL_PROTECTION_BED_PERIOD 20    // Seconds
88
   #define THERMAL_PROTECTION_BED_PERIOD 20    // Seconds
89
   #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius
89
   #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius
90
+
91
+  /**
92
+   * Whenever an M140 or M190 increases the target temperature the firmware will wait for the
93
+   * WATCH_BED_TEMP_PERIOD to expire, and if the temperature hasn't increased by WATCH_BED_TEMP_INCREASE
94
+   * degrees, the machine is halted, requiring a hard reset. This test restarts with any M140/M190,
95
+   * but only if the current temperature is far enough below the target for a reliable test.
96
+   *
97
+   * If you get too many "Heating failed" errors, increase WATCH_BED_TEMP_PERIOD and/or decrease
98
+   * WATCH_BED_TEMP_INCREASE. (WATCH_BED_TEMP_INCREASE should not be below 2.)
99
+   */
100
+  #define WATCH_BED_TEMP_PERIOD 60                // Seconds
101
+  #define WATCH_BED_TEMP_INCREASE 2               // Degrees Celsius
90
 #endif
102
 #endif
91
 
103
 
92
 #if ENABLED(PIDTEMP)
104
 #if ENABLED(PIDTEMP)

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

87
 #if ENABLED(THERMAL_PROTECTION_BED)
87
 #if ENABLED(THERMAL_PROTECTION_BED)
88
   #define THERMAL_PROTECTION_BED_PERIOD 20    // Seconds
88
   #define THERMAL_PROTECTION_BED_PERIOD 20    // Seconds
89
   #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius
89
   #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius
90
+
91
+  /**
92
+   * Whenever an M140 or M190 increases the target temperature the firmware will wait for the
93
+   * WATCH_BED_TEMP_PERIOD to expire, and if the temperature hasn't increased by WATCH_BED_TEMP_INCREASE
94
+   * degrees, the machine is halted, requiring a hard reset. This test restarts with any M140/M190,
95
+   * but only if the current temperature is far enough below the target for a reliable test.
96
+   *
97
+   * If you get too many "Heating failed" errors, increase WATCH_BED_TEMP_PERIOD and/or decrease
98
+   * WATCH_BED_TEMP_INCREASE. (WATCH_BED_TEMP_INCREASE should not be below 2.)
99
+   */
100
+  #define WATCH_BED_TEMP_PERIOD 60                // Seconds
101
+  #define WATCH_BED_TEMP_INCREASE 2               // Degrees Celsius
90
 #endif
102
 #endif
91
 
103
 
92
 #if ENABLED(PIDTEMP)
104
 #if ENABLED(PIDTEMP)

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

87
 #if ENABLED(THERMAL_PROTECTION_BED)
87
 #if ENABLED(THERMAL_PROTECTION_BED)
88
   #define THERMAL_PROTECTION_BED_PERIOD 20    // Seconds
88
   #define THERMAL_PROTECTION_BED_PERIOD 20    // Seconds
89
   #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius
89
   #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius
90
+
91
+  /**
92
+   * Whenever an M140 or M190 increases the target temperature the firmware will wait for the
93
+   * WATCH_BED_TEMP_PERIOD to expire, and if the temperature hasn't increased by WATCH_BED_TEMP_INCREASE
94
+   * degrees, the machine is halted, requiring a hard reset. This test restarts with any M140/M190,
95
+   * but only if the current temperature is far enough below the target for a reliable test.
96
+   *
97
+   * If you get too many "Heating failed" errors, increase WATCH_BED_TEMP_PERIOD and/or decrease
98
+   * WATCH_BED_TEMP_INCREASE. (WATCH_BED_TEMP_INCREASE should not be below 2.)
99
+   */
100
+  #define WATCH_BED_TEMP_PERIOD 60                // Seconds
101
+  #define WATCH_BED_TEMP_INCREASE 2               // Degrees Celsius
90
 #endif
102
 #endif
91
 
103
 
92
 #if ENABLED(PIDTEMP)
104
 #if ENABLED(PIDTEMP)

+ 43
- 4
Marlin/temperature.cpp Wyświetl plik

200
 static float analog2tempBed(int raw);
200
 static float analog2tempBed(int raw);
201
 static void updateTemperaturesFromRawValues();
201
 static void updateTemperaturesFromRawValues();
202
 
202
 
203
-#if ENABLED(THERMAL_PROTECTION_HOTENDS)
203
+#if ENABLED(THERMAL_PROTECTION_HOTENDS) && WATCH_TEMP_PERIOD > 0
204
   int watch_target_temp[EXTRUDERS] = { 0 };
204
   int watch_target_temp[EXTRUDERS] = { 0 };
205
   millis_t watch_heater_next_ms[EXTRUDERS] = { 0 };
205
   millis_t watch_heater_next_ms[EXTRUDERS] = { 0 };
206
 #endif
206
 #endif
207
 
207
 
208
+#if ENABLED(THERMAL_PROTECTION_BED) && WATCH_BED_TEMP_PERIOD > 0
209
+  int watch_target_bed_temp = 0;
210
+  millis_t watch_bed_next_ms = 0;
211
+#endif
212
+
208
 #ifndef SOFT_PWM_SCALE
213
 #ifndef SOFT_PWM_SCALE
209
   #define SOFT_PWM_SCALE 0
214
   #define SOFT_PWM_SCALE 0
210
 #endif
215
 #endif
717
     if (ct < max(HEATER_0_MINTEMP, 0.01)) min_temp_error(0);
722
     if (ct < max(HEATER_0_MINTEMP, 0.01)) min_temp_error(0);
718
   #endif
723
   #endif
719
 
724
 
720
-  #if ENABLED(THERMAL_PROTECTION_HOTENDS) || DISABLED(PIDTEMPBED) || HAS_AUTO_FAN
725
+  #if (ENABLED(THERMAL_PROTECTION_HOTENDS) && WATCH_TEMP_PERIOD > 0) || (ENABLED(THERMAL_PROTECTION_BED) && WATCH_BED_TEMP_PERIOD > 0) || DISABLED(PIDTEMPBED) || HAS_AUTO_FAN
721
     millis_t ms = millis();
726
     millis_t ms = millis();
722
   #endif
727
   #endif
723
 
728
 
734
     soft_pwm[e] = current_temperature[e] > minttemp[e] && current_temperature[e] < maxttemp[e] ? (int)pid_output >> 1 : 0;
739
     soft_pwm[e] = current_temperature[e] > minttemp[e] && current_temperature[e] < maxttemp[e] ? (int)pid_output >> 1 : 0;
735
 
740
 
736
     // Check if the temperature is failing to increase
741
     // Check if the temperature is failing to increase
737
-    #if ENABLED(THERMAL_PROTECTION_HOTENDS)
742
+    #if ENABLED(THERMAL_PROTECTION_HOTENDS) && WATCH_TEMP_PERIOD > 0
738
 
743
 
739
       // Is it time to check this extruder's heater?
744
       // Is it time to check this extruder's heater?
740
       if (watch_heater_next_ms[e] && ELAPSED(ms, watch_heater_next_ms[e])) {
745
       if (watch_heater_next_ms[e] && ELAPSED(ms, watch_heater_next_ms[e])) {
751
 
756
 
752
     #endif // THERMAL_PROTECTION_HOTENDS
757
     #endif // THERMAL_PROTECTION_HOTENDS
753
 
758
 
759
+    // Check if the temperature is failing to increase
760
+    #if ENABLED(THERMAL_PROTECTION_BED) && WATCH_BED_TEMP_PERIOD > 0
761
+
762
+      // Is it time to check the bed?
763
+      if (watch_bed_next_ms && ELAPSED(ms, watch_bed_next_ms)) {
764
+        // Has it failed to increase enough?
765
+        if (degBed() < watch_target_bed_temp) {
766
+          // Stop!
767
+          _temp_error(-1, PSTR(MSG_T_HEATING_FAILED), PSTR(MSG_HEATING_FAILED_LCD));
768
+        }
769
+        else {
770
+          // Start again if the target is still far off
771
+          start_watching_bed();
772
+        }
773
+      }
774
+
775
+    #endif // THERMAL_PROTECTION_HOTENDS
776
+
754
     #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT)
777
     #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT)
755
       if (fabs(current_temperature[0] - redundant_temperature) > MAX_REDUNDANT_TEMP_SENSOR_DIFF) {
778
       if (fabs(current_temperature[0] - redundant_temperature) > MAX_REDUNDANT_TEMP_SENSOR_DIFF) {
756
         _temp_error(0, PSTR(MSG_REDUNDANCY), PSTR(MSG_ERR_REDUNDANT_TEMP));
779
         _temp_error(0, PSTR(MSG_REDUNDANCY), PSTR(MSG_ERR_REDUNDANT_TEMP));
1160
   #endif //BED_MAXTEMP
1183
   #endif //BED_MAXTEMP
1161
 }
1184
 }
1162
 
1185
 
1163
-#if ENABLED(THERMAL_PROTECTION_HOTENDS)
1186
+#if ENABLED(THERMAL_PROTECTION_HOTENDS) && WATCH_TEMP_PERIOD > 0
1164
   /**
1187
   /**
1165
    * Start Heating Sanity Check for hotends that are below
1188
    * Start Heating Sanity Check for hotends that are below
1166
    * their target temperature by a configurable margin.
1189
    * their target temperature by a configurable margin.
1176
   }
1199
   }
1177
 #endif
1200
 #endif
1178
 
1201
 
1202
+#if ENABLED(THERMAL_PROTECTION_BED) && WATCH_BED_TEMP_PERIOD > 0
1203
+  /**
1204
+   * Start Heating Sanity Check for hotends that are below
1205
+   * their target temperature by a configurable margin.
1206
+   * This is called when the temperature is set. (M140, M190)
1207
+   */
1208
+  void start_watching_bed() {
1209
+    if (degBed() < degTargetBed() - (WATCH_BED_TEMP_INCREASE + TEMP_BED_HYSTERESIS + 1)) {
1210
+      watch_target_bed_temp = degBed() + WATCH_BED_TEMP_INCREASE;
1211
+      watch_bed_next_ms = millis() + (WATCH_BED_TEMP_PERIOD) * 1000UL;
1212
+    }
1213
+    else
1214
+      watch_bed_next_ms = 0;
1215
+  }
1216
+#endif
1217
+
1179
 #if ENABLED(THERMAL_PROTECTION_HOTENDS) || ENABLED(THERMAL_PROTECTION_BED)
1218
 #if ENABLED(THERMAL_PROTECTION_HOTENDS) || ENABLED(THERMAL_PROTECTION_BED)
1180
 
1219
 
1181
   void thermal_runaway_protection(TRState* state, millis_t* timer, float temperature, float target_temperature, int heater_id, int period_seconds, int hysteresis_degc) {
1220
   void thermal_runaway_protection(TRState* state, millis_t* timer, float temperature, float target_temperature, int heater_id, int period_seconds, int hysteresis_degc) {

+ 12
- 3
Marlin/temperature.h Wyświetl plik

124
 FORCE_INLINE float degTargetHotend(uint8_t extruder) { return target_temperature[extruder]; }
124
 FORCE_INLINE float degTargetHotend(uint8_t extruder) { return target_temperature[extruder]; }
125
 FORCE_INLINE float degTargetBed() { return target_temperature_bed; }
125
 FORCE_INLINE float degTargetBed() { return target_temperature_bed; }
126
 
126
 
127
-#if ENABLED(THERMAL_PROTECTION_HOTENDS)
127
+#if ENABLED(THERMAL_PROTECTION_HOTENDS) && WATCH_TEMP_PERIOD > 0
128
   void start_watching_heater(int e = 0);
128
   void start_watching_heater(int e = 0);
129
 #endif
129
 #endif
130
 
130
 
131
+#if ENABLED(THERMAL_PROTECTION_BED) && WATCH_BED_TEMP_PERIOD > 0
132
+  void start_watching_bed();
133
+#endif
134
+
131
 FORCE_INLINE void setTargetHotend(const float& celsius, uint8_t extruder) {
135
 FORCE_INLINE void setTargetHotend(const float& celsius, uint8_t extruder) {
132
   target_temperature[extruder] = celsius;
136
   target_temperature[extruder] = celsius;
133
-  #if ENABLED(THERMAL_PROTECTION_HOTENDS)
137
+  #if ENABLED(THERMAL_PROTECTION_HOTENDS) && WATCH_TEMP_PERIOD > 0
134
     start_watching_heater(extruder);
138
     start_watching_heater(extruder);
135
   #endif
139
   #endif
136
 }
140
 }
137
-FORCE_INLINE void setTargetBed(const float& celsius) { target_temperature_bed = celsius; }
141
+FORCE_INLINE void setTargetBed(const float& celsius) {
142
+  target_temperature_bed = celsius;
143
+  #if ENABLED(THERMAL_PROTECTION_BED) && WATCH_BED_TEMP_PERIOD > 0
144
+    start_watching_bed();
145
+  #endif
146
+}
138
 
147
 
139
 FORCE_INLINE bool isHeatingHotend(uint8_t extruder) { return target_temperature[extruder] > current_temperature[extruder]; }
148
 FORCE_INLINE bool isHeatingHotend(uint8_t extruder) { return target_temperature[extruder] > current_temperature[extruder]; }
140
 FORCE_INLINE bool isHeatingBed() { return target_temperature_bed > current_temperature_bed; }
149
 FORCE_INLINE bool isHeatingBed() { return target_temperature_bed > current_temperature_bed; }

+ 12
- 2
Marlin/ultralcd.cpp Wyświetl plik

603
 /**
603
 /**
604
  * Watch temperature callbacks
604
  * Watch temperature callbacks
605
  */
605
  */
606
-#if ENABLED(THERMAL_PROTECTION_HOTENDS)
606
+#if ENABLED(THERMAL_PROTECTION_HOTENDS) && WATCH_TEMP_PERIOD > 0
607
   #if TEMP_SENSOR_0 != 0
607
   #if TEMP_SENSOR_0 != 0
608
     void watch_temp_callback_E0() { start_watching_heater(0); }
608
     void watch_temp_callback_E0() { start_watching_heater(0); }
609
   #endif
609
   #endif
631
   #endif // EXTRUDERS > 3
631
   #endif // EXTRUDERS > 3
632
 #endif
632
 #endif
633
 
633
 
634
+#if ENABLED(THERMAL_PROTECTION_BED) && WATCH_BED_TEMP_PERIOD > 0
635
+  #if TEMP_SENSOR_BED != 0
636
+    void watch_temp_callback_bed() { start_watching_bed(); }
637
+  #endif
638
+#else
639
+  #if TEMP_SENSOR_BED != 0
640
+    void watch_temp_callback_bed() {}
641
+  #endif
642
+#endif
643
+
634
 /**
644
 /**
635
  *
645
  *
636
  * "Tune" submenu
646
  * "Tune" submenu
685
   // Bed:
695
   // Bed:
686
   //
696
   //
687
   #if TEMP_SENSOR_BED != 0
697
   #if TEMP_SENSOR_BED != 0
688
-    MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_BED, &target_temperature_bed, 0, BED_MAXTEMP - 15);
698
+    MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_BED, &target_temperature_bed, 0, BED_MAXTEMP - 15, watch_temp_callback_bed);
689
   #endif
699
   #endif
690
 
700
 
691
   //
701
   //

Ładowanie…
Anuluj
Zapisz