How to turn off heater bed when it exceeds temperature

Basic Information:

Printer Model: Custom
MCU / Printerboard:Manta M8P
Host / SBC CB1
klippy.log -

Hi everyone, I’m looking to add a safety feature to my heated bed setup.

I have two temperature sensors: one on the print platform (target temperature) and another directly on the heater element itself.

Currently, I control the temperature of the print platform as the target. However, the issue arises because the heater often overheats in order to get the print platform to the desired temperature. For example, when the platform’s target is 80°C, the heater can reach up to 200°C while the platform is still warming up. (Once the temperature stabilizes, both settle around 80°C.)

I would like to keep controlling the print platform temperature as I have been, but I want to implement a safeguard to stop the heater when its own temperature exceeds, say, 200°C. Ideally, this should be done via software.

Possible Solutions I’ve Considered:

  1. Hardware Approach:
    Use a relay controlled by a temperature_fan. The relay would cut power to the heater when it exceeds 200°C and re-enable it when the temperature drops below 200°C.
  2. Software Approach (Delayed Macro):
    Use a delayed macro to evaluate the heater’s temperature periodically. If the temperature exceeds 200°C, the macro would set the heater bed’s target to 0°C, effectively disabling it. Once the temperature drops below 200°C, the target would be restored.
    However, I’m hesitant about this method because delayed macros can sometimes respond too slowly, especially if there are long movement commands or complex operations queued beforehand.

My Question:

Is there a more automated or efficient way to implement this kind of safety mechanism within Klipper? Perhaps a component or feature that I’m not aware of that can handle these types of safety constraints?

Thanks in advance for your help!

You can set a max_temp in your config. See Configuration reference - Klipper documentation

Also, did you PID tune your heat bed? Overshooting by 120ºC is not normal.

AFAIK, there is currently no option to do this. See Dual Loop PID, a accurate bed surface temperature for a previous discussion on this topic.

An option might be the rather new template function for output_pin. See Add support for output_pin and fan templates by KevinOConnor · Pull Request #6695 · Klipper3d/klipper · GitHub for the implementation details and Configuration reference - Klipper documentation for some information on the general idea and where it came from.

Yes, it is correctly tuned. And yes, when you have a veeery big and thick print platform, the heater gets very hot in order to heat the platform (they are two different elements, the plattform receives the heat from the heater, so heater is always hotter than plattform. Also, the bigger the plattform, the bigger the heat disipation, and the bigger the difference between these elements).

Thanks, i’m going to take a look.

Should not the thermal runaway protection kick in?

This is not what you want. If you control the heating power from the surface temperature, but the “leading sensor” is on the heating mat itself, you will get a delta between the surface and the heating mat. On my printers and with a heating mat temperature of 120°C this delta is easily >20°C.

So to protect the heating mat you would want to limit its maximum temperature but still control it via the surface temperature sensor.

1 Like