- "mSec refers to the fractional data in seconds, not milliseconds". Does the data you showed mean time at 37.4, 37.5, 37.6 and 37.3 second?
- "I faced the problem of logging more than 60 times faster". How does the data you showed indicate it is 60 times faster?
- "This sensor operates at 10Hz and logs data every 0.1 seconds when logging through an external program." How does Simulink connect to or receive this sensor data? Might it be that the sensor measurement is executed in almost real-time like every 0.1 second, while your Simulink simulation is running much faster, like it runs 60 iterations within 0.1 second? You know Simulink simulation is not in real time. It could be faster or slower than real time. In most cases, it is faster.
to workspace block logging in real time?
4 次查看(过去 30 天)
显示 更早的评论
Hello
I made a block that logs actual sensor (GPS, IMU) data with Simulink using To workspace.
This sensor operates at 10Hz and logs data every 0.1 seconds when logging through an external program.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/344407/image.png)
(Sensor data value logged by an external program, mSec refers to the fractional data in seconds, not milliseconds.)
To workspace block was used to record sensor data. Simulink settings were set to discrete time settings.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/344410/image.png)
However, when looking at the recorded data through the To workspace block, it was confirmed that logging proceeded at least 60 times faster.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/344413/image.png)
(The recorded data is UTC data of the GPS sensor, and the value corresponding to seconds has been logged more than 60 times.)
Since the sampling time of the To workspace block was set to 0.1s, I thought that I would log data every 10 Hz, which is the actual operation of the GPS sensor, but I faced the problem of logging more than 60 times faster.
I would like to know how to set the To workspace to record data every 10 Hz, which is the actual GPS operation Hz.
2 个评论
Fangjun Jiang
2020-8-11
回答(1 个)
Fangjun Jiang
2020-8-11
In that case, you need this toolbox Simulink Desktop Real-Time. It can slows down your simulation to try to match real time.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Configure and View Diagnostics 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!