Skip to content

Repository files navigation

Edge AI Predictive Maintenance Node

An embedded machine learning proof-of-concept deploying a quantized neural network onto an STM32 NUCLEO F401RE microcontroller for real-time motor anomaly detection.

This project bridges hardware and machine learning by analyzing high-frequency mechanical vibrations to detect physical imbalances before catastrophic failure occurs, a core concept in industrial Predictive Maintenance (PdM).

⚙️ Hardware Architecture

  • Microcontroller: STM32 Nucleo-64 (ARM Cortex-M core)
  • Motor Driver: L298N Dual H-Bridge (interfacing the MCU logic with the high-current DC motor)
  • Sensors: External vibration/motion sensor - MPU6050
  • Communication: UART Serial Communication configured for high-throughput data streaming (460800 Baud Rate).

🛠️ Software & Toolchain

  • Development Environment: STM32CubeIDE (C/C++)
  • AI Middleware: Nano Edge AI Studio for converting and deploying the quantized neural network to the MCU.
  • Model Architecture: Binary classifier trained on nominal and imbalanced mechanical states.

🧠 Machine Learning Implementation

The model continuously evaluates real-time sensor telemetry against two established classifications:

  1. Class 1 (Nominal): High-frequency vibration of a balanced, healthy motor.
  2. Class 2 (Anomaly): Mechanical imbalance characterized by violent, out-of-distribution physical harmonics.

Note: The model strictly evaluates these two states. Out-of-distribution handling noise (e.g., manual sensor movement) may default to Class 1 due to low-frequency features failing to cross the Class 2 mathematical threshold.

🚧 Engineering Constraints & Design Decisions

Deploying AI on resource-constrained microcontrollers requires strict memory management.

  • Memory Optimization: Floating-point operations for printf via newlib-nano were explicitly bypassed. Instead of processing float arrays for classification probabilities, the output logic was streamlined into lightweight string literal transmission.
  • Performance: This prevented heap/stack overflow and reduced the binary footprint, ensuring the real-time inference loop executed without bottlenecking the 460800 baud UART transmission.

🔬 Physical Test Rig & Data Collection

To train and validate the Edge AI model, a physical test rig was constructed:

  • Sensor Coupling & Signal Integrity: The vibration sensor was mechanically coupled directly to the motor chassis using high-density foam mounting tape.
  • Strict care was taken to compress the mounting interface and eliminate all air cavities, preventing signal attenuation and ensuring the high-fidelity transfer of physical motor harmonics to the sensor.
  • Inducing the Anomaly: The "Imbalance" state (Class 2) was synthetically generated by attaching an asymmetric mass to the motor shaft, simulating a degraded rotor or damaged bearing in an industrial setting.

🚀 How to Run the Project

  1. Clone this repository to your local machine.
  2. Import the .cproject / .project files into an STM32CubeIDE workspace.
  3. Ensure the target STM32 Nucleo board is connected.
  4. Build the project and flash the binary to the MCU.
  5. Open a serial monitor (e.g., TeraTerm, PuTTY) configured to 460800 baud.
  6. Observe the real-time terminal output classifying the physical motor state.

📺 Demonstration

project photo 1 proejct video 1

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages