FanControl: Add Silent fan profile (#141)

This commit is contained in:
Adravil 2023-09-02 12:29:32 +03:00 committed by Kamil Trzciński
parent 97d0e1038e
commit a561153521
3 changed files with 67 additions and 14 deletions

View file

@ -10,6 +10,7 @@ namespace CommonHelpers
public enum FanMode : uint
{
Default = 17374,
Silent,
SteamOS,
Max
}

View file

@ -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,
}
}
}
}

View file

@ -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()