Enable WATCH_TEMP_PERIOD by default

This commit is contained in:
Scott Lahteine 2015-05-08 22:36:02 -07:00
parent deedb00c18
commit 54deb9eea3
15 changed files with 56 additions and 45 deletions

View file

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

View file

@ -3166,7 +3166,10 @@ inline void gcode_M104() {
if (dual_x_carriage_mode == DXC_DUPLICATION_MODE && target_extruder == 0) if (dual_x_carriage_mode == DXC_DUPLICATION_MODE && target_extruder == 0)
setTargetHotend1(temp == 0.0 ? 0.0 : temp + duplicate_extruder_temp_offset); setTargetHotend1(temp == 0.0 ? 0.0 : temp + duplicate_extruder_temp_offset);
#endif #endif
setWatch();
#ifdef WATCH_TEMP_PERIOD
start_watching_heaters();
#endif
} }
} }
@ -3278,7 +3281,9 @@ inline void gcode_M109() {
if (code_seen('B')) autotemp_max = code_value(); if (code_seen('B')) autotemp_max = code_value();
#endif #endif
setWatch(); #ifdef WATCH_TEMP_PERIOD
start_watching_heaters();
#endif
millis_t temp_ms = millis(); millis_t temp_ms = millis();

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -171,7 +171,7 @@ static float analog2tempBed(int raw);
static void updateTemperaturesFromRawValues(); static void updateTemperaturesFromRawValues();
#ifdef WATCH_TEMP_PERIOD #ifdef WATCH_TEMP_PERIOD
int watch_start_temp[EXTRUDERS] = { 0 }; int watch_target_temp[EXTRUDERS] = { 0 };
millis_t watch_heater_next_ms[EXTRUDERS] = { 0 }; millis_t watch_heater_next_ms[EXTRUDERS] = { 0 };
#endif #endif
@ -625,11 +625,12 @@ void manage_heater() {
// Is it time to check this extruder's heater? // Is it time to check this extruder's heater?
if (watch_heater_next_ms[e] && ms > watch_heater_next_ms[e]) { if (watch_heater_next_ms[e] && ms > watch_heater_next_ms[e]) {
// Has it failed to increase enough? // Has it failed to increase enough?
if (degHotend(e) < watch_start_temp[e] + WATCH_TEMP_INCREASE) { if (degHotend(e) < watch_target_temp[e]) {
// Stop! // Stop!
_temp_error(e, MSG_HEATING_FAILED, MSG_HEATING_FAILED_LCD); _temp_error(e, MSG_HEATING_FAILED, MSG_HEATING_FAILED_LCD);
} }
else { else {
// Only check once per M104/M109
watch_heater_next_ms[e] = 0; watch_heater_next_ms[e] = 0;
} }
} }
@ -997,24 +998,24 @@ void tp_init() {
#endif //BED_MAXTEMP #endif //BED_MAXTEMP
} }
/** #ifdef WATCH_TEMP_PERIOD
* Start Heating Sanity Check for hotends that are below /**
* their target temperature by a configurable margin. * Start Heating Sanity Check for hotends that are below
* This is called when the temperature is set. (M104, M109) * their target temperature by a configurable margin.
*/ * This is called when the temperature is set. (M104, M109)
void setWatch() { */
#ifdef WATCH_TEMP_PERIOD void start_watching_heaters() {
millis_t ms = millis() + WATCH_TEMP_PERIOD; millis_t ms = millis() + WATCH_TEMP_PERIOD;
for (int e = 0; e < EXTRUDERS; e++) { for (int e = 0; e < EXTRUDERS; e++) {
if (degHotend(e) < degTargetHotend(e) - (WATCH_TEMP_INCREASE * 2)) { if (degHotend(e) < degTargetHotend(e) - (WATCH_TEMP_INCREASE * 2)) {
watch_start_temp[e] = degHotend(e); watch_target_temp[e] = degHotend(e) + WATCH_TEMP_INCREASE;
watch_heater_next_ms[e] = ms; watch_heater_next_ms[e] = ms;
}
else
watch_heater_next_ms[e] = 0;
} }
else }
watch_heater_next_ms[e] = 0; #endif
}
#endif
}
#if HAS_HEATER_THERMAL_PROTECTION || HAS_BED_THERMAL_PROTECTION #if HAS_HEATER_THERMAL_PROTECTION || HAS_BED_THERMAL_PROTECTION

View file

@ -130,7 +130,6 @@ HOTEND_ROUTINES(0);
int getHeaterPower(int heater); int getHeaterPower(int heater);
void disable_all_heaters(); void disable_all_heaters();
void setWatch();
void updatePID(); void updatePID();
void PID_autotune(float temp, int extruder, int ncycles); void PID_autotune(float temp, int extruder, int ncycles);
@ -138,6 +137,10 @@ void PID_autotune(float temp, int extruder, int ncycles);
void setExtruderAutoFanState(int pin, bool state); void setExtruderAutoFanState(int pin, bool state);
void checkExtruderAutoFans(); void checkExtruderAutoFans();
#ifdef WATCH_TEMP_PERIOD
void start_watching_heaters();
#endif
FORCE_INLINE void autotempShutdown() { FORCE_INLINE void autotempShutdown() {
#ifdef AUTOTEMP #ifdef AUTOTEMP
if (autotemp_enabled) { if (autotemp_enabled) {

View file

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