Connecting multiple ODrive boards to one PC


#1

Hi,

Is there a way to communicate with multiple ODrives using one PC at the same time? Is it using find_all, which returns a generator? I have tried change the code in find_any, but that won’t work. Since I have a project needs to control multiple motors and make them work cooperatively, is there a way to do it by just using one PC? What is the code should be like?

Best Regards,


#2

Yes, it definitely is possible. I have 3 connected through a USB hub. I’ve written a C++ interface for my needs at https://github.com/moorage/odrive_cpp_sdk

I’m sure you can use the existing python interface to do the same. They should have a function to find one by serial number (or /dev/ttyACM* if on native-stream)


#3

Yes you can use find_all, it returns a generator. If you are uncomfortable using generators in Python, you can simply cast it to a list and use the list. So like:

all_odrives = list(odrive.find_all( ... ))
print(all_odrives[0].vbus_voltage)

#4

Thank you so much for your help!


#5

Thank you for your guidance, it is now working so well!

Best


#6

keep in mind that connecting multiple devices to a USB hub doesn’t let you talk to them at the same time, you are talking to them sequentially.

for most things this is ‘good enough’, but if you are needing to have close coordination of movement across axis that are on different boards, this probably will fall out of ‘good enough’ pretty quickly


#7

With C++, coordinating across a USB hub never became a problem for coordinating across all degrees of freedom, so that’s good news!