30-Second Window Enforcement with Clock DriftURL copied
The state machine's wash window relies on wall-clock time. Sensor events arrive from multiple edge devices — RFID readers, cameras, soap sensors — each with their own clock. Even a 1–2 second drift between devices can cause the state machine to misclassify a legitimate wash event as a missed window.
The fix is NTP synchronisation on all edge devices to a common lab network time source, plus a short grace margin (2–3 seconds) on the window boundary. The grace margin should be documented in the protocol configuration, not hardcoded, so it can be adjusted as operational data accumulates.
Assumption — 30-second window: This duration is a design assumption. Confirm the actual protocol requirement before hardcoding the default.