Multiple ODrives on one serial port

I’m trying to command 3 odrives over a wired network (ethernet). Currently my plan is to have a raspberry pi acting as an intermediary to translate the messages into serial that can then be sent to the odrives. The only issue is that the rpi only has one serial port. I want to avoid having multiple raspberry pis due to issues involved with synchronising motors controlled by different rpis. I’m thinking of two potential solutions:

  • Find some way of multiplexing the 3 signals onto 1 serial port. Other controllers like the RoboClaw accomplish this by having open collector outputs on their TX lines. Then the TX and RX lines of multiple motor controllers can be tied together and the controllers can be addressed independently using an addressing scheme. Is this something ODrives can do/be made to do? Alternatively the connection can be switched using a hardware multiplexer. If I can figure this out from a electrical perspective how does it work on the protocol end? Would the ODrives get confused? Would this work in the simplified case where the motors are being issued identical commands with no need for feedback (simply disconnect the ODrive’s TX lines)

  • Talk to one ODrive and have it relay the messages to the other ones over CAN/some other protocol. Personally haven’t looked at the ODrive firmware extensively, how difficult would this be given the code structure?

This is our plan for the future, but we don’t have that yet. For now I’d suggest a UART multiplexer that you can switch around from the RPi, maybe controlled over i2c if your RPi can do that at the same time.

Thank you for your fast reply :slight_smile:

Looks like we will go down this path. Does the ODrive send a heartbeat message which would cause it to shutoff when it is disconnected by the multiplexer?

Nope, nothing like that. The ODrive’s ASCII protocol is response-only right now.