Skip to main content
Visitor II
October 20, 2020
Question

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

  • October 20, 2020
  • 3 replies
  • 1704 views

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.

    This topic has been closed for replies.

    3 replies

    ST Employee
    October 21, 2020

    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

    Rajesh1Author
    Visitor II
    October 21, 2020

    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.

    ST Employee
    October 26, 2020

    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

    Rajesh1Author
    Visitor II
    October 26, 2020

    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.

    Rajesh1Author
    Visitor II
    December 4, 2020

    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.