Custom CAN Devices?


#1

While I dig through the manual …

Can we build a device that has an interface that uses the CAN bus? Are there any specific rules for creating and accessing a device on the CAN bus?

…Duane


#2

Section 8, R78, bullet point A, at the bottom of page 91 of the Complete Game and Season Manual, as of today (1-15-2017):

Additional switches, sensor modules, CUSTOM CIRCUITS, third-party modules, etc. may also be placed on the CAN-bus.

You can add whatever custom devices you want as long as the roboRIO, PDP, PCM, etc are connected to the CAN bus legally and the custom device(s) do not interfere with, block, or override other signals (See rules R61, R75 to R78).

I’m curious to know what custom devices you intend to build, if you don’t mind sharing :slight_smile:


#3

Thanks for the quote out of the manual. I found the same information not too long after you posted this message. :slight_smile:

We’ve enjoyed using CAN bus for Talon’s and the added support for sensors on the Talon’s have simplified wiring and programming.

We would like to build an interface to a Raspberry Pi. We have a vision program operating nicely with the Raspberry Pi. We’d now like to get the data to the RoboRio.

Ethernet is a common suggestion, but the Ethernet interfaces on the robot are limited. Adding the Pi to Ethernet would take up bandwidth as well as likely require the addition of a switch (weight, space, ouch).

I’d like to hear the benefits of other interface choices.

I’m also on the lookout for examples of using the CAN interface on the RoboRio.


#4

Anything on board the robot doesn’t have the bandwidth restriction. Switches are also pretty lightweight and not too big.


#5

CAN bus is great for many things, but high bandwidth is not one of them. Small amounts of data such as motor controller commands and sensor data can be moved with low latency, but it will struggle with a video stream. Last year a code bug early in development resulted in a flooded CAN network on our robot. Very laggy and unpredictable behavior resulted as the network hit its limits and could not update frequently enough.

As bobbysq said, there’s no bandwidth limit on the bot itself. Only transmissions between bot and field are limited to <7 mbit/sec. If you are really tight on weight and space, you can use the second Ethernet port on the radio to feed data through to the RIO. It works quite well as a switch, though you lose that port for tethering.


#6

I should clarify. This is not a video stream. There’s a Raspberry Pi operating as a sensor independently evaluating the video stream. The Pi is returning the distance to the target so that we can adjust the targeting and shooting system with vision.

The data between the Pi and the RoboRio will be quite small (several integers).

I’m digging but could still use more examples of how to use the CAN bus properly.


#7

That makes far more sense using the Pi is a coprocessor and sending small amounts of data back to the RIO. CAN bus will handle that no problem, though unfortunately the implementation of such a setup is where we leave my realm of expertise.

From what I’ve researched, the Pi will need a separate CAN module, as it does not natively support CAN. However, it has hardware support for SPI and I2C built in, as does the RIO. Those seem like a more accessible method of communicating than CAN.


#8

Duane, did you get a chance to follow these leads? I’d be interested if you did any research into getting custom devices on the CAN (or, even better, actually managed it!). I’m looking into doing this myself and any info I can get on how successful others were would be great.