Sampling rate is not accurate (Arduino support package)
2 ビュー (過去 30 日間)
古いコメントを表示
Hello everyone, I am using the Arduino Support package on Simulink to acquire an input signal and send the samples to workspace. The sampling rate specified in the 'analog-read' block is 0.01. This means that, when running the model for 20 seconds, I should expect 2000 data points (2000 X 1 vector in workspace). This is however not happening. It seems that Simulink is not collecting 100 samples per second. it would randomly collect a number of samples all of which are different than what is specified (0.01). Any ideas why this is happening? and how to solve it. Thank you. Here is a screenshot of my model.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/157523/image.jpeg)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/157526/image.jpeg)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/157528/image.jpeg)
0 件のコメント
回答 (1 件)
Madhu Govindarajan
2016 年 3 月 15 日
If these are the only blocks in your model, then two more things to notice are sampling time of Workspace blocks and the sampling time of your model itself
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Arduino Hardware についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!