cancel
Showing results for 
Search instead for 
Did you mean: 

How to perform Asset tracking with the SensorTile.box and Unicleo app

Eleon BORLINI
ST Employee
This article deals with the implementation of a simple machine learning case (the recognition of the state of an asset in movement) on the LSM6DSOX core of the SensorTile.box, combined with a finite state machine configuration that determines the free-fall and impact events, and the visualization of the output of the decision tree on the Unicleo PC app.

Table of the contents
 

  1. ​​​​Why it is important to monitor an Asset during transportation?
  2. Problem Scenario
  3. Sensor Configuration
  4. Data Collection
  5. Algorithm (MLC and FSM) Configuration
  6. Data visualization with the Unicleo GUI app
 

Why it is important to monitoring an Asset during transportation

Asset monitoring and tracking is an increasingly important application for the detection of the status of a good or commodity that can be transferred form one place to another one. The data can be progressively saved locally ("on the edge"), exploiting the . Since the power consumption is crucial in a battery-operated application such as the asset tracking one, in this article a SensorTile.box and the LSM6DSOX embedded low power Machine Learning Core (MLC) and Finite State Machine (FSM) are used.
 

Problem Scenario

The SensorTile.Box can fit the needs of this application, since its form factor enables the positioning on the asset to be tracked, and the data can be stored locally on the onboard SD card.

This example combines Machine Learning Core (MLC) and Finite State Machine (FSM) capabilities to implement a Smart Asset Tracking algorithm able to detect and track the various states of a package (Stationary - Upright, Stationary - Not upright, In motion, Shaken) and detect some possible events (Impact, Free-fall).
 

Sensor Configuration

Among the onboard sensor, the accelerometer is configured with ±16 g full-scale and 26 Hz output data rate in low-power mode. Sensor orientation is set as for the ENU convention (with Z-axis pointing up) in order to properly work.
 

Data Collection

For the data acquisition, the SensorTile.box configured with the STBLE Sensor app can be used. The SensorTile.box has been configured the chosen sensor at ODR 026Hz, storing raw data on the onboard SD card. Please refer to this article for a detailed description of the configuration procedure.
Another possibility for data collection, though less "IoT style", would be to use the X-NUCLEO-IKS01A3 board with Unicleo-GUI, configured as shown in the picture below:
801.png
 

Algorithm (MLC and FSM) Configuration (details)

Both the MLC and FSM are configured to process the accelerometer data at 26 Hz in low-power mode:

  • The MLC processes the accelerometer data in order to detect the package state by using three features (peak-to-peak and mean on the accelerometer norm, mean on the accelerometer Z-axis), computed every 13 samples (corresponding to 0.5 seconds). One decision tree with three nodes has been configured to detect the different classes. A meta-classifier has been set to reduce false positives.

    The output of the MLC can be read from the MLC0_SRC (70h) register:

    • 00h = Stationary - Upright
    • 04h = Stationary - Not upright
    • 08h = In motion
    • 0Ch = Shaken

    The MLC also applies a high-pass filter on the accelerometer data which is used by the FSM. The configuration generates an interrupt (pulsed and active high) on the INT1 pin every time the register MLC0_SRC (70h) is updated with a new value (when the state detected by the MLC changes). The duration of the interrupt pulse is 38.5 ms in this configuration.

  • The FSMs process both the raw and filtered accelerometer data in order to detect the following states:

    • Impact, detected by FSM #1
    • Free-fall, detected by FSM #2

In this example, the threshold for impact detection is set to 0.5 g, and the angle for upright is set to 26°. The configuration generates an interrupt (pulsed and active high) on the INT2 pin when either a free-fall or an impact event is detected by the FSM. The free-fall interrupt remains active as long as the package is airborne. The FSM_STATUS_A (13h) register allows determining which FSM has generated the interrupt in order to distinguish between impact and free-fall events.

The overall current consumption is about 22 µA.

804.png 806.png
808.png 809.png
*credits to: https://qeexo.com/video/
 

Data visualization with the Unicleo GUI app

To test the decision tree and the FSM outputs, Unicleo-GUI PC app visualization method has been preferred. The value of the Decision Tree: 1 varies according to the class label described in the previous paragraphs.
  1. Put the SensorTile.Box in DFU mode (Direct Firmware Upgrade): disconnect the battery and unplug the USB cable, press and hold the "DFU boot" button, connect the USB cable then release the button.
  2. Run STM32CubeProgrammer, select "USB" from the pull-down menu on the right, then press "Connect". Click on the Menu button in the top-left corner. Optionally perform a full chip erase. Select "Erase & Programming", browse to select the DataLogExtended binary that can be found in the FP-SNS-STBOX1 function pack, set the address to 0x800 0000, check "Run after Programming", then click "Start Programming".
  3. Run Unicleo GUI, connect to the device, click the checkbox to enable the MLC, then click on the MLC button in the left panel, browse and load the .ucf file, finally click the Start button.

810.png
Enjoy!
Comments
ASbor.1
Associate


_legacyfs_online_stmicro_images_0693W00000Y8qsWQAR.pngGreetings to all!

I'm currently working with NUCLEO-F429ZI + IKS01A3 and I can't seem to connect them to see the data in the Unicleo-GUI.

I do everything as in the ST video (the 476 controller is used there) I copy the bin file to the folder of my 429 controller, but the Uncleo-GUI does not see my board. What am I doing wrong ? How can I build IKS01A3 support for my controller and view the data through the Unicleo-GUI.

MRaff.1
Associate III

Same problem with IKS4A1 unicleo-GUI does not connect. 

Miroslav BATEK
ST Employee

Hello @MRaff.1,

I'm not sure what is you HW configuration except you are using X-NUCLEO-IKS4A1. You need to program your STM32 NUCLEO board with DatalogExtended firmware for particular STM32. The DatalogExtended is available in X-CUBE-MEMS1 package.

MRaff.1
Associate III

Thank you Miroslav, now I can connect, I had to set the Uart speed at 961600 as suggested by Federica Bossi  despite the IKS4A1 "Getting started guide", and the CubeMX+X-CUBE_MEMS affirms to set the UART at 115200.

Miroslav BATEK
ST Employee

It is good that you make it functional. Indeed 921600 baud rate is need for communication with Unicleo-GUI.

Could you please send me a link where you have find the information about 115200? Thank you.

MRaff.1
Associate III

Hello Miroslav, I followed the instructions provided on the document "Getting started with the STMicroelectronics X-CUBE-MEMS1 software package for STM32MX". It is inside the directory \en.x-cube-mems1\Documentation. At page 53 and 60 it is said to set the UART at 115200. 

MRaff1_0-1706607361674.png

On the contrary I have not found a document in which it said to set 921600, maybe I am missing some documentation. In particular I am not able to use the IKS4A1 compass, the unicleo-gui highlight the sensor on a further expansion board I don't have. 

Here my Cube-MX project.

 

Denise SANFILIPPO
ST Employee

This item has been closed, please refer to https://community.st.com/t5/mems-sensors/iks4a1-ecompass-application-with-unicleo-gui/m-p/634070#M22461 if you want to see the solution. 

Version history
Last update:
‎2022-02-28 10:50 PM
Updated by: