Why does Simulink scope skip data points when tuning parameters?
4 ビュー (過去 30 日間)
古いコメントを表示
Tyler Johns
2018 年 11 月 2 日
回答済み: Madhu Govindarajan
2018 年 11 月 8 日
MATLAB 2018a - Simulink support package for Arduino hardware
I am using an Arduino Uno to send signals to a motor driver and acquire an analog input from a sensor and log the data to the base workspace using a scope.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/193804/image.gif)
Ultimately I would like to tune the parameters of the DIR signal block (period samples & pulse width samples) during the simulation. However, when I tune parameters during simulation the scope does not capture every value.
For example ScopeRawVoltage.time = [0.002, 0.004, 0.014, 0.016, 0.018, 0.020, 0.032] even though the sensor samples every 0.002s(500hz). There doesn't seem to be a pattern to the missing values and different amounts of data is missing every time. Also, the missing points don't necessarily coincide with the time that the parameters were changed.
This is a non-issue when I run the simulation without tuning parameters but that is not practical for my purpose since it takes a fair amount of time to upload the model to the Arduino every time I change a parameter.
0 件のコメント
採用された回答
Madhu Govindarajan
2018 年 11 月 8 日
The data is coming over serial port and that has its own limitations. Recommendations - slower sampling time or lesser data streamed (maybe you don't need both data points streamed or something like that).
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Run on Target Hardware についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!