diff --git a/CommonHelpers/GlobalConfig.cs b/CommonHelpers/GlobalConfig.cs index 22cbf92..83161ed 100644 --- a/CommonHelpers/GlobalConfig.cs +++ b/CommonHelpers/GlobalConfig.cs @@ -10,6 +10,7 @@ namespace CommonHelpers public enum FanMode : uint { Default = 17374, + Silent, SteamOS, Max } diff --git a/FanControl/FanControllerSensors.cs b/FanControl/FanControllerSensors.cs index d7d823d..d5df406 100644 --- a/FanControl/FanControllerSensors.cs +++ b/FanControl/FanControllerSensors.cs @@ -1,11 +1,6 @@ using CommonHelpers; using LibreHardwareMonitor.Hardware; -using System; -using System.Collections.Generic; using System.ComponentModel; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace FanControl { @@ -40,6 +35,13 @@ namespace FanControl MinRPM = 1500 } }, + { + FanMode.Silent, new FanSensor.Profile() + { + Type = FanSensor.Profile.ProfileType.Constant, + MinRPM = 1500 + } + }, } } }, @@ -64,7 +66,18 @@ namespace FanControl B = -188.6f, C = 5457.0f } - } + }, + { + FanMode.Silent, new FanSensor.Profile() + { + Type = FanSensor.Profile.ProfileType.Exponential, + MinInput = 55, + MaxInput = 93, + A = 1.28f, + B = 60f, + C = 3000f + } + }, } } }, @@ -89,7 +102,18 @@ namespace FanControl B = -188.6f, C = 5457.0f } - } + }, + { + FanMode.Silent, new FanSensor.Profile() + { + Type = FanSensor.Profile.ProfileType.Exponential, + MinInput = 55, + MaxInput = 93, + A = 1.28f, + B = 60f, + C = 3000f + } + }, } } }, @@ -114,6 +138,19 @@ namespace FanControl Ki = -20, Kd = 0 } + }, + { + FanMode.Silent, new FanSensor.Profile() + { + Type = FanSensor.Profile.ProfileType.Pid, + MinInput = 30, + MaxInput = 70, + MaxRPM = 3000, + PidSetPoint = 70, + Kp = 0, + Ki = -20, + Kd = 0 + } } } } @@ -137,6 +174,17 @@ namespace FanControl MinRPM = 0, MaxRPM = 2000, } + }, + { + FanMode.Silent, new FanSensor.Profile() + { + // If battery goes over 40oC require 2kRPM + Type = FanSensor.Profile.ProfileType.Constant, + MinInput = 0, + MaxInput = 40, + MinRPM = 0, + MaxRPM = 2000, + } } } } diff --git a/FanControl/FanSensor.cs b/FanControl/FanSensor.cs index 6392187..8683b20 100644 --- a/FanControl/FanSensor.cs +++ b/FanControl/FanSensor.cs @@ -1,12 +1,6 @@ using CommonHelpers; using LibreHardwareMonitor.Hardware; -using System; -using System.Collections.Generic; using System.ComponentModel; -using System.Linq; -using System.Security.Policy; -using System.Text; -using System.Threading.Tasks; namespace FanControl { @@ -36,7 +30,8 @@ namespace FanControl { Constant, Quadratic, - Pid + Pid, + Exponential } public ProfileType Type { get; set; } @@ -78,6 +73,10 @@ namespace FanControl case ProfileType.Pid: rpm = calculatePidRPM(input); break; + + case ProfileType.Exponential: + rpm = calculateExponentialRPM(input); + break; } if (input < MinInput) @@ -119,6 +118,11 @@ namespace FanControl return pidP + pidI + pidD; } + + private float calculateExponentialRPM(float input) + { + return (float)(Math.Pow(A, input - B) + C); + } } public void Reset()