You are here

VESC 6+ CAN bus continued

4 posts / 0 new
Last post
kimpet
Offline
Last seen: 4 years 11 months ago
Joined: 2019-04-01 11:39
Posts: 7
VESC 6+ CAN bus continued

I was finally able to get communication from then VESC to my RPi

Without CAN-bus forward

linjer uten can send fra tools.PNG

With CAN-bus forward

linjer med can send fra tools.PNG

 

CAN-bus meanings according to this source: https://triforce-docs.readthedocs.io/en/latest/canbus/canbus.html#canbus-control

Command ID Data Data Length Data Type Units
CAN_PACKET_SET_DUTY 0 Motor Duty Cycle 32-bit/4-by te Signed Integer Thous andth s of perce nt (5000 0 –> 50%)
CAN_PACKET_SET_CURREN T 1 Motor Current 32-bit/4-by te Signed Integer mAh
CAN_PACKET_SET_CURREN T_BRAKE 2 Motor Brake Current 32-bit/4-by te Signed Integer mAh
CAN_PACKET_SET_RPM 3 Motor RPM 32-bit/4-by te Signed Integer ERPM
CAN_PACKET_SET_POS 4 Motor Position      
CAN_PACKET_FILL_RX_B UFFER 5        
CAN_PACKET_FILL_RX_B UFFER_LONG 6        
CAN_PACKET_PROCESS_RX _BUFFER 7        
CAN_PACKET_PROCESS_SH ORT_BUFFER 8        
CAN_PACKET_STATUS 9 Request status N/A    
CAN_PACKET_SET_CURREN T_REL 10        
CAN_PACKET_SET_CURREN T_BRAKE_REL 11        

So I gues I'm just getting the "process short buffer" messages

I imagine that my RPi would have to behave like a VESC master in order for my other VESC's to behave like slaves and get controlled via the CAN-bus

Any kind of links or knowledge that could get me in the right direction would be of big help

kimpet
Offline
Last seen: 4 years 11 months ago
Joined: 2019-04-01 11:39
Posts: 7

Finally figured it out! For future ​can-noobs angel

To send the RPM 1000 to my VESC with adress 61:
fuckin can bus.png

Tinkerer
Offline
Last seen: 3 years 3 weeks ago
Joined: 2020-06-30 08:28
Posts: 7

Hi kimpet,

I've recently started working with CAN and I'm trying to read all data that the VESC can provide over CAN using a Rpi and then have it printed on a display that can read CAN directly. I'm a bit stuck with trying to decipher packets and obtain current, voltage, and temperature data. I'm not able to find a comprehensive list of everything that the VESC writes into the CAN line.

From what I understand, I'm supposed to send a 'CAN_PACKET_STATUS' command over CAN and then the VESC is going to respond with all kinds of data? Any guidance on how I can go about this will be greatly appreciated.

Thank you in advance!

Edit: I'm using a CAN to USB converter that is plugged into a USB port on the Raspberry pi. So the pi is going to be reading USB data. I imagine this might also affect the packets that are sent/received?

Tinkerer
Offline
Last seen: 3 years 3 weeks ago
Joined: 2020-06-30 08:28
Posts: 7

I've added CAN frame description and packet/ID decoding for VESC 6 into a spreadsheet linked in my Github, for anyone in the future that comes across this.

https://github.com/CanonFlair/VESC_CAN