mirror of
https://github.com/lm-sensors/lm-sensors
synced 2025-08-31 14:25:39 +00:00
Use linear interpolation instead of quadratic to choose PWM values.
This is simpler and will work better in most cases. For example this should address at least part of ticket #2224. It seems that quadratic was used to lower the average noise level, but I don't think this is a valid reason. The new MINPWM and MAXPWM parameters will also let the user control the noise level if really needed. git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4589 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
1
CHANGES
1
CHANGES
@@ -29,6 +29,7 @@ SVN HEAD
|
||||
Check for configuration file validity
|
||||
Support optional min and max PWM values
|
||||
Better integration with init scripts
|
||||
Use linear control instead of quadratic
|
||||
Program pwmconfig: Use smaller steps for low PWM values
|
||||
Support optional min and max PWM values
|
||||
Program rrd: Support only hwmon class devices
|
||||
|
@@ -120,16 +120,14 @@ fancontrol first reads its configuration, writes it to arrays and loops its
|
||||
main function. This function gets the temperatures and fanspeeds from
|
||||
kernel driver files and calculates new speeds depending on temperature
|
||||
changes, but only if the temp is between MINTEMP and MAXTEMP. After that, the
|
||||
new values are written to the pwm outputs. Currently the speed increases
|
||||
quadratically with rising temperature. This way you won't hear your fans most
|
||||
of the time at best.
|
||||
new values are written to the pwm outputs. The pwm value increases
|
||||
linearly with rising temperature.
|
||||
|
||||
|
||||
Planned features
|
||||
|
||||
rc-scripts for some gnu/linux-distributions
|
||||
smoother regulation (temp interpolation)
|
||||
other curve styles (linear, exponential)
|
||||
gui for configuration
|
||||
|
||||
If you have other wishes or want to contribute something, please let me know:
|
||||
|
@@ -324,7 +324,7 @@ function UpdateFanSpeeds {
|
||||
then pwmval=$maxpwm # over max temp, use defined max pwm
|
||||
else
|
||||
# calculate the new value from temperature and settings
|
||||
let pwmval="((${tval}-${mint})**2)*(${maxpwm}-${minso})/((${maxt}-${mint})**2)+${minso}"
|
||||
let pwmval="(${tval}-${mint})*(${maxpwm}-${minso})/(${maxt}-${mint})+${minso}"
|
||||
if [ $pwmpval -eq 0 -o $fanval -eq 0 ]
|
||||
then # if fan was stopped start it using a safe value
|
||||
echo $minsa > $pwmo
|
||||
|
@@ -390,7 +390,7 @@ sub UpdateFanSpeeds()
|
||||
{ $pwmval = MAX; }
|
||||
else
|
||||
{
|
||||
$pwmval = eval ( ($tval - $mint) / ($maxt - $mint) )**2 ;
|
||||
$pwmval = eval ( ($tval - $mint) / ($maxt - $mint) );
|
||||
$pwmval *= (255 - $minso);
|
||||
$pwmval += $minso;
|
||||
$pwmval = int($pwmval);
|
||||
|
Reference in New Issue
Block a user