Skip to main content
Visitor II
March 17, 2021
Solved

Plotting in cube monitor

  • March 17, 2021
  • 3 replies
  • 7071 views

We are trying to sample a 50Hz to 200Hz signal at 50Khz rate, using stm32H7 micro controller, ADC-DMA mode is used. Tried to plot the wave in cube monitor by accessing the corresponding variable. the issue is 50Hz waveform is not reproduced properly, while if the signal frequency is reduced to 1Hz, the waveform is plotted and reproduced perfectly. Till 5Hz the waveform looks fine. Beyond that the waveform is not proper. Tried changing the sampling custom sampling frequency in Cube Monitor beyond 50kHz. But looks like no change.

If we need plot signals till 200Hz, how this can be done. We need to sense and plot around 12 ADC channels.

Need suggestions, if any settings to be changed in cube monitor or IDE. Tq

    This topic has been closed for replies.
    Best answer by stephane.legargeant

    Hello

    There is a new wiki about csv files : https://wiki.st.com/stm32mcu/wiki/STM32CubeMonitor:How_to_log_data_in_a_.csv_file

    3 replies

    ST Employee
    March 17, 2021

    Hello

    The acquisition through swd/jtag takes some time, because CubeMonitor send a request to read each variable, and then wait the answer from the probe . The latency of computer USB and probe limits the speed of acquisition. It will not be possible to transfer 50 000 points each second.

    There is a wiki explaining how to optimize acquisition : STM32CubeMonitor:How_to_optimize_acquisition_speed

    Another important point is how do you sync the variable storage in memory with the acquisition ? As the ADC is running faster than variable reading from STM32CubeMonitor, the points may be "out of sync"

    You can use the snapshot to improve the data extraction by copying complete buffers. The wiki is here : How to use snapshot mode

    VVija.1Author
    Visitor II
    March 18, 2021

    Thank you,

    I referred the link you mentioned. There is some improvement in data plotting

    after I increased to full micro-controller clock.

    The

    variables are accessed in two ways:

    the

    adc converted values are stored in dma buffer,

    1) the dma buffer itself is accessed in cube monitor,

    2)the dma buffer value is assigned to variable in conversion complete callback,

    this variable is accessed in cube monitor. Both had similar results.

    I have attached some images for your viewing.

    Requirement: Getting raw data from three timer synchronized ADCs, Each ADC with 8 channels.

     ADCs triggered at 50kHz

    The

    three phase signal frequency would range 50 to 100Hz,

    Please suggest a method to take data from ADC-DMA buffer and to validate this. We are also trying to take values from buffers from Cube IDE expressions, but there is also seems to be problem with update rate.

    Is there a way to take the variables buffer from Cube IDE as in csv format or import to excel, because if we copy and buffer array from cube IDE expressions and then copy means, takes lot of time, (at times not updating properly also).

    VVija.1Author
    Visitor II
    March 18, 2021

    Adding one more image of 1 Hz signal

    Graduate II
    March 20, 2021

    .

    Visitor II
    June 22, 2022

    @VVija.1​ 

    Hello,

    Are you getting a smooth waveform on ST Monitor if you plot raw data from 1 ADCs to ST Monitor?

    Signal frequency- 50Hz to 60Hz

    Sampling frequency- 10KHz