Projects and News
06-02-2022

Predictive Maintenance of Compressor Water Pumps

An average citizen rarely thinks about how water enters taps or central heating pipes and may not even have an idea of how a compressor water pump works. However, a pump that breaks down is always noticed because it deprives people of the usual domestic comforts such as taking a hot shower or starting a washing machine. In rural areas, access to processed potable water is even more difficult, so people have to rely on underground water, which makes water pumps the only option.  In the case of a damaged pump, some people have to wait for weeks for repair.

It is obvious that preventing damage is easier than repairing it. Like any other machines, water pumps should be properly maintained and/or repaired in a timely fashion. In this project, which was made by our engineer, Sumit Kumar, you’ll learn how to use RSL10 sensors and Neuton to build ML-based predictive models for providing timely maintenance, avoiding serious issues, and extending the life of a compressor pump. Here is a demo to see how the solution works:

Predictive Maintenance VS Reactive Maintenance?

Predictive maintenance is a type of troubleshooting that addresses needs before they turn into problems. This process helps you prevent equipment breakdowns rather than waiting until a concern reveals itself.

 

Reactive maintenance requires far less forethought but can cost a lot. Predictive maintenance requires more planning, but it can pay off in big ways, as we’ll see. Of course, it’s not possible to predict every problem, but you can avoid a lot of unexpected machinery issues.

Importance of water pumps

Water pumps have several areas of use: residential, industrial, and commercial, depending on their features. However, the functions of all these pumps remain the same; they all transport water and other liquids from one place to another.

  

In this project, I used RSL10, the industry’s lowest power Bluetooth® 5 SoC, and several sensors from ON Semiconductor and Bosch.

  

Key Features

  • Arm® Cortex®−M3 Processor Clocked at up to 48 MHz
  • Supply Voltage Range: 1.1 − 3.3 V
  • 384 kB of Flash Memory
  • 76 kB of Program Memory
  • 88 kB of Data Memory
  • ~10 yrs battery operation on deep sleep mode

Advanced Wireless features:

  • Bluetooth 5.2 Certified with LE 2−Mbit PHY (High Speed), as well as Backwards Compatibility and Support for Earlier
  • Supports FOTA (Firmware Over−The−Air) Updates
  • Rx Sensitivity (Bluetooth Low Energy Mode, 1 Mbps): −93 dB
  • Transmitting Power: −17 to +6 dBm
  • Range up to 100 Meters

Sensor Fusion

Sensor fusion is the process of combining sensor  data or data derived from disparate sources so that the resulting information  can be more accurate. Sensor fusion creates a situation in which the whole is much greater than the sum of its parts. These mechanisms provide a way to resolve contradictory situations and allow the development of dynamic sensing strategies. Sensor fusion is also known as (multi-sensor) data fusion  and is a subset of  information fusion.

The concept of data fusion has origins in the evolved capacity of humans and animals to incorporate information from multiple senses to improve their ability to survive. For example, a combination of sight, touch, smell, and taste may indicate whether a substance is edible.

Sensor fusion, machine learning, and connectivity enable context awareness, and context awareness enables a new generation of services.

What is Context?

Context is defined as the circumstances or facts that form the setting for an event, statement, situation, or idea. In software programming, the idea of developing context-aware applications has been around for a while. Context-aware apps examine who, where, when, and what. The software designer uses this contextual information to determine why a situation is happening and then encodes some action in the application.

  

Based on this definition, the four most important categories of information to formulate a context-aware action are:

  • Identification
  • Location
  • Time
  • Activity

Procedure

Step 1: Data Collection

  

  

Note: Vibration means the state of an object moving repetitively back/forward, right/ left or up/down and is generally expressed by Frequency, Displacement, Velocity, and Acceleration.

As shown above, we will set up our data collection stage for our compressor water pump with RSL10 device sensors. To do so, we need to configure our IDE for programming first.

  1. Visit the website https://www.onsemi.com/products/wireless-connectivity/wireless-rf-transceivers/rsl10-sip and download the required IDE and SDK packages.


  

  1. Follow this official manual for importing the CMSIS pack in the OnSemi IDE. https://www.onsemi.com/pub/collateral/evbum2614-d.pdf
  2. Copy the BH160 Sensor Hub example in your workspace.


 

     4. We can modify the example code to build a dataset for our project.

  

Hardware Setup

 

The pump heats, so I tried to use a rough enclosure to protect the RSL10 sensor board from any damage. Once the setup is complete, we are ready to print all the sensor values and prepare our dataset.

printf("%.2f, %.2f, %.2f, %.2f, %.2f, %.2f, %.2f, %.2f, %.2f, %.2f, %.2f, %.2f \n", sensorFusion.h, sensorFusion.p, sensorFusion.b, sensorFusion.xlinear, sensorFusion.ylinear, sensorFusion.zlinear, sensorFusion.xrotate, sensorFusion.yrotate, sensorFusion.zrotate, sensorFusion.pressure, sensorFusion.temperature, sensorFusion.humidity);

The sensor values would be printed on the J-Link RTT Viewer.

Once we are ready with the data collection part, we will proceed to training a Neuton model and running inference.

 

Check out the dataset summary:

 

Step 2: Model Training

On the Neuton platform, upload your dataset, and select 'output' as the target variable.

Neuton by default uses cross-validation which gives perfect metric results for created models. I also uploaded a holdout dataset to measure metrics on data that were not seen during model training.

 

In this case, our goal is to define the action mode on the pump based on provided feature values to solve the classification task.

 

Toggle the DSP option and select Windows size auto selection and start training.
In the automatic mode, the optimal window size will be selected. Also, additional features will be generated from the data and then feature selection will occur.

 

Some minutes after the training begins, we can explore variable-to-target relation features and data analysis charts.

 

The training looks good – our model has 99% Accuracy. Next, we will download the generated TinyML model C library to use on our RSL10 board IDE.

 

Here’s the confusion matrix:

 

Click on the “Download” button.

 

Step 3: Model deployment and Inference

We will place all our header files in the include folder and C files in the src folder for the downloaded Neuton TinyML C library (see below).

 

The important function here is neuton_model_set_inputs(inputs), into which all sensor values are fed. Once the buffer is full of the function, it returns 0 and is ready for inference.

 

Build your project: the build writes .elf binary file, which is to be flashed on the RSL10 device through J-Link Debugger.

 

Set the build configurations for the RSL10 device, and proceed to the “Run” button to flash the RSL10 board.

 

The console should log the following output:

SEGGER J-Link GDB Server V7.58b Command Line Version

To see the output, we can either use the J-Link RTT Viewer or Eclipse IDE terminal viewer. Let's use Terminal in Eclipse OnSemi IDE.

  

We can see the inference output on the terminal:

 

Have a look at the total footprint on the device:

 

The Neuton TinyML model and RSL10 device have proved to be working mission-critical solutions for the compressor pumps industry. With such accurate and reliable TinyML models, there is still ample space left for all other networking and DSP operations. The inference is faster than any other existing tinyML solutions.

 

Note about TensorFlow Lite for MCU

Meanwhile, I created a model using the TensorFlow Lite solution for the Microcontrollers framework. I spent some hours on manual searching for optimal architecture, and I achieved Accuracy=0.935300 and Model Size=12.94kB.Unfortunately, I found that RSL10 SDK does not support C++, hence we cannot run TensorFlow Lite models on this device.

Conclusion

Through this project, I showcased how such tiny sensor-rich low-powered devices can improve lives for the better. Predictive maintenance of compressor water pumps can really save much money for the common man, farmers, and even companies. 

Source code: https://github.com/vilaksh01/RSL10-based-Monitoring-of-Compressor-Water-Pump-Condition- 

Eager to create your own project? Try Neuton for free right now!

Stay updated, join the community
slack