Motor Monitor

Detect anomalies in 3-phase stator current envelope without identifying the fault type

How it works

Tier 1 listener - This sample implements the first stage of the edge fault detection pipeline. An ESP32-class MCU continuously monitors the stator current envelope, looking for drift from a learned baseline. It does not identify what fault occurred. It only detects that something changed.

Online calibration - The first 20 windows are used to build a statistical baseline: the mean and standard deviation of three per-window features (modulation amplitude, peak-to-peak range, clipping rate) across three current phases. This calibrates at the current operating point, not across all loads.

Anomaly scoring - Each subsequent window is scored as the average z-score of its features against the baseline. A score of 1.0 means the window is one standard deviation from normal on average. The raw score is smoothed with an exponential moving average (EMA) to avoid false alarms from single noisy windows.

Adaptive thresholds - Warning and alarm thresholds are computed automatically from the calibration data itself: the calibration windows are scored against the baseline, and the thresholds are set at mean + 2 sigma (warning) and mean + 3 sigma (alarm) of those healthy scores. This adapts to the specific motor, load, and sensor without manual tuning. The sliders in the configuration panel show the computed values and can be adjusted manually if needed.

Simulation - The demo streams healthy windows first (baseline confirmation), then switches to broken rotor bar data. The anomaly score should rise and trigger warnings/alarms after the transition.

Configuration


2.0
3.5
0.3
Loading data...

Anomaly Score

0.00
NORMAL

Live Envelope

Monitor Log

Ready.

Data preparation

Generate the streaming data from the existing motor current dataset:

python packages/dev/tools/python/prepare_monitor_baseline.py \
    --from-json packages/host/www/data/motor_current

This reads the existing train.json/test.json, selects healthy and BRB windows from a similar load region, and writes streaming.json to packages/host/www/data/motor_monitor/. The baseline is computed online in the browser from the first 20 healthy windows.