XL320 - RPi4 and Python


for a project i want to control up to 6x XL-320.

The basis should be an Raspberry (RPi4 or 5 if possible; or 3B+), depending on the possibilities.

Here are the options that I have found as driver boards:

  • Poppy Pixl Board: can control up to 6 pcs. XL-320. These are simply connected “in series”. Control via GPIO pins. As far as I could see it, this board can be controlled with RPi3, max. RPI3+.

  • OpenCM 9.04: can control up to 4 pcs. XL-320. One port for each motor on the board. Can only be controlled via USB? Would also work with RPi4 etc.
    .+ OpenCM485: to control 6 Motors. Is this meant to expand the number of motors that can be controlled by opencm?

  • U2D2, USB2…: I newly found this ones. Are this ones maybe right ones to control XL-320 with a raspberry pi?

=> I would like to control the XL-320 via a raspberry pi, with Python!
The projects contains a few other things i want to contro via python.

Is there any simple way/ or way to control the XL-320 with python from a rpi?
I found some boards and solutions but nothing seems to be controllable with python. I have controlled some other motors with the pi an python before. But with the XL-320 its not so simply possible i think? As I undersood because of the half duplex.

Does anone maybe have a solution?
It has to be the XL-320. And it should be a Pi and python, if possible.

Thanks a lot for your help in advance!



DYNAMIXEL Controller:
OpenCM 9.04c

  • OpenCM485? (to control up to 6 Motors?)

Software Interface:
RPi/ Linux/ Python

For RPi using the U2D2 is best. Combine it with the DXL SDK. You will need these XL-320 convertible cables

And these hubs

You can look at this free Kindle sample for some ideas


Or at this post for a more conceptual approach at what needs to be done

Thanks a lot for your answer and detailed help!
This helps a lot! Great!

I looked through it and tried to understand and searched for more sources. I would have some querys.

  • Regarding the 3P JST Expansion Board :
    Is it really that simple? :slight_smile:
    Do the Motors simply get “looped through”?
    Then I can control each of them individually, because of the IDs they get, as i understood, right? I would have thought they need a driverboard, which “knows” which motor is on which port.
    But of course its fine if it is that simple :wink:

As i concentrated on the U2D2 (U2D2) i found that sometimes for the XL-320 it’s mentioned, that also the “U2D2 Power Hub” (U2D2 Power Hub) is needed. Or could the Pi do all the power supply for 6 motors for this case?

Again, thanks a lot!

The X3P hub is just a PCB with 5 DXL connectors hooked up in parallel.

The combo U2D2 + power hub is a good choice. The U2D2 itself is powered via the RPI USB port. But you need to have a separate 7.5 V power supply for your XL-320s as the RPI runs at 5V anyway. Just remember no daisy chain longer more than 4 DXLs.

All new DXLs come with the same ID=1 so you’ll need to rename their IDs, one at a time via the combo U2D2 + Power Hub and the Robotis tool called Dynamixel Wizard 2. It is free.

By the way RPi5 seemed to work fine with DXLs

Again, thanks a lot for the great help!

I’ll use the U2D2 + the power hub (+cables and expansion boards) in combination with a RPi5.

Because it is for a moving robot, i’ll need to run everything with batteries instead of powersupplies.
For the Pi i’ll use a strompi, some sort of HAT or a powerbank. Like this one:
I’ll check whats best for the RPi5.

What is meant to power the U2D2 power hub (+U2D2 and Motors)?

I found the “LiPo-Batterie LB-010 11V for Robotis” (+ charger). But i think i read somewhere that it doesn’t fit for the U2D2, but I can’t find it anymore.

Once more, thanks a lot!

Do you have some basic tools for wire cutting/splicing, shrink tube, soldering tools? As you will have to adapt a few things together.

In the previous post, I already mentioned that the U2D2 can be powered via the USB port on the RPi5.

For the XL-320s, you can power them via the U2D2 power hub, you need to look at the layout of the U2D2 Power Hub at this link and decide how you are going to power it up: there are 3 options via this web link

The Pi5 wants 5V and 5A. I know that I cannot use the older PS (3A) for RPi-4B with the RPi5.

Below are my “theoretical suggestions” as I have not put together such a power scheme yet!

You may have to buy a beefy LiPo battery for RC cars and planes such as this one:


If you use only 1 LiPo battery, splice it out into 2 power paths: 1 power path stays at 7.4 V to power the U2D2 Power Hub (and the XL-320s), and the other path you feed through a voltage step down converter such as this one

to get the 5V-5A that the RPi5 wants.

This type of battery also looks interesting!


You have lots of “searching” to do!