cancel
Showing results for 
Search instead for 
Did you mean: 

NanoEdgeAI Studio - Proper Signal Formatting?

Kbitsnbyte
Associate II

Hi STM Community-

Context: X-Nucleo-53L8A1 / Nucleo-L476RG
16 zones per line of distance measurements are being captured by NanoEdgeAI in an attempt to generate an anomaly detection AI model. 16 axes correlate to 16 measurement zones. Measurements are in mm.  The data seems to be properly formatted; however, when the "Signal" is added, NanoEdgeAI indicates there are not sufficient values for FFT to be performed. MIN, MAX, & MEANS are calculated.

Files attached. Pls advise.

Thanks in advance,
Kelly

 

7 REPLIES 7
Julian E.
ST Employee

Hello,

 

The idea with NanoEdge Data format is to capture a temporal signal. For example, in a case of vibrations, you would capture 3 axis data and you would collect multiple samples to create a buffer (signal). For example, 512 samples of 3 axis data, or buffer of size 1536.

These buffers, depending on the sampling rate chosen, represent the variations in the vibrations studied during x seconds. And for NanoEdge, is it much easier to distinguish the variations in the data than just a single sample of values.

 

In your case, you have 16 values per buffer. I don't know your exact use case, but would it make sense to capture multiple samples of size 16 to create buffers representing the evolutions of these 16 measurement zones? 

If not, you can put 1 axis in the project settings instead of 16, it will solve the FFT issue.

 

Please make sure to always have the 16 values, representing the 16 measurement zones, in the same order in your data.

 

If you have any other questions, please ask.

Best regards,

Julian


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.

Hello Julian-

Thank you for your expert response.

The need for a temporal reference makes sense when seeking to apply FFT. The use case entails the correlation of data from multiple sensors over time. The initial ToF dataset was collected over a (brief) interval. Would adding a timestamp to the 16 axes of ToF measurement data suffice with respect to satisfying the NanoEdgeAI FFT ingest expectations? Once the efficacy of 16 axes is demonstrated, it is intended to expand the data set to include 64 axes—the full capability of the 53L8A1. The data sets associated with the 64 axes will include:

  • Number of targets / zone (will likely vary)
  • Distance measurements / target
  • Ambient light levels

Any suggestions regarding how to best generate anomaly detection AI models incorporating the above specifications and using NanoEdgeAI would be appreciated.

Thanks again.

Sincerely,

Kelly

Hello Kelly,

 

First, even if the FFT is not displayed/used, you still can use NanoEdge AI Studio and see how your data performs.

 

Concerning the timestamps in the data imported in NanoEdge AI Studio, I don't think it will help.

To have better results in the benchmark, you will probably need to concatenate consecutive sequences of your 16 values samples to create a buffer with temporal information. It is easier to distinguish differences.

(In terms of number of consecutive samples to concatenate, you can test to create buffer from size 16*16=256 to around 2000)

You said you have multiple sensors collecting the values. As long as you stay coherent (same order, same data rate etc in your 16 values), it makes no difference as if they were collected with one sensor. 

 

Concerning suggestions to generate the best AD model, you can read the following guide: AI:Datalogging guidelines for a successful NanoEdge AI project - stm32mcu

 

Best regards,

Julian


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.

Hello Julian – I am in the process of digesting and implementing the tenets of the linked document, with particular focus on the ToF examples described in sections 7.3 & 7.4. I greatly appreciate your guidance. Thanks much! Kelly  

Kbitsnbyte
Associate II

Hello Julian / all

 

I am using the Simple Ranging example for the X-Nucleo-53L8A1 / Nucleo-L476RG eval kit.  

The MX_TOF_Process includes a TOF_Process_PostTreatment  User Code section. I am seeking to use this section to format ToF data for NanoEdgeAI. However, the PostTreatment code does not run due to the while (1) loop that is utilized to continually read sensor data. Pls advise. Thanks, Kelly   

 

void MX_TOF_Process(void)

{

/* USER CODE BEGIN TOF_Process_PreTreatment */

 

/* USER CODE END TOF_Process_PreTreatment */

 

MX_53L8A1_SimpleRanging_Process();

 

/* USER CODE BEGIN TOF_Process_PostTreatment */

 

/* USER CODE END TOF_Process_PostTreatment */

 

------------------------------------------------------------------------------------ 

 

 

while (1)

{

/* polling mode */

status = VL53L8A1_RANGING_SENSOR_GetDistance(VL53L8A1_DEV_CENTER, &Result);

 

if (status == BSP_ERROR_NONE)

{

print_result(&Result);

}

 

if (com_has_data())

{

handle_cmd(get_key());

}

 

HAL_Delay(POLLING_PERIOD);

}

}

Hello Kelly,

 

Here is a way to achieve it:

* get the while(1) loop out of the  MX_53L8A1_SimpleRanging_Process() function. Add it instead in the void MX_TOF_Process(void) function

* Add your preprocessing code after the /* USER CODE BEGIN TOF_Process_PostTreatment */

 

Here what you will get:

 

void MX_TOF_Process(void)

{

while (1)

{

/* USER CODE BEGIN TOF_Process_PreTreatment */

 

/* USER CODE END TOF_Process_PreTreatment */

 

MX_53L8A1_SimpleRanging_Process();

 

/* USER CODE BEGIN TOF_Process_PostTreatment */

Your code here

/* USER CODE END TOF_Process_PostTreatment */

}

------------------------------------------------------------------------------------ 

 

 

/* polling mode */

status = VL53L8A1_RANGING_SENSOR_GetDistance(VL53L8A1_DEV_CENTER, &Result);

 

if (status == BSP_ERROR_NONE)

{

print_result(&Result);

}

 

if (com_has_data())

{

handle_cmd(get_key());

}

 

HAL_Delay(POLLING_PERIOD);

}

 

Best regards,

Julian


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.

Hey Julian - moving the while loop did allow the TOF_Process_PostTreatment code to run. It was necessary to reposition some of the other code elements as well.  The full app_tof.c file is attached. A cautionary note for others who may land on this post: I am in the process of incorporating additional sensors, which entails the modification of the *.ioc file. Any subsequent regeneration of the code will wipe out any changes to the program made outside of the user-defined "guard rails." Pls ensure appropriate backups of modified code have been captured in advance of regeneration. I appreciate your and STM's support. Thanks much, Kelly