Setting DYNAMIXEL Servo ID with the DXL_Monitor

Kyle Granat edited this page Oct 29, 2015 · 3 revisions

The HR-OS1 Framework comes with a program 'dxl_monitor' or DYNAMIXEL Monitor. This program is very useful for writing/reading data from the DYNAMIXEL servos and the ArbotiX Pro. In this article we'll show you how to use the DYNAMIXEL Monitor to set the servo IDs on your AX-12A servos. Click the image below to see an video tutorial on how to ID servos using the DYNAMIXEL Monitor

ID Servos HR-OS1

Before you can use the DYNAMIXEL Monitor you'll need to have your electronics setup and have the HR-OS1 Framework downloaded and compiled.

By default, all of the AX-12A servos come factory set to ID #1. For the robot to function correctly, each servo needs to be set to a unique ID. Using the DYNAMIXEL monitor you can change the ID of each servo to a new desired ID. If you have multiple servos with the same ID # on the DYNAMIXEL chain, you will see erratic behavior. Because of this, you should only have one servo plugged in at a time while setting the IDs of your servo.

The DYNAMIXEL Monitor will allow us to set the servo ID and test the servo by writing to the servo's register table. The DYNAMIXEL register table stores data that controls the servo as well as data that the servo has collected from its sensors. A full list of the servo's register table can be found on the AX-12A E-manual. We will be focusing on register 3 the ID register and registers 30/31 the Goal Position Register.

A Note on register values: Some values like ID only need one byte(0-255), so they only take up one register. Other values like Goal Position need a larger range of values (0-1023), so they take up two registers, a low-byte and a high-byte that are combined into a single value. If the value you enter into the DYNAMIXEL Monitor is more than a single byte can hold (255) then the program will automatically split the value into 2 bytes and send them to the appropriate registers.

A note to Intel Edison users : you will not need to append 'sudo' to the following commands.

First, move to your home directory

cd ~

Now move into the DXL_Monitor directory

cd HROS1-Framework/Linux/project/dxl_monitor

If you have previously compiled the DYNAMIXEL Monitor and are recompiling it because of code changes, to a make clean operation to remove old files

sudo make clean

Now compile the files using the make all command

sudo make all

Once you see the command prompt, issue the list command

ls

You should see a file called 'dxl_monitor'. You can start the program using the following command

sudo ./dxl_monitor

You should now see a list of servos 1-20 as well as the ArbotiX pro (ID # 200). The ArbotiX pro should have an 'OK' message next to it while the other 20 servos have a 'fail' message. At any time you can type

help

to see a list of all the available commands.

Now you can plug in your first servo. Take a 3-pin cable and plug one end into the back of your servo (either of the 2 ports will work, they are electrically identical). Plug the other end into one of the five 3-pin ports along the side of the ArbotiX Pro board. Do not plug the servo into the 3-pin port labeled 'CPU Power only' Once the servo is plugged in, issue a scan command to rescan the servo chain

scan

Now you should see 'OK' next to servo #1. Now we can use the id command to move to servo #1, so that any write commands will be directed to servo #1.

id 1

We do not need to do any special commands to set the ID for servo #1, but we will test it by sending a positional command. To do this we will send the following command

wr 30 0

This command will write to the register 30 the value 0. This will move the servo as far clockwise as it can go. If we wanted the servo to move as far counter-clockwise as possible, we would send the command

wr 30 1023

Before we unplug the servo, we need to set it back to its 'centered' value, 512. At this value the single notch on the servo horn should line up with the single notch on the top of the servo case. To set the value to 512, send the following command

wr 30 512

Now you can unplug the servo and put the ID #1 sticker on the back of it.

Next, plug in a new servo. When you type

scan

You should see the same report as before, ID #1 should have a 'OK' next to it. To make sure that our commands are directed to ID # 1, type

id 1

again. This time however, we need to change the ID value to 2. To do this we will need to write to the register 3</strong the value 2

wr 3 2

Once we've set the new ID, the command prompt should also change to reflect that we're directing commands to ID # 2. We can now test the servo just as we did before

wr 30 0 wr 30 512

Once the servo is IDed and tested, unplug the servo and attach the sticker to it. You can now repeat the process for the other 18 servos. At the bottom of this article we've listed all the commands for all IDing/testing all the servos.

After you have set the IDs on all of your servos, you will want to plug all of the servos into the ArbotiX Pro. Plug one servo directly into the ArbotiX Pro with a 3-pin cable. Use another 3-pin cable to connect the open port on the first servo into the next servo. Repeat this process until you have a chain with all 20 servos. Now perform a scan in the DYNAMIXEL monitor

scan

you should see an 'OK' message next to all 20 of the servos - this means that you've correctly set the IDs on all of your servos. You can now move on to the HR-OS1 Assembly Guide

##Complete list of commands for IDing servo 3-20 Plug In a new servo.

scan

id 1

wr 3 3

wr 30 0

wr 30 512

Unplug and sticker servo # 3, plug In a new servo.

scan

id 1

wr 3 4

wr 30 0

wr 30 512

Unplug and sticker servo # 4, plug In a new servo.

scan

id 1

wr 3 5

wr 30 0

wr 30 512

Unplug and sticker servo # 5, plug In a new servo.

scan

id 1

wr 3 6

wr 30 0

wr 30 512

Unplug and sticker servo # 6, plug In a new servo.

scan

id 1

wr 3 7

wr 30 0

wr 30 512

Unplug and sticker servo # 7, plug In a new servo.

scan

id 1

wr 3 8

wr 30 0

wr 30 512

Unplug and sticker servo # 8, plug In a new servo.

scan

id 1

wr 3 9

wr 30 0

wr 30 512

Unplug and sticker servo # 9, plug In a new servo.

scan

id 1

wr 3 10

wr 30 0

wr 30 512

Unplug and sticker servo # 10, plug In a new servo.

scan

id 1

wr 3 11

wr 30 0

wr 30 512

Unplug and sticker servo # 11, plug In a new servo.

scan

id 1

wr 3 12

wr 30 0

wr 30 512

Unplug and sticker servo # 12, plug In a new servo.

scan

id 1

wr 3 13

wr 30 0

wr 30 512

Unplug and sticker servo # 13, plug In a new servo.

scan

id 1

wr 3 14

wr 30 0

wr 30 512

Unplug and sticker servo # 14, plug In a new servo.

scan

id 1

wr 3 15

wr 30 0

wr 30 512

Unplug and sticker servo # 15, plug In a new servo.

scan

id 1

wr 3 16

wr 30 0

wr 30 512

Unplug and sticker servo # 16, plug In a new servo.

scan

id 1

wr 3 17

wr 30 0

wr 30 512

Unplug and sticker servo # 17, plug In a new servo.

scan

id 1

wr 3 18

wr 30 0

wr 30 512

Unplug and sticker servo # 18, plug In a new servo.

scan

id 1

wr 3 19

wr 30 0

wr 30 512

Unplug and sticker servo #19, plug In a new servo.

scan

id 1

wr 3 20

wr 30 0

wr 30 512

Unplug and sticker servo # 20

ls /dev/ttyUSB0