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

idealab :)

Bioloid robot kit from Korean company Robotis; CM5 controller block, AX12 servos..
18 postsPage 1 of 21, 2
18 postsPage 1 of 21, 2

idealab :)

Post by savuporo » Sun Dec 17, 2006 6:45 pm

Post by savuporo
Sun Dec 17, 2006 6:45 pm

first, hello all, im new to this forum, not new to robotics though :)

Im considering a Bioloid kit for myself probably early next year ( in a tight financial spot right now with vacation behind, new apartment needing furniture and just got a new car lease .. no current budget for robots left :( )

Im just throwing out my reasons for getting one. First, from what i gather its one of the few advanced robot kits that actually provides motion feedback, which IMO is essential. Having worked on industrial robots for couple of years, im baffled that this feature is often missing in hobby robots and is "trickling down" so slowly. Ok, it doesnt have rotary encoders but i hope that the servos it has provide high-enough precision of feedback for basic purposes.

So, as i am an embedded programmer obviously i am going to stick a "real" contoller in that thing :) preferrably either ARM9-based single board computer, running Linux, or something like Blackfin "DSP Stamp". Im not really fond of 8-bit micros, although i have done a fair amount of coding on them. IMO, price/performance of 32-bit MCUs/CPUs is so much better than 8-bits these days that i see no reason being stuck with limitations of AVRs or PICs.

IMO, linux-running CPU board should be a default option when buying a Bioloid kit, opens the possibilities horizon up so much farther.

Anyone else thinking along the same lines ?
first, hello all, im new to this forum, not new to robotics though :)

Im considering a Bioloid kit for myself probably early next year ( in a tight financial spot right now with vacation behind, new apartment needing furniture and just got a new car lease .. no current budget for robots left :( )

Im just throwing out my reasons for getting one. First, from what i gather its one of the few advanced robot kits that actually provides motion feedback, which IMO is essential. Having worked on industrial robots for couple of years, im baffled that this feature is often missing in hobby robots and is "trickling down" so slowly. Ok, it doesnt have rotary encoders but i hope that the servos it has provide high-enough precision of feedback for basic purposes.

So, as i am an embedded programmer obviously i am going to stick a "real" contoller in that thing :) preferrably either ARM9-based single board computer, running Linux, or something like Blackfin "DSP Stamp". Im not really fond of 8-bit micros, although i have done a fair amount of coding on them. IMO, price/performance of 32-bit MCUs/CPUs is so much better than 8-bits these days that i see no reason being stuck with limitations of AVRs or PICs.

IMO, linux-running CPU board should be a default option when buying a Bioloid kit, opens the possibilities horizon up so much farther.

Anyone else thinking along the same lines ?
savuporo
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 26
Joined: Sun Dec 17, 2006 1:00 am

Post by limor » Sun Dec 17, 2006 7:23 pm

Post by limor
Sun Dec 17, 2006 7:23 pm

Hi savuporo,
indeed people who have some background in control and robotics are often amazed that these humanoids do the things they do while using only holding-position control techniques.

Bioloid is the platform of choice if you plan to do your own dynamic control. Position control provided by the AX12 servos is uses PID and is very comprehensive (check the manual for compliance variables).

By setting the speed of the servos, you actually control the voltage given to the motor. By setting the maximum-torque you are actually limiting the current. These two, together with position sampling available at up to 2000hz and current consumption reading (available at lower sampling rate), provide fertile ground for creative velocity control and dymamic gaits.

I've been working with gumstix and robostix and they provide a great environment for this kind of research. Can you provide more info about your experience with Blackfin
Hi savuporo,
indeed people who have some background in control and robotics are often amazed that these humanoids do the things they do while using only holding-position control techniques.

Bioloid is the platform of choice if you plan to do your own dynamic control. Position control provided by the AX12 servos is uses PID and is very comprehensive (check the manual for compliance variables).

By setting the speed of the servos, you actually control the voltage given to the motor. By setting the maximum-torque you are actually limiting the current. These two, together with position sampling available at up to 2000hz and current consumption reading (available at lower sampling rate), provide fertile ground for creative velocity control and dymamic gaits.

I've been working with gumstix and robostix and they provide a great environment for this kind of research. Can you provide more info about your experience with Blackfin
limor
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 1845
Joined: Mon Oct 11, 2004 1:00 am
Location: London, UK

Post by savuporo » Sun Dec 17, 2006 7:40 pm

Post by savuporo
Sun Dec 17, 2006 7:40 pm

Re: BlackFin.
Well, i havent played with Blackfin yet, but its capabilities at first sight should be pretty similar to general 32-bit micros, like ARM9 and derivatives, or MIPS-based solutions. With the exception that it can do DSP-like processing ( image, sound, general signal processing ) as well on the same chip.
In general, the difference with 8-bit micros is that you can run a fullfledged operating system on it, in realtime mode if you so desire, and of course a huge jump in performance, especially floating-point becomes important.

My main experience on 32bits is with various ARM9-based CPUs from different vendors. Very widely used platform, just not often by hobby robotics guys for some reason. Good tool support, runs Linux in all sorts of different flavors, you can program in any language you wish, starting from assembler for those really performance-critical loops , C/C++, to Perl , Java or Lua if you so desire.
One other great advantage is that you can take basically any opensource library or other code available to you and usually make it run directly, without modifications on this tiny piece of battery-powered silicon :)
You have a huge array of boards to choose from, some of them are tailored especially for robotics, with plenty of relevant hardware integrated, wireless comms, lots of GPIO, timers and whatnot. http://linuxdevices.com/articles/AT2614444132.html will give you hundreds of different options, or look under "Products" and search for ARM9/Single Board Computers.
Or just head straight to http://robots.net/article/1844.html, http://robots.net/article/1873.html
Re: BlackFin.
Well, i havent played with Blackfin yet, but its capabilities at first sight should be pretty similar to general 32-bit micros, like ARM9 and derivatives, or MIPS-based solutions. With the exception that it can do DSP-like processing ( image, sound, general signal processing ) as well on the same chip.
In general, the difference with 8-bit micros is that you can run a fullfledged operating system on it, in realtime mode if you so desire, and of course a huge jump in performance, especially floating-point becomes important.

My main experience on 32bits is with various ARM9-based CPUs from different vendors. Very widely used platform, just not often by hobby robotics guys for some reason. Good tool support, runs Linux in all sorts of different flavors, you can program in any language you wish, starting from assembler for those really performance-critical loops , C/C++, to Perl , Java or Lua if you so desire.
One other great advantage is that you can take basically any opensource library or other code available to you and usually make it run directly, without modifications on this tiny piece of battery-powered silicon :)
You have a huge array of boards to choose from, some of them are tailored especially for robotics, with plenty of relevant hardware integrated, wireless comms, lots of GPIO, timers and whatnot. http://linuxdevices.com/articles/AT2614444132.html will give you hundreds of different options, or look under "Products" and search for ARM9/Single Board Computers.
Or just head straight to http://robots.net/article/1844.html, http://robots.net/article/1873.html
savuporo
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 26
Joined: Sun Dec 17, 2006 1:00 am

Post by Juha » Mon Dec 18, 2006 10:41 am

Post by Juha
Mon Dec 18, 2006 10:41 am

Welcome to the forum, "smoked reindeer" ;)

limor wrote:I've been working with gumstix and robostix and they provide a great environment for this kind of research. Can you provide more info about your experience with Blackfin


I must say, that I've become a bit tempted on switching to gumstix :) The system seems very cool.

What kind of combo are you working with? Some gumstix motherboard + robostix?

BTW, how fast are the serial connections on the system? I guess it depends on the expansion board you have?

I only wish they had a java API allowing you to do gumstix specific functions (as far as I know, they don't?).
Welcome to the forum, "smoked reindeer" ;)

limor wrote:I've been working with gumstix and robostix and they provide a great environment for this kind of research. Can you provide more info about your experience with Blackfin


I must say, that I've become a bit tempted on switching to gumstix :) The system seems very cool.

What kind of combo are you working with? Some gumstix motherboard + robostix?

BTW, how fast are the serial connections on the system? I guess it depends on the expansion board you have?

I only wish they had a java API allowing you to do gumstix specific functions (as far as I know, they don't?).
Juha
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 30
Joined: Fri Aug 25, 2006 1:00 am
Location: Helsinki, Finland

Post by JonHylands » Mon Dec 18, 2006 12:20 pm

Post by JonHylands
Mon Dec 18, 2006 12:20 pm

With my setup (which I have published on my blog), the Robostix talks to the Bioloid bus at 1 Mbps. The gumstix talks to the Robostix at 115,200, over the standard serial port.

The Robostix acts as a message forwarder in both directions. It takes whatever it gets from the gumstix, and puts those bytes on the bus, and the same for the other direction.

The next setup I am doing will involve a different ATMega128 board, mainly because the Robostix can't do master SPI. I'll be connecting this new ATMega128 board to the Bioloid at the same 1 Mbps, and to a Wifi module (802.11g) over SPI also at 1 Mbps. So that will make the Bioloid bus basically adressable over a socket connection, with throughput of 1 Mbps, from any PC on the network.

- Jon

http://www.huv.com/blog
With my setup (which I have published on my blog), the Robostix talks to the Bioloid bus at 1 Mbps. The gumstix talks to the Robostix at 115,200, over the standard serial port.

The Robostix acts as a message forwarder in both directions. It takes whatever it gets from the gumstix, and puts those bytes on the bus, and the same for the other direction.

The next setup I am doing will involve a different ATMega128 board, mainly because the Robostix can't do master SPI. I'll be connecting this new ATMega128 board to the Bioloid at the same 1 Mbps, and to a Wifi module (802.11g) over SPI also at 1 Mbps. So that will make the Bioloid bus basically adressable over a socket connection, with throughput of 1 Mbps, from any PC on the network.

- Jon

http://www.huv.com/blog
JonHylands
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 512
Joined: Thu Nov 09, 2006 1:00 am
Location: Ontario, Canada

Post by savuporo » Mon Dec 18, 2006 12:28 pm

Post by savuporo
Mon Dec 18, 2006 12:28 pm

Oh, i didnt realize that Gumstix is actually XScale ( this info isnt easily found on gumstix.com ) . Thats definitely enough CPU power for serious tinkerers :)
Oh, i didnt realize that Gumstix is actually XScale ( this info isnt easily found on gumstix.com ) . Thats definitely enough CPU power for serious tinkerers :)
savuporo
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 26
Joined: Sun Dec 17, 2006 1:00 am

Post by JonHylands » Mon Dec 18, 2006 2:26 pm

Post by JonHylands
Mon Dec 18, 2006 2:26 pm

Yes, the gumstix has either a 200 MHz or 400 MHz XScale processor, running a full blown Linux build, with 64 MB of RAM. It has many connection options, including bluetooth, ethernet, dual ethernet, or Wifi, as well as more traditional options like RS-232 and USB (device only, not host).

- Jon
Yes, the gumstix has either a 200 MHz or 400 MHz XScale processor, running a full blown Linux build, with 64 MB of RAM. It has many connection options, including bluetooth, ethernet, dual ethernet, or Wifi, as well as more traditional options like RS-232 and USB (device only, not host).

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

Post by limor » Mon Dec 18, 2006 2:58 pm

Post by limor
Mon Dec 18, 2006 2:58 pm

I ordered a few months ago a "Basix" BlueTooth board at 400hz + Robostix + Serial board combo.

A new daughter board option they have now is the WifiStix which connects to the Gumstix in the "Connex" configuration (vertical hirose connector).

However, I haven't checked out on their wiki if WifiStix exposes any serial pins to enable communication with the Bioloid bus. The Gumstix itself doesnt expose anything except for the microscopic pins on the hirose connector.

(I agree that the Gumstix web site is not very friendly and easy to navigate but the products work as advertised)
I ordered a few months ago a "Basix" BlueTooth board at 400hz + Robostix + Serial board combo.

A new daughter board option they have now is the WifiStix which connects to the Gumstix in the "Connex" configuration (vertical hirose connector).

However, I haven't checked out on their wiki if WifiStix exposes any serial pins to enable communication with the Bioloid bus. The Gumstix itself doesnt expose anything except for the microscopic pins on the hirose connector.

(I agree that the Gumstix web site is not very friendly and easy to navigate but the products work as advertised)
limor
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 1845
Joined: Mon Oct 11, 2004 1:00 am
Location: London, UK

Post by JonHylands » Mon Dec 18, 2006 3:46 pm

Post by JonHylands
Mon Dec 18, 2006 3:46 pm

According to some people who know, talking directly to the Bioloid bus from the gumstix is a non-trivial exercise (basically, you'd have to implement a kernel-level driver).

Its much simpler to use an embedded 8-bit microcontroller to talk to the Bioloid bus, and if you're planning on using a gumstix, the robostix is probably the simplest way to go.

The robostix connects to the smaller 60-pin hirose connector, so you can use that combined with the wifistix to have a decent system.

- Jon
According to some people who know, talking directly to the Bioloid bus from the gumstix is a non-trivial exercise (basically, you'd have to implement a kernel-level driver).

Its much simpler to use an embedded 8-bit microcontroller to talk to the Bioloid bus, and if you're planning on using a gumstix, the robostix is probably the simplest way to go.

The robostix connects to the smaller 60-pin hirose connector, so you can use that combined with the wifistix to have a decent system.

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

Post by savuporo » Mon Dec 18, 2006 4:17 pm

Post by savuporo
Mon Dec 18, 2006 4:17 pm

JonHylands wrote:According to some people who know, talking directly to the Bioloid bus from the gumstix is a non-trivial exercise (basically, you'd have to implement a kernel-level driver).


From what i gathered at first glance, its a RS422/485-like bus configuration with pretty well documented command set. Having hacked around with kernel-level drivers before, i think i would take that challenge. There are similar sources available for modifyng or taking ideas from ( http://cmp.felk.cvut.cz/~pisa/ulan/ul_drv.html , libnodave )

BTW, to get things going there are ways to do development and testing in userspace on normal x86 linux
JonHylands wrote:According to some people who know, talking directly to the Bioloid bus from the gumstix is a non-trivial exercise (basically, you'd have to implement a kernel-level driver).


From what i gathered at first glance, its a RS422/485-like bus configuration with pretty well documented command set. Having hacked around with kernel-level drivers before, i think i would take that challenge. There are similar sources available for modifyng or taking ideas from ( http://cmp.felk.cvut.cz/~pisa/ulan/ul_drv.html , libnodave )

BTW, to get things going there are ways to do development and testing in userspace on normal x86 linux
savuporo
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 26
Joined: Sun Dec 17, 2006 1:00 am

Post by JonHylands » Mon Dec 18, 2006 6:15 pm

Post by JonHylands
Mon Dec 18, 2006 6:15 pm

Ahh, if that were true, it would be a piece of cake. The Bioloid kit comes with AX-12 servos, which use a half-duplex, single wire for both Tx and Rx, TTL serial bus that runs at 1 Mbps.

The DX series of servos from Robotis use RS-485, and the CX-series use CAN.

The trick with the AX-12 is that it is a one-wire bus, so you have to be able to transmit and receive on the same line. You can use a bus switcher to do that, but with the hardware UART on the gumstix, you would need to be down at the driver level to know exactly when the bytes are done being transmitted in order to switch to receive mode.

On an ATMega128, however, its a piece of cake...

- Jon
Ahh, if that were true, it would be a piece of cake. The Bioloid kit comes with AX-12 servos, which use a half-duplex, single wire for both Tx and Rx, TTL serial bus that runs at 1 Mbps.

The DX series of servos from Robotis use RS-485, and the CX-series use CAN.

The trick with the AX-12 is that it is a one-wire bus, so you have to be able to transmit and receive on the same line. You can use a bus switcher to do that, but with the hardware UART on the gumstix, you would need to be down at the driver level to know exactly when the bytes are done being transmitted in order to switch to receive mode.

On an ATMega128, however, its a piece of cake...

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

Post by savuporo » Mon Dec 18, 2006 7:46 pm

Post by savuporo
Mon Dec 18, 2006 7:46 pm

So i will base my code off the I2C/SPI drivers then and use the ATMega source as a reference :) IMO, programming a 32-bit micro aint significantly more difficult than 8-bit, in most cases exactly the opposite.
So i will base my code off the I2C/SPI drivers then and use the ATMega source as a reference :) IMO, programming a 32-bit micro aint significantly more difficult than 8-bit, in most cases exactly the opposite.
savuporo
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 26
Joined: Sun Dec 17, 2006 1:00 am

Post by JonHylands » Mon Dec 18, 2006 8:20 pm

Post by JonHylands
Mon Dec 18, 2006 8:20 pm

My brother had this to say about it:

"Realistically, going this route would require a driver change in the
gumstix serial driver. Trying to manipulate the GPIOs from user space
won't work since the UART has a FIFO, and you need to assert the GPIO
line until the FIFO is actually empty, and then deassert before the
server responds. The default turnaround needs to be less than 160
usec."

- Jon
My brother had this to say about it:

"Realistically, going this route would require a driver change in the
gumstix serial driver. Trying to manipulate the GPIOs from user space
won't work since the UART has a FIFO, and you need to assert the GPIO
line until the FIFO is actually empty, and then deassert before the
server responds. The default turnaround needs to be less than 160
usec."

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

Post by dhylands » Tue Dec 19, 2006 10:56 pm

Post by dhylands
Tue Dec 19, 2006 10:56 pm

There are a bunch of issues trying to get a device to talk to an AX-12 servo.

The first is the fact that the AX-12 uses a half-duplex form of communication. The second is getting the baud rates to match.

Lets talk about baud rates first. Many devices, like the gumstix, use crystals which are based around frequencies which are multiples of 1200. The gumstix happens to use a 3.6864 MHz crystal for its serial communications. This makes getting baud rates like 115,200 or 921,600 bang on.

The AX-12 uses (I believe) an AVR based processor running at 16 MHz, which makes baud rates like 1000000 easy, but rates like 921600 not possible. With a 16 MHz crystal, you can get 117647 baud which is within about 2% or 115200, but the closest you can get to 921600 is 1Mbit which is 8.5% error, which is too big a difference to allow reliable communication (the datasheets recommends 2% as the max error for reliable communication)

So the next issues is using the half-duplex protocol. With the code I was doing for Jon, I was trying to use an ATMega128 (the robostix) to talk to the AX-12 by using no additional hardware. Even then it was a bit tricky. You need to be careful about when you stop driving the Tx line. You need to wait until all of the bits have actually been shifted out of the Tx shift register, and then within 160 usec, you need to configure the Tx line as a GPIO input (so it's not driving the line anymore).

I chose to receive my own input and when I start to send a character I put the Tx into output mode. After I've received the character being sent I turn the Tx back into an input (since I've received the character, by definition the last bit must have been shifted out).

So, given the above, it didn't seem practical to use the gumstix to talk directly to the AX-12. The baud rates don't work out and linux can't guarantee that I can turn my Tx off within 160 usec of sending the last character.

The initial version I did for Jon uses the gumstix talking at 115,200 to the robostix and the robostix talking at 1Mbit to the the AX-12. Eventually, I'd like to redo it so that the gumstix/robostix link is using SPI, which will allow going up to full 1Mbit transfer rates.

--
Dave Hylands
Vancouver, BC, Canada
http://www.DaveHylands.com/
There are a bunch of issues trying to get a device to talk to an AX-12 servo.

The first is the fact that the AX-12 uses a half-duplex form of communication. The second is getting the baud rates to match.

Lets talk about baud rates first. Many devices, like the gumstix, use crystals which are based around frequencies which are multiples of 1200. The gumstix happens to use a 3.6864 MHz crystal for its serial communications. This makes getting baud rates like 115,200 or 921,600 bang on.

The AX-12 uses (I believe) an AVR based processor running at 16 MHz, which makes baud rates like 1000000 easy, but rates like 921600 not possible. With a 16 MHz crystal, you can get 117647 baud which is within about 2% or 115200, but the closest you can get to 921600 is 1Mbit which is 8.5% error, which is too big a difference to allow reliable communication (the datasheets recommends 2% as the max error for reliable communication)

So the next issues is using the half-duplex protocol. With the code I was doing for Jon, I was trying to use an ATMega128 (the robostix) to talk to the AX-12 by using no additional hardware. Even then it was a bit tricky. You need to be careful about when you stop driving the Tx line. You need to wait until all of the bits have actually been shifted out of the Tx shift register, and then within 160 usec, you need to configure the Tx line as a GPIO input (so it's not driving the line anymore).

I chose to receive my own input and when I start to send a character I put the Tx into output mode. After I've received the character being sent I turn the Tx back into an input (since I've received the character, by definition the last bit must have been shifted out).

So, given the above, it didn't seem practical to use the gumstix to talk directly to the AX-12. The baud rates don't work out and linux can't guarantee that I can turn my Tx off within 160 usec of sending the last character.

The initial version I did for Jon uses the gumstix talking at 115,200 to the robostix and the robostix talking at 1Mbit to the the AX-12. Eventually, I'd like to redo it so that the gumstix/robostix link is using SPI, which will allow going up to full 1Mbit transfer rates.

--
Dave Hylands
Vancouver, BC, Canada
http://www.DaveHylands.com/
dhylands
Newbie
Newbie
User avatar
Posts: 5
Joined: Tue Dec 19, 2006 1:00 am

Post by Juha » Wed Dec 20, 2006 10:02 am

Post by Juha
Wed Dec 20, 2006 10:02 am

dhylands wrote:You need to wait until all of the bits have actually been shifted out of the Tx shift register, and then within 160 usec, you need to configure the Tx line as a GPIO input (so it's not driving the line anymore).


Hi Dave,

Just incase you missed it, address 5 in the ax-12 registry sets the return time delay.

I had to use this myself (on a different platform). I haven't really done ant proper testing yet to see how low I could set this value.

-- Juha
dhylands wrote:You need to wait until all of the bits have actually been shifted out of the Tx shift register, and then within 160 usec, you need to configure the Tx line as a GPIO input (so it's not driving the line anymore).


Hi Dave,

Just incase you missed it, address 5 in the ax-12 registry sets the return time delay.

I had to use this myself (on a different platform). I haven't really done ant proper testing yet to see how low I could set this value.

-- Juha
Juha
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 30
Joined: Fri Aug 25, 2006 1:00 am
Location: Helsinki, Finland

Next
18 postsPage 1 of 21, 2
18 postsPage 1 of 21, 2