Testing PWM fan speeds in Linux using spintest.sh
I swapped out the fan in my NAS server with some Noctua, which all supported PWM.
As part of my testing, to see what speeds the PWM fans would run at, I found a script that was written by the TrueNAS community.
I had to modify it so it would run on Ubuntu, but there wasn't much to modify.
This output of this script helped me figure out what speeds I should shoot for in my (eventual) PWM fan solution.
Modifying the script
Ubuntu has various executables (bash, etc) in /usr/bin/, not in /usr/local/bin/, so we need to edit the scripts to change the reference point:
sed -i 's/\/local//' spintest.sh
Change the location of the log file to the same directory that the spin*.sh script files are located:
sed -i 's/\/mnt\/Ark\/Jim/./' spintest.sh
Running the script, and the output
sudo ./spintest.sh
Script to determine fan RPMs associated with varying duty cycles.
Duty will be varied from 100% down in steps of 10.
After setting duty, we wait 5 seconds for equilibration
before reading the fans. Some points:
1. Set the log path in the script before beginning.
2. There should be no fan control scripts running.
3. At very high and especially low fan speeds, the BMC may take
over and change the duty. You can:
- ignore it,
- adjust fan thresholds before testing, or
- edit the script so it starts and/or ends at different values
(see comment before while loop for instructions).
Thursday, Sep 16, 12:49:27
___Duty%___ Curr_RPM____________________
MODE Zone0 Zone1 FANA FAN1 FAN2 FAN3 FAN4
Conditions before test Full 100 100 1800 2200 --- 1800 1800
Are you ready to begin? (y/n)
y
Thursday, Sep 16, 12:49:39
___Duty%___ Curr_RPM____________________
MODE Zone0 Zone1 FANA FAN1 FAN2 FAN3 FAN4
Duty cycle 100% Full 100 100 1800 2200 --- 1800 1800
Duty cycle 90% Full 90 90 1700 1900 --- 1600 1600
Duty cycle 80% Full 80 80 1500 1700 --- 1500 1500
Duty cycle 70% Full 70 70 1300 1500 --- 1300 1300
Duty cycle 60% Full 60 60 1200 1300 --- 1100 1100
Duty cycle 50% Full 50 50 1000 1100 --- 1000 1000
Duty cycle 40% Full 40 40 800 800 --- 800 800
Duty cycle 30% Full 30 30 600 600 --- 600 600
Duty cycle 20% Full 100 100 500 2000 --- 1600 400
In the pid_fan_contro.pl
script that was bundled with this script, it mentions that some fans will stall below 30%, which is what I see above for fans 'FAN1' and 'FAN3' when the duty cycle is at 20%.
TrueNAS Resources - Fan Scripts for Supermicro Boards Using PID Logic https://www.truenas.com/community/resources/fan-scripts-for-supermicro-boards-using-pid-logic.24/