Combine thermal runaway and watch-period

- Make thermal protection for all hotends and/or bed into simple
switches
- Now enable `WATCH_TEMP_PERIOD` when `THERMAL_PROTECTION_HOTENDS` is
enabled
- Move detailed thermal parameters to `Configuration_adv.h`
- Add sanity checks to warn about old configurations
- Change `WATCH_TEMP_PERIOD` to seconds instead of milliseconds
2.0.x
Scott Lahteine 10 years ago
parent 4097207c75
commit 2445ae3d3a

@ -284,24 +284,10 @@ Here are some standard links for getting your machine calibrated:
* The solution: Once the temperature reaches the target, start observing. * The solution: Once the temperature reaches the target, start observing.
* If the temperature stays too far below the target (hysteresis) for too long, * If the temperature stays too far below the target (hysteresis) for too long,
* the firmware will halt as a safety precaution. * the firmware will halt as a safety precaution.
*
* Note that because the countdown starts only AFTER the temperature reaches
* the target, this will not catch a thermistor that is already disconnected
* when the print starts!
*
* To enable for all extruder heaters, uncomment the two defines below:
*/ */
// Parameters for all extruder heaters #define THERMAL_PROTECTION_HOTENDS // Enable thermal protection for all extruders
#define THERMAL_RUNAWAY_PROTECTION_PERIOD 40 // in seconds #define THERMAL_PROTECTION_BED // Enable thermal protection for the heated bed
#define THERMAL_RUNAWAY_PROTECTION_HYSTERESIS 4 // in degree Celsius
// To enable for the bed heater, uncomment the two defines below:
// Parameters for the bed heater
#define THERMAL_RUNAWAY_PROTECTION_BED_PERIOD 20 // in seconds
#define THERMAL_RUNAWAY_PROTECTION_BED_HYSTERESIS 2 // in degree Celsius
//=========================================================================== //===========================================================================
//============================= Mechanical Settings ========================= //============================= Mechanical Settings =========================

@ -15,15 +15,26 @@
#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 * Thermal Protection parameters
*
* Whenever an M104 or M109 increases the target temperature this will wait for WATCH_TEMP_PERIOD milliseconds,
* and if the temperature hasn't increased by WATCH_TEMP_INCREASE degrees, the machine is halted, requiring a
* hard reset. This test restarts with any M104/M109, but only if the current temperature is below the target
* by at least 2 * WATCH_TEMP_INCREASE degrees celsius.
*/ */
#define WATCH_TEMP_PERIOD 16000 // 16 seconds #ifdef THERMAL_PROTECTION_HOTENDS
#define WATCH_TEMP_INCREASE 4 // Heat up at least 4 degrees in 16 seconds #define THERMAL_PROTECTION_PERIOD 40 // Seconds
#define THERMAL_PROTECTION_HYSTERESIS 4 // Degrees Celsius
/**
* Whenever an M104 or M109 increases the target temperature the firmware will wait for the
* WATCH_TEMP_PERIOD to transpire, and if the temperature hasn't increased by WATCH_TEMP_INCREASE
* degrees, the machine is halted, requiring a hard reset. This test restarts with any M104/M109,
* but only if the current temperature is below the target by at least 2 * WATCH_TEMP_INCREASE degrees.
*/
#define WATCH_TEMP_PERIOD 16 // Seconds
#define WATCH_TEMP_INCREASE 4 // Degrees Celsius
#endif
#ifdef THERMAL_PROTECTION_BED
#define THERMAL_PROTECTION_BED_PERIOD 20 // Seconds
#define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius
#endif
#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.
@ -34,14 +45,16 @@
#endif #endif
#endif #endif
/**
//automatic temperature: The hot end target temperature is calculated by all the buffered lines of gcode. * Automatic Temperature:
//The maximum buffered steps/sec of the extruder motor are called "se". * The hotend target temperature is calculated by all the buffered lines of gcode.
//You enter the autotemp mode by a M109 S<mintemp> B<maxtemp> F<factor> * The maximum buffered steps/sec of the extruder motor is called "se".
// the target temperature is set to mintemp+factor*se[steps/sec] and limited by mintemp and maxtemp * Start autotemp mode with M109 S<mintemp> B<maxtemp> F<factor>
// you exit the value by any M109 without F* * The target temperature is set to mintemp+factor*se[steps/sec] and is limited by
// Also, if the temperature is set to a value <mintemp, it is not changed by autotemp. * mintemp and maxtemp. Turn this off by excuting M109 without F*
// on an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode * Also, if the temperature is set to a value below mintemp, it will not be changed by autotemp.
* On an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode
*/
#define AUTOTEMP #define AUTOTEMP
#ifdef AUTOTEMP #ifdef AUTOTEMP
#define AUTOTEMP_OLDWEIGHT 0.98 #define AUTOTEMP_OLDWEIGHT 0.98

@ -3167,7 +3167,7 @@ inline void gcode_M104() {
setTargetHotend1(temp == 0.0 ? 0.0 : temp + duplicate_extruder_temp_offset); setTargetHotend1(temp == 0.0 ? 0.0 : temp + duplicate_extruder_temp_offset);
#endif #endif
#ifdef WATCH_TEMP_PERIOD #ifdef THERMAL_PROTECTION_HOTENDS
start_watching_heater(target_extruder); start_watching_heater(target_extruder);
#endif #endif
} }
@ -3281,7 +3281,7 @@ inline void gcode_M109() {
if (code_seen('B')) autotemp_max = code_value(); if (code_seen('B')) autotemp_max = code_value();
#endif #endif
#ifdef WATCH_TEMP_PERIOD #ifdef THERMAL_PROTECTION_HOTENDS
start_watching_heater(target_extruder); start_watching_heater(target_extruder);
#endif #endif

@ -313,4 +313,16 @@
#error [XYZ]_HOME_RETRACT_MM settings have been renamed [XYZ]_HOME_BUMP_MM #error [XYZ]_HOME_RETRACT_MM settings have been renamed [XYZ]_HOME_BUMP_MM
#endif #endif
#if WATCH_TEMP_PERIOD > 500
#error WATCH_TEMP_PERIOD now uses seconds instead of milliseconds
#endif
#if !defined(THERMAL_PROTECTION_HOTENDS) && (defined(WATCH_TEMP_PERIOD) || defined(THERMAL_PROTECTION_PERIOD))
#error Thermal Runaway Protection for hotends must now be enabled with THERMAL_PROTECTION_HOTENDS
#endif
#if !defined(THERMAL_PROTECTION_BED) && defined(THERMAL_PROTECTION_BED_PERIOD)
#error Thermal Runaway Protection for the bed must now be enabled with THERMAL_PROTECTION_BED
#error
#endif //SANITYCHECK_H #endif //SANITYCHECK_H

@ -284,23 +284,10 @@ Here are some standard links for getting your machine calibrated:
* The solution: Once the temperature reaches the target, start observing. * The solution: Once the temperature reaches the target, start observing.
* If the temperature stays too far below the target (hysteresis) for too long, * If the temperature stays too far below the target (hysteresis) for too long,
* the firmware will halt as a safety precaution. * the firmware will halt as a safety precaution.
*
* Note that because the countdown starts only AFTER the temperature reaches
* the target, this will not catch a thermistor that is already disconnected
* when the print starts!
*
* To enable for all extruder heaters, uncomment the two defines below:
*/ */
// Parameters for all extruder heaters #define THERMAL_PROTECTION_HOTENDS // Enable thermal protection for all extruders
#define THERMAL_RUNAWAY_PROTECTION_PERIOD 40 // in seconds #define THERMAL_PROTECTION_BED // Enable thermal protection for the heated bed
#define THERMAL_RUNAWAY_PROTECTION_HYSTERESIS 4 // in degree Celsius
// To enable for the bed heater, uncomment the two defines below:
// Parameters for the bed heater
#define THERMAL_RUNAWAY_PROTECTION_BED_PERIOD 20 // in seconds
#define THERMAL_RUNAWAY_PROTECTION_BED_HYSTERESIS 2 // in degree Celsius
//=========================================================================== //===========================================================================
//============================= Mechanical Settings ========================= //============================= Mechanical Settings =========================

@ -15,16 +15,37 @@
#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 * Thermal Protection parameters
*
* Whenever an M104 or M109 increases the target temperature this will wait for WATCH_TEMP_PERIOD milliseconds,
* and if the temperature hasn't increased by WATCH_TEMP_INCREASE degrees, the machine is halted, requiring a
* hard reset. This test restarts with any M104/M109, but only if the current temperature is below the target
* by at least 2 * WATCH_TEMP_INCREASE degrees celsius.
*/ */
#define WATCH_TEMP_PERIOD 16000 // 16 seconds #ifdef THERMAL_PROTECTION_HOTENDS
#define WATCH_TEMP_INCREASE 4 // Heat up at least 4 degrees in 16 seconds #define THERMAL_PROTECTION_PERIOD 40 // Seconds
#define THERMAL_PROTECTION_HYSTERESIS 4 // Degrees Celsius
/**
* Whenever an M104 or M109 increases the target temperature the firmware will wait for the
* WATCH_TEMP_PERIOD to transpire, and if the temperature hasn't increased by WATCH_TEMP_INCREASE
* degrees, the machine is halted, requiring a hard reset. This test restarts with any M104/M109,
* but only if the current temperature is below the target by at least 2 * WATCH_TEMP_INCREASE degrees.
*/
#define WATCH_TEMP_PERIOD 16 // Seconds
#define WATCH_TEMP_INCREASE 4 // Degrees Celsius
#endif
#ifdef THERMAL_PROTECTION_BED
#define THERMAL_PROTECTION_BED_PERIOD 20 // Seconds
#define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius
#endif
/**
* Automatic Temperature:
* The hotend target temperature is calculated by all the buffered lines of gcode.
* The maximum buffered steps/sec of the extruder motor is called "se".
* Start autotemp mode with M109 S<mintemp> B<maxtemp> F<factor>
* The target temperature is set to mintemp+factor*se[steps/sec] and is limited by
* mintemp and maxtemp. Turn this off by excuting M109 without F*
* Also, if the temperature is set to a value below mintemp, it will not be changed by autotemp.
* On an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode
*/
#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.
// if Kc is chosen well, the additional required power due to increased melting should be compensated. // if Kc is chosen well, the additional required power due to increased melting should be compensated.

@ -250,23 +250,10 @@ Here are some standard links for getting your machine calibrated:
* The solution: Once the temperature reaches the target, start observing. * The solution: Once the temperature reaches the target, start observing.
* If the temperature stays too far below the target (hysteresis) for too long, * If the temperature stays too far below the target (hysteresis) for too long,
* the firmware will halt as a safety precaution. * the firmware will halt as a safety precaution.
*
* Note that because the countdown starts only AFTER the temperature reaches
* the target, this will not catch a thermistor that is already disconnected
* when the print starts!
*
* To enable for all extruder heaters, uncomment the two defines below:
*/ */
// Parameters for all extruder heaters #define THERMAL_PROTECTION_HOTENDS // Enable thermal protection for all extruders
#define THERMAL_RUNAWAY_PROTECTION_PERIOD 40 // in seconds #define THERMAL_PROTECTION_BED // Enable thermal protection for the heated bed
#define THERMAL_RUNAWAY_PROTECTION_HYSTERESIS 4 // in degree Celsius
// To enable for the bed heater, uncomment the two defines below:
// Parameters for the bed heater
#define THERMAL_RUNAWAY_PROTECTION_BED_PERIOD 20 // in seconds
#define THERMAL_RUNAWAY_PROTECTION_BED_HYSTERESIS 2 // in degree Celsius
//=========================================================================== //===========================================================================
//============================= Mechanical Settings ========================= //============================= Mechanical Settings =========================

@ -250,23 +250,10 @@ Here are some standard links for getting your machine calibrated:
* The solution: Once the temperature reaches the target, start observing. * The solution: Once the temperature reaches the target, start observing.
* If the temperature stays too far below the target (hysteresis) for too long, * If the temperature stays too far below the target (hysteresis) for too long,
* the firmware will halt as a safety precaution. * the firmware will halt as a safety precaution.
*
* Note that because the countdown starts only AFTER the temperature reaches
* the target, this will not catch a thermistor that is already disconnected
* when the print starts!
*
* To enable for all extruder heaters, uncomment the two defines below:
*/ */
// Parameters for all extruder heaters #define THERMAL_PROTECTION_HOTENDS // Enable thermal protection for all extruders
#define THERMAL_RUNAWAY_PROTECTION_PERIOD 40 // in seconds #define THERMAL_PROTECTION_BED // Enable thermal protection for the heated bed
#define THERMAL_RUNAWAY_PROTECTION_HYSTERESIS 4 // in degree Celsius
// To enable for the bed heater, uncomment the two defines below:
// Parameters for the bed heater
#define THERMAL_RUNAWAY_PROTECTION_BED_PERIOD 20 // in seconds
#define THERMAL_RUNAWAY_PROTECTION_BED_HYSTERESIS 2 // in degree Celsius
//=========================================================================== //===========================================================================
//============================= Mechanical Settings ========================= //============================= Mechanical Settings =========================

@ -15,16 +15,37 @@
#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 * Thermal Protection parameters
*
* Whenever an M104 or M109 increases the target temperature this will wait for WATCH_TEMP_PERIOD milliseconds,
* and if the temperature hasn't increased by WATCH_TEMP_INCREASE degrees, the machine is halted, requiring a
* hard reset. This test restarts with any M104/M109, but only if the current temperature is below the target
* by at least 2 * WATCH_TEMP_INCREASE degrees celsius.
*/ */
#define WATCH_TEMP_PERIOD 16000 // 16 seconds #ifdef THERMAL_PROTECTION_HOTENDS
#define WATCH_TEMP_INCREASE 4 // Heat up at least 4 degrees in 16 seconds #define THERMAL_PROTECTION_PERIOD 40 // Seconds
#define THERMAL_PROTECTION_HYSTERESIS 4 // Degrees Celsius
/**
* Whenever an M104 or M109 increases the target temperature the firmware will wait for the
* WATCH_TEMP_PERIOD to transpire, and if the temperature hasn't increased by WATCH_TEMP_INCREASE
* degrees, the machine is halted, requiring a hard reset. This test restarts with any M104/M109,
* but only if the current temperature is below the target by at least 2 * WATCH_TEMP_INCREASE degrees.
*/
#define WATCH_TEMP_PERIOD 16 // Seconds
#define WATCH_TEMP_INCREASE 4 // Degrees Celsius
#endif
#ifdef THERMAL_PROTECTION_BED
#define THERMAL_PROTECTION_BED_PERIOD 20 // Seconds
#define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius
#endif
/**
* Automatic Temperature:
* The hotend target temperature is calculated by all the buffered lines of gcode.
* The maximum buffered steps/sec of the extruder motor is called "se".
* Start autotemp mode with M109 S<mintemp> B<maxtemp> F<factor>
* The target temperature is set to mintemp+factor*se[steps/sec] and is limited by
* mintemp and maxtemp. Turn this off by excuting M109 without F*
* Also, if the temperature is set to a value below mintemp, it will not be changed by autotemp.
* On an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode
*/
#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.
// if Kc is chosen well, the additional required power due to increased melting should be compensated. // if Kc is chosen well, the additional required power due to increased melting should be compensated.

@ -271,23 +271,10 @@ Here are some standard links for getting your machine calibrated:
* The solution: Once the temperature reaches the target, start observing. * The solution: Once the temperature reaches the target, start observing.
* If the temperature stays too far below the target (hysteresis) for too long, * If the temperature stays too far below the target (hysteresis) for too long,
* the firmware will halt as a safety precaution. * the firmware will halt as a safety precaution.
*
* Note that because the countdown starts only AFTER the temperature reaches
* the target, this will not catch a thermistor that is already disconnected
* when the print starts!
*
* To enable for all extruder heaters, uncomment the two defines below:
*/ */
// Parameters for all extruder heaters #define THERMAL_PROTECTION_HOTENDS // Enable thermal protection for all extruders
#define THERMAL_RUNAWAY_PROTECTION_PERIOD 40 // in seconds #define THERMAL_PROTECTION_BED // Enable thermal protection for the heated bed
#define THERMAL_RUNAWAY_PROTECTION_HYSTERESIS 4 // in degree Celsius
// To enable for the bed heater, uncomment the two defines below:
// Parameters for the bed heater
#define THERMAL_RUNAWAY_PROTECTION_BED_PERIOD 20 // in seconds
#define THERMAL_RUNAWAY_PROTECTION_BED_HYSTERESIS 2 // in degree Celsius
//=========================================================================== //===========================================================================
//============================= Mechanical Settings ========================= //============================= Mechanical Settings =========================

@ -15,16 +15,37 @@
#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 * Thermal Protection parameters
*
* Whenever an M104 or M109 increases the target temperature this will wait for WATCH_TEMP_PERIOD milliseconds,
* and if the temperature hasn't increased by WATCH_TEMP_INCREASE degrees, the machine is halted, requiring a
* hard reset. This test restarts with any M104/M109, but only if the current temperature is below the target
* by at least 2 * WATCH_TEMP_INCREASE degrees celsius.
*/ */
#define WATCH_TEMP_PERIOD 16000 // 16 seconds #ifdef THERMAL_PROTECTION_HOTENDS
#define WATCH_TEMP_INCREASE 4 // Heat up at least 4 degrees in 16 seconds #define THERMAL_PROTECTION_PERIOD 40 // Seconds
#define THERMAL_PROTECTION_HYSTERESIS 4 // Degrees Celsius
/**
* Whenever an M104 or M109 increases the target temperature the firmware will wait for the
* WATCH_TEMP_PERIOD to transpire, and if the temperature hasn't increased by WATCH_TEMP_INCREASE
* degrees, the machine is halted, requiring a hard reset. This test restarts with any M104/M109,
* but only if the current temperature is below the target by at least 2 * WATCH_TEMP_INCREASE degrees.
*/
#define WATCH_TEMP_PERIOD 16 // Seconds
#define WATCH_TEMP_INCREASE 4 // Degrees Celsius
#endif
#ifdef THERMAL_PROTECTION_BED
#define THERMAL_PROTECTION_BED_PERIOD 20 // Seconds
#define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius
#endif
/**
* Automatic Temperature:
* The hotend target temperature is calculated by all the buffered lines of gcode.
* The maximum buffered steps/sec of the extruder motor is called "se".
* Start autotemp mode with M109 S<mintemp> B<maxtemp> F<factor>
* The target temperature is set to mintemp+factor*se[steps/sec] and is limited by
* mintemp and maxtemp. Turn this off by excuting M109 without F*
* Also, if the temperature is set to a value below mintemp, it will not be changed by autotemp.
* On an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode
*/
#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.
// if Kc is chosen well, the additional required power due to increased melting should be compensated. // if Kc is chosen well, the additional required power due to increased melting should be compensated.

@ -300,23 +300,10 @@ Here are some standard links for getting your machine calibrated:
* The solution: Once the temperature reaches the target, start observing. * The solution: Once the temperature reaches the target, start observing.
* If the temperature stays too far below the target (hysteresis) for too long, * If the temperature stays too far below the target (hysteresis) for too long,
* the firmware will halt as a safety precaution. * the firmware will halt as a safety precaution.
*
* Note that because the countdown starts only AFTER the temperature reaches
* the target, this will not catch a thermistor that is already disconnected
* when the print starts!
*
* To enable for all extruder heaters, uncomment the two defines below:
*/ */
// Parameters for all extruder heaters #define THERMAL_PROTECTION_HOTENDS // Enable thermal protection for all extruders
#define THERMAL_RUNAWAY_PROTECTION_PERIOD 40 // in seconds #define THERMAL_PROTECTION_BED // Enable thermal protection for the heated bed
#define THERMAL_RUNAWAY_PROTECTION_HYSTERESIS 4 // in degree Celsius
// To enable for the bed heater, uncomment the two defines below:
// Parameters for the bed heater
#define THERMAL_RUNAWAY_PROTECTION_BED_PERIOD 20 // in seconds
#define THERMAL_RUNAWAY_PROTECTION_BED_HYSTERESIS 2 // in degree Celsius
//=========================================================================== //===========================================================================
//============================= Mechanical Settings ========================= //============================= Mechanical Settings =========================

@ -15,16 +15,37 @@
#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 * Thermal Protection parameters
*
* Whenever an M104 or M109 increases the target temperature this will wait for WATCH_TEMP_PERIOD milliseconds,
* and if the temperature hasn't increased by WATCH_TEMP_INCREASE degrees, the machine is halted, requiring a
* hard reset. This test restarts with any M104/M109, but only if the current temperature is below the target
* by at least 2 * WATCH_TEMP_INCREASE degrees celsius.
*/ */
#define WATCH_TEMP_PERIOD 16000 // 16 seconds #ifdef THERMAL_PROTECTION_HOTENDS
#define WATCH_TEMP_INCREASE 4 // Heat up at least 4 degrees in 16 seconds #define THERMAL_PROTECTION_PERIOD 40 // Seconds
#define THERMAL_PROTECTION_HYSTERESIS 4 // Degrees Celsius
/**
* Whenever an M104 or M109 increases the target temperature the firmware will wait for the
* WATCH_TEMP_PERIOD to transpire, and if the temperature hasn't increased by WATCH_TEMP_INCREASE
* degrees, the machine is halted, requiring a hard reset. This test restarts with any M104/M109,
* but only if the current temperature is below the target by at least 2 * WATCH_TEMP_INCREASE degrees.
*/
#define WATCH_TEMP_PERIOD 16 // Seconds
#define WATCH_TEMP_INCREASE 4 // Degrees Celsius
#endif
#ifdef THERMAL_PROTECTION_BED
#define THERMAL_PROTECTION_BED_PERIOD 20 // Seconds
#define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius
#endif
/**
* Automatic Temperature:
* The hotend target temperature is calculated by all the buffered lines of gcode.
* The maximum buffered steps/sec of the extruder motor is called "se".
* Start autotemp mode with M109 S<mintemp> B<maxtemp> F<factor>
* The target temperature is set to mintemp+factor*se[steps/sec] and is limited by
* mintemp and maxtemp. Turn this off by excuting M109 without F*
* Also, if the temperature is set to a value below mintemp, it will not be changed by autotemp.
* On an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode
*/
#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.
// if Kc is chosen well, the additional required power due to increased melting should be compensated. // if Kc is chosen well, the additional required power due to increased melting should be compensated.

@ -200,8 +200,7 @@ Here are some standard links for getting your machine calibrated:
// is more then PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. // is more then PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max.
#define PID_INTEGRAL_DRIVE_MAX PID_MAX //limit for the integral term #define PID_INTEGRAL_DRIVE_MAX PID_MAX //limit for the integral term
#define K1 0.95 //smoothing factor within the PID #define K1 0.95 //smoothing factor within the PID
#define PID_dT ((16.0 * 8.0)/(F_CPU / 64.0 / 256.0)) //sampling period of the temperature routine
// If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it
// Ultimaker // Ultimaker
#define DEFAULT_Kp 22.2 #define DEFAULT_Kp 22.2
@ -271,44 +270,24 @@ Here are some standard links for getting your machine calibrated:
#define EXTRUDE_MAXLENGTH (X_MAX_LENGTH+Y_MAX_LENGTH) //prevent extrusion of very large distances. #define EXTRUDE_MAXLENGTH (X_MAX_LENGTH+Y_MAX_LENGTH) //prevent extrusion of very large distances.
//=========================================================================== //===========================================================================
//============================= Thermal Runaway Protection ================== //======================== Thermal Runaway Protection =======================
//=========================================================================== //===========================================================================
/*
This is a feature to protect your printer from burn up in flames if it has
a thermistor coming off place (this happened to a friend of mine recently and
motivated me writing this feature).
The issue: If a thermistor come off, it will read a lower temperature than actual.
The system will turn the heater on forever, burning up the filament and anything
else around.
After the temperature reaches the target for the first time, this feature will
start measuring for how long the current temperature stays below the target
minus _HYSTERESIS (set_temperature - THERMAL_RUNAWAY_PROTECTION_HYSTERESIS).
If it stays longer than _PERIOD, it means the thermistor temperature
cannot catch up with the target, so something *may be* wrong. Then, to be on the
safe side, the system will he halt.
Bear in mind the count down will just start AFTER the first time the
thermistor temperature is over the target, so you will have no problem if
your extruder heater takes 2 minutes to hit the target on heating.
*/
// If you want to enable this feature for all your extruder heaters,
// uncomment the 2 defines below:
// Parameters for all extruder heaters
#define THERMAL_RUNAWAY_PROTECTION_PERIOD 40 //in seconds
#define THERMAL_RUNAWAY_PROTECTION_HYSTERESIS 4 // in degree Celsius
// If you want to enable this feature for your bed heater, /**
// uncomment the 2 defines below: * Thermal Runaway Protection protects your printer from damage and fire if a
* thermistor falls out or temperature sensors fail in any way.
// Parameters for the bed heater *
#define THERMAL_RUNAWAY_PROTECTION_BED_PERIOD 20 //in seconds * The issue: If a thermistor falls out or a temperature sensor fails,
#define THERMAL_RUNAWAY_PROTECTION_BED_HYSTERESIS 2 // in degree Celsius * Marlin can no longer sense the actual temperature. Since a disconnected
* thermistor reads as a low temperature, the firmware will keep the heater on.
*
* The solution: Once the temperature reaches the target, start observing.
* If the temperature stays too far below the target (hysteresis) for too long,
* the firmware will halt as a safety precaution.
*/
#define THERMAL_PROTECTION_HOTENDS // Enable thermal protection for all extruders
#define THERMAL_PROTECTION_BED // Enable thermal protection for the heated bed
//=========================================================================== //===========================================================================
//============================= Mechanical Settings ========================= //============================= Mechanical Settings =========================
@ -412,17 +391,20 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
#define Z_MAX_POS 200 #define Z_MAX_POS 200
//=========================================================================== //===========================================================================
//============================= Filament Runout Sensor ====================== //========================= Filament Runout Sensor ==========================
//=========================================================================== //===========================================================================
//#define FILAMENT_RUNOUT_SENSOR // Uncomment for defining a filament runout sensor such as a mechanical or opto endstop to check the existence of filament //#define FILAMENT_RUNOUT_SENSOR // Uncomment for defining a filament runout sensor such as a mechanical or opto endstop to check the existence of filament
// In RAMPS uses servo pin 2. Can be changed in pins file. For other boards pin definition should be made. // In RAMPS uses servo pin 2. Can be changed in pins file. For other boards pin definition should be made.
// It is assumed that when logic high = filament available // It is assumed that when logic high = filament available
// when logic low = filament ran out // when logic low = filament ran out
//const bool FIL_RUNOUT_INVERTING = true; // Should be uncommented and true or false should assigned #ifdef FILAMENT_RUNOUT_SENSOR
//#define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. const bool FIL_RUNOUT_INVERTING = true; // Should be uncommented and true or false should assigned
#define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined.
#define FILAMENT_RUNOUT_SCRIPT "M600"
#endif
//=========================================================================== //===========================================================================
//============================ Mesh Bed Leveling ============================ //=========================== Manual Bed Leveling ===========================
//=========================================================================== //===========================================================================
// #define MANUAL_BED_LEVELING // Add display menu option for bed leveling // #define MANUAL_BED_LEVELING // Add display menu option for bed leveling
@ -443,7 +425,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
#endif // MESH_BED_LEVELING #endif // MESH_BED_LEVELING
//=========================================================================== //===========================================================================
//============================= Bed Auto Leveling =========================== //============================ Bed Auto Leveling ============================
//=========================================================================== //===========================================================================
// @section bedlevel // @section bedlevel

@ -302,23 +302,10 @@ Here are some standard links for getting your machine calibrated:
* The solution: Once the temperature reaches the target, start observing. * The solution: Once the temperature reaches the target, start observing.
* If the temperature stays too far below the target (hysteresis) for too long, * If the temperature stays too far below the target (hysteresis) for too long,
* the firmware will halt as a safety precaution. * the firmware will halt as a safety precaution.
*
* Note that because the countdown starts only AFTER the temperature reaches
* the target, this will not catch a thermistor that is already disconnected
* when the print starts!
*
* To enable for all extruder heaters, uncomment the two defines below:
*/ */
// Parameters for all extruder heaters #define THERMAL_PROTECTION_HOTENDS // Enable thermal protection for all extruders
#define THERMAL_RUNAWAY_PROTECTION_PERIOD 40 // in seconds #define THERMAL_PROTECTION_BED // Enable thermal protection for the heated bed
#define THERMAL_RUNAWAY_PROTECTION_HYSTERESIS 4 // in degree Celsius
// To enable for the bed heater, uncomment the two defines below:
// Parameters for the bed heater
#define THERMAL_RUNAWAY_PROTECTION_BED_PERIOD 20 // in seconds
#define THERMAL_RUNAWAY_PROTECTION_BED_HYSTERESIS 2 // in degree Celsius
//=========================================================================== //===========================================================================
//============================= Mechanical Settings ========================= //============================= Mechanical Settings =========================

@ -15,16 +15,37 @@
#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 * Thermal Protection parameters
*
* Whenever an M104 or M109 increases the target temperature this will wait for WATCH_TEMP_PERIOD milliseconds,
* and if the temperature hasn't increased by WATCH_TEMP_INCREASE degrees, the machine is halted, requiring a
* hard reset. This test restarts with any M104/M109, but only if the current temperature is below the target
* by at least 2 * WATCH_TEMP_INCREASE degrees celsius.
*/ */
#define WATCH_TEMP_PERIOD 16000 // 16 seconds #ifdef THERMAL_PROTECTION_HOTENDS
#define WATCH_TEMP_INCREASE 4 // Heat up at least 4 degrees in 16 seconds #define THERMAL_PROTECTION_PERIOD 40 // Seconds
#define THERMAL_PROTECTION_HYSTERESIS 4 // Degrees Celsius
/**
* Whenever an M104 or M109 increases the target temperature the firmware will wait for the
* WATCH_TEMP_PERIOD to transpire, and if the temperature hasn't increased by WATCH_TEMP_INCREASE
* degrees, the machine is halted, requiring a hard reset. This test restarts with any M104/M109,
* but only if the current temperature is below the target by at least 2 * WATCH_TEMP_INCREASE degrees.
*/
#define WATCH_TEMP_PERIOD 16 // Seconds
#define WATCH_TEMP_INCREASE 4 // Degrees Celsius
#endif
#ifdef THERMAL_PROTECTION_BED
#define THERMAL_PROTECTION_BED_PERIOD 20 // Seconds
#define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius
#endif
/**
* Automatic Temperature:
* The hotend target temperature is calculated by all the buffered lines of gcode.
* The maximum buffered steps/sec of the extruder motor is called "se".
* Start autotemp mode with M109 S<mintemp> B<maxtemp> F<factor>
* The target temperature is set to mintemp+factor*se[steps/sec] and is limited by
* mintemp and maxtemp. Turn this off by excuting M109 without F*
* Also, if the temperature is set to a value below mintemp, it will not be changed by autotemp.
* On an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode
*/
#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.
// if Kc is chosen well, the additional required power due to increased melting should be compensated. // if Kc is chosen well, the additional required power due to increased melting should be compensated.

@ -270,23 +270,10 @@ Here are some standard links for getting your machine calibrated:
* The solution: Once the temperature reaches the target, start observing. * The solution: Once the temperature reaches the target, start observing.
* If the temperature stays too far below the target (hysteresis) for too long, * If the temperature stays too far below the target (hysteresis) for too long,
* the firmware will halt as a safety precaution. * the firmware will halt as a safety precaution.
*
* Note that because the countdown starts only AFTER the temperature reaches
* the target, this will not catch a thermistor that is already disconnected
* when the print starts!
*
* To enable for all extruder heaters, uncomment the two defines below:
*/ */
// Parameters for all extruder heaters #define THERMAL_PROTECTION_HOTENDS // Enable thermal protection for all extruders
#define THERMAL_RUNAWAY_PROTECTION_PERIOD 40 // in seconds #define THERMAL_PROTECTION_BED // Enable thermal protection for the heated bed
#define THERMAL_RUNAWAY_PROTECTION_HYSTERESIS 4 // in degree Celsius
// To enable for the bed heater, uncomment the two defines below:
// Parameters for the bed heater
#define THERMAL_RUNAWAY_PROTECTION_BED_PERIOD 20 // in seconds
#define THERMAL_RUNAWAY_PROTECTION_BED_HYSTERESIS 2 // in degree Celsius
//=========================================================================== //===========================================================================
//============================= Mechanical Settings ========================= //============================= Mechanical Settings =========================

@ -15,16 +15,37 @@
#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 * Thermal Protection parameters
*
* Whenever an M104 or M109 increases the target temperature this will wait for WATCH_TEMP_PERIOD milliseconds,
* and if the temperature hasn't increased by WATCH_TEMP_INCREASE degrees, the machine is halted, requiring a
* hard reset. This test restarts with any M104/M109, but only if the current temperature is below the target
* by at least 2 * WATCH_TEMP_INCREASE degrees celsius.
*/ */
#define WATCH_TEMP_PERIOD 16000 // 16 seconds #ifdef THERMAL_PROTECTION_HOTENDS
#define WATCH_TEMP_INCREASE 4 // Heat up at least 4 degrees in 16 seconds #define THERMAL_PROTECTION_PERIOD 40 // Seconds
#define THERMAL_PROTECTION_HYSTERESIS 4 // Degrees Celsius
/**
* Whenever an M104 or M109 increases the target temperature the firmware will wait for the
* WATCH_TEMP_PERIOD to transpire, and if the temperature hasn't increased by WATCH_TEMP_INCREASE
* degrees, the machine is halted, requiring a hard reset. This test restarts with any M104/M109,
* but only if the current temperature is below the target by at least 2 * WATCH_TEMP_INCREASE degrees.
*/
#define WATCH_TEMP_PERIOD 16 // Seconds
#define WATCH_TEMP_INCREASE 4 // Degrees Celsius
#endif
#ifdef THERMAL_PROTECTION_BED
#define THERMAL_PROTECTION_BED_PERIOD 20 // Seconds
#define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius
#endif
/**
* Automatic Temperature:
* The hotend target temperature is calculated by all the buffered lines of gcode.
* The maximum buffered steps/sec of the extruder motor is called "se".
* Start autotemp mode with M109 S<mintemp> B<maxtemp> F<factor>
* The target temperature is set to mintemp+factor*se[steps/sec] and is limited by
* mintemp and maxtemp. Turn this off by excuting M109 without F*
* Also, if the temperature is set to a value below mintemp, it will not be changed by autotemp.
* On an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode
*/
#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.
// if Kc is chosen well, the additional required power due to increased melting should be compensated. // if Kc is chosen well, the additional required power due to increased melting should be compensated.

@ -300,23 +300,10 @@ Here are some standard links for getting your machine calibrated:
* The solution: Once the temperature reaches the target, start observing. * The solution: Once the temperature reaches the target, start observing.
* If the temperature stays too far below the target (hysteresis) for too long, * If the temperature stays too far below the target (hysteresis) for too long,
* the firmware will halt as a safety precaution. * the firmware will halt as a safety precaution.
*
* Note that because the countdown starts only AFTER the temperature reaches
* the target, this will not catch a thermistor that is already disconnected
* when the print starts!
*
* To enable for all extruder heaters, uncomment the two defines below:
*/ */
// Parameters for all extruder heaters #define THERMAL_PROTECTION_HOTENDS // Enable thermal protection for all extruders
#define THERMAL_RUNAWAY_PROTECTION_PERIOD 40 // in seconds #define THERMAL_PROTECTION_BED // Enable thermal protection for the heated bed
#define THERMAL_RUNAWAY_PROTECTION_HYSTERESIS 4 // in degree Celsius
// To enable for the bed heater, uncomment the two defines below:
// Parameters for the bed heater
#define THERMAL_RUNAWAY_PROTECTION_BED_PERIOD 120 // in seconds
#define THERMAL_RUNAWAY_PROTECTION_BED_HYSTERESIS 4 // in degree Celsius
//=========================================================================== //===========================================================================
//============================= Mechanical Settings ========================= //============================= Mechanical Settings =========================

@ -15,16 +15,37 @@
#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 * Thermal Protection parameters
*
* Whenever an M104 or M109 increases the target temperature this will wait for WATCH_TEMP_PERIOD milliseconds,
* and if the temperature hasn't increased by WATCH_TEMP_INCREASE degrees, the machine is halted, requiring a
* hard reset. This test restarts with any M104/M109, but only if the current temperature is below the target
* by at least 2 * WATCH_TEMP_INCREASE degrees celsius.
*/ */
#define WATCH_TEMP_PERIOD 16000 // 16 seconds #ifdef THERMAL_PROTECTION_HOTENDS
#define WATCH_TEMP_INCREASE 4 // Heat up at least 4 degrees in 16 seconds #define THERMAL_PROTECTION_PERIOD 40 // Seconds
#define THERMAL_PROTECTION_HYSTERESIS 4 // Degrees Celsius
/**
* Whenever an M104 or M109 increases the target temperature the firmware will wait for the
* WATCH_TEMP_PERIOD to transpire, and if the temperature hasn't increased by WATCH_TEMP_INCREASE
* degrees, the machine is halted, requiring a hard reset. This test restarts with any M104/M109,
* but only if the current temperature is below the target by at least 2 * WATCH_TEMP_INCREASE degrees.
*/
#define WATCH_TEMP_PERIOD 16 // Seconds
#define WATCH_TEMP_INCREASE 4 // Degrees Celsius
#endif
#ifdef THERMAL_PROTECTION_BED
#define THERMAL_PROTECTION_BED_PERIOD 120 // Seconds
#define THERMAL_PROTECTION_BED_HYSTERESIS 4 // Degrees Celsius
#endif
/**
* Automatic Temperature:
* The hotend target temperature is calculated by all the buffered lines of gcode.
* The maximum buffered steps/sec of the extruder motor is called "se".
* Start autotemp mode with M109 S<mintemp> B<maxtemp> F<factor>
* The target temperature is set to mintemp+factor*se[steps/sec] and is limited by
* mintemp and maxtemp. Turn this off by excuting M109 without F*
* Also, if the temperature is set to a value below mintemp, it will not be changed by autotemp.
* On an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode
*/
#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.
// if Kc is chosen well, the additional required power due to increased melting should be compensated. // if Kc is chosen well, the additional required power due to increased melting should be compensated.

@ -300,23 +300,10 @@ Here are some standard links for getting your machine calibrated:
* The solution: Once the temperature reaches the target, start observing. * The solution: Once the temperature reaches the target, start observing.
* If the temperature stays too far below the target (hysteresis) for too long, * If the temperature stays too far below the target (hysteresis) for too long,
* the firmware will halt as a safety precaution. * the firmware will halt as a safety precaution.
*
* Note that because the countdown starts only AFTER the temperature reaches
* the target, this will not catch a thermistor that is already disconnected
* when the print starts!
*
* To enable for all extruder heaters, uncomment the two defines below:
*/ */
// Parameters for all extruder heaters #define THERMAL_PROTECTION_HOTENDS // Enable thermal protection for all extruders
#define THERMAL_RUNAWAY_PROTECTION_PERIOD 40 // in seconds #define THERMAL_PROTECTION_BED // Enable thermal protection for the heated bed
#define THERMAL_RUNAWAY_PROTECTION_HYSTERESIS 4 // in degree Celsius
// To enable for the bed heater, uncomment the two defines below:
// Parameters for the bed heater
#define THERMAL_RUNAWAY_PROTECTION_BED_PERIOD 20 // in seconds
#define THERMAL_RUNAWAY_PROTECTION_BED_HYSTERESIS 2 // in degree Celsius
//=========================================================================== //===========================================================================
//============================= Mechanical Settings ========================= //============================= Mechanical Settings =========================

@ -15,16 +15,37 @@
#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 * Thermal Protection parameters
*
* Whenever an M104 or M109 increases the target temperature this will wait for WATCH_TEMP_PERIOD milliseconds,
* and if the temperature hasn't increased by WATCH_TEMP_INCREASE degrees, the machine is halted, requiring a
* hard reset. This test restarts with any M104/M109, but only if the current temperature is below the target
* by at least 2 * WATCH_TEMP_INCREASE degrees celsius.
*/ */
#define WATCH_TEMP_PERIOD 16000 // 16 seconds #ifdef THERMAL_PROTECTION_HOTENDS
#define WATCH_TEMP_INCREASE 4 // Heat up at least 4 degrees in 16 seconds #define THERMAL_PROTECTION_PERIOD 40 // Seconds
#define THERMAL_PROTECTION_HYSTERESIS 4 // Degrees Celsius
/**
* Whenever an M104 or M109 increases the target temperature the firmware will wait for the
* WATCH_TEMP_PERIOD to transpire, and if the temperature hasn't increased by WATCH_TEMP_INCREASE
* degrees, the machine is halted, requiring a hard reset. This test restarts with any M104/M109,
* but only if the current temperature is below the target by at least 2 * WATCH_TEMP_INCREASE degrees.
*/
#define WATCH_TEMP_PERIOD 16 // Seconds
#define WATCH_TEMP_INCREASE 4 // Degrees Celsius
#endif
#ifdef THERMAL_PROTECTION_BED
#define THERMAL_PROTECTION_BED_PERIOD 20 // Seconds
#define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius
#endif
/**
* Automatic Temperature:
* The hotend target temperature is calculated by all the buffered lines of gcode.
* The maximum buffered steps/sec of the extruder motor is called "se".
* Start autotemp mode with M109 S<mintemp> B<maxtemp> F<factor>
* The target temperature is set to mintemp+factor*se[steps/sec] and is limited by
* mintemp and maxtemp. Turn this off by excuting M109 without F*
* Also, if the temperature is set to a value below mintemp, it will not be changed by autotemp.
* On an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode
*/
#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.
// if Kc is chosen well, the additional required power due to increased melting should be compensated. // if Kc is chosen well, the additional required power due to increased melting should be compensated.

@ -300,23 +300,10 @@ Here are some standard links for getting your machine calibrated:
* The solution: Once the temperature reaches the target, start observing. * The solution: Once the temperature reaches the target, start observing.
* If the temperature stays too far below the target (hysteresis) for too long, * If the temperature stays too far below the target (hysteresis) for too long,
* the firmware will halt as a safety precaution. * the firmware will halt as a safety precaution.
*
* Note that because the countdown starts only AFTER the temperature reaches
* the target, this will not catch a thermistor that is already disconnected
* when the print starts!
*
* To enable for all extruder heaters, uncomment the two defines below:
*/ */
// Parameters for all extruder heaters #define THERMAL_PROTECTION_HOTENDS // Enable thermal protection for all extruders
#define THERMAL_RUNAWAY_PROTECTION_PERIOD 40 // in seconds #define THERMAL_PROTECTION_BED // Enable thermal protection for the heated bed
#define THERMAL_RUNAWAY_PROTECTION_HYSTERESIS 4 // in degree Celsius
// To enable for the bed heater, uncomment the two defines below:
// Parameters for the bed heater
#define THERMAL_RUNAWAY_PROTECTION_BED_PERIOD 20 // in seconds
#define THERMAL_RUNAWAY_PROTECTION_BED_HYSTERESIS 2 // in degree Celsius
//=========================================================================== //===========================================================================
//============================= Mechanical Settings ========================= //============================= Mechanical Settings =========================

@ -15,16 +15,37 @@
#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 * Thermal Protection parameters
*
* Whenever an M104 or M109 increases the target temperature this will wait for WATCH_TEMP_PERIOD milliseconds,
* and if the temperature hasn't increased by WATCH_TEMP_INCREASE degrees, the machine is halted, requiring a
* hard reset. This test restarts with any M104/M109, but only if the current temperature is below the target
* by at least 2 * WATCH_TEMP_INCREASE degrees celsius.
*/ */
#define WATCH_TEMP_PERIOD 16000 // 16 seconds #ifdef THERMAL_PROTECTION_HOTENDS
#define WATCH_TEMP_INCREASE 4 // Heat up at least 4 degrees in 16 seconds #define THERMAL_PROTECTION_PERIOD 40 // Seconds
#define THERMAL_PROTECTION_HYSTERESIS 4 // Degrees Celsius
/**
* Whenever an M104 or M109 increases the target temperature the firmware will wait for the
* WATCH_TEMP_PERIOD to transpire, and if the temperature hasn't increased by WATCH_TEMP_INCREASE
* degrees, the machine is halted, requiring a hard reset. This test restarts with any M104/M109,
* but only if the current temperature is below the target by at least 2 * WATCH_TEMP_INCREASE degrees.
*/
#define WATCH_TEMP_PERIOD 16 // Seconds
#define WATCH_TEMP_INCREASE 4 // Degrees Celsius
#endif
#ifdef THERMAL_PROTECTION_BED
#define THERMAL_PROTECTION_BED_PERIOD 20 // Seconds
#define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius
#endif
/**
* Automatic Temperature:
* The hotend target temperature is calculated by all the buffered lines of gcode.
* The maximum buffered steps/sec of the extruder motor is called "se".
* Start autotemp mode with M109 S<mintemp> B<maxtemp> F<factor>
* The target temperature is set to mintemp+factor*se[steps/sec] and is limited by
* mintemp and maxtemp. Turn this off by excuting M109 without F*
* Also, if the temperature is set to a value below mintemp, it will not be changed by autotemp.
* On an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode
*/
#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.
// if Kc is chosen well, the additional required power due to increased melting should be compensated. // if Kc is chosen well, the additional required power due to increased melting should be compensated.

@ -270,23 +270,10 @@ Here are some standard links for getting your machine calibrated:
* The solution: Once the temperature reaches the target, start observing. * The solution: Once the temperature reaches the target, start observing.
* If the temperature stays too far below the target (hysteresis) for too long, * If the temperature stays too far below the target (hysteresis) for too long,
* the firmware will halt as a safety precaution. * the firmware will halt as a safety precaution.
*
* Note that because the countdown starts only AFTER the temperature reaches
* the target, this will not catch a thermistor that is already disconnected
* when the print starts!
*
* To enable for all extruder heaters, uncomment the two defines below:
*/ */
// Parameters for all extruder heaters #define THERMAL_PROTECTION_HOTENDS // Enable thermal protection for all extruders
#define THERMAL_RUNAWAY_PROTECTION_PERIOD 40 // in seconds #define THERMAL_PROTECTION_BED // Enable thermal protection for the heated bed
#define THERMAL_RUNAWAY_PROTECTION_HYSTERESIS 4 // in degree Celsius
// To enable for the bed heater, uncomment the two defines below:
// Parameters for the bed heater
#define THERMAL_RUNAWAY_PROTECTION_BED_PERIOD 20 // in seconds
#define THERMAL_RUNAWAY_PROTECTION_BED_HYSTERESIS 2 // in degree Celsius
//=========================================================================== //===========================================================================
//============================= Mechanical Settings ========================= //============================= Mechanical Settings =========================

@ -15,16 +15,37 @@
#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 * Thermal Protection parameters
*
* Whenever an M104 or M109 increases the target temperature this will wait for WATCH_TEMP_PERIOD milliseconds,
* and if the temperature hasn't increased by WATCH_TEMP_INCREASE degrees, the machine is halted, requiring a
* hard reset. This test restarts with any M104/M109, but only if the current temperature is below the target
* by at least 2 * WATCH_TEMP_INCREASE degrees celsius.
*/ */
#define WATCH_TEMP_PERIOD 16000 // 16 seconds #ifdef THERMAL_PROTECTION_HOTENDS
#define WATCH_TEMP_INCREASE 4 // Heat up at least 4 degrees in 16 seconds #define THERMAL_PROTECTION_PERIOD 40 // Seconds
#define THERMAL_PROTECTION_HYSTERESIS 4 // Degrees Celsius
/**
* Whenever an M104 or M109 increases the target temperature the firmware will wait for the
* WATCH_TEMP_PERIOD to transpire, and if the temperature hasn't increased by WATCH_TEMP_INCREASE
* degrees, the machine is halted, requiring a hard reset. This test restarts with any M104/M109,
* but only if the current temperature is below the target by at least 2 * WATCH_TEMP_INCREASE degrees.
*/
#define WATCH_TEMP_PERIOD 16 // Seconds
#define WATCH_TEMP_INCREASE 4 // Degrees Celsius
#endif
#ifdef THERMAL_PROTECTION_BED
#define THERMAL_PROTECTION_BED_PERIOD 20 // Seconds
#define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius
#endif
/**
* Automatic Temperature:
* The hotend target temperature is calculated by all the buffered lines of gcode.
* The maximum buffered steps/sec of the extruder motor is called "se".
* Start autotemp mode with M109 S<mintemp> B<maxtemp> F<factor>
* The target temperature is set to mintemp+factor*se[steps/sec] and is limited by
* mintemp and maxtemp. Turn this off by excuting M109 without F*
* Also, if the temperature is set to a value below mintemp, it will not be changed by autotemp.
* On an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode
*/
#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.
// if Kc is chosen well, the additional required power due to increased melting should be compensated. // if Kc is chosen well, the additional required power due to increased melting should be compensated.

@ -272,23 +272,10 @@ Here are some standard links for getting your machine calibrated:
* The solution: Once the temperature reaches the target, start observing. * The solution: Once the temperature reaches the target, start observing.
* If the temperature stays too far below the target (hysteresis) for too long, * If the temperature stays too far below the target (hysteresis) for too long,
* the firmware will halt as a safety precaution. * the firmware will halt as a safety precaution.
*
* Note that because the countdown starts only AFTER the temperature reaches
* the target, this will not catch a thermistor that is already disconnected
* when the print starts!
*
* To enable for all extruder heaters, uncomment the two defines below:
*/ */
// Parameters for all extruder heaters #define THERMAL_PROTECTION_HOTENDS // Enable thermal protection for all extruders
#define THERMAL_RUNAWAY_PROTECTION_PERIOD 40 // in seconds #define THERMAL_PROTECTION_BED // Enable thermal protection for the heated bed
#define THERMAL_RUNAWAY_PROTECTION_HYSTERESIS 4 // in degree Celsius
// To enable for the bed heater, uncomment the two defines below:
// Parameters for the bed heater
#define THERMAL_RUNAWAY_PROTECTION_BED_PERIOD 20 // in seconds
#define THERMAL_RUNAWAY_PROTECTION_BED_HYSTERESIS 2 // in degree Celsius
//=========================================================================== //===========================================================================
//============================= Mechanical Settings ========================= //============================= Mechanical Settings =========================

@ -15,16 +15,37 @@
#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 * Thermal Protection parameters
*
* Whenever an M104 or M109 increases the target temperature this will wait for WATCH_TEMP_PERIOD milliseconds,
* and if the temperature hasn't increased by WATCH_TEMP_INCREASE degrees, the machine is halted, requiring a
* hard reset. This test restarts with any M104/M109, but only if the current temperature is below the target
* by at least 2 * WATCH_TEMP_INCREASE degrees celsius.
*/ */
#define WATCH_TEMP_PERIOD 16000 // 16 seconds #ifdef THERMAL_PROTECTION_HOTENDS
#define WATCH_TEMP_INCREASE 4 // Heat up at least 4 degrees in 16 seconds #define THERMAL_PROTECTION_PERIOD 40 // Seconds
#define THERMAL_PROTECTION_HYSTERESIS 4 // Degrees Celsius
/**
* Whenever an M104 or M109 increases the target temperature the firmware will wait for the
* WATCH_TEMP_PERIOD to transpire, and if the temperature hasn't increased by WATCH_TEMP_INCREASE
* degrees, the machine is halted, requiring a hard reset. This test restarts with any M104/M109,
* but only if the current temperature is below the target by at least 2 * WATCH_TEMP_INCREASE degrees.
*/
#define WATCH_TEMP_PERIOD 16 // Seconds
#define WATCH_TEMP_INCREASE 4 // Degrees Celsius
#endif
#ifdef THERMAL_PROTECTION_BED
#define THERMAL_PROTECTION_BED_PERIOD 20 // Seconds
#define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius
#endif
/**
* Automatic Temperature:
* The hotend target temperature is calculated by all the buffered lines of gcode.
* The maximum buffered steps/sec of the extruder motor is called "se".
* Start autotemp mode with M109 S<mintemp> B<maxtemp> F<factor>
* The target temperature is set to mintemp+factor*se[steps/sec] and is limited by
* mintemp and maxtemp. Turn this off by excuting M109 without F*
* Also, if the temperature is set to a value below mintemp, it will not be changed by autotemp.
* On an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode
*/
#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.
// if Kc is chosen well, the additional required power due to increased melting should be compensated. // if Kc is chosen well, the additional required power due to increased melting should be compensated.

@ -73,16 +73,14 @@ unsigned char soft_pwm_bed;
int current_raw_filwidth = 0; //Holds measured filament diameter - one extruder only int current_raw_filwidth = 0; //Holds measured filament diameter - one extruder only
#endif #endif
#define HAS_HEATER_THERMAL_PROTECTION (defined(THERMAL_RUNAWAY_PROTECTION_PERIOD) && THERMAL_RUNAWAY_PROTECTION_PERIOD > 0) #if THERMAL_PROTECTION_HOTENDS || THERMAL_PROTECTION_BED
#define HAS_BED_THERMAL_PROTECTION (defined(THERMAL_RUNAWAY_PROTECTION_BED_PERIOD) && THERMAL_RUNAWAY_PROTECTION_BED_PERIOD > 0 && TEMP_SENSOR_BED != 0)
#if HAS_HEATER_THERMAL_PROTECTION || HAS_BED_THERMAL_PROTECTION
enum TRState { TRReset, TRInactive, TRFirstHeating, TRStable, TRRunaway }; enum TRState { TRReset, TRInactive, TRFirstHeating, TRStable, TRRunaway };
void thermal_runaway_protection(TRState *state, millis_t *timer, float temperature, float target_temperature, int heater_id, int period_seconds, int hysteresis_degc); void thermal_runaway_protection(TRState *state, millis_t *timer, float temperature, float target_temperature, int heater_id, int period_seconds, int hysteresis_degc);
#if HAS_HEATER_THERMAL_PROTECTION #if THERMAL_PROTECTION_HOTENDS
static TRState thermal_runaway_state_machine[4] = { TRReset, TRReset, TRReset, TRReset }; static TRState thermal_runaway_state_machine[4] = { TRReset, TRReset, TRReset, TRReset };
static millis_t thermal_runaway_timer[4]; // = {0,0,0,0}; static millis_t thermal_runaway_timer[4]; // = {0,0,0,0};
#endif #endif
#if HAS_BED_THERMAL_PROTECTION #if THERMAL_PROTECTION_BED
static TRState thermal_runaway_bed_state_machine = TRReset; static TRState thermal_runaway_bed_state_machine = TRReset;
static millis_t thermal_runaway_bed_timer; static millis_t thermal_runaway_bed_timer;
#endif #endif
@ -170,7 +168,7 @@ static float analog2temp(int raw, uint8_t e);
static float analog2tempBed(int raw); static float analog2tempBed(int raw);
static void updateTemperaturesFromRawValues(); static void updateTemperaturesFromRawValues();
#ifdef WATCH_TEMP_PERIOD #ifdef THERMAL_PROTECTION_HOTENDS
int watch_target_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
@ -604,15 +602,15 @@ void manage_heater() {
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 #endif
#if defined(WATCH_TEMP_PERIOD) || !defined(PIDTEMPBED) || HAS_AUTO_FAN #if defined(THERMAL_PROTECTION_HOTENDS) || !defined(PIDTEMPBED) || HAS_AUTO_FAN
millis_t ms = millis(); millis_t ms = millis();
#endif #endif
// Loop through all extruders // Loop through all extruders
for (int e = 0; e < EXTRUDERS; e++) { for (int e = 0; e < EXTRUDERS; e++) {
#if HAS_HEATER_THERMAL_PROTECTION #if THERMAL_PROTECTION_HOTENDS
thermal_runaway_protection(&thermal_runaway_state_machine[e], &thermal_runaway_timer[e], current_temperature[e], target_temperature[e], e, THERMAL_RUNAWAY_PROTECTION_PERIOD, THERMAL_RUNAWAY_PROTECTION_HYSTERESIS); thermal_runaway_protection(&thermal_runaway_state_machine[e], &thermal_runaway_timer[e], current_temperature[e], target_temperature[e], e, THERMAL_PROTECTION_PERIOD, THERMAL_PROTECTION_HYSTERESIS);
#endif #endif
float pid_output = get_pid_output(e); float pid_output = get_pid_output(e);
@ -621,7 +619,7 @@ void manage_heater() {
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 // Check if the temperature is failing to increase
#ifdef WATCH_TEMP_PERIOD #ifdef THERMAL_PROTECTION_HOTENDS
// 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?
@ -635,7 +633,7 @@ void manage_heater() {
watch_heater_next_ms[e] = 0; watch_heater_next_ms[e] = 0;
} }
} }
#endif // WATCH_TEMP_PERIOD #endif // THERMAL_PROTECTION_HOTENDS
#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) {
@ -675,8 +673,8 @@ void manage_heater() {
#if TEMP_SENSOR_BED != 0 #if TEMP_SENSOR_BED != 0
#if HAS_BED_THERMAL_PROTECTION #if THERMAL_PROTECTION_BED
thermal_runaway_protection(&thermal_runaway_bed_state_machine, &thermal_runaway_bed_timer, current_temperature_bed, target_temperature_bed, -1, THERMAL_RUNAWAY_PROTECTION_BED_PERIOD, THERMAL_RUNAWAY_PROTECTION_BED_HYSTERESIS); thermal_runaway_protection(&thermal_runaway_bed_state_machine, &thermal_runaway_bed_timer, current_temperature_bed, target_temperature_bed, -1, THERMAL_PROTECTION_BED_PERIOD, THERMAL_PROTECTION_BED_HYSTERESIS);
#endif #endif
#ifdef PIDTEMPBED #ifdef PIDTEMPBED
@ -999,14 +997,14 @@ void tp_init() {
#endif //BED_MAXTEMP #endif //BED_MAXTEMP
} }
#ifdef WATCH_TEMP_PERIOD #ifdef THERMAL_PROTECTION_HOTENDS
/** /**
* Start Heating Sanity Check for hotends that are below * Start Heating Sanity Check for hotends that are below
* their target temperature by a configurable margin. * their target temperature by a configurable margin.
* This is called when the temperature is set. (M104, M109) * This is called when the temperature is set. (M104, M109)
*/ */
void start_watching_heater(int e) { void start_watching_heater(int e) {
millis_t ms = millis() + WATCH_TEMP_PERIOD; millis_t ms = millis() + WATCH_TEMP_PERIOD * 1000;
if (degHotend(e) < degTargetHotend(e) - (WATCH_TEMP_INCREASE * 2)) { if (degHotend(e) < degTargetHotend(e) - (WATCH_TEMP_INCREASE * 2)) {
watch_target_temp[e] = degHotend(e) + WATCH_TEMP_INCREASE; watch_target_temp[e] = degHotend(e) + WATCH_TEMP_INCREASE;
watch_heater_next_ms[e] = ms; watch_heater_next_ms[e] = ms;
@ -1016,7 +1014,7 @@ void tp_init() {
} }
#endif #endif
#if HAS_HEATER_THERMAL_PROTECTION || HAS_BED_THERMAL_PROTECTION #if THERMAL_PROTECTION_HOTENDS || THERMAL_PROTECTION_BED
void thermal_runaway_protection(TRState *state, millis_t *timer, float temperature, float target_temperature, int heater_id, int period_seconds, int hysteresis_degc) { void thermal_runaway_protection(TRState *state, millis_t *timer, float temperature, float target_temperature, int heater_id, int period_seconds, int hysteresis_degc) {
@ -1082,7 +1080,7 @@ void tp_init() {
} }
} }
#endif // HAS_HEATER_THERMAL_PROTECTION || HAS_BED_THERMAL_PROTECTION #endif // THERMAL_PROTECTION_HOTENDS || THERMAL_PROTECTION_BED
void disable_all_heaters() { void disable_all_heaters() {
for (int i=0; i<EXTRUDERS; i++) setTargetHotend(0, i); for (int i=0; i<EXTRUDERS; i++) setTargetHotend(0, i);

@ -137,7 +137,7 @@ 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 #ifdef THERMAL_PROTECTION_HOTENDS
void start_watching_heater(int e=0); void start_watching_heater(int e=0);
#endif #endif

Loading…
Cancel
Save