Random thoughts on fan speed control
Hi all,
I've been adding fan speed control to the f71805f driver today. Along the way of testing, I had some thoughts which I'd like to share.
* Frequency matters. I wasn't convinced so far, now I am. The F71805F defaults to a PWM frequency of 187.5 kHz. At this frequency, the fan is at either full speed or stopped. I even feared for a moment that my motherboard wasn't wired for fan speed control... Basically the fan is at almost full speed down to pwm = 24, and then dives very fast, giving you absolutely no control.
So I hacked a perl script testing several frequencies from 160 kHz to 30 kHz (the lowest the F71805F can do). You can see the result here:
http://khali.linux-fr.org/devel/lm-sensors/pwm_response_curves.png
At and above 10 kHz, it's about the same as I just described. The range where the pwm value actually matters is 0 - 40, not exactly usable.
At and below 100 Hz, I found that you reach a point where the fan speed is no more reported properly. I puroposedly removed the bogus value from the graph, but you can see where the curves are stopping, at approximatively 1200 RPM. I guess that the tachometer doesn't like these frequencies, so using them also means that you can't use the lowest range of duty cycle values (< 64), as there's very little point in controlling the fan speed if in return you can't monitor it anymore.
From this you'd conclude that the 300 - 2000 Hz frequency range is the best choice. Except that my fan starts emitting high-pitch noise when I use these frequencies. The whole point of fan speed control being noise reduction, it pretty much voids the effort, replacing a noise with another (even more annoying at that.)
* Fan speed control isn't ready for mainline. With the default PWM frequency, I almost didn't notice that I could control my fan. Then it took me a day of tests to find out what frequencies were better, and what pwm value range to use in each case. And I'm not even sure what I'll do now, as every frequency has some form of drawback. And of course I presume that all of this depends on the fan model, so it's not even worth documenting for others.
* Reading the F71805F documentation, I learned that the external circuitery needed for PWM fan speed control is completely different from the one needed for DC fan speed control. So I wonder if it is a good idea to let the user change between the two modes. Clearly the BIOS should set it right. I tried to switch to DC mode and it had no effect at all on my fan (not even on/off). I wonder if it is possible to confuse or even damage the hardware by using the wrong mode?
* pwmconfig doesn't work for non-i2c-based hardware monitoring drivers, because the script still looks for the devices in /sys/bus/i2c rather than /sys/class/hwmon. We need to fix this before the 2.10.1 release. Any volunteer? It's probably just a couple of lines of shell to add.
Signature · 1 line
Jean Delvare
Hi,
Just quick snip because I gotta work too ;)
Quoted 7 lines
* Reading the F71805F documentation, I learned that the external circuitery needed for PWM fan speed control is completely different from the one needed for DC fan speed control. So I wonder if it is a good idea to let the user change between the two modes. Clearly the BIOS should set it right. I tried to switch to DC mode and it had no effect at all on my fan (not even on/off). I wonder if it is possible to confuse or even damage the hardware by using the wrong mode?
Yes DC/PWM settings were already removed from W83793 and imho not implemented on EHF too.
You need to know what circuits are onboard -> BIOS should do that for you. If you want to implement this I would suggest just a kernel param for BIOS fixups.
Rudolf
Hi Rudolf,
Quoted 10 lines
Quoted 7 lines
* Reading the F71805F documentation, I learned that the external circuitery needed for PWM fan speed control is completely different from the one needed for DC fan speed control. So I wonder if it is a good idea to let the user change between the two modes. Clearly the BIOS should set it right. I tried to switch to DC mode and it had no effect at all on my fan (not even on/off). I wonder if it is possible to confuse or even damage the hardware by using the wrong mode?
Yes DC/PWM settings were already removed from W83793 and imho not implemented on EHF too.
Well, I have no problem with chip makers implementing both and letting the integrators choose what they want to do. But in that case the BIOS should set the proper operation mode.
Quoted 2 lines
You need to know what circuits are onboard -> BIOS should do that for you. If you want to implement this I would suggest just a kernel param for BIOS fixups.
I usually avoid adding BIOS fixups unless really needed. I don't want to incite motherboard manufacturers to ship broken BIOSes. As long as nobody reports a problem with this, I won't implement it. And even then, I'd rather ask the user to request a fixed BIOS, as it makes much more sense.
So my current plan is:
* Provide pwmN_mode, but read-only.
* Only provide pwmN_freq in PWM mode.
Thanks,
Signature · 1 line
Jean Delvare
Rudolf,
Quoted 2 lines
Quoted 2 lines
Yes DC/PWM settings were already removed from W83793 and imho not implemented on EHF too.
I haven't used a scope to trace the signal, but a little testing shows that when I change the w83627ehf from PWM to DC mode, I get a different response from the fan. The w83627ehf does support PWM and DC mode. It defaults to PWM mode on my motherboard.
David