on 2024-09-04 05:00 AM
This knowledge article explains how you can easily create an anomaly detection application with the new IMU ISM330BX and its ecosystem.
This is the second part of the hands-on, starting from an acquired datalog up to the recognition of different classes. For example, stationary, pick and place, anomaly, and using the ISM330BX machine learning core.
The first part of the hands-on, from setting up the hardware and software tools up to acquiring a datalog, is explained in the knowledge article:
“How to acquire a datalog for your anomaly detection application with ISM330BX".
To build a configuration for ISM330BX and in general ST MEMS sensors, ST provides a dedicated tool for MEMS sensor called MEMS-Studio. MEMS-Studio is a desktop software solution for all the MEMS sensors in the ST portfolio. Through this developer environment, you can easily evaluate and program all the MEMS sensors. You can also develop embedded AI features, evaluate the libraries, analyze data, and design algorithms even without writing code.
MEMS-Studio is an all-in-one solution that includes all the features that were previously available in other tools like Unico-GUI, Unicleo-GUI, and AlgoBuilder.
To import into MEMS-Studio the datalogs we have previously acquired, we need to convert them to a compatible format. We can do this through the HSDatalogApp through Unico script, which is provided inside the Python SDK installed as described in the article: “How to acquire a datalog for your anomaly detection application with ISM330BX".
Now, we can open MEMS-Studio in offline mode without any board connected to the PC. In the data analysis tool, we can import data to do some data cleaning and labeling.
We can set the labels for the three classes we want to detect so that the single file previously acquired can be split into three files, one per class. Note that in this simple example we have used one single acquisition, but you can have multiple datalogs in a real application.
When we have completed the labeling part, we can click on Save labeled data.
Then in the MLC tool of MEMS-Studio, the three files generated can be imported with their specific label (stationary, pick and place movement, and anomaly).
An analysis of the imported data can be done to have some suggestions on the parameters to be used to. Alternatively, we can proceed with the manual configuration of the machine learning core parameters like inputs, and window features.
At the end of this step, the tool generates first a file containing the features computed in the final window. We can generate the decision tree model and the tool provides some information about the accuracy of the generated model.
Finally, we can choose the output values corresponding to the three classes defined, for instance, zero for stationary, four for pick and place and eight for anomaly.
The tools generate a configuration file containing the sensor configuration.
The configuration for the sensor generated by MEMS-Studio can be imported in the High Speed Datalog GUI to test it with real time data.
The output of the machine learning core is available in the MLC source register. The STWIN.box firmware reads the register and sends it to the High Speed Datalog GUI. We can see the result equal to 0 when there is no movement: This is the stationary class.
The result is equal to 4 when the pick and place movement is recognized.
The result is equal to 8 when the anomaly has been detected on the robot.
Going back to MEMS-Studio, note that we have previously used it offline without any board connected.
However, MEMS-Studio can be used also for evaluation with the compatible boards, for instance, the Professional MEMS tool board, which is shown in Figure 12.
With this board connected, you can evaluate the different features available in ISM330BX.
In the [Quick Setup] section, you can easily configure the sensor: Changing the evaluation mode to sensor fusion (see Figure 13) in the 3D model section, you can evaluate the sensor fusion low power running on ISM330BX (see Figure 14).
Another important feature available in MEMS-Studio is the FFT tool, which shows the fast Fourier transform of the data coming from the accelerometer and gyroscope.
Last but not least, if you are not using any ST evaluation board but you have a custom hardware, platform independent drivers are available on GitHub. In fact, inside the repository called ST MEMS Standard C drivers, you can find drivers and examples both for the ISM330BX sensor and for many other sensors.
To conclude, here is a summary about the ecosystem for the IMU ISM330BX.
The STEVAL-MKI245KA adapter board containing the ISM330BX sensor can be plugged in different motherboards for evaluation, development, and prototyping. For instance, the Professional MEMS tool board, the Nucleo board with the X-NUCLEO-IKS02A1 expansion board and some form factor boards like SensorTile.box PRO and STWIN.box.
The software MEMS-Studio is available for configuring the sensor on your PC. There is also a mobile application for Android and iOS called the STBLESensor. There are ready to go examples available on GitHub and in our function packs on st.com.
As we have seen during these two articles the ISM330BX sensor also has some Edge AI capabilities. In our website, you can find a dedicated section related to the ST Edge AI Suite where there are many tools supporting edge AI and examples of application or case studies.
The tools used, which are High Speed Datalog and MEMS-Studio are part of the ST Edge AI Suite. Finally, the boards we have used can be purchased through our eStore at estore.st.com.
During this second part of the hands-on, we started from an acquired datalog and ended up to the recognition of different classes, that is, stationary, pick and place, anomaly, using ISM330BX machine learning core.
We have used a hardware setup made up of the board STWIN.box, the ISM330BX evaluation kit and a robotic arm. Moreover, we used the software function pack FP-SNS-Datalog2 with its High Speed Datalog GUI and MEMS-Studio.
We encourage you to further explore the IMU ISM330BX ecosystem!