03 February 2008

S5040の冷却ファン速度制御 (Fedora 8)

東芝 EQUIUM S5040のCPUファンと背面ファンの速度制御を行う。

S5040のBIOS設定画面で、"Thermal Control Mode" を "Performance" に設定する。(" Automatic Speed "では、CPUファンをソフトウエアで制御できなかったため)

Fedora 8 に lm_sensors をインストールする。


[root@localhost ~]# yum install lm_sensors

[root@localhost ~]# sensors-detect

設定ファイルを編集する

/etc/rc.local (多分、sensors-detect で自動的に設定される)

# I2C adapter drivers
modprobe i2c-i801
# Chip drivers
modprobe adm1031
modprobe pc87360
# sleep 2 # optional
/usr/bin/sensors -s # recommended

/etc/sensors.conf

chip "adm1031-*"

label temp1 "SYS Temp"
label temp2 "CPU Temp"
label temp1_crit "SYS Crit"
label temp2_crit "CPU Crit"

ignore temp3

set temp1_max 45
set temp2_max 55
set temp1_crit 50
set temp2_crit 70

label fan1 "CPU Fan"
label fan2 "N/A Fan"

chip "pc87360-*"

label fan1 "Case Fan"
label fan2 "N/A Fan"

set fan1_min 2000
set fan2_min 0

lm_sensors サービスが自動起動するように設定する


[root@localhost ~]# /sbin/chkconfig lm_sensors on

温度・回転数が計測できているか確認


[root@localhost ~]# sensors
adm1031-i2c-0-2c
Adapter: SMBus I801 adapter at 0c00
CPU Fan: 1875 RPM (min = 1308 RPM, div = 4)
N/A Fan: 1323 RPM (min = 1323 RPM, div = 2)
SYS Temp: +27.5°C (low = +0°C, high = +45°C)
SYS Crit: +50°C
CPU Temp: +25.5°C (low = -75°C, high = +55°C)
CPU Crit: +70°C

pc87360-isa-1010
Adapter: ISA adapter
Case Fan: 2823 RPM (min = 2000 RPM, div = 1)
N/A Fan: 0 RPM (min = 0 RPM, div = 8) OVERFLOW

ファン回転数制御の設定をする


[root@localhost ~]# /usr/sbin/pwmconfig

This program will search your sensors for pulse width modulation (pwm)
controls, and test each one to see if it controls a fan on
your motherboard. Note that many motherboards do not have pwm
circuitry installed, even if your sensor chip supports pwm.

We will attempt to briefly stop each fan using the pwm controls.
The program will attempt to restore each fan to full speed
after testing. However, it is ** very important ** that you
physically verify that the fans have been to full speed
after the program has completed.

Found the following devices:
hwmon0/device is adm1031
hwmon1/device is pc87360

Found the following PWM controls:
hwmon0/device/pwm1 ← CPUファン
hwmon0/device/pwm2
hwmon1/device/pwm1 ← 背面ファン
hwmon1/device/pwm2

Found the following fan sensors:
hwmon0/device/fan1_input current speed: 1875 RPM ← CPUファン
hwmon0/device/fan2_input current speed: 0 ... skipping!
hwmon1/device/fan1_input current speed: 3428 RPM ← 背面ファン
hwmon1/device/fan2_input current speed: 0 ... skipping!

Warning!!! This program will stop your fans, one at a time,
for approximately 5 seconds each!!!
This may cause your processor temperature to rise!!!
If you do not want to do this hit control-C now!!!
Hit return to continue:リターンキーを押す

Testing pwm control hwmon0/device/pwm1 ... ← CPUファン用電圧制御器の測定開始
hwmon0/device/fan1_input ... speed was 1875 now 1875 ← CPUファン
no correlation
hwmon1/device/fan1_input ... speed was 3428 now 5000 ← 背面ファン
no correlation

No correlations were detected.
There is either no fan connected to the output of hwmon0/device/pwm1,
or the connected fan has no rpm-signal connected to one of
the tested fan sensors. (Note: not all motherboards have
the pwm outputs connected to the fan connectors,
check out the hardware database on http://www.almico.com/forumindex.php)

Did you see/hear a fan stopping during the above test (n)? y

Testing pwm control hwmon0/device/pwm2 ... ← この制御器にはファンは繋がっていない
hwmon0/device/fan1_input ... speed was 1875 now 1896
no correlation
hwmon1/device/fan1_input ... speed was 3428 now 2944
no correlation

No correlations were detected.
There is either no fan connected to the output of hwmon0/device/pwm2,
or the connected fan has no rpm-signal connected to one of
the tested fan sensors. (Note: not all motherboards have
the pwm outputs connected to the fan connectors,
check out the hardware database on http://www.almico.com/forumindex.php)

Did you see/hear a fan stopping during the above test (n)? y ← 本当はファンは動かないが、一応「y」を押して設定対象にする

Testing pwm control hwmon1/device/pwm1 ... ← 背面ファン用電圧制御器の測定開始
hwmon0/device/fan1_input ... speed was 1875 now 1875
no correlation
hwmon1/device/fan1_input ... speed was 3428 now 0 ← 背面ファン
It appears that fan hwmon1/device/fan1_input
is controlled by pwm hwmon1/device/pwm1
Would you like to generate a detailed correlation (y)? n

Testing pwm control hwmon1/device/pwm2 ... ← この制御器にはファンは繋がっていない
hwmon0/device/fan1_input ... speed was 1875 now 1875
no correlation
hwmon1/device/fan1_input ... speed was 3428 now 2926
no correlation

No correlations were detected.
There is either no fan connected to the output of hwmon1/device/pwm2,
or the connected fan has no rpm-signal connected to one of
the tested fan sensors. (Note: not all motherboards have
the pwm outputs connected to the fan connectors,
check out the hardware database on http://www.almico.com/forumindex.php)

Did you see/hear a fan stopping during the above test (n)? y ← 本当はファンは動かないが、一応「y」を押して設定対象にする

Testing is complete.
Please verify that all fans have returned to their normal speed.

The fancontrol script can automatically respond to temperature changes
of your system by changing fanspeeds.
Do you want to set up its configuration file now (y)?リターンキーを押す
What should be the path to your fancontrol config file (/etc/fancontrol)?リターンキーを押す
Loading configuration from /etc/fancontrol ...

Select fan output to configure, or other action:
1) hwmon1/device/pwm2 4) hwmon0/device/pwm1 7) Save and quit
2) hwmon1/device/pwm1 5) Change INTERVAL 8) Show configuration
3) hwmon0/device/pwm2 6) Just quit
select (1-n): 4 ← CPUファン速度設定を選択

Devices:
hwmon0/device is adm1031
hwmon1/device is pc87360

Current temperature readings are as follows:
hwmon0/device/temp1_input 27
hwmon0/device/temp2_input 25 ← CPU温度
hwmon0/device/temp3_input 0

Select a temperature sensor as source for hwmon0/device/pwm1:
1) hwmon0/device/temp1_input
2) hwmon0/device/temp2_input
3) hwmon0/device/temp3_input
4) None (Do not affect this PWM output)
select (1-n): 2

Enter the low temperature (degree C) ← ファン最低回転数の温度
below which the fan should spin at minimum speed (0): 30

Enter the high temperature (degree C) ← ファン最高回転数の温度
over which the fan should spin at maximum speed (60): 45

Enter the minimum PWM value (0-255) ← ファン回転開始電圧(PWM周波数)
at which the fan STARTS spinning (press t to test) (150): 150

Enter the minimum PWM value (0-255) ← ファン回転停止電圧(PWM周波数)
at which the fan STOPS spinning (press t to test) (100): 150

Enter the PWM value (0-150) to use when the temperature ← 最低温度以下の時のファン回転制御電圧
is below the low temperature limit (0): 150

Enter the PWM value (150-255) to use when the temperature ← 最高温度以上の時のファン回転制御電圧
is over the high temperature limit (255): 255

select (1-n):

CPUファンと背面ファンの速度制御設定を一通り行って、/etc/fancontrolファイルに保存する。

/etc/fancontrol

INTERVAL=10
FCTEMPS=hwmon1/device/pwm1=hwmon0/device/temp2_input hwmon0/device/pwm1=hwmon0/device/temp2_input
FCFANS=hwmon1/device/pwm1=hwmon1/device/fan1_input hwmon0/device/pwm1=
MINTEMP=hwmon1/device/pwm1=40 hwmon0/device/pwm1=30
MAXTEMP=hwmon1/device/pwm1=45 hwmon0/device/pwm1=40
MINSTART=hwmon1/device/pwm1=25 hwmon0/device/pwm1=150
MINSTOP=hwmon1/device/pwm1=25 hwmon0/device/pwm1=150
MINPWM=hwmon1/device/pwm1=25 hwmon0/device/pwm1=150
MAXPWM=hwmon1/device/pwm1=150 hwmon0/device/pwm1=255

この値でちゃんと制御できるか、試してみる。


[root@localhost ~]# /usr/sbin/fancontrol &

適当なベンチマークで、CPU温度を上げて、ファンの回転数が変化することを確認した後に、常駐設定する。


[root@localhost ~]# crontab -e

実際は、次のファイルが編集される。(cronにより、cronサービス開始時にroot権限で実行される)

/var/spool/cron/root

@reboot /usr/sbin/fancontrol &> /var/log/fancontrol & ← この行を追加


S5040のCPUファンは、起動時(BIOSチェック時)に少しだけ回って停止し、CPU温度が50℃を越えるまで止まったまま…

せめて、30℃を越えたら最小回転数で回転し続けてくれればいいのに。

マシンの電源を入れてから、cronサービスが動き出すまで、CPU温度はうなぎのぼり。外気温が15℃の室内で、cronサービスが動く時までCPUファンを停止したままにすると、CPU温度が40℃を軽く越える。真夏に、本当にこれでOKなのか、東芝の設計能力に疑問を感じる。

とりあえず、真夏にはFANを常時回転させるように、12V電源を68オームの抵抗で電圧を落としてファンに直結する回路も作成した。
(Pemtium 4-Mに交換するか、それとも常時回転にするか。夏までに決めようと思う)