Notifications
Clear all

Fix for THERMAL RUNAWAY problem  

  RSS
egil.k
(@egil-k)
New Member
Fix for THERMAL RUNAWAY problem

While I assume this is a problem that affects the MK2 much more than any model, I believe it might affect any model for elevated printing temperatures. I am of course talking about the THERMAL RUNAWAY check, which might kick in to destroy a print after a few hours if you happened to have set the cooling fan speed a bit higher than the extruder can sustain. This software fix simple throttles the cooling fan whenever it detects that the extruder cannot keep the set temperature, thus preventing the print from being destroyed.

If there for instance is a break in the connector for the temperature sensor, the THERMAL RUNAWAY check will of course still function exactly as intended.

I was not allowed to add the patch as an attachment, so it is added below this text instead. I do have a precompiled hex file if anyone are interested. I did have to reduce the number of supported languages to make it work.

Cheers, Egil

diff --git a/Firmware/Configuration.h b/Firmware/Configuration.h
index 9c920ceb..5097897f 100644
--- a/Firmware/Configuration.h
+++ b/Firmware/Configuration.h
@@ -5,7 +5,7 @@
#include "Configuration_prusa.h"

// Firmware version
-#define FW_version "3.2.3"
+#define FW_version "3.2.3-X2"

#define FW_PRUSA3D_MAGIC "PRUSA3DFW"
#define FW_PRUSA3D_MAGIC_LEN 10
diff --git a/Firmware/Marlin.h b/Firmware/Marlin.h
index 1aa23704..a3a12b4f 100644
--- a/Firmware/Marlin.h
+++ b/Firmware/Marlin.h
@@ -260,6 +260,9 @@ extern float max_pos[3];
extern bool axis_known_position[3];
extern float zprobe_zoffset;
extern int fanSpeed;
+#ifdef TEMP_RUNAWAY_SAFETY_NET
+extern unsigned char fanSpeedReduce; // reduction of fan speed due to "safety net"
+#endif
extern void homeaxis(int axis);


diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp
index 5dec1a7e..2e5d3d57 100644
--- a/Firmware/Marlin_main.cpp
+++ b/Firmware/Marlin_main.cpp
@@ -320,6 +320,9 @@ float extruder_offset[NUM_EXTRUDER_OFFSETS][EXTRUDERS] = {

uint8_t active_extruder = 0;
int fanSpeed=0;
+#ifdef TEMP_RUNAWAY_SAFETY_NET
+unsigned char fanSpeedReduce=0; // reduction of fan speed due to "safety net"
+#endif

#ifdef FWRETRACT
bool autoretract_enabled=false;
diff --git a/Firmware/planner.cpp b/Firmware/planner.cpp
index 7dd79903..bd54bcfa 100644
--- a/Firmware/planner.cpp
+++ b/Firmware/planner.cpp
@@ -505,6 +505,10 @@ void check_axes_activity()
disable_e1();
disable_e2();
}
+#ifdef TEMP_RUNAWAY_SAFETY_NET
+ if (tail_fan_speed >= fanSpeedReduce) tail_fan_speed -= fanSpeedReduce;
+ else tail_fan_speed = 0;
+#endif
#if defined(FAN_PIN) && FAN_PIN > -1
#ifdef FAN_KICK_START_TIME
static bool fan_kick = false;
diff --git a/Firmware/temperature.cpp b/Firmware/temperature.cpp
index 63b50208..0a2733fa 100644
--- a/Firmware/temperature.cpp
+++ b/Firmware/temperature.cpp
@@ -1136,6 +1136,9 @@ void temp_runaway_check(int _heater_id, float _target_temperature, float _curren
{
__hysteresis = TEMP_RUNAWAY_EXTRUDER_HYSTERESIS;
__timeout = TEMP_RUNAWAY_EXTRUDER_TIMEOUT;
+#ifdef TEMP_RUNAWAY_SAFETY_NET
+ fanSpeedReduce = 0; // default assumption is no reduction in fan speed
+#endif
}
#endif

@@ -1215,6 +1218,30 @@ void temp_runaway_check(int _heater_id, float _target_temperature, float _curren

if (temp_runaway_check_active)
{
+#if defined(TEMP_RUNAWAY_SAFETY_NET) && TEMP_RUNAWAY_SAFETY_NET < TEMP_RUNAWAY_EXTRUDER_HYSTERESIS
+ if (!_isbed)
+ {
+ if (fanSpeed > 0 && _current_tempe THERMAL RUNAWAY checkrature < (_target_temperature - TEMP_RUNAWAY_SAFETY_NET))
+ {
+ // into safety net and beyond.
+ // implement trivial P regulator of fan speed against temperature
+ // over 60% of temperature span where runaway shutdown kicks in.
+ // this will reduce actual filament temperature when this mechanism is triggered
+ // which may happen to be not a bad thing for instance when bridging.
+ int reduce = (255.0 * (_target_temperature - TEMP_RUNAWAY_SAFETY_NET - _current_temperature)) /
+ (0.6 * (TEMP_RUNAWAY_EXTRUDER_HYSTERESIS - TEMP_RUNAWAY_SAFETY_NET));
+ fanSpeedReduce = (reduce < 255) ? reduce : 255;
+#if 0 // DEBUG
+ static unsigned char did_warn; // reset when?
+ if (!did_warn)
+ {
+ LCD_ALERTMESSAGEPGM("FAN THROTTLED");
+ did_warn = 1;
+ }
+#endif
+ }
+ }
+#endif
// we are in range
if ((_isbed && (_target_temperature > TEMP_MAX_CHECKED_BED) && (_current_temperature > TEMP_MAX_CHECKED_BED)) || ((_current_temperature > (_target_temperature - __hysteresis)) && (_current_temperature < (_target_temperature + __hysteresis))))
{
@@ -1324,6 +1351,10 @@ void disable_heater()
WRITE(HEATER_BED_PIN,LOW);
#endif
#endif
+
+ #ifdef TEMP_RUNAWAY_SAFETY_NET
+ fanSpeedReduce = 0;
+ #endif
}

void max_temp_error(uint8_t e) {
diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp
index 221a0bc6..771bb579 100644
--- a/Firmware/ultralcd.cpp
+++ b/Firmware/ultralcd.cpp
@@ -4942,6 +4942,9 @@ void lcd_print_stop() {
SET_OUTPUT(FAN_PIN);
WRITE(FAN_PIN, 0);
fanSpeed=0;
+#ifdef TEMP_RUNAWAY_SAFETY_NET
+ fanSpeedReduce = 0;
+#endif
}


diff --git a/Firmware/variants/1_75mm_MK1-RAMBo10a-E3Dv6full.h b/Firmware/variants/1_75mm_MK1-RAMBo10a-E3Dv6full.h
index 708a14c0..868df95a 100644
--- a/Firmware/variants/1_75mm_MK1-RAMBo10a-E3Dv6full.h
+++ b/Firmware/variants/1_75mm_MK1-RAMBo10a-E3Dv6full.h
@@ -184,6 +184,7 @@ ADDITIONAL FEATURES SETTINGS
#define TEMP_RUNAWAY_BED_HYSTERESIS 5
#define TEMP_RUNAWAY_BED_TIMEOUT 360

+#define TEMP_RUNAWAY_SAFETY_NET 3 // temperature difference where "fan reduce safety net" feature kicks in
#define TEMP_RUNAWAY_EXTRUDER_HYSTERESIS 15
#define TEMP_RUNAWAY_EXTRUDER_TIMEOUT 45

diff --git a/Firmware/variants/1_75mm_MK1-RAMBo13a-E3Dv6full.h b/Firmware/variants/1_75mm_MK1-RAMBo13a-E3Dv6full.h
index fbfc4290..8a1fdf01 100644
--- a/Firmware/variants/1_75mm_MK1-RAMBo13a-E3Dv6full.h
+++ b/Firmware/variants/1_75mm_MK1-RAMBo13a-E3Dv6full.h
@@ -184,6 +184,7 @@ ADDITIONAL FEATURES SETTINGS
#define TEMP_RUNAWAY_BED_HYSTERESIS 5
#define TEMP_RUNAWAY_BED_TIMEOUT 360

+#define TEMP_RUNAWAY_SAFETY_NET 3 // temperature difference where "fan reduce safety net" feature kicks in
#define TEMP_RUNAWAY_EXTRUDER_HYSTERESIS 15
#define TEMP_RUNAWAY_EXTRUDER_TIMEOUT 45

diff --git a/Firmware/variants/1_75mm_MK2-MultiMaterial-RAMBo10a-E3Dv6full.h b/Firmware/variants/1_75mm_MK2-MultiMaterial-RAMBo10a-E3Dv6full.h
index 9e4ff1a2..e0ee638c 100644
--- a/Firmware/variants/1_75mm_MK2-MultiMaterial-RAMBo10a-E3Dv6full.h
+++ b/Firmware/variants/1_75mm_MK2-MultiMaterial-RAMBo10a-E3Dv6full.h
@@ -181,6 +181,7 @@ ADDITIONAL FEATURES SETTINGS
#define TEMP_RUNAWAY_BED_HYSTERESIS 5
#define TEMP_RUNAWAY_BED_TIMEOUT 360

+#define TEMP_RUNAWAY_SAFETY_NET 3 // temperature difference where "fan reduce safety net" feature kicks in
#define TEMP_RUNAWAY_EXTRUDER_HYSTERESIS 15
#define TEMP_RUNAWAY_EXTRUDER_TIMEOUT 45

diff --git a/Firmware/variants/1_75mm_MK2-MultiMaterial-RAMBo13a-E3Dv6full.h b/Firmware/variants/1_75mm_MK2-MultiMaterial-RAMBo13a-E3Dv6full.h
index a3c39a18..ef556a3e 100644
--- a/Firmware/variants/1_75mm_MK2-MultiMaterial-RAMBo13a-E3Dv6full.h
+++ b/Firmware/variants/1_75mm_MK2-MultiMaterial-RAMBo13a-E3Dv6full.h
@@ -183,6 +183,7 @@ ADDITIONAL FEATURES SETTINGS
#define TEMP_RUNAWAY_BED_HYSTERESIS 5
#define TEMP_RUNAWAY_BED_TIMEOUT 360

+#define TEMP_RUNAWAY_SAFETY_NET 3 // temperature difference where "fan reduce safety net" feature kicks in
#define TEMP_RUNAWAY_EXTRUDER_HYSTERESIS 15
#define TEMP_RUNAWAY_EXTRUDER_TIMEOUT 45

diff --git a/Firmware/variants/1_75mm_MK2-RAMBo10a-E3Dv6full.h b/Firmware/variants/1_75mm_MK2-RAMBo10a-E3Dv6full.h
index 5833e3a8..6ca35ed4 100644
--- a/Firmware/variants/1_75mm_MK2-RAMBo10a-E3Dv6full.h
+++ b/Firmware/variants/1_75mm_MK2-RAMBo10a-E3Dv6full.h
@@ -181,6 +181,7 @@ ADDITIONAL FEATURES SETTINGS
#define TEMP_RUNAWAY_BED_HYSTERESIS 5
#define TEMP_RUNAWAY_BED_TIMEOUT 360

+#define TEMP_RUNAWAY_SAFETY_NET 3 // temperature difference where "fan reduce safety net" feature kicks in
#define TEMP_RUNAWAY_EXTRUDER_HYSTERESIS 15
#define TEMP_RUNAWAY_EXTRUDER_TIMEOUT 45

diff --git a/Firmware/variants/1_75mm_MK2-RAMBo13a-E3Dv6full.h b/Firmware/variants/1_75mm_MK2-RAMBo13a-E3Dv6full.h
index 4cfa5323..72de78f1 100644
--- a/Firmware/variants/1_75mm_MK2-RAMBo13a-E3Dv6full.h
+++ b/Firmware/variants/1_75mm_MK2-RAMBo13a-E3Dv6full.h
@@ -183,6 +183,7 @@ ADDITIONAL FEATURES SETTINGS
#define TEMP_RUNAWAY_BED_HYSTERESIS 5
#define TEMP_RUNAWAY_BED_TIMEOUT 360

+#define TEMP_RUNAWAY_SAFETY_NET 3 // temperature difference where "fan reduce safety net" feature kicks in
#define TEMP_RUNAWAY_EXTRUDER_HYSTERESIS 15
#define TEMP_RUNAWAY_EXTRUDER_TIMEOUT 45
...
Posted : 12/07/2019 11:52 am
vipu
 vipu
(@vipu)
Active Member
RE: Fix for THERMAL RUNAWAY problem

I upgraded the firmware and downloaded a new slicer and can not even print PLA. In 5 seconds the bed temperature starts to fall. Wiring procedure, connections fine. Everything worked fine before updating the software. The more I no longer update the software, the errors will be more than good things. Trying to reinstall the old firmware.

Posted : 14/07/2019 9:24 am
vipu
 vipu
(@vipu)
Active Member
RE: Fix for THERMAL RUNAWAY problem

I put the V3.1.0 version back on and the printer is working fine.

Posted : 14/07/2019 9:42 am
christian.a
(@christian-a)
New Member
RE: Fix for THERMAL RUNAWAY problem
I know I'm very late to this conversation but I was wondering do you still have that hex file to fix the issue that you are mentioning above I seem to be having the same issue with the 40 mm fan and am using high-end heaters from e3d but none of them will reach temp as described in the reasons for making this if you are unable to provide the hex file where do I need to modify the code in the firmware to reflect these updates so that I can get back to printing

Thank you and kind regards,
Christian
My email is [email protected]
...
Posted : 12/04/2020 4:40 pm
Tom Anderson
(@tom-anderson)
Active Member
RE: Fix for THERMAL RUNAWAY problem

@vipike-vip

IF YOU KEEP HAVING THERMAL RUNAWAY
THEN replace your fan shroud with this one,

https://www.prusaprinters.org/prints/56604-mk25-fan-shroud-fix

it reduces air flow from the fan across the heat block.

This should fix your mk2.5s upgraded printer and not require a silicone sock or fan speed adjustment in the slicer. I have put this on my mk2.5S upgraded mk2S. It has solved the Thermal Runaway! If the fan kicks in high it will cool the nozzle quickly but not directly affecting the heat block with a rush of air that the heater is unable to recover from.

Print in ABS.

This has break away area on bottom between nozzle ducts that needs does need to be snapped out.

I have tested extensively  no need to adjust fan speed, though you will find the fan much louder

Posted : 16/02/2021 4:53 am
Share: