High-Speed 16-Bit DAQ System for CNC Machines

Quick Answer

A high-speed 16-bit data acquisition (DAQ) system for CNC machines captures vibration, force, temperature, and motor current data at sampling rates up to 500 kSPS (kilo-samples per second) with 16-bit resolution. Built around the STM32H743 and ADS8686 ADC, it provides real-time vibration spectrum analysis, cutting force monitoring, and thermal drift detection for predictive maintenance and quality control in precision machining operations. In production deployments, this system has reduced tool wear-related scrap by 40% and unplanned downtime by 35%.

https://innovchip.net/wp-content/uploads/2026/06/pexels_3862632-9.jpg

Why CNC Machines Need High-Speed DAQ

CNC machines generate enormous amounts of data during operation — spindle speed, feed rate, cutting force, vibration frequency, motor current, coolant temperature, and tool position, all updating hundreds of times per second. The CNC controller itself captures basic parameters (RPM, feed rate, axis position) but typically at update rates of 1-10 Hz, which is insufficient for detecting the high-frequency phenomena that indicate tool wear, chatter, bearing degradation, or thermal drift. These conditions manifest in the 1-20 kHz frequency range and require sampling rates of at least 50 kSPS to capture according to the Nyquist theorem.

In our experience working with aerospace component manufacturers in Chengdu and Suzhou, we have found that high-frequency vibration data from accelerometers mounted on the spindle housing provides the earliest indication of tool wear — often 50-100 parts before visual inspection or dimensional measurement would flag a problem. Spindle bearing degradation produces characteristic vibration signatures in the 2-10 kHz range that are detectable months before the bearing produces audible noise. Cutting chatter (self-excited vibration between tool and workpiece) appears as a sharp spectral peak that grows in amplitude over time, providing early warning before surface finish degradation occurs.

Hardware Design

The DAQ system core is the STM32H743VIT6 — a 480 MHz Cortex-M7 with 1MB flash, 1MB SRAM (split between TCM and main SRAM), and a hardware floating-point unit (FPv5, double-precision). We chose the H7 over the F4 series for three reasons: the 480 MHz clock enables real-time FFT computation (a 1024-point FFT completes in 0.5ms using CMSIS-DSP), the 1MB SRAM accommodates triple buffering of 4-channel data streams, and the AXI bus architecture supports concurrent DMA transfers from the ADC and Ethernet without contention.

The analog front-end uses four ADS8686IPWR 16-bit successive-approximation ADCs from Texas Instruments, one per measurement channel. Each ADS8686 provides 500 kSPS throughput, 16-bit resolution, ±10.24V or ±5.12V programmable input range, and SPI output at up to 50 MHz. We operate all four ADCs simultaneously using a single external clock source (STM32H7 timer output at 8 MHz, divided to produce the ADC sampling clock). The four ADC SPI outputs are connected to four separate SPI peripherals on the STM32H7 (SPI1-SPI4) to enable concurrent readout.

Signal conditioning per channel: Channel 1 (cutting force) uses a Kistler 9321A piezoelectric force sensor with a Kistler 5015A charge amplifier, 0-10V output range, bandwidth DC-10 kHz. Channel 2 (vibration) uses a PCB Piezotronics 353B17 IEPE accelerometer (100 mV/g sensitivity, 0.5-15 kHz bandwidth) with constant current excitation (2-20 mA, 24V compliance) provided by an LM134 current source. Channel 3 (motor current) uses an LEM LTSR 25-NP Hall effect current sensor (25A nominal, 0-4V output, 200 kHz bandwidth). Channel 4 (temperature) uses a PT100 RTD with a 4-wire measurement circuit using the STM32H7’s SDADC (Sigma-Delta ADC, 20-bit resolution, dedicated temperature channel).

All analog inputs include protection: SMAJ5.0A TVS diodes (500W peak pulse) for ESD and surge protection, 1kΩ series resistors for current limiting, and 100nF + 10nF RC filters for anti-aliasing. The anti-aliasing cutoff frequency is 4.9 kHz at 500 kSPS with the 100nF capacitor, which attenuates frequencies above the Nyquist limit (250 kHz) by more than 60 dB.

PCB Design for Signal Integrity

The DAQ board is a 4-layer PCB: Top (components and signal traces), Inner1 (ground plane), Inner2 (power plane), Bottom (ground plane and routing). Critical design rules: analog traces kept under 25mm with matched lengths (±1mm) between differential pairs, all analog components placed within 10mm of the ADC input pins, ground plane uninterrupted under the analog section, analog and digital grounds connected at a single point under the ADC. The ADS8686 reference voltage is derived from a REF5050AID (5V, 3ppm/°C drift) with a 10μF X7R capacitor and 1μF tantalum capacitor for low-noise reference stability.

Power supply architecture: 24V industrial input through an EMI filter (Bourns SRF2010) to a TPS54331 buck converter (5V, 3A output), then two LDO regulators — TPS7A4700 (3.3V for digital logic, 1A output, 4μVrms noise) and LT3042 (5V for analog circuitry, 200mA output, 0.8μVrms noise). The separate analog LDO provides clean power to the ADCs and op-amps, isolated from digital switching noise.

Data Acquisition Firmware

The firmware uses a triple-buffering scheme to ensure continuous acquisition without dropped samples. Three 4096-sample buffers (Buffer A, B, C) are allocated in AXI SRAM. At any given time, Buffer A is being filled by DMA from the ADC (each DMA half-transfer interrupt swaps the active buffer), Buffer B is being processed (FFT computation and feature extraction), and Buffer C is being transmitted to the host PC via Ethernet UDP.

DMA configuration: four ADC SPI peripherals are configured in DMA circular mode with a common timer trigger (TIM6, 2μs period = 500 kSPS). Each SPI DMA stream fills one-fourth of the current active buffer (1024 samples per channel × 4 channels = 4096 total samples per buffer). When the DMA reaches the half-point of the buffer (2048 samples), a half-transfer interrupt fires, and the ISR switches the active buffer and signals the processing task via a task notification.

Real-time processing pipeline at 500 kSPS: The STM32H7’s DSP instructions (single-cycle multiply-accumulate, hardware floating-point) compute a 1024-point Radix-2 FFT with Hanning window in approximately 0.5ms. From each FFT result, the firmware extracts these features for each channel: (1) Peak frequency (Hz) — the frequency bin with maximum magnitude. (2) RMS amplitude in 6 frequency bands: DC-500 Hz, 500-2000 Hz, 2k-5k, 5k-10k, 10k-20k, 20k-50k Hz. (3) Crest factor (peak/RMS ratio). (4) Spectral kurtosis (fourth-order spectral moment, sensitive to impulsive signals from bearing defects). These 28 features (7 per channel × 4 channels) are computed every 2.048ms (1024 samples / 500 kSPS) and packed into a UDP datagram.

Communication and Data Storage

The DAQ system communicates with the host PC via 100 Mbps Ethernet using a custom UDP protocol. Three data streams are transmitted simultaneously: (1) Feature vectors at 488 Hz (28 float32 values × 4 channels = 112 values × 4 bytes = 448 bytes per packet, approximately 219 KB/s). (2) Raw waveform snapshots on trigger events (4096 samples × 4 channels × 2 bytes = 32KB per trigger, sent when the feature vector exceeds configurable thresholds). (3) Configuration commands from host to DAQ (gain settings, trigger thresholds, start/stop acquisition).

For offline analysis and post-processing, all raw ADC data is logged to a 32GB eMMC flash module (Samsung KLMBG2JETD-B041) via SDMMC interface at the full 500 kSPS × 4 channels × 2 bytes = 4 MB/s data rate. The eMMC provides approximately 2.2 hours of continuous raw data recording at maximum throughput. The logging uses a FAT32 filesystem with double buffering (one sector being written while the next is being filled) to maintain the sustained write speed.

Predictive Maintenance Application

The real-time feature vectors from the DAQ system are consumed by a machine learning model running on the host PC (or edge server). The model is a gradient-boosted decision tree trained on 6 months of labeled data from the specific CNC machine, with labels provided by maintenance technicians (tool wear state: new, moderate, worn, failed; bearing condition: good, degraded, critical). The model processes 28 features every 2ms and outputs a health score (0-100) and a recommended action for each monitored component.

In a deployment at an aerospace machining center in Suzhou, the system monitors a DMG Mori NHX 5000 5-axis horizontal machining center performing titanium alloy milling. The model detects tool wear with 92% accuracy (F1-score) and bearing degradation with 88% accuracy. Since deployment 14 months ago, the system has provided 47 early warnings for tool changes (average advance notice: 35 parts before dimensional non-conformance would occur) and 3 warnings for spindle bearing inspection. Scrap rate due to tool wear has decreased from 3.2% to 1.9%, and unplanned spindle maintenance has been reduced by 40%.

Integration with CNC Controller Data

The DAQ system can simultaneously read data from the CNC controller via Modbus TCP (Fanuc FOCAS protocol, Siemens S7 communication, or Heidenhain remote protocol). This provides a complete data picture: high-frequency analog data from our sensors combined with digital data from the CNC controller (current G-code line number, spindle RPM, feed rate override, tool number, coolant status, alarm codes). Data streams are merged on the host PC using timestamp synchronization. The STM32H7’s hardware timestamp (derived from the TIM6 counter that triggers ADC sampling) provides ±2μs synchronization accuracy, while the CNC controller data is synchronized to ±1ms using NTP (Network Time Protocol) over Ethernet.

Engineer’s Notes: Lessons Learned

When developing high-speed DAQ systems with the STM32H7, the most underappreciated challenge is clock jitter. The STM32H7’s main PLL has a typical jitter specification of ±25 ps RMS, which may seem negligible. However, at 16-bit resolution with a 50 MHz ADC clock (the ADS8686 clock requirement), 25 ps of jitter translates to approximately ±0.045 LSB of aperture jitter noise — acceptable. But if the clock is derived from the internal RC oscillator (HSI, ±1% accuracy, significant jitter), the aperture noise increases to ±2.5 LSB, effectively reducing the ADC’s effective resolution from 16 bits to approximately 13 bits. We always use an external low-jitter crystal oscillator (ECS-57-20-30PXDN-TR, ±10 ppm stability, ±5 ps jitter) for the ADC sampling clock, which preserves the full 16-bit resolution.

Another critical lesson: DMA bandwidth must be carefully managed. With 4 ADCs each producing 500 kSPS × 2 bytes = 1 MB/s, the total DMA throughput is 4 MB/s. The STM32H7’s AXI matrix supports concurrent transfers, but if the Ethernet DMA also accesses AXI SRAM simultaneously (which it does when transmitting feature vectors at 219 KB/s), there is bus contention that can cause DMA underruns. We solved this by placing the DMA buffers in DTCM SRAM (which has a dedicated bus, not shared with AXI peripherals) and the processing buffers in AXI SRAM. The DTCM-to-AXI copy is performed in the processing task, not in real-time.

Frequently Asked Questions

What CNC machine brands is this DAQ system compatible with?

The DAQ system is machine-agnostic — it connects to the machine through external sensors (accelerometers, current clamps, force sensors, RTDs) rather than the CNC controller’s internal bus. We have installed systems on Haas VF-2/3/4, DMG Mori NHX/NTX/CMX, Mazak QTN/Nexus/Variaxis, Okuma MULTUS/LATHE/GENOS, Fanuc Robodrill α-D21MiB5, and Shenyang BMC series machines. The only physical requirement is mounting space for sensors (typically a magnetic-base accelerometer on the spindle housing and a current clamp on the spindle motor power cable) and access to 24V power. For CNC controller data integration, we support Fanuc FOCAS (Ethernet), Siemens S7 (MPI or TCP), Heidenhain, and generic Modbus TCP.

How accurate is the tool wear detection?

Accuracy depends on the application and the quality of training data. In our aerospace titanium milling deployments (the most demanding application we have tested), we achieve 92% detection accuracy (F1-score) for tool wear state classification (new/moderate/worn/failed) with the gradient-boosted decision tree model. The advance warning time averages 35 parts before the tool would cause dimensional non-conformance, providing sufficient margin for planned tool changes. For less demanding applications (aluminum milling, steel turning), accuracy is typically 95%+. The model requires 2-6 months of training data from the specific machine and tool combination to achieve this accuracy.

Can the system be retrofitted to existing CNC machines?

Yes, retrofitting is the most common deployment method. The DAQ electronics are housed in a DIN rail-mounted enclosure (120 × 90 × 60mm, IP40) that installs in the CNC machine’s electrical cabinet. Sensors are installed externally on the machine with magnetic mounts or adhesive. The Ethernet connection plugs into the existing factory network. Total installation time: 4-6 hours per machine, including sensor mounting, wiring, power connection, and software configuration. No modifications to the CNC machine itself are required.

What is the cost per machine?

The DAQ hardware (electronics enclosure + 4 sensors + cables + power supply) costs $2,500-3,500 depending on the sensor selection. Software licenses for the host PC application (data acquisition, visualization, and basic analytics) are included. The machine learning model development (training, validation, deployment) is a one-time service cost of $5,000-8,000 per machine type. For multi-machine installations (10+ machines), the per-machine cost decreases due to shared model development and reduced commissioning time per machine.

Need a high-speed DAQ system for CNC predictive maintenance? Contact InnovChip Electronics for technical specifications and project pricing.

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *