Thumbnail

Dynamixel

Connect and control Robotis Dynamixel Servos to ARC. This open-source plugin converts the Virtual Servo ports on ARC (v0-v99) to control Robotis Dynamixel Servos.

+ How To Add This Control To Your Project (Click to Expand)
  1. Make sure you have the latest version of ARC installed.
  2. Select the Get button in this page to download the archive file.
  3. Double click the downloaded archive file to execute installer.
  4. The installer will add this control to ARC.
  5. Load ARC and press the Project -> Add Control button from the menu.
  6. Choose the Servo category tab.
  7. Press the Dynamixel icon to add the control to your project.

Manual

Connect and control Robotis Dynamixel Servos with ARC, including Arduino and Robotis controllers. This open-source plugin converts the Virtual servo ports with any EZ-B (v0-v99) to control Robotis Dynamixel Servos. The servos supported are XL-320, AX-12, and XL430 compatible protocols. Dynamixel Servos are very different than regular hobby PWM servos. Firstly, they are considered much more professional due to their design which is specifically for use in robotics. Each Dynamixel servo contains a microprocessor. The microprocessor is told what position to move the servo into over TTL at the configured baud rate. 

ARC Capability Support
This robot skill supports native ARC servo parameters for Position, Acceleration, Velocity, and Speed

Cable Accessory
This plugin requires a cable accessory to easily connect your servo to the EZ-B. If you desire to READ servo positions, the cable will need to include both RX and TX. There are instructions below for connecting the servo to READ positioning.
User-inserted image


EZB Controller Types


There are a few different types of EZB controllers, that each has its own hardware configuration. We cover the controllers and what UART should be used below.

EZ-Robot IoTiny
The IoTiny does not have a hardware UART, so it cannot read servo positions. This means you can use any of the digital ports to transmit servo positions to the servo. Connect any digital port of the IoTiny to the signal wire of the dynamixel connector.

Arduino/EZ-Robot EZB v4 Wiring For Reading Positioning
You must manually wire the servo yourself to these controllers using this diagram. If you wish to read servo data with bi-directional communication, you must connect TX and RX ports together. On the EZ-Robot EZ-B v4, it’s port D5 (TX) and D6 (RX) for UART #1 together. 

User-inserted image



Robotis Open CM9.04 Controller
The Robotis Open CM9.04 controller can either support servos connected directly to itself or through the expansion board. If using only the controller, the UART #0 is used in ARC. If using the expansion board, UART #2 is used in ARC.

Robotis OpenCR Controller
The Robotis OpenCR controller can support servos connected directly to the onboard connectors. This uses UART #2 in ARC, which means select UART #2 in the dynamixel robot skill config.

UART/Serial Port Overview


There are a few options for connecting the Dynamixel servos that were covered above. Here is a summary...

1) EZB controllers without hardware UART (such as IoTiny) will use software serial pins for transmitting servo positions only. They cannot read servo positions. With this setup, you can use any digital port.

2) EZ-Robot EZ-B v4 or Arduino Mega is UART #1 (port D5 & D6). But depending on how many UARTs there EZB has, you can connect to any UART.

3) Robotis Open CM 9.04 without expansion board uses UART #0.

4) Robotis Open CM 9.04 with expansion board uses UART #2.

5) Robotis OpenCR uses UART #2.

Voltage


Most Dynamixel servo documentation states the operating voltage in the manual. Check the documentation for your dynamixel servo model to ensure your power source is sufficient. If you experience unusual behavior of Dynamixel servos, the first common issue is insufficient power. 

Servo ID


The Dynamixel Servos each have a unique ID. Because they are chained together through one cable, each servo must be given a unique ID. Servos with the same ID will respond to the same commands and therefore mirror their behavior. New Dynamixel Servos come pre-configured with the ID of 01. servo V0 relates to dynamixel ID:0, V1 is dynamixel ID:1, v2 is dynamixel ID:2, and so on...

Using this configuration utility, you can assign new ID's to servos. You may also test the servo to ensure the ID was successful.


Servo LEDs


The LEDs on the dynamixel servo can be controlled using the EZ-Script ControlCommand(). View the Cheat Sheet when editing a script to see the available ControlCommand syntax for the Dynamixel Plugin.


Control Commands


There are a number of control commands supported by this robot skill. The most useful are the WriteRam commands. These allow the user to send a command directly to the servo RAM. These control commands are not required to use this robot skill, as these are added for advanced users. To use the robot skill and move servos, simply follow the instructions in this manual page to assign Dynamixel servo id's to ARC Vx servos.

Code:


controlCommand("Dynamixel", "SetLED", Port, true|false);
controlCommand("Dynamixel", "TorqueEnable", Port, true|false);
controlCommand("Dynamixel", "WriteRamByte", Port, Address, Value);
controlCommand("Dynamixel", "WriteRamInt32", Port, Address, Value);
controlCommand("Dynamixel", "WriteRamUInt16", Port, Address, Value);


1) The Address and Value can be referenced using the servo Control Table. Find the list of Dynamixel Servos HERE to access their control table specifications.

2) Each WriteRam ControlCommand() specifies the size of the value. This is because control table addresses will require a value size (byte, int32, uint16). Check the manual for the control table command for the variable size it accepts.

For example, this command will set the goal position of an AX-12 servo on port V1 (id 1) to 512.

Code:


controlCommand("Dynamixel", "WriteRamUInt16", v1, 30, 512);

When viewing the control table, the parameters you will need for the control commands are identified in the image below. Notice the SIZE parameter, which determines the WriteRamXXXX to use. If the size is 1, the WriteRamByte will be used. If the size is 2, the WriteRamUInt16 will be used. If the size is 4, the WriteRamIn32 will be used. 

The address is and value range are also displayed in the control tables.
User-inserted image




EZ-Script Commands


There are a number of EZ-Script commands added with this control. The commands are as follows...

Quote:


GetDynamixelTemp(ServoPort)
Returns the temp of the specified servo

GetDynamixelLoadDir(ServoPort)
Returns the direction of load on the specified servo

GetDynamixelLoad(ServoPort)
Returns the load of the specified servo

GetDynamixelPing(ServoPort)
Returns a ping response if the servo exists. Otherwise, returns false


Video Demo With Robotis Arm


This video uses a Robotis Dynamixel arm and XM430 servos with an OpenCM9.04 controller. 



Troubleshooting Dynamixel Servos


If the servos are not responding, verify the physical connection is correct. Next, verify adequate power is provided to the servo. Verify the servo ID and correct type is selected in this robot skill config.

If the XL430 or similar type servo is not responding, the torque may be disabled. This can be force enabled by using the control command, or by releasing the servo. When the servo is released, it will automatically enable torque once the servo is instructed to move.


Step by Step Instructions


Once you have the servo wired, and sufficient power is provided, you can use any control in ARC that uses servos. This means it will work with Auto Position, Camera, WiiMote, Joystick, and more. In this example, we'll show you how to move a dynamixel servo with generic servo control. Before following these steps, ensure you have this plugin installed.



Step 1
Load ARC

User-inserted image




Step 2

Connect to your I/O controller

User-inserted image




Step 3

Add the control by selecting the Project tab and Add Control

User-inserted image




Step 4

Navigate to the servo tab and select Dynamixel. If the plugin has been successfully installed, you will see the Dynamixel plugin in the list.

User-inserted image




Step 5

The Dyamixel control will be added to your project. Press the Config gear icon to load the configuration screen.

User-inserted image




Step 6

Enter the baud rate that matches your servo configuration. The servos have a baud rate that can be specified or a default baud rate shipped from the factory. If you need to change the baud rate of the servo, use the Dyanmixel utility. You cannot change the baud rate of the servo in ARC. This value is the baud rate that the EZ-B will use to communicate with the dynamixel servo. This must match the baud rate of the servo.

User-inserted image




Step 6a

Specify what port the servo is connected to on the controller. It is important to follow this recommendation. There are blue question boxes in the plugin (and throughout the ARC software) to assist your robot development. It is recommended to use the blue question marks and read the content to understand what options do.

User-inserted image




Step 7

Each dynamixel servo will have a unique ID. Enable each ID for the servos by checking the respective box. When an ID is checked, the ARC software will use the Vx (virtual servos) corresponding with that ID. For example, if you enable Dynamixel servo ID #2, the ARC V2 servo will control it. Also, specify the protocol version of the servo. Different dynamixel models will use one of the two protocols. Consult the datasheet of the dynamixel servo to know what protocol it uses -or- contact Robotis for more information on using their product. To get full resolution of the servo, also ensure you have entered the MAX resolution for that servo model. Each model has different resolutions, or it can be configured using the Dyanmixel utilities.

User-inserted image




Step 8

After you have enabled your servos, press Save

User-inserted image




Step 9

Now we will show you an example of how the servo can be moved. We will do this by using a generic horizontal servo control. Press Project -> Add Control to return to the add control menu. Navigate to servo and select Horizontal Servo. Remember, any control in ARC that uses servos can now control dynamixel servos by the respective Vx (virtual) servo ID.

User-inserted image




Step 10

Press the GEAR icon to configure the horizontal servo control.

User-inserted image




Step 11

To configure this control to use a virtual servo, select the servo to bring up the port dialog. This applies to all controls in ARC that use servos.

User-inserted image




Step 12

Select the Virtual servo ID for your dynamixel servo from the list and press Close.

User-inserted image




Step 13

Now use the sliders to specify the Min and Max position that you wish this servo to move and press Close.

User-inserted image




Finished

You can now control the dynamixel servo with the horizontal servo control. To find out more about servos, consult the learn section of this website for activities on using your Synthiam product.

Related Content

live hack
DJ's Third Hack Night

DJ's Third Hack Night

We're going to play with EZ-Builder software, build Perry's robot eyes, make Dynamixel servo cables, demonstrate how to...
live hack
DJ's 4Th Hack Event (Arduino, Bioloid, Lewansoul, And More)

DJ's 4Th Hack Event (Arduino, Bioloid, Lewansoul, And More)

In the last event, some people asked me to demonstrate how to use the LewanSoul Serial Servos. Also, we'll program the...
live hack
Dj's 5Th Live Hack Session

Dj's 5Th Live Hack Session

In this 5th live robot hacking event, I will demonstrate how to program an Arduino and connect it to EZ-Builder via USB...
question
Dynamixel With Ezbpi Server

Dynamixel With Ezbpi Server

I am trying to control my Dynamixel AX-12a with the EZBPi, but when I try to connect EZ-Builder it disconnects shortly...
live hack
DJ's 9Th Live Hack - Raspberry Pi + Dynamixel... Together For Ever!

DJ's 9Th Live Hack - Raspberry Pi + Dynamixel... Together...

This is a short live hack where I will demonstrate how to... 1) Install EZ-Builder on Raspberry Pi 2) Install EZBPi...
live hack
Hacking Robotis Opencm 9.04 With Bioloid

Hacking Robotis Opencm 9.04 With Bioloid

I will be hacking the Robotis OpenCM 9.04 controller with EZ-Builder using a Bioloid. We'll install the Arduino OpenCM...
live hack
The Lattepanda Robot Hack

The Lattepanda Robot Hack

I'm hacking the lattepanda to control Robotis Dynamixel servos and use a USB camera for machine vision. This will be a...
question
Leap Motion Combine With Ez-Builder To Control In Space

Leap Motion Combine With Ez-Builder To Control In Space

I'm trying to use LEAP Montion on EZ-builder but I'm still not successful and I posted this question in the hope that...
question

Using Dynamixel Servos With EZ-Builder

Hey, I was tossing it in my head for a while...but I did not ask this, because there is a solution already, and I chose to build my robot using a...
tutorial
Robotis Arm, Opencm 9.08 & Dynamixel XM430

Robotis Arm, Opencm 9.08 & Dynamixel XM430

Learn how to program and control a Robotis Arm powered by a OpenCM 9.04 board and Dynamixel servos using Synthiam...
question
Controlling Speed On Dynamixels.

Controlling Speed On Dynamixels.

How would you approach controlling travel speed on a Dynamixel (400 Series) servo when not using Autoposition? I tried...
PRO
Synthiam
#48  
Added support for Wheeled Mode (act like a wheel) or Position mode (act like a servo) for XH430 servos.

User-inserted image
PRO
Synthiam
#49  
Updated with a debug checkbox option that can be used for testing. It is not recommended to use the option other than testing because it will slow the computer down a lot.
PRO
Synthiam
#50  
Added controlcommands to allow writing directly to the dynamixel RAM by specifying the control table address. Check the manual above on how to access the control tables for each robotis servo.

User-inserted image
PRO
USA
#51  
I just did a test and wasn't able to get my XM servo to change profile velocity using the Skill.
The Cheat Sheet shows a lot of extra parenthesis and slash marks...  I removed them and tried it.  I may have gotten that wrong but I used my Dynamixel line sniffer and it didnt send.

This is what my script sent... I know it needs 4 bytes of data so that makes it Int32
Cheat Sheet shows:  controlCommand("Dynamixel", "\"WriteRamInt32\", Port, Address, Value");

my javascript reads:

Code:

controlCommand("Dynamixel", "SetLED", V2, true);
controlCommand("Dynamixel", "WriteRamInt32", V2, 112, 10);

The first line turns on the LED and is there just to be sure things are talking to each other.

On the sniffer end all I get is the led command as having been sent.

BTW here is the correct command that should appear.
User-inserted image


It is probably just a syntax error on my part from misinterpreting the Cheat Sheet instruction, but if properly executed it should make my servo run extremely slow.  I do get this error when running the above script:
User-inserted image

I am testing on two XM540-W150-R servos.  
Profile velocity is #112 on the control table 


BTW profile acceleration and profile Velocity are the two settings that make dynamixels amazing! 
I'm super excited that you are working to give us access to them in ARC!!!!
PRO
USA
#52   — Edited
I agree with David on this. Acceleration and velocity!
PRO
Synthiam
#53  
Interesting - I’ll take a look. Stay tuned
PRO
Synthiam
#54   — Edited
Try the latest version (v43)

The Cheat Sheet will still be incorrect with the slashes (Escape) because there is a bug in ARC that is doing it. That explains the multiple \" in the cheatsheet.  I submitted a fix and it'll be released in a few days I suspect. The bug seems to be with multiple ControlCommand() parameters.

However, there is a workaround for the time being. Simply right-click in the editor and use the menu-driven ControlCommand() interface. The right-click when editing a script is the most common method of using the cheat sheet.
PRO
USA
#55  
That worked beautifully!
I wrote this short dynamixel test with a well documented script to help people understand how acceleration and velocity work in the simplest terms.  Ill link it below

Change Dynamixel Acc and Vel.EZB

This is the simple script within it :

Code:

// Simple Script to change the acceleration and velocity on two XM540-W150-R
// This script works on most x series 500 and 400 Dynamixels.. Check control
// table at Robotis wesite to make sure your servos use these same control codes
// Note acceleration value should be half or less of the velocity value.
// Max values allowed vary from servo to servo (see control table for more info)
// A lower acceleration value gives a more sluggish but more dampened motion
// values of 0 = max value so setting both acceleration and velocity
// to 0 gives you full speed with no dampening
// Acceleration and velocity values should just be set as needed and not constantly within a loop

//change velocity on servo 1 to 75 (profile velocity control code is 112)
controlCommand("Dynamixel", "WriteRamInt32", V1, 112, 75);
//change acceleration on servo 1 to 10 (profile velocity control code is 108)
controlCommand("Dynamixel", "WriteRamInt32", V1, 108, 10);

controlCommand("Dynamixel", "WriteRamInt32", V2, 112, 75);
controlCommand("Dynamixel", "WriteRamInt32", V2, 108, 10);
PRO
USA
#56  
Here is a quick test showing one servo at full speed and acceleration and the second set at slow speed with very low acceleration...  Congrats on this awesome skill! It opens up to a ton of possibilities! Wonder if it can do time based movements yet?  if not maybe look into it... telling a servo where to go and what time to get there and having it do all of the math itself is pretty cool too!

PRO
USA
#59  
Some new awesomeness! Thanks!
PRO
USA
#60  
I'm having some strange behavior on Alan and Alena's dynamixels. The robots have not been on for several months and I needed to activate them for an interview. I updated to the latest build and updated the skill.

The servos power up and move for a moment, but  they reach an odd start position and then they do not respond to input from touchpad or the sliders. It happens on both robots and the rest position is the same for both. I'll dive deeper into the issue tomorrow and make a video if I can't troubleshoot the issue.
PRO
Synthiam
#61  
You can turn on servo debugging to see what’s going on temporarily

also remember the global servo position limit is in a new place. It’s not global for arc. So if you had it set before, it will need to be set again
PRO
USA
#62  
...ahhhh that's right, I forgot about the global setting...I bet that's it...I'll take a look! Thanks for the reminder!
PRO
USA
#63  
I am having an issue that started with the latest revision.  I had the dynamixels working, but when the acceleration and velocity settings were added it stopped responding.  I am not sure if it is because of this but it did start exactly on that day.  I am getting connection on ARC and I can see the green communication light flicker when I move a horizontal control,  but the servos remain torqued off.
I'm not sure what the global servo position is so maybe the solution is in your previous response.  I just couldn't find anything called global servo limits anywhere.
Could it be a baud rate issue?
my servos are set to 1000000 baud*
That is the speed that the OpenCM talks to the servo on and not the speed that the ARC software talks to openCM... that is set to 921600 on COMUSB connection settings page... not sure if I need DTR RTS enabled for this.... but like I said, it worked prior to the last change so Im guessing my settings should work.  The Dynamixels do get power and the leds turn on and off with the script below so I know they are talking back and forth

Code:


// This script works on most x series 500 and 400 Dynamixels.. Check control
// table at Robotis wesite to make sure your servos use these same control codes
// Note acceleration value should be half or less of the velocity value.
// Max values allowed vary from servo to servo (see control table for more info)
// A lower acceleration value gives a more sluggish but more dampened motion
// values of 0 = max value so setting both acceleration and velocity
// to 0 gives you full speed with no dampening
// Acceleration and velocity values should just be set as needed and not constantly within a loop

//change velocity on servo 1 to 75 (profile velocity control code is 112)
controlCommand("Dynamixel", "WriteRamInt32", V1, 112, 75);
//change acceleration on servo 1 to 10 (profile velocity control code is 108)
controlCommand("Dynamixel", "WriteRamInt32", V1, 108, 10);

controlCommand("Dynamixel", "WriteRamInt32", V2, 112, 75);
controlCommand("Dynamixel", "WriteRamInt32", V2, 108, 10);

controlCommand("Dynamixel", "SetLED", V1, false);
controlCommand("Dynamixel", "TorqueEnable", V1, true);

controlCommand("Dynamixel", "SetLED", V2, true);
controlCommand("Dynamixel", "TorqueEnable", V2, true);
PRO
Synthiam
#64  
The ezb baudrate and servo baudrate can be different. It’s okay because they’re different ports on different connections. 

dtr and rts only need to be enabled if the ezb won’t connect at all. If the ezb is connecting, then it’s golden. 

I’ll take a peek to see if the previous changes would affect anything. Stay tuned
PRO
USA
#65  
This might help you guys...
I did some line sniffing and found that the Torque Enable command in the Cheat Sheet doesn't actually send anything down to the Dynamixel that is readable by the Dynamixel wizard.
My workaround was to use this line of code instead.

Code:

controlCommand("Dynamixel", "WriteRamByte", V1, 64, 1);
register 64 torques on the servo when it gets a 1 value and torques it off when it gets a 0.
This got my servo torqued ON and working, but I am pretty sure that before the servos torqued on from the start and didn't require this step.

Either way I'm back in business while you have time to look up the bug.
PRO
Synthiam
#66  
Ya they used to torque from startup. Strange they’re not. Thanks for debugging that because it’ll help.
PRO
Synthiam
#67  
A bug was introduced from an optimization in the ezb servo library which caused the torque to not enable when the servo was released. This has been resolved and will be included in tonight's release