Non-uniform sampling time to read data from Arduino Due in Simulink

4 次查看(过去 30 天)
Hello
I wrote an S function (Builder) to read data from one of analog inputs of Arduino Due. I know the signal on that pin is sinusoidal with frequency of 20Hz. When I read data in Simulink in realtime with scope block and To-workspace block, the data I am receiving, does not have uniform sampling time. It seems it sends packages of 3 sampled data (with different of 0.001 second in time = my settings in solver). And it waits for some time (around 0.1 second) and then again send another package of 3 sampled data with right sampling rate of 0.001.
I use the fixed-step size solver with the step size of 0.001 in simulink.
What is the reason of it and how can I remove that undesirable 0.1 waiting time?
Thanks in Advance.
Yousof

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Arduino Hardware 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by