Wire canbus for FRC electronics

Hi,
My team wanted to change the way we connect the canbus wire in our robot.
Until now we connect in a “series connection” way, and we wanted to check about “parallel connection”.
For teams that use this method, I will be glad if you will share with me tips on how to do this.

CAN Star topology is not recommended in FRC and can cause issues (this is what I’m assuming when you say running them in parallel). It’s highly recommended and required (in cases of CAN Fd) that you run the devices in series (daisy-chained) with the connection beginning at the roboRIO (or CANivore) and ending at the PDH/PDB with a 120Ohm resister.

9 Likes

There is a topology that is referred to as a star topology where there is a central bus with “branches” off at several points to individual devices. It was discussed at length a couple years ago here on CD and I think the conclusion is that it was not recommended due to reflections within the branches and other technical issues.

Here is the full topic:

6 Likes

Generally you should use a bus topology, not a star, as multiple paths can cause reflections which will deteriorate the bus’s performance.

Why would you like to wire the CAN differently?

What do you mean when you say bus topology, a central bus with kind of branches?

Buses are a “line” of buses in a row. It’s different word for daisy-chaining.

We have run star topology in multiple robots without detectable issues. But we did not do so blindly.

CANBus stub length (e.g. the length of wire from the main bus to the device) should be kept under a length that depends on BUS speed. FRC uses 1MBit/s and has a maximum recommended stub length of about 1ft. Thus all CANBus leads need to be 1ft or shorter from the start center to the device.

This can be impractical for some robot designs. It is highly impractical in industrial and automotive applications. Thus it is most often counter-indicated in documentation.

Serial/diasy-chain topology has a stub length of the length of traces on the device PCB from the CAN wire pigtail to the controller chip, usually <1in, so they’re naturally fine.

4 Likes

Just some anecdotal findings here but, we ran a standard daisy-chained design from the bottom of our robot up to the top and ended the chain after our last motor on our shooter which was on a turret (120ohm resistor at the end). This allowed us only to have wire runs “one way” which made it easy to disassemble and reassemble. We then ran two ToF can sensors as a branch off the main line with absolutely no issues. We made sure though to minimize branch length though.

We’ve run ours this way the past 2 builds and it’s been working well, saved our bus when a wire got loose in a particularly rough elims match.

I really worry that the insistence throughout some parts of the community saying ‘no don’t do this’ without explaining the risks and precautions ends up causing more issues than help.

“Loop” or series CAN bus is the simple tried and true method that will work just fine for most teams, assuming wires are soldered together or connected with good connectors. All devices are connected up in a series loop starting at the Rio and ending at a 120ohm resistor (either standalone or the one built into the PDH/PDP). As long as wires are connected well and protected within the frame this wiring method works well.


If there’s a break in the loop, the devices past the break will lose communication

“Star” or parallel CAN bus is a more complex way of wiring up CAN on robots, it involves hooking up clumps of devices with short runs of wire into 1 or more hubs on a bot. So like you hook your Rio to a hub, have a bunch of 1 foot long wires hooking in devices, then a longer length of wire to your next hub elsewhere on the robot, rinse repeat and terminate at the end. The benefit being if one device or connection goes down, the whole robot doesn’t. HIGHLY recommend reading the TI documentation on the matter before considering trying this though.


If there’s a break, only one device goes down, not the whole bus.

As far as hubs go, we use a combination of this big hub in high density areas and these multi port connectors for smaller hubs.

Hopefully that provided some level of insight, I can only speak for how this works for us with CAN 2.0 on the Rio, not FD/CANivore as we haven’t started using it yet.

3 Likes

If there’s a break and the termination resistance is lost there is a non-zero chance of the whole bus going down or acting erratically.

6 Likes

With most onboard communications happening over the CANbus, it is essential to protect the bus and make it as fault tolerant as possible. I think this is one of the merits of considering the Star topology.

Burying the CAN wires inside your robot such that they are as protected from damage as possible is a good design practice. But the basic design of the mechanisms may not allow you to have the wires fully shielded from damage. Consider the fact that the CAN wires to the CANcoder on the top of the SDS swerve modules are potentially exposed to damage from another robot making contact inside your frame perimeter. I wonder how many robots that got disabled this year during a match was due to these wires getting clipped and taking down the whole bus.

There are other things that can be done to make the bus as fault tolerant as possible. REV introduced their V2 canbus cables for the spark max a couple years back. The jumper wires that they added ensure that if the cable comes unplugged from the motor controller that it will not take down the entire bus:

Adding clips onto the PWM connectors on the ends of those cables are also key to making sure the bus does not get unplugged:

All these little details may make a difference when the robot is getting banged about in a match.

4 Likes

I’ll second that the REV V2 CAN connectors are a huge improvement. Even with those, we like to ziptie the CAN wire to the power wires to prevent it being pulled out, as you still don’t want to lose a controller off the bus.

The cable clips are a must if you stick to the original PWM-style connectors, but I don’t recommend that. Much better to cut off the PWM-style Molex ends and substitute a (properly crimped) locking style instead. Or if you aren’t comfortable with all those small gauge crimps, lever-nuts are a much better solution that I’ve seen many teams use with success.

3 Likes

Our team still hasn’t found a connector we like for can, so we just end up soldering everything. Andersons are HUGE for can, and the PWM connectors with clips aren’t locking.

We had huge issues with the wagos in the smaller wires. Off season we went to solder and I don’t think we will ever look back. It was not hard and we had zero issues with soldered wires.

JST-SM or Molex Ditto. Both are truly locking. JST-SM is gendered, Ditto is not. I like both quite a lot.

1 Like

Yeah the lever nuts are good for prototypes and quick stuff but I would absolutely not trust it for even rough practice sessions

The difficulty is that not every team will adhere to the constraints needed to make a star topology work properly and some will create stubs that are long enough to cause signal distortion and degradation of the S/N. Those teams will then have difficulty diagnosing the issue because their lack of understanding of those constraints.

The countermeasure for a break in the wiring is learning to improve the quality of the wiring so there are no wiring failures throughout the season. This is very achievable and will give benefits in other areas (i.e. not having one of the pneumatic solenoid wires fall off) so all teams should be working towards this anyway.

3 Likes

Have you had specific failures with the PWM style with clips, or just a preference? We didn’t seem to have any issues.

This is… sort of right. CANbus has no concept of a “master”; all messages are asynchronously broadcast onto the bus. The reason we want to put the roboRIO at one end of the bus is that it has a (non-switchable) internal 120 Ohm termination resistor.

If you mean like the Molex SL, these work fine with a good (expensive Molex) crimper. But they fail like anything else involving independent teenagers - inattention to painstaking details. We have a hard time getting the discipline to make good crimps, check for quality, insert into shell and tug test.
image