You are here

VESC CAN Status message interpretation

2 posts / 0 new
Last post
harsha008
Offline
Last seen: 5 years 10 months ago
Joined: 2019-01-09 15:18
Posts: 1
VESC CAN Status message interpretation

Hello,

I am working towards CAN communication between Arduino (Non-VESC) and VESC. The basic communication is working fine, thanks to community members for their support and documentation. I couldn’t understand answers to below questions:

1. How should one interpret/decipher CAN status message being received by Arduino and sent from VESC? I understand CAN ID 0x00000900 is for Status message and VESC ID 0. It seems first 4 Bytes in payload are to be “zero” by default. However, last 4 Bytes correspond to “ID, RX Time, RPM, Current, and Duty”. Is there a sequence to be followed in interpreting these messages?

2. I have Set CAN Status rate at 1 Hz, however I receive the CAN status message multiple times in 1 second. Can someone tell what am I missing here?

Thank you for reading through this. Any input/help is appreciated!!

 

 

bluesquall
Offline
Last seen: 5 months 3 weeks ago
VESC Free
Joined: 2018-12-14 21:54
Posts: 1

If I understand the source correctly, he last byte of that extended ID (0x00) is the controller number, and the second-to-last byte (0x09) is the CAN_PACKET_ID for CAN_PACKET_STATUS.

You need to decode the actual payload of the CAN packet to get electrical RPM, motor current, and duty cycle. Start here.

If you're receiving multiple status messages each cycle, I'd guess you've configured the VESC to output more than the first status message (e.g., conf->send_can_status == CAN_STATUS_1_2_3_4). So some of the packets you receive should have extended ID 0x00001400, 0x00001500, etc.