Smart Chamber Heater - Adaptive Predictive Chamber Heating Macro for Klipper

Hi everyone!

I’d like to share a project I’ve been working on.

Smart Chamber Heater is an advanced chamber heating controller for Klipper, designed for enclosed printers using a PTC chamber heater.

It supports both Solid State Relays (SSR) and mechanical relays, making it compatible with a wide range of chamber heating setups.

Unlike a traditional thermostat, it continuously evaluates the thermal state of the printer and dynamically adjusts the heater target to improve heating performance, reduce overshoot and provide a more stable chamber temperature.


Why was this created?

The motivation behind this project was actually very simple.

Klipper already supports chamber heaters through heater_generic, but its behavior is straightforward: you set the target temperature of the PTC heater, and Klipper regulates the heater to maintain that temperature.

The problem is that users don’t actually care about the PTC heater temperature—they care about the chamber temperature.

Unfortunately, these are not the same thing.

The chamber temperature depends on many factors, including:

  • Heater power
  • Chamber size
  • Air circulation
  • Printer insulation
  • Residual heat stored inside the PTC heater

With a standard configuration, reaching a desired chamber temperature usually becomes a process of trial and error. You might set the heater to 60°C, wait, measure the chamber, increase it to 70°C, wait again, and repeat until the chamber eventually reaches the temperature you actually wanted.

Smart Chamber Heater removes this guesswork.

Instead of setting the PTC heater temperature, you simply set the chamber temperature you want.

For example:

SET_HEATER_TEMPERATURE HEATER=chamber_heater TARGET=50

With Smart Chamber Heater, this does not mean:

“Keep the PTC heater at 50°C.”

Instead, it means:

“I want the printer chamber to reach 50°C.”

From that point on, Smart Chamber Heater stores the requested chamber temperature internally and automatically determines the optimal PTC heater target.

During the heating process, the heater target shown in Klipper may change dynamically as the controller continuously adapts to the current thermal conditions.

This is completely normal—the displayed heater target is only a temporary working value calculated by the controller, while the original chamber temperature requested by the user always remains the true target.


Main Features

  • Adaptive chamber heating
  • Compatible with SSR and mechanical relays
  • Linear Control
  • Hybrid Predictive Control
  • Full Adaptive Predictive Control
  • Automatic control mode selection
  • Chamber prediction model
  • PTC thermal memory estimation
  • Progressive heater unloading
  • Hold Mode
  • Adaptive chamber fan control
  • Independent heat-assist fan management
  • Intelligent exhaust fan control
  • Automatic cooldown
  • Multiple safety layers
  • Diagnostic macros
  • M141 / M191 slicer compatibility

Documentation

The repository includes:

  • Usage Guide
  • Configuration Parameters
  • Tuning Guide
  • FAQ
  • Security documentation
  • GitHub Wiki

I’ve tried to document the project as thoroughly as possible, so hopefully most questions are already answered there.


Video

Project overview:


GitHub


A Few Notes

This project was designed and developed from scratch. AI was used only to assist with documentation and improve comment near code,to make this easily readable from every user.
*
Although the controller is already working well on my hardware, the project is still under active testing. I expect there are hardware combinations and edge cases that haven’t been encountered yet, so feedback from the community is extremely valuable.
*
My long-term goal is to provide an optional native Klipper Extras implementation in Python, alongside the current macro version. This would allow cleaner code, easier maintenance and more advanced control strategies that are difficult or impossible to implement purely with Jinja macros.
*
One of the control strategies I’m currently researching for the Python implementation is Nonlinear Control (NLC). I’m still studying the mathematical model and evaluating how it could be integrated into Klipper to further improve temperature stability, overshoot reduction and overall heating performance.


Feedback Welcome

The project is still actively evolving, so I’d really appreciate feedback from the Klipper community.

I’m especially interested in:

  • Testing on different printers and chamber sizes
  • Different PTC heater configurations
  • Ideas for improving the control strategy
  • Code optimization
  • Suggestions for additional safety features
  • Bug reports and real-world testing results

Whether it’s a bug report, a feature request or simply sharing your experience with the controller, every piece of feedback helps improve the project.

Thanks for taking the time to have a look!

4 Likes