[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/session.php on line 594: sizeof(): Parameter must be an array or an object that implements Countable
[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/session.php on line 650: sizeof(): Parameter must be an array or an object that implements Countable
[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/session.php on line 1110: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3903)
[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/session.php on line 1110: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3903)
[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/session.php on line 1110: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3903)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 113: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 5277: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3903)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 5277: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3903)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 5277: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3903)
vedder.se forums • CAN-BUS Forwarding
Page 1 of 1

CAN-BUS Forwarding

Posted: 02 Sep 2016, 00:07
by transpower
Hello,

I am looking to control 4 VESC units from a single USB on my computer. I am struggling to understand how the CAN forwarding is to be implemented. I am able to control the first motors speed by sending a message that looks like [2,5,8,blah,blah,blah,blah,3]. I have enabled CAN forwarding using the bldc-tool and have given each a separate address and can control them though the single USB. I see COMM_FORWARD_CAN and CAN_PACKET_SET_RPM defined and assume that they are required to be placed somewhere within the message. I will continue to experiment with different message formats but if someone could provide and example message of setting a speed via CAN forwarding it would be amazing.

Thanks a bunch,
Mitchell

Re: CAN-BUS Forwarding

Posted: 02 Sep 2016, 07:30
by rew
The CANBUS is a BUS. So normally all devices on the bus can hear what is transmitted by one of them.

I suspect that "CAN_FORWARD" is a command used on USB or SERIAL to send a message onto the canbus. But I haven't looked at that part of the code.

Re: CAN-BUS Forwarding

Posted: 03 Sep 2016, 09:51
by pf26
I think you just need to change your frame like this :

[2,5,8,blah,blah,blah,blah,3] -> [2,5+2,COMM_FORWARD_CAN, VESC_ADDRESS, 8,blah,blah,blah,blah,3].
+2, because the frame has 2 more bytes, hence the new length
Now the message should be forwarded to the VESC with VESC_ADDRESS.

Did you try with BLDC_tools ? (check CAN Fwd box and input the VESC destination in the Textbox nearby)
Using some COM port monitor, you will see how the serial frames are changed.
COMM_FORWARD_CAN = 33 (0x21)

Pierre

Re: CAN-BUS Forwarding

Posted: 30 Dec 2017, 16:26
by GvB

Re: CAN-BUS Forwarding

Posted: 31 Dec 2017, 10:45
by pf26
In datatypes.h, you can see the enumaration of all communication commands, and COMM_FORWARD_CAN is the 33rd in the list, hence the constant COMM_FORWARD_CAN=33.

Re: CAN-BUS Forwarding

Posted: 31 Dec 2017, 12:07
by GvB
Ah. that's it. of course. did not know how that worked. and also was working with a different library. now switching to rollingGecko's...
Learning C++ as I am going along.