No, you need a CAN interface on the controller end. Use USB for configuration of each ODrive (gains, etc) and CAN for real-time control. You can disconnect the USB while in use, and it should be a bit more robust to electromagnetic noise.
Get a USB-CAN adapter e.g. “innomaker” https://www.inno-maker.com/product/usb-can/ - this one is good because it is isolated, cheap, and works out of the box with Linux (socketcan) and Windows (pyusbcan)
Connect CANH and CANL of each ODrive and the USB adapter in a bus configuiration. The last ODrive (furthest from the USB adapter) needs to have the terminator enabled, and the others you should turn the terminator off.
The CAN protocol is dead simple to use, but I can post some examples if you need.
BTW, do you have any ferrite rings in your robot? I’d highly recommend adding some if not. (they improve control performance by reducing noise on the current sensors, amongst other things)
What controller are you using for the robot? The board you mentioned is only a differential transceiver, and will only work if you already have CAN TX and RX pins on your controller, e.g. NVidia Jetson AGX Xavier has this, along with some other single-board computers.
Raspberry Pi for example does NOT have them. You need a CAN interface IC e.g. mcp2515 in addition to a transceiver for that.
If you are using a Pi, then you can get a ‘hat’ with a MCP2515 SPI-CAN interface plus a differential transceiver.
The board I posted is pretty compact tbh, and it doesn’t need to go in the confined space where the ODrives sit. It plugs into USB and is wired directly to the CANH/CANL pins of ODrive from there.
You don’t need an extra ground wire because the ODrives already share a ground via the battery (you need to make sure that the positive supply is never connected before or without the negative)
And CAN is differential and can tolerate a few volts of ground difference between boards.
Normally you’d need to connect a ground to the controller, but with an isolated CAN interface like the one I posted, you don’t need to (although it might still help if you do connect a GND from one of the ODrives to the isolated side of the interface).
It’s a Raspberry Pi 4 controlling everything. The Raspberry Pi is located in the arm of the robot and space is super tight, hence me looking for more compact options - also the InnoMaker is out of stock in the UK and we’re on quite a deadline. Looking into Hats, I’ve found this
Is this the sort of thing you were suggesting?
I’ve read through the ODrive CAD guide - really helpful.
I’ll have a read through the code properly later on - we’ve got a guy joining the team next month to help with all the coding - I’m not a coder myself, sadly, as it would make things easier.
The PICAN2 HAT looks really good, we’ve got the budget for it. I couldn’t find a schematic for it, but look at the schematic for non isolated one, it seems that quite a few of the RPi GPIOs are free - The RPi also controls a vacuum pump, solenoid valve and light using the GPIO. I’m guessing it’s possible to stack another HAT on top, like
The controller I found before, said RS485 CAN - is that quite different to CAN?
Unfortunately, the Pi can’t be located elsewhere - the robot moves on linear rails, power is sent through the linear rails. There are no wires to the robot.
Oh sorry, I hadn’t read that properly - indeed RS485 is quite different to CAN, and I don’t normally associate RS485 with CAN, normally you want one or the other.
Actually it’s RS485 AND CAN, the two are independent of eachother. It’s basically the same as the SKPang PiCAN 2, in that it’s a MCP2515 connected to one of the Pi’s SPI ports, with a non-isolated CAN transceiver (and a RS485 transceiver thrown in too, connected to one of the serial ports of the Pi) and quite a lot cheaper too!
Yes, it’s check and pretty compact - I’m going to buy it and the GPIO breakout - see if we can fit them nicely in the arm.
I suddenly had a thought about using the CAN bus rather than the USB connection - on two of the ODrive boards there are sensors connected to the ODrive GPIO and the AVCC pin on the other ODrive. Do you know if there will be an issue reading these sensors over CAN?