cancel
Showing results for 
Search instead for 
Did you mean: 

Plotting in cube monitor

VVija.1
Associate II

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

1 ACCEPTED SOLUTION

Accepted Solutions
9 REPLIES 9
stephane.legargeant
ST Employee

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

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).

Adding one more image of 1 Hz signal

Hello VVija.1

On the picture, I see that you are logging 12 variables. As the bandwidth is shared between variables, you will not be able to see smoothly variables at 100Hz in direct mode. You can check with only one variable, it should be improved. you can also use the "show points" option to see exactly when the point has been measured.

But I feel it will not be possible to have a display of all channels at a sufficient rate.

For the variable export, there are 2 options for this :

Best regards

Stephane

Cartu38 OpenDev
Lead II

.

Ok thank you I will try this

You may try to readout the whole buffer, import nodes from this example: sigview.zip and connect nodes according !view-me!.png, add your array and fix array size in loops (currently it is 512 points). This example gathers all array element values to single global variable (array) and then outputs in on a chart component by sending x-y payload. This way x axis scale will not be dependent missed samples/latency. I think if you use some double buffering for processing or trigger readout somehow you may even readout data without being overwritten.

SPRAD.2
Associate

@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