Jump to content

FanControl, my take on a SpeedFan replacement

11 hours ago, McsGone said:

Hi, first of all I wanted to thank you for the time spent creating this app (or at least making it available to all of us).

I had been using Argus Monitor previously but it just had too many settings and configurations that I didn't even need in the first place, besides also behaving strangely with my Navi GPU fan curve.

Whereas your program is simple and intuitive.

I just wanted to ask you whether it'd be possible to implement a longer activation time for the fan curves, since right now the maximum is 15s which makes my CPU cooler rev each time I open up a program (temp spikes of 10C are a regular thing on Ryzen I guess).

With Argus the maximum activation time was 60s, which was perfect in order to not have the continuous revving whenever the CPU temp spiked for only half a minute or so.

Thank you!

The response time right now works both directions, up or down. I guess the way you would want it to work is up only right?

Link to comment
Share on other sites

Link to post
Share on other sites

I had problems registering for the startup task, but I ran it as administrator and now it works perfectly. You can add that as a tip for if it isn't working! 

The only thing I'd mind being added is fan control over the graphics card, but I guess that also depends on LibreHardwareMonitor support...

 

Link to comment
Share on other sites

Link to post
Share on other sites

13 hours ago, Rem0o said:

The response time right now works both directions, up or down. I guess the way you would want it to work is up only right?

I don't understand what you mean by "working up and down".

Basically what I was asking for was the option to select a longer response time; let's say 60 seconds, so that in case of temp spikes and fluctuations (which happen a lot with Ryzen) the fans don't speed up until after 60 seconds of temperatures staying high (being the case in which you're actually running a game or a heavy program and you'd want the RPM to increase).

 

Right now the maximum response time that I can select is 15 seconds.

Link to comment
Share on other sites

Link to post
Share on other sites

21 minutes ago, McsGone said:

I don't understand what you mean by "working up and down".

Basically what I was asking for was the option to select a longer response time; let's say 60 seconds, so that in case of temp spikes and fluctuations (which happen a lot with Ryzen) the fans don't speed up until after 60 seconds of temperatures staying high (being the case in which you're actually running a game or a heavy program and you'd want the RPM to increase).

 

Right now the maximum response time that I can select is 15 seconds.

What I meant by up and down was that it takes let say 15 seconds for the fans to start spinning faster when the temperature goes up and then 15 seconds for the fans to spin down when the temperature goes down. That is the current behavior. I was was wondering if that behavior would still be alright in the context of 60 seconds.

Link to comment
Share on other sites

Link to post
Share on other sites

10 minutes ago, Rem0o said:

What I meant by up and down was that it takes let say 15 seconds for the fans to start spinning faster when the temperature goes up and then 15 seconds for the fans to spin down when the temperature goes down. That is the current behavior. I was was wondering if that behavior would still be alright in the context of 60 seconds.

Ah yes, I understand now.

Yes, I wouldn't change anything related to that part; I think it's perfect as it is now.

All I needed was the option to select a higher value for the response time :P

Link to comment
Share on other sites

Link to post
Share on other sites

I've made progress -- "proof of concept" -- toward using custom software to manipulate FanControl so that the SMART temperature of my USB-connected external hard drive will be the source temperature for controlling the speed of the external fan that cools my external drive. (The external fan is cabled to a motherboard fan header, which FanControl is capable of controlling.)

 

Step 1 was to verify that two separate copies of FanControl can run at the same time.  One copy controls the speed of the external fan, and the other controls the speeds of the internal fans.  The two copies of FanControl are stored in different folders (to minimize possible collisions that only Rem0o would know about since his software isn't open source).  It seems to work okay this way.  Attached below is a screencapture that shows the two FanControl windows running side by side.

 

Step 2 was to verify that a Windows Task Scheduler task that runs the external fan's FanControl copy can be started and ended and restarted.  To be able to end the task, it was necessary to modify the properties of the task created by Rem0o's Register_Startup_Task.cmd.  In the properties' Actions tab I removed the "cmd /c /d ... START /NORMAL" from the action, so the action is simply C:\FanControl\ExternalFan\FanControl.exe, and to be safe I typed the path C:\FanControl\ExternalFan\ into the Start In field.  Removing cmd from the action allows Windows Task Scheduler to end the running FanControl task, which it couldn't do while the task was cmd. (Another advantage of removing cmd from the action is that a cmd window doesn't annoyingly briefly display when the task starts.)  Also, in the properties' Settings tab I unchecked the box that says to stop the task if it runs longer than 3 days.

 

Step 3 was to copy FanControl to multiple folders (C:\FanControl\ExternalFan0\, C:\FanControl\ExternalFan1\, C:\FanControl\ExternalFan2\, etc), each configured with a different flat curve, and to create a corresponding Windows Task Scheduler task for each copy.  These tasks will be started and ended so only one at a time will run.  The task chosen to run will be the one that has the flat speed curve appropriate for the external drive's temperature.  I verified that I could end a running External Fan FanControl task and start a different one, with no noticeable problems.

 

What remains to be done is to write custom software, such as a cmd script, that will periodically read the SMART temperature of the external drive (I will use the smartctl.exe utility supplied with Smartmontools to read the temperature) and then end the running External Fan task if its flat speed curve is inappropriate for the temperature, and start the External Fan task that has the appropriate flat speed curve.

 

The FanControl copy that controls only the internal fans won't need to be ended or restarted, since FanControl is sufficient for that purpose.  It can be started with Windows and allowed to run forever.

 

As suggested two days ago in a post by secu9k, I'd like someday to design my custom script to maintain the external hard drive at a desired target temperature (perhaps 35C).  Rem0o's reply suggests this is difficult to accomplish.  I'll guess the difficulty in the case of a hard drive would be the long lag time between change of fan speed and effect on drive temperature, and part of the solution may be to change the fan speed no more frequently than every few minutes, to give the drive time to reach equilibrium between changes.  Software that learns from experience, like neural nets and evolutionary software do, might be worth exploring, to learn how to avoid overshooting the target with a fan speed allowed to run too long, and to learn about points of diminishing return (fan speeds that aren't much more effective at cooling than slower speeds are).  Having an ambient temperature sensor might help since ambient temperature could be a significant factor in determining the appropriate fan speed; a reasonable substitute for an ambient temperature sensor might be a website that provides a local weather api.  Another wild idea, for the situation when the drive is cooler than desired, is to warm the drive by making it run a background selftest, and aborting the selftest when the target temperature is reached. (Note that a background selftest is a low priority task that won't interfere with the drive responding to read & write requests. See https://www.thomas-krenn.com/en/wiki/SMART_tests_with_smartctl)

Two FanControls (screencapture 2020-06-19, 16 colors).png

Link to comment
Share on other sites

Link to post
Share on other sites

Can the user turn off FanControl's automatic update checking?  I don't see a way.

Link to comment
Share on other sites

Link to post
Share on other sites

I completed my .bat file that reads the SMART temperature of my external USB-connected hard drive and manipulates FanControl into controlling the speed of the external fan that cools the external drive.  Below are three screencaptures.

 

The .bat file also keeps a log that records changes of the external drive's temperature.  Since the drive temperature has fluctuated only once during the time that the .bat has been running, the log has only two entries so far:

Quote

Date,Time, Celsius
06/20/2020,14:03:19.18, 30
06/20/2020,14:12:18.71, 31

 

The only issue I've seen so far is that ending a FanControl task briefly flashes a FanControl error message window about an unexpected error.  The error window disappears a moment later as the task is finally terminated.  It would be nice if FanControl had a setting so it wouldn't display the error message or log the error, or if FanControl delayed displaying & logging the error for a second or so, so that it will be terminated before it displays & logs. (Alternatively, I could try running FanControl as a hidden task to see if that prevents the error window flash, but it might make the tray icon and/or gui unavailable, and I assume it wouldn't prevent the unwanted logging.  I suppose I could deal with the unwanted logging by having the .bat file copy the log, then end the task, and then overwrite the changed log with the copy.)  For reference, here's the portion of the FanControl log for one of those FanControl task end errors, which includes two timestamped entries:

Quote

6/20/2020 2:02:57 PM: The process cannot access the file 'C:\FanControl\ExternalFanFLAT0\CACHE' because it is being used by another process.
6/20/2020 2:02:57 PM:    at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   at System.IO.StreamWriter.CreateFile(String path, Boolean append, Boolean checkHost)
   at System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding, Int32 bufferSize, Boolean checkHost)
   at System.IO.File.InternalWriteAllText(String path, String contents, Encoding encoding, Boolean checkHost)
   at FanControl.Domain.ApplicationContext.SaveCacheState()

Attached below are three screencaptures.  (1) The first screencapture shows my .bat file running in a CMD window, alongside the fanspeed=0 FanControl app that the .bat file started by launching its corresponding Windows Task Scheduler task.  The .bat file reads the external drive temperature every minute, and checks whether the currently running FanControl task is the appropriate fanspeed.  If not, it ends the currently running FC task and starts the appropriate FC task.  Since the drive temperature has remained below the 32C "coolest temperature to be allowed" the .bat file hasn't yet had to end the fanspeed=0 task and start a different fanspeed task.

1515629453_ExternalFanController.batandarunningFanControltask(screencapture2020-06-2016colors).thumb.png.e1c57f91dff8600a7787b0c614a097b4.png

(2) The second screencapture shows some of the Windows Task Scheduler setup.  I defined a task for the internal fans that always runs, plus an external fan speed=0 task to run if the external drive temperature is 32C or less, plus a task to run if the external drive is 33C, plus a task to run if the external drive is 34C, plus a 100% fan speed task to run if the external drive exceeds 34C.  Eventually I'll add more tasks to cover an external drive temperature range from 32C to 39C instead of 32C to 34C.

599643103_FanControltasksinWindowsTaskScheduler(screencapture2020-06-2016colors).thumb.png.b915044ce4e04213e425b49c7e8e4dca.png

(3) The third screencapture shows the multitude of FanControl folder copies, plus the .xml task files exported from Windows Task Scheduler. (It's not necessary to export the tasks, but they make it easier to create new similar tasks.)

355858545_FanControlfoldersandexportedtasks(screencapture2020-06-2016colors).thumb.png.e916126daebdbba549393f911bc82525.png

Link to comment
Share on other sites

Link to post
Share on other sites

UPDATE 1: I wrote yesterday about a briefly flashing error window and corresponding error log entry when a FanControl task is stopped.  But I haven't observed that behavior while the tasks are being controlled by my .bat script (which starts and ends tasks so that only one at a time runs).  So I assume FanControl wasn't responsible for it yesterday.  I'll attribute it to sloppy manual experimentation with Windows Task Scheduler fancontrol tasks yesterday; perhaps I had a second instance of the same FanControl copy running, and didn't realize it was running... maybe it was running as a hidden task.

 

UPDATE 2: There appears to be a minor bug in FanControl that I assume would be easy for Rem0o to fix.  When a copy of FanControl that has a 0% flat curve is launched, FanControl first revs up the speed of the fan to 80% and then drops it to 0%.  Presumably 0% could be achieved without spinning up the fan first.  FanControl doesn't spin up the fan with a 1% flat curve and activation% less than or equal to 1% (and 0 offset), which also achieves 0 rpm, so I'm working around the bug by using a 1% flat curve with a 1% fan activation setting. [EDIT: I found the 1% 1% flat curve and activation didn't consistently solve the problem.  So I increased the step size to the maximum 50% (and set the flat curve and activation back to 0 0) and that appears to mitigate the problem by preventing the fan speed from getting annoyingly fast/loud.  It reaches only about 500rpm this way, before the big step size quickly drops it down to 0 rpm.]  Here are the results of several experiments I did today, which all show that a newly-launched FanControl always revs up the fan first when it calculates the target % should be 0, but doesn't when it calculates the target % should be 1:

Quote

FlatCurve%   Activation%   Offset%   RevProblem?
0  0   0   Y
0  0  -5   Y
0  1   0   Y
0  1  -5   Y
1  0   0   N
1  0  -1   Y
1  1   0   N

1  1  -1   Y
1  2   0   Y

 

Edited by Adrenalina
Updated: Discovered 1% 1% didn't consistently solve problem, but 50% stepsize helps.
Link to comment
Share on other sites

Link to post
Share on other sites

Attached below is a screenrecording that shows my External Fan Controller .bat software in operation... stopping and starting copies of FanControl that each have a different flat curve.  To make it interesting, I provided the .bat with a command-line parameter DEBUG that causes it to ignore the drive's actual temperature and simulate a randomly varying temperature in the range of 31C to 40C. (The drive's actual temperature is boringly low and stable.)  Another FanControl task, which controls only the internal fans, can also be seen to have its task running.

 

The screenrecording shows several windows: (1) Windows Task Scheduler, (2) a small HWiNFO windows that displays the external fan speed and external drive's temperature, (3) the folder where the log is written, and occasionally (4) the log opened so you can see its entries of simulated temperatures. 

 

The video is 4 mins 48 seconds long.  If you watch it, follow the mouse cursor movements to understand what's happening.  Initially, only the FanControl task for the internal fans is running.

 

I recorded the screen at 10 frames per second using OBS Studio (free and open source) and compressed it afterward using Avidemux (free and open source) with x264 at 30kbits/second.  Of course, I plan to post the .bat file here (free and open source).

 

 

External Fan Controller screenrecording (simulated randomly varying external drive temperature) x264 1280x720 30k - 2020-06-21 10-50-18.mkv

Edited by Adrenalina
Replaced the 848x480 grayscale video with 1280x720 color
Link to comment
Share on other sites

Link to post
Share on other sites

3 hours ago, Adrenalina said:

UPDATE 2: There appears to be a minor bug in FanControl that I assume would be easy for Rem0o to fix.  When a copy of FanControl that has a 0% flat curve is launched, FanControl first revs up the speed of the fan to 80% and then drops it to 0%.  Presumably 0% could be achieved without spinning up the fan first.  FanControl doesn't spin up the fan with a 1% flat curve and activation% less than or equal to 1% (and 0 offset), which also achieves 0 rpm, so I'm working around the bug by using a 1% flat curve with a 1% fan activation setting.  Here are the results of several experiments I did today, which all show that a newly-launched FanControl always revs up the fan first when it calculates the target % should be 0, but doesn't when it calculates the target % should be 1:

 

Did some testing, and the behavior is that when Fan Control isn't running, the fan goes to the BIOS setting. In my case, it is 60%. So when I start Fan Control, its starting point is 60%. Since I use a 5%/sec step, it then goes to 55%, 50% and so on until it hits its target. If you got a Flat curve at 0%, it won't start directly at that %.

Link to comment
Share on other sites

Link to post
Share on other sites

15 minutes ago, Rem0o said:

Did some testing, and the behavior is that when Fan Control isn't running, the fan goes to the BIOS setting. In my case, it is 60%. So when I start Fan Control, its starting point is 60%. Since I use a 5%/sec step, it then goes to 55%, 50% and so on until it hits its target.

Thanks.  When I have an opportunity, I'll check my BIOS to see how I have it set.  I presume it's set at speed 0 or disabled, since the external fan rpm is 0 when I'm not running FanControl.

 

Are you saying FanControl reads the BIOS speed setting, and that it pays attention to the BIOS speed even if the BIOS control over the fan is disabled?  Perhaps I have the BIOS control disabled but set to 80%.

 

The issue I mentioned is that when FanControl is launched, it raises the fan speed to 80% even though the target speed 0% matches the fan's speed prior to launch.  I found about an hour ago that increasing the stepsize to the maximum, 50%, reduces how fast the fan gets when FanControl launches with the 0% flat curve.  Instead of reaching 80% before dropping to 0%, the 50% step causes it to reach only about 30% before dropping to 0%, and it drops to 0% much more quickly.

 

Note: the fan doesn't reach 80% if FanControl is launched with a flat curve that has its target speed at least the fan's activation speed.  So the behavior with the 0% flat curve is counter-intuitive.

 

Edited by Adrenalina
Noted that the issue only happens with flat curve speed below activation speed.
Link to comment
Share on other sites

Link to post
Share on other sites

2 minutes ago, Adrenalina said:

Thanks.  When I have an opportunity, I'll check my BIOS to see how I have it set.  I presume it's set at speed 0 or disabled, since the external fan rpm is 0 when I'm not running FanControl.

 

Are you saying FanControl reads the BIOS speed setting, and that it pays attention to the BIOS speed even if the BIOS control over the fan is disabled?  Perhaps I have the BIOS control disabled but set to 80%.

 

The issue I mentioned is that when FanControl is launched, it raises the fan speed to 80% even though the target speed 0% matches the fan's speed prior to launch.  I found about an hour ago that increasing the stepsize to the maximum, 50%, reduces how fast the fan gets when FanControl launches with the 0% flat curve.  Instead of reaching 80% before dropping to 0%, the 50% step causes it to reach only about 30% before dropping to 0%, and it drops to 0% much more quickly.

 

Yes, it reads the controller's value prior to Fan Control taking over.  Perhaps your BIOS is doing some weird stuff with a control mode where the value is 80% even though it is shut off.

Link to comment
Share on other sites

Link to post
Share on other sites

2 minutes ago, Rem0o said:

Yes, it reads the controller's value prior to Fan Control taking over.  Perhaps your BIOS is doing some weird stuff with a control mode where the value is 80% even though it is shut off.

If that's the cause, why doesn't it go to 80% for any of my other flat curves (which have target speeds greater than the fan activation speed)?

Link to comment
Share on other sites

Link to post
Share on other sites

13 minutes ago, Adrenalina said:

If that's the cause, why doesn't it go to 80% for any of my other flat curves (which have target speeds greater than the fan activation speed)?

Are you running the latest version?

Link to comment
Share on other sites

Link to post
Share on other sites

1 hour ago, Rem0o said:

Are you running the latest version?

Yes, I think so.  Updated yesterday to version 34.

Link to comment
Share on other sites

Link to post
Share on other sites

Here are two more screenrecording videos that show my External Fan Controller .bat running unhidden in an ordinary window instead of as a hidden Windows Task Scheduler task.  The display output of the .bat may help people understand what it does behind the scenes. 

 

The first recording shows how the .bat handles the external drive's real temperature. This isn't very dynamic (which is why there's a second recording).  It starts the 0% flat curve copy of FanControl and doesn't need to stop it because the drive temperature stays low. 

 

About 1 minute into the first video, the FanControl speed bug that Rem0o and I have been discussing today can be observed.  The external fan's speed is 0 rpm with no FanControl running, and when the FanControl with 0% flat curve is launched the fan speed mysteriously increases for a moment before settling to 0 rpm. (I have the stepsize at 50%; the large stepsize appears to reduce the magnitude of the problem in two ways: the speed doesn't peak as high -- which seems counter-intuitive -- and the speed returns more quickly to 0 rpm -- which seems intuitively expected.)

 

In the second recording, the DEBUG command-line parameter is used to show how the .bat stops and starts different flat curve copies of FanControl in response to varying "temperatures" (simulated pseudo-randomly in the range 31C to 40C).  The second recording also uses a 20 seconds loop duration command-line parameter instead of 60 so the random temperatures and responses are more rapid.  If you have sharp eyes, you'll notice the often-spinning external fan eventually has an effect on the external drive's temperature: at about 3 minutes, the drive temperature decreases from 32C to 31C.

 

Like my earlier video, these have no narration and no subtitles, but the mouse cursor points out things of interest.

 

External Fan Controller screenrecording, .bat not hidden (real drive temperature) x264 1280x720 30k - 2020-06-21 13.08.mkv

External Fan Controller screenrecording, .bat not hidden (simulated randomly varying external drive temperature) x264 1280x720 50k - 2020-06-21 13.16.mkv

 

 

Edited by Adrenalina
Replaced videos with versions compressed to 30 kbps, much smaller but similar quality
Link to comment
Share on other sites

Link to post
Share on other sites

I'm having a rather bizarre problem. I can control all fans and pump, even CPU fans (Noctuas), except 2 fans connected to the Fan 4 and 5 headers of the motherboard. The fans are from NZXT, but I can control 1 of them (I have 3). When I set a fan curve to them they simply return to the default 56% from the bios. I configured the Bios to manual (I didn't find any "off" setting) and they still go back to default. I don't have other software running, only MSI Afterburner. I closed it and tried again and still couldn't controll the fans.

 

My motherboard is Z370 Gigabyte Gaming 7.

 

Edit: my bios is like this one:

 

Link to comment
Share on other sites

Link to post
Share on other sites

1 hour ago, RonDamon said:

I don't have other software running, only MSI Afterburner. I closed it and tried again and still couldn't control the fans.

Did you try closing and re-launching FanControl AFTER you closed Afterburner?  Did you try restarting the computer with Afterburner set not to automatically start?  Does Afterburner have a driver that stays loaded even if Afterburner isn't loaded? (These are just questions that come to mind; I don't know Afterburner and I'm not promising any of these questions will lead to the solution.)  If you don't mind uninstalling Afterburner, that would be one way to ensure it's not the issue.

 

You might also try setting the BIOS control to 0 rpm, to see if that has an effect.  If the fan speed still continues to go to 56% it would suggest the BIOS isn't involved.

Edited by Adrenalina
Added thoughts about the BIOS fan control
Link to comment
Share on other sites

Link to post
Share on other sites

46 minutes ago, Adrenalina said:

Did you try closing and re-launching FanControl AFTER you closed Afterburner?  Did you try restarting the computer with Afterburner set not to automatically start?  Does Afterburner have a driver that stays loaded even if Afterburner isn't loaded? (These are just questions that come to mind; I don't know Afterburner and I'm not promising any of these questions will lead to the solution.)  If you don't mind uninstalling Afterburner, that would be one way to ensure it's not the issue.

 

You might also try setting the BIOS control to 0 rpm, to see if that has an effect.  If the fan speed still continues to go to 56% it would suggest the BIOS isn't involved.

If I set the BIOS do 0 my fan stops, yes. The only fan that I can control with the Fancontrol is the System 3 (besides the CPU fans and pump). The other 2 from the System 4 and 5 I can't. The funny thing is that the S3 fan is with the same settings in bios than S4 and 5, so it was supposed to work like S3.

Link to comment
Share on other sites

Link to post
Share on other sites

5 minutes ago, RonDamon said:

If I set the BIOS do 0 my fan stops, yes. The only fan that I can control with the Fancontrol is the System 3 (besides the CPU fans and pump). The other 2 from the System 4 and 5 I can't. The funny thing is that the S3 fan is with the same settings in bios than S4 and 5, so it was supposed to work like S3.

I think there were some similar messages earlier in this thread, and if so, and if my memory is correct, the explanation was that the openhardwaremonitor or librehardwaremonitor library that FanControl uses doesn't yet fully understand all motherboard chipsets, and some chipset manufacturers don't make enough info available.  You might want to skim the 19 pages of messages; it would probably take about 10 minutes.

 

Can we infer there is no Sys 6 fan on your motherboard?  Assuming so, the fact that the highest numbered fan headers are the ones not working is consistent with the theory that the cause is the incompleteness of the library's understanding of the chipset.

Link to comment
Share on other sites

Link to post
Share on other sites

8 minutes ago, Adrenalina said:

I think there were some similar messages earlier in this thread, and if so, and if my memory is correct, the explanation was that the openhardwaremonitor or librehardwaremonitor library that FanControl uses doesn't yet fully understand all motherboard chipsets, and some chipset manufacturers don't make enough info available.  You might want to skim the 19 pages of messages; it would probably take about 10 minutes.

 

Can we infer there is no Sys 6 fan on your motherboard?  Assuming so, the fact that the highest numbered fan headers are the ones not working is consistent with the theory that the cause is the incompleteness of the library's understanding of the chipset.

It has to be that, then. I'm thinking about using a 2-way splitter just to control my radiator fans in the system 3 connection. It'll probably work.

Link to comment
Share on other sites

Link to post
Share on other sites

57 minutes ago, RonDamon said:

If I set the BIOS do 0 my fan stops, yes. The only fan that I can control with the Fancontrol is the System 3 (besides the CPU fans and pump). The other 2 from the System 4 and 5 I can't. The funny thing is that the S3 fan is with the same settings in bios than S4 and 5, so it was supposed to work like S3.

According to this review: https://www.tweaktown.com/reviews/8377/gigabyte-z370-aorus-gaming-7-motherboard-review/index4.html, you got a IT8795E for fan control, which is not mapped specifically from the ITE chip list in OpenhardwareMonitor. You thus got a "generic" support for it.
image.png.381d4bebfc1e01be236b65a3c2a24372.png
 

Link to comment
Share on other sites

Link to post
Share on other sites

Below is my .bat file that manages multiple copies of FanControl in order to control the speed of an external fan based on the temperature of a USB-connected external drive.  The external fan must be cabled to a fan header that FanControl understands how to control.

 

To control your internal fans, use a separate copy of FanControl (or your BIOS).  That copy of FanControl must not have the control for the external fan enabled, and the copies that control the external fan should have only the external fan enabled.

 

To use this .bat you need to manually create a Windows Task Scheduler task for each copy of FanControl that has control of the external fan enabled, so that this .bat can stop and start the FanControl tasks to run one at a time.  The task definitions are based on the one created by Rem0o's "Register_Startup_Task.cmd" but need to be modified as described in my earlier message dated Friday June 19 2020 1:38pm (EDT).  Make sure the tasks that will control the external fan have no automatic triggers, so that only the .bat file will start them.

 

For my external drive (a WD Red hard drive) I defined a desired temperature range of 32C to 39C, so the fan will spin at 0% at 32C and below, 100% at 40C or above, and monotonic in between.  I made a copy of FanControl for each temperature in the 32-39 range, plus a copy for 100%, and a task for each copy.

 

Each copy of FanControl should be configured with a different flat curve, one FanControl copy for each degree Celsius in your desired range of temperatures, plus the FanControl copy with a 100% flat curve for temperatures that exceed your desired range.  For example, if you want to have 0 rpm when the drive is at 32C or below, the task that has its name ending with "32" should run the copy of FanControl that you would configure with a 0% flat curve.  The task that runs the copy configured with the 100% flat curve should have its name end with "FULLSPEED". 

 

Here are two screencaptures that may help.  The first shows my tasks in Windows Task Scheduler, in a Task Scheduler folder named "FanControl tasks".  The second shows the Action tab of the Properties of one the tasks.

1542157184_FanControl-WindowsTaskScheduler-screencapture(16colors).thumb.png.5fcfb8956d4e33d482f27e103b91f426.png

 

554667844_FanControl-WindowsTaskSchedulertaskproperties-screencapture(16colors).thumb.png.972d9801632041c214cfeea23fc3c62b.png

 

You also need to have a copy of smartctl.exe (a utility that's part of the free Smartmontools) for this .bat to run, to periodically read the external drive's temperature.

 

You'll probably want to create a Windows Task Scheduler task that triggers this .bat file each time Windows starts.  That task wouldn't need high privilege.

 

Near the top of the .bat file is a section you must customize for your system: the volume label of the external drive, some folder locations, etc.

 

The line about "Usage" assumes the .bat file is named ExternalFanControl.bat but you could name it whatever you want.

 

Okay, here's the .bat file:

@echo off

set BATNAME=ExternalFanControl
set BATVER=1.2
rem  Usage: ExternalFanControl [LoopDuration] [SIM]
rem     The loop duration is the frequency to read the drive temperature, specified in seconds (default 60).
rem     If parameter SIM is provided, a randomly varying drive temperature will be simulated.
rem  You'll probably want to make a Windows Scheduler Task to automatically trigger this whenever Windows starts.
rem
rem  CHANGELOG: Changed DEBUG command-line parameter to SIM, and allow parameters in any order.
rem             Expect the Windows tasks to be in a Task Scheduler folder named "FanControl tasks".

REM ===============================================================================
rem  IN THIS SECTION ARE SETTINGS YOU MUST CUSTOMIZE FOR YOUR SYSTEM:

rem  The volume label (without the colon) of the external drive to be cooled:
   set "EXTERNALDRIVE=D"
rem  The ramdisk volume, or some other writeable location, for a temporary file:
   set "TMPDIR=R:"
rem  The folder where smartctl.exe is located:
   set "PROGDIR=C:\Smartmontools"
rem  The folder where the temperature&fanspeed log will be written (and be
rem     sure to manually create that folder before running this software):
   set "LOGDIR=N:\FanControl\Logs"

rem  The folder in Windows Task Scheduler where you defined all the flat curve tasks:
   set "SchedulerFolder=\FanControl tasks\"
rem  The common prefix portion of each of the flat curve tasknames:
   set "TaskPrefix=FanControl - External Fan - "
rem  The desired temperature range, in degrees Celsius, for the external drive:
   set /A "ColdestTemperature=32, WarmestTemperature=39"
rem  A FanControl task must exist for each degree in the above range of temperatures,
rem     with the taskname suffix matching the temperature, and another task must
rem     exist that has FULLSPEED as the suffix in its name.
rem  The corresponding FanControl copies should be configured to 0% at ColdestTemperature,
rem     100% (the FULLSPEED copy) when exceeding WarmestTemperature, and monotonic in between.
rem  The tasks should have no automatic trigger; let this .bat start and stop them so only one at a time runs.
rem  The tasks must have highest privileges so that FanControl can control the motherboard's fan speed header.

REM ========= (end of customization section) =======================

set "FanTaskName=%SchedulerFolder%%TaskPrefix%"

rem  Default parameters that command-line can override:
set LOOPSECONDS=60
set SimTemp=N

rem  Allow FanControl 5 seconds to gracefully exit when its task is ended:
set ENDSECONDS=5

set /A "_Seconds=0"
if NOT [%1]==[] set /A "_Seconds+=%1"
if NOT [%2]==[] set /A "_Seconds+=%2"
if NOT [%3]==[] set /A "_Seconds+=%3"
if %_Seconds% GTR 0  set /A "LOOPSECONDS=_Seconds"
if [%1]==[SIM]  set SimTemp=Y
if [%2]==[SIM]  set SimTemp=Y
if [%3]==[SIM]  set SimTemp=Y

TITLE %BATNAME%_v%BATVER% [%ColdestTemperature%C..%WarmestTemperature%C] [%LOOPSECONDS% seconds] fan for %EXTERNALDRIVE%:
set "SNAPFILE=%TMPDIR%\%BATNAME%_%LOOPSECONDS%seconds.txt"
if exist %SNAPFILE%  del /Q %SNAPFILE%

set "PROG=%PROGDIR%\smartctl.exe"
if not exist "%PROG%" (
   echo Aborting: '%PROG%' not found.
   EXIT /B 1
)
rem  Embed the start date & time in the log filename:
set datetime=%date:~10,4%.%date:~4,2%.%date:~7,2%-%time:~0,2%%time:~3,2%%time:~6,2%
set datetime=%datetime: =0%
set "LOG=%LOGDIR%\%BATNAME%%BATVER%_%datetime%_[%LOOPSECONDS%_seconds].LOG"
echo Snap[%SNAPFILE%]
echo Log[%LOG%]
echo Date,Time, Celsius>> %LOG%

setlocal enabledelayedexpansion

set /A "PrevTemp=999, PrevTask=999"

rem  INFINITE LOOP:
FOR /L %%G in (0,0,0) do (
   rem  Use smartctl to read the temperature of the external drive:
   for /f "delims=" %%g in ('%PROG% -A %EXTERNALDRIVE%: ^| findstr /R Temperature_Celsius' ) do set "line=%%g"
   set Celsius=!line:~87,2!
   rem  For testing, simulate temperature that randomly varies in [ColdestTemperature-1 .. ColdestTemperature+5] or 99C:
   if %SimTemp%==Y (
      for /F "tokens=1-4 delims=:." %%a in ("!time!") do set /A "RandDigit=(1%%d-100)%%10"
      if !RandDigit! LEQ 6  (
         set /A "Celsius=ColdestTemperature+RandDigit-1"
      ) else (
         set /A "Celsius=99"
   )  )
   set Datestamp=!date:~4!
   set Timestamp=!time: =!
   echo !Datestamp! !Timestamp!   !Celsius! > %SNAPFILE%

   set /A "PauseTime=LOOPSECONDS"

   rem  If temperature changed, log the temperature and control the fan speed:
   if !Celsius! NEQ !PrevTemp! (
      rem  Calculate which fan task is appropriate for the temperature:
      if !Celsius! LEQ !ColdestTemperature! (
         set /A "FanTask=ColdestTemperature"
      ) else (
         if !Celsius! GTR !WarmestTemperature! (
            set "FanTask=FULLSPEED"
         ) else (
            set /A "FanTask=Celsius"
      )  )
      rem  Check whether running fan task is the appropriate task, and if not, end running task and start appropriate task:
      if !FanTask! NEQ !PrevTask! (
         if !PrevTask! NEQ 999 (
            echo !date! !time!  Ending task "!FanTaskName!!PrevTask!"
            SCHTASKS /End /TN "!FanTaskName!!PrevTask!"
            rem  Wait a few seconds to allow FanControl task to end as gracefully as possible:
            TIMEOUT /T %ENDSECONDS% >nul
            set /A "PauseTime-=ENDSECONDS"
         )
         echo !date! !time!  Starting task "!FanTaskName!!FanTask!" !Celsius!C
         SCHTASKS /Run /TN "!FanTaskName!!FanTask!"
      )
      rem  If the temperature or the task changed, log the temperature.
      if NOT !Celsius!!FanTask!==!PrevTemp!!PrevTask! (
         set PrevTemp=!Celsius!
         set PrevTask=!FanTask!
         echo !Datestamp!,!Timestamp!, !Celsius!>> %LOG%
   )  )
   echo !Datestamp! !Timestamp!   !Celsius!C  Task!FanTask!
   rem  Repeat the loop about once per minute:
   TIMEOUT /T !PauseTime! >nul
)

EXIT /B 0

 

Edited by Adrenalina
Changed embedded .bat file from quote to code
Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×