Legacy Forum: Preserving Nearly 20 Years of Community History - A Time Capsule of Discussions, Memories, and Shared Experiences.

Simple PC/USB to Robotis bus interface

Bioloid robot kit from Korean company Robotis; CM5 controller block, AX12 servos..
73 postsPage 3 of 51, 2, 3, 4, 5
73 postsPage 3 of 51, 2, 3, 4, 5

Post by billyzelsnack » Sun May 06, 2007 2:54 am

Post by billyzelsnack
Sun May 06, 2007 2:54 am

Apparently yesterday was a good day for my old Bioloid! Not only did I get my CM-5 working again, but..

My breadboard showed up in the mail and I took the chips off my previous soldered together interface attempt and quickly wired up a new one on the breadboard. It works better than the old one! Now I get all my data, what a concept. haha.

Boy it sure is nice see both of those 0xff's! :)
Apparently yesterday was a good day for my old Bioloid! Not only did I get my CM-5 working again, but..

My breadboard showed up in the mail and I took the chips off my previous soldered together interface attempt and quickly wired up a new one on the breadboard. It works better than the old one! Now I get all my data, what a concept. haha.

Boy it sure is nice see both of those 0xff's! :)
billyzelsnack
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 618
Joined: Sat Dec 30, 2006 1:00 am

Post by Goldrake » Mon May 07, 2007 12:38 pm

Post by Goldrake
Mon May 07, 2007 12:38 pm

billyzelsnack wrote:Apparently yesterday was a good day for my old Bioloid! Not only did I get my CM-5 working again, but..

My breadboard showed up in the mail and I took the chips off my previous soldered together interface attempt and quickly wired up a new one on the breadboard. It works better than the old one! Now I get all my data, what a concept. haha.

Boy it sure is nice see both of those 0xff's! :)

the schematics is the same or did you change something on the breadboard circuit?

thank you :)
billyzelsnack wrote:Apparently yesterday was a good day for my old Bioloid! Not only did I get my CM-5 working again, but..

My breadboard showed up in the mail and I took the chips off my previous soldered together interface attempt and quickly wired up a new one on the breadboard. It works better than the old one! Now I get all my data, what a concept. haha.

Boy it sure is nice see both of those 0xff's! :)

the schematics is the same or did you change something on the breadboard circuit?

thank you :)
Goldrake
Robot Builder
Robot Builder
User avatar
Posts: 22
Joined: Tue Feb 06, 2007 1:00 am

Post by billyzelsnack » Mon May 07, 2007 4:46 pm

Post by billyzelsnack
Mon May 07, 2007 4:46 pm

Same schematic. I'm not sure why the old one just 'mostly' worked. My packets still are not perfect, but it's better than it was. I think once I tweak things it will be pretty good.

Arnaud or Jon.. About what percentage of your packets are coming back with good checksums?
Same schematic. I'm not sure why the old one just 'mostly' worked. My packets still are not perfect, but it's better than it was. I think once I tweak things it will be pretty good.

Arnaud or Jon.. About what percentage of your packets are coming back with good checksums?
billyzelsnack
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 618
Joined: Sat Dec 30, 2006 1:00 am

Post by JonHylands » Mon May 07, 2007 4:55 pm

Post by JonHylands
Mon May 07, 2007 4:55 pm

Sometimes I don't get a response at all, but that is typically just after powering the thing up, so I tend to ignore those. Other than that, I pretty much never get a bad checksum...

Note also that I'm not using any special code or drivers - just the default Windows XP drivers that install for the FT232 when you plug it in. From my application, I'm running a (virtual) serial port at 1000000 baud.

I'll let you know how it works once I hook up the whole robot and start running 20 servos at once.

- Jon
Sometimes I don't get a response at all, but that is typically just after powering the thing up, so I tend to ignore those. Other than that, I pretty much never get a bad checksum...

Note also that I'm not using any special code or drivers - just the default Windows XP drivers that install for the FT232 when you plug it in. From my application, I'm running a (virtual) serial port at 1000000 baud.

I'll let you know how it works once I hook up the whole robot and start running 20 servos at once.

- Jon
JonHylands
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 512
Joined: Thu Nov 09, 2006 1:00 am
Location: Ontario, Canada

Post by Goldrake » Mon May 07, 2007 5:32 pm

Post by Goldrake
Mon May 07, 2007 5:32 pm

this week i'll try your schematics on my linux board, I'll let you know if i have a loss of data.
this week i'll try your schematics on my linux board, I'll let you know if i have a loss of data.
Goldrake
Robot Builder
Robot Builder
User avatar
Posts: 22
Joined: Tue Feb 06, 2007 1:00 am

Post by billyzelsnack » Tue May 08, 2007 3:59 am

Post by billyzelsnack
Tue May 08, 2007 3:59 am

Dang it. I thought I was finally making progress. I guess not.

Today I plug my toy in and it's working like the soldered version. Bah. So frustrating!! When is your board going to be ready to buy Jon? :)

I was fiddling around with it and noticed that I get the same results (missing first character) whether I have +5 plugged in or not. I guess I could try swapping out all my logic chips since I have extra. Maybe I zapped them or something.
Dang it. I thought I was finally making progress. I guess not.

Today I plug my toy in and it's working like the soldered version. Bah. So frustrating!! When is your board going to be ready to buy Jon? :)

I was fiddling around with it and noticed that I get the same results (missing first character) whether I have +5 plugged in or not. I guess I could try swapping out all my logic chips since I have extra. Maybe I zapped them or something.
billyzelsnack
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 618
Joined: Sat Dec 30, 2006 1:00 am

Post by billyzelsnack » Tue May 08, 2007 4:41 am

Post by billyzelsnack
Tue May 08, 2007 4:41 am

Ok. Got it working again. Though I'm not sure how in the world it ever worked yesterday! Geez.

So the problem.. I was following the schematic literally and not actually looking at what these logic chips did. So in my investigation of their specs I noticed that I didn't have GND or VCC hooked up on them. Plugged it in and I got my first characters back.

Because it had been bugging me that I was using two power supplies I also tried using the USB pin which spits out +5V. That worked too. Now I'm not sure how much draw the servo data pin is going to need, but hopefully it'll be below the USB 500mah and I can just skip the second +5V source.

Next step I think I might rewire things so I am just use a single 74HC126N instead of two considering that that chip has 4 duplicate functionalities!
Ok. Got it working again. Though I'm not sure how in the world it ever worked yesterday! Geez.

So the problem.. I was following the schematic literally and not actually looking at what these logic chips did. So in my investigation of their specs I noticed that I didn't have GND or VCC hooked up on them. Plugged it in and I got my first characters back.

Because it had been bugging me that I was using two power supplies I also tried using the USB pin which spits out +5V. That worked too. Now I'm not sure how much draw the servo data pin is going to need, but hopefully it'll be below the USB 500mah and I can just skip the second +5V source.

Next step I think I might rewire things so I am just use a single 74HC126N instead of two considering that that chip has 4 duplicate functionalities!
billyzelsnack
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 618
Joined: Sat Dec 30, 2006 1:00 am

Post by JonHylands » Tue May 08, 2007 4:52 am

Post by JonHylands
Tue May 08, 2007 4:52 am

Well, that board is pretty much ready, although it is set up to fit inside of BrainBot's chest cavity.

I just tried it against the CM-5 box, and it fits perfectly on the outside of the box (the screw holes on two of the mounting holes even line up).

Image

I have to figure out what the board will cost, and get a few more printed. Let me know if you're interested...

- Jon
Well, that board is pretty much ready, although it is set up to fit inside of BrainBot's chest cavity.

I just tried it against the CM-5 box, and it fits perfectly on the outside of the box (the screw holes on two of the mounting holes even line up).

Image

I have to figure out what the board will cost, and get a few more printed. Let me know if you're interested...

- Jon
JonHylands
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 512
Joined: Thu Nov 09, 2006 1:00 am
Location: Ontario, Canada

Post by Goldrake » Tue May 08, 2007 12:15 pm

Post by Goldrake
Tue May 08, 2007 12:15 pm

Features of the board?
Features of the board?
Goldrake
Robot Builder
Robot Builder
User avatar
Posts: 22
Joined: Tue Feb 06, 2007 1:00 am

Post by JonHylands » Tue May 08, 2007 1:33 pm

Post by JonHylands
Tue May 08, 2007 1:33 pm

Well, this board provides a USB connection to the bus. It has separately switchable power supplies for the bus and the electronics package. It has a third power switch connection (and a spot for a 5 volt switching regulator) to provide power to an aux board (gumstix or similar).

The board is currently set up to provide power for two other devices, which can be run at any voltage (subject to the limits of the converter) using a pair of AnyVolt Micros from Dimension Engineering. I will be using those power connectors for a pair of 12 volt CCD wireless cameras.

- Jon
Well, this board provides a USB connection to the bus. It has separately switchable power supplies for the bus and the electronics package. It has a third power switch connection (and a spot for a 5 volt switching regulator) to provide power to an aux board (gumstix or similar).

The board is currently set up to provide power for two other devices, which can be run at any voltage (subject to the limits of the converter) using a pair of AnyVolt Micros from Dimension Engineering. I will be using those power connectors for a pair of 12 volt CCD wireless cameras.

- Jon
JonHylands
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 512
Joined: Thu Nov 09, 2006 1:00 am
Location: Ontario, Canada

Post by Goldrake » Tue May 08, 2007 1:43 pm

Post by Goldrake
Tue May 08, 2007 1:43 pm

Great, it's what i need. I'll wait for a final release.
Great, it's what i need. I'll wait for a final release.
Goldrake
Robot Builder
Robot Builder
User avatar
Posts: 22
Joined: Tue Feb 06, 2007 1:00 am

Post by billyzelsnack » Wed May 09, 2007 5:59 am

Post by billyzelsnack
Wed May 09, 2007 5:59 am

Jon or anyone else..

I'd like to know what kind of sample rate you are getting from all 20 of your servos.

Doing things directly I end up with about 27fps ( 18 servos ) reading 8 bytes from PRESENT_POSITION_L. It doesn't get much faster if I only read 2 bytes so I just go ahead and grab all 8. This is just get the data for each servo one at a time.

I'm experimenting now with doing 4 get-writes in a row and then doing the 4 get-reads in a row to overlap the read latency. My values look pretty good (yeah right) and I'm getting 65fps this way. I'll be experimenting with more/less groups of servos tomorrow and see if I can find a sweet spot. I also hope to get some sync-sets in there too so I can finally get an idea of the actual performance I can get.

I REALLY would like to have 100hz gets and 30hz sets. I'd prefer to do it with a single USB interface, but maybe I'll end up with 2 or 3 (yuck).
Jon or anyone else..

I'd like to know what kind of sample rate you are getting from all 20 of your servos.

Doing things directly I end up with about 27fps ( 18 servos ) reading 8 bytes from PRESENT_POSITION_L. It doesn't get much faster if I only read 2 bytes so I just go ahead and grab all 8. This is just get the data for each servo one at a time.

I'm experimenting now with doing 4 get-writes in a row and then doing the 4 get-reads in a row to overlap the read latency. My values look pretty good (yeah right) and I'm getting 65fps this way. I'll be experimenting with more/less groups of servos tomorrow and see if I can find a sweet spot. I also hope to get some sync-sets in there too so I can finally get an idea of the actual performance I can get.

I REALLY would like to have 100hz gets and 30hz sets. I'd prefer to do it with a single USB interface, but maybe I'll end up with 2 or 3 (yuck).
billyzelsnack
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 618
Joined: Sat Dec 30, 2006 1:00 am

Post by JonHylands » Wed May 09, 2007 11:16 am

Post by JonHylands
Wed May 09, 2007 11:16 am

Actually, I was just playing with this concept last night. Here's how it breaks down:

The default servo response lag is 250, which corresponds to half a millisecond. For high speed, that's way too slow. I reset mine to 5, which corresponds to 10 us. (Parameter 5, Return Delay Time)

I can reliably do READ_COMMAND in one ms, which, for 18 servos, turns into 55 Hz if that was all you were doing. I'm running more like 25 devices, so my limit is 40 Hz. I plan to run at 33Hz for now, so I'm happy with that. If you're coding in C, and can approach the limit of the bus, you could do 100 Hz. Its not clear that you can get anywhere near that limit, however.

We're going to look at running 100 Hz later this summer, and it will involve adding more USB chips and splitting the bus.

To speed things up, make sure you're using SYNC_WRITE, which is enormously faster than WRITE_COMMAND.

- Jon
Actually, I was just playing with this concept last night. Here's how it breaks down:

The default servo response lag is 250, which corresponds to half a millisecond. For high speed, that's way too slow. I reset mine to 5, which corresponds to 10 us. (Parameter 5, Return Delay Time)

I can reliably do READ_COMMAND in one ms, which, for 18 servos, turns into 55 Hz if that was all you were doing. I'm running more like 25 devices, so my limit is 40 Hz. I plan to run at 33Hz for now, so I'm happy with that. If you're coding in C, and can approach the limit of the bus, you could do 100 Hz. Its not clear that you can get anywhere near that limit, however.

We're going to look at running 100 Hz later this summer, and it will involve adding more USB chips and splitting the bus.

To speed things up, make sure you're using SYNC_WRITE, which is enormously faster than WRITE_COMMAND.

- Jon
JonHylands
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 512
Joined: Thu Nov 09, 2006 1:00 am
Location: Ontario, Canada

Post by billyzelsnack » Wed May 09, 2007 8:30 pm

Post by billyzelsnack
Wed May 09, 2007 8:30 pm

hmm. Maybe it's the laptop I'm running, but to send out a READ_COMMAND takes about 800uS and it takes about 1000uS to read the response ( with a return delay of 1) which puts me at about 30fps with 18 servos.

I'm now experimenting with combining packets together and doing less actual serial reads/writes and using staggered return delays. With packing the writes on 2 servos ( still doing 2 seperate reads ) is giving me 55fps.

I'm not sure how many servos I can pack together, but I should be able to get at least 3. For the 2 servos above I have a return delays of 100 and 5. Lowering the 100 to 75 gives me checksum failures. So maybe I'll be able to squeak 4 in there.
hmm. Maybe it's the laptop I'm running, but to send out a READ_COMMAND takes about 800uS and it takes about 1000uS to read the response ( with a return delay of 1) which puts me at about 30fps with 18 servos.

I'm now experimenting with combining packets together and doing less actual serial reads/writes and using staggered return delays. With packing the writes on 2 servos ( still doing 2 seperate reads ) is giving me 55fps.

I'm not sure how many servos I can pack together, but I should be able to get at least 3. For the 2 servos above I have a return delays of 100 and 5. Lowering the 100 to 75 gives me checksum failures. So maybe I'll be able to squeak 4 in there.
billyzelsnack
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 618
Joined: Sat Dec 30, 2006 1:00 am

Post by JonHylands » Wed May 09, 2007 8:39 pm

Post by JonHylands
Wed May 09, 2007 8:39 pm

Check your USB driver properties: (assuming you're running WinXP)

Device Manager -> Ports -> USB -> Properties -> Port Settings -> Advanced -> Latency Timer

I set mine to 1 ms - it defaults to 15 or 20.

- Jon
Check your USB driver properties: (assuming you're running WinXP)

Device Manager -> Ports -> USB -> Properties -> Port Settings -> Advanced -> Latency Timer

I set mine to 1 ms - it defaults to 15 or 20.

- Jon
JonHylands
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 512
Joined: Thu Nov 09, 2006 1:00 am
Location: Ontario, Canada

PreviousNext
73 postsPage 3 of 51, 2, 3, 4, 5
73 postsPage 3 of 51, 2, 3, 4, 5