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

Thread: Dynamixel Linux SDK

  1. Dynamixel Linux SDK

    Hi All. I have two questions (btw, I seem to be incapable of figuring out how to add a new line to this editor, so I apologize for the formatting). To make somewhat of a long story short, I am porting the Linux SDK from pure C to C++ to meet the requirements of my lab. The first question I have is does anyone know what the instruction packet has a max size of MAXNUM_TXPARAM(150) + 10? The status packet is similar. It doesn't look like an arbitrary size, but I haven't been able to wrap my head around it (btw, I tried asking on robotis, but got no answer). The 2nd question is about timeout errors. I seem to regularly get timeout errors when communicating with the server from a USB2Dynamixel on Linux. When I say timeout errors, it is getting part of the packet before it times out, so it is setting the status to COMM_RXCORRUPT. Anyone have any ideas to why this is? I'm going to try and do some more testing today to get an idea, but I'm relatively new to all of this, so I'm afraid I may be missing something obvious. Thanks!
    Last edited by Ctank02; 03-08-2013 at 11:20 AM.

  2. #2

    Re: Dynamixel Linux SDK

    If you get timeout errors, something is wrong. You may want to hook up a digital oscilloscope or logic analyzer to the bus that the Dynamixels talk on, to compare what goes there to what you see from the USB2Dynamixel.

    The maximum size of packets is given by the size field and the parameters you can put into them. If you look at the various packet formats on the Dynamixel communications site, you can calculate the sizes of the worst-case packets and usage scenarios.

    In the end, though, I ended up writing my own software, formulating the packets myself. It's not that hard, and lets me have better control over what happens when and where.

    Finally, if your lab "requires" that the software is "re-written" from C to C++, then something is seriously wrong with that lab. C is a proper subset of C++, so anything that is C, is also C++.

  3. Re: Dynamixel Linux SDK

    Thanks for the replies. That being said, when most of the students in the lab are freshman / sophomore undergrads, life isn't always that easy. Sometimes it is easier to change it to something that they are more familiar with. I have an idea on what the problem with the timeouts are, so once I know, I'll report it back here.

  4. #4
    Join Date
    Sep 2010
    Location
    ಠ_ಠ
    Posts
    2,295
    Images
    27
    Rep Power
    278

    Re: Dynamixel Linux SDK

    Pretty sure the buffer sizes are arbitrary (other libraries use different values), and others have had problems with the sdk erroneously causing timeouts. You could try increasing the timeout delay a bit and see if that helps (it multiplies the number of bytes to be sent/returned by a constant - increase that constant a bit). I know I have had problems with the sdk and embedded-c libraries because it was not happy with the delay between when the servo receives the packet and when the servo eventually starts sending a response packet. Also, the driver settings for the FT232RL sometimes get set to have a high latency (long wait between receiving small packet from the UART and actually creating and sending the USB packet to the PC), but cannot remember how to change them (do not need to recompile, but there is an option file somewhere).




    It's the key usually labeled "enter"/"return".
    Last edited by tician; 03-08-2013 at 01:05 PM.
    Please pardon the pedantry... and the profanity... and the convoluted speech pattern...
    "You have failed me, Brain!"
    bleh
    more bleh

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

    Re: Dynamixel Linux SDK

    The Robotis C dynamixel sdk allows only a single USB2Dynamixel to be accessed at given time by a given program. Rewriting in C++ enables multiple simultaneous connections within a single program. There is a way to make the C version handle multiple USB2Dynamixel, but it is not a very pretty solution (I've already done it twice for windows, but I wiped it from the Robotis Q&A because it was that poorly implemented).
    Please pardon the pedantry... and the profanity... and the convoluted speech pattern...
    "You have failed me, Brain!"
    bleh
    more bleh

  6. Re: Dynamixel Linux SDK

    Thanks Tician. I can't see to get past the stupid timeouts. If anyone knows how to reduce the latency, as tician mentioned, please let me know! Thanks.

  7. #7
    Join Date
    Dec 2012
    Location
    Los Angeles, CA
    Posts
    856
    Images
    25
    Rep Power
    88

    Re: Dynamixel Linux SDK

    I had to drop my latency way down in the FTDI driver on the raspberry pi. It's been a few weeks let me go back and see what my steps were. I remeber I set it all the way down to 2. I'm at work right now so I don't have my notes and links in front of me.

  8. #8

    Re: Dynamixel Linux SDK

    The first thing you should do is probably to configure your Dynamixels to not wait for a long time before returning data as part of a command. This is a register in each Dynamixel, and you could write/set a very low number (like, 0 or 1,) when you set the ID of the servo, for example.

    Secondly, I've had problems before with the Linux USB serial (CDC) drivers. There seems to be something wrong in them, where they will drop data. I think the Dynamixel SDK uses those drivers, because the USB2Dynamixel looks like a USB serial port. I ended up using a custom-programmed Atmega32u4 instead, and send it commands using libusb, rather than going through the serial port driver. If that's not an option for you, perhaps you can still use libusb, and talk directly to the device, rather than let the Linux USB serial driver do it. With luck, that will work more reliably.

  9. #9
    Join Date
    Dec 2012
    Location
    Los Angeles, CA
    Posts
    856
    Images
    25
    Rep Power
    88

    Re: Dynamixel Linux SDK

    Here is what I think I did on my raspberry pi / usb2dynamixel robot. You need to run as sudo or be logged in as root.

    cat /sys/bus/usb-serial/drivers/ftdi_sio/ttyUSB0/latency_timer

    Changing the ttyUSB0 by the ttyUSB that you use.

    echo "2" > /sys/bus/usb-serial/drivers/ftdi_sio/ttyUSB0/latency_timer
    Last edited by KevinO; 03-08-2013 at 01:43 PM.

  10. Re: Dynamixel Linux SDK

    Thanks Kevin. That was extremely helpful; unfortunately, it was already set to 1 I'm 90% sure that the motor is getting my packets (because I can do stuff like turn on and off the LED light, but I still can't get status packets most of the time). I should note, I'm using the code from robotis, so I hoped that they had tested it, but my confidence in their code is blown at this point. EDIT: I'm running Ubuntu 12.10 (not sure if this matters, but figured I should share)
    Last edited by Ctank02; 03-08-2013 at 03:54 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Dynamixel RX-24F and RS-485 Communication on Linux/Ubuntu
    By robot in forum Software and Programming
    Replies: 2
    Last Post: 09-06-2012, 04:25 AM
  2. Question(s) SSC32 in Linux C programming?
    By nik2031 in forum Software and Programming
    Replies: 2
    Last Post: 01-18-2009, 09:30 PM
  3. Linux install
    By sthmck in forum Off Topic
    Replies: 6
    Last Post: 09-02-2008, 09:05 PM
  4. Discussion Linux Robots
    By LinuxGuy in forum Robotics General Discussion
    Replies: 15
    Last Post: 04-02-2008, 09:32 AM
  5. Question(s) Linux and Phidgets
    By LinuxGuy in forum Sensors
    Replies: 1
    Last Post: 03-24-2008, 11:08 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
  •