CAN simulation delay and distortion issues
11 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Using the most basic CAN receiving and sending model that comes with Simulink without any modifications, without setting the message cycle, with a sampling time of 0.01s, the two simulation results are completely different. The official explanation for the case is delay. After setting the message cycle to 0.01s, the result is completely distorted. No matter how the sampling time and message cycle are changed, it will always be like this.
I don't understand why the result is so distorted and the message sending cycle is completely wrong.Any help is appriciated.


0 Kommentare
Antworten (1)
Ayush
am 15 Dez. 2025 um 4:26
Hi Fangxu,
I understand your concern about the distorted results when setting the CAN message cycle in Simulink.
This happens because, in Simulink, the simulation step (sampling time) and the CAN message cycle need to be perfectly aligned. If they are not, messages may be sent or received at unexpected times, causing data to appear distorted or out of sync. When the message cycle is left unset, messages are sent every simulation step, so everything stays synchronized. But when you set the message cycle, especially if it doesn’t exactly match the simulation step, timing mismatches and buffering can occur, leading to the issues you’re seeing.
To avoid this, make sure your sampling time and message cycle are set to the same value or are integer multiples of each other. You can refer the following documentation to know more about CAN transmission and reception:
Hope this helps!
0 Kommentare
Siehe auch
Kategorien
Mehr zu Event Functions finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!