Ubuntu – I downloaded “fancontrol” to bring the computer’s temperature down, but what do the different “pwmconfig” parameters actually do

configurationfanfancontroloverheatingtemperature

I would like to increase my fan speed and get my computer to run a little cooler, so I downloaded the "fancontrol" package and ran the sensors-detect along with pwmconfig programs. But even after reading the man page for "fancontrol" I don't really know what numeric values for some of the parameters actually do.

For example, there are "MINSTART" and "MINSTOP" parameters that set the "minimum speed at which the fan begins spinning. You should use a safe value to be sure it works, even when the fan gets old" and "the minimum speed at which the fan still spins. Use a safe value here, too." But what are the units of measure for "MINSTART" and "MINSTOP"?

Then it says the "MINPWM" and "MAXPWM" are the "PWM" values to use when the temperature is below MINTEMP or above MAXTEMP, respectively. It does say that "when "MINPWM… isn't defined, it defaults to 0 (stopped fan)" (obviously, the opposite of what I want) and if MAXPWM "isn't defined, it defaults to 255 (full speed)." But when I run "pwmconfig" and select the option for a "detailed correlation," I can see that 255 is not the maximum speed; rather, it's about half speed (and yes, I have tried waiting a few minutes for the fan to spin up so that this behavior is not merely an artifact of lag time between starting the test and the measurements) and then the value of 210 is the highest speed attained during the "detailed correlation" test:

    PWM 255 FAN 1066
    PWM 240 FAN 974
    PWM 225 FAN 1366 (probably incorrect)
    PWM 210 FAN 1650 (probably incorrect)
    PWM 195 FAN 1558 (probably incorrect)
    PWM 180 FAN 1442 (probably incorrect)
    PWM 165 FAN 1323 (probably incorrect)
    PWM 150 FAN 1198 (probably incorrect)
    PWM 135 FAN 1066
    PWM 120 FAN 976
    PWM 105 FAN 974
    ... some output omitted (PWM values under 150 consistently produce slow speeds)....
    Warning: slow font initialization    Hit return to continue...qt_processTermEvent received a GE_fontprops event. This should not have happened

Consistently, the fan spins up to full speed, then I start this stage of the test, then the fan speed immediately drops, then accelerates, then drops again. (This is for the "hwmon1/pwm1" sensor. For the "hwmon1/pwm3" sensor there is a more dramatic and seemingly random effect.) (The error message at the end is new.)

Anyway, when I use the fancontrol program (with either default configuration or "pwmconfig"-generated configuration) it definitely affects the speed of the fan but it's hard to say whether on average it is faster with the fancontrol service running in the background, or without it.

So what does the "PWM" number mean? From casually Googling it seems to do with a pulse cycle of electricity to the fan, which begs the question: which PWM number really is the maximum speed? I assume that a number between 190 and 220 generates a waveform that causes the motor to spin faster, but what is the real meaning of this number? And how can I configure the fan to run at a higher speed on-demand?

Best Answer

The 0-255 is simply a single byte. The power to the fan is either on or off. The speed of the fan is regulated by how long power is on vs off. Let's say a single period lasts one second, divide that second into 255. If your PWM is set to 64, that means that 64 out of 255 fractions of a second the power is on (~25%), and the other 191 the power is off (~75%). The on portion is called a duty cycle. So a value of 255 would mean power is applied 100% of the time, 0 would be 0% of the time. How fast the fan is actually spinning is dependent on the fan itself. This is why pwmconfig is trying to determine how fast the fan spins at the given pwm values. There are typically 25000 periods per second with fan controllers.

MINSTART is the minimum duty cycle required for the fan to break static friction and start moving. MINSTOP is similar, the minimum duty cycle required for kinetic friction to stop the fan. These are different values because static and kinetic friction are different.

For MINPWM if you want your fan spinning all the time, you would set it to something higher than the MINSTART, otherwise set it to 0. I always wondered where there would be a use case for MAXPWM, and you just might have it. In your example, if those fan speeds are to be believed, running at 100% on duty cycle is leaving your fans slower than they are capable of moving. You would set the MAXPWM to the fans fastest speed, around 210.

To me, this suggests a fan problem, it's very odd to see the power applied 80% of the cycle being faster than 100%. It could even be a loose/bad wire/connection, power supply issue, or the IO controller is bad. They do sell fan controllers you can plug into the USB connector on the motherboard like CORSAIR Commander if it came down to the IO controller, and there is a github project for controlling that in Linux.

Related Question