Skip to content

Commit

Permalink
heaters: Change default smooth_time from 2 seconds to 1 second
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
KevinOConnor committed Sep 3, 2021
1 parent af36225 commit c84956b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions docs/Config_Changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ All dates in this document are approximate.

## 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
parameter for the `ACCELEROMETER_MEASURE` and `ACCELEROMETER_QUERY` is
now also "adxl345".
Expand Down
4 changes: 2 additions & 2 deletions docs/Config_Reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -707,10 +707,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: 2.0
#smooth_time: 1.0
# A time value (in seconds) over which temperature measurements will
# be smoothed to reduce the impact of measurement noise. The default
# is 2 seconds.
# is 1 seconds.
control:
# Control algorithm (either pid or watermark). This parameter must
# be provided.
Expand Down
2 changes: 1 addition & 1 deletion klippy/extras/heaters.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def __init__(self, config, sensor):
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', 2., above=0.)
self.smooth_time = config.getfloat('smooth_time', 1., above=0.)
self.inv_smooth_time = 1. / self.smooth_time
self.lock = threading.Lock()
self.last_temp = self.smoothed_temp = self.target_temp = 0.
Expand Down

1 comment on commit c84956b

@robthide37
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you should go lower than that i have been telling people who have problems to do this and have all my patrons set to .1 and it makes things way better. maybe doesn't have to be .1 but 1 sec is still longer than needed. The thicker the bed or higher power the heater the worse it is if the time is to long. If you look only one person i have told to do this has not said it fixed his issue and i am not sure he re did his pid tune.

Please sign in to comment.