How can I adjust the setting of analog signal sampling with STM32 using Matlab Simulink.
15 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(2 个)
Sulaymon Eshkabilov
2023-12-30
Increase data sampling rate, e.g., 2.5kHz or higher and re-collect your data. It will solve the problem.
Goutham Varanasi
2024-1-9
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 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!