cancel
Showing results for 
Search instead for 
Did you mean: 

Vibration Monitoring example code works fine with FFT size of 512. But does not work with FFT size of more than 512.

Rajesh1
Associate II

We are using X-Nucleo-IKS02A1 board to test the vibration sensor using vibration monitoring example code. The FFT data of vibration sensor is observed using Unicleo-GUI.

It is observed that the FFT data is not represented in Unicleo-GUI when FFT size is changed from FFT_SIZE_512 FFT_SIZE_1024 in MotionSP_Config.h file.

Please suggest the configuration settings to increase FFT size.

7 REPLIES 7
Eleon BORLINI
ST Employee

Hi @Rajesh​ , @SS_135​ ,

Can I refer here also for to this thread?

In the meantime, I asked internally to our experts.

Meanwhile, for my better understanding, the issue is that you are changing the FFT_SIZE from FFT_SIZE_512 to FFT_SIZE_1024 in MotionSP_Config.h file (in the code section below), but you are not experiencing the related FFT plot in Unicleo-GUI, right? Did you changed the FFT_SIZE_MAX default value?

#define FFT_SIZE_512          512u          //!< FFT will be performed on 512 samples
#define FFT_SIZE_1024         1024u         //!< FFT will be performed on 1024 samples
 
#define FFT_SIZE_MAX          FFT_SIZE_512  //!< Max FFT size
 
/* Set parameters for MotionSP library */
  MotionSP_Parameters.FftSize = FFT_SIZE_DEFAULT;
  MotionSP_Parameters.tau = TAU_DEFAULT;
  MotionSP_Parameters.window = WINDOW_DEFAULT;
  MotionSP_Parameters.td_type = TD_DEFAULT;
  MotionSP_Parameters.tacq = TACQ_DEFAULT;

-Eleon

Rajesh1
Associate II

Hi Eleon,

Thanks for your response.

We have changed the FFT_SIZE_MAX default value as shown below.

#define FFT_SIZE_DEFAULT   FFT_SIZE_MAX //!< Default value for FFT size

.

.

.

//#define FFT_SIZE_MAX     FFT_SIZE_512 //!< Max FFT size

#define FFT_SIZE_MAX     FFT_SIZE_1024 //!< Max FFT size

The related FFT plot is not shown up in Unicleo-GUI.

Please let us know, if we are missing any other configuration.

Regards,

Rajesh K.

Hi @Rajesh​ , @SS_135​ ,

here is our feedback: the project cannot be easily modified to 1024 points.

This because it uses sensor FIFO which has 3kB, so we it is not possible in FIFO standard mode to fit more the 512 samples (512 x 2 bytes x 3 axis). To increase number of FFT points the project would need to be modified to use FIFO compression or to use local buffer and copy samples from FIFO to the buffer, and it is difficult to do it so far...

-Eleon

Hi Eleon,

Thanks for your response.

Do you have an example code or application where local buffers are used instead of FIFO to calculate FFT of vibration sensor.

Do you have a generic FFT library instead of MotionSP library to calculate FFT of vibration sensor.

Regards,

Rajesh K.

Hi Eleon,

We have verified the data sheet of ISM330DHCX which is used in evaluation board [X-Nucleo-IKS02A1].

The FIFO size is 9K bytes. Please find the captured data below for your reference.

I suggest the changes in vibration monitoring example to use 9K bytes of FIFO, which shall be used to represent FFT data.

Regards,

Rajesh K.

Hi @Rajesh​ ,

>> The FIFO size is 9K bytes. Please find the captured data below for your reference.

Please note that, as reported in the ISM330DHCX datasheet at p. 31:

"the ISM330DHCX embeds 3 kbytes of data (up to 9 kbytes with the compression feature enabled) in FIFO to store the data"

This means that, as I wrote in my last comment, the >3kBytes functionality implies the FIFO compression feature, and it is not the default operation of the sensor.

I reported this suggestion internally. However, since this is a pretty major change in the interface between the Unicleo-GUI and the board(s) firmware, to help speeding up the processing of the request I suggest you to contact a sales representative from your country from this link.

-Eleon

Rajesh1
Associate II

Hi Eleon,

Now we are ready with our custom board which has vibration sensor [ISM330DLC] and MCU[STM32F446RE].

We have done following configuration using XCUBE-MEMS1

  • Configure SPI2 to interface with MEMS sensor [ISM330DLC]
  • Configure XCUBE-MEMS1 to use custom BSP drivers of ISM330DLC

We have implemented following features

  • Implement FIFO buffering using SPI interface to capture 1024 samples for FFT calculation
  • Integrate Vibration Monitoring code which uses MotionSP library
  • Test our custom board using Unicleo-GUI to represent FFT data from MEMS sensor [ISM330DLC]

We are using following versions of tools.

  • STM322CubeIDE - Version 1.4.0
  • XCUBE-MEMS1 - Version 8.1.1
  • Unicleo-GUI - Version 1.15.0

Issue:

  • The issue is that we are able to observe FFT data with 512 samples correctly. But FFT data is not visible in Unicleo-GUI when FFT data samples are changed to 1024 samples
  • We need clarification on the above issue is with Unicleo-GUI or Vibration Monitoring code

Regards,

Rajesh K.