Results 1 to 7 of 7

Thread: Dynamixel XL/XM on WX250 Arm: Can't writeWord to Change Position, Velocity

  1. Dynamixel XL/XM on WX250 Arm: Can't writeWord to Change Position, Velocity

    I am using the dynamixel XL and XM motors here:


    http://support.robotis.com/en/produc...xl430-w250.htm
    http://support.robotis.com/en/produc...xm430-w350.htm


    There are 8 of them connected in serial. I am using the OpenCM9.04 board.


    For some reason I cannot move the servos, or change their speeds/velocities. However I am able to accurately read positions, and turn torque on/off.


    Here is what is not working:


    SerialUSB.print("min positions "); PrintAttribute(52, NUMBER_SERVOS); SerialUSB.println("");
    SerialUSB.print("max positions "); PrintAttribute(48, NUMBER_SERVOS); SerialUSB.println("");
    SerialUSB.print("operating mode "); PrintAttribute(11, NUMBER_SERVOS); SerialUSB.println("");
    SerialUSB.print("goal velocity "); PrintAttribute(104, NUMBER_SERVOS); SerialUSB.println("");
    SerialUSB.print("profile acceleration "); PrintAttribute(108, NUMBER_SERVOS); SerialUSB.println("");
    SerialUSB.print("profile velocity "); PrintAttribute(112, NUMBER_SERVOS); SerialUSB.println("");
    SerialUSB.print("goal position "); PrintAttribute(116, NUMBER_SERVOS); SerialUSB.println("");

    for (int j = 1; j <= NUMBER_SERVOS; j++) {
    Dxl.writeWord(j, 104, 0x100); int test_result = Dxl.getResult();
    Dxl.writeWord(j, 108, 0x100);
    Dxl.writeWord(j, 112, 0x100);
    Dxl.writeWord(j, 116, 0x0);



    SerialUSB.println("");
    SerialUSB.print("Dxl.getResult() :: "); SerialUSB.print(test_result);

    }


    My print function works fine, and Dxl.getResult actually gives the success value. But the output never changes despite trying to write the words (except for the position reading if I manually move it with torque off):


    min positions
    Attribute: 52: 0 / 0 / 0 / 0 / 0 / 0 / 0 / 0 /
    max positions
    Attribute: 48: 4095 / 4095 / 4095 / 4095 / 4095 / 4095 / 4095 / 4095 /
    operating mode
    Attribute: 11: 65283 / 65283 / 65283 / 65283 / 65283 / 65283 / 65283 / 65283 /
    goal velocity
    Attribute: 104: 350 / 350 / 350 / 350 / 350 / 350 / 415 / 415 /
    profile acceleration
    Attribute: 108: 0 / 0 / 0 / 0 / 0 / 0 / 0 / 0 /
    profile velocity
    Attribute: 112: 0 / 0 / 0 / 0 / 0 / 0 / 0 / 0 /
    goal position
    Attribute: 116: 1608 / 1776 / 2333 / 1956 / 2143 / 925 / 2056 / 2045 /

    The attributes 104,108,112 never change despite trying to write reasonable values to them (I've tested quite a few). And of course writing to goal position doesn't cause any motion.


    However, the following code works just fine below and toggles the motors' torques on/off:


    torque_toggle = torque_toggle * -1;
    SerialUSB.print("torque_toggle: "); SerialUSB.print(torque_toggle);
    int toggle = torque_toggle;
    if (toggle == -1) toggle = 0;
    // a - ID of dynamixel/servo
    // b - register/address to write
    // c - new value
    //Dxl.writeByte(a, b, c);
    // Ex: turn torque ON (addr 64 for our servos)
    SerialUSB.println("");
    SerialUSB.print("toggle: "); SerialUSB.print(toggle);
    for (int j = 1; j <= NUMBER_SERVOS; j++) {
    Dxl.writeByte(j, TORQUE_ENABLE, toggle);
    Dxl.writeByte(j, LED_ENABLE, toggle);

    int test_result = Dxl.getResult();
    SerialUSB.println("");
    SerialUSB.print("Dxl.getResult() :: "); SerialUSB.print(test_result);


    }


    Very frustrating as I cannot move the XL and XM dynamixels despite getting other functionality to work and following the tutorial pages I found. Hopefully I'm doing something wrong and easy to fix?


    Thanks for any help.

  2. #2

    Re: Dynamixel XL/XM on WX250 Arm: Can't writeWord to Change Position, Velocity

    For many of these things you may want to ask on the Robotis Forums: http://en.robotis.com/service/forum.php

    If you look at the control table for the servos, example:
    http://emanual.robotis.com/docs/en/d...#control-table


    This E-Manuals are their current support documents.

    Note: many of these fields like GoalPosition (116) are 4 bytes in length, not two bytes.

    So it might not like the updates....

  3. #3

    Re: Dynamixel XL/XM on WX250 Arm: Can't writeWord to Change Position, Velocity

    Forgot to metnion.

    You say that you are using an OpenCM9.04? Are you using their older IDE or are you using Arduino IDE? They are now only supporting the Arduino IDE.

    Which library are you using?

  4. Re: Dynamixel XL/XM on WX250 Arm: Can't writeWord to Change Position, Velocity

    Quote Originally Posted by KurtEck View Post
    Forgot to metnion.

    You say that you are using an OpenCM9.04? Are you using their older IDE or are you using Arduino IDE? They are now only supporting the Arduino IDE.

    Which library are you using?
    Hey Kurt, first of all thank you for responding! =)

    I am using the OpenCM9.04 lib here: http://emanual.robotis.com/docs/en/s...tting_started/

    I extracted an started modifying a sample code.

    What should I use instead?

    Quote Originally Posted by KurtEck View Post
    For many of these things you may want to ask on the Robotis Forums: http://en.robotis.com/service/forum.php

    If you look at the control table for the servos, example:
    http://emanual.robotis.com/docs/en/d...#control-table


    This E-Manuals are their current support documents.

    Note: many of these fields like GoalPosition (116) are 4 bytes in length, not two bytes.

    So it might not like the updates....
    I believe that control table is the same one in my OP link, though I'll double check more to ensure consistency.

    What do you mean by goal position not liking the updates? I know it's 4 bytes, I've tried writing a ton of different values, including just regular integers from 0 to 4000, and more recently those hex formatted numbers. Nothing to get motions.

    Hoping to get this going ASAP - I'd be happy to share the code when it's ready. The folks at Trossen have told me that they are still working on the WX-250 arm firmware. But I need to get a project going ASAP so I've started working on it myself.

    Cheers

  5. #5

    Re: Dynamixel XL/XM on WX250 Arm: Can't writeWord to Change Position, Velocity

    Again as I have mentioned, the OpenCM IDE is their older setup and I don't believe they are making any updates to it.

    They are now going the more standardized approach of adding their stuff to the Arduino IDE.
    More instructions about this is up on their E-Manual: http://emanual.robotis.com/docs/en/s...e/arduino_ide/

    Your code above showed things like: Dxl.writeWord(j, 116, 0x0);
    Which sounds like it outputs a word which in these cases is probably 16 bits.

    FYI - I am also tried to contribute things to the Robotis Arduino code base. Currently working on making SerialX.write(...) not block....

    I have code that I am using to experiment with and to transfer some of other Arbotix code to work with their Dynamixel SDK code.
    Some of it is up in my github project: https://github.com/KurtE/Open_CM904

    With the Dynamixel SDK you need to know if you are working with Protocol1 or Protocol2 servos. In your case Protocol2. More details up at: http://emanual.robotis.com/docs/en/s..._sdk/overview/

    In the above github project, there is a sketch: AX12_Test_OpenCM which I should rename as it now also works with XL servo...

    But to change the position of a servo in the simplest case, would be a call like:

    Code:
    packetHandler2->write4ByteTxRx(portHandler, g_bServoID,  DXL_X_GOAL_POSITION, g_wServoGoalPos);
    where you put in your servo ID, DXL_X_GOAL_POSITION is defined as 116 and the goal position is a 4 byte value...

    With the Dynamixel Workbench library, they make it such that you can ignore differences between Protocol 1 and Protocol 2 servos, but at a cost. That is you pass in strings for which register you wish to change, it then figures out what type of servo it is, and then converts that to register number and size and then sends that out. It also has ways to convert the Angle from degrees (or radians?) to servo units, which again depends on which servo...

    A while ago, I was going to convert my simple Arm program over from Arbotix code to Dynamixel SDK...
    https://github.com/KurtE/Phantom_Arm

    But I have not done so... Also this is for the AX12 servo ARM so would again take a little work to convert to XL/XM.

    Also this has the code do all of the interpolation of positions where you tell the servos to move from their current position to new position in some amount of time, and the software does it. With the XL/XM servos I would be tempted to use some of the servo smarts to do it for me...

    At some point will hopefully work on Hexapod with XL servos and try all of that out...

  6. Re: Dynamixel XL/XM on WX250 Arm: Can't writeWord to Change Position, Velocity

    Thanks for the follow up, plenty of things to try now.

    I'll start by porting everything to the Arduino with the OpenCM9.04 board. If this doesn't help, then I'll start playing around with your code repos and see if I can get these XL/XM servos moving.

    Cheers

  7. #7

    Re: Dynamixel XL/XM on WX250 Arm: Can't writeWord to Change Position, Velocity

    Another thing you can try is some of the example sketches that come with the OpenCM IDE.
    If there is one that uses DXL 2.0 protocol to move a servo, try that, and see if the servo moves.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Question(s) Lidar Lite Help to get the distance from the velocity registers
    By cybernetx in forum Sensors
    Replies: 0
    Last Post: 10-05-2015, 03:45 PM
  2. Replies: 8
    Last Post: 06-01-2015, 05:22 PM
  3. Servo reading position and lock position CW
    By mkanon in forum DYNAMIXEL & Robot Actuators
    Replies: 5
    Last Post: 03-30-2013, 04:10 PM
  4. Contest Entry PID Velocity DC Motor Controller
    By Upgrayd in forum Project Showcase
    Replies: 0
    Last Post: 12-31-2010, 10:46 AM
  5. Dynamixel position accuracy, calibration
    By Adam in forum DYNAMIXEL & Robot Actuators
    Replies: 3
    Last Post: 05-19-2010, 09:55 AM

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
  •