system76 / ec

System76 Open Source Embedded Controller
GNU General Public License v3.0
318 stars 72 forks source link

Sync fans based on temp instead of duty #477

Closed crawfxrd closed 3 weeks ago

crawfxrd commented 2 months ago

Fans may be different sizes, placed in asymmetrical positions, or have different amounts of venting through the chassis. These characteristics affect the ability for each fan, separately, to dissipate heat and generate noise.

Replace syncing fans to the highest duty calculated for each fan, based on separate thermal sensors, to using the highest reported temperature across all sensors to calculate each fan's duty for that highest temperature.

In other words: The old behavior synced fans based on the output value (duty), while this new behavior syncs fans based on the input value (temperature).

This allows tuning fans separately to better manage total system thermals and mitigate noise.

Tested by modifying FAN2 points on oryp6 to always run at 80% and then verifying that "CPU fan" spins up/down to different values than "GPU fan".

Resolves: #390.

XV-02 commented 1 month ago

Would we expect the fan with a steady-state fan-curve to boost above that duty cycle on initial spin-up?

To build firmware leveraging this, just to confirm, I should only need the fan2 branch in firmware-open and this branch for ec, right?

crawfxrd commented 1 month ago

Would we expect the fan with a steady-state fan-curve to boost above that duty cycle on initial spin-up?

Maybe for a second while it ramps up? I'm not sure how long it would take to become stable.

To build firmware leveraging this, just to confirm, I should only need the fan2 branch in firmware-open and this branch for ec, right?

Correct.