Page 1 of 2 12 LastLast
Results 1 to 10 of 20

Thread: USB2AX sync writes to 2 servos but not 3+ (USB2Dynamixel does)

  1. USB2AX sync writes to 2 servos but not 3+ (USB2Dynamixel does)

    I have several MX-64ATs daisy-chained together and am trying to use use the Dynamixel SDK's sync write interface to send them all commands at once. I modified the sync_write.py example to have a third servo and it works as expected when running over a USB2Dynamixel. If I switch to a USB2AX the example works with 2 servos, but fails (none of the servos turn) for 3 or more. I've tried different power sources and collections of servos and the only thing that seems to matter is the USB2AX vs. the USB2Dynamixel. Any ideas why this might be happening or what I could do to diagnose the problem?

    Thanks

  2. #2

    Re: USB2AX sync writes to 2 servos but not 3+ (USB2Dynamixel does)

    Hook up an oscilloscope with waveform memory and see what's going on.

  3. Re: USB2AX sync writes to 2 servos but not 3+ (USB2Dynamixel does)

    If I don't have easy access to an oscilloscope, do you have any other recommendations? In theory, the USB2AX should support more than 2 servos, right?

    From the hardware side, I've updated the USB2AX's firmware and swapped different servos and power supplies.

    From the software side, I dissected the packets and they match the specifications (ff:ff:fe:d:83:1e:2:1:64:0:2:64:0:3:64:0 to set ids 1,2, and 3 to goal position 100). But, if I read the goal position registers after sending the command, their values haven't changed.

    I do see references on the USB2AX site about a customized SDK, but it since it hasn't been updated in 4 years, I assume it was superseded by the official 3.0 SDK?
    Last edited by eelmonger; 1 Week Ago at 04:32 PM.

  4. #4

    Re: USB2AX sync writes to 2 servos but not 3+ (USB2Dynamixel does)

    Yes, it should work.
    It may be that the USB2Dynamixel SDK sends some commands automatically for you that the USB2AX doesn't.
    For example, by default, the servos do not have torque enabled, so you need to enable torque. (If I remember correctly, you need to set register 24 to the value 1? Something like that.)

    If two servos work, but not three, then does it matter which two servos? If some particular pair of servos doesn't work, or some particular servo doesn't work, that would be a clue.

    It could also be that the drive strength of the USB2AX is different from the drive strength of the USB2Dynamixel, and something in your wiring or something marginal in your servos causes this difference. The only way to know for sure about that would be to use an oscilloscope. You can work out theories by testing pairs of servos in various configurations, with various wiring, though.

  5. #5

    Re: USB2AX sync writes to 2 servos but not 3+ (USB2Dynamixel does)

    I would also suggest using a logic analyzer to look at the packet being sent out by the USB2AX....

    Also If I look quickly at the python stuff you linked in first one.
    Code:
    # Enable Dynamixel#1 Torque
    dynamixel.write1ByteTxRx(port_num, PROTOCOL_VERSION, DXL1_ID, ADDR_MX_TORQUE_ENABLE, TORQUE_ENABLE)
    dxl_comm_result = dynamixel.getLastTxRxResult(port_num, PROTOCOL_VERSION)
    dxl_error = dynamixel.getLastRxPacketError(port_num, PROTOCOL_VERSION)
    if dxl_comm_result != COMM_SUCCESS:
        print(dynamixel.getTxRxResult(PROTOCOL_VERSION, dxl_comm_result))
    elif dxl_error != 0:
        print(dynamixel.getRxPacketError(PROTOCOL_VERSION, dxl_error))
    else:
        print("Dynamixel#1 has been successfully connected")
    
    # Enable Dynamixel#2 Torque
    dynamixel.write1ByteTxRx(port_num, PROTOCOL_VERSION, DXL2_ID, ADDR_MX_TORQUE_ENABLE, TORQUE_ENABLE)
    dxl_comm_result = dynamixel.getLastTxRxResult(port_num, PROTOCOL_VERSION)
    dxl_error = dynamixel.getLastRxPacketError(port_num, PROTOCOL_VERSION)
    if dxl_comm_result != COMM_SUCCESS:
        print(dynamixel.getTxRxResult(PROTOCOL_VERSION, dxl_comm_result))
    elif dxl_error != 0:
        print(dynamixel.getRxPacketError(PROTOCOL_VERSION, dxl_error))
    else:
        print("Dynamixel#2 has been successfully connected")
    It looks like it enables torque on the first two servos...

  6. Re: USB2AX sync writes to 2 servos but not 3+ (USB2Dynamixel does)

    Hi,

    The SDK thing on the USB2AX website / repo is outdated, the new one should indeed work as-is, as long as you have the latest firmware - which you said you have.
    Did you confirm that the update process finished successfully?

    When you run the example with 2 then 3 servos, could you have a look at what the return values are?

    Could you share your modified code please?

    So far, it looks quite strange to me. The USB2AX can drive more than 35 servos easily in a normal setup.
    ---
    Personal blog: http://xevel.org
    USB2AX documentation: http://xevelabs.com

  7. Re: USB2AX sync writes to 2 servos but not 3+ (USB2Dynamixel does)

    Thanks for all the responses everyone.

    For the USB2AX, I queried address 0x02 from id 0xfd and got back "5", so I assume that means I'm on firmware v5. In all other cases, I've been treating the USB2AX exactly the same as the USB2Dynamixel and it has been working as expected (i.e. I'm not assuming it's automatically handling anything for me like turning on the torque).

    I've tried several different wiring orders and combinations of motors and they all work with 2 motors on the USB2AX and 4 motors (probably more, that's just how many I have) on the USB2Dynamixel. Interestingly, if I have all 4 motors wired up and my sync_write only addresses 2 of them, the USB2AX works as expected, it's only once the write addresses 3 or more motors that it fails.

    The modified code can be found here: https://pastebin.com/8nm0GZJ9. All I've done is taken the SDK's example code and added a 3rd servo. I didn't add the 3rd servo to the stop condition, but that shouldn't be an issue. Again it works perfectly (just much more slowly) on the USB2Dynamixel.

    Based on the documentation there is no return value from a sync write; it just immediately returns after sending, which makes debugging difficult. If I try and read the goal position after issuing the commands, I can, but they values have not changed. Am I missing something about sync write and return values?
    Last edited by eelmonger; 1 Week Ago at 05:34 PM.

  8. #8

    Re: USB2AX sync writes to 2 servos but not 3+ (USB2Dynamixel does)

    it just immediately returns after sending, which makes debugging difficult
    Hence why we all are saying you need an oscilloscope with memory, or a logic analyzer :-)

    I like the Saleae Logic ones. Try the Logic 8, it's good value for money and can double as a 'scope in a pinch because it has "enough" analog in bandwidth.
    Don't use the "nano" "DOSs" as their signal quality is pretty poor, even though they are even cheaper than the Saleaes.

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

    Re: USB2AX sync writes to 2 servos but not 3+ (USB2Dynamixel does)

    A Teensy-3.x can also be used as a logic analyzer if you are desperate.

    Just adding the USB2Dynamixel to the far end of the chain to continuously listen to the buss traffic would be useful for verifying the correct messages are getting everywhere.
    Please pardon the pedantry... and the profanity... and the convoluted speech pattern...
    "You have failed me, Brain!"
    bleh

  10. #10
    Join Date
    May 2016
    Location
    White Plains, NY
    Posts
    116
    Images
    1
    Rep Power
    7

    Re: USB2AX sync writes to 2 servos but not 3+ (USB2Dynamixel does)

    Along with swapping the end-of-chain server with the second-from-end servo - to see if the problem changes.

    And I'll second JWatte's recommendation regarding Saleae Logic Analyzers. Tools such as these will last you a lifetime...

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Question(s) How to power AX-12A servos connected to an USB2AX?
    By corot in forum DYNAMIXEL & Robot Actuators
    Replies: 6
    Last Post: 02-20-2017, 06:01 PM
  2. Project Robot Arm That Writes. MX-64t & MX-28t servos wanted
    By OOrmOnIzArGoR in forum Projects For Request and/or Sale
    Replies: 0
    Last Post: 12-29-2014, 10:09 PM
  3. Replies: 1
    Last Post: 08-15-2014, 07:03 PM
  4. Question(s) USB2Dynamixel Unable to find Servos
    By sshiv in forum DYNAMIXEL & Robot Actuators
    Replies: 3
    Last Post: 06-24-2014, 02:08 PM
  5. What's special about the USB2Dynamixel and USB2AX as a CDC device?
    By jwatte in forum Arbotix, Microcontrollers, Arduino
    Replies: 4
    Last Post: 06-13-2013, 09:42 PM

Posting Permissions

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