Control 2 VESCs with external CAN

Support for creating custom user applications on the VESC.
Dimitri.d
Posts: 4
Joined: 03 Feb 2017, 09:55
Location: Paris
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1236: count(): Parameter must be an array or an object that implements Countable

Control 2 VESCs with external CAN

Postby Dimitri.d » 03 Feb 2017, 10:26

Hello,

I'm working on a project, and I would like to control 2 VESC with external CAN.

I'd like to be able to :

- Control each VESC speed independently
- Control each VESC direction of rotation independently
- Control each VESC braking current independently

I'm aware that I can give each VESC a different ID, but I would like to know what kind of CAN frame should I send to it.

I studied the source code and I guess I should send something like : |Controller ID|Command|Parameter|
where Controller ID is the ID i setted on BLDC tool, Command is (Duty cycle, braking current, etc.)

So I would like to know the bytes (corresponding to each command) that I have to send.

I would also like to know if I can get each VESC current informations on the CAN bus.

Thanks in advance for your replies.

Dimitri

pf26
Posts: 310
Joined: 28 Mar 2016, 14:37
Location: FR Valence
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1236: count(): Parameter must be an array or an object that implements Countable

Re: Control 2 VESCs with external CAN

Postby pf26 » 03 Feb 2017, 17:11


Dimitri.d
Posts: 4
Joined: 03 Feb 2017, 09:55
Location: Paris
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1236: count(): Parameter must be an array or an object that implements Countable

Re: Control 2 VESCs with external CAN

Postby Dimitri.d » 06 Feb 2017, 08:19

Thanks for your reply.

My problem is that I can't find the decimal values of the different commands to send.
Where did you get "CAN_PACKET_SET_POS = 4". I'm not seeing this in the "comm_can.c"

Dimitri.d
Posts: 4
Joined: 03 Feb 2017, 09:55
Location: Paris
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1236: count(): Parameter must be an array or an object that implements Countable

Re: Control 2 VESCs with external CAN

Postby Dimitri.d » 06 Feb 2017, 08:25

My bad,
I just saw that the different commands ID have been declared in the file "datatypes.h"

Thanks again for your help

I also wanted to know if I can get VESC information like Current over the CAN bus ?

Dimitri.d
Posts: 4
Joined: 03 Feb 2017, 09:55
Location: Paris
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1236: count(): Parameter must be an array or an object that implements Countable

Re: Control 2 VESCs with external CAN

Postby Dimitri.d » 07 Feb 2017, 16:04

Thanks a lot, this is exactly what I needed

s28500
Posts: 12
Joined: 13 Sep 2016, 18:33
Location: Florida
Contact:

Re: Control 2 VESCs with external CAN

Postby s28500 » 06 Apr 2017, 19:21

Did you figure out how to pull info from the VESC units over CAN? Also, are you using the TI SN65HVD232 Transceiver as your external can IC?
Thanks!

benjamin
Site Admin
Posts: 280
Joined: 15 Dec 2015, 08:38
Location: Sweden
Contact:

Re: Control 2 VESCs with external CAN

Postby benjamin » 07 Apr 2017, 07:23

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/bl ... comm_can.c

and here is the bldc interface code
https://github.com/vedderb/rise_sdvp/bl ... nterface.c
https://github.com/vedderb/rise_sdvp/bl ... nterface.h

here is an older version of the interface that should work for FW 2.16
https://github.com/vedderb/bldc_uart_co ... nterface.c
https://github.com/vedderb/bldc_uart_co ... nterface.h

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.

s28500
Posts: 12
Joined: 13 Sep 2016, 18:33
Location: Florida
Contact:

Re: Control 2 VESCs with external CAN

Postby s28500 » 07 Apr 2017, 17:53

Thank you for the reply, Ben! I will read through the code and play with it. I can make a lite tutorial with examples once I get it working.
Cheers!

kitewinder
Posts: 19
Joined: 29 May 2017, 20:47
Location: Bordeaux
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1236: count(): Parameter must be an array or an object that implements Countable

Re: Control 2 VESCs with external CAN

Postby kitewinder » 01 Jun 2017, 10:20

hello all!
I'm really interested by this topics.
for info we do that : www.kitewinder.fr
My which is to control a Vesc trough a can bus delivered by an arduino with can shield bus.

I try to figure out infos but with no great success at that point.
My first step would be just to send data from vesc ( voltage, current for example) and try to get them on the arduino can bus port. but even the conf that shall be given in bldc tool, I'm not sure about it...

Is there some update available, tutorials, anything. Any help would be greatly appreciated !

ondyll
Posts: 1
Joined: 08 Jun 2017, 12:22
Location: Prague
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1236: count(): Parameter must be an array or an object that implements Countable

Re: Control 2 VESCs with external CAN

Postby ondyll » 08 Jun 2017, 12:38



[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1236: count(): Parameter must be an array or an object that implements Countable

Return to “Custom Applications”

Who is online

Users browsing this forum: No registered users and 2 guests