heaters: Change default smooth_time from 2 seconds to 1 second

A larger smooth_time results in a slower reaction time for the PID.
This increased delay can cause temperature oscillations with high
power heaters.  Many boards produce good results without any
smoothing.  So, it seems a smooth_time of 1 second is a better
default.

Reported by @ReXT3D.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2021-09-01 12:54:25 -04:00
parent af3622544d
commit c84956befe
3 changed files with 7 additions and 3 deletions

View File

@ -8,6 +8,10 @@ All dates in this document are approximate.
## Changes ## Changes
20210903: The default [`smooth_time`](Config_Reference.md#extruder)
for heaters has changed to 1 second (from 2 seconds). For most
printers this will result in more stable temperature control.
20210830: The default adxl345 name is now "adxl345". The default CHIP 20210830: The default adxl345 name is now "adxl345". The default CHIP
parameter for the `ACCELEROMETER_MEASURE` and `ACCELEROMETER_QUERY` is parameter for the `ACCELEROMETER_MEASURE` and `ACCELEROMETER_QUERY` is
now also "adxl345". now also "adxl345".

View File

@ -707,10 +707,10 @@ sensor_pin:
# The resistance (in ohms) of the pullup attached to the thermistor. # The resistance (in ohms) of the pullup attached to the thermistor.
# This parameter is only valid when the sensor is a thermistor. The # This parameter is only valid when the sensor is a thermistor. The
# default is 4700 ohms. # default is 4700 ohms.
#smooth_time: 2.0 #smooth_time: 1.0
# A time value (in seconds) over which temperature measurements will # A time value (in seconds) over which temperature measurements will
# be smoothed to reduce the impact of measurement noise. The default # be smoothed to reduce the impact of measurement noise. The default
# is 2 seconds. # is 1 seconds.
control: control:
# Control algorithm (either pid or watermark). This parameter must # Control algorithm (either pid or watermark). This parameter must
# be provided. # be provided.

View File

@ -34,7 +34,7 @@ class Heater:
is not None) is not None)
self.can_extrude = self.min_extrude_temp <= 0. or is_fileoutput self.can_extrude = self.min_extrude_temp <= 0. or is_fileoutput
self.max_power = config.getfloat('max_power', 1., above=0., maxval=1.) self.max_power = config.getfloat('max_power', 1., above=0., maxval=1.)
self.smooth_time = config.getfloat('smooth_time', 2., above=0.) self.smooth_time = config.getfloat('smooth_time', 1., above=0.)
self.inv_smooth_time = 1. / self.smooth_time self.inv_smooth_time = 1. / self.smooth_time
self.lock = threading.Lock() self.lock = threading.Lock()
self.last_temp = self.smoothed_temp = self.target_temp = 0. self.last_temp = self.smoothed_temp = self.target_temp = 0.