-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Normalising Fan PWM power #6307
base: master
Are you sure you want to change the base?
Conversation
Thank you for submitting a PR, please could you refer to point 3 in the "what to expect" section in https://github.com/Klipper3d/klipper/blob/master/docs/CONTRIBUTING.md and add a signed-off-by line. Also you need to fix your whitespaces/length of line to pass build checks Thanks |
14cbd54
to
f46d357
Compare
@JamesH1978 It should be fine now. Let me just test everything once more and I think it's ready unless you have some objections. |
@Sineos Thanks. I looked into the implementations and they modify a lot the 'input' value parameter which then stores scaled value as Renaming the value if we decide not to keep it to I'm also inviting @dewi-ni-je for hopefully final discussion! As he seems to be the most vocal about the change :)) |
I went though the discussions again. It doesn't seem like anybody has a problem with this per-se more so the way it was implemented that there were too many variables. So do we agree to rename the off_power to min_power and scale the value between Renaming the value has that added benefit that the user has to review the setting if it's set. Plus it deals with the off_bellow handling that mainsail is doing. I will create a separate PR to mainsail also to remove the dead code |
I would very much like to see a min/max power, and scale between them. Currently "50%" doesn't mean anything related to "50%" relevant to the fan, but relevant to pwm speed. For bare pins, that makes sense, but in the context of fans, I'd like to see 50% mean 50% of the available fan curve. Consider me onboard with this change in concept. Will actively be checking back to code review and do testing on my printers. |
There is only one person you need to convince and this is @KevinOConnor 😉 |
2a9046b
to
9020849
Compare
I've renamed the IMG_1371_MOV.mp4 |
41984a4
to
aeab8c1
Compare
Isn't this something that can be implemented as macro? why a native way? |
I wrote in description of the PR. I can't see any reason why in the context of Fan values below certain treshold should be ignored while So the question to ask really is what use do you have for this not to be scaled. So now, either we handle values above max_power the same way as we do with off_bellow == ignore them (or clip) OR we normalise the safe duty cycle range such that this PR suggest. I'm "happy" to implemented a |
IMO this is a good change:
|
... and in addition,
|
Indeed. Also searching for M106 the internet says |
Scale value for fan input based on fan's `min_power` and `max_power`. As an example, when fan's min_power is set to `0.2`, requesting 1% of fan should translate to roughly `0.2` This makes it possible to operate fans such as CPAP which generally need quite high min_power (between 16-30%) operatable at 1% This also renamed off_below to min_power Signed-off-by: Jakub Racek <me@jakubracek.net>
77c9834
to
b687d39
Compare
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:
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, PS: I'm just an automated script, not a human being. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Workin as intended.
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, PS: I'm just an automated script, not a human being. |
What if to leave both "off_below" and "min_power"? This will ensure backward compatibility and both parameters are still different in meaning and may be useful. |
Is this implemented in newest klipper version? (Trying that but can't find it.) |
@surikatec no this is an open PR, it is not implemented or merged |
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, PS: I'm just an automated script, not a human being. |
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, PS: I'm just an automated script, not a human being. |
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, PS: I'm just an automated script, not a human being. |
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, PS: I'm just an automated script, not a human being. |
What tasks are open here? |
It looks like this thing has stalled. I was looking for exactly this and manually copied the fan.py into my RatOs setup. Works like a charm. |
Thanks for testing, it stalled on merging. There isn't anybody assigned to this with the rights to merge this unfortunately. |
And yes I'm unfortunately doing it aswell, shame that this simple feature is not in klipper... @KoenVanduffel comment regarding developer and user perspective is very good and its confusing for most people. Marlin does that quite well with @KevinOConnor can you please merge this or #4720? |
Chiming in to support this PR. It seems this would align the way fans work with most users expected behhavior, and would simplify/reduce the need to explicitly configure slicer settings for low fan speeds. In the event that some users wish to keep the current fan setup, perhaps a "scaled_fan" class could be added to wrap the regular fan and add the scaled fan functionality? |
What this does
It makes it possible to set 1% for a fan such as CPAP with a large off_below value and the fan will run at its lowest power at this setting
Why
Fans with quite high value for
off_below
(CPAP for example) are currently in klipper bit tricky to operate and people use several tricks either in slicer/gcode/macros to scale the values as requesting a 10% fan for cpap that might start at 16% or 30% gets ignored by klipper and fan stays off. When fan is properly configured in klipper and I request a fan to run at 1% of its speed I expect it to actually move, which is not the case currently. So the slicer/gcode needs to have a 'low level' knowledge of my hardware (when my fan actually will kick-in).The value is actually currently partially scaled but between 0 and max_power. It's a bit odd.
How
This normalises the value between
off_below
andmax_power
.When
off_below
would be set to0.3
and max_power to1.0
a10%
increment would have a value of0.7
so requesting 10% of a fan will result in a value ofoff_below + 0.7 = 0.37
and not0.1
as it does currently which effectively has no effect.Normalizing the value according to fan setting such that the CPAP and similar fans will kick in even at 1% so the whole range can be used in same fashion as with any other fan where
off_below=0
Note
These two notes bellow were addressed by renaming the parameter.
When testing this. Mainsail has a logic in place where they useoff_below
as a minimal setting for the fan using the fan slider, so setting the fan to say 2% will automatically set it to 30%I will create a separate PR in Mainsail to remove this logic as it will no longer be needed.
After such update, users withoff_below > 0
who will not change theirM106
to lower the value will have their fans a bit louder, heh. They will generaly expect that their cpap might kick-in at around 16-30% so that's what they will have their lowest value set to in slicer and such. After the update it will be an actual 16-30% fan speed.