- Use the "CAN Configuration" block to set up the CAN bus parameters.
- Add "CAN Pack" and "CAN Unpack" blocks to encode and decode CAN messages according to the DBC file.
- Use "CAN Transmit" and "CAN Receive" blocks to send and receive messages over the virtual CAN channels.
- To link the modules (ECU, BMS, etc.), ensure they are on the same CAN channel and are using the correct message identifiers as defined in your DBC file.
Connecting nodes via virtual CAN bus channels in Simulink to create a simulation of an electric vehicle
28 次查看(过去 30 天)
显示 更早的评论
Hi,
I have a question and it would be so helpful if someone could offer some assistance: I am working on a project where me and team are trying to create an electric vehicle in Simulink and connect the modules (ECU, BMS) via CAN bus and inputting a DBC file collected from an actual vehicle to provide validation between the real world and simulation in Simulink. We are wanting to utilise the vehicle network toolbox.
I'm not sure how to link the modules via the CAN virtual channels - would anyone be able to offer some help?
0 个评论
回答(1 个)
Hari
2024-2-12
编辑:Hari
2024-2-12
Hi laura medhurst,
I understand that you trying to simulate an electric vehicle in Simulink, where you need to connect different modules like ECU and BMS using a virtual CAN bus and also you want to use a DBC file for validation purposes.
You can use the CAN Communication blocks from Vehicle Network Toolbox in Simulink to set up your virtual CAN network. Here's a general approach for to do the same:
Refer to the documentation of "CAN Communication in Simulink" for guidance on setting up and configuring the CAN network:
For information on how to use the "CAN Configuration" block, please at the "CAN Configuration" block https://www.mathworks.com/help/vnt/ug/canconfiguration.html
To understand how to encode and decode messages based on a DBC file, check out the documentation for
"CAN pack" - https://www.mathworks.com/help/vnt/ug/canpack.html
"CAN Unpack" - https://www.mathworks.com/help/vnt/ug/canunpack.html
For details on sending and receiving messages over a CAN network in Simulink, you can refer to the documentation of CAN Receive and CAN Transmit.
"CAN Receive" - https://www.mathworks.com/help/vnt/ug/canreceive.html
"CAN Transmit" - https://www.mathworks.com/help/vnt/ug/cantransmit.html
Hope this helps!
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Vehicle Network Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!