The real time stream input block in simulink buffers data at undesirable times during the communication

4 views (last 30 days)
Hi,
I am working on implementing a robotic controller using the real time capabilities of simulink. However I am running into a bit of problem when transferring data between simulink and arduino which is used to communicate to the sensors and the actuators.
At the moment the arduino sends out the data point of a 1Hz triangle wave at 500Hz. Plotting the collected data in Matlab proves that there are short periods where there is no incoming byte. The picture below illustrates the issue.
Is there anyway to solve this issue or is this as good as it gets with realtime simulink. The blocks properties for in/out streams mention that COM port communication can support up to 500Hz. I have another micro controller that can send/receive data over TCP/IP. Using the TCP/IP protocol with the normal non-real-time receive query block results in much better output with no gaps in the time series data. However, the TCP/IP protocol cannot be used with the real time stream in block or in fact any other real-time block.

Answers (0)

Products

Community Treasure Hunt

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

Start Hunting!