thermal-runaway

Thermal Runaway Protection: An introduction to the thermal safety systems in the Marlin Firmware

What is it, what it does, how to use it, and finally what these setting cannot prevent, and some safety precautions.

Author: Dahai Zhu

Introduction

In Marlin firmware, there are a series of settings that enable the firmware to monitor the temperatures and thermal progress of the hot-end(s) and heated bed of a 3D Printer. Should a condition occur that is outside the ‘safe boundaries’ set in the firmware, it can shut down the heaters and all printing processes to help prevent damage to the 3D Printer, and avoid dangerous situations such as a potential fire.

I need to stress here, however, that these settings, and the Marlin firmware itself, cannot guarantee absolute Thermal Runaway Protection under all circumstances. These are not absolute fail-safes, nor are they idiot proof. The final sections in this document cover some basic safety precautions, as well as situations beyond the control of the firmware and the controller.


Enabling & Disabling Settings

Many features in Marlin can be enabled or disabled by modifying the configuration files in the source code. In most cases, features are disabled when they are 'commented out'. This is done by inserting two forward slashes at the start of the line to be disabled, like ‘//’. See the examples below:

Here's an example of an enabled feature:

#define THERMAL_PROTECTION_HOTENDS

Here's an example of a disabled feature:

//#define THERMAL_PROTECTION_HOTENDS

Thermal Runaway Safety Monitoring Settings in Marlin

Let’s now go through each of the thermal runaway settings in the Marlin firmware (as of release 1.1.9) and cover what they are each for.


Enabling Thermal Protection

File: configuration.h
Section: Thermal Runaway Protection
Settings:

#define THERMAL_PROTECTION_HOTENDS 
#define THERMAL_PROTECTION_BED

What it is:
These are the two most important settings for thermal protection in Marlin. If these are disabled (by commenting out - see above), then there is no Thermal Runaway Protection at all – regardless of any of the other items covered here.

What it does:
When enabled (no slashes before the ‘#define’ statements), these options enable Thermal Runaway Protection to help keep your printer, and you, safe.

How to use it:
Enable this setting as shown. This is the base for all Thermal Runaway Protection in Marlin and allows the firmware to monitor and control the heaters on your printer, to shut them off if a dangerous condition should occur.


Configuring Hotend Thermal Stability Protection

File: configuration_adv.h
Section: Thermal Settings
Settings:

#if ENABLED(THERMAL_PROTECTION_HOTENDS)
  #define THERMAL_PROTECTION_PERIOD 40        // Seconds
  #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius  

What it is:
This is part of the built-in Thermal Runaway Protection in Marlin and as you can see above, it is only enabled if THERMAL_PROTECTION_HOTENDS is enabled in the previous setting in configuration.h and these setting are enabled (have NO slashes (‘//’) in front of the lines).

What is does:
After the target temperature of the hot-end is reached, this will watch the temperature of the hot-end, and if it drops 4c (THERMAL_PROTECTION_HYSTERESIS) below the target temperature within the allotted time (THERMAL_PROTECTION_PERIOD), the heater will be shut off. In the situation where the thermistor has come off of the heater block, or failed for whatever reason, and so is no longer reporting the actual hot-end temperature, the firmware will see the temperature drop and turn on the heater to compensate. If, however, the temperatue continues to fall below the 4c limit after the set 40 second period, this will catch it and shut the hot-end heater off to help prevent it from overheating and possibly causing a fire.

How to use it:
Enable THERMAL_PROTECTION_HOTENDS in configuration.h and enable these above setting (no slashes (‘//’) in front of the lines) Normally, you should not change this setting unless you have a very slow hot-end heater (its under powered, or a very large heater block).


Configuring Hotend Heating Protection

File: configuration_adv.h
Section: Thermal Settings
Settings:

#if ENABLED(THERMAL_PROTECTION_HOTENDS)
  #define WATCH_TEMP_PERIOD 20                // Seconds
  #define WATCH_TEMP_INCREASE 2               // Degrees Celsius

What it is:
This is part of the built-in Thermal Runaway Protection in Marlin and as you can see above, it is only enabled if THERMAL_PROTECTION_HOTENDS is enabled in the previous setting in configuration.h and these setting are enabled (have NO slashes (‘//’) in front of the lines).

What it does:
These settings monitor the heating of the Hot Ends to ensure the temperature is increasing as expected. If the temperature does not increase by 2c (WATCH_TEMP_INCREASE) within a 20 second time period (WATCH_TEMP_PERIOD), the heater will be turned off. In the situation where the thermistor is detached from the hot-end, or is defective, it will not report a temperature rise with the heater on, and so after 20 seconds of not seeing a temperature change, the heater will be turned off.

How to use it:
Enable THERMAL_PROTECTION_HOTENDS in configuration.h and enable these above setting (no slashes (‘//’) in front of the lines). Normally, you should not change this setting unless you have a very slow hot-end heater (its under powered, or a very large heater block), and in those cases you should only increase the WATCH_TEMP_PERIOD

Warning: This setting only applies during the initial heating of the hot-end. It is not used once the target temperature is reached.


Configuring Bed Thermal Stability & Heating Protection

File: configuration_adv.h
Section: Thermal Settings
Settings:

#if ENABLED(THERMAL_PROTECTION_BED)
  #define THERMAL_PROTECTION_BED_PERIOD 20    // Seconds
  #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius
  #define WATCH_BED_TEMP_PERIOD 90                // Seconds
  #define WATCH_BED_TEMP_INCREASE 2               // Degrees Celsius

These are the corresponding Thermal Runaway Protection settings for the heated bed and perform the same function as the previous 2 sections for the hot-end.


Additional Settings

These are additional safety precaution items in Marlin that while not tied directly to Thermal Runaway Production, they still help keep the printer safe from over-driving the heaters and potentially causing a fire.


Configuring Thermistor Missing Protection

File: configuration.h
Section: Thermal Settings
Settings:

#define HEATER_0_MINTEMP 5
#define HEATER_1_MINTEMP 5
#define HEATER_2_MINTEMP 5
#define HEATER_3_MINTEMP 5
#define HEATER_4_MINTEMP 5
#define BED_MINTEMP 5

What it is:
This set the minimum temperature (in celsius) the thermistors are allowed to report in order to be considered ‘working properly’. A working temperature sensor should show your room’s temperature when first turned on, or after cooling down completely from a print. Unless you live in an igloo, its probably not going to be 5c or below in the room. What it does:
If these sensors are reporting temperatures below these set values, the heaters will not be allow to turn on as there is obviously something wrong with either the sensors, the wiring, or the controller board (such as a short) as doing so could be very dangerous.

How to use it:
Ensure these lines are enabled (no slashes in front of them). For almost all situations (that I can think of), you will want to leave this at the default of 5c. This will help keep your printer from enabled the heaters if there is a problem with the thermistors reporting too low of a temperature.


Configuring Over-temperature Protection

File: configuarion.h
Section: Thermal Settings
Settings:

#define HEATER_0_MAXTEMP 260
#define HEATER_1_MAXTEMP 275
#define HEATER_2_MAXTEMP 275
#define HEATER_3_MAXTEMP 275
#define HEATER_4_MAXTEMP 275
#define BED_MAXTEMP 115

What it is:
These are the maximum temperatures the hot-end(s) and heated bed are allow to reach.

What it does:
Heaters 0 – 4 are the hot-end heaters, and these default values are considered safe for most hot-ends. As most hot-ends contain PTFE (Telfon) in their throats (the hollow threaded rod between the heater block and the cold-end), the PTFE extends down into the heater block itself. As a result it is exposed to the same temperatures as the filament being melted. Since PTFE begins breaking down above 250c and can start out-gassing above 260c, the Max Temperature is defaulted to 260c. PTFE produces toxic fumes that can cause illness and kill birds.

How to use it:
Unless you are certain your printer has an ‘all metal hot-end’ (most do not), you should leave these at their default values shown and ensure these lines are enabled (no slashes in front of them).


Configuring Thermal Tolerance Grace Period

File: configuration_adv.h
Section: High Temperature Support
Settings:

//#define MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED 0
//#define MILLISECONDS_PREHEAT_TIME 0

What it is:
These are advanced settings for high temperature thermistor support and are not directly related to Thermal Runaway Protection

What it does:
High temperature thermistors have a difficult time getting accurate readings at room temperature and as a result can erroneously trigger a thermal runaway event and shut down the heater. These settings help compensate for that. However, since most all 3D Printers do not have high temperature sensors, they are disabled by default (have two slashes (‘//’) in front of them)

How to use it:
Unless you know your 3D printer has a high temperature sensor in its hot-end, you should leave these settings disabled, as shown. There is additional information in the comments for these settings in the configuration_adv.h file if you need to enable and use them.


Basic Safety Precautions, Best Practices, and other Dumb Things you shouldn’t do...

Thermistor Type:
It is very important that the correct thermistor type be selected in configuration.h in the Thermistor section for these settings:

#define TEMP_SENSOR_0 1
#define TEMP_SENSOR_1 0
#define TEMP_SENSOR_2 0
#define TEMP_SENSOR_3 0
#define TEMP_SENSOR_4 0
#define TEMP_SENSOR_BED 1

Normally you only have one hot-end, so you need only set TEMP_SENSOR_0 for it. If you have a heated bed, you would set TEMP_SENSOR_BED as well.

Many of the Thermal Runaway Protection settings rely on a properly working, and correctly set temperature sensor (thermistor). If the correct sensor is not set, inaccurate temperature readings can occur resulting in higher temperatures than those being reported. This can cause the release of toxic gases from PTFE lining in the throat as well as from the burning of filament residue if the actual temperature exceeds 260c.

Typically, this thermistor type is set to ‘1’ : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) However, if you do not know what thermistor your printer has installed, consult the printer manufacturer or the seller of the sensor to find out.

Best Practices & Safety Precautions

Here are some precautions and best practices when operating your 3D Printer.

  • Ensure you have a fire extinguisher (pick one suitable for electronic fires) within the room your printer is operating.
  • Ensure you have a working Smoke Alarm within the room your printer is operating.
  • Do not turn on your printer’s heaters if the thermistors are not initially reporting temperatures near your room’s temperature (when fully cooled) or, if a thermistors is not connected or physically attached to the heater it is responsible for monitoring (e.g. stuck down to the the print bed or mounted in the nozzle heater block).
  • Do not exceed 250c hot-end temperature for those printers with PTFE (Teflon) in their throats (most 3D Printers) as out-gassing of toxic fumes can occur.
  • Do not purposefully bypass the Thermal Runaway Protection of your 3D Printer for any reason. If you are having issues with it erroneously triggering a Runaway fault, find out why and fix it.
  • Do not purposefully ‘burn’ the filament or its residue from the hot-end of your printer – through disengaging the thermistor or any other means. Burning of plastic, any plastic, produces toxic, possibly carcinogenic, fumes (which is why you don’t burn plastic in your fireplace). Beyond the base plastic, 3D Printer filament also contains various additive compounds, such as colour dyes, flow enhancers, viscosity modifiers – and there is virtually no information available on what chemicals are released when these are burned.
  • Do not purposefully trigger a Thermal Runaway event. There are no guarantees the Thermal Runaway Protection will engage before PTFE starts out-gassing toxic fumes, filament starts burning, or even a fire.
  • If you are unsure if any of the Thermal Runaway Protection settings are enabled in your printer’s firmware, contact the manufacture. If they are unable, or unwilling to provide that information, then assume it is disabled. However, the only sure method of ensuring all the Thermal Runaway Protection settings are enabled and set to proper values is to find the manufacture's Marlin source, or a community source, for your printer, set the values yourself and upload that firmware to your printer.

CAVEAT EMPTOR: Thermal Runaway Protection is not an absolute failsafe! Read on, to find out why…

MOSFET Shorts

MOSFETs (metal-oxide semiconductor field-effect transistors), are solid-state (non-moving) components on your printer’s controller board. Their job is to switch power to the various heaters (e.g. bed heater, or hot-end nozzle heater) on and off. These MOSFET devices can fail either open (no power delivered) or closed (power is delivered). If the MOSFET fails open, this simply means the heater it controls will appear to not work at all.

If a MOSFET fails “short”, or closed, power will be passed straight through from the power supply to the heater, and it will not respond to commmands from the firmware to turn off. When this happens, the MOSFET is stuck ON and cannot be turned off - the only way to stop power being delivered to the heater is to physically unplug or switch off the main power to the printer.

A 3D printer with a shorted MOSFET will immediately start to heat up once power is turned on - and will not obey any instructions from the safety systems to turn off. In that circumstance Thermal Runaway will occur, and this may generate smoke, toxic fumes and can potentially cause a fire.

Since a MOSFET short can occur randomly at any time, without any apparent cause. For this reason, lastly, and absolutely:

NEVER LEAVE AN OPERATING 3D PRINTER UNATTENDED

Stay safe, and happy printing!

DaHai Zhu

thermal-runaway.txt · Last modified: 2019/02/18 20:37 by samuelpinches