Jump to content

Dunc4n1d4h0

Members
  • Posts

    7
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. My bad, hardcoded default value. Long time ago I used kernel module parameters. There are none in pwm-fan module. Please, tell me how to change that to value that fits my needs? :-) (Other way that I use to write values to /sys/*) Regards
  2. For me problem here is hardcoded pwm frequency; https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dtsi line 61 fan: pwm-fan { compatible = "pwm-fan"; #cooling-cells = <2>; fan-supply = <&vcc12v_dcin>; pwms = <&pwm1 0 50000 0>; }; Fans I tested work at low frequencies, below 1000 Hz.
  3. @soerenderfor AFAIR: echo 0 > /sys/class/pwm/pwmchip1/unexport modprobe pwm-fan
  4. P.S. It's good to set duty_cycle first, as you can't set period lower than duty_cycle - you'll get "permission denied".
  5. @soerenderfor echo 100 > /sys/class/pwm/pwmchip1/pwm0/period - this is 100% (at frequency of 100Hz) echo 40 > /sys/class/pwm/pwmchip1/pwm0/duty_cycle - 40 here is 40% of 100 Period is cycle frequency, duty is percentage of this cycle filled with logical 1, here 12V, so at 100Hz cycle is 10ms, 4ms signal is 12V and 6ms its 0V echo 500 > /sys/class/pwm/pwmchip1/pwm0/period - this is 100% (at frequency of 500Hz) echo 250 > /sys/class/pwm/pwmchip1/pwm0/duty_cycle - 250 here is 50% of 500 No problem :-)
  6. @soerenderfor I already tried tux3dv fan cotrol. Well, it isn't magic box :-) What it does is to read from /sys/devices/virtual/thermal/thermal_zone*/temp and write values from curve build from config f.e. 100..255 into /sys/devices/platform/pwm-fan/hwmon/hwmon*/pwm1. All of this can be done manually. It uses pwm-fan kernel module. If you unload this module there is no more /sys/devices/platform/pwm-fan/hwmon/hwmon* and fan stops. Real problem here is lack of customization in this module. In 5.7.15 version there is hardcoded 50kHz pwm frequency - which simply won't work with all 2-wire fans. Decent DC fans aren't simple motors, such fan has microcontroller which task is to deliver AC current in correct time to coils. Since there is no control with in 2-wire fan, 50% square pwm signal simply turns on/off whole circuit (at low frequency). All you can get at high frequency is fan working at full or zero speed. Good solution would be to add paremeter to pwm-fan module for setting pwm-freqeuncy. Meanwhile I searched alot and found solution for my fan :-) rmmod pwm-fan echo 0 > /sys/class/pwm/pwmchip1/export echo 40 > /sys/class/pwm/pwmchip1/pwm0/duty_cycle echo 100 > /sys/class/pwm/pwmchip1/pwm0/period echo 1 > /sys/class/pwm/pwmchip1/pwm0/enable What is does: - remove useless kernel module and unlock pwmchip - write to export creates subfolder to control pwm - 40/100 - set frequency to 100Hz and duty_cycle to 40% (so we have low pwm frequency and square vawe fulfillment of 40%) It works, fan speed can be controlled in much higher range, no more jet turbine dB level :-) PS. I used Sunon fans for test: https://www.tme.eu/Document/b6f8c2a3813918913726d12d942d1b83/EE80151S1-A99.pdf https://www.tme.eu/Document/d44c6feef6683af4934c9d10cdd59c2e/ME80201V1-A99.pdf IMHO RockPro64 fan solution is bad desing. It should be programmable DC output for 2 wire, or 4-wire nice pwm like we have in PC.
  7. Hi, Is fan control still broken? Linux rockpro64 5.7.15-rockchip64 #20.08 SMP PREEMPT Mon Aug 17 00:26:28 CEST 2020 aarch64 aarch64 aarch64 GNU/Linux echo 255 > /sys/devices/platform/pwm-fan/hwmon/hwmon2/pwm1 echo 0 > /sys/devices/platform/pwm-fan/hwmon/hwmon2/pwm1 Commands line above work, but writing anything between (like 240, 200, etc.) does not. I can hear noise imho coming from fan coils when I write 253 to pwm1, maybe it's pwm frequency too high/too low? I checked two different 80x80mm fans, same result. Fans start to spin connected to DC ~4V, so they should work for sure. From kernel side there is pwm-fan module, but it can't take any parameters imho. Every kernel version I checked comes with it's own values (lol), for. example: https://github.com/ayufan-rock64/linux-kernel/pull/40/commits/5d9fbef9cfa01846dd0b4d66249df55c85fa344f
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines