cancel
Showing results for 
Search instead for 
Did you mean: 

Sensortile.box Machine learing with Unico GUI

Frabbit
Associate III

Hello everyone,

I'm trying to use the sensortile box pro for an ML alghoritm.

My idea is to have a machine learning algorithm that can identify two types of vibrations: correct and fault.

Using the firmware loaded on the Sensortilebox Pro Datalog 2.1.1, I was able to obtain the values from the accelerometer and gyroscope lsm6dsv16x_gyro.csv and lsm6dsv16x_acc.csv along with those from all other sensors such as the magnetometer lis2mdl_mag.csv.

Using a Python script, I then verified that the timestamps for the accelerometer and gyroscope were the same and merged the CSV files but i cannot do the same with the magnetometer.

 To create a decision tree, I have split the merged CSV into two different CSV files, one for each type of vibration: lsm6dsv16x_all_correct and lsm6dsv16x_all_fault.

Using the Unico_GUI software, I would like to generate the UCF file needed by the Sensortile to distinguish these vibrations. I followed the guide on GitHub for machine learning: https://github.com/STMicroelectronics/STMems_Machine_Learning_Core/blob/master/configuration_examples/example_1_sensortilebox_stble_unico/README.md

Frabbit_2-1716820083837.png

I select this configuration

Frabbit_0-1716819924874.png

Following the step this error occur to me but clicking yes it goes on

Frabbit_3-1716820168003.png

 

I upload both files with the correct label and fault label and here comes the first doubt, 
If i upload the magnetometer file it gives me no data even if the file cvs is full, how can i upload the data from magnetometer?

Frabbit_4-1716820228315.png

Moving forward, I use this configuration:

Frabbit_5-1716820448017.png

with one decision tree, windows lenght of 52, no filter and the mean of acceletometer and gyroscope 

Frabbit_6-1716820509836.png

 

The arff file is the generated without problem and same things with the ucf file that i call ml.ucf,

The problem arises when I try to upload the UCF file to the Sensortile (whether it's the Sensortile Box or the Sensortile Box Pro). I tried using Unicleo, but neither of the Sensortiles is recognized by the PC via Bluetooth, although they are recognized via USB, which Unicleo doesn't seem to use (?).

I then tried to upload the UCF file via the app (both Android and iPhone), but I get this error:

Frabbit_7-1716820809786.jpeg

Someone can please help me? what did i do wrong?

7 REPLIES 7
Federica Bossi
ST Employee

Hi @Frabbit ,

How did you configure the sensors ODR and FS?

 

For the magnetometer issue, you want to use the MLC feature with the sensor hub interface to include the magnetometer data right? In that case the log data should not be two different csv files but a single csv file with all 3 sensors. Somehthing like this for example:

 

time[us],acc_x[mg],acc_y[mg],acc_z[mg],gyro_x[mdps],gyro_y[mdps],gyro_z[mdps],mag_x[mG],mag_y[mG],mag_z[mG]
4344450,4,-34,998,-280,560,-280,-654,469,-117
4347473,4,-33,997,-70,210,-140,-654,469,-117

 

Then, in Unico, when selecting the MLC inputs make sure to select also the external sensor option and include the desired features.  

 

You can also check this application note that explains how to configure the MLC sensor with the Sensor Hub interface for including magnetometer data. However if your goal is to use it on the SensorTile BOX.Pro is not possible to connect the sensors together using the SensorHub features given the hardware design. 

 

For the UCF error, did you also try it using the ST BLE Sensor app (not the Classic version)? If the error is still present, can you copy the UCF file so that we can replicate the error? 

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
Frabbit
Associate III

Hi Federica,

To be as clear as possible, I'm sending you both the CSV files and the generated UCF file. I originally intended to create a single file that included all three sensors, but the sampling rate of the magnetometer is different from that of the accelerometer and gyroscope, so I may need to re-acquire the data.

I'm using the SensorTile Box Pro with Datalog2 inside, and I used the basic configuration to collect data:

  • Magnetometer ODR 100 FS 50
  • Accelerometer ODR 7680 FS 16
  • Gyroscope ODR 7680 FS 4000

My idea is to use the SensorTile Box Pro, but since I'm having some problems, I might also be able to use the regular SensorTile Box if it can use all three sensors together.

For the UCF file, I used both applications (STBle for the SensorTile Box Pro and STBle Classic for the regular SensorTile). Both give me this problem.
P.S. Since the website doesn't allow me to upload UCF files, I'm sending you the file in TXT format.

Hi @Frabbit ,

Even if the ODR is different you can log the data using the highest frequency. The sensor will the slowest frequency will just be oversampled. 

 

Using the SensorTileBOX, its not possible to configure their IMU to use the Sensor Hub (so no possible integration of the Magnetometer in the MLC) given the Hardware Design. Same happens with the SensorTileBOX.Pro.

 

If the Magnetometer data is mandatory for your application, you will need to use a different setup.

 

For instance, the UCF was done for the LSM6DSOX, and using the app connected with the SensorTileBOX.Pro you need the UCF for the LSM6DSV16X. By generating the correct UCF and connecting the Pro board, the application error should be fixed. 

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
Frabbit
Associate III

Thanks very much!

i've now made the right ucf file, could you please tell me how can i insert it in the SensortileBox pro? the same ucf can be inserted in the sensortile box? 
Because in the app STBLE sensor i cant apply a new flow with datalog2

Frabbit
Associate III

Hi Federica,
I just realized that the tool only accepted CSV files with accelerometer data followed by gyroscope data. So, I have recreated the CSV files so that they can be read correctly by the tool.
So now i select the iNemo inertial module (is that correct?) with device LSM6DSV16X

Frabbit_0-1716992016587.png

i then select the two different csv one for fault and the other for correct

Frabbit_2-1716992154947.png

with this configuration 

Frabbit_3-1716992206593.png

 

this decision tree pop up

Frabbit_4-1716992256723.png

and generates this ml.ucf 
But still i have the same problem when i try to upload it in a new folw throw the app STBLE classic into the sensortile "The selected ucf configuration cannot be parsed correctly"

 

Federica Bossi
ST Employee

Hi @Frabbit ,

First of all to clarify:

 

  • The SensorTile.BOX has the LSM6DSOX sensor inside and is used mainly with the ST BLE Sensor Classic App.
  • The SensorTile.BOX Pro has the LSM6DSV16X sensor inside and is used mainly with the ST BLE Sensor App.
  • For each board, generate the UCF file for the corresponding sensor. 

 

Having on your phone the UCF file generated for the sensor LSM6DSV16X, connect to you SensorTile.BOX Pro board using the ST BLE Sensor App. Open the Flow option:

Expert view >> New App >> Select Input Source >> MLC Virtual Sensor >> Choose Output >> Stream to Bluetooth. Click on the gear next to the MLC Virtual Sensor >> add .UCF FILE. 

In this way you should be able to load the app.

In addition, you are using the wrong UCF file for the SensorTile.BOX since it should be the one generated for the LSM6DSOX.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

Hi federica! 

Since I was not able do make any further step on i tried to upload the ucf file generated by the datalog in the git repository:
https://github.com/STMicroelectronics/STMems_Machine_Learning_Core/tree/master/configuration_examples/example_2_sensortilebox_algobuilder_unico/1_datalogs
i was following the steps for the sensortile (not sensortile pro):
So I downoad the file, upload them in the Unico GUI(selecting LSM6DSOX)

Frabbit_0-1717771801115.png

I have followed the instruction said in the readme file

Frabbit_1-1717771840196.pngFrabbit_2-1717771869648.pngFrabbit_3-1717771899025.png

the ucf file was generated, i send it to my phone in the STBLESensor Classic app then create app>>SensorTile.Box>>Expert view>>New APP>>Select input>>MLC Virtual Sensor
then in settings>>Select a .UCF file, i select the one generated before and the same warning pop up... what can i do now?

photo_5987964836702703870_y.jpg

photo_5987964836702703869_y.jpg

photo_5987964836702703868_y.jpg

photo_5987964836702703867_y.jpg

photo_5987964836702703866_y.jpg

  I send you the ucf file