
Introduction
Data and analytics are used in predictive maintenance to foretell when equipment may fail. Predictive maintenance can help you save money by spotting possible issues before they become costly problems and require repairs. Monitoring the device’s temperature, sound levels, and vibration level are three methods for anticipating machinery failure, each of them being appropriate for a certain type of machinery. Vibration data is a great dimension to monitor in machinery that has moving parts. When such machinery starts manifesting anomalous vibration patterns, a possible malfunction may have occurred and critical equipment failure may be inbound. Such modifications may take place over a span of hours or days and they are seldom picked up by human operators. By harnessing IoT devices and machine learning algorithms, such phenomena can be detected and maintenance teams may be alerted before machinery failure takes place.The Challenge
In industrial settings, compressors are used to provide air to power air tools, paint sprayers, and abrasive blast equipment, to phase shift refrigerants for air conditioning and refrigeration and to propel gas through pipelines. Fundamentally, an air compressor is a pump that pulls air from the atmosphere and pressurizes it into a reducing volume. The two most common types of compressors are piston compressors, in which a piston moves up and down in a cylinder, drawing air on the downstroke, and rotary screw compressors that employ a set of helical screws to draw air from the atmosphere. In our application, the compressor is used in a laser cutting machine to eliminate all the debris and cool the material at the point of contact between the workpiece and the laser beam. Failure of doing this may lead to ruining the workpiece, as the material will warp near the laser beam and also pose a structural risk to the whole machinery as the debris might accumulate and ignite from the heat. There are not many ways of preventing such accidents from happening, except doing routine preventive maintenance procedures on the compressor unit, like changing the oil, the gaskets and the tubing.Our Solution
The whole principle of operation of a compressor being based on moving parts, any eccentricity or imbalance will be characterized by a different vibration pattern compared to normal functioning regime. To address this, we will be developing a predictive maintenance solution that gathers vibration data from an oil-less compressor and uses machine learning algorithms to detect if the piston is unbalanced or if the compressor manifests an anomalous behavior.Hardware Requirements
- Nordic Thingy:53
- USB-C cable
Software requirements
- nRF Programmer Android/IoS App
- Edge Impulse account
- Edge Impulse CLI
- Git
Hardware Setup
For this application, we will be using the Thingy:53, a prototyping platform developed by Nordic Semiconductor, based on the nRF5340 SoC, packed with temperature, humidity, AQ and color sensors, alongside a high precision accelerometer and a MEMs microphone.
Software Setup
Creating an Edge Impulse Project
Let’s start by developing an Edge Impulse project. Log into your Edge Impulse account, pick Create new project from the menu, give it a recognizable name, choose Developer as the project type, and then click Create new project.
Connecting the Device
The Nordic nRF Edge Impulse iPhone and Android apps will work with new Thingy:53 devices right out of the box. The firmware of Thingy:53 needs to be updated before it can be connected to the Edge Impulse project. Launch the nRF Programmer mobile application after downloading it from Apple Store or Google Play. You will be presented with several available firmware that can be uploaded on the board..jpg?fit=max&auto=format&n=Nm5pkV8HYHPDwlJp&q=85&s=007c7ce4ffe394237be398d88f956ad5)


Building the Dataset
After the board shows up in the Devices tab, navigate to the Data acquisition to start gathering data. Your device will show up in the Record new data window. Write down a label that corresponds to the phenomenon you are capturing, use 10000ms as the Sample length, Accelerometer as Sensor and use a Frequency of 100Hz. With everything set up, tap Start sampling.




Designing the Impulse
After the datapool is populated, it’s time to create the Impulse. An Impulse is an abstraction of the process of gathering data, processing it, feeding it into a neural network and outputting it, each step of the process being customizable.
Configure the Spectral Analysis Block
The Spectral Analysis block is used to extract the frequency and power characteristics of a signal. Low-pass and high-pass filters can be used in this block to eliminate undesirable frequencies. As with our use case, this block typically performs well when decoding recurrent patterns in a signal, such as those caused by the vibrations or motions picked up by an accelerometer unit.


Configure the NN Classifier
The NN Classifier block’s configuration is the next phase in the development of the machine learning algorithm. The number of training cycles, learning rate, size of the validation set, and whether or not the Auto-balance dataset function is enabled are just a few of the factors that can be modified. They provide users control over the number of epochs the NN is trained on, how quickly the weight of the links between neurons is modified each epoch, and the proportion of samples from the training dataset that are used for validation. The architecture of the NN is detailed underneath. Leave everything on default settings for the time being and click Start training.

Configure the Anomaly Detector
A secondary neural network called the Anomaly Detector will be used to identify data that does not fall into any of the categories we established in the previous step. By enabling the Generate Feature importance during the Generate Feature step, the users can greatly improve the performance of this Neural Network and drastically reduce the processing resources needed for using it.

Model Testing
The Model Testing tab allows users to quickly evaluate how the machine learning model fares when presented with new data. The platform uses the data available in the Test data pool, defined during the data acquisition phase and evaluates the performance of the model.

Deploying the Model on the Edge
Upload the Impulse via USB Cable
Edge impulse allows its users to export the machine learning model they have just created in the form of a pre-compiled binary that can be easily uploaded on the board, without going through the effort of building custom firmware for it. To do so, click Build and wait for the process to end. Once it’s done, download the .hex file and follow the steps in the video that shows up to upload it on the Thingy:53 board.
Upload the Impulse via Android/iOS App
An alternative and easy way of quickly deploying the model on the edge is using the Nordic nRF Edge Impulse app for iPhone or Android:- Download and install the application from Google Play/Apple Store.
- Launch the application and login with your Edge Impulse credentials.
-
Select your Predictive Maintenance project from the list:
-
Navigate to the Devices tab and connect to the Thingy:53:
-
Navigate to the Data tab and press Connect. You will see the status on the button changing from Connect to Disconnect.
-
Navigate to the deployment tab and press Deploy.
-
In the Inferencing tab, you will see the results of the Edge Impulse model you have flashed on the device:
EON Compiler and Resource Optimization
The EON compiler enables you to run NN with up to 35% less storage and 25-55% less RAM without compromising model performance. At the bottom of your project’s deployment page, on all supported boards, this feature is automatically turned on.

Conclusion
