AlexIII / tcc-g15

Thermal Control Center for Dell G15 - open source alternative to AWCC
GNU General Public License v3.0
368 stars 11 forks source link

Fan Curves and user configured Fail-Safe #27

Open nomeat1997 opened 1 month ago

nomeat1997 commented 1 month ago

Would it be possible to add a user configurable curve for the fan speeds ? Like a table of temp. vs fan speed ?

The problem is that I can only set a single speed. So I let the fail safe mode turn on G mode when I play games and it keeps the system cool enough. Now sometimes, the CPU spikes to high temperatures, beyond the fail safe. This causes the fans to ramp up even during casual tasks. And the fail safe mode turns off after a long time too.

It would be nice if we could configure some kind of parameter for the fail safe (like the CPU/GPU should remain beyond the fail safe temp. for X seconds) after which G mode will be turned on. Or if possible we can just use regular old fan curves.

Sorry, this is a bit of nitpick, it's just that even small tasks like opening up a word doc or browsing the web sometimes causes the CPU to spike beyond 80C and this ramps up the fans (deafeningly)

AlexIII commented 1 month ago

Hi! I think these are very useful suggestions, the fan curves and configurable delay for the fail-safe are both possible to implement. I cannot promise you when I'll have time to get back to the project, but I will definitely take a note. Cheers!

AlexIII commented 1 month ago

Added a small fix in the latest release to filter-out short temp spikes, so they shouldn't trigger fail-safe any more.

Mih-Ziv commented 1 week ago

Great idea, I think something very simple like the "curve" just being points on a graph, connected would be great, if not the best. Math seems very simple, where the program would index an array of temperatures saying:

  1. is the temp between these two temps
  2. if yes, (RPM on lower temp distance to higher temp + RPM on higher temp distance to lower temp) / distance of higher and lower temp is the goal RPM
  3. if not, just go to the next higher temp pair if binary search was implemented, it would be faster, but no one would use it with so many points that it matters

Some other benefits of this method:

(sorry for backseat programming, but I can't figure my way out from the code provided, and don't know enough python. If I knew more, I would do it myself)

pseudocode of a body of a method for calculating RPM from the arrays and the reported temperature:

Temp temp[n]
RPM rpm[n]
Temp reportedTemp
for(i from 0 to n-1){
    if(reportedTemp > temp[i] and reportedTemp < temp[i+1]){
        return rpm[i] *  ((reportedTemp-temp[i+1])/ (temp[i+1]-temp[i]))
           + rpm[i+1] * ((temp[i]-reportedTemp)   / (temp[i+1]-temp[i]));
    }
}