puff: make fan control better behaved#13
puff: make fan control better behaved#13tofurky wants to merge 1 commit intoMrChromebox:firmware-puff-13324.B-masterfrom
Conversation
The stock fan control has a few issues leading to erratic behavior such as stalls and constant cycling on/off. Most of this is due to the tendency of the algorithm to make the temperature rapidly oscillate above and below the "fan off" temperature. However, the fan on duffy (Asus Chromebox 4) additionally has a stall speed of approximately 7% PWM. The algorithm, when frequently stopping and starting per the aforementioned oscillation, can wind up choosing PWM values below this threshold, causing the fan to stall. Due to a delayed response, it'll then be commanded to quickly burst towards maximum RPM, crossing the "fan off" boundary and just as quickly stopping again. A few changes make the fan much better behaved: - Add a 3C "fan off" hysteresis to avoid oscillating - Ensure applied PWM is always greater than stall speed - When stopping the fan, set RPM to 0 immediately to avoid stale/misleading values being used for subsequent decisions - Slightly raise the "fan off" temperature and lower the min fan speed Also, while we're in there, fix a typo in the CML header guard. Fixes MrChromebox/firmware/issues/678 Signed-off-by: Matt Merhar <mattmerhar@protonmail.com>
|
I've been using this (just used Previously, putting my ear to it, it was constantly starting and stopping (like every couple seconds) which can't be good for the bearings etc. I wrapped the functional changes in |
|
I think we want to make sure that all puff-based devices (some of which use other board definitions) also benefit from these changes, so I would drop the ifdefs and adjust the min rpm and fan off temp for others as well (ambassador, dooly, genesis, moonbuggy, scout) |
Thanks for taking a look. I can do as suggested, but I won't be able to test any of those other changes. They're all built from the same branch as this, then? And, do you know off hand if the fan specs etc. are similar enough between them that they can use the same settings? The one I have is the somewhat dinky Celeron which is just dual core and lower TDP. Adding the hysteresis and immediately setting the RPM to 0 should help all boards, though. |
yes. fan specs, no idea as never seen any of those boards and they aren't documented/published
sounds good to me. we can probably do the same for the Fizz boards/branch too |
I started looking at these other boards and it seems most of them have their own "custom" fan control: This includes e.g. from board/ambassador/board.c: I'm going to see if adding "custom" control for puff is enough to resolve the issue. It seems that |
SGTM! |
The stock fan control has a few issues leading to erratic behavior such as stalls and constant cycling on/off.
Most of this is due to the tendency of the algorithm to make the temperature rapidly oscillate above and below the "fan off" temperature.
However, the fan on duffy (Asus Chromebox 4) additionally has a stall speed of approximately 7% PWM.
The algorithm, when frequently stopping and starting per the aforementioned oscillation, can wind up choosing PWM values below this threshold, causing the fan to stall. Due to a delayed response, it'll then be commanded to quickly burst towards maximum RPM, crossing the "fan off" boundary and just as quickly stopping again.
A few changes make the fan much better behaved:
Also, while we're in there, fix a typo in the CML header guard.
Fixes MrChromebox/firmware/issues/678