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

heaters: drop control delay #6706

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nefelim4ag
Copy link
Contributor

@nefelim4ag nefelim4ag commented Oct 6, 2024

Heaters control is reactive, the faster we apply new PWM - the faster we will see a response.
Add command to directly apply PWM as fast as it arrives.
As a bonus, we relaxed time constraints, Timer Too Close should happen "never".
As a safety check, we still have Missed scheduling of next digital out event.
This code is mostly related to this topic/comment: https://klipper.discourse.group/t/remove-the-300ms-heater-control-delay/17771/11

I'm not sure about the right value for reqclock. If I understood the code correctly the reqclock=0 command should be sent in the next batch.

This is more like a simple and safe solution because we just avoid timer calculation on the host.
I think the proper way to do this for heaters is to make another timer function and update fields on_duration, off_duration, end_time on each command arrival. In addition, if we want to remove the 5-second limit, cycles counter can be used there, which will be decremented on each cycle, and then there will be no dependence on timer resolution.

Thanks.

Heaters control is reactive,
the faster we apply new PWM - the better.
Add command to directly apply PWM as fast as it arrives.
As a bonus, we relaxed time constraints,
Timer Too Close should happen less often.

Signed-off-by: Timofey Titovets <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant