You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Pin assignments map each accelerometer axis to specific analog inputs on the Nano R4
234
-
- Sensitivity and zero-g voltage values come from the [ADXL335 datasheet](https://www.analog.com/media/en/technical-documentation/data-sheets/adxl335.pdf)
235
-
- Reference voltage matches the accelerometer's regulated output voltage
245
+
- Pin assignments map each accelerometer axis to specific analog inputs on the Nano R4 board
246
+
- ADC specifications define the 14-bit resolution and 5V reference voltage used by the Nano R4
247
+
- ADXL335 specifications use calibrated values measured from the actual breakout board
248
+
- The conversion factor translates raw ADC readings to millivolts for processing
249
+
250
+
***__Important note__: ADXL335 breakout boards typically include onboard voltage regulators that convert the input voltage (+5 VDC from the Nano R4) to a lower voltage (usually +3.3 VDC or less) to power the accelerometer chip. This means the actual supply voltage to the ADXL335 may be different from what you expect. The values shown in this code (supplyMidPointmV = 1237.0 and mVperg = 303.0) are calibrated for a specific breakout board and may need adjustment for your hardware.***
236
251
237
252
### Data Collection Timing and Control
238
253
@@ -252,34 +267,36 @@ In this code:
252
267
253
268
### Signal Processing and Conversion
254
269
255
-
Once we have the raw sensor readings, we need to convert them into useful acceleration values. This conversion process transforms the ADC readings into data we can analyze:
270
+
Once we have the raw sensor readings, we need to convert them into useful acceleration values. This conversion process transforms the ADC readings into calibrated acceleration data:
- Timing control maintains consistent sample intervals, which is essential for proper frequency analysis
281
-
- ADC conversion uses the Nano R4's 14-bit resolution that ranges from 0 to 16383
282
-
- Acceleration calculation applies the ADXL335 calibration parameters to get accurate g-force values
296
+
- ADC conversion uses the Nano R4's 14-bit resolution to convert raw readings to millivolts
297
+
- Acceleration calculation applies the calibrated zero-point and sensitivity values to get accurate g-force measurements
298
+
299
+
***__Important note__: For accurate measurements, you should calibrate your specific ADXL335 breakout board by placing it flat on a table with the Z-axis pointing up and measuring the actual voltage outputs. The X and Y axes should read approximately the same voltage (this is your zero-g bias point), while the Z-axis should read higher due to gravity (1g acceleration). The difference between Z-axis voltage and the zero-g bias point gives you the sensitivity in mV/g. This calibration accounts for variations in onboard regulators and manufacturing tolerances.***
283
300
284
301
### Edge Impulse Data Formatting
285
302
@@ -387,9 +404,15 @@ With the data forwarder running, you can now collect training data for your anom
387
404
388
405
Start by mounting the accelerometer securely to the motor housing. You will collect two types of normal operation data:
389
406
390
-
1.**Idle data collection**: With the motor turned off, collect 10 to 15 minutes of "idle" operation data through multiple two second windows. This captures the baseline vibration environment without motor operation. Label all data as `idle` in Edge Impulse Studio.
407
+
1.**Idle data collection**: With the motor turned off, **collect 10 to 15 minutes of "idle" operation** data through multiple two second windows. This captures the baseline vibration environment without motor operation. Label all data as `idle` in Edge Impulse Studio.
408
+
409
+
2.**Nominal data collection**: With the motor running under normal operating conditions, **collect 10 to 15 minutes of "nominal" operation** data through multiple two second windows. Vary motor load conditions slightly to capture different normal operating scenarios. Label all data as `nominal` in Edge Impulse Studio.
410
+
411
+
Edge Impulse can automatically split your collected data into **training (80%) and testing (20%) sets**. The 20 to 30 minutes total of data ensures you have enough samples for both training the model and validating its performance on unseen data.
391
412
392
-
2.**Nominal data collection**: With the motor running under normal operating conditions, collect 10 to 15 minutes of "nominal" operation data through multiple two second windows. Vary motor load conditions slightly to capture different normal operating scenarios. Label all data as `nominal` in Edge Impulse Studio.
413
+

414
+
415
+
After data collection, review the collected samples in Edge Impulse Studio for consistency. Check for proper amplitude ranges and no clipping, verify sample rate consistency and timing accuracy and remove any corrupted or unusual samples from the training set.
393
416
394
417
***__Important note__: The anomaly detection model learns what "normal" looks like from both idle and nominal data. Any future vibration patterns that significantly differ from these learned patterns will be flagged as anomalies. This approach allows the system to detect unknown fault conditions without needing examples of actual motor failures.***
395
418
@@ -401,43 +424,56 @@ Once you have collected sufficient `idle` and `nominal` operation data, the nex
401
424
402
425
Within Edge Impulse Studio, configure the impulse design with appropriate processing and learning blocks. Navigate to the "Impulse design" tab and set up the following blocks:
403
426
404
-
1.**Input Block**: Configure time series data with 2000 ms windows at 100 Hz sampling rate (200 samples per window)
427
+
1.**Input Block**: Configure time series data with window size of 2000 ms, window increase of 80 ms, and frequency of 100 Hz to match your data collection sampling rate.
405
428
2.**Processing Block**: Add "Spectral Analysis" block for frequency domain feature extraction
406
429
3.**Learning Block**: Select "Anomaly Detection (K-means)" for unsupervised learning approach
407
430
431
+

432
+
408
433
#### Feature Extraction Configuration
409
434
410
435
The spectral analysis block extracts relevant features from the raw vibration signals. Configure the following parameters for optimal motor fault detection:
411
436
412
-
-**FFT Length**: 256 points for sufficient frequency resolution up to 50 Hz
413
-
-**Filter**: Low-pass filter with 50 Hz cutoff to focus on motor fault frequencies
414
-
-**Spectral Power Edges**: Define frequency bands covering 0 to 50 Hz for motor characteristics
415
-
-**Analysis Type**: Power spectral density for energy-based feature extraction
437
+
-**Type**: Low-pass filter to focus on motor fault frequencies
438
+
-**Cut-off frequency**: 45 Hz to capture relevant motor vibration characteristics while staying below the Nyquist frequency
439
+
-**Order**: 6 for effective filtering
440
+
-**FFT length**: 256 points for sufficient frequency resolution
441
+
-**Take log of spectrum**: Enable this option to compress the dynamic range of the frequency data
442
+
-**Overlap FFT frames**: Enable this option to increase the number of features extracted from each window
443
+
444
+

416
445
417
446
***__Important note__: The spectral analysis converts time-domain vibration signals into frequency-domain features. This is crucial because motor faults often appear as specific frequency patterns (like bearing wear creating high-frequency components or imbalance showing up at rotational frequency). The K-means clustering algorithm groups similar frequency patterns together, creating a map of normal operation that can identify when new data doesn't fit the established patterns.***
418
447
419
448
#### Model Training Process
420
449
421
450
Follow these steps to train the anomaly detection model using the collected idle and nominal operation data:
422
451
423
-
1.**Generate Features**: Click "Generate features" to extract spectral features from all training data
424
-
2.**Feature Explorer**: Review the feature explorer visualization to verify data quality and feature separation
425
-
3.**Anomaly Detection Setup**: Configure K-means clustering with 32 clusters for pattern recognition
452
+
1.**Generate Features**: Before clicking "Generate features", enable "Calculate feature importance" to identify which frequency bands are most relevant for distinguishing between idle and nominal states. Then click "Generate features" to extract spectral features from all training data. Edge Impulse will process your data and create the feature vectors needed for training.
453
+
2.**Feature Explorer**: Review the feature explorer visualization to verify data quality and feature separation between your idle and nominal classes.
454
+
455
+

456
+
457
+
3.**Anomaly Detection Setup**: Go to the "Anomaly detection" tab in the left menu to configure the machine learning model.
426
458
4.**Axis Selection**: Use "Select suggested axes" to automatically choose the most relevant spectral features
427
459
5.**Start Training**: Start the training process and monitor convergence metrics
428
460
461
+

462
+
429
463
***__Important note__: The feature explorer shows how well your idle and nominal data separate in the feature space. Good separation means the model can clearly distinguish between different operating states. If the data points overlap significantly, you may need to collect more diverse data or adjust your sensor mounting.***
430
464
431
465
The training process creates clusters representing normal motor operation patterns. Any future data that falls outside these established clusters will be identified as anomalous.
432
466
467
+

468
+
433
469
***__Important note__: The 32 clusters create a detailed map of normal operation patterns. Each cluster represents a different "type" of normal vibration signature. When new data doesn't fit well into any existing cluster, it's flagged as an anomaly. More clusters provide finer detail but require more training data.***
434
470
435
471
#### Model Validation and Testing
436
472
437
473
After training completion, validate the model performance using the following methods:
438
474
439
475
-**Live Classification**: Test with new motor data to verify anomaly detection capability
440
-
-**Threshold Tuning**: Adjust anomaly threshold (typically 0.3-0.5) based on desired sensitivity
476
+
-**Threshold Tuning**: Adjust anomaly threshold (typically 0.3 to 0.5) based on desired sensitivity
441
477
-**Performance Analysis**: Review clustering quality and feature importance rankings
442
478
-**False Alarm Testing**: Validate with known normal conditions to reduce false positives
0 commit comments