cancel
Showing results for 
Search instead for 
Did you mean: 

How to implement an air blower state recognition with IIS2DULPX

Denise SANFILIPPO
ST Employee

Introduction

This article showcases the complete workflow for deploying a decision tree trained for air blower state recognition. The hardware used is within the ST MEMS sensor, IIS2DULPX, embedding the machine learning core (MLC) using the software tool MEMS Studio.

1. Air blower state recognition

The following steps explain how to use MEMS Studio and the motherboard STEVAL-MKI109D to collect accelerometer data from a device. In this case, an air blower operating in various modes:

  • OFF (disconnected from the power source)
  • LOW-speed (connected to 12 volts)
  • HIGH-speed (connected to 15 volts)
  • CLOGGED (connected to 15 volts but clogged with a filter)

The collected data are used to train a decision tree model. The decision tree model is subsequently deployed on a sensor equipped with a machine learning core (MLC) to classify the air blower's operational state. This setup facilitates, for example, monitoring air blower performance and detecting potential issues, enhancing predictive maintenance capabilities.  

2. Prerequisites

To reproduce all steps in this article, the following software and hardware components are required.

2.1 Hardware

STEVAL-MKI109D: an STM32-based motherboard designed for evaluating STMicroelectronics MEMS sensors.

Figure 1: STEVAL-MKI109DFigure 1: STEVAL-MKI109D

 

 

IIS2DULPX DIL24 adapter board (STEVAL-MKI246KA):  An adapter board for the IIS2DULPX sensor, a digital 3-axis linear accelerometer. The MEMS and ASIC of IIS2DULPX have been expressly designed to combine the lowest supply current possible with features such as always-on antialiasing filtering, a finite state machine (FSM), and machine learning core (MLC) with adaptive self-configuration (ASC), and an analog hub/Qvar sensing channel. The board is connected using a cable to the STEVAL-MKIGIBV5 adapter board to render it compatible with the DIL24 socket of STEVAL-MKI109D.

Figure 2: STEVAL-MKI246KAFigure 2: STEVAL-MKI246KA

 

The air blower used for this demonstration is model VHS0065XUFBS from manufacturer ebmpapst. Further information about this device can be found here (pages 156-157).

Figure 3: STEVAL-MKI246KA mounted onto the Air blowerFigure 3: STEVAL-MKI246KA mounted onto the Air blower

2.2 Software

MEMS Studio: a complete desktop software solution designed to develop embedded AI features, evaluate embedded libraries, analyze data, and design no-code algorithms for the entire portfolio of STMicroelectronics MEMS sensors.

3. Training and validating the dataset acquisition

The initial step involves acquiring data to facilitate the creation of machine learning core (MLC) classes and the construction of a decision tree. STEVAL-MKI109D, with the sensor adapter mounted, can be used with MEMS Studio to collect multiple data logs for each activity the MLC is intended to classify.

NOTE: The dataset located in the “data” folder can be utilized to create an example MLC configuration, which can subsequently be verified via the data injection feature.

Connect the STEVAL-MKI246KA to the STEVAL-MKIGIBV5 adapter board using a cable to ensure compatibility with the STEVAL-MKI109D evaluation platform. Once connected, insert the STEVAL-MKIGIBV5 adapter into the DIL24 socket on STEVAL-MKI109D. Connect the STEVAL-MKI109D to your computer via USB.

Figure 4: Connection of the boards to the PCFigure 4: Connection of the boards to the PC

 

Flash the latest firmware, located within the MEMS Studio installation folder at: <mems-studio_folder>/firmware/mems-studio/steval-mki109d/, to enable communication between MEMS Studio and the sensor. Navigate to the "Firmware Programming" page. Connect the device (select the DFU interface and switch the device into DFU mode to establish a connection). Click the [Firmware Directory] button (this action will locate the firmware folder) and then select the "steval-mki109d" binary. Click the [Program] button. The programming action should execute and display the result (status).

Figure 5: MEMS Studio - Firmware ProgrammingFigure 5: MEMS Studio - Firmware Programming

 

NOTE: This can be also achieved through STM32CubeProgrammer.
 
In MEMS Studio, go to the "Connect" page, select "Serial" as the communication type and the serial port the board is connected to as the "communication port", then press [Connect]. Search and [Select] the "STEVAL-MKI246KA (IIS2DULPX)."6.png

Navigate to the "Sensor Evaluation" page and select the "Quick Setup" tab to configure the sensor according to your preferences (or select easy configuration). Press the ▶ button in the top-left corner to begin streaming data from the sensor.

Figure 7: MEMS Studio - Quick setupFigure 7: MEMS Studio - Quick setup

 

Navigate to the "Save to File" tab. Select a save path for the CSV log within the data/<id>_<activity> folder (where <activity> corresponds to the desired activity name and <id> corresponds to the numeric identifier used for its classification). Select [Accelerometer] in the "Data" section.

Figure 8: MEMS Studio - Save to FileFigure 8: MEMS Studio - Save to File

 

Use the [Start] and [Stop] buttons to initiate and terminate data collection. Ensure that data is acquired in the most realistic setting, with only one activity type per log.
Example use case: We want to acquire data to create an MLC class for an air blower running at high speed. In this case, the sensor would be attached to the air blower.

Start the air blower at high speed. Start data collection using the [Start] button. The timeout feature (set, for example, at 30 seconds) can be used for this purpose. After the specified period (which depends on data complexity), use the [Stop] button to stop data collection manually. Alternatively, use the timeout feature. Data is automatically saved in the specified file.

Now, stop the air blower. We now collected data that is used later to create an MLC class. Repeat this process for each activity the MLC should classify. Use activities specific to your use case.

4. Dataset used

For the purpose of this example, a prepared dataset is located in the "data" folder. This dataset was generated using the STEVAL-MKI246KA (accelerometer full scale: 4 G, accelerometer data rate: 200 Hz) and the MEMS Studio “Save to File” feature, logging only accelerometer data. The objective of this dataset is to create an MLC class for each operational activity typically performed by the air blower, which served as the data source in this case: OFF, LOW-speed, HIGH-speed, and HIGH-speed + CLOGGED (achieved by using a filter).

This dataset is utilized throughout the guide. If you follow the steps and also use this dataset, it is possible to verify the functionality of your output using the data injection feature (explained later in "10. MLC configuration evaluation" section).

The graph below visualizes the data for each activity of the air blower and transitions between these activities (transition peaks). The difference between each activity is most visible on the Z-axis line, so it is used to highlight individual data patterns. Each activity possesses unique characteristics that serve to differentiate it when configuring the machine learning core (MLC.)

Figure 9: Data Analysis - exampleFigure 9: Data Analysis - example

5. Creating the MLC configuration

The "Advanced Features" page in MEMS Studio is used to generate the MLC configuration. While it is not necessary to have the STEVAL-MKI246KA connected during the MLC configuration creation phase, it is required for subsequent evaluation (debugging, data injection). Keeping the STEVAL-MKI246KA connected is recommended.

6. Data patterns

This step loads individual data patterns from the dataset and assigns a *class name* to each group of these patterns. Multiple data patterns can be loaded to describe a single activity (class.) For simplicity, this example utilizes only one data pattern per class.

Open MEMS Studio, go to "Advanced Features"  "MLC" and select data patterns tab. In the "Workspace" option, specify a path to the desired output folder for the configuration. In the "Sensor" option, select [IIS2DULPX]. This action initializes the workspace and creates the workspace settings JSON file within the specified folder. Use the "drag and drop" feature, or the [Browse] button in the "Data patterns to load window" to load the individual data patterns. For each loaded data pattern, specify a class name and then click the [Load] button.

The result of the previous steps should look similar to this (including the workspace settings above):

11.png

7. AFS tool

The AFS tool processes the specified data patterns and user-defined settings and recommends window length, filters, and features that can be used for decision tree generation. Such features and filters can then be reviewed and applied to the configuration, primarily influencing ARFF file generation.

Open the "AFS tool" tab. Specify the "Inputs" window selection (in accordance with the values used during data acquisition): accelerometer_only, FS: 4 G, ODR: 200 Hz. Specify the "machine learning core ODR"(which must be less than or equal to the sensor ODR), in this case it is 200 Hz. Click the [run] button to start the calculation. Once the calculation is complete, the features and filters can be applied to the settings using the Apply to Setting button.

This configuration should result in the message "MLC settings updated".  See the screenshot below of the tab after completion for orientation:

Figure 11: MEMS Studio - AFS toolFigure 11: MEMS Studio - AFS tool

8. ARFF generation

This tab displays the features and filters previously recommended by the AFS tool; each can be individually modified, deleted, or new ones can be added. The sole step on this tab is to click the [Generate ARFF File] button (there is no need to specify a path). The ARFF file will then be created and stored in the workspace.

13.png

9.  Decision tree generation

Decision tree specifications can be modified on this page. For the purpose of this example, the default values are selected. Click the [Generate Decision Tree] button. This action generates a decision tree based on the ARFF file and stores it in the workspace. A workspace can contain multiple decision trees.

10.  MLC configuration generation

This tab enables the setting of output values for each class, the specification of end counters, and the generation of the final MLC configuration file. If your dataset differs from this example, adjust the values according to your preferences. If you are using the dataset from the data folder, select values as shown in the screenshot below:

Figure 13: MEMS Studio - MLC configuration generationFigure 13: MEMS Studio - MLC configuration generation

Note: The configuration file can be exported to a C header file using the [Export As] button. This file can then be included in a C project for straightforward MLC configuration.

11. MLC configuration evaluation

There are two easy ways to evaluate the new MLC configuration.

11.1 Decision tree output viewer tab

This option allows for the display of the MLC output from the currently connected device. The data are visualized graphically and updated in real time as the MLC evaluates the sensor data. It is a prerequisite that the device (in this case, STEVAL-MKI246KA) is connected and that the MLC configuration to be evaluated is loaded onto the device. The configuration can be loaded from the "Config Generation" tab and clicking the [Load Config into Sensor] button.

The ▶ button must be enabled to start the evaluation.

11.2 Debug tab

The debug tab option also operates with a connected device but does not utilize live data from the sensor. Instead, it processes a datalog, extracting data (for example, acceleration) and submits it to the MLC. The output of this process is another datalog. It contains the original sensor data along with the MLC's "result" or "reaction" to that data in the form of MLC output.

This functionality enables the capture of data (for example, acceleration), saving into a log file, and subsequent utilization of this log file to evaluate an MLC configuration. This feature is demonstrated in the following steps. Each individual datalog in the dataset located in the "data" folder was created during an air blower demonstration. It is not possible to access the demo to evaluate the configuration "live". However, the data_validate folder contains a log named Test_data.csv. This log contains measured data (accelerometer only) from a brief demonstration of the demo's capabilities, making it suitable for evaluating the MLC configuration.

Navigate to the "Debug" page under "Advanced Feature" → "MLC".

In the "Device configuration" path, you can select [Default] (which loads the configuration from the current workspace) or [Browse] for a specific configuration to evaluate. Select the path to the file data_validate/Test_data.csv as your log file. Set the "Number of decision tree set" option to [1] (in accordance with the decision trees in your configuration). Click [Run]

A progress bar is displayed. Processing this data might take some time. The process should look similar to the screenshot below:

Figure 14: MEMS Studio - MLC DebugFigure 14: MEMS Studio - MLC Debug

Once the process is complete, select the [LOG] option from the menu to save the data. Reference process result can be found at data_validate/Test_data_result.csv.

Note: If you exit the tab, the process stops and the table with result data is discarded. Remember to save using the LOG option.

You should now have a datalog containing the results from the MLC. The "Data Analysis" page can be utilized to visualize the data. While this page offers numerous options for data visualization, the "Time Domain" option is the most straightforward option. In this tab, you can specify the result log file path in the "Log file name" option and visualize only the MLC data (or any desired data) by disabling all values except dectree and mlc_status.

An example of "Data Analysis" with each activity described is described below. If you used the same dataset and submitted the same testing datalog, you should have the same result as in the picture.

Figure 15: Data analysis - resultFigure 15: Data analysis - result

Conclusion

The showcased solution facilitates monitoring air blower performance and detecting potential issues, enhancing predictive maintenance capabilities. It is particularly valuable in industrial and HVAC systems where continuous monitoring of equipment health is essential. By accurately identifying the blower’s state, it enables early detection of potential issues, reducing unexpected downtime and maintenance costs.

Embedding the model within the MLC allows for on-device processing, minimizing latency and reliance on external systems. This results in more efficient, reliable, and cost-effective predictive maintenance strategies, ultimately extending equipment lifespan and improving overall system performance.

Related links

 

Version history
Last update:
‎2025-11-05 6:58 AM
Updated by: