From 9dd235ab91f9a45e04daf0f1ece946214a326c57 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Fri, 23 Jun 2023 20:52:04 -0400 Subject: [PATCH] heaters: Don't add additional temperature smoothing by default Smoothing of reported temperatures can make the pid less stable. Many printers do not need temperature smoothing, so it is better to not smooth by default. Signed-off-by: Kevin O'Connor --- docs/Config_Changes.md | 5 +++++ docs/Config_Reference.md | 4 ++-- klippy/extras/heaters.py | 3 ++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/docs/Config_Changes.md b/docs/Config_Changes.md index 063af8ac3..ea0bcfff1 100644 --- a/docs/Config_Changes.md +++ b/docs/Config_Changes.md @@ -8,6 +8,11 @@ All dates in this document are approximate. ## Changes +20230820: The heater `smooth_time` now defaults to not perform any +additional temperature smoothing. To return to the previous behavior +of one second smoothing, set `smooth_time: 1.0` in the heater config +section. + 20230810: The flash-sdcard.sh script now supports both variants of the Bigtreetech SKR-3, STM32H743 and STM32H723. For this, the original tag of btt-skr-3 now has changed to be either btt-skr-3-h743 or btt-skr-3-h723. diff --git a/docs/Config_Reference.md b/docs/Config_Reference.md index d0b617a36..cae24281f 100644 --- a/docs/Config_Reference.md +++ b/docs/Config_Reference.md @@ -798,10 +798,10 @@ sensor_pin: # The resistance (in ohms) of the pullup attached to the thermistor. # This parameter is only valid when the sensor is a thermistor. The # default is 4700 ohms. -#smooth_time: 1.0 +#smooth_time: # A time value (in seconds) over which temperature measurements will # be smoothed to reduce the impact of measurement noise. The default -# is 1 seconds. +# is to not perform any additional temperature smoothing. control: # Control algorithm (either pid or watermark). This parameter must # be provided. diff --git a/klippy/extras/heaters.py b/klippy/extras/heaters.py index 0e9411c9f..83be1b436 100644 --- a/klippy/extras/heaters.py +++ b/klippy/extras/heaters.py @@ -34,7 +34,8 @@ class Heater: is not None) self.can_extrude = self.min_extrude_temp <= 0. or is_fileoutput self.max_power = config.getfloat('max_power', 1., above=0., maxval=1.) - self.smooth_time = config.getfloat('smooth_time', 1., above=0.) + self.smooth_time = config.getfloat('smooth_time', self.pwm_delay, + above=0.) self.inv_smooth_time = 1. / self.smooth_time self.lock = threading.Lock() self.last_temp = self.smoothed_temp = self.target_temp = 0.