Commit Graph

2 Commits

Author SHA1 Message Date
Tony Cao
ad312c0b00 feat(phase-ab): 4kHz timestamp stamping + rfm-sync-4k experiment + dc-align + L0b fresh watchdog
- Phase A: aOut1[264..271]=plc_ts / aIn1[264..279]=t_d2k_ns+plc_ts_echo (RTT p50=2.0ms p99=2.25ms, 7.7M samples)
- rfm-sync-4k chunked mode: implemented, measured infeasible (slot exec p50=295us > 250us budget)
- --dc-align + --sync-offset-ns/--dc-wphase-ns: DC-grid phase gating for FPRD/FPWR kicks;
  sweep showed net loss vs free-running async (p50 RTT 2.0->2.5-3.0ms), kept off in production
- L0b watchdog: fresh-stall >3s -> exit(42); fixes blind spot where bridge wedge freezes
  tx_seq and old echo watchdog condition stays false (2026-11-13 incident, cured by CX TwinCAT reset)
- ethercrab pdu_rx/pdu_loop patch: late/short/unknown-idx frames downgraded to Ignored
  instead of killing the tx_rx task (production robustness fix)
- plc_data_age metric: (dc_read - plc_ts) mod 250us, proved end-to-end DC grid lock
- production binary md5=72eb50fb deployed to D2000 + SSD p4
2026-11-16 17:19:17 +08:00
Tony Cao
21b2d3bf99 J1900 <-> TwinCAT 1 kHz verification over EL6695 bridge
Re-implementation of rustbootd's ecat_el6695_* examples as a single binary
with fixes found in review and on hardware:

- DC-follow PLL hardened against period-2 hunting: slew-limited anchor
  (+/-50us/cycle), bistable-trap snap re-anchor, re-prime on stale deadline
- drift-free absolute-grid ticker mode; probe mode for timestamp forensics
- bounded-memory online stats (histograms), graceful SIGINT/SIGTERM shutdown
  with full report, error-streak abort
- timestamp plausibility filter comparing against the previous raw sample
  (avoids the deadlock after a startup outlier)
- XFC scope waveform options: --el2202 (with --el2202-dual), --el2262,
  --el1252 latch timestamp readback with per-channel edge statistics
- register access unified in regs.rs: named bit constants everywhere,
  read-modify-write for enable/activation bytes
- vendored patched ethercrab 0.7.1 (sdo_write_complete, send_raw_coe)

Verified on J1900 (PREEMPT_RT 6.6.135): 600k cycles/600s exact 1 kHz,
tx/rx zero errors, phase_err p50=164us std=5us; EL2202<->EL1252 loopback
edge interval mean 2000.24us std=24.65us.
2026-07-22 08:55:41 +08:00