Top fans: stall detection from the tach registers, and no manual duty left behind

- control.py: TopFanCurve reads the NCT6687D tach registers while the fans are
  commanded to spin. A channel whose fan was seen turning and then reads 0 RPM
  on three consecutive polls raises everything to 100% and says FAILSAFE. A
  channel whose tach has never been seen turning (SYS_FAN1's is not wired on
  this board) is left alone, so an unwired or empty header cannot cry wolf.
  The latest readings are in the snapshot.
- control.py: CaseFanGroup's stall check now needs three consecutive low
  readings instead of one; a single glitchy RPM no longer forces 100%.
- control.py: when a top-fan write fails, the channels are handed back to the
  BIOS curve at once (best effort); the status says so, or names the duty the
  fans are left at when even the hand-back fails. Previously the UI claimed
  "BIOS curve keeps control" even while the fans sat at a manual duty.
- Tests (three new, one reworked, board doubles given rpms) and README updated
  to match.
This commit is contained in:
paul committed 2026-12-05 17:32:22 +13:00
1 parent 8969a57045
commit b2da2213b7
4 files changed
+117 -6

No files matched your search

+9 -3
View File
@@ -213,7 +213,10 @@ every profile:
- Fans run at 100% on start-up.
- They run at 100% after a polling gap of over 5 seconds.
- They run at 100% when a temperature is missing or invalid.
- A group runs at 100% when one of its fans is below 200 RPM after its 10-second spin-up.
- A group runs at 100% when one of its fans reads below 200 RPM on three consecutive polls
after its 10-second spin-up; a single glitchy reading doesn't count.
- The top fans run at 100% when a fan that was seen turning then reads 0 RPM on three
consecutive polls.
- The top fans are held at 100% while either case-fan group runs at 85% or more. They are released once both groups are at 65% or less.
### Ports and channels
@@ -250,8 +253,11 @@ On exit the case fans are left at 100% and the top fans go back to the BIOS Smar
This is software control, not a hardware thermal safeguard. It can't guarantee a speed change
after a USB failure, a forced process kill or a system hang, and the Commander PRO may keep its
last duty. Verify temperatures and fan rotation under your real workloads. Only SYS_FAN4 reports
RPM, so there is no stall detection on the top fans.
last duty. If a top-fan write fails, The Kurgan hands those headers back to the BIOS curve at
once; if even that fails, the UI says what duty they are left at. Verify temperatures and fan
rotation under your real workloads. Only SYS_FAN4's tach is wired to the EC, so top-fan stall
detection covers that fan only: a channel whose tach has never been seen turning is left alone
rather than crying wolf.
## Lighting