You are here

CANBUS communication documentation

11 posts / 0 new
Last post
Dillon
Offline
Last seen: 5 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: 1 year 8 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: 5 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: 4 months 1 week 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: 1 year 7 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: 4 months 4 days ago
VESC Free
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: 2 months 1 week ago
VESC FreeVESC 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: 4 months 4 days ago
VESC Free
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: 4 months 4 days ago
VESC Free
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: 1 month 1 week ago
VESC Free
Joined: 2020-04-07 20:05
Posts: 1

Thank you for sharing! Will try it soon

drdrs
Offline
Last seen: 5 hours 26 min ago
VESC Free
Joined: 2019-09-27 04:48
Posts: 10

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.