フィルターのクリア

Communication Rate Between Host and Target Models

1 回表示 (過去 30 日間)
Michael Nye
Michael Nye 2022 年 10 月 12 日
回答済み: Varun 2023 年 9 月 15 日
I am using a target and host model set up for a motor controller. I am currently using a sampling rate of 10 kHz, and I am aware that the serial communication cannot operate at this speed. Therefore, the debug data is buffered to 600 samples before transmiting from the host to slow down the communication rate. In our application, there may be a variable sampling rate, and when I increase the sampling rate high enough the models can no longer transmit/recieve all of the data. I can probably buffer more data samples before transmitting but my question is as follows;
Is there a downside to buffering more data samples? Does it take up more space on the MCU (we're currenlt using the F28379D)? Can I buffer too much data?
Additionally, is there an aprroximate max communication rate between the two models? I know with 600 buffered samples at a sample rate of 10 kHz, they models communicate at ~17 Hz. What is the maximum rate they can communicate?
Thanks!

回答 (1 件)

Varun
Varun 2023 年 9 月 15 日
Hi,
I understand that you are currently using a sampling rate of 10 kHz and buffering 600 samples before transmitting from the host to slow down the communication rate.
Here are the disadvantages of buffering more data samples:
  1. Increased memory usage: Buffering more data samples will require additional memory on the MCU to store the buffered data. You need to ensure that the MCU has enough memory available to accommodate the increased buffer size.
  2. Increased latency: Buffering introduces additional delay between the time the data is sampled and when it is transmitted/received. This can impact the real-time responsiveness of your system, especially if there are strict timing requirements.
Communication rate = Sampling rate / Buffer size Communication rate = 10 kHz / 600 samples Communication rate = ~16.7 Hz
So, with the current setup, the host and target models communicate at approximately 16.7 Hz.
To determine the maximum communication rate, you can perform some testing and analysis on your system. Gradually increase the sampling rate and observe the behaviour of the system. Monitor the MCU's memory usage and ensure it remains within acceptable limits. Also, consider the impact on other system tasks and the overall system performance.
Hope this helps.

カテゴリ

Help Center および File ExchangeHardware-in-the-Loop Simulation with Simulink Real-Time についてさらに検索

製品


リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by