필터 지우기
필터 지우기

Intermittent Delay seen using virtual CAN protocol

조회 수: 6 (최근 30일)
Calvin Watson
Calvin Watson 2023년 9월 22일
답변: Aman Banthia 2023년 9월 26일
Hello,
I am trying to setup a simple CAN bus loopback to configure the dbc file before deploying onto real hardware by using th Mathworks Virtual Channel blocks within the vehicle toolset.
When running the simulation there is an intermittent delay and frezzing of the receieivng signal and it varies from simulation to simulation. I tried running the Mathworks example 'GetStartedWithCANCommunicationInSimulinkExample' see what differences there were but it experienced the same issue?
Is this just a bug with using the virtual channels and will be resolved when deployed onto hardware or am I missing something?
See plot below: Top plot is my model with a free running counter and the bottom plot is the mathworks example. As you can see the signal lags and freezes.
Any and all insight into this would be appreciated.
Thanks

답변 (1개)

Aman Banthia
Aman Banthia 2023년 9월 26일
Hello Calvin,
It seems like you're experiencing intermittent delays and freezing with the CAN bus loopback using MathWorks Virtual Channel blocks.
Here are a few things you could consider:
1. Task Overloading: The simulation could be getting overloaded if it's running too many tasks or computations simultaneously. Try to simplify your model or use a faster computer for the simulation.
2. Virtual Channel Limitations: The Virtual Channels are meant for initial development and testing, and they might not perfectly emulate the real-time behaviour of a physical CAN bus. Some timing inconsistencies might be expected.
3. Sample Time: Check the sample time of your model. If it's too small, the model might be trying to process data faster than it can, leading to delays and freezing.
4. Buffer Size: If the buffer size of the CAN Receive block is too small, it might cause delays if the buffer gets full. Try increasing the buffer size.
5. Block Parameters: Review the parameters of the CAN blocks in your model. Make sure they're correctly set according to your requirements.
Remember, the behaviour on actual hardware could be different and you might not experience these issues once you deploy your model to the hardware.
Hope the above suggestions work.
Best regards,
Aman Banthia

카테고리

Help CenterFile Exchange에서 Vehicle Network Toolbox에 대해 자세히 알아보기

제품


릴리스

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by