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

+1
View File
@@ -34,6 +34,7 @@ class ProfileSwitchTest(unittest.TestCase):
self.commander.set_duty.side_effect = lambda ports, duty: {p: 1200 for p in ports}
board = Mock(spec=Nct6687)
board.manual_mask.return_value = 0x24
board.rpms.return_value = [0] * 16 # no tach has been seen turning: stall detection stays quiet
self.top = TopFanCurve((2, 5), board_factory=lambda: board)
self.fans = CaseFanControl(self.commander, (4, 5, 6), (1, 2, 3), top=self.top, profile=BALANCED)
self.now = 0.0