PDA

View Full Version : [Question(s)] Bioloid USB bus board



elaughlin
05-16-2010, 10:40 AM
I was looking at buying the USB 2 Dynamixel or the Bioloid USB bus board. I want to connect my bioloid directly to the computer to start programming small things on my own and want to get rid of the CM-5 kind of. Can both of these products do essentially the same thing (except for the bus board not having a serial port)? I already have a USB to serial adapter bought from radio shack since I ddint want to wait for the USb2 dynamixel to come in the mail when I opened up my bioloid kit and saw I couldnt run anything on him without an adapter for my computer - so i ran out and bought an adapter.

But i want to connect by servos and control through my pc now. Should I go with the USB 2 Dynamixel or the bus board?

The bus board interested me more since the power supply from the biolod kit can be used to power it. And the usb2dynamixel needed another power source converted into the 3P style biolod connector.

So my real final question is, which one is the better purchase for me? Ha

Thanks for any insight you guys can give me. I am slowly but surely going to build a custom mech. Starting from the ground up, learning everything I can.

lnxfergy
05-16-2010, 11:16 AM
The SMPS2dynamixel will give you the same power connection: http://www.trossenrobotics.com/store/p/5886-SMPS2Dynamixel-Adapter.aspx

The only other feature the USB2dynamixel has over the HUV board, is that it would allow you to use RX servos later on (but you can't do RX & AX at the same time, there's a selection switch)

-Fergs

Adam
05-16-2010, 11:16 AM
I have both. The bus board is much better if you plan to run AX servos. The bus board has six 3-pin connectors and a power plug.

The USB2Dynamixel only has one 3-pin connector, and you would have to make yourself a 3-pin power plug.

The only advantage of the USB2Dynamixel is that it has the 4-pin connector for the bigger RX/EX servos.

EDIT: Ok, me and lnxfergy posted basically the same message at the same time... :)

elaughlin
05-16-2010, 06:52 PM
Thanks for the heads up. I don't think I will have the cash to buy loads of RX or EX servos anytime soon. So I think I might go with the Bus Board.

Inxfergy - That SMPS2dynamixel is much cheaper, but does it communicate with a PC via USB cable? Doesn't look like it does, but I can't quite be sure whats on the other side or if it is just a fuse. I was looking for something to communicate with my servos so I could practice some simple programming with them.

lnxfergy
05-16-2010, 06:56 PM
What I was saying is that the SMPS2Dynamixel is an add-on for the USB2Dynamixel, which gives it the power plug capability that the HUV board has. The SMPS does no communication on it's own.

-Fergs

elaughlin
05-16-2010, 09:24 PM
Ahh I see. Thanks for clearing me up.

elaughlin
05-21-2010, 02:55 PM
Alright, now that I have gotten the USB bus board into my possession (which Trossen Robotics is amazingly fast at delivering - purchased online at 4:30 on Monday, arrived before I was home at 3:00 on Wednesday).

I need some help on programming.... I have been learning C for a little while, but do I need anything special (i.e. software) to start making small programs to run a few AX-12s. Then work my way up to controlling quite a few.

If anyone could help, it would be much appreciated.

lnxfergy
05-21-2010, 03:34 PM
You can use any language that is able to open a serial port. From there, you just have to send the right bytes out the serial port (reading the AX-12 manual helps here).

A few possible (open-source) options:
Jon/Dave Hylands C-based application (http://www.bioloid.info/tiki/tiki-index.php?page=Bioloid+Command+Line+Utility)
PyPose, a python based application (http://arbotix.googlecode.com)

Both of these are just utility programs, but you should be able to use the internals to open a port and send packets without having to rewrite all that.

-Fergs

Adam
05-21-2010, 07:25 PM
I'm using the C# library from Forest Moon Productions.

elaughlin
05-23-2010, 09:18 PM
Alright, I know I am a noob, bigtime. I have some C programming experience, but very basic. Thats not the problem really. I dont know what to do once I connect my USB bus board (with AX-12s and power cord) to the computer. I could write programs, but how do you get any communication to the bus board. I am sorry I dont know anything, I do need lots of help guys. Thanks again for anything you can tell me, or yell at me for being so dumb about.

DresnerRobotics
05-23-2010, 11:30 PM
Any language that can talk to a serial port can control the servos using the Bioloid Bus Board. You can check out the C example code in the AX-12+ manual for a start, but really you either need to find & use, or write, your own control library. Writing the commands at hexadecimal level will grow tiring quickly. The AX-12+ manual has everything you need to know about controlling them, such as what registers do what and how the serial packet structure is setup. All PC > Dynamixel communication entails is sending a hexadecimal packet of data out a serial port.

To be perfectly honest though, given that you don't know a ton about programming it might have been a better idea to use a controller that already had a good solid foundation of code written around it (such as the ArbotiX). Otherwise, you're looking at being tethered to a PC, and using something like the Forest Moon Library which isn't exactly suited for a code beginner. With the ArbotiX, you'd have an onboard controller and a very straight forward library for controlling the AX-12s.

Literally, moving an AX-12 using the ArbotiX is a single line of code using the library and very well documented.

What exactly do you intend to do with your Bioloid Bus Board? Did you intend to have a PC onboard? While its a great board to have (I recommend one for any bioloid user) and I prefer it over the USB2Dynamixel, it might not be the right tool for the job, and developing code around it might be a waste of time if you don't plan on having an onboard PC on your robot.

elaughlin
05-24-2010, 05:56 AM
Ahh, I got it to create some small programs, just to practice writing code for the dynamixels and keep that tethered to the PC. I did also get the Arbotix starter kit, but I thought using that would be a much higher step up than using the bus board - it kind of scared me. So I was planning on using that later when I got a better knowledge of what to do, so I didnt mess that bad boy up. Does this make any sense?

DresnerRobotics
05-24-2010, 08:18 AM
It does, and it might be good practice for you to study the ax-12 manual and code example to learn more about how the dynamixels tick. That said, it's actually more complicated to control servos that way than it is just using the arbotix. I also wouldn't spend *too* much time on it. I'd suggest thoroughly reading all of the manuals and software documentation, getting a feel for the overall system and how everything works. Once you've got the arduino IDE setup for the arbotix, looking at the different code examples will be very helpful as well.

Making a servo move is as simple as:

SetPosition(1, 512);

Where 1 is the servo Id and 512 is the goal position between 0 and 1023. If you have questions, that's what were here for, I only ask that you take the time to read through the provided documentation and understand it the best you can.

JonHylands
05-24-2010, 08:26 PM
You can also download my brother's bioloid command line utility (http://www.bioloid.info/tiki/tiki-index.php?page=Bioloid+Command+Line+Utility).

That will give you a command line interface to play with the servos on the bus.

- Jon

elaughlin
05-26-2010, 06:16 AM
Thanks, I actually downloaded that right away, but forgot I had it. It is still brand new to me, but I did finally get it all configured and have been tinkering around with it connected to some servos. It will take me a long time to be familiar with any program based part of the robot competitions, but thanks for having patience with me, and continually putting me on the right path.

elaughlin
05-26-2010, 06:46 PM
Alright, so I got back on to playing around with the bioloid bus board. I may just not understand this kind of stuff yet at all, but I definitely don't know how to program anything for it at all. I have been using the Command line utility and I can manually move around the servos, get data reads sent back from the the servos, that stuff is not a problem. I found this site with code posted from you, Jon, for the CLI/ Bioloid -

http://websvn.hylands.org/listing.php?repname=Projects&path=/avr/bioloid-io/&rev=0&sc=0

Do these include any code I can open up with the bus board, because I really cant tell. Sorry for being so terrible at this stuff. I do need to study my C and then get into the C++ programming still.

I like the bus board so far, and being able to move the servos around and all just by typing in the correct lines, but I need help to figure out how to do more with it. Thanks again, hope Im not being too much trouble for everyone.

Erik

DresnerRobotics
05-26-2010, 08:01 PM
I'm on my iPhone so I can't fully investigate the code in your link, but the bus board does not open any program or code. It is only an adapter that provides a serial port interface to the bioloid bus. Any code written to work with it would likewise work with a usb2dynamixel. Code snippets and programs are going to require the correct IDEs to execute and modify them, so depending on what language it's written in, you'd need a matching IDE to fit.

Honestly the thing I'd suggest here if you want to start learning programming C, would be an arduino. But you basically already have one with the arbotix. Direct pc connections via a bus board or usb2dynamixel are likely going to require a high level language knowledge to take advantage of any of the libraries out there written for that type of application (ie: Forest Moon Library). IMO, starting there is much more difficult than just diving into your arbotix and coding it directly within the arduino IDE.

Adam
05-26-2010, 09:26 PM
If you want to try to give it a go with the Forest Moon library and Visual Studio, I can help you out... but ultimately, you're going to have to really learn how to program. It won't happen overnight.

elaughlin
05-26-2010, 10:32 PM
Alright thanks guys. So the best thing would be to start working with my arbotix. I had my orders reversed, trying to work from the bus board up to the arbotix. Alright, I think I need to keep a power source for the arbotix then, and Ill start looking into all that. Thanks so much.

lnxfergy
05-26-2010, 10:38 PM
Alright thanks guys. So the best thing would be to start working with my arbotix. I had my orders reversed, trying to work from the bus board up to the arbotix. Alright, I think I need to keep a power source for the arbotix then, and Ill start looking into all that. Thanks so much.

You could take a bioloid cable, snip the signal (RX/TX) line, and connect your HUV to your ArbotiX to use the power brick with the arbotix. It's like making the HUV bus board into a very expensive version of the SMPS power adapter.

-Fergs

kamondelious
05-27-2010, 11:38 AM
Hi elaughlin,

If you already know some C and want to play with programming servos from your PC, have a look at the C library provided from Robotis.
http://support.robotis.com/en/software/dynamixel_sdk/api_reference.htm

I've been using it for a little while now and it's pretty great. There isn't a lot to it, it's just a basic library for connecting via USB2Dynamixel (work with the bioloid bus Board, that's what I'm using too) and reading/writing AX-* information. There are a couple simple example programs that come with it. You'll need the FTDI driver if you don't have it.

Here's something I just wrote as a quick demo :


#include <stdio.h>
#include <unistd.h>
#include <math.h>
#include <termio.h>
#include <sys/timeb.h>

#include "robotis/include/dynamixel.h"
#define DEFAULT_BAUDNUM 1 /* 1Mbps */
#define TRUE 1
#define FALSE 0
/* This is straight from the control table in the AX-12 manual page 12 */
#define AX12_PRESENT_POSITION_L (36)

int main()
{
int i;
int device_index = 0;
/* Open USB Bus Connection */
printf( "- Bus Connection : " );
if( dxl_initialize(device_index, DEFAULT_BAUDNUM) == FALSE ) {
printf( "Failure\n" );
return FALSE;
} else {
printf( "Success\n" );
}
/* Check for all attached Bioloid devices */
for( i=1; i<253; i++ ) {
dxl_ping(i);
/* Got ping? */
if( dxl_get_result() == COMM_RXSUCCESS ) {
short unsigned int readbytes = 11;
int results;
dxl_set_txpacket_id(i);
dxl_set_txpacket_instruction(INST_READ);
dxl_set_txpacket_parameter(0, AX12_PRESENT_POSITION_L);
dxl_set_txpacket_parameter(1, readbytes);
dxl_set_txpacket_length(4);
dxl_txrx_packet();
results = dxl_get_result();
if(results == COMM_RXSUCCESS) {
/* Read the returned size of data */
int rx_data_len = dxl_get_rxpacket_length();
/* Ensure we get the amount of data expected */
if(rx_data_len != readbytes+2) {
printf("Returned byte count (%d) mismatch! Expecting:%d\n",rx_data_len, readbytes);
} else {
/* Print out what we found */
printf( "\tID:%d pos:%d load:%d volt:%.1fV temp:%dC moving:%d @%d\n",
i,
dxl_makeword(dxl_get_rxpacket_parameter(0),dxl_get _rxpacket_parameter(1)),
dxl_makeword(dxl_get_rxpacket_parameter(4),dxl_get _rxpacket_parameter(5)),
(double)dxl_get_rxpacket_parameter(6)/10,
dxl_get_rxpacket_parameter(7),
dxl_get_rxpacket_parameter(10),
dxl_makeword(dxl_get_rxpacket_parameter(2),dxl_get _rxpacket_parameter(3))
);
}
} else {
printf("ID %d write failue\n", i);
}
} else {
printf("ID %d not found\n", i);
}
}

return TRUE;
}
Hope this helps.

If I can help more, let me know.

Cheers,

;)

elaughlin
05-27-2010, 08:12 PM
Inxfergy,

You are saying, use the power adapter and connect it to the BIOLOID BUS BOARD. Connecting one of the 3 pin ports on the BUS BOARD to one of the 3 pin ports on the ARBOTIX. And cutting the wire on the left (data line). And that will provide accurate voltage to the ARBOTIX?

Just want to clarify it all because I am very worried about burning out any of my electronic boards.

Thanks,
Erik

JonHylands
05-28-2010, 07:06 AM
Yes - the power and ground pins on the bioloid bus on the Arbotix are connected directly to the power terminal block, so powering the Arbotix from the bus is electrically equivalent to powering it through the power terminal block.

Just to clarify, on the bioloid bus the power pin is in the center, and the ground pin is the one with the angle cut on the shroud next to it. On the Arbotix the ground pin is next to the edge of the board.

- Jon

DresnerRobotics
05-28-2010, 08:17 PM
That said- I'd just suggest picking up an SMPS2Dynamixel on your next order, they're like $6 and provide a 2.5mm jack to 3/4 pin Dynamixel bus interface for power. Keep your Bioloid USB Bus Board free for other stuff!

Adam
05-28-2010, 09:37 PM
I pity the fool who doesn't own a SMPS2Dynamixel. ;)

RobotAtlas
08-14-2010, 02:14 PM
Just for the record, for those who like GUI programs, Dynamixel Wizard from Robotis RoboPlus software also works with USB bus board (Bioloid Bus Inteface). You just need to specify a correct com port and you can see the state of all connected Dynamixels.