Dynamixel and Arduino

I am using a XL430 W250 T dynamixel and I need to control it using Arduino IDE. Do I need to use additional library ?

I am a beginner in robotics. Thanks for your help

Hopefully someone from Robotis can give you some better answers.

Might help to know more about setup. like which Arduino you wish to use and how you are trying to hook up the servos to your arduino. Some of the simplist cases is to use something like the Robotis OpenCM or OpenCR boards as they are setup to run Dynamixel servos.

There are libraries like: GitHub - ROBOTIS-GIT/Dynamixel2Arduino: DYNAMIXEL protocol library for Arduino
They also have a shield that works with some of the Arduino boards (Dynamixel Shield).

For some other boards like Teensy boards by PJRC, I roll my own setups.

I know this is not much help yet, but again would help others help you if you there was some additional information.

Hello Kurt,
Thanks for your quick reply. I m using OpenCR 1.0 board and I would like to control XL430 W250T (10Nos) in a Mars rover robot. I am using Arduino IDE to program and I have already installed Dynamixel2Arduino library. Kindly inform me that do I need an additional library in Arduino and also suggest me suitable dynamixel shield for controlling multiple motors.


The OpenCR board should already be setup to control those servos. It has 3 connectors on the board for TTL level servos:

I assume you have already installed the OpenCR board into the Arduino IDE? If not use the instructions in the e-Manual I linked.

As for controlling the servos with this board you have several options:
You can use the Dynamixel2Arduino, but in addition to this it also installs the
DynamixelSDK and the Dynamixel Workbench

With your board you should be able to apply power to the board to run those servos. As for can you apply enough power through this board to power 10 servos, probably yes, depending maybe on how the servos are all connected. That is if you have a daisy chain of all 10 servos in a line, maybe issues. If you instead use all 3 connections and branch out, probably OK, else you can also at times split up the servos to multiple sub-trees and use a couple powered hubs or the like where you feed in multiple batteries that each power a sub-set… But hopefully you wont need to do that.

Hello Kurt,
Thank you for the information. I am using Dynamixel Workbench.

const char * getModelName(uint8_t id, const char **log = NULL);

What is log in the above mentioned code? Kindly tell me how to use the code with an example.


@Sarwan - Sorry I have not played with the Dynamixel Workbench for a long time and I personally did not like using it. I believe it was mainly setup to use with ROS.

I believe the log parameter is a way for you to get back a string that describes an error if it should error out.
something like:

const char *log; 
const char *model_name;
model_name = dxl_wb.getModelName(id, &log);
if (!model_name) Serial.print(log);

But Again I don’t use workbench.

Hopefullly someone from Robotis like @ROBOTIS-Will might be able to help you.

Hello Kurt,
Thanks for your reply. I am finding it difficult to understand use the dynamixel workbench.
I have basic knowledge in python,C and Matlab.

As previously explained I am trying to build a mars rover, could you please suggest other sources to build code for controlling dynamixel which would be easier.


The Dynamixel Workbench is built more or less on top of the Dynamixel SDK. Which I preferred over the Workbench.

Mainly as the Workbench is setup to try to abstract your servos away. That is instead of knowing Servo type X, who has the register Y that is 16 bits in size with a range of … Instead you ask for a logical name for a parameter by string name and the code looks up the name using a table that it deduces is for your servo and computes which register it is and its true size and if remember correctly it may then scale your values to fit to that servo…

I preferred doing that work myself.

Again depending on build platform, they also created a newer library Dynamixel2Arduino which is also simpler to use.

I also had my own version of library that I had done to be compatible with the ones used by Trossen Robotics several years ago.

Which is better may be more a user preference.

Thank you. Could you please inform me, is it possible to access the code of the functions in the library. For example, in Dynamixel workbench library I would like to see the function code for goalVelocity, setGoalPosition etc…

It would be helpful for me to understand as well as create a small suitable library myself.


Again sorry, I don’t use this stuff nor doing anything with these servos right now.

But the simplest way to see the sources is to go up to github:
Their main line sources for Workbench is under the workbench project, I think the actual library is at: dynamixel-workbench/dynamixel_workbench_toolbox/src/dynamixel_workbench_toolbox at master · ROBOTIS-GIT/dynamixel-workbench · GitHub

Probably the best place to see the sources that they use for the OpenCR board Arduino, which may or may not be 100% in sync with the main sources is up at the OpenCR project. The main stuff they release is in the main branch, but if you switch to develop branch it has the sources:
You can see the different libraries at: OpenCR/arduino/opencr_arduino/opencr/libraries at master · ROBOTIS-GIT/OpenCR · GitHub

Good luck


I’m trying to run the XL430 directly from a Teensy 4.1. Is there a way to do this? Do you have any sample code by chance?

I have done this… Did you ask this on the PJRC forum? If so sorry I saw a question, but got wrapped up in other things (MTP, MSC…)…

Will try to find that thread over on the forum