How To Perform Fault Classification With an AI-Based Vibration Sensor Node
Learn how to use edge AI technology to do predictive maintenance, leveraging machine learning, vibration sensors, and wireless connectivity.
Many industrial plants rely on motors to perform production processes. Motors are vulnerable to failures due to effects such as structural loosening, damaged bearings, angular and linear misalignment, corrosion, resonance, and load imbalance.
Any of these can cause long machine downtime. Preventing such failures has been a perennial challenge for manufacturing businesses, as they seek to minimize costs and boost productivity.
Schedule-based maintenance strategies can achieve these goals by adjusting and replacing parts and subsystems at predetermined intervals. Unfortunately, schedule-based maintenance can result in unnecessary maintenance. Condition-based maintenance, on the other hand, improves efficiency and uptime by adjusting the maintenance and repairs according to actual equipment condition.
Sensors for Predictive Maintenance
Predictive maintenance (PdM) can deliver further improvements. It has become possible, using the latest high-accuracy inertial sensors and low-power, high-performing edge AI devices with short- or long-range wireless connectivity to continuously collect and analyze the critical machine data in real-time for this purpose (Figure 1).
Figure 1. It doesn’t take much space or power to combine vibration and MEMS temperature sensors, power management, a secure element, and an STM32 MCU running a machine-learning library, to monitor equipment and detect faults.
In this context AI offers several advantages enabling real-time and distributed data analysis and identifying potential issues before they escalate. This proactive approach minimizes downtime, reduces maintenance costs, and extends the lifespan of machinery by addressing problems precisely when needed, optimizing overall operational efficiency.
To monitor these machines, data from motion sensors (accelerometer, gyroscope), processed by different algorithms, can continuously analyze the motors’ vibrational state during their use in production.
Predictive Maintenance with Machine Learning
The main pillar of predictive maintenance is condition monitoring. A classical approach to condition monitoring, using digital 3-axis micro electro-mechanical systems (MEMS) sensors, relies on a microcontroller (MCU) operating as the control unit to drive the power management, perform data logging functions, and then process data using conventional time and frequency domain analysis.
When machines are operating correctly, the monitored vibrations conform closely to standard analytical models. To predict any drift tending towards a fault, the PdM implementation must evaluate the equipment status by comparing vibration data with predefined thresholds.
This classic method has limitations because it requires in-depth mechanical and mathematical models of the system and programming knowledge to build algorithms and rules. Furthermore, analytic models, algorithms, and thresholds have limited flexibility. If the resources or working conditions were to change, the rules would have to be rewritten.
In the case of AI-based methodologies, neural network models and machine-learning algorithms allow systems to learn continuously from data and to refine their models accordingly. When the equipment conditions change, the predictive model’s accuracy and performance can be enhanced with no need to tune algorithms or understand process rules.
Reference Design Kit
In this article, we present a system solution based on the STEVAL-PROTEUS1 reference design kit, an industrial wireless sensor node with a compact form factor. The design kit integrates MEMS sensors, Bluetooth connectivity, and an embedded AI library to detect anomalies and classify faults in monitored equipment. It sends results to a PC terminal console via USB cable, or wirelessly to an associated mobile app, STBLESensor. This app presents the results graphically and shares the data with the cloud (Figure 2).
Figure 2. Equipment monitoring for predictive maintenance
The challenge is the early detection, using an n-classification machine learning model, of those mechanical drifts that are usually detected late. Our goal is to identify and classify the insertion of linear misalignments with incremental sizes, with “tens-of-mm-level” precision.
Reference Design Architecture
The STEVAL-PROTEUS1 kit is an evaluation tool designed for temperature and vibration monitoring in industrial applications. The main board (STEVAL-PROTEUS, Figure 3) includes a certified wireless radio module, a combination of industrial MEMS inertial sensors to enable vibration monitoring, a high-accuracy temperature sensor, power management and protection circuits, and 2 Gb of flash memory for code and data storage.
The board also offers an STSAFE-A110 secure element that provides authentication and secure data management services to a local or remote host. All the components are mounted exclusively on the top side of the PCB to facilitate direct attachment.
The wireless module, STM32WB5MMG, has a small form factor with ultra-low power consumption and an STM32WB55VGY wireless SoC. The SoC contains a 2.4 GHz integrated RF section with an Arm Cortex-M4 core for application processing and a Cortex-M0+ to manage the radio layer. The M0+ can host stacks such as Bluetooth Low Energy (BLE) 5, 802.15.4, Zigbee 3.0, Thread, or proprietary software.
Figure 3. The STEVAL-PROTEUS board
To accelerate application development, the kit comes with a firmware package for anomaly detection and classification ready to run on Cortex-M4. Using the raw data from the inertial sensors, AI algorithms can provide an early warning of any problems such as imbalance or wear.
The embedded AI is a machine-learning library generated with the NanoEdge AI Studio software tool. It starts from a specific dataset generated from the outputs of sensors on the STEVAL-PROTEUS board. NanoEdge AI Studio software extracts a machine-learning library for the required use case—say, anomaly detection or classification—to be integrated in the MCU on the sensor node.
To permit remote awareness of machine status, indicating when anomalies are detected, the node is connected using Bluetooth to the STBLESensor app. The app lets users set sensor and library parameters, control learning and detecting modes, and monitor equipment fault states.
Signal Processing and ML Model Generation
Typically, sensors provide data in a raw form that is unsuitable for conventional predictive maintenance applications. Filtering, reshaping, and other preprocessing methods must be used before a traditional or ML-based algorithm can begin manipulating the data. To design the preprocessing and processing chain optimally, the designer must know the characteristics of the signal.
An STEVAL-PROTEUS node can acquire vibration data from the inertial sensors on-board and process the data directly on the edge using the STM32WB MCU.
In condition monitoring, the sensor signals are a collection of acceleration samples along x-y-z axes. Figure 4 shows the vibrations corresponding to normal machine conditions, expressed in both the time and frequency domains.
Figure 4. Raw and transformed sensor signals. Click image to enlarge
The samples are stored in a circular data buffer implemented in the application firmware. Figure 5 summarizes the logical flow of data production, processing, and sending results.
Figure 5. Sensing, processing, and communication with STEVAL-PROTEUS
In this example, NanoEdgeAI (NEAI) Studio generates a single library that contains the preprocessing blocks and ML model. The tool contains automated machine-learning software that lets embedded developers get started without extensive knowledge of machine learning or data science. It produces a precompiled C library ready to integrate in STM32 MCUs. By following the workflow shown in Figure 6, users can obtain a reliable library using NanoEdge AI Studio.
Figure 6. NanoEdge AI Studio workflow
The objective of this example is to classify motor-shaft misalignments into four severity categories. The first step is to define the four classes. Then, you would acquire accelerometer data using high-speed datalogging firmware to produce the datasets for each class.
An ISM330DHCX accelerometer on the STEVAL-PROTEUS board is configured with a nominal output data rate of 833 Hz and full-scale of 2 g. Several pre-acquisition cycles help identify these parameters for the motor speed to assure the proper sampling frequency and the maximum value of acceleration on the x-y-z axes.
The injected condition defines the dataset:
- No misalignment or nominal condition
- 0.20 mm misalignment
- 0.40 mm misalignment
- 0.60 mm misalignment
Then you need to create an N-class classification NEAI project with STEVAL-PROTEUS1 as the target. The four datasets can then be imported, and benchmarking identifies the best possible model in terms of several performance indicators and memory footprint.
The datasets comprise 423 lines or signals and each of these signals contains 128 × 3 samples. (Note that one sample includes three values corresponding to acceleration measured on the three axes.) The circular buffer is sized according to the signals’ size: that is, 128 × 3 samples for each item.
During benchmarking, NanoEdge AI Studio trains, cross-validates, and tests candidate libraries. It assigns a score to each candidate and provides a ranking when the benchmarking is completed. Figure 7 shows the benchmark plot corresponding to the model selected from the ranking.
Figure 7. Benchmarking the NEAI model
In this example, benchmarking takes 23 minutes. The chosen SEFR (Scalable, Efficient and Fast ClassifieR) model uses about 3 KB of RAM and 4 KB of flash. In other words, NEAI processing takes up 6.4% of RAM and 0.5% of the STEVAL-PROTEUS on-board flash memory. (Note: these percentages are computed considering the available RAM and FLASH for user application using FUS v22.214.171.124 and BLE Full stack v126.96.36.199,)
NanoEdge AI Studio provides several performance indicators that estimate model performance, as shown in Figure 8. Among these indicators, balanced accuracy is one of the most significant values for multi-class classification problems where datasets are balanced. In multi-class classification problems, datasets are balanced if they contain the same number of samples for each class.
Figure 8. Model performance indicators
The signal processing chain comprises a combination of conventional signal-processing functions and the SEFR multi-class classifier machine-learning algorithm to recognize the four levels of misalignment (Figure 9).
Figure 9. Signal-processing chain enhanced with AI. Click image to enlarge
Next, a software function pack (FP-AI-PDMWBSOC) helps accelerate ML model deployment on the MCU (STM32WB). Developed for STEVAL-PROTEUS1, this pack integrated the NEAI library in an environment suitable for managing different kinds of sensors and connectivity.
Within a sensor manager module, several sensor threads deal with sensor initialization, configuration, and data production. A data builder can take a small amount of data coming from a sensor task and manipulate this to fill a circular buffer. Later, the NEAI thread processes data when an item is ready.
This enables data to pass through the processing chain as described earlier. The STEVAL-PROTEUS node shares the results, reduced to a few bytes, via the Bluetooth connection to a client device such as a smartphone.
System Setup and Results
The fault classification solution can be validated using a professional test bench such as the OneX tool, developed by ISE. This can simulate the most common faults of a motor such as shaft misalignment, unbalanced loads, structural looseness, and bearing damage.
The test bench contains a motor and driver with a mechanical coupling and shaft, weighted disks to simulate imbalance, and three bearings. The bearing housings allow controlled misalignments to be applied, or damaged bearings to be installed, for analysis.
Figure 10. Test setup with OneX tool
We attached the STEVAL-PROTEUS node to the second bearing as shown in Figure 10. The motor speed was set to 3000 rpm. Testing then introduced progressively greater misalignment of the bearing shaft, keeping other experimental parameters identical. The PROTEUS node recognized misalignment correctly in all four categories and communicated the results to the smartphone app.
Figure 11. The results, as shown on the mobile app. Click image to enlarge
As Figure 11 shows, the mobile app displays a number corresponding to the recognized condition. The app also takes care of sharing the results with the cloud.
Further testing to apply other motor faults using the same procedure to generate appropriate ML libraries, showed that inferencing with the PROTEUS node can also correctly recognize normal and unbalanced loads, mechanical looseness, and bearing faults.
Early Detection of Equipment Misbehavior
IoT sensor nodes, enhanced with artificial intelligence (AIoT), improve the effectiveness of predictive maintenance applications by supporting early detection of drifts in the behavior of industrial equipment.
The sensor-rich STEVAL-PROTEUS node, combined with an inferencing application developed using NanoEdge AI Studio, can detect anomalous vibrations and correctly identify the magnitude of misalignment according to the severity.
The sensor and application can quantify shaft misalignment on the order of tenths of a millimeter, or imbalances of less than one gram. In addition, the node’s Bluetooth connectivity enables remote monitoring inside and outside the factory by including a Bluetooth Low Energy gateway in the system solution.
All images used courtesy of STMicroelectronics
Industry Articles are a form of content that allows industry partners to share useful news, messages, and technology with All About Circuits readers in a way editorial content is not well suited to. All Industry Articles are subject to strict editorial guidelines with the intention of offering readers useful news, technical expertise, or stories. The viewpoints and opinions expressed in Industry Articles are those of the partner and not necessarily those of All About Circuits or its writers.