Skip to content

fix fan speed scaling algorithm - #18

Closed
ghost wants to merge 1 commit into
masterfrom
unknown repository
Closed

ghost wants to merge 1 commit into
masterfrom
unknown repository

Conversation

@ghost

@ghost ghost commented Sep 29, 2025

Copy link
Copy Markdown

i dont remember exactly any more, but i've always been running with this patch

i think i had issue macfand setting a low fan speed and my settings in the conf file doesnt seem to be working properly, this pr is the hack worked (i think) for myself

if i understand correctly the intention of this code here is about:

  1. calculating the temperature window (ceiling - floor)
  2. use current temperature minus floor and divide by the window to get a "normalized" value between 0 and 1
  3. use the value to determine the fan speed to use

say i set my floor and ceiling to 20 and 30℃, window will be 10
if my current temperature is at 25℃, the math goes: 25-20=5; 5/10=0.5

so if in my conf file i have fan min and max set to 2000rpm and 3000rpm, im expecting it to give me the middle value (2500rpm)
but the code in repo currently calculate a "fan_window" by using 3000-2000=1000, and 0.5*1000 which gives me 500, not the 2500rpm i wanted

i suspect the code should be fan_min plus this 500

i figured i shouldnt remove "fan_window" entirely and just use the normalized value times fan_max, since someone might set a fan_min higher than 0, so this part of code is still necessary to be kept

fyi, im using macfand on macbookair7,2 running archlinux. (im not an experienced developer)

@ghost ghost closed this Oct 8, 2025
@ablakely

ablakely commented Dec 2, 2025

Copy link
Copy Markdown
Owner

I'm open to changes in the algorithm if they're beneficial to everyone using this.

I currently don't have a mac running linux to really test/maintain this project at the moment.

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant