Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default to no additional temperature smoothing #6317

Closed
wants to merge 1 commit into from

Conversation

KevinOConnor
Copy link
Collaborator

@KevinOConnor KevinOConnor commented Aug 12, 2023

The default for heater smooth_time used to be 2 seconds; it was reduced to 1 second on 20210903. This PR would further change that default to not perform any extra temperature smoothing.

Klipper already has a relatively slow response time of 300ms for heater updates. We've seen in the past that additional "smoothing" time can result in worse PID stability (which was why the default was originally reduced from 2 seconds). I suspect that no additional smoothing may be a better overall default for most printers. That is, I suspect most printers today don't need extra smoothing and could benefit from a more responsive pid.

In particular, many printers today have stable temperature circuits. Also, regardless of the smooth_time setting, Klipper already averages 8 measurements on every reported sample. So, in effect, there is already some "smoothing" even with no extra smooth_time set.

Comments?

@ReXT3D , @dans98 - fyi.

-Kevin

P.S. This is a followup to PR #4646 .

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 <[email protected]>
@ReXT3D
Copy link

ReXT3D commented Aug 15, 2023

Attached are the results from my two printers:

  1. Cr-10S Pro with Duet3 Mini 5+, stock bed (~400W 24V DC heater), Dragon with 50W heater & PT1000 connected directly to the Duet3 Mini 5+:

image
Fig.1: Optimized extruder & bed smooth_time vs. proposed default of 0.0 smooth_time

image
Fig.2: Optimized bed smooth_time vs. proposed default of 0.0 & current default of 1.0 smooth_time

  1. Voron 2.4 with Duet3 Mini 5+, 6mm MIC bed with RTV attached 400W 120V AC Keenovo heater, Mosquito with 50W heater & PT1000 connected via Duet PT100 Daughter Board (with reference resistors modified for PT1000 RTD)

image
Fig.3: Current default of 1.0 extruder & bed smooth_time vs. proposed default of 0.0 smooth_time

Based on my previous experiments I expect that the removal of extra temperature smoothing will work well in some cases but will result in very high levels of PWM "noise" in other cases. I will run some comparisons and post the results.

EDIT: I included the results from my two printers above and also added my interpretation below.

As I anticipated, the amount of required derivative term smoothing is heavily dependent on the printer hardware. I feel that the above data presents an interesting case study because both of my printers use the exact same high quality MCU hardware and yet present totally different results. In case of my CR-10S Pro there is a very significant and unacceptable amount of increase in PWM command "noise" when reducing smooth_time to the new proposed default of 0.0. In case of my Voron 2.4 the impact of smooth_time reduction to 0.0 is negligible. Note that I have not seen any PID instabilities on my CR-10S Pro even with the excessively high PWM command noise, but I have not done any printing nor any dedicated stability/disturbance testing.

I am not sure what the above illustrates beyond highlighting that detailed fine-tuning is required for each specific printer configuration.

@KevinOConnor
Copy link
Collaborator Author

Thanks for testing and reporting results. It seems we may need to get more tests on various printers before proceeding with this merge. (In general, I think it should be okay for the PWM value to have greater variability as long as the resulting temperature stays relatively steady, but more tests is probably a good thing.)

-Kevin

@freakydude
Copy link
Contributor

Hello everyone,

Just a quick feedback from me.

I did a quick test on my Sidewinder X2 with Manta M8P board.
I have Volcano Heatblock/Nozzle with 64W heater.

I switched to this patch. Recalibrated the PID with 240°C target.

After calibration, heating to 210°C results in temperature fluctuation around 207-209°C.
Heating to the calibrated 240°C gives 241-243°C.

Finally, I switched back to the master branch using the same calibrated PID values, the temperature stays within +-0.2°C. Either at 210°C or 240°C

Best Regards
freakyDude

@github-actions
Copy link

Thank you for your contribution to Klipper. Unfortunately, a reviewer has not assigned themselves to this GitHub Pull Request. All Pull Requests are reviewed before merging, and a reviewer will need to volunteer. Further information is available at: https://www.klipper3d.org/CONTRIBUTING.html

There are some steps that you can take now:

  1. Perform a self-review of your Pull Request by following the steps at: https://www.klipper3d.org/CONTRIBUTING.html#what-to-expect-in-a-review
    If you have completed a self-review, be sure to state the results of that self-review explicitly in the Pull Request comments. A reviewer is more likely to participate if the bulk of a review has already been completed.
  2. Consider opening a topic on the Klipper Discourse server to discuss this work. The Discourse server is a good place to discuss development ideas and to engage users interested in testing. Reviewers are more likely to prioritize Pull Requests with an active community of users.
  3. Consider helping out reviewers by reviewing other Klipper Pull Requests. Taking the time to perform a careful and detailed review of others work is appreciated. Regular contributors are more likely to prioritize the contributions of other regular contributors.

Unfortunately, if a reviewer does not assign themselves to this GitHub Pull Request then it will be automatically closed. If this happens, then it is a good idea to move further discussion to the Klipper Discourse server. Reviewers can reach out on that forum to let you know if they are interested and when they are available.

Best regards,
~ Your friendly GitIssueBot

PS: I'm just an automated script, not a human being.

@github-actions
Copy link

Unfortunately a reviewer has not assigned themselves to this GitHub Pull Request and it is therefore being closed. It is a good idea to move further discussion to the Klipper Discourse server. Reviewers can reach out on that forum to let you know if they are interested and when they are available.

Best regards,
~ Your friendly GitIssueBot

PS: I'm just an automated script, not a human being.

@github-actions github-actions bot closed this Sep 25, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Sep 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants