Files
forgefirm/scripts/bench/flow_sampler.py
T
ScottW514 f92147093e Flow-detection experimental record and bench tooling
Adds the design matrix and its supporting tools, and records in BRINGUP
what the 60-run matrix overturned: sub-40-percent duty mimics flow
(three of five dead-pump trials looked healthier than a working pump),
the operating point and threshold now rest on 25 pooled observations,
periodic re-checks are thermally free with the fans running, and the
settle gate closes a bench-proven miss. Also records what is NOT yet
validated - warm-loop baselines and behaviour under laser heating - as
first-light commissioning items.
2026-08-02 23:51:31 -04:00

23 lines
631 B
Python

#!/usr/bin/env python3
"""Board-side coolant sampler: prints 'elapsed,raw_down,raw_up' lines.
Usage: flow_sampler.py <duration_s> <interval_s>
Kept on the board so sampling cadence is not at the mercy of ssh
round-trip latency."""
import sys
import time
dur = float(sys.argv[1])
iv = float(sys.argv[2])
t0 = time.time()
while True:
el = time.time() - t0
if el > dur:
break
with open('/sys/glowforge/pic/water_temp_1') as f:
r1 = f.read().strip()
with open('/sys/glowforge/pic/water_temp_2') as f:
r2 = f.read().strip()
print('%.2f,%s,%s' % (el, r1, r2), flush=True)
time.sleep(iv)