Back to Work

Digital Twin — CNC Acoustic Emission Monitoring

Edge-deployed machine learning system for real-time ductile vs. brittle classification on a HAAS CNC mill using acoustic emission sensors and TinyML.

ArduinoTFLitePythonBLESignal ProcessingSTM32

The Problem

Computer Numerical Control (CNC) machining operations rely on operator experience and scheduled tool changes to manage tool wear — a reactive approach that leads to scrapped parts, unplanned downtime, and wasted tooling budget. Acoustic Emission (AE) sensors can detect the subtle ultrasonic signatures of cutting mode transitions in real time, but processing that data typically requires expensive proprietary Data Acquisition (DAQ) systems like MISTRAS or AEwin costing $4,700–$7,500. For a university research lab running a HAAS VF-2YT mill, that budget doesn't exist.

The research question: can a low-cost edge computing stack — microcontrollers, open-source Machine Learning (ML), and off-the-shelf sensors — classify ductile vs. brittle machining modes in real time, enabling closed-loop feedback control without cloud dependency or proprietary hardware?

What I Built

This is an academic research project at Texas State University under Dr. Sachin Shendokar (Manufacturing Engineering), inspired by Lee et al.'s 97.37% accuracy on ductile-brittle classification using Acoustic Emission + Convolutional Neural Networks (CNN). The project has two phases: a completed wireless proof of concept, and a production deployment targeting the HAAS VF-2YT that reached first captures before pausing in June 2026.

Proof of Concept: Musical Notes Classifier

Before investing in AE sensors, I validated the entire edge-inference pipeline using audio data. A 12-class musical note CNN was trained in Python using TensorFlow, quantized to INT8 (176 KB), and deployed on an Arduino Nano 33 Bluetooth Low Energy (BLE) Rev2 with a MAX9814 external microphone. The Nano captures audio, runs a Fast Fourier Transform (FFT) on-device, feeds frequency features into the CNN, and transmits predictions over BLE to an ESP32-WROOM-32 WiFi bridge. The ESP32 pushes results to any browser on the local network via WebSocket. This three-hop architecture — Nano → BLE → ESP32 → WiFi → Browser — validated that real-time edge ML classification over a wireless link is feasible on $30 worth of hardware.

Production Target: Ductile vs. Brittle Classification

The production system replaces the Nano with an STM32F746 Discovery board ($55) — its 2.4 MSPS Analog-to-Digital Converter (ADC) can sample up to 1.2 MHz Nyquist, which is essential for capturing AE signals in the 100–500 kHz band that characterize aluminum machining. A KRN KRNBB-PCP broadband AE sensor (with built-in preamplifier) mounts directly on the HAAS VF-2YT, feeding conditioned signal through a voltage divider into the STM32's ADC. The CNN will be retrained on real machining data across four classes: ductile (continuous chip formation), brittle (chip fragmentation), transition/chatter (unstable cutting), and idle.

The planned data collection follows Lee et al.'s methodology: sweeps across 5 spindle speeds (12,000–18,000 RPM), 5 feed rates (5–35 micrometers per second), and 3 tool diameters (0.5–1.0 mm) on Al 6061 aluminum — 56 parameter combinations targeting 200+ labeled samples. What exists so far is the first slice of that: 11 capture sessions of 30 events each recorded on the HAAS VF-2YT in May 2026, of which one is a real cut on 6061-T6. The contrast classes the classifier needs are the next capture campaign, not a finished dataset.

Budget Impact

The hardware pivot from commercial DAQ to microcontrollers saved 54–72% of the original budget:

  • AE Sensor + Preamp: $1,500–$3,000 → $300–$700
  • DAQ Hardware: $1,000–$1,500 → $65 (STM32F746 + ESP32-S3)
  • DAQ Software: $1,000–$1,500 → $0 (open source)
  • Total: $4,700–$7,500 → $1,498–$2,148

Known Issues

A confidence calibration bug in the wireless pipeline puts values above 1000% on the browser dashboard, likely from incorrect INT8 dequantization in the BLE or WiFi bridge firmware. A second defect sits in the analysis path: the push script computes a 2048-point Fast Fourier Transform, giving 488 Hz bins, so the band reported as 100–400 kHz actually covers 50–200 kHz. The raw captures are unaffected — only the band label and the derived band math. Both are open.

Tech Stack

STM32F746 Discovery (production), Arduino Nano 33 BLE Rev2 (Proof of Concept (POC)), ESP32-WROOM-32 (WiFi bridge), KRN KRNBB-PCP AE sensor, TensorFlow 2.16 + TFLite Micro, Python ML pipeline (FFT, mel-spectrogram, training, INT8 quantization), C++ Arduino/STM32 firmware, WebSocket browser dashboard. Academic research under Dr. Sachin Shendokar at Texas State University, Ingram School of Engineering.

Development Timeline

Jan 2026

Literature Review

14,500-word review covering 34 sources in IEEE format. Established theoretical foundation for AE-based ductile-brittle classification with TinyML.

Feb 2026

Hardware Analysis

Documented Nano 33 BLE limitations (100 kHz Nyquist — insufficient for AE). Built sensor-board compatibility matrix. Recommended STM32F746 as production platform.

Mar 6, 2026

Notes CNN Deployed

12-class musical note classifier trained, INT8 quantized (176 KB), and running real-time inference on Nano 33 BLE with external mic. Validated that edge ML pipeline works.

Mar 9, 2026

Wireless POC Validated

Full pipeline working end-to-end: Nano (mic→FFT→CNN→BLE) → ESP32 (WiFi AP) → Browser dashboard. Proved wireless architecture is viable for production.

Mar 14, 2026

Hardware Procurement

STM32F746, ESP32-S3, piezo test kit, and cables ordered; AE sensor sourcing settled on STEMINC PZT discs.

May 27, 2026

Signal Chain and First Captures

Sensor mounted on the HAAS VF-2YT and the capture path run end to end at 1 MSPS: 11 trial sessions of 30 events each, spanning machine-off, idle at five spindle speeds, and two preamp gain settings — including one real cut on 6061-T6 aluminum. Validity check on the first idle baseline came back clean.

May 31, 2026

Makerspace Closeout Submitted

Closeout package delivered: project report, operating manual, closeout brief, supporting figures, video deliverables, and a curated snapshot of every source file the documents reference.

Jun 17, 2026

Monitoring Pi Rebuilt

Dashboard host reflashed to Ubuntu Server 24.04 with the deploy bugs from the previous build backported. The platform itself was not redeployed onto it before the pause.

Since Jun 2026

Paused

Work stopped after the rebuild and has not resumed. Remaining to close the research question: a contrast-class capture campaign across real cuts at multiple feeds, speeds, depths, and materials; a classifier trained on that data without label leakage; and the platform deployed onto the monitoring Pi. The 13-section article is drafted and awaiting advisor review.