Overview
Initiates the system calibration process by generating 1,000 healthy sensor samples, building baseline profiles, and training dual anomaly detection models (legacy 1Hz + batch 100Hz). This is the required first step before monitoring or fault injection.Endpoint
Query Parameters
Asset identifier to calibrate. Defaults to
Motor-01 if not specified.Calibration Process
The calibration runs as a background task with the following phases:Phase 1: Burst Data Generation (Instant)
Generates 1,000 healthy sensor samples with timestamps spread across the last hour:- Voltage: 230V ± 2V (Range: 226-234V)
- Current: 15A ± 1A (Range: 13-17A)
- Power Factor: 0.92 ± 0.02 (Range: 0.88-0.96)
- Vibration: 0.15g ± 0.03g (Range: 0.09-0.21g)
Phase 2: Baseline Profile Construction
Builds statistical profiles for each sensor signal:- Min/Max ranges
- Mean and standard deviation
- 3-sigma thresholds for anomaly detection
Phase 3: Legacy Model Training
Trains 1Hz Isolation Forest on 6 features:voltage_rolling_mean_1hcurrent_spike_countpower_factor_efficiency_scorevibration_intensity_rmsvoltage_stabilitypower_vibration_ratio
Phase 4: Batch Model Training
Trains 100Hz Isolation Forest on 16 batch features (mean, std, peak-to-peak, RMS) extracted from 100-point windows. This model is primary for inference.Phase 5: Healthy Monitoring
Transitions toMONITORING_HEALTHY state and begins generating healthy data with batch-feature ML detection.
Response
Always returns
"started" when calibration begins successfullyHuman-readable confirmation message
New system state:
"CALIBRATING"Example Request
cURL
Python
JavaScript
Example Response
200 OK
Error Responses
IDLE state.
Resolution:
- Call
POST /system/stopto return to IDLE - Or call
POST /system/purgefor a deep reset
Monitoring Progress
PollGET /system/state to track calibration progress:
| Message | Duration | Action |
|---|---|---|
"Generating training data... 500/1000" | ~1-2s | Burst generation in progress |
"Building baseline profile from 1,000 samples..." | ~1s | Statistical profiling |
"Training anomaly model on 1,000 samples..." | ~2s | Legacy model training |
"Training batch-feature model (16-D statistical features)..." | ~2s | Batch model training |
"Calibration complete. Trained on 1000 samples." | Done | State → MONITORING_HEALTHY |
Validation Metrics
After calibration completes, monitor these metrics viaGET /system/state:
State Persistence
Calibration data is stored in:- InfluxDB - 1,000 sensor samples with
source=calibrationtag - In-Memory - Baseline profiles, trained models, degradation state (DI=0.0)
- Disk - Model artifacts are not persisted (retraining on restart)
Use Cases
First-Time Setup
Run calibration immediately after deployment to establish healthy baseline
After Purge
Required after
POST /system/purge to rebuild models from scratchBaseline Drift
Recalibrate weekly/monthly if operating conditions change (e.g., seasonal temperature shifts)
Model Retraining
Retrain models after hardware upgrades or sensor replacements
Performance Characteristics
- Latency: 200ms (calibration runs in background)
- Background Duration: 5-10 seconds
- CPU Usage: High during training phase
- Memory: +50MB for model storage
- InfluxDB Writes: 100 points (every 10th sample)
Related Endpoints
- GET /system/state - Monitor calibration progress
- POST /system/inject-fault - Test detection after calibration
- POST /system/purge - Reset before recalibration