Monday, April 20, 2009

Adventures with Bioloid

A couple of weeks ago, I was participating in the Siggraph Jury review process looking at some of the projects submitted this year. There were a couple of submissions using humanoid servo motor robots. Since I have always had an itch to play with robots that I've never had a chance to scratch, I decided to look into buying one. One of the best selections of these robots I found online was at Trossen Robotics. After a lot of reading and video watching, the current highest rated robots appear to be the Robonova, Kondo KHR-2HV, Futaba RBT-1, and the edutainment Robotis Bioloid. These are all very impressive robots that all (with the exception of the Bioloid) are used in the RoboCup Soccer competitions. Combined with the $900-$1500 price tags, these are definitely not your typical kids toy.

After much deliberation, I ended up going with the Bioloid. It's one of the more well documented robots with a healthy developer community, and it's highly reconfigurable. It comes with an "errector set"-like kit which allows you to build a variety of robots, not just humanoids. However, this modularity comes at the cost of extra weight. So, while the power-to-weight ratio of the servo motors maybe comparable to the higher-end robots, the overall performance of the robot is noticeably slower and clunkier. It also happens to be one of the cheaper robots at$900. I really liked the re-configurability (for future robot projects), the number of degrees of freedom (particularly in the hip), and the size of the community support/English documentation.


When I first got it, I was a little intimidated by the number of pieces in the box. Being an educational robot, I was hoping it was going to be a quick and simple setup. While the instructions are fairly easy to follow, it did take me about 5 hours from opening the box to a completed robot. Assembly requires handing many similar looking parts and lots of tiny screws. However, it is very satisfying to see the robot slowly take form as you assemble the components.


Once it is done, you do get an urge to say out loud "IT'S ALIVE!" with a grin on your face.


The included CD does have software to program and contol the robot, but as I expected, it is somewhat limited to keyframe pose playback or simplfied visual programming. My original intent was to run the robot using my own C/C++ or C# program. So, I didn't spend much time with the included software other than to verify the robot worked and to get an understanding of the control flow. The C development tools described by the documentation are for writing programs that run on the Atmega128 chip inside the robot. What I wanted was to run the control logic on my PC. However, getting my own software to control the robot ended up being quite a bit more challenging than I had expected.

The first major hurdle I had was the physical connection. The kit comes with a serial cable for communication with the robot, but it uses a DB-9 connector that is only found on desktops these days and my main machine is a laptop. The Bioloid has an expansion slot on its control board, the CM-5, for a wireless Zigbee connection. There are a few resources online explaining how to use a Bluetooh Module instead of a Zigbee module. So, I had ordered a BlueSMIRF module (WRL-08332) from Sparkfun in anticipation of doing this.

The Bioloid controller requires 57600 baud serial communication, but the Bluetooth modules typically come set to 9600 baud. To my frustration, the information on Sparkfun's website on exactly how to re-configure the baud rate is a little obtuse. They have different chipset versions with different command sets. Something I burned about 2 hours learning was that newer modules, with the BGB203 chip, CANNOT be configured wirelessly over the Bluetooth connection. They have to be configured via the wired TTL TX/RX connections. Moreover, to change the baud rate and save it to memory requires a TTL connection that can dynamically change its baud rate to issue the "save to memory" command at the new baud rate. My short lived attempt at trying to using a second Bluetooth module was a failure because while it could issue the "change baud rate" command it could not issue the "save to memory" command. =oP Anyway, once I got my hands on a USB TTL-232 cable, things went smoothly. One other important thing to check is the Bluetooth passkey of the module (using the configuration commands). In Vista, to make the Bluetooth serial port binding behave nicely I had to configure the bluetooth connection to use the passkey. It happened to be set to "0000" on my module despite the documentation from Sparkfun indicating it would be "default".


The second problem I ran into was that once I connected the Bluetooth module to the Zigbee communication pins, I discovered that it is NOT A REPLACEMENT for to the PC LINK serial programming cable port at the top of the CM-5. The data from the Zigbee unit is only meant to provide command bytes triggering behaviors in a program running natively on the CM-5. What I wanted was raw access to the servos so I could run control logic on the PC. This can only done via the PC LINK. The data from the Zigbee module never makes it to the servo motor bus. So after some digging, I found a schematic for the CM-5 and found where to piggy back data onto the main PC link. The image below shows where I connected my wires. The TX from the Bluetooth module is attached to the logic level side of the RS232 level converter. The other wires are connected to the Zigbee pins as decribed by the reference above.


This defintiely at your own risk and may behave badly if you try to connect the wired PC link cable at the same time. But since I intend to only use the Bluetooth serial connection, this was not a concern for me.

Now, I can run the included software such as Motion Builder using the Bluetooth connection as if I had the wired PC Link cable attached. Great! The CM-5 provides some commands such that if you open up a ternimal window to the serial port, you can get/set the data for each servo manually. However, the human readable commands use A LOT of bandwidth overhead. Given that the 57600 baud connection is already runnning much slower than the 1000000 native baud rate of the Dynamixel AX-12 servo motors, trying to control the robot via these commands was unbearably slow even if executed programmatically and I kept running into buffer limits on more complex commands.

A not-very-well documented mode of the CM-5 is "Toss Mode" which appears to be a pass through mode to the servo motor bus. Put the CM-5 in Manage Mode, and hit the Start button. In your PC's terminal window, type "t" then hit enter. It should respond with "Toss Mode". At this point, any bytes sent via the serial connection is pushed directly onto the servo motor bus and vice versa. Finally! Exactly what I wanted. After slowly making my way through the Dynamixel AX-12 User's guide, I now have a small C# library that provides direct control/communication with the servos via the serial port. It's still pretty rough but once I clean it up a bit more, I'll probably make it available for download. But, it is a farily straight forward implementation of key commands from the Dynamixel users manual. The hard part was getting the hardware into the right configuration to allow direct communication.

The next step to do is write my own control and logic software to see if I can make it do more interesting things than simply recall preset poses. There's also a mild annoyance in that the 57600 baud serial link is about 17x slower than the 1000000 baud servo bus speed. If this becomes an issue, I might explore making an alternative controller board that would provide 1000000 baud pass through, or even put each limb on a separate bus to parallelize I/O making it even faster. This could result in a 70x speed bump in servo communication which would be helpful with real-time control logic.

(update 4-22-09) It looks like Scott Ferguson has C# libraries for controlling a dynamixel directly via a serial port. He was using a USB2Dynamixel adapter. The bad this is that it doesn't provide power to the servo, only control. So, using the CM-5 a wirelss control/power brick is still fairly attractive.

70 comments:

  1. Fascinating stuff. I'm really surprised that these bots don't come with bluetooth built in that allows you to call functions on the bot and/or access the servos directly for PC based control. It seems pretty obvious to me.

    I've got a Robonova (and haven't done anywhere enough experiments with it yet) and was just wondering how your battery compares? Mainly because on the RN1 you have to leave it at least partially charged when not in use. I don't know much about battery technology, but this seemed like something that could be easily overlooked.

    ReplyDelete
  2. If/when your wires break off you may wish to check out the USB2Dynamixel adapter. http://www.trossenrobotics.com/robotis-bioloid-usb2dynamixel.aspx

    Also check out Dynamixel Commander
    http://www.forestmoon.com/Software/DynaCommander/

    If memory serves, two of the un-populated J5 holes lead up the the TX/RX of the ATmega128.

    ReplyDelete
  3. I don't understand what you did but it sounds interesting.

    ReplyDelete
  4. Don't know if it's relevant but at this point I would suggest my approach.
    I'm using 16 Hitec HS-322HD Deluxe Servo (£ 10 each) and a motor serial controller via UART.
    The motor controller is interfaced eithe with a zigbee module or an arduino controller.
    To assemble the servos you can just buy servo's brackets. And the overall cost is less than the bioloid. Plus you can do whatever you want with the software control.The only hassle is to write your software for kinematic and dynamic control, so it's not very easy for a newbie!

    ReplyDelete
  5. Not having played with this robot, it seems like you might find using the embedded CPU to be a path of least resistance. The PC can handle all the computational "heavy lifting" for what you want to do. (Pose selection, basically). But, you can have the PC send terse instructions to the main CPU over the low bandwidth wireless link. Then, the control program running on the robot parses the command stream and handles talking directly to the motors.

    ReplyDelete
  6. Hi

    If you want to do PC copntrol directly you haeve the USB2Dynamixel as you mentioned and, to power the servo bus, you have SMPS2Dynamixel.

    Anyway it's a shame that you didn't include Robobuilder in your compariosion. For some reason the american market is not very fond of it.
    It's very similar to Bioloid (the founders started together) but Robobuilder comes natively with support for bluetooth and support for doing control directly from the PC.
    No need for all the hacking and cracking you're doing.
    Most of this stuff is documented here http://robosavvy.com/forum/viewforum.php?f=15

    ReplyDelete
  7. Hi, I'm Stefan from Brainstormers Twobots / Tribots. You can look us up at Youtube. We've competed last year at the RoboCup 2008 competition humanoid league as the team "twobots". Unfortunately, without major success due to lack people, time and resources. But actually, e.g. the Fumanoid Robots 2006 and 2007 were built entirely of Bioloid parts and achieved 3rd place in the competitions then. In my opinion, the dynamixel AX 12 acutator, is a strong motor in its price segment, due to its daisy chain bus setup and integrated features (the possibility to retrieve the servo angles and internal data of the integrated micro controller). The same technology, but with a stronger motor is used by the world champion (NimBro) ,in the RoboCup competition, e.g. Dynamixel RX 64 servo.
    To control the Bioloid components we used a USB device made by John Highlands from HUV Robotics and used an integrated gumstix 600 MHz Verdex computer and a USB Logitech Webcam Pro.
    Prior to the USB device, we used a standard RS232 and the TOSS mode (can be setup with the buttons on the CM 5) of the CM5 controller, which directly forwards the RS232 messages to the Bioloid RS485 bus.
    Once we got the gumsticks setup running, we got rid of the CM 5 and used a 2000 mAh lithium polymer battery. This setup can power the robot incl. gumstix, wifi and camera for about half an hour.
    For using the setup with a laptop, we've developped a program that can forward packets via UDP to the Bioloid bus. If you need more information, I could provide some. Mail me a tek2222 @ gmail.com

    Regards
    Stefan

    ReplyDelete
  8. Severely retarded bad design of the Bioloid. No user should have to solder anything to the mobo to get full wireless access to the servo motors. And the idea of forcing the robot to be physically tethered by a control cable..that's absurd.

    Fer cripes sake, that's ridiculous. And what's with this limitation to 57K? That's ridiculous. This isn't 1985. Wireless baud rates of 5 megabits are today considered slow.

    $900 for a product you have to rip apart and solder on the mobo sounds like a good explanation of why home robotics aint' takin' off like a rocket.

    And please don't tell me you used Vista on your laptop. No wonder you're having problems. Deep six that POS and get a real OS, then you'll be going somewhere.

    Frankly, from your description it looks as though a dedicated hobbyist would be a lot better off buying the raw stepper motors and wiring 'em up to a microcontroller and an Arduino or something similar to handle interfacing to the host computer. Pretty much what Bao Lu Long said.

    ReplyDelete
  9. You got a really useful blog I have been here reading for about an hour. I am a newbee and your success is very much an inspiration for me. Please come visit my site Des Moines Iowa Business Directory when you got time.

    ReplyDelete
  10. Wow! Thank you! I always wanted to write in my site something like that. Can I take part of your post to my blog? Please come visit my site Stockton Yellow Page Business Directory when you got time.

    ReplyDelete
  11. I usually don’t leave comments!!! Trust me! But I liked your blog…especially this post! Would you mind terribly if I put up a backlink from my site to your site? Please come visit my site Chula Vista Yellow Page Business Directory when you got time.

    ReplyDelete
  12. It must be fun to do such a thing. I have never saw a robot in reality. I want to but don't know where to go.
    earn money chao!

    ReplyDelete
  13. Congratulations, you just earned yourself an entry in my feed reader, great blog. Please come visit my site Nova Scotia Businesses when you got time.

    ReplyDelete
  14. There is obviously a lot more than this. Would you mind telling me how long it took you to gather your content? Please come visit my site New Brunswick Businesses when you got time.

    ReplyDelete
  15. Well I also use the USB2Dynamixel to directly control the AX-12s and CM-5 as the power supply to the servos. :)

    ReplyDelete
  16. I'm glad you're back to posting. I love reading about your shopping adventures and great finds. Your outfits are always super cute too! Very inspirational. Please come visit my site rosacea treatment when you got time.

    ReplyDelete
  17. I love the style, i have several similar one, i usually wear them to work or shopping. Please come visit my site eczema natural treatment when you got time.

    ReplyDelete
  18. Wow, loving the two photos you posted. You got potential. Please come visit my site Hialeah Business Directory when you got time.

    ReplyDelete
  19. when I first saw them. lol. Please come visit my site Tulsa Business Directory when you got time.

    ReplyDelete
  20. I was thinking of looking up some of them newspaper websites, but am glad I came here instead. Although glad is not quite the right word… let me just say I needed this after the incessant chatter in the media, and am grateful to you for articulating something many of us are feeling - even from distant shores. Please come visit my site Anaheim Directory when you got time.

    ReplyDelete
  21. Please come visit my site Philadelphia City Business Listings when you got time.

    ReplyDelete
  22. Please come visit my site City Guide San Antonio when you got time.

    ReplyDelete
  23. Wow! Thank you! I always wanted to write in my site something like that. Can I take part of your post to my blog?
    Please come visit my site Business Directory Portland when you got time.

    ReplyDelete
  24. Wow! Thank you! I always wanted to write in my site something like that. Can I take part of your post to my blog?
    Please come visit my site Portland Business Search when you got time.

    ReplyDelete
  25. I wanted to thank you for this great read!! I definitely enjoying every little bit of it :) I have you bookmarked to check out new stuff you post. Please visit my Please visit my blog when you have time Please come visit my site Aurora City Business Listings when you got time.

    ReplyDelete
  26. I wanted to thank you for this great read!! I definitely enjoying every little bit of it :) I have you bookmarked to check out new stuff you post. Please visit my Please visit my blog when you have time Please come visit my site Aurora Business Phone Listing when you got time.

    ReplyDelete
  27. I don't know much about battery technology, but this seemed like something that could be easily overlooked.
    Dissertation Writing | Essay Writing | Research Paper Writing

    ReplyDelete
  28. I don't know much about battery technology, but this seemed like something that could be easily overlooked.
    Term Paper Writing | Thesis Writing

    ReplyDelete
  29. Yeah it is a great and nice article looking forward to have such article it is so useful. Please come visit my site Arlington Phone Book when you got time.

    ReplyDelete
  30. Wow! Thank you! I always wanted to write in my site something like that. Can I take part of your post to my blog? Please come visit my site Business Trade Guide of Columbus Ohio OH when you got time.

    ReplyDelete
  31. Wow! Thank you! I always wanted to write in my site something like that. Can I take part of your post to my blog? Please come visit my site Ohio OH Phone Directory when you got time.

    ReplyDelete
  32. I usually don’t leave comments!!! Trust me! But I liked your blog…especially this post! Would you mind terribly if I put up a backlink from my site to your site? Please come visit my site Directory Columbus City when you got time.

    ReplyDelete
  33. I usually don’t leave comments!!! Trust me! But I liked your blog…especially this post! Would you mind terribly if I put up a backlink from my site to your site? Please come visit my site Ohio OH Phone Directory when you got time.

    ReplyDelete
  34. You got a really useful blog I have been here reading for about an hour. I am a newbee and your success is very much an inspiration for me. Please come visit my site Detroit Business Directory when you got time.

    ReplyDelete
  35. You got a really useful blog I have been here reading for about an hour. I am a newbee and your success is very much an inspiration for me. Please come visit my site Local Business Directory Of Detroit U.S.A. when you got time.

    ReplyDelete
  36. WMV HD, AVI HD.In addition,Blu-ray ripper support rip Blu-ray and DVD to video and audio devices as iPod, iPhone, PSP, PS3, Apple .blu-ray ripper
    blu ray to mkv
    ipad converter

    ReplyDelete
  37. ed hardy outlet The Ghd hair straightener has cheap vibram 5 fingers been created to meet the demands of any woman no matter what the length of their hair. discount vibram five fingerBeing female may have many perks but there are also the downsides too and that contains keeping your hair looking and feeling great whilst still
    vibram running shoes keeping up with the latest fashion trends. For this season that means luster straight looking hair and the use of a ceramic flat hair iron. The GHD GHD hair straightener is one of the best ghd straighteners for this.
    vibram five fingers outlet Not only does the GHD GHD hair straightener allow you to achieve excellent hairstyles but it also helps to protect your hair too. Whether your hair is long or short the GHD GHD hair straightener can meet all your demands. Applying state of the art technology this ceramic flat hair iron really is every woman's number one option and is also the favorite among celebrities including Jennifer Aniston.
    vibram five fingers outlet How the GHD GHD Hair Straightener Works moncler jackets For any women out there who has Sexy Lingerie ever purchased or applied a ceramic hair straightening iron you will be amazing at how easy the ghd hair straighteners sexy Underwear make styling your hair. women's underwear This ceramic flat hair iron comes with so excellent features and also guarantees to minimize hair damage.Nike Shox R4
    Unlike the ordinary ceramic hair straightening iron the GHD flat iron comes with ultra smooth plates Shox shoes that straighten your hair without pulling or breaking your hair in the process.
    ugg boots The GHD flat iron applies GHD on its plates to generate negative ions that straighten the hair and eliminate frizz in the process. ed hardy wholesale Applying negative ions also helps to add more shine to your hair and speeds up the straightening process.discount ed hardy wholesale The use of infra red heat technology in this cheap ed hardy wholesale ceramic ghd hair straighteners help to seal in the hairs moisture almost eliminating any possible hair damage.
    wholesale ed hardy

    ReplyDelete
  38. A lot of very smart people have written in questions and suggestions and wmv to iphone
    avi to iphone converter I think a lot of them are very clever and worth sharing... and I'd

    ReplyDelete
  39. This comment has been removed by the author.

    ReplyDelete
  40. This comment has been removed by the author.

    ReplyDelete
  41. This comment has been removed by the author.

    ReplyDelete
  42. This comment has been removed by the author.

    ReplyDelete
  43. Portable Video Eyewear Glasses LCD + Head Tracking for Desktop VR Displays using the Wii Remote + Xbox360 = !!WWOOOOWW!! + New Software to go with the BOTS...

    ReplyDelete
  44. Breitling must be one of the coolest watches in the world. Because you can call a helicopter to pick you up when activating the built-in radio transmitter. What a watch! This is why they are called Bentley Motors Emergency watches. Bentley Motors T is always proud to be the luxury watchmaker that produces "instruments for professionals". The Navitimer Watches Emergency watches are just one of such typical watches that feature strong professional style.


    These Christian Shoes will add the right excitement and that little something extra to your feet to enable you to go that extra mile in life. The bundles of attitude that Christian Louboutin Pumps comes along with looks good and cute at the same time. This is certainly a wonderful combination. And not to mention, the right sleek look can be got by fitting your feet with the perfect pair of Christian Louboutin Boots , which is a certain enlightening factor. So, no more of Monday blues with these Christian Louboutin Sandals on your feet as every day will feel like a Sunday!


    You can find Coach bags in floral prints and solids. When pleating is something you see in many Coach Gallery designs you will find pleating being done on a Coach Hamptons to keep up with fashion. A new line is coming out in distressed leather to go along with distressed denim which is popular currently. When Coach Legacy makes a purse or bag you know there is a great deal of patience involved.

    ReplyDelete
  45. Thanks I really appreciate your work.. I have noticed all that you have posted for us.

    online writing service
    writing service
    writing services
    writing agency
    buy essay

    ReplyDelete
  46. sinema filmleri izle film izle
    sinema filmleri izle dizi izle
    lig tv maç izlettir lig tv izle
    maç izle lig tv izle lig tv izle

    canlı maç dinle izle canlı maç izle
    Canlı maç izle canlı maç izle

    sikiş izle sikiş izle

    sikiş izle sikiş izle
    sikiş sikiş
    sikiş izleme sikiş
    sex izle sex izle
    sikiş yeni sikiş filmleri
    redtube sikiş redtube sikiş

    sikiş sikiş
    sikiş yeni sikiş filmleri
    sikiş amatör sikiş
    sikiş gizli sikiş
    sikiş kızlık bozma

    sikiş sikiş
    porno porno izle
    porno porno izle
    sikişsikiş
    sikiş izle sikiş izle
    sikiş izle sikiş izle
    sikiş amcık

    ReplyDelete
  47. “Whoever a woman is,Christian Louboutin
    Christian Louboutin Pumps LiToYo says.herve legerNowadays, the pumps are the women’s favorite like the old time too.Christian Louboutin Sandals And the height of pumps has made breakthrough for many times. Christian Louboutin BootsTwenty years ago, christian louboutin blackthe fashionable giant Christian Louboutin, gave a standard to the fashionable pumps.christian louboutin discount
    Christian Louboutin shoes And at the same time, the red-sole sky-high pumps became the striking mark of Louboutin, and the striking mark of fashion.
    christian louboutin heels

    Let’s imagine about that a woman wears a pair of red-sole sky-high pumps walking on the street with rhythmic strides;
    christian heels
    how wonderful sight it will be!Christian Louboutin specials If the woman chooses a mini skirt to go with her red-sole pumps,Christian Louboutin black with the gentle summer breeze and long hair and beautiful skirt fluttering slightly,Christian Louboutin red will you think the woman is charming? And the famous designer Christian Louboutin has said that, Christian Louboutin blue“Exactly the red-sole high heels made women have a healthy body, because these high heels make women slow down their steps.Hermes Birkin The difference is like that driving a car is different from ride a bike;Christian Louboutin glitter you can enjoy the scene along the way at least if you ride a bike.”
    Maybe the pumps are so high that you will doubt about whether you can walk wearing them. Christian Louboutin pinkIt’s sure that you have not worn Christian Louboutin shoes so far. Louboutin pumps are designed to match body’s structure, especially the structure of women’s foeet; and you can have a run with Christian Louboutin pumps. That’s the other one important reason that Christian Louboutin shoes are so appreciated by women.

    ReplyDelete