[FR] Chamber Heater with seperate temperature sensor for chamber_heater_temp and chamber_temp

I work with an active chamber heater. To avoid melting the chamber heater housing, I added a temperature sensor on the heater and defined it in the chamber_heater section. The heater_temp should not go over 120°C. It works fine, but the sensor is only used to control the heater temperature and not the chamber temperature.
To get the chamber temperature, I added another sensor to monitor the actual chamber temperature.
I don’t see a way to directly control the chamber temperature, so I have to manually adjust the temperature of the chamber_heater to get the chamber temperature on point.
To do this, I had to write a macro that calculates the value for the chamber heater according to the chamber temperature used. Unfortunately, after a while the chamber gets warmer than it should because the frame etc gets warmer and the chamber heater has to get lower.
Again, this is a PID control.

It would be nice to get a function that controls the heater temperature and the chamber temperature with the special chamber_temp_sensor pid.

I hope it is understandable

As far as I know this is currently not possible and I’m not even sure if it is feasible, since you would have two competing PIDs.

Why don’t you use the sensor / chamber heater PID not simply for heating your chamber and limit the power of the heater that it cannot go over 120°C?

Cause I use a DS18B20 Sensor for the Chamber Temp and until now, it´s not possible to use these sensors to control heaters. I´ve openend an issue on github (BUG?: Chamber Heater with DS18B20 Temperature Sensor generates "MCU 'mcu' shutdown: Scheduled digital out event will exceed max_duration" failure · Issue #5189 · Klipper3d/klipper · GitHub) but it´s not been fixed till now.

The docs specifically say that sensor can’t be used for controlling heaters. I believe there’s too much time between temp updates to use it for that purpose so it’s not something that can ever be used in that way.

Which docs do you mean? Do you have a link?

https://www.klipper3d.org/Config_Reference.html?h=ds1#ds18b20-temperature-sensor

But there stands also that „They can also function as simple fan/heater controllers.“
So, what is a simple heater? Controlled by watermark instead of PID?

I just put together a similar setup, had similar goals, and this is the best I’ve come up with.
It is far from optimized yet, but it functions.

The compromise is to limit the maximum temperature that the heater reaches by reducing max_power.
I hate not using the heaters full potential on startup, so plan to make some changes and let the heater get hotter. The screws holding the thermistor are conducting heat from fins further inside so it is reading hotter than the outside fins really are.

The sensor in the chamber controls when the heater kicks on.
I JUST STARTED WORKING ON THIS AND HAVE NOT DETERMINED PROPER SETTINGS FOR VERIFY_HEATER YET. USE AT YOUR OWN RISK.

[heater_generic heater_chamber]
heater_pin: PB11
sensor_type: ATC Semitec 104GT-2
sensor_pin: PF6
min_temp: 10
max_temp: 70
max_power: .3
control: watermark
max_delta: 2.0
pwm_cycle_time: 0.0166

[verify_heater heater_chamber]
max_error: 900
check_gain_time: 900
hysteresis: 5
heating_gain: 1

The sensor on the outer fin of the heater controls the fan that blows through the heater. It will kick on at 40 degrees. If the max temp is reached klipper will shut down, but the fans will continue to run like the hotend fan does. The temperature and fan status show in your thermals list in Fluidd or Mainsail.

[temperature_fan chamber_fan]

pin: PD14
max_power: 1.0
shutdown_speed: 1
kick_start_time: 0.5
sensor_type: ATC Semitec 104GT-2
sensor_pin: PF7
control: watermark
max_delta: 2.0
min_temp: 10
max_temp: 150
target_temp: 40.0