Skip to content

About

Streamlit analyzer for LD0625BC haptic motor DAQ accelerometer logs

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Haptic DAQ Analyzer

Version 1.1

Interactive web app (Streamlit) for analyzing DAQ accelerometer logs (daq.log) from testing the LD0625BC linear vibration motor (DAQ-DiagV4.exe). It parses runs/frames, computes metrics, classifies PASS/FAIL with root-cause analysis, visually compares PASS vs FAIL, and suggests limits from the data.

Requirements

  • Python 3.10+
  • Dependencies in requirements.txt

Install

cd haptic_daq_analysis
python3 -m venv .venv
source .venv/bin/activate   # Windows: .venv\Scripts\activate
pip install -r requirements.txt

Run

python run.py

or

streamlit run app.py

Streamlit prints a local URL (usually http://localhost:8501).

Input data

Logs are expected in the structure:

<root>/PASS/<serial>_<timestamp>/log/daq.log
<root>/FAIL/<serial>_<timestamp>/log/daq.log

unit_serial, timestamp, and path_verdict (PASS/FAIL from the parent folder) are derived from the path. You can:

  • put logs into the data/ folder and enter the root path in the app, or
  • upload individual files via the uploader in the app.

Log format

A single daq.log may contain multiple runs (retries), separated by a === ... Version = ... header. Each run contains frames and a final verdict:

Frame 1 | BAND=252.0Hz PEAK=0.070669 EFFECTIVE=0.070669 | Band=[242-270] | RMS_Limit=[0.050000-0.100000] | Status=VALID
HARMONICS: H2=503.9Hz(0.018271) H3=761.7Hz(0.008787) H4=1013.7Hz(0.010065) H5=1265.6Hz(0.006389)
HARMONIC_SUM=0.043512 EFFECTIVE_RMS=0.070669
[HARMONIC_BAND] PEAK=503.9Hz RMS=0.018271
[HIGH_FREQ] PEAK=3035.2Hz RMS=0.001038
...
========== FINAL RESULT ==========
Total Frames = 11
Valid Frames = 11
Average Frequency = 252.0 Hz
Average RMS = 0.061397
==================================
Result: haptic_pass DATA: 252.0Hz RMS=0.066450

The verdict can be Result: haptic_pass or FAIL: <REASON> + REASON=<...> (observed: UNSTABLE_SIGNAL, NO_VALID_FRAME, NO_PEAK_IN_RANGE, PEAK_LOW_IN_RANGE).

The parser also handles the alternative frame line with no detected peak in the band:

Frame 1 | OVERALL=11.7Hz RMS=0.000102 | BAND=none | Band=[242-270] | Status=NO_PEAK_IN_RANGE

RMS_Limit recorded in the logs varies per batch (lo in {0.031, 0.05}, hi in {0.10, 0.12, 0.13}). The app does not use those per-log values by default - it applies one fixed universal limit (rms_limit = [0.04, 0.12], use_log_rms_limit = false) so the same rule holds for every unit at all times. Set use_log_rms_limit = true only if you want to follow each log's own band.

Metrics (per run)

Metric Meaning
rms_mean, rms_std, rms_cv mean / spread / coefficient of variation of EFFECTIVE_RMS across frames
rms_slope RMS trend across frames (decay = instability)
peak_freq_mean/std stability of the dominant frequency in the F0 band
valid_frame_ratio ratio of frames with Status=VALID
dominant_harmonic strongest harmonic H2-H5 and its share
harmonic_distortion HARMONIC_SUM / EFFECTIVE_RMS
harmonic_band_ratio_max strongest peak in the harmonic band relative to the fundamental
hf_peak_rms, hf_detect_count high-frequency noise and number of HF-detect events
num_runs number of runs (retries) in the file

Unit verdict

The test station retries until pass. The unit verdict therefore follows the last run; earlier failing attempts are shown as context (had_retry_fail, retry: ...).

Root-cause tags

  • RMS_LOW / RMS_HIGH - mean RMS outside the fixed limit [0.04, 0.12]
  • UNSTABLE_SIGNAL - high CV or decreasing/increasing RMS trend
  • HF_NOISE - high-frequency energy above limit or haptic_fail HF detect events
  • SPURIOUS_PEAK - peak in the harmonic band stronger than the fundamental (harmonic_band_rms / effective_rms > limit); corresponds to possible_harmonic_detect fail (e.g., resonance outside the [242-270] band)
  • INVALID_FRAMES - too few frames with Status=VALID
  • HARMONIC_SHIFT - dominant harmonic different from expected (optional, disabled by default - not discriminative in this data)

Reference specification (datasheet LD0625BC)

F0 = 260±10 Hz, drive 0.7 Vrms AC sine, acceleration min 0.70 Grms, resistance 8±2 Ω, vibration axis Z, rise time max 20 ms, falling time max 80 ms. RMS_Limit in the log is in DAQ device units (not directly Grms); datasheet values serve as a reference in the config and UI.

Project layout

Module Role
parser.py parse daq.log into runs/frames (parse_log) and scan the tree (scan_tree)
metrics.py per-run features, PASS/FAIL rules, root-cause, limit suggestions
app.py Streamlit UI
config_default.json default thresholds + datasheet reference
data/ dropzone for logs

About

Streamlit analyzer for LD0625BC haptic motor DAQ accelerometer logs

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages