How can I adjust the setting of analog signal sampling with STM32 using Matlab Simulink.
12 views (last 30 days)
Show older comments
Hi everyone,
I want to see the AC signal I measured with STM32F746ZG in matlab simulink. The AC signal has offset and its frequency is 50 Hz. For example, I want to measure this AC signal with a 10 kHz sample. In the Matlab simulink analog input (MBED) block, only the pin and sample time (Note: The sample time in the block is entered as 1e-4) can be set. When I run it with Monitor and Tune, it measures with a sample of around 500 Hz in the data inspector section. Naturally, the graph is quite far from sinusoidal waveform. How should I configure in matlab simulink to measure this signal in real time and with 10 kHz sampling. The figure below shows the shape of the AC signal monitored in the data inspector.
Thank you for your advice.
0 Comments
Answers (2)
Sulaymon Eshkabilov
on 30 Dec 2023
Increase data sampling rate, e.g., 2.5kHz or higher and re-collect your data. It will solve the problem.
Goutham Varanasi
on 9 Jan 2024
Hi,
This is because logging with external mode is done at higher sample rate which requires higher data speeds along with the overhead of external mode.
As a workaround you may use the two-model approach where data logging is handled by a different model there by reducing the overhead of logging on the main model.
You may follow these examples for reference.
0 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!