Fan control

Hi,

I’d like to know how can I change the fan mode.

I’ve found this commands in this forum (Jetson Nano Fanhttps://devtalk.nvidia.com/default/topic/1049521/jetson-nano/jetson-nano-fan/post/5326445/#5326445):

ON :
sudo sh -c 'echo 255 > /sys/devices/pwm-fan/target_pwm'

OFF :
sudo sh -c 'echo 0 > /sys/devices/pwm-fan/target_pwm'

But I’ve seen that checking the file /sys/bus/platform/devices/pwm-fan/pwm_rpm_table I get this table:

(Index, RPM, PWM, RRU, RRD)
(0, 0, 0, 40, 40)
(1, 1000, 80, 2, 2)
(2, 2000, 120, 1, 1)
(3, 3000, 160, 1, 1)
(4, 4000, 255, 1, 1)
(5, 5000, 255, 1, 1)
(6, 6000, 255, 1, 1)
(7, 7000, 255, 1, 1)
(8, 10000, 255, 1, 1)
(9, 11000, 255, 1, 1)

Then I doubt which real RPM will be set after typing the above command to pass 255 to /sys/devices/pwm-fan/target_pwm

How could I change the real RPM?

In addition, what do they mean RRU and RRD?

Thanks in advance
Jose

hello jetxeberria,

Jetson-Nano includes PWM and tachometer functionality to enable fan control.
you might found there’re GPIO pins for measurement, i.e. GPIO_PE7 (Fan PWM), GPIO_PZ2 (Fan Tachometer)
but controlling through GPIO might slow down the system performance as interrupts will be too high in numbers.

please have an alternative way to use tachometer for measuring and also set the rpm.
for example,

/sys/devices/pwm-fan/tegra-fan/
cur_pwm, pwm_rpm_table, rpm_measured,  step_time,
pwm_cap,  target_pwm

Hello JerryChange,

Thanks for you fast answer.

I have not “tegra-fan” folder inside /sys/devices/pwm-fan. My contents in pwm-fan are:

-r--r--r-- 1 root root 4096 sep 30 10:06 cur_pwm
lrwxrwxrwx 1 root root    0 sep 30 10:06 driver -> ../../bus/platform/drivers/pwm_fan_driver
-rw-r--r-- 1 root root 4096 sep 30 10:06 driver_override
-rw-r--r-- 1 root root 4096 sep 30 10:06 fan_kickstart
-rw-r--r-- 1 root root 4096 sep 30 10:06 fan_profile
-rw-r--r-- 1 root root 4096 sep 30 10:06 kickstart_params
-r--r--r-- 1 root root 4096 sep 30 10:06 modalias
lrwxrwxrwx 1 root root    0 sep 30 10:06 of_node -> ../../firmware/devicetree/base/pwm-fan
drwxr-xr-x 2 root root    0 sep 30 10:06 power
-rw-r--r-- 1 root root 4096 sep 30 10:06 pwm_cap
-r--r--r-- 1 root root 4096 sep 30 10:06 pwm_rpm_table
-rw-r--r-- 1 root root 4096 sep 30 10:06 pwm_state_map
-r--r--r-- 1 root root 4096 sep 30 10:06 rpm_measured
-rw-r--r-- 1 root root 4096 sep 30 10:06 state_cap
-rw-r--r-- 1 root root 4096 sep 30 10:06 step_time
lrwxrwxrwx 1 root root    0 ene 28  2018 subsystem -> ../../bus/platform
-rw-r--r-- 1 root root 4096 sep 30 10:06 tach_enable
-rw-r--r-- 1 root root 4096 sep 30 10:06 target_pwm
-rw-r--r-- 1 root root 4096 sep 30 10:06 temp_control
-rw-r--r-- 1 root root 4096 ene 28  2018 uevent

hello jetxeberria,

you still had device nodes for fan control, please use tachometer for measuring and also set the fan rpm.
thanks

Hello JerryChang,

which is the suggested tachometer reference? and how is it managed? I can’t find documentation in the Jetson Nano Developer Kit User Guide concerning the tachometer, nor in the Jeston Nano Supported Component List

Thanks in advance

How do I do this?

hello thohtdelta,

please check similar discussion thread, Topic 1063713.
you may also refer to automatic fan control solution, https://github.com/Pyrestone/jetson-fan-ctl.
thanks

Hello JerryChang,

I’m using the automatic fan control solution, that is working well, however I would like to know how to control the fan manually just in case I need it.

I still would like to have answers for my previous questions.

Must I ignore pwm_rpm_table?

In the thread you point to

tachometer is just named to redirect to this thread. I can’t find official documentation, could you tell me where to find it?

Thanks in advance

Hello,

Could I have some answer?

Thanks in advance

Trying a new installation in a new empty SD card, fan has started running without installing the automatic control tool nor explicitly setting PWM value in “target_pwm”.

Dmesg outputs this:

$ dmesg | grep FAN
[    1.736251] FAN dev name: pwm-fan
[    1.736305] FAN:gpio request success.
[  382.343535] FAN rising trip_level:1 cur_temp:51250 trip_temps[2]:61000
[ 2007.420076] FAN cooling trip_level:0 cur_temp:35750 trip_temps[1]:51000

It seems that there is already a temperature bounded fan control.

  • How is it activated or deactivated?
  • How are trip_temps modified?

Why have you don’t say anything about this before? This should be a trivial task, I can’t understand why there is not a documentation about how to control this.

I still expect answer to the previous questions

hello jetxeberria,

trip_temps means the range of temperature, it’s a way to estimate the temperature and determine the fan condition.
you’ll also found device tree setting to specify the temp in the ranges.
for example,

thermal-fan-est {
...
    active_trip_temps = <0 51000 61000 71000 82000 140000 150000 160000 170000 180000>;

you might also refer to below kernel sources for fan controls.
$l4t-r32.2/public_sources/kernel/nvidia/drivers/misc/therm_fan_est.c

the RRU and RRD are referred as ramp up and ramp down granularity.
basically, while transitioning from lower PWM value to higher PWM value, RRU is being considered.
for example,

(Index, RPM, PWM, RRU, RRD)
(    0,   0,   0,   40, 40)
(    1, 1000, 80,    2,  2)
(    2, 2000, 120,   1,  1)

PWM values changes will following below.
0 - 80 : RRU is 40. so cur_pwm value is changed as 40, 80
80-120 : RRU is 2. so cur_pwm value will be incremented as 82, 84, 86, 88, 90 … 120
120-160 : RRU is 1. so cur_pwm value will be incremented as 121, 122, 123 … 160

and similarly RRD for the reverse way.
thanks