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

controller_fan: add ability to watch temperature_sensors too #6479

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

slaesh
Copy link

@slaesh slaesh commented Jan 30, 2024

I searched a way to have a fan controller that just watches one or more temperature sensors.. like host-temperature. since the enclosure fans of my voron are pretty loud.. and I noticed that most of the stuff is not getting hot at all.. so.. having this fan-controller work without the heater/extruder.. and just watch actual temperatures would be awesome! for my ears.. for the fans.. and hopefully for other guys out there ;)

I found this pretty old PR from @mnigbur, which did not make it back then..

just pinging some of the guys who where active in the past in this thread.. @Ramalama2, @theopensourcerer, @meteyou, @edddeduck, @KevinOConnor

question: any chance to test it without running an actual machine? (in general, not for this one =))

To-Do:

  • adjust linting (its not linting, its a hand-written code checker :D)
  • test on machine

Signed-off-by: Sascha Ehlers [email protected]

@slaesh slaesh marked this pull request as ready for review January 30, 2024 12:51
@Ramalama2
Copy link

Hey @slaesh
Im sorry, but i have to pass, im not active anymore in the 3d printing world xD
Gaved my Voron away, using only Bambu atm if i need to print something rarely at all.
Cheers :-)

@JamesH1978
Copy link
Collaborator

Thank you for submitting a PR, pleas refer to point 3 in "What to expect in a review" in https://github.com/Klipper3d/klipper/blob/master/docs/CONTRIBUTING.md and provide a signed off by line.

Thanks
James

@slaesh
Copy link
Author

slaesh commented Jan 31, 2024

Thank you for submitting a PR, pleas refer to point 3 in "What to expect in a review" in https://github.com/Klipper3d/klipper/blob/master/docs/CONTRIBUTING.md and provide a signed off by line.

Thanks
James

Hey James, I am happy to do that. But I am not sure exactly what to do 🙈 Where do I need to upload that "signed" file? :)

BR Sascha ✌️

@slaesh
Copy link
Author

slaesh commented Jan 31, 2024

do I need to add another commit with --signoff option?

@slaesh
Copy link
Author

slaesh commented Jan 31, 2024

oh I see, the link was not working on my github app this morning. so.. we add this sign-off thingy at the squashed commit or how do I add this kind of stuff for the already done commits? Oo

Signed-off-by: Sascha Ehlers <[email protected]>

@slaesh
Copy link
Author

slaesh commented Feb 13, 2024

@JamesH1978 done. Just saw another PR which had it in the description text. Hope this does the job ;)

@pedrolamas
Copy link
Contributor

Just a thought, but would the combined temperature sensor and a regular temperature_fan help to achieve a similar result?

Copy link

github-actions bot commented Mar 6, 2024

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.

@TheFuzzyGiggler
Copy link

Is this not what's already covered with temperature_fan?

You can set a temperature_fan to check an mcu temp.

Example:

[temperature_fan SB2040_Fan]
pin: sb2040:gpio15
sensor_mcu: sb2040
sensor_type: temperature_mcu
cycle_time: 0.010
hardware_pwm: False
min_temp: 0
max_temp: 100
control = pid
pid_kp = 59.385
pid_ki = 0.153
pid_kd = 5758.870
min_speed: 0.1
target_temp: 45

Ignore my PID settings, they're horrible. I was messing around.

@gabevenberg
Copy link

Is this not what's already covered with temperature_fan?

You can set a temperature_fan to check an mcu temp.

Seems to me the reason is that you cant have a single fan be both a controller_fan and a temperature_fan.

@dmit2k
Copy link

dmit2k commented Dec 6, 2024

I searched a way to have a fan controller that just watches one or more temperature sensors.. like host-temperature. since the enclosure fans of my voron are pretty loud.. and I noticed that most of the stuff is not getting hot at all.. so.. having this fan-controller work without the heater/extruder.. and just watch actual temperatures would be awesome! for my ears.. for the fans.. and hopefully for other guys out there ;)

Hi @slaesh ! Love your Zigbee sticks BTW )
But I've found one problem with your provided solution. I'm trying to resolve the same case: my printer has single controller fan block for cooling the host CPU, mainboard MCU and stepper drivers all at the same time. When the steppers and heaters are off, I need to cool down just the host CPU (which reaches 60-70C even if idle). For cooling the CPU I need only 20-30% of fan speed. But the [controller_fan] either can be Full Off or Full On.

So your solution does not resolve the primary intention to reduce the fan noice: either it will be all the time Full On because of CPU temp, or Full On because of stepper / heater activity.

I would suggest much simpler solution as a compromise: allow the "min_speed" or "default_speed" option for [controller_fan] so it will run at a predefined minimal speed when not triggered On by steppers / heaters, just to cool down the controllers and CPU.

Otherwise we have to extend the [controller_fan] to a very complex thing with PID controls which can be difficult as we can't get the TMC2209 drivers actual temperature for example.

EDIT: Just discovered there were already some similar "min_speed" PRs rejected in 2022, with the following comment from Kevin:

#5792

Separately, I have a rough plan to add support for "fan speed templates" so that one can specify an arbitrary formula to set the fan speed to (similar to how one can specify "led templates" today).

Though I've never heard of fan_templates being introduced since that....

@KevinOConnor,
I can understand your point, but that is pretty regular case when one fan is being used for cooling everything, though has no need to run at full speed all the time.

@dmit2k
Copy link

dmit2k commented Dec 6, 2024

Seems to me the reason is that you cant have a single fan be both a controller_fan and a temperature_fan.

Actually we can, with the [duplicate_pin_override] Klipper option.

But the problem is - which of them will take precedence over this single fan at specific moment? :) It's like placing a hot iron into the fridge guessing "who will win" :)

I have tried this workaround but can't imagine how to check the actual fan speed...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants