Merge pull request #2041 from thinkyhead/watch_temp
More thermal protection
This commit is contained in:
commit
4097207c75
@ -14,13 +14,16 @@
|
|||||||
#endif
|
#endif
|
||||||
#define BED_CHECK_INTERVAL 5000 //ms between checks in bang-bang control
|
#define BED_CHECK_INTERVAL 5000 //ms between checks in bang-bang control
|
||||||
|
|
||||||
//// Heating sanity check:
|
/**
|
||||||
// This waits for the watch period in milliseconds whenever an M104 or M109 increases the target temperature
|
* Heating Sanity Check
|
||||||
// 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 the current temperature
|
* Whenever an M104 or M109 increases the target temperature this will wait for WATCH_TEMP_PERIOD milliseconds,
|
||||||
// differ by at least 2x WATCH_TEMP_INCREASE
|
* and if the temperature hasn't increased by WATCH_TEMP_INCREASE degrees, the machine is halted, requiring a
|
||||||
//#define WATCH_TEMP_PERIOD 40000 //40 seconds
|
* hard reset. This test restarts with any M104/M109, but only if the current temperature is below the target
|
||||||
//#define WATCH_TEMP_INCREASE 10 //Heat up at least 10 degree in 20 seconds
|
* by at least 2 * WATCH_TEMP_INCREASE degrees celsius.
|
||||||
|
*/
|
||||||
|
#define WATCH_TEMP_PERIOD 16000 // 16 seconds
|
||||||
|
#define WATCH_TEMP_INCREASE 4 // Heat up at least 4 degrees in 16 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.
|
||||||
|
@ -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_heater(target_extruder);
|
||||||
|
#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_heater(target_extruder);
|
||||||
|
#endif
|
||||||
|
|
||||||
millis_t temp_ms = millis();
|
millis_t temp_ms = millis();
|
||||||
|
|
||||||
|
@ -14,13 +14,16 @@
|
|||||||
#endif
|
#endif
|
||||||
#define BED_CHECK_INTERVAL 5000 //ms between checks in bang-bang control
|
#define BED_CHECK_INTERVAL 5000 //ms between checks in bang-bang control
|
||||||
|
|
||||||
//// Heating sanity check:
|
/**
|
||||||
// This waits for the watch period in milliseconds whenever an M104 or M109 increases the target temperature
|
* Heating Sanity Check
|
||||||
// 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 the current temperature
|
* Whenever an M104 or M109 increases the target temperature this will wait for WATCH_TEMP_PERIOD milliseconds,
|
||||||
// differ by at least 2x WATCH_TEMP_INCREASE
|
* and if the temperature hasn't increased by WATCH_TEMP_INCREASE degrees, the machine is halted, requiring a
|
||||||
//#define WATCH_TEMP_PERIOD 40000 //40 seconds
|
* hard reset. This test restarts with any M104/M109, but only if the current temperature is below the target
|
||||||
//#define WATCH_TEMP_INCREASE 10 //Heat up at least 10 degree in 20 seconds
|
* by at least 2 * WATCH_TEMP_INCREASE degrees celsius.
|
||||||
|
*/
|
||||||
|
#define WATCH_TEMP_PERIOD 16000 // 16 seconds
|
||||||
|
#define WATCH_TEMP_INCREASE 4 // Heat up at least 4 degrees in 16 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.
|
||||||
|
@ -14,13 +14,16 @@
|
|||||||
#endif
|
#endif
|
||||||
#define BED_CHECK_INTERVAL 5000 //ms between checks in bang-bang control
|
#define BED_CHECK_INTERVAL 5000 //ms between checks in bang-bang control
|
||||||
|
|
||||||
//// Heating sanity check:
|
/**
|
||||||
// This waits for the watch period in milliseconds whenever an M104 or M109 increases the target temperature
|
* Heating Sanity Check
|
||||||
// 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 the current temperature
|
* Whenever an M104 or M109 increases the target temperature this will wait for WATCH_TEMP_PERIOD milliseconds,
|
||||||
// differ by at least 2x WATCH_TEMP_INCREASE
|
* and if the temperature hasn't increased by WATCH_TEMP_INCREASE degrees, the machine is halted, requiring a
|
||||||
//#define WATCH_TEMP_PERIOD 40000 //40 seconds
|
* hard reset. This test restarts with any M104/M109, but only if the current temperature is below the target
|
||||||
//#define WATCH_TEMP_INCREASE 10 //Heat up at least 10 degree in 20 seconds
|
* by at least 2 * WATCH_TEMP_INCREASE degrees celsius.
|
||||||
|
*/
|
||||||
|
#define WATCH_TEMP_PERIOD 16000 // 16 seconds
|
||||||
|
#define WATCH_TEMP_INCREASE 4 // Heat up at least 4 degrees in 16 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.
|
||||||
|
@ -14,13 +14,16 @@
|
|||||||
#endif
|
#endif
|
||||||
#define BED_CHECK_INTERVAL 5000 //ms between checks in bang-bang control
|
#define BED_CHECK_INTERVAL 5000 //ms between checks in bang-bang control
|
||||||
|
|
||||||
//// Heating sanity check:
|
/**
|
||||||
// This waits for the watch period in milliseconds whenever an M104 or M109 increases the target temperature
|
* Heating Sanity Check
|
||||||
// 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 the current temperature
|
* Whenever an M104 or M109 increases the target temperature this will wait for WATCH_TEMP_PERIOD milliseconds,
|
||||||
// differ by at least 2x WATCH_TEMP_INCREASE
|
* and if the temperature hasn't increased by WATCH_TEMP_INCREASE degrees, the machine is halted, requiring a
|
||||||
//#define WATCH_TEMP_PERIOD 40000 //40 seconds
|
* hard reset. This test restarts with any M104/M109, but only if the current temperature is below the target
|
||||||
//#define WATCH_TEMP_INCREASE 10 //Heat up at least 10 degree in 20 seconds
|
* by at least 2 * WATCH_TEMP_INCREASE degrees celsius.
|
||||||
|
*/
|
||||||
|
#define WATCH_TEMP_PERIOD 16000 // 16 seconds
|
||||||
|
#define WATCH_TEMP_INCREASE 4 // Heat up at least 4 degrees in 16 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.
|
||||||
|
@ -14,13 +14,16 @@
|
|||||||
#endif
|
#endif
|
||||||
#define BED_CHECK_INTERVAL 5000 //ms between checks in bang-bang control
|
#define BED_CHECK_INTERVAL 5000 //ms between checks in bang-bang control
|
||||||
|
|
||||||
//// Heating sanity check:
|
/**
|
||||||
// This waits for the watch period in milliseconds whenever an M104 or M109 increases the target temperature
|
* Heating Sanity Check
|
||||||
// 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 the current temperature
|
* Whenever an M104 or M109 increases the target temperature this will wait for WATCH_TEMP_PERIOD milliseconds,
|
||||||
// differ by at least 2x WATCH_TEMP_INCREASE
|
* and if the temperature hasn't increased by WATCH_TEMP_INCREASE degrees, the machine is halted, requiring a
|
||||||
//#define WATCH_TEMP_PERIOD 40000 //40 seconds
|
* hard reset. This test restarts with any M104/M109, but only if the current temperature is below the target
|
||||||
//#define WATCH_TEMP_INCREASE 10 //Heat up at least 10 degree in 20 seconds
|
* by at least 2 * WATCH_TEMP_INCREASE degrees celsius.
|
||||||
|
*/
|
||||||
|
#define WATCH_TEMP_PERIOD 16000 // 16 seconds
|
||||||
|
#define WATCH_TEMP_INCREASE 4 // Heat up at least 4 degrees in 16 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.
|
||||||
|
@ -14,13 +14,16 @@
|
|||||||
#endif
|
#endif
|
||||||
#define BED_CHECK_INTERVAL 3000 //ms between checks in bang-bang control
|
#define BED_CHECK_INTERVAL 3000 //ms between checks in bang-bang control
|
||||||
|
|
||||||
//// Heating sanity check:
|
/**
|
||||||
// This waits for the watch period in milliseconds whenever an M104 or M109 increases the target temperature
|
* Heating Sanity Check
|
||||||
// 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 the current temperature
|
* Whenever an M104 or M109 increases the target temperature this will wait for WATCH_TEMP_PERIOD milliseconds,
|
||||||
// differ by at least 2x WATCH_TEMP_INCREASE
|
* and if the temperature hasn't increased by WATCH_TEMP_INCREASE degrees, the machine is halted, requiring a
|
||||||
//#define WATCH_TEMP_PERIOD 40000 //40 seconds
|
* hard reset. This test restarts with any M104/M109, but only if the current temperature is below the target
|
||||||
//#define WATCH_TEMP_INCREASE 10 //Heat up at least 10 degree in 20 seconds
|
* by at least 2 * WATCH_TEMP_INCREASE degrees celsius.
|
||||||
|
*/
|
||||||
|
#define WATCH_TEMP_PERIOD 16000 // 16 seconds
|
||||||
|
#define WATCH_TEMP_INCREASE 4 // Heat up at least 4 degrees in 16 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.
|
||||||
|
@ -14,13 +14,16 @@
|
|||||||
#endif
|
#endif
|
||||||
#define BED_CHECK_INTERVAL 5000 //ms between checks in bang-bang control
|
#define BED_CHECK_INTERVAL 5000 //ms between checks in bang-bang control
|
||||||
|
|
||||||
//// Heating sanity check:
|
/**
|
||||||
// This waits for the watch period in milliseconds whenever an M104 or M109 increases the target temperature
|
* Heating Sanity Check
|
||||||
// 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 the current temperature
|
* Whenever an M104 or M109 increases the target temperature this will wait for WATCH_TEMP_PERIOD milliseconds,
|
||||||
// differ by at least 2x WATCH_TEMP_INCREASE
|
* and if the temperature hasn't increased by WATCH_TEMP_INCREASE degrees, the machine is halted, requiring a
|
||||||
//#define WATCH_TEMP_PERIOD 40000 //40 seconds
|
* hard reset. This test restarts with any M104/M109, but only if the current temperature is below the target
|
||||||
//#define WATCH_TEMP_INCREASE 10 //Heat up at least 10 degree in 20 seconds
|
* by at least 2 * WATCH_TEMP_INCREASE degrees celsius.
|
||||||
|
*/
|
||||||
|
#define WATCH_TEMP_PERIOD 16000 // 16 seconds
|
||||||
|
#define WATCH_TEMP_INCREASE 4 // Heat up at least 4 degrees in 16 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.
|
||||||
|
@ -14,13 +14,16 @@
|
|||||||
#endif
|
#endif
|
||||||
#define BED_CHECK_INTERVAL 5000 //ms between checks in bang-bang control
|
#define BED_CHECK_INTERVAL 5000 //ms between checks in bang-bang control
|
||||||
|
|
||||||
//// Heating sanity check:
|
/**
|
||||||
// This waits for the watch period in milliseconds whenever an M104 or M109 increases the target temperature
|
* Heating Sanity Check
|
||||||
// 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 the current temperature
|
* Whenever an M104 or M109 increases the target temperature this will wait for WATCH_TEMP_PERIOD milliseconds,
|
||||||
// differ by at least 2x WATCH_TEMP_INCREASE
|
* and if the temperature hasn't increased by WATCH_TEMP_INCREASE degrees, the machine is halted, requiring a
|
||||||
#define WATCH_TEMP_PERIOD 40000 //40 seconds
|
* hard reset. This test restarts with any M104/M109, but only if the current temperature is below the target
|
||||||
#define WATCH_TEMP_INCREASE 10 //Heat up at least 10 degree in 20 seconds
|
* by at least 2 * WATCH_TEMP_INCREASE degrees celsius.
|
||||||
|
*/
|
||||||
|
#define WATCH_TEMP_PERIOD 16000 // 16 seconds
|
||||||
|
#define WATCH_TEMP_INCREASE 4 // Heat up at least 4 degrees in 16 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.
|
||||||
|
@ -14,13 +14,16 @@
|
|||||||
#endif
|
#endif
|
||||||
#define BED_CHECK_INTERVAL 5000 //ms between checks in bang-bang control
|
#define BED_CHECK_INTERVAL 5000 //ms between checks in bang-bang control
|
||||||
|
|
||||||
//// Heating sanity check:
|
/**
|
||||||
// This waits for the watch period in milliseconds whenever an M104 or M109 increases the target temperature
|
* Heating Sanity Check
|
||||||
// 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 the current temperature
|
* Whenever an M104 or M109 increases the target temperature this will wait for WATCH_TEMP_PERIOD milliseconds,
|
||||||
// differ by at least 2x WATCH_TEMP_INCREASE
|
* and if the temperature hasn't increased by WATCH_TEMP_INCREASE degrees, the machine is halted, requiring a
|
||||||
//#define WATCH_TEMP_PERIOD 40000 //40 seconds
|
* hard reset. This test restarts with any M104/M109, but only if the current temperature is below the target
|
||||||
//#define WATCH_TEMP_INCREASE 10 //Heat up at least 10 degree in 20 seconds
|
* by at least 2 * WATCH_TEMP_INCREASE degrees celsius.
|
||||||
|
*/
|
||||||
|
#define WATCH_TEMP_PERIOD 16000 // 16 seconds
|
||||||
|
#define WATCH_TEMP_INCREASE 4 // Heat up at least 4 degrees in 16 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.
|
||||||
|
@ -14,13 +14,16 @@
|
|||||||
#endif
|
#endif
|
||||||
#define BED_CHECK_INTERVAL 5000 //ms between checks in bang-bang control
|
#define BED_CHECK_INTERVAL 5000 //ms between checks in bang-bang control
|
||||||
|
|
||||||
//// Heating sanity check:
|
/**
|
||||||
// This waits for the watch period in milliseconds whenever an M104 or M109 increases the target temperature
|
* Heating Sanity Check
|
||||||
// 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 the current temperature
|
* Whenever an M104 or M109 increases the target temperature this will wait for WATCH_TEMP_PERIOD milliseconds,
|
||||||
// differ by at least 2x WATCH_TEMP_INCREASE
|
* and if the temperature hasn't increased by WATCH_TEMP_INCREASE degrees, the machine is halted, requiring a
|
||||||
//#define WATCH_TEMP_PERIOD 40000 //40 seconds
|
* hard reset. This test restarts with any M104/M109, but only if the current temperature is below the target
|
||||||
//#define WATCH_TEMP_INCREASE 10 //Heat up at least 10 degree in 20 seconds
|
* by at least 2 * WATCH_TEMP_INCREASE degrees celsius.
|
||||||
|
*/
|
||||||
|
#define WATCH_TEMP_PERIOD 16000 // 16 seconds
|
||||||
|
#define WATCH_TEMP_INCREASE 4 // Heat up at least 4 degrees in 16 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.
|
||||||
|
@ -14,13 +14,16 @@
|
|||||||
#endif
|
#endif
|
||||||
#define BED_CHECK_INTERVAL 5000 //ms between checks in bang-bang control
|
#define BED_CHECK_INTERVAL 5000 //ms between checks in bang-bang control
|
||||||
|
|
||||||
//// Heating sanity check:
|
/**
|
||||||
// This waits for the watch period in milliseconds whenever an M104 or M109 increases the target temperature
|
* Heating Sanity Check
|
||||||
// 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 the current temperature
|
* Whenever an M104 or M109 increases the target temperature this will wait for WATCH_TEMP_PERIOD milliseconds,
|
||||||
// differ by at least 2x WATCH_TEMP_INCREASE
|
* and if the temperature hasn't increased by WATCH_TEMP_INCREASE degrees, the machine is halted, requiring a
|
||||||
//#define WATCH_TEMP_PERIOD 40000 //40 seconds
|
* hard reset. This test restarts with any M104/M109, but only if the current temperature is below the target
|
||||||
//#define WATCH_TEMP_INCREASE 10 //Heat up at least 10 degree in 20 seconds
|
* by at least 2 * WATCH_TEMP_INCREASE degrees celsius.
|
||||||
|
*/
|
||||||
|
#define WATCH_TEMP_PERIOD 16000 // 16 seconds
|
||||||
|
#define WATCH_TEMP_INCREASE 4 // Heat up at least 4 degrees in 16 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.
|
||||||
|
@ -14,13 +14,16 @@
|
|||||||
#endif
|
#endif
|
||||||
#define BED_CHECK_INTERVAL 5000 //ms between checks in bang-bang control
|
#define BED_CHECK_INTERVAL 5000 //ms between checks in bang-bang control
|
||||||
|
|
||||||
//// Heating sanity check:
|
/**
|
||||||
// This waits for the watch period in milliseconds whenever an M104 or M109 increases the target temperature
|
* Heating Sanity Check
|
||||||
// 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 the current temperature
|
* Whenever an M104 or M109 increases the target temperature this will wait for WATCH_TEMP_PERIOD milliseconds,
|
||||||
// differ by at least 2x WATCH_TEMP_INCREASE
|
* and if the temperature hasn't increased by WATCH_TEMP_INCREASE degrees, the machine is halted, requiring a
|
||||||
//#define WATCH_TEMP_PERIOD 40000 //40 seconds
|
* hard reset. This test restarts with any M104/M109, but only if the current temperature is below the target
|
||||||
//#define WATCH_TEMP_INCREASE 10 //Heat up at least 10 degree in 20 seconds
|
* by at least 2 * WATCH_TEMP_INCREASE degrees celsius.
|
||||||
|
*/
|
||||||
|
#define WATCH_TEMP_PERIOD 16000 // 16 seconds
|
||||||
|
#define WATCH_TEMP_INCREASE 4 // Heat up at least 4 degrees in 16 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.
|
||||||
|
@ -171,9 +171,9 @@ 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 watchmillis[EXTRUDERS] = { 0 };
|
millis_t watch_heater_next_ms[EXTRUDERS] = { 0 };
|
||||||
#endif //WATCH_TEMP_PERIOD
|
#endif
|
||||||
|
|
||||||
#ifndef SOFT_PWM_SCALE
|
#ifndef SOFT_PWM_SCALE
|
||||||
#define SOFT_PWM_SCALE 0
|
#define SOFT_PWM_SCALE 0
|
||||||
@ -447,14 +447,14 @@ void checkExtruderAutoFans()
|
|||||||
//
|
//
|
||||||
// Temperature Error Handlers
|
// Temperature Error Handlers
|
||||||
//
|
//
|
||||||
inline void _temp_error(int e, const char *msg1, const char *msg2) {
|
inline void _temp_error(int e, const char *serial_msg, const char *lcd_msg) {
|
||||||
if (IsRunning()) {
|
if (IsRunning()) {
|
||||||
SERIAL_ERROR_START;
|
SERIAL_ERROR_START;
|
||||||
if (e >= 0) SERIAL_ERRORLN((int)e);
|
if (e >= 0) SERIAL_ERRORLN((int)e);
|
||||||
serialprintPGM(msg1);
|
serialprintPGM(serial_msg);
|
||||||
MYSERIAL.write('\n');
|
MYSERIAL.write('\n');
|
||||||
#ifdef ULTRA_LCD
|
#ifdef ULTRA_LCD
|
||||||
lcd_setalertstatuspgm(msg2);
|
lcd_setalertstatuspgm(lcd_msg);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#ifndef BOGUS_TEMPERATURE_FAILSAFE_OVERRIDE
|
#ifndef BOGUS_TEMPERATURE_FAILSAFE_OVERRIDE
|
||||||
@ -602,7 +602,7 @@ void manage_heater() {
|
|||||||
float ct = current_temperature[0];
|
float ct = current_temperature[0];
|
||||||
if (ct > min(HEATER_0_MAXTEMP, 1023)) max_temp_error(0);
|
if (ct > min(HEATER_0_MAXTEMP, 1023)) max_temp_error(0);
|
||||||
if (ct < max(HEATER_0_MINTEMP, 0.01)) min_temp_error(0);
|
if (ct < max(HEATER_0_MINTEMP, 0.01)) min_temp_error(0);
|
||||||
#endif //HEATER_0_USES_MAX6675
|
#endif
|
||||||
|
|
||||||
#if defined(WATCH_TEMP_PERIOD) || !defined(PIDTEMPBED) || HAS_AUTO_FAN
|
#if defined(WATCH_TEMP_PERIOD) || !defined(PIDTEMPBED) || HAS_AUTO_FAN
|
||||||
millis_t ms = millis();
|
millis_t ms = millis();
|
||||||
@ -620,26 +620,29 @@ void manage_heater() {
|
|||||||
// Check if temperature is within the correct range
|
// Check if temperature is within the correct range
|
||||||
soft_pwm[e] = current_temperature[e] > minttemp[e] && current_temperature[e] < maxttemp[e] ? (int)pid_output >> 1 : 0;
|
soft_pwm[e] = current_temperature[e] > minttemp[e] && current_temperature[e] < maxttemp[e] ? (int)pid_output >> 1 : 0;
|
||||||
|
|
||||||
|
// Check if the temperature is failing to increase
|
||||||
#ifdef WATCH_TEMP_PERIOD
|
#ifdef WATCH_TEMP_PERIOD
|
||||||
if (watchmillis[e] && ms > watchmillis[e] + WATCH_TEMP_PERIOD) {
|
// Is it time to check this extruder's heater?
|
||||||
if (degHotend(e) < watch_start_temp[e] + WATCH_TEMP_INCREASE) {
|
if (watch_heater_next_ms[e] && ms > watch_heater_next_ms[e]) {
|
||||||
setTargetHotend(0, e);
|
// Has it failed to increase enough?
|
||||||
LCD_MESSAGEPGM(MSG_HEATING_FAILED_LCD); // translatable
|
if (degHotend(e) < watch_target_temp[e]) {
|
||||||
SERIAL_ECHO_START;
|
// Stop!
|
||||||
SERIAL_ECHOLNPGM(MSG_HEATING_FAILED);
|
disable_all_heaters();
|
||||||
|
_temp_error(e, MSG_HEATING_FAILED, MSG_HEATING_FAILED_LCD);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
watchmillis[e] = 0;
|
// Only check once per M104/M109
|
||||||
|
watch_heater_next_ms[e] = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif //WATCH_TEMP_PERIOD
|
#endif // WATCH_TEMP_PERIOD
|
||||||
|
|
||||||
#ifdef TEMP_SENSOR_1_AS_REDUNDANT
|
#ifdef TEMP_SENSOR_1_AS_REDUNDANT
|
||||||
if (fabs(current_temperature[0] - redundant_temperature) > MAX_REDUNDANT_TEMP_SENSOR_DIFF) {
|
if (fabs(current_temperature[0] - redundant_temperature) > MAX_REDUNDANT_TEMP_SENSOR_DIFF) {
|
||||||
disable_all_heaters();
|
disable_all_heaters();
|
||||||
_temp_error(0, PSTR(MSG_EXTRUDER_SWITCHED_OFF), PSTR(MSG_ERR_REDUNDANT_TEMP));
|
_temp_error(0, PSTR(MSG_EXTRUDER_SWITCHED_OFF), PSTR(MSG_ERR_REDUNDANT_TEMP));
|
||||||
}
|
}
|
||||||
#endif // TEMP_SENSOR_1_AS_REDUNDANT
|
#endif
|
||||||
|
|
||||||
} // Extruders Loop
|
} // Extruders Loop
|
||||||
|
|
||||||
@ -996,17 +999,22 @@ void tp_init() {
|
|||||||
#endif //BED_MAXTEMP
|
#endif //BED_MAXTEMP
|
||||||
}
|
}
|
||||||
|
|
||||||
void setWatch() {
|
#ifdef WATCH_TEMP_PERIOD
|
||||||
#ifdef WATCH_TEMP_PERIOD
|
/**
|
||||||
millis_t ms = millis();
|
* Start Heating Sanity Check for hotends that are below
|
||||||
for (int e = 0; e < EXTRUDERS; e++) {
|
* their target temperature by a configurable margin.
|
||||||
if (degHotend(e) < degTargetHotend(e) - (WATCH_TEMP_INCREASE * 2)) {
|
* This is called when the temperature is set. (M104, M109)
|
||||||
watch_start_temp[e] = degHotend(e);
|
*/
|
||||||
watchmillis[e] = ms;
|
void start_watching_heater(int e) {
|
||||||
}
|
millis_t ms = millis() + WATCH_TEMP_PERIOD;
|
||||||
|
if (degHotend(e) < degTargetHotend(e) - (WATCH_TEMP_INCREASE * 2)) {
|
||||||
|
watch_target_temp[e] = degHotend(e) + WATCH_TEMP_INCREASE;
|
||||||
|
watch_heater_next_ms[e] = ms;
|
||||||
}
|
}
|
||||||
#endif
|
else
|
||||||
}
|
watch_heater_next_ms[e] = 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#if HAS_HEATER_THERMAL_PROTECTION || HAS_BED_THERMAL_PROTECTION
|
#if HAS_HEATER_THERMAL_PROTECTION || HAS_BED_THERMAL_PROTECTION
|
||||||
|
|
||||||
|
@ -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_heater(int e=0);
|
||||||
|
#endif
|
||||||
|
|
||||||
FORCE_INLINE void autotempShutdown() {
|
FORCE_INLINE void autotempShutdown() {
|
||||||
#ifdef AUTOTEMP
|
#ifdef AUTOTEMP
|
||||||
if (autotemp_enabled) {
|
if (autotemp_enabled) {
|
||||||
|
@ -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
|
||||||
|
if (endnum >= 0) start_watching_heater(endnum);
|
||||||
|
#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); }
|
||||||
|
Loading…
Reference in New Issue
Block a user