pymumu / fan-control-rock5b

PWM fan speed control for rock5B; ROCK5B风扇速度控制软件。
MIT License
105 stars 32 forks source link

stayed on max even though temp dropped to 31'c #1

Open StuartIanNaylor opened 1 year ago

StuartIanNaylor commented 1 year ago

Not sure what happened but for some reason stayed on max even though temp dropped to 31'c

Didn't do any checks but had a rough script running.

#!/bin/bash
stress-ng -c 8 --vm 8 --vm-bytes 512M&
echo start > temp.txt
while true
do
    echo $(cat /sys/class/thermal/thermal_zone*/temp)
    echo $(cat /sys/class/thermal/thermal_zone*/temp) >> temp.txt
    echo $(date +"%T")
    echo $(date +"%T") >> temp.txt
    sleep 20
done

When I hot ctrl+c to escape the script the fan was already fast at 50c but heard up go up another notch and there it stuck even though temps where back down to 31c

PS the cpu freq buffs to get 2400000Mhz have turned this exceptionally cool SoC into a bit of a hot one.

pymumu commented 1 year ago

When below the required temperature, the fan still spins for a certain amount of time to assist in cooling. https://github.com/pymumu/fan-control-rock5b/blob/main/src/fan-control.c#L50-L56 The longest time is 180s

StuartIanNaylor commented 1 year ago

Prob that and I switched off before 180s :)

Thnx

StuartIanNaylor commented 1 year ago

@pymumu There is something a bit weird about the pwm control and not your software. Or at least there is with the fan I have got.

echo 5000 > /sys/devices/platform/fd8b0010.pwm/pwm/pwmchip1/pwm0/duty_cycle gives nothing (50%) needs approx echo 5500 > /sys/devices/platform/fd8b0010.pwm/pwm/pwmchip1/pwm0/duty_cycle (55%)

But also echo 7500 > /sys/devices/platform/fd8b0010.pwm/pwm/pwmchip1/pwm0/duty_cycle (75% but over time you can hear the fan speed change)

I have no idea part from wtf as pwm can definitely control a fan at less than 50% mark-space even 10% Its almost like its linear control but something more is wrong than that as even linear would not wobble the speed as it does. I can tell from your software where 50% is the 1st minimum which is an odd choice you where likely as easily confused.

pymumu commented 1 year ago

There is a minimum current requirement for fan spin. the pwm value of my fan is 5500, it stops when it is lower than 5500. You can adjust the initial value according to the requirements of your fan.

Picture of my fan: image

StuartIanNaylor commented 1 year ago

Nope I am same as the vcc5v_sys doesn't seem to be able to suplly the current if I run stress-ng I can hear the fan slow down and when ends it speeds back up with no control change. I just have an aliexpress 5v 0.20a fan and it acts exactly as yours as approx below 5500 it stalls. But its sort of weird as after some play I understand more now and you are running @ 100Khz which guess is ok but 25Khz for fans is more normal but at 25Khz its even worse and know why you upped it to 100Khz. I think your software works perfectly but beginning to doubt the hardware implementation that might need a revision for the fan.