compute fan speed within fan_min and fan_max

The computed fan speeds had an error in their calculations.  They were effectively setting fan speeds between 0 and (fan_max - fan_min).  These changes correct the calculations to set fan speeds between fan_min and fan_max.