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/trunk@4588 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
Jean Delvare committed 2007-07-08 10:01:50 +00:00
1 parent f51cffe559
commit fd9077bd03
4 files changed
+5 -6

No files matched your search

+1 -1
View File
@@ -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
+1 -1
View File
@@ -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);