Almico's Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000251SpeedFanFan controlpublic2005-04-21 14:022008-05-14 11:29
Reporternightcrie 
Assigned Toalfredo 
PrioritynormalSeverityfeatureReproducibilityN/A
StatusresolvedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version4.29 
Summary0000251: Use better fan control algorithm
DescriptionThe current fan control algorithm has a slow response time and leads to fan speed oscillations when the temperature increases. A better control algorithm would be to use a PID controller and a low-pass filter on the temperature readings.
Additional InformationHere's a link to a pseudo-code snippet you can use for the algorithm: http://www.jashaw.com/pid/code2.html [^]

You would have to set some safe default values for the gain, resetrate and derivative values, but allow the user to adjust them (at least the gain).

I'm not sure how often you sample temperatures, but I think using a sampling interval of 1 second would be better for fan control. Then, you can average results every 2 seconds to filter out signal noise that would affect the derivative in the controller.

Another setting could contain the maximum % change in fan speed/second as well.

I can help you with the math/code/tuning if you are not familar with control theory.
TagsNo tags attached.
Motherboard Model
Video Card Model
Attached Files

- Relationships

-  Notes
(0000848)
flachschippe (reporter)
2005-04-23 22:19

Right on, nightcrie! (:-) In issue 196, note 659, I also suggested a different control algorithm to get rid of 'oscillations', see there. The algorithm suggested by me is not as sophisticated (simpler, to phrase it positively), but I am no controller expert. Heck, it may not even work, though I think it should.
  The main point of my suggestion is to change the fan speed smoothly. The algorithm is stateless (it uses no explicit internal feedback), the only variable is the current temperature. Feedback is still provided implicitly by the current temperature. Although it would probably also exhibit oscillations, the oscillations should be much less noticeable (because of the smooth speed changes), which is what I intended. Also because of the smooth speed changes, temperatures (and thereby the control variable) should change slower than with the current 'on-off'-style, again making the speed changes less noticeable.
(0000873)
grumbrum (reporter)
2005-05-05 22:03

Actually, I think a good algorithm could react to 3 variables to tune them:

1) CPU load %
2) current measured fan speed
3) temperature of CPU.

1) The produced CPU heat is a (linear) function of CPU load in modern PCs.

2) The air flow is a linear function of the fan rotation speed.
So if you want to increase/decrease airflow, you can do this by measuring the effect of changing the speed (in my Shuttle this is non-linear)

The temperature of the CPU is, however, a sort-of low-pass filtered version of the generated heat inside the CPU. The amount of low-pass filtering is primarily dependant on the amount of metal in your cooling block, and whether you have heat pipes.
The total surface area of the cooler block combined with the airflow speed determines how much energy can be dissipated per time unit.

So if you know your cpu load upfront, you can make a pretty good prediction what the temperature change will be in a few seconds.

The trick is that such an algorithm would need to self-adapt to every different type of cooler and CPU load vs. temperature ratio.



If you look at it from a thermal point of view, I would guess you get the best results if you would increase the fan speed in conjunction with CPU load.
(0000876)
nightcrie (reporter)
2005-05-06 03:20

Actually, this lag effect in the temperature is taken care of in a PID controller with the D term. It "predicts" where the temperature will be in the future and will speed up the fan ahead of time.

Using the CPU load is tough since every CPU is different and you have to account for Speedfan and new Athlon64/PentiumM CPUs will change their CPU frequency constantly so there is little direct correlation between CPU load and watts of heat produced. Using a PID controller, you don't need to worry about any of this.
(0000881)
alfredo (manager)
2005-05-07 09:34

Temps are sampled every 3 seconds. I'm working on this, but you should consider that SpeedFan is able to control every single SPEED based on multiple input temperatures. Currently it takes into consideration the TREND for each temperature and checks it. SpeedFan won't lower any fan speed unless all the temperatures linked to any SPEED are lowering.
(0003549)
alfredo (manager)
2008-05-14 11:29

Now SpeedFan uses hysteresis.

- Issue History
Date Modified Username Field Change
2005-04-21 14:02 nightcrie New Issue
2005-04-23 22:19 flachschippe Note Added: 0000848
2005-05-05 22:03 grumbrum Note Added: 0000873
2005-05-06 03:20 nightcrie Note Added: 0000876
2005-05-07 09:34 alfredo Note Added: 0000881
2005-05-07 09:34 alfredo Status assigned => acknowledged
2008-05-14 11:29 alfredo Note Added: 0003549
2008-05-14 11:29 alfredo Status acknowledged => resolved
2008-05-14 11:29 alfredo Resolution open => fixed
2008-05-14 11:29 alfredo Fixed in Version => 4.29


Copyright © 2000 - 2018 MantisBT Team
Time: 0.1664 seconds.
memory usage: 8,071 KB
Powered by Mantis Bugtracker