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

Set PWM mode and frequency for quieter fan #3

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

Conversation

agspoon
Copy link

@agspoon agspoon commented Jan 16, 2025

Using an oscilloscope and my sensitive hearing ;), I achieved much lower noise and slower minimum speed, by setting the PWM mode and frequency to "Mark-Space" and 25KHz respectively. This is with 30mm & 40mm fans mounted on a RPi-4b Hat.

The wiringPi library defaults to "Balanced Mode", and a resulting high frequency signal at the PWM controller input. By changing the frequency close to the more standard 25KHz, and using a fixed square-wave, the resulting noise artifacts are considerably reduced. I am also able to achieve very low minimum fan rotation speeds under these conditions.

Note, this should be a backwards compatible change with any existing configuration in /etc/conf.d/kvmd-fan, as the default 1024 Range is not changed here. Any user that has specified a different value for --pwm-high, was not changing the actual signal.

I'm using this - https://www.tindie.com/products/jeremycook/ez-fan2-tiny-raspberry-pi-fan-controller/
as my controller interface between the RPi GPIO PWM signal, and the two-wire fan.

I'm running kvmd-fan on a PiKVM clone (Geekworm PiKVM-A3), but I believe this change would be applicable to any small fan PWM controller.

@mdevaev
Copy link
Member

mdevaev commented Jan 17, 2025

Hello. It's interesting. I'll check. But if it doesn't make improvements on official V3 and V4, I won't accept the changes.

@agspoon
Copy link
Author

agspoon commented Jan 17, 2025

Certainly. I was sitting on a similar PR to #2, but was not happy that it required so much re-work and broke backwards compatibility. Then I realized it wasn't necessary to hit exactly 25KHz, it just needed to be in the ballpark. This allowed me to keep the 1024 step Range, and thus backwards compatibility with both the code base and people's existing configuration parameters.

Given it a listen in a quite space, and if it works better great.

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

Successfully merging this pull request may close these issues.

2 participants