Legacy Forum: Preserving Nearly 20 Years of Community History - A Time Capsule of Discussions, Memories, and Shared Experiences.

Moving Dynamixels with sync_wr

Bioloid robot kit from Korean company Robotis; CM5 controller block, AX12 servos..
24 postsPage 1 of 21, 2
24 postsPage 1 of 21, 2

Moving Dynamixels with sync_wr

Post by Andi » Sun Feb 17, 2008 1:29 pm

Post by Andi
Sun Feb 17, 2008 1:29 pm

Hi All,

I am currently trying to move several AX-12+ with sync_write

I was following the Bioloid manual and did it for two AX-12+

sync_wr 30 4 0 0 2 80 0 1 0 1 80 0

and it worked.

I understand from the "syntax" above that

0 0 2 80 0

says move

ID 0

to position 0 2

with speed 80

I dont know which position is 0 2??


If I have a target position of lets say 0652 for ID 2 how could this be translated for the sync_wr command?

Many thanks for any help

iandi
Hi All,

I am currently trying to move several AX-12+ with sync_write

I was following the Bioloid manual and did it for two AX-12+

sync_wr 30 4 0 0 2 80 0 1 0 1 80 0

and it worked.

I understand from the "syntax" above that

0 0 2 80 0

says move

ID 0

to position 0 2

with speed 80

I dont know which position is 0 2??


If I have a target position of lets say 0652 for ID 2 how could this be translated for the sync_wr command?

Many thanks for any help

iandi
Andi
Robot Builder
Robot Builder
Posts: 10
Joined: Thu Feb 07, 2008 6:08 pm

Post by Rob » Mon Feb 18, 2008 1:34 pm

Post by Rob
Mon Feb 18, 2008 1:34 pm

I'll try to remember to send you the instructions for this when I get home from work. In the mean time the VBA code in the Excel plotter might help http://robosavvy.com/forum/viewtopic.php?t=318
I'll try to remember to send you the instructions for this when I get home from work. In the mean time the VBA code in the Excel plotter might help http://robosavvy.com/forum/viewtopic.php?t=318
Rob
Savvy Roboteer
Savvy Roboteer
Posts: 51
Joined: Sun Nov 25, 2007 2:05 pm

Post by Rob » Mon Feb 18, 2008 11:53 pm

Post by Rob
Mon Feb 18, 2008 11:53 pm

Hope this helps:

Write Sync Command: SWR FirstAddress Length FirstDynamixelId PositionLow PositionHigh SpeedLow SpeedHigh

Aim: Move ID 6 to position 500 with speed 100
GoalLow:500 % 256 = 244
GoalHigh:500 / 256 = 001
SpeedLow:100 % 256 = 100
SpeedHigh:100 / 256 = 000

Therefore the command is: SWR 30 4 6 244 001 100 000
Hope this helps:

Write Sync Command: SWR FirstAddress Length FirstDynamixelId PositionLow PositionHigh SpeedLow SpeedHigh

Aim: Move ID 6 to position 500 with speed 100
GoalLow:500 % 256 = 244
GoalHigh:500 / 256 = 001
SpeedLow:100 % 256 = 100
SpeedHigh:100 / 256 = 000

Therefore the command is: SWR 30 4 6 244 001 100 000
Last edited by Rob on Wed Feb 20, 2008 9:55 am, edited 1 time in total.
Rob
Savvy Roboteer
Savvy Roboteer
Posts: 51
Joined: Sun Nov 25, 2007 2:05 pm

Post by Andi » Tue Feb 19, 2008 10:31 pm

Post by Andi
Tue Feb 19, 2008 10:31 pm

Hi Rob,

excellent! I tried this and it works fine. Just a last question:

What are the standard min and max values for each Dynamixel and what is then the middle??

Best wishes and many thanks again

iandi
Hi Rob,

excellent! I tried this and it works fine. Just a last question:

What are the standard min and max values for each Dynamixel and what is then the middle??

Best wishes and many thanks again

iandi
Andi
Robot Builder
Robot Builder
Posts: 10
Joined: Thu Feb 07, 2008 6:08 pm

Post by JonHylands » Tue Feb 19, 2008 10:48 pm

Post by JonHylands
Tue Feb 19, 2008 10:48 pm

They all range from 0-1023, so the middle value is 511.

You should really read the AX-12 manual - it has a wealth of information on everything about the AX-12...

- Jon
They all range from 0-1023, so the middle value is 511.

You should really read the AX-12 manual - it has a wealth of information on everything about the AX-12...

- Jon
JonHylands
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 512
Joined: Thu Nov 09, 2006 1:00 am
Location: Ontario, Canada

Post by Ike » Sun Feb 24, 2008 9:21 pm

Post by Ike
Sun Feb 24, 2008 9:21 pm

I have a somewhat related question. When I try to do a SyncWrite in Manage mode (from robot terminal, hyperterm, VB, C#, etc.) only the first 60 characters are accepted by the CM5. After the 60th character, I can see the CM5 receives the character (RXD lights) but nothing is returned or registered (no TXD light.) This is frustrating, as the code to send goal position and speed gets cut off in the middle of the third servo's command:

Code:

this.comPort.WriteLine("SWR 30 4" +
" 001 255 001 100 000" +
" 002 255 001 100 000" +
" 003 090 001 100 000" +
" 004 255 001 100 000" +
" 005 255 001 110 000" +
" 006 255 001 050 000" +
" 007 255 001 100 000" +
" 011 255 001 100 000" +
" 012 255 001 100 000" +
" 013 155 002 100 000" +
" 014 255 001 100 000" +
" 015 255 001 110 000" +
" 016 255 001 050 000" +
" 017 255 001 100 000");

Received by CM5:

SWR 30 4 001 255 001 100 000 002 255 001 100 000 003 090 001

I have searched all over trying to find documentation (or any reference) of this 60 character limit, but have found nothing. I am running the latest Bioloid firmware (v115). Is this limit common across all stock CM5s, or am I just running into a (mis)configuration issue with my unit?

Any help would be appreciated!

Thanks,

Chris
I have a somewhat related question. When I try to do a SyncWrite in Manage mode (from robot terminal, hyperterm, VB, C#, etc.) only the first 60 characters are accepted by the CM5. After the 60th character, I can see the CM5 receives the character (RXD lights) but nothing is returned or registered (no TXD light.) This is frustrating, as the code to send goal position and speed gets cut off in the middle of the third servo's command:

Code:

this.comPort.WriteLine("SWR 30 4" +
" 001 255 001 100 000" +
" 002 255 001 100 000" +
" 003 090 001 100 000" +
" 004 255 001 100 000" +
" 005 255 001 110 000" +
" 006 255 001 050 000" +
" 007 255 001 100 000" +
" 011 255 001 100 000" +
" 012 255 001 100 000" +
" 013 155 002 100 000" +
" 014 255 001 100 000" +
" 015 255 001 110 000" +
" 016 255 001 050 000" +
" 017 255 001 100 000");

Received by CM5:

SWR 30 4 001 255 001 100 000 002 255 001 100 000 003 090 001

I have searched all over trying to find documentation (or any reference) of this 60 character limit, but have found nothing. I am running the latest Bioloid firmware (v115). Is this limit common across all stock CM5s, or am I just running into a (mis)configuration issue with my unit?

Any help would be appreciated!

Thanks,

Chris
Ike
Newbie
Newbie
Posts: 6
Joined: Sun Feb 24, 2008 9:05 pm

Post by Rob » Tue Feb 26, 2008 1:45 pm

Post by Rob
Tue Feb 26, 2008 1:45 pm

Hi Ike,

I haven't hit this yet but I will very soon. If no one provides an answer in a couple of days I suggest you post it on the robotis site forum. The guys there are really good at answering questions like this.

I have the feeling however that this may be a limitation of the CM5 lib method that handles the SWR command and cannot be fixed.

Once you have found out could you post the answer back here!

Cheers
Rob
Hi Ike,

I haven't hit this yet but I will very soon. If no one provides an answer in a couple of days I suggest you post it on the robotis site forum. The guys there are really good at answering questions like this.

I have the feeling however that this may be a limitation of the CM5 lib method that handles the SWR command and cannot be fixed.

Once you have found out could you post the answer back here!

Cheers
Rob
Rob
Savvy Roboteer
Savvy Roboteer
Posts: 51
Joined: Sun Nov 25, 2007 2:05 pm

Post by Ike » Tue Feb 26, 2008 7:01 pm

Post by Ike
Tue Feb 26, 2008 7:01 pm

I would be inclined to think it was a limitation of the CM5, but I noticed that the code behind the '2 arm plotter' Excel project sends goal position and speed for 4 servos in one Sync Write, which led me to believe I may have something misconfigured on my end.

Also, just for clarification, the 60 character limit is for any input, not just the Sync Write command. For example, if you open the CM5 through Hyperterm, start Manage Mode, and just send XXXXXXXXXXXXXXX......, it will only accept 60 before it stops responding to the input. You can backspace and enter another character and it is fine, but won't seem to go past 60.
I would be inclined to think it was a limitation of the CM5, but I noticed that the code behind the '2 arm plotter' Excel project sends goal position and speed for 4 servos in one Sync Write, which led me to believe I may have something misconfigured on my end.

Also, just for clarification, the 60 character limit is for any input, not just the Sync Write command. For example, if you open the CM5 through Hyperterm, start Manage Mode, and just send XXXXXXXXXXXXXXX......, it will only accept 60 before it stops responding to the input. You can backspace and enter another character and it is fine, but won't seem to go past 60.
Ike
Newbie
Newbie
Posts: 6
Joined: Sun Feb 24, 2008 9:05 pm

Post by Ike » Fri Mar 14, 2008 1:54 am

Post by Ike
Fri Mar 14, 2008 1:54 am

For those that are interested, here is the response from Robotis:

Dear 1ke,

Thank you for your kind patience.

#define COMMAND_BUFFER_SIZE 60

void SerialMonitor(void)
{
byte bpCommandBuffer[COMMAND_BUFFER_SIZE];
byte bTerminate,bCount,bParaNum,bRxData;
byte bpCommand[COMMAND_LENGTH];
unsigned long ulpParameter[PARA_NUM];
.
.
Currently, the manage mode and edit mode's text command buffer within the CM-5 firmware
is limiting the size to 60 characters. With the information provided, we are assuming that
the programming has been done through a program like Visual Studio.
This may be a little inconvenient, but please try creating your own packet and use the CM-5
s toss mode.

Thanks,
ROBOTIS
For those that are interested, here is the response from Robotis:

Dear 1ke,

Thank you for your kind patience.

#define COMMAND_BUFFER_SIZE 60

void SerialMonitor(void)
{
byte bpCommandBuffer[COMMAND_BUFFER_SIZE];
byte bTerminate,bCount,bParaNum,bRxData;
byte bpCommand[COMMAND_LENGTH];
unsigned long ulpParameter[PARA_NUM];
.
.
Currently, the manage mode and edit mode's text command buffer within the CM-5 firmware
is limiting the size to 60 characters. With the information provided, we are assuming that
the programming has been done through a program like Visual Studio.
This may be a little inconvenient, but please try creating your own packet and use the CM-5
s toss mode.

Thanks,
ROBOTIS
Ike
Newbie
Newbie
Posts: 6
Joined: Sun Feb 24, 2008 9:05 pm

Post by siempre.aprendiendo » Fri Mar 14, 2008 12:42 pm

Post by siempre.aprendiendo
Fri Mar 14, 2008 12:42 pm

Ike wrote:For those that are interested, here is the response from Robotis:

Dear 1ke,

Thank you for your kind patience.

#define COMMAND_BUFFER_SIZE 60

void SerialMonitor(void)
{
byte bpCommandBuffer[COMMAND_BUFFER_SIZE];
byte bTerminate,bCount,bParaNum,bRxData;
byte bpCommand[COMMAND_LENGTH];
unsigned long ulpParameter[PARA_NUM];
.
.
Currently, the manage mode and edit mode's text command buffer within the CM-5 firmware
is limiting the size to 60 characters. With the information provided, we are assuming that
the programming has been done through a program like Visual Studio.
This may be a little inconvenient, but please try creating your own packet and use the CM-5
s toss mode.

Thanks,
ROBOTIS


I have asked Robotis (Q&A forum) where is that toss mode documented. I can't find it in the documentation.
Ike wrote:For those that are interested, here is the response from Robotis:

Dear 1ke,

Thank you for your kind patience.

#define COMMAND_BUFFER_SIZE 60

void SerialMonitor(void)
{
byte bpCommandBuffer[COMMAND_BUFFER_SIZE];
byte bTerminate,bCount,bParaNum,bRxData;
byte bpCommand[COMMAND_LENGTH];
unsigned long ulpParameter[PARA_NUM];
.
.
Currently, the manage mode and edit mode's text command buffer within the CM-5 firmware
is limiting the size to 60 characters. With the information provided, we are assuming that
the programming has been done through a program like Visual Studio.
This may be a little inconvenient, but please try creating your own packet and use the CM-5
s toss mode.

Thanks,
ROBOTIS


I have asked Robotis (Q&A forum) where is that toss mode documented. I can't find it in the documentation.
siempre.aprendiendo
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 559
Joined: Wed Aug 08, 2007 9:13 pm
Location: Barcelona

Post by Rob » Fri Mar 14, 2008 12:58 pm

Post by Rob
Fri Mar 14, 2008 12:58 pm

I hope that was a typo!
I hope that was a typo!
Rob
Savvy Roboteer
Savvy Roboteer
Posts: 51
Joined: Sun Nov 25, 2007 2:05 pm

Post by Bullit » Fri Mar 14, 2008 7:47 pm

Post by Bullit
Fri Mar 14, 2008 7:47 pm

Enter toss mode my setting to manage mode then send a 't' and the bioloid firmware responds with something like "toss mode" all communication from that point on is tossed from the CM-5 to the dynamixel bus and from the dynamixel bus back to the pc. So the CM-5 becomes transparent.

I used to have a separate app that was toss.hex that I got from robotis some time ago that basically is just the toss function. Now it is part of the bioloid.hex. Monitor was also a separate program at one point.

Hope this helps.
Enter toss mode my setting to manage mode then send a 't' and the bioloid firmware responds with something like "toss mode" all communication from that point on is tossed from the CM-5 to the dynamixel bus and from the dynamixel bus back to the pc. So the CM-5 becomes transparent.

I used to have a separate app that was toss.hex that I got from robotis some time ago that basically is just the toss function. Now it is part of the bioloid.hex. Monitor was also a separate program at one point.

Hope this helps.
Bullit
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 291
Joined: Wed May 31, 2006 1:00 am
Location: Near robot

Post by Ike » Sat Mar 15, 2008 2:29 am

Post by Ike
Sat Mar 15, 2008 2:29 am

I was able to set to CM5 to Toss Mode (either T or L will set Toss Mode) but for the life of me, I can't seem to get the AX-12s to recognize (or even respond to) a command, even a simple PING command.

I have tried a few of the commands from the AX12 manual through the Robot Terminal and Hyperterm, none of which seem to give a response, not even a light on the Tx LED:

# Obtain the status packet of the Dynamixel actuator with an ID of 1
ff ff 01 02 01 fb
# Read the internal temperature of the Dynamixel actuator with an ID of 1
ff ff 01 04 02 2b 01 cc


Am I using an incorrect format? (I've tried FF, ff, 0XFF, 0xFF, 0xff, 255) Do I need a header/footer? Baud rates maybe? (currently COM->CM5 = 57600, CM5->AX12 = 1000000)

I eventually plan to go wireless (ditch the CM5 all together) if I can find anyone still selling the parts to get WiFi/SPI going, so this kind of development hopefully all lends itself to my end state.

Thanks!

Chris
I was able to set to CM5 to Toss Mode (either T or L will set Toss Mode) but for the life of me, I can't seem to get the AX-12s to recognize (or even respond to) a command, even a simple PING command.

I have tried a few of the commands from the AX12 manual through the Robot Terminal and Hyperterm, none of which seem to give a response, not even a light on the Tx LED:

# Obtain the status packet of the Dynamixel actuator with an ID of 1
ff ff 01 02 01 fb
# Read the internal temperature of the Dynamixel actuator with an ID of 1
ff ff 01 04 02 2b 01 cc


Am I using an incorrect format? (I've tried FF, ff, 0XFF, 0xFF, 0xff, 255) Do I need a header/footer? Baud rates maybe? (currently COM->CM5 = 57600, CM5->AX12 = 1000000)

I eventually plan to go wireless (ditch the CM5 all together) if I can find anyone still selling the parts to get WiFi/SPI going, so this kind of development hopefully all lends itself to my end state.

Thanks!

Chris
Ike
Newbie
Newbie
Posts: 6
Joined: Sun Feb 24, 2008 9:05 pm

Post by JonHylands » Sat Mar 15, 2008 2:39 am

Post by JonHylands
Sat Mar 15, 2008 2:39 am

You're trying to send ASCII to it, and you need to send binary data to it.

The byte values you're trying to send are correct, just in the wrong format.

You have to write code that sends the actual bytes out the serial port...

- Jon
You're trying to send ASCII to it, and you need to send binary data to it.

The byte values you're trying to send are correct, just in the wrong format.

You have to write code that sends the actual bytes out the serial port...

- Jon
JonHylands
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 512
Joined: Thu Nov 09, 2006 1:00 am
Location: Ontario, Canada

Post by Ike » Sat Mar 15, 2008 3:02 am

Post by Ike
Sat Mar 15, 2008 3:02 am

Ah ha!

Looks like I have some work to do :)

Thank you Jon!
Ah ha!

Looks like I have some work to do :)

Thank you Jon!
Ike
Newbie
Newbie
Posts: 6
Joined: Sun Feb 24, 2008 9:05 pm

Next
24 postsPage 1 of 21, 2
24 postsPage 1 of 21, 2