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.

38 comments:

Chris Brind said...

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.

Royce said...

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.

Lavon said...

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

Bao Lu Long said...

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!

forkazoo said...

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.

Pedro said...

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

Stefan said...

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

zorgon the malevolent said...

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.

poston said...

There are ed hardy shirts
,pretty ed hardy shirt for men,

ed hardy womens in the ed hardy online store

designed by ed hardy ,
many cheap ed hardy shirt ,glasses,caps,trouers ed hardy shirts on sale ,

You can go to edhardyshirts.com to have a look ,you may find one of ed hardy clothing fit for you
Top qualitymen's jacket,
These cheap jacket are on sale now,you can find
north face jackets inmage on our web
Ralph Lauren Polo Shirtsbuberry polo shirts

Do you wannaghd hair straighteners for you own , we have many
cheap ghd hair straightenersin style and great,you can choose one from these
hair straighteners
Authentic chaussure puma
chaussure sport
And chaussure nike shoes
Come here to have a look of our Wholesale Jeans
Many fashionMens Jeans ,eye-catching
Womens Jeans ,and special out standing
Blue Jeans ,you can spend less money on our
Discount Jeans but gain really fine jeans, absolutely a great bargain.
http://www.weddingdressseason.com
 

http://CLOTHES-WHOLESALE.US

poston said...

There are ed hardy shirts
,pretty ed hardy shirt for men,

ed hardy womens in the ed hardy online store

designed by ed hardy ,
many cheap ed hardy shirt ,glasses,caps,trouers ed hardy shirts on sale ,

You can go to edhardyshirts.com to have a look ,you may find one of ed hardy clothing fit for you
Top qualitymen's jacket,
These cheap jacket are on sale now,you can find
north face jackets inmage on our web
Ralph Lauren Polo Shirtsbuberry polo shirts

Do you wannaghd hair straighteners for you own , we have many
cheap ghd hair straightenersin style and great,you can choose one from these
hair straighteners
Authentic chaussure puma
chaussure sport
And chaussure nike shoes
Come here to have a look of our Wholesale Jeans
Many fashionMens Jeans ,eye-catching
Womens Jeans ,and special out standing
Blue Jeans ,you can spend less money on our
Discount Jeans but gain really fine jeans, absolutely a great bargain.
http://www.weddingdressseason.com
 

http://CLOTHES-WHOLESALE.US

China Wholesale
wholesale from china
buy products wholesale
China Wholesalers

julia said...

I can see that you are an expert at your field! I am launching a website soon, and your information will be very useful for me. Thanks for all your help and wishing you all the success in your business. Please come visit my site Yonkers New York Business Directory when yo.u got time

julia said...

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.

J&D said...

視訊|影音視訊聊天室|視訊聊天室|視訊交友|視訊聊天|視訊美女|視訊辣妹|免費視訊聊天室

自慰器|自慰器

網頁設計|網頁設計公司|最新消息|訪客留言|網站導覽

免費視訊聊天|辣妹視訊|視訊交友網|美女視訊|視訊交友|視訊交友90739|成人聊天室|視訊聊天室|視訊聊天|視訊聊天室|情色視訊|情人視訊網|視訊美女
一葉情貼圖片區|免費視訊聊天室|免費視訊|ut聊天室|聊天室|豆豆聊天室|尋夢園聊天室|聊天室尋夢園|影音視訊聊天室||

poll said...

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 Riverside Yellow Page Business Directory when you got time.

poll said...

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.

poll said...

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.

j337 said...

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!

jacks said...

Hi Friend,
Congratulations for this nice looking blog. In this post everything about Web Development. I am also interested in latest news, sometimes i posted on Customized application development

J&D said...

米蘭情趣用品情趣用品情趣飛機杯自慰套充氣娃娃AV女優按摩棒跳蛋潤滑液角色扮演情趣內衣自慰器穿戴蝴蝶變頻跳蛋無線跳蛋電動按摩棒情趣按摩棒丁字褲G點SM後庭

情人趣味用品柏拉圖情趣用品成人論壇情色論壇一葉情貼圖片區


視訊美女視訊做愛


網頁設計

poston said...

crystal jewelry
wholesale crystal jewelry
wholesale jewelry
jewelry wholesale
cheap jewelry
wholesale gemstone jewelry
crystal wholesale
rock crystal

doll said...

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.

doll said...

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.

lla said...

cell phones
cheap cell phones
wholesale cell phones
discount cell phones
cell phone china
cell phones wholesale
Mobil phones

poll said...

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 Fortworth Yellow Page Business Directory when you got time.

Wira Bahasa said...

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

poll said...

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.

poll said...

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.

poll said...

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

poll said...

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

poll said...

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.

poll said...

You may have not intended to do so, but I think you have managed to express the state of mind that a lot of people are in. The sense of wanting to help, but not knowing how or where, is something a lot of us are going through. Please come visit my site Bakersfield Business Directory when you got time.

poll said...

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

poll said...

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

rr8004 said...

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.

rr8004 said...

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.

rr8004 said...

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.

rr8004 said...

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.

Onlineer said...

viagra preise
comprar cialis generico
prix viagra
viagra vente
cialis online bestellen
viagra online bestellen
buy levitra
cialis bestellen
viagra posologie
acheter viagra france
viagra kaufen
como comprar cialis
viagra online bestellen
precio del cialis