You are here

CANBUS communication documentation

12 posts / 0 new
Last post
Dillon
Offline
Last seen: 3 months 4 weeks ago
VESC Original
Joined: 2017-08-14 11:48
Posts: 34
CANBUS communication documentation

Hello,

I have not been able to find any information on CANBUS communication. Is there any documentation anywhere? I am looking to communicate through CANBUS due to its robustness over UART. Robustness is extremely important in my application.

Thanks!

Dillon

josh
josh's picture
Offline
Last seen: 2 years 3 months ago
VESC Original
Joined: 2017-05-24 12:15
Posts: 92

I too am trying to communicate over CAN and I asked about this a few months back on vedder.se forums. Here is what Ben said:

A tutorial would probably be helpful, but here is the CAN interface I'm using for a self driving RC car:
https://github.com/vedderb/rise_sdvp/blob/master/Embedded/RC_Controller/...

and here is the bldc interface code
https://github.com/vedderb/rise_sdvp/blob/master/Embedded/RC_Controller/...
https://github.com/vedderb/rise_sdvp/blob/master/Embedded/RC_Controller/...

here is an older version of the interface that should work for FW 2.16
https://github.com/vedderb/bldc_uart_comm_stm32f4_discovery/blob/master/...
https://github.com/vedderb/bldc_uart_comm_stm32f4_discovery/blob/master/...

There are also a few much simpler CAN commands with limited functionality, but by implementing the things above you will be able to access everything on the VESC over CAN, including changing the configuration.

I would read through the code and see what you can get from it. I have not dug too deep into it yet but I will soon hopefully. Once I get my setup working, I am planning on doing some examples and tutorials for the community.

Cheers!

Dillon
Offline
Last seen: 3 months 4 weeks ago
VESC Original
Joined: 2017-08-14 11:48
Posts: 34

Thanks much Josh! I'll see what I can do

Pimousse
Offline
Last seen: 2 months 3 hours ago
VESC Original
Joined: 2017-05-24 12:15
Posts: 101

Thanks a lot Josh !

I'll need it as well to communicate with a BMS.

Keep us updated ! ;)

Jack_Li
Offline
Last seen: 4 years 3 months ago
Joined: 2019-07-01 05:03
Posts: 12

hi,friends,I also have the same needs. How is your work going?

jack li

Tinkerer
Offline
Last seen: 2 years 12 months ago
Joined: 2020-06-30 08:28
Posts: 7

Hi All,

Any updates on a unified manual/instruction documentation for communicating with the VESC over CAN? 

Thanks!

TheFallen
Offline
Last seen: 9 months 4 weeks ago
VESC Original
Joined: 2017-09-11 11:46
Posts: 222

Aside from the info in Josh's post above, no. As will most VESC things you'll have to reverese engineer it from the source code.

Tinkerer
Offline
Last seen: 2 years 12 months ago
Joined: 2020-06-30 08:28
Posts: 7

Ah, I see.
That's not very promising. I'm new to all this, so looks like it'll be a while before I get any kind of solid footing. Thank you for your prompt response, though!

I know this is a silly question, but are there any other resources that have started off reverse engineering and successfully using CAN data from VESC hardware? I've tried using an Arduino to read data from the CAN bus at 500K rate, but no luck. It doesn't seem to be picking up anything. I'm of the opinion I have to send a trigger message to the VESC hardware to make it send back status data to me.

I'll keep an eye out on the forums for any kind of resources that may surface.

 

Cheers!

Tinkerer
Offline
Last seen: 2 years 12 months 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

Ohad Reuveni
Offline
Last seen: 2 years 6 months ago
Joined: 2020-04-07 20:05
Posts: 1

Thank you for sharing! Will try it soon

drdrs
Offline
Last seen: 2 weeks 1 day ago
VESC Free
Joined: 2019-09-27 04:48
Posts: 22

I've created both Arduino/C and CircuitPython implementations of a CAN bus reader for a VESC and VESC-compatible BMS (ENNOID-SS).

Here is a link to the CircuitPython implementation:

https://github.com/dsoto/VESC-Ennoid-CAN-Feather

This method uses the emitted messages from the controller and the BMS but I've also used the commands to request values over CAN.

Vinayak Bhat
Offline
Last seen: 7 months 1 day ago
Joined: 2022-11-08 07:39
Posts: 2

Hi all,

I've just started tinkering on Vescs and i want to use can to control it. Ive first started by probing the can bus and decoding the contents on the bus. After looking at Tinkerer's spreadsheet and the command lists, I figured that the can updates the can transceivers buffer with values. I wanted to figure what values is it updating in the buffer. Any suggestions on this?

Vinayak Bhat