Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   CAN (http://www.chiefdelphi.com/forums/forumdisplay.php?f=185)
-   -   Custom CAN Devices? (http://www.chiefdelphi.com/forums/showthread.php?t=153707)

duane 15-01-2017 14:47

Custom CAN Devices?
 
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

MetaEngineer 15-01-2017 21:52

Re: Custom CAN Devices?
 
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):

Quote:

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 :)

duane 15-01-2017 22:16

Re: Custom CAN Devices?
 
Thanks for the quote out of the manual. I found the same information not too long after you posted this message. :)

Quote:

Originally Posted by MetaEngineer (Post 1631672)
I'm curious to know what custom devices you intend to build, if you don't mind sharing :)

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.

bobbysq 15-01-2017 22:38

Re: Custom CAN Devices?
 
Quote:

Originally Posted by duane (Post 1631678)
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).

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

MetaEngineer 15-01-2017 23:07

Re: Custom CAN Devices?
 
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.

duane 16-01-2017 10:15

Re: Custom CAN Devices?
 
Quote:

Originally Posted by MetaEngineer (Post 1631702)
CAN bus is great for many things, but high bandwidth is not one of them.

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.

MetaEngineer 16-01-2017 11:14

Re: Custom CAN Devices?
 
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.


All times are GMT -5. The time now is 10:46.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi