Did you know that CAN is parallel?

All devices on a CAN bus are always in parallel. Yes, even if you daisy chain your motor controllers together, they are still wired in parallel, just with tiny branches of near zero length. But the problem with daisy chaining your can bus is that a single failure takes down every motor.

Switching to parallel wiring, if done correctly, can increase your sanity. I’m a bit sick of the kinds of messages in So many dead robots in Playoffs that claim that parallel can is impossible, too hard to do, or impossible over CAN FD.

Here’s how 4096 Ctrl-Z has wired their drivetrain can bus for the past 2 years with great success. Our drivetrain for '22 and '23 has been 4 WCP SwerveX modules with Falcon500’s and a CANcoder on each. We also have a Pigeon 2 imu. They are on a Canivore CAN FD bus. We run a main CAN trunk around the drivetrain and make a branch for each device. The branches for the cancoders and pigeon are 10-12 inches long. The branches for the falcons are ~20 inches long (we didn’t want to snip off the second set of can wires off each motor since they aren’t user replaceable, so we just bundle them up).

We call this “parallel can with branches”. Mike Copioli called it “parallel pigtails”, which I think sounds more fun.

Now, we have had can failures. In the past two years, we’ve had a motor disconnect due to another robot reaching in yanking out exposed can wires. We’ve had a motor disconnect just due to poor wiring. In both cases, just the one motor dropped off the can bus. The rest of the drivetrain worked perfectly fine. And, in the DS console, we get error messages for exactly 1 can device, not for 13! How useful.

For connectors, the only 2 connectors we use for CAN are weidmuller (without ferrules) and lever nut. We moved away from all crimps (pwm and ferrule) as they were too error prone for us.

31 Likes

Here we go again.

18 Likes

When I hear people mentioning CAN Star layout, usually it involves having a branch of 3+ feet or so, usually running up the robot far away from the drivetrain. When the CAN spec says branches of 12in are fine, the margin of error is high enough that 20 inches is likely fine as well. I’m all for pigtailing off your subsystems like this, pretty much everyone agrees its either within CAN spec, or barely off in the case of the 20 inch branch. It doesn’t solve the problem where there are still multiple single points of failure across the bus. Its just that a single device can be lost without causing the rest to go down.

5 Likes

Multiple single points of failure at the device level are also ok. The only thing that you’re not allowed to lose is the trunk.

1 Like

Which part specifically do you use as a CAN splitter? Do you place any motor controllers on non-drivetrain mechanisms and if so how do you wire them? Where are your terminating resistors?

This is interesting.
This year I thought about circling our can back to loops around in both ways but wasn’t sure if that works or causes an error.

I’d love to see a photo just of the splitter set up if ya have any.

The can hub is custom. I think the design is from another team on CD. It’s a can hub plus a 12V extender for cancoder power. In the future we’ll stop using the 12V rail and just use it for CAN. It would also be nice to redesign it to have levers instead of weidmuller as I personally like lever nuts more. Think mini PDH but with green and yellow instead of red and black.

2 Likes

We do use other motors. We reserve the canivore bus for the drivetrain and put everything else on the Rio’s can bus. The Rio bus we do daisy chain as it only has 6 devices on it and runs up our arm. So if it gets cut, it would be the trunk being cut anyway so there’s not as large of a benefit going parallel.

For the drivetrain, the terminating resistor goes at the end of the trunk. The diagram is a slight simplification. We plug the terminating resistor into the second set of can leads in the last falcon. But really, it’s the same as putting it at the end of the trunk.

1 Like

Would it be possible to have have a redundant trunk if each side is less that 20 or 12 in?

2 Likes

Two things for teams that go with star/bus/other valid names topology.

If you’re using a CANivore keep the bus short. 4099 had a 6 foot long ish parallel branched bus in 2022 connected to a CANivore that led to one of our two shooter motors not connecting to CAN (was persistent between different motors, different point of connections on the bus, etc).

Keep stub lengths <12 inches. This standard is artificial but significantly reduces the possibility of CAN reflection where the same motor shows up on the bus twice which leads to some pretty funky behavior.

100% recommend the switch, it is valid asf and means if one motor dies, we are still trapping on the field :100:

2 Likes

While we haven’t experimented with “Star-topology” our team is considering using these 4-drop modules from playing with fusion over the summer here: Playing With Fusion - CANstar 4-Drop

CAN as a protocol isn’t an issue, and star-topology is perfectly possible from industrial experience (e.g. small stubs <100mm for CAN in CubeSats) but those are shorter traces on a PCB. We’ll be testing/using the aforementioned wiring of our swerve modules with the 4-drop modules over the summer/pre-season here. We recognize the major benefits of still having CAN connection even if a motor/component goes out of the CAN loop.

I had been inadvertently teaching students that CAN was a sequential bus and it worked like “passing notes” in class for YEARS (at least 5) because that’s how it’s wired externally.

Two things 253 used this year that really improved our CAN experience:
These CAN wires from REV which parrel the connection outside of the motor controller - no more loose connections affecting the entire robot! 10/10 recommend.

A termination resistor at one end. Instead of terminating at the PDP as usual, we used a termination resistor so that we didn’t need to loop back down from our furthest motor (at the end of an arm).

1 Like

Documentation is important

5 Likes

I just squint hard enough to see the can packets traveling through the wires.

7 Likes

What’s the background to this?

The beautiful thing about CAN is that it is very forgiving. There is a reason it’s used in vehicles and aircraft.

We never had any CAN issues this year. When we do swerve this summer, I think we will use this topology.

Thanks for sharing!

1 Like

Seconding this- all new spark maxes come with these but old ones bought before 2022ish(?) did not so you’ll have old ones floating around. I’d highly highly recommend throwing the old ones away, replacing them with the new version is cheap insurance against losing your whole bus.

2 Likes

oh, our team cut those off to swap them out for connectors we have that clip together