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

Is this a valid instruction packet?

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

Is this a valid instruction packet?

Post by Miamicanes » Sun May 27, 2007 9:55 pm

Post by Miamicanes
Sun May 27, 2007 9:55 pm

Is this a valid instruction packet? It's supposed to turn on Dynamixel #4's LED by writing a '1' to location 0x19:

0xff
0xff
0x04 (address = 4)
0x04 (length = 2 parameters + 2 = 4)
0x03 (instruction = WRITE)
0x19 (LED = register 0x19)
0x01 (new value = 1)
0xD6 (checksum)

checksum calculated by:
~0xff = 0x00
~0xff = 0x00
~0x04 = 0xfb
~0x04 = 0xfb
~0x03 = 0xfc
~0x19 = 0xe6
~0x01 = 0xfe
-------------
sum = 0x4D6
checksum byte thus = D6


It's not working, and before I start ripping apart the interface circuit, I want to make sure I'm at least sending a valid datagram ;)
Is this a valid instruction packet? It's supposed to turn on Dynamixel #4's LED by writing a '1' to location 0x19:

0xff
0xff
0x04 (address = 4)
0x04 (length = 2 parameters + 2 = 4)
0x03 (instruction = WRITE)
0x19 (LED = register 0x19)
0x01 (new value = 1)
0xD6 (checksum)

checksum calculated by:
~0xff = 0x00
~0xff = 0x00
~0x04 = 0xfb
~0x04 = 0xfb
~0x03 = 0xfc
~0x19 = 0xe6
~0x01 = 0xfe
-------------
sum = 0x4D6
checksum byte thus = D6


It's not working, and before I start ripping apart the interface circuit, I want to make sure I'm at least sending a valid datagram ;)
Miamicanes
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 28
Joined: Thu Dec 28, 2006 1:00 am

Post by JonHylands » Sun May 27, 2007 10:27 pm

Post by JonHylands
Sun May 27, 2007 10:27 pm

The problem is you don't include the two header bytes in the checksum calculation...

So, for turning it on:

FF FF 04 04 03 19 01 DA

checksum calc:

= ~(4 + 4 + 3 + 25 + 1)
= ~(37)
= 218
= 0xDA

for turning it off:

FF FF 04 04 03 19 00 DB

Also, you have to add all the values together, and then do the NOT calculation...

- Jon
The problem is you don't include the two header bytes in the checksum calculation...

So, for turning it on:

FF FF 04 04 03 19 01 DA

checksum calc:

= ~(4 + 4 + 3 + 25 + 1)
= ~(37)
= 218
= 0xDA

for turning it off:

FF FF 04 04 03 19 00 DB

Also, you have to add all the values together, and then do the NOT calculation...

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


2 postsPage 1 of 1
2 postsPage 1 of 1