README
Fan Blade Fault Detection
Example Summary
The fan_blade_fault_detection example demonstrates an AI-powered motor/fan fault classification application across TI wireless MCU families (CC13XX, CC27XX, CC35XX) and leverages TI’s Edge AI Studio to enable the development of AI applications capable of efficiently running locally on the device, on the Edge.
The system acquires vibration data from an ADXL355 accelerometer mounted on a brushless DC fan, extracts frequency-domain features on-device, and runs inference using a pre-trained neural network model. On CC27XX/CC35XX devices the inference is accelerated by the Custom Datapath Extension (CDE).
The model classifies the fan’s mechanical state into four classes:
- Class 0: Normal
- Class 1: Blade Obstruction
- Class 2: Blade Imbalance
- Class 3: Blade Damage
This is a single example that supports two runtime modes, selected by TI’s Edge AI Studio over the Device Agent Protocol (DAP) via UART/USB:
- Data Acquisition - streams raw time-domain ADXL355 vibration samples to the host for offline dataset building, model training, and verification.
- Sensor Inferencing (Live Preview) - extracts features on-device, runs the AI model, and transfers the inferred class and per-class output values to the host for real-time visualization in Edge AI Studio.
TI’s Edge AI Studio guides users through the entire AI pipeline with these key steps:
Live Sensor Data Acquisition. Build application-specific datasets by acquiring vibration data directly from the device. Label each instance with the appropriate fault class and define the number of samples per instance and the measurement duration (time).
Model Selection. Select a pre-trained neural network architecture and a suitable device for inference.
Model Training. Select a feature extraction preset and define training hyperparameters such as the number of epochs and learning rate. Feature extraction is supported on the MCU side through the feature extraction library.
- Model Compilation. Compiles the trained AI model into efficient C code optimized for the target device architecture:
- CC13XX devices: Uses the Cortex-M4F processor with standard compilation targeting the ARM instruction set.
- CC27XX/CC35XX devices: Leverages the Custom Datapath Extension (CDE) - hardware instructions that accelerate computation of quantized deep learning neural network layers, crucial for power-efficient edge execution. The CDE is enabled by default and operations are optimized at compilation time.
- Live Inference Results Preview. Flash the complete application (including the compiled AI model) onto the device and run inference on real vibration data with real-time result visualization.
Edge AI Studio
TI’s Edge AI Studio is a collection of tools that provide a fully integrated graphical user interface solution for collecting and annotating data, training and compiling models for deployment on live development platforms. Users can select from a variety of pre-trained models in the TI Model Zoo and optionally re-train them with custom data to improve accuracy and performance.
Prerequisites
Please go through the Release Notes to make sure you consider all the correct hardware and software dependencies.
Project Structure
- ai_artifacts
- Contains the AI neural network model header file
tvmgen_default.h, the pre-compiled model codemod.a, anduser_input_config.h. These files are regenerated each time a new model is trained through TI’s Edge AI Studio.
- Contains the AI neural network model header file
- feature_extraction
- Application wrapper around the feature extraction library:
FeatureExtract_config: Initializes the on-device feature extraction pipeline for the fan-fault model.FeatureExtract_run: Executes one frame of feature extraction. For each of the 3 axes the pipeline removes the DC component, applies a Hann window, computes a 256-point FFT, bins the magnitude spectrum (16 bins of 8) and applies 20·log10 scaling. The per-frame features are concatenated across an 8-frame rolling history to form the model input tensor.FeatureExtract_findClass: Determines the labeled fault class from the model’s output vector (argmax).
core: The device-independent feature extraction library sources compiled with the example -feature_extract.c(alloc/init/run plus all DSP stages) andfeature_extract_fft_cmsis.c(the FFT stage via CMSIS-DSP). The application wrapper above is the only intended entry point.
- Application wrapper around the feature extraction library:
- sensor
Sensor_init: Initializes the sensor task, opening SPI and GPIO and configuring the ADXL355 (range, power control, interrupt map).Sensor_getData: Collects one frame of interleaved XYZ samples from the ADXL355 on each data-ready (DRDY) interrupt and copies it to the caller’s buffer.
- fan_blade_fault_detection
- Main application task that processes input from TI’s Edge AI Studio through the Device Agent Protocol (DAP) to operate in different modes. Supported modes:
- Live preview of raw sensor data acquisition.
- Live preview of sensor inferencing.
- The Device Agent Protocol (DAP) is a UART-based serial communication protocol that enables interaction between TI’s Edge AI Studio (the host) and supported devices.
- Main application task that processes input from TI’s Edge AI Studio through the Device Agent Protocol (DAP) to operate in different modes. Supported modes:
Peripherals & Pin Assignments
When this project is built, the SysConfig tool generates the TI-Driver configurations into the ti_drivers_config.c and ti_drivers_config.h files and the TI-EdgeAI configuration into the ti_edgeai_config.c, ti_edgeai_config.h and ti_edgeai_fe_config.h files. Information on peripheral configuration, resources and parameters used is present in the generated files. The System Configuration file (*.syscfg) in the project may be opened with SysConfig’s graphical user interface to inspect the resources used.
- SPI - controller interface to the ADXL355 accelerometer in 3-pin mode (SCLK, PICO, POCI).
- GPIO - chip select (CS) line for the ADXL355, driven manually.
- GPIO - data-ready (DRDY) input from the ADXL355, configured as an interrupt.
- UART - Device Agent Protocol (DAP) link to the host at 115200 baud.
BoosterPacks, Board Resources & Jumper Settings
For board specific jumper settings, resources and BoosterPack modifications, refer to the Board.html file.
- The accelerometer used is the ADXL355 connected over SPI.
- The fan under test is the EF80251S1-1000U-A99 DC brushless (BLDC) fan.
Example Usage
- Hardware Setup
- Connect the ADXL355 accelerometer (SPI peripheral) to the device’s SPI interface (SPI controller) in 3-pin mode:
- Controller SCLK -> Peripheral SCLK
- Controller PICO -> Peripheral PICO
- Controller POCI <- Peripheral POCI
- Controller CS (GPIO) -> Peripheral CS
- Connect the sensor data-ready pin (DRDY) to the designated GPIO interrupt pin.
- Power the sensor from the board’s regulated 3.3V and ensure a common ground.
- Secure the accelerometer to the top of the fan/motor under test for accurate vibration coupling.
Important: Ensure the sensor supply does not exceed its rated voltage and that the digital ground and power are connected to the respective pins on the sensor.
Connect the Launchpad to the XDS110 debug probe.
Connect the XDS110 debug probe to the PC over USB.
The connection will have the following settings by default:
Baud-rate: 115200
Data bits: 8
Stop bits: 1
Parity: None
Flow Control: None
Build, load, and run the application on the device.
Go to TI’s Edge AI Studio and open the fan blade fault detection example.
Select the correct serial COM port and the default baudrate (115200), then connect to the device.
- Follow the steps defined by TI’s Edge AI Studio:
- In Data Capture mode, request a capture session to record raw vibration samples for dataset building.
- In Live Preview mode, click Start Preview to view the predicted class and the per-class output values in real time.
Software Details
- Feature Extraction: feature_extraction pipeline - per-axis DC removal, Hann windowing, 256-point FFT, magnitude binning (16 bins of 8), 20·log10 scaling, and concatenation across an 8-frame rolling history.
- AI Inference: Runs a pre-trained model using the TVM runtime - on the Cortex-M4F processor for CC13XX devices, and accelerated by the Custom Datapath Extension (CDE) on CC27XX/CC35XX devices.
- Frame geometry: 256 samples per axis per frame, 3 axes, with an 8-frame rolling history (2048 samples per axis) per inference.
- Data framing: Raw samples are packed as 16-bit signed integers (high byte first) and streamed in DAP frames over UART at 115200 baud.
- AI model used: Model details are available on the Model Zoo.
Notes
- Ensure the ADXL355 sensor is properly powered and connected.
References
- ModelZoo Example
- TI Neural Network Compiler Guide
- TI Model Training Guide: tinyml-tensorlab
- EdgeAI Software Guide: SDK_INSTALL_DIR/docs/english/middleware/edgeAI/EdgeAI_User_Guide.html