Controlling Dynamixel MX-28T or MX-64T servo wirelessly using Arduino Mega?

I am planning to control multiple Dynamixel servos (MX28T or MX-64T) wirelessly using Arduino Mega. Since this servo uses serial communication, I need an additional serial port to interface with Xbee module. Although it seems to be very common application controlling these servos wirelessly based on Arduino, I could't find any of them in web. I found the two very well constructed libraries.

https://code.google.com/p/slide-33/downloads/list. This library is for MX28T servo, which is the same servo I am trying to use, but it uses UNO;therefore, I cannot interface with Xbee.

http://www.pablogindel.com/informacion/the-arduinodynamixel-resource-page/. This library use UART1 (serial1) to interface with servo (AX-12) motors. Therefore, I can connect Xbee module to UART0. But, the problem is that this library is outdated and not compatible with MX64-T servo anymore.

So my question is here:

Is there any one who has experience in controlling Dynamixel MX24T, MX64T servo series using Xbee module simultaneously? If you have experience, please share with me.

Is it possible for Arduino Mega can interface with Xbee module using Serial1 (i.e., RX18 TX19)? If it can, I might be able to use the library1 without any modification.

Thank you very much.

This library is for MX28T servo, which is the same servo I am trying to use, but it uses UNO;therefore, I cannot interface with Xbee.

Why not? The XBee does not need to be connected to Serial. It can be connected to Serial1, Serial2, or Serial3.

Is it possible for Arduino Mega can interface with Xbee module using Serial1

Of course it is. With the appropriate shield (most are not) or breadboard connections.

Jinkyoo:
Is there any one who has experience in controlling Dynamixel MX24T, MX64T servo series using Xbee module simultaneously? If you have experience, please share with me.

Is it possible for Arduino Mega can interface with Xbee module using Serial1 (i.e., RX18 TX19)? If it can, I might be able to use the library1 without any modification.

Thank you very much.

I've faced a similar situation before. Modified some code to work with Dynamixel mx28 servos and serial1 port (Leonardo board). Just uploaded to my github in case you may find it useful:

Regards.

Thank you very much!!
You eliminate my concern. I might need to order the servos and test it. Let me add one more question. To control two servos, connected in serial chain, can I just write a command message (packet) with motor ID? Is is similar to communicating with multiple Xbees having their own ID?

Thank you again for your code. It will greatly helpful.

Jinkyoo:
Thank you very much!!
You eliminate my concern. I might need to order the servos and test it. Let me add one more question. To control two servos, connected in serial chain, can I just write a command message (packet) with motor ID? Is is similar to communicating with multiple Xbees having their own ID?

Thank you again for your code. It will greatly helpful.

Yes, that's it. As you can see in the example included in my github, you can address any motor in the chain by it's id. However, the brand new servos are configured all with the same ID: 1. What I do to change a servo's ID, is to plug only that servo and uncomment the line in the provided example sketch:

mx28SetRegisterID(id,CHANGE_ID_REGISTER,newid);

Upload it to the Arduino board and it will then change the servo's ID. Leonardo board takes a few seconds to reset and do the thing, so be patient. You may have to plug/unplug to see the changes. Dont forget to change the test commands with the new ID

Another option I changed is the baudrate. New servos are suppose to come with a 57600 baudrate. You can change that with this command:
mx28SetBR(id,1000000);

Changing ID'a and baudrates can get a bit tricky, since you may forget to change the sketch to the new baudrate/id to communicate again with the servo, so I recommend to label the servo with the new ID and baudrate once changed and verified.

If things get messed up, you can reset the servo to the factory defaults with the command:

mx28reset(id);

Just make sure you execute this command with the proper baudrate and id, or with id 254 (address all servos) and trying all baudrates (and plugging only the servo(s) you want to reset).

Have a look at this blog for the hardware setup and lots of info:

I'll also upload to the repo the board layout I designed for my setup.

Edit: here you go with the shield: GitHub - dasaki/dynashield: Arduino shield to interface Dynamixel AX and MX series servos