This commit is contained in:
nickweedon 2025-12-20 11:13:30 +00:00 committed by GitHub
commit bc04a66c12
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 45 additions and 0 deletions

View file

@ -2640,6 +2640,16 @@ Tool to disable heaters when homing or probing an axis.
# A comma separated list of heaters to disable during homing/probing
# moves. The default is to disable all heaters.
# Typical example: extruder, heater_bed
#threshold:
# If this is set then the printer will wait until the heaters have
# reached their target temperatures before continuing. If set then the
# number indicates the threshold below which the temperature of any
# heater must fall before needing to re-heat.
# This is useful for when performing bed mesh calinbration probing for
# probes that are sensitive to EMI, while still allowing the bed to
# maintain a constant temperature.
# Note that it is typically more convenient to set this via the
# SET_HOMING_HEATERS [gcode command](G-Codes.md#set_homing_heaters)
```
### [thermistor]

View file

@ -811,6 +811,13 @@ above the supplied MINIMUM and/or at or below the supplied MAXIMUM.
[TARGET=<target_temperature>]`: Sets the target temperature for a
heater. If a target temperature is not supplied, the target is 0.
### [homing_heaters]
#### SET_HOMING_HEATERS [THRESHOLD=<temperature_threshold>]
`SET_HOMING_HEATERS [THRESHOLD=<temperature_threshold>]`: Setting this to any value at all causes homing procedures to wait until the heaters have reached
thier target temperatures AFTER probing has occurred.
This is helpful during bed mesh calibration in the event that the probe is sensitive to the EMI caused by the bed but the bed temperature must be maintained during probing. To disable this, simply run the `SET_HOMING_HEATERS` command while omitting the `THRESHOLD` parameter.
### [idle_timeout]
The idle_timeout module is automatically loaded.

View file

@ -18,7 +18,12 @@ class HomingHeaters:
self.disable_heaters = config.getlist("heaters", None)
self.flaky_steppers = config.getlist("steppers", None)
self.pheaters = self.printer.load_object(config, 'heaters')
self.threshold = config.getfloat("threshold", None)
self.target_save = {}
self.gcode = self.printer.lookup_object('gcode')
self.gcode.register_command("SET_HOMING_HEATERS",
self.cmd_SET_HOMING_HEATERS,
desc=self.cmd_SET_HOMING_HEATERS_desc)
def handle_connect(self):
# heaters to disable
@ -56,9 +61,32 @@ class HomingHeaters:
def handle_homing_move_end(self, hmove):
if not self.check_eligible(hmove.get_mcu_endstops()):
return
# Switch all the heaters back on first
for heater_name in self.disable_heaters:
heater = self.pheaters.lookup_heater(heater_name)
heater.set_temp(self.target_save[heater_name])
if self.threshold is None:
return
# Now wait for them to re-heat if we need to
for heater_name in self.disable_heaters:
heater = self.pheaters.lookup_heater(heater_name)
heater_target = self.target_save[heater_name]
heater_threshold = heater_target - self.threshold
current_temp = heater.get_temp(
self.printer.get_reactor().monotonic())[0]
if current_temp < heater_threshold:
self.gcode.respond_raw(
"echo: Waiting for '%s' to reheat" % heater_name)
self.pheaters.set_temperature(heater, heater_target, True)
cmd_SET_HOMING_HEATERS_desc = "Set the reheat threshold for homing heaters"
def cmd_SET_HOMING_HEATERS(self, gcmd):
self.threshold = gcmd.get("THRESHOLD", None)
if self.threshold is not None:
self.threshold = float(self.threshold)
def load_config(config):
return HomingHeaters(config)