Results 1 to 9 of 9

Thread: Hard: Can anyone give me a sample packet by running function:"Reading Current Position" for Dynamixel Pro Motors?

  1. Hard: Can anyone give me a sample packet by running function:"Reading Current Position" for Dynamixel Pro Motors?

    Hi everyone,
    I am trying to write a labview driver for dynamixel pro motors and I am in trouble. I think a sample packet will help a lot. I also try to get a sample packet by running Dynamixel SDK C++ code under my Ubuntu system but I am in trouble again %>_<%, so can anyone help me by getting a sample packet by hooking up one dynamixel pro motor and running your C++ code to read the current position of the motor under linux system?

    There is a "readvalue" example under /example folder if you download Dynamixel Pro SDK for linux.
    According to my understanding, it runs
    DXL.WriteDWord(1, GOAL_POSITION, GoalPos, &error);
    to send a signal, then it runs:
    ReadDWord(1, Present_Position, &val3, &error)
    which fits into
    ReadDWord(id, address, *value, *error)
    by id=1, address=Present_Position=611

    Then it runs
    Read(id, address, 4, data, error)
    which fits into
    Read(int id, int address, int length, unsigned char* data, int *error)

    Then it runs
    TxRxPacket(txpacket, rxpacket, error);

    So the packet gets read will look something like this:
    -----header-----
    0xFF
    0xFF
    0xFD
    0x00
    --------------------
    0x01 =ID

    0x04
    0x00 //Read data length

    0x55 =INST_STATUS

    ?????
    Then I really need the rest ????? part. Can anyone help me by print that part out to see how long it is and what it looks like? I think there're 1 error big, 2 data bits as well as 2 checksum bits.

    My motor is Dynamixle pro H54-200-s500-r but I think any dynamixel pro motors will work. I would imagine this to be not easy so if somebody happens to have a motor on hand and is able to help me I will greatly appreciated.
    Thank you!
    Last edited by maynight; 05-31-2015 at 05:22 PM. Reason: Sorry I confused between rxpacket and txpacket

  2. #2
    Join Date
    Sep 2010
    Location
    ಠ_ಠ
    Posts
    2,317
    Images
    27
    Rep Power
    285

    Re: Hard: Can anyone give me a sample packet by running function:"Reading Current Position" for Dynamixel Pro Motors?

    Don't have any Dynamixel Pro, but the entire communication protocol is documented on the Robotis support site. The Instruction/status packet link is especially useful as it gives complete structure of all packet types.

    So, if that site is correct, the ???? of the command packet is simply the CRC checksum. The status return packet will be three byte header (0xff 0xff 0xfd, one byte reserved (0x00). one byte ID, two bytes of packet length, one byte instruction (0x55 for status), one byte error (hopefully none), then N requested bytes of data from the servo (4 bytes in your case), then the two byte CRC.
    Please pardon the pedantry... and the profanity... and the convoluted speech pattern...
    "You have failed me, Brain!"
    [git][mech][hack]
    gives free advice only on public threads

  3. Re: Hard: Can anyone give me a sample packet by running function:"Reading Current Position" for Dynamixel Pro Motors?

    Actually, my colleague and I think the driver follows exactly with that e-manual, but the result just doesn't seems right. The packet gets sent to motor is:
    (under decimals)
    ----headers------
    255 255 253 0
    ----ID----
    1
    ----Length----
    7 0
    ----INST=READ----
    2
    ----Address----
    2 99 //611=0x02 0x63 = 02(d) 99(d)
    ----Data Length---
    0 4 //length=4 because of readDword
    ----Checksum-----
    19 115

    Then I read this status packet:
    ----headers------
    255 255 253 0
    ----ID----
    1
    ----Length----
    4 0 //Consistent with data_length
    ----INST=STATUS----
    85 //=0x55
    ----supposed to be Error+Data----
    3 171 12

    the last 3 digits confuse me because I will expect they to be longer. This is the reason we are asking for help. If someone can give us absolute correct packets which is sent as well as read, I think we may be able to fix some mistakes we made.
    Thank you!

  4. Re: Hard: Can anyone give me a sample packet by running function:"Reading Current Position" for Dynamixel Pro Motors?

    Also, if anyone can help please give me the current position you see under Roboplus also.

  5. #5
    Join Date
    Sep 2010
    Location
    ಠ_ಠ
    Posts
    2,317
    Images
    27
    Rep Power
    285

    Re: Hard: Can anyone give me a sample packet by running function:"Reading Current Position" for Dynamixel Pro Motors?

    From the DXL2.0 instruction/status packet page on error numbers:
    0x03 CRC Error Failed Packet’s CRC value match
    Also, everything is sent least significant byte first, so 611 decimal = 0x0263 should be sent as 0x63 then 0x02, should it not?
    0x63 0x02 = 0x0263 => 611
    0x02 0x63 = 0x6302 => 25346

    Same goes for data length of 0x0004 should be 0x04 then 0x00.


    And no, packet length of 0x0004 is not consistent with a successful return. 4 = 1 instruction byte + 1 error byte + 2 CRC bytes; which is the minimum valid length of a status return packet.
    Last edited by tician; 05-31-2015 at 06:15 PM.
    Please pardon the pedantry... and the profanity... and the convoluted speech pattern...
    "You have failed me, Brain!"
    [git][mech][hack]
    gives free advice only on public threads

  6. Re: Hard: Can anyone give me a sample packet by running function:"Reading Current Position" for Dynamixel Pro Motors?

    Yes, I also realized that the order is wrong and I fix it just now. But I am still getting CRC error. Does return data length =4 correspond to
    Instruction Packet Parameter (Write data length: N)
    Parameter 0 Error Byte (please refer to the basic structure)
    Parameter 1 Read data start address 1st byte
    Parameter 2 Read data start address 2nd byte
    So am I supposed to read 5 digits with 2 data digits and 2 CRC?

  7. #7
    Join Date
    Sep 2010
    Location
    ಠ_ಠ
    Posts
    2,317
    Images
    27
    Rep Power
    285

    Re: Hard: Can anyone give me a sample packet by running function:"Reading Current Position" for Dynamixel Pro Motors?

    The packet:
    ----headers------
    0xff 0xff 0xfd 0x00
    ----ID----
    0x01
    ----Length----
    0x07 0x00
    ----INST=READ----
    0x02
    ----Address----
    0x63 0x02
    ----Data Length---
    0x04 0x00
    ----CRC_L -> CRC_H-----
    0x1B 0xF9

    CRC_calc
    ((crc_accm>>8) ^ data[j]) & 0xFF = i => (crc_accm<<8) ^ crc_table[i] => crc_accm
    ((0x0000>>8) ^ 0xFF) & 0xFF = 0xFF => (0x0000<<8) ^ 0x0202 => 0x0202
    ((0x0202>>8) ^ 0xFF) & 0xFF = 0xFD => (0x0202<<8) ^ 0x820D => 0x800D
    ((0x800D>>8) ^ 0xFD) & 0xFF = 0x7D => (0x800D<<8) ^ 0x010E => 0x0C0E
    ((0x0C0E>>8) ^ 0x00) & 0xFF = 0x0C => (0x0C0E<<8) ^ 0x0028 => 0x0E28
    ((0x0E28>>8) ^ 0x01) & 0xFF = 0x0F => (0x0E28<<8) ^ 0x0022 => 0x2822
    ((0x2822>>8) ^ 0x07) & 0xFF = 0x2F => (0x2822<<8) ^ 0x80E1 => 0xA2E1
    ((0xA2E1>>8) ^ 0x00) & 0xFF = 0xA2 => (0xA2E1<<8) ^ 0x83CF => 0x62CF
    ((0x62CF>>8) ^ 0x02) & 0xFF = 0x60 => (0x62CF<<8) ^ 0x0140 => 0xCE40
    ((0xCE40>>8) ^ 0x63) & 0xFF = 0xAD => (0xCE40<<8) ^ 0x83ED => 0xC3ED
    ((0xC3ED>>8) ^ 0x02) & 0xFF = 0xC1 => (0xC3ED<<8) ^ 0x8285 => 0x6F85
    ((0x6F85>>8) ^ 0x04) & 0xFF = 0x6B => (0x6F85<<8) ^ 0x8179 => 0x0479
    ((0x0479>>8) ^ 0x00) & 0xFF = 0x04 => (0x0479<<8) ^ 0x801B => 0xF91B

    ...should produce a status return packet of length 0x0008: 1 instruction byte + 1 error byte + 4 returned parameter bytes + 2 CRC bytes.
    Last edited by tician; 05-31-2015 at 07:31 PM. Reason: little transcription error in lines 3+4 of CRC
    Please pardon the pedantry... and the profanity... and the convoluted speech pattern...
    "You have failed me, Brain!"
    [git][mech][hack]
    gives free advice only on public threads

  8. Re: Hard: Can anyone give me a sample packet by running function:"Reading Current Position" for Dynamixel Pro Motors?

    Thank you so much!!!!!! According to this, I find that actually the CRC function is wrong. I am able to get the correct status packet now.
    Thanks! It's always great to come back to this forum.

  9. #9
    Join Date
    Sep 2010
    Location
    ಠ_ಠ
    Posts
    2,317
    Images
    27
    Rep Power
    285

    Re: Hard: Can anyone give me a sample packet by running function:"Reading Current Position" for Dynamixel Pro Motors?

    Since the first four bytes of all packets will be identical, you can seed the CRC function with '0x0E28' and start processing the packet data at the ID byte if you want to save a few cycles.
    Please pardon the pedantry... and the profanity... and the convoluted speech pattern...
    "You have failed me, Brain!"
    [git][mech][hack]
    gives free advice only on public threads

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Question(s) USB2Dynamixel, RX-28, Windows., "COMM_RXTIMEOUT: There is no status packet!"
    By JonasFN in forum DYNAMIXEL & Robot Actuators
    Replies: 4
    Last Post: 04-26-2015, 05:51 AM
  2. Project "Free" "LIDAR"
    By Adrenalynn in forum Sensors
    Replies: 80
    Last Post: 11-16-2012, 12:27 PM
  3. Project Bioloid 6x6 rocker-bogie suspension little "Mars curiosity"
    By siempre.aprendiendo in forum Rovers
    Replies: 2
    Last Post: 12-12-2011, 01:38 PM
  4. Bioloid RoboPlus - "A file motion cannot play Next/Exit pages....."
    By aacs in forum Humanoids, Walkers & Crawlers
    Replies: 5
    Last Post: 09-22-2011, 03:27 AM
  5. "Dynamixel AX-12+ Actuator Latencies"
    By Stobs in forum Robotics General Discussion
    Replies: 1
    Last Post: 06-27-2011, 10:38 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •