Function of two can busses.
-
I am developing specific hardware for the DUET using the can-fd protocol. I just can't figure out why most of the DUET board have two can connections with 4 wires? I have also seen that the Duet 3 Roto Toolboard has just one can connection with 2 wires. In the can basisc documentation I found that just can1 is used for now and that CAN0 is for future expansion. Are the can0 wires just not active?
-
@Jords27 CAN_0 is currently not enabled in the standard firmware; you would need to compile your own firmware to do that. Support has been added (but not enabled as standard) for plain CAN (not CAN-FD) on CAN_0, and has been used in machines with custom firmware, ie Hangprinter, where it's used to communicate with ODrive motor drivers to configure them.
I asked @dc42 if it is possible to:
- set CAN-0 as CAN-FD and disable CAN_1 - There is a 6HC build configuration to use CAN0 instead of CAN1. It should still build, but hasn't been tested in a long time.
- swap so CAN_0 is CAN-FD and CAN-1 is CAN - Don't know whether plain CAN is supported on CAN1, it depends on how support was added for normal CAN on the second channel. So may be possible.
- both CAN_0 and CAN_1 as CAN-FD ports at the same time - Not supported because the firmware assumes all expansion boards are on the same bus.
CAN is a linear bus system, using differential wiring (ie one wire is High, the other LOW, which makes it more resistant to interference), so apart from the devices at the ends (one of which is the Duet main board) each device needs CAN wires from the previous device and CAN wires to the next device.
Most Duet Expansion boards have two connections with 4 wires to make the wiring easy; pre-made RJ11 cables can be sourced easily, and there's space on the boards for both connectors. It also future-proofs the boards in the eventuality that CAN_0 is used, as it carries this bus too, to where ever you need it.
Toolboards like the Roto are usually at the end of the bus, so it's less important that they loop on to the next board, and the bus can be terminated on this toolboard. However, if you need to loop on to another board, you can have short 'stubs' attached to the CAN bus. The stub length should be limited to 1m.
Ian
-
@droftarts Thanks for that response, that is really helpful!