필터 지우기
필터 지우기

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 CenterFile Exchange에서 Hardware-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