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

Control AX-12 with Visual Basic (VBA or Excel)

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

Control AX-12 with Visual Basic (VBA or Excel)

Post by VanHelsing » Wed May 31, 2006 9:49 am

Post by VanHelsing
Wed May 31, 2006 9:49 am

Hi there! Very nice that there’s this forum now. Have the Bioloid since end March, and spend quite some evenings having fun with it. But, also trying to find more info on it (don’t speak Korean), often after an episode of ‘why doesn’t this work like I expect it should work’ (the glitches thing, what I now feel is solved with the AX-12 rom update). A forum like this would have helped a lot back then. Learned a lot now by trial and error, so maybe I can contribute a bit.

I wanted to have more control over the movement of the AX-12’s, meaning, not simply connect poses, but movement generated by code (VB or VBA) on the fly. And that goes a bit beyond the Bioloid software supplied with it.

What I now do is put an ‘MSCOMM32.ocx Active X control’ (simplifies sending something through the com port) on an Excel sheet. And use broadcast strings (and manage mode) to send whatever I program in code or knock on a worksheet to the AX-12’s. With some goniometry (and patience), I even build a simple plotter this way (pen up, pen down, x-y coordinates). It could draw whatever image I wanted to process (beautiful to see the drawing appear on paper).

A lot of other ‘wild’ projects are possible this way, but to be honest, some are hampered by the 60 degrees ‘dead zone’ of the AX-12’s using wheels. I’m also a newbie in com port communication (max string lengths, ready to send, ready to receive etc.), so I have a lot of improvement opportunities here, if somebody can help, would be greatly appreciated!

If anybody would like to explore this Mscomm32 thing, happy to help. And, questions, ideas, comments, suggestions are always welcome of course.
Hi there! Very nice that there’s this forum now. Have the Bioloid since end March, and spend quite some evenings having fun with it. But, also trying to find more info on it (don’t speak Korean), often after an episode of ‘why doesn’t this work like I expect it should work’ (the glitches thing, what I now feel is solved with the AX-12 rom update). A forum like this would have helped a lot back then. Learned a lot now by trial and error, so maybe I can contribute a bit.

I wanted to have more control over the movement of the AX-12’s, meaning, not simply connect poses, but movement generated by code (VB or VBA) on the fly. And that goes a bit beyond the Bioloid software supplied with it.

What I now do is put an ‘MSCOMM32.ocx Active X control’ (simplifies sending something through the com port) on an Excel sheet. And use broadcast strings (and manage mode) to send whatever I program in code or knock on a worksheet to the AX-12’s. With some goniometry (and patience), I even build a simple plotter this way (pen up, pen down, x-y coordinates). It could draw whatever image I wanted to process (beautiful to see the drawing appear on paper).

A lot of other ‘wild’ projects are possible this way, but to be honest, some are hampered by the 60 degrees ‘dead zone’ of the AX-12’s using wheels. I’m also a newbie in com port communication (max string lengths, ready to send, ready to receive etc.), so I have a lot of improvement opportunities here, if somebody can help, would be greatly appreciated!

If anybody would like to explore this Mscomm32 thing, happy to help. And, questions, ideas, comments, suggestions are always welcome of course.
VanHelsing
Robot Builder
Robot Builder
User avatar
Posts: 22
Joined: Tue May 30, 2006 1:00 am
Location: Netherlands

Post by inaki » Wed May 31, 2006 9:07 pm

Post by inaki
Wed May 31, 2006 9:07 pm

I would like to see a picture of your plotter please !
I would like to see a picture of your plotter please !
inaki
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 233
Joined: Sun Mar 06, 2005 1:00 am
Location: EH

Post by VanHelsing » Fri Jun 02, 2006 8:44 am

Post by VanHelsing
Fri Jun 02, 2006 8:44 am

I would certainly like to… have a picture ready now after rebuilding it. Unfortunately, don’t have a place to upload it to :(. Could anybody advice me where I can drop it, so I can reference it with an img-tag? Or, would someone be kind enough to put it in this topic after I e-mail it?

Thanks a lot!
I would certainly like to… have a picture ready now after rebuilding it. Unfortunately, don’t have a place to upload it to :(. Could anybody advice me where I can drop it, so I can reference it with an img-tag? Or, would someone be kind enough to put it in this topic after I e-mail it?

Thanks a lot!
VanHelsing
Robot Builder
Robot Builder
User avatar
Posts: 22
Joined: Tue May 30, 2006 1:00 am
Location: Netherlands

Post by Pev » Fri Jun 02, 2006 8:55 am

Post by Pev
Fri Jun 02, 2006 8:55 am

VanHelsing wrote:I would certainly like to… have a picture ready now after rebuilding it. Unfortunately, don’t have a place to upload it to :(. Could anybody advice me where I can drop it, so I can reference it with an img-tag? Or, would someone be kind enough to put it in this topic after I e-mail it?

Thanks a lot!


VanHelsing,

If you look to the left of the formun area you'll see a panel called User Info, and an option within it called Manage File Uploads. If you follow that link you'll find an area you can upload images, photos, movies and code etc and then reference them in your posts.

Hope this helps because like inaki I would love to see the plotter you have built

Pev
VanHelsing wrote:I would certainly like to… have a picture ready now after rebuilding it. Unfortunately, don’t have a place to upload it to :(. Could anybody advice me where I can drop it, so I can reference it with an img-tag? Or, would someone be kind enough to put it in this topic after I e-mail it?

Thanks a lot!


VanHelsing,

If you look to the left of the formun area you'll see a panel called User Info, and an option within it called Manage File Uploads. If you follow that link you'll find an area you can upload images, photos, movies and code etc and then reference them in your posts.

Hope this helps because like inaki I would love to see the plotter you have built

Pev
Carl
-------------------------
www.alt-view.co.uk
Pev
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 547
Joined: Sun Feb 26, 2006 1:00 am
Location: UK

Post by VanHelsing » Fri Jun 02, 2006 9:45 am

Post by VanHelsing
Fri Jun 02, 2006 9:45 am

Thanks for the info. I read the Forum FAQ, and there it said: ’…there is no facility at present for uploading images…’, so I didn’t look any further.

But, here it is:

Image
(barbar, 640x480).

The duck is some powerpoint clipart picture actually drawn some weeks ago. Back then I elongated ‘Arm 1’ a bit with three of those ‘distance shims’ between servo and bracket for more reach. Later I tried a 4 wheeled (driven and steering) plotter, but that wasn’t a big success because of the stacked up tiny slips between wheels and paper, it basically lost track of where it was after some time (the 60 degree ‘dead zone’ wasn’t helpful either).

Anybody with a great idea to increase reach/range and accuracy?
Thanks for the info. I read the Forum FAQ, and there it said: ’…there is no facility at present for uploading images…’, so I didn’t look any further.

But, here it is:

Image
(barbar, 640x480).

The duck is some powerpoint clipart picture actually drawn some weeks ago. Back then I elongated ‘Arm 1’ a bit with three of those ‘distance shims’ between servo and bracket for more reach. Later I tried a 4 wheeled (driven and steering) plotter, but that wasn’t a big success because of the stacked up tiny slips between wheels and paper, it basically lost track of where it was after some time (the 60 degree ‘dead zone’ wasn’t helpful either).

Anybody with a great idea to increase reach/range and accuracy?
Last edited by VanHelsing on Sat Jun 03, 2006 9:44 am, edited 1 time in total.
VanHelsing
Robot Builder
Robot Builder
User avatar
Posts: 22
Joined: Tue May 30, 2006 1:00 am
Location: Netherlands

Post by Pev » Fri Jun 02, 2006 10:11 am

Post by Pev
Fri Jun 02, 2006 10:11 am

This is brilliant and the output looks great - congrats and thanks for sharing the design
This is brilliant and the output looks great - congrats and thanks for sharing the design
Carl
-------------------------
www.alt-view.co.uk
Pev
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 547
Joined: Sun Feb 26, 2006 1:00 am
Location: UK

Post by inaki » Fri Jun 02, 2006 12:02 pm

Post by inaki
Fri Jun 02, 2006 12:02 pm

Cooooool! Impressive! Great! :D

Now I am intrigued, any chance to take a look at the code you used to manage the plotter ? :?
Cooooool! Impressive! Great! :D

Now I am intrigued, any chance to take a look at the code you used to manage the plotter ? :?
inaki
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 233
Joined: Sun Mar 06, 2005 1:00 am
Location: EH

Post by barbar » Fri Jun 02, 2006 2:52 pm

Post by barbar
Fri Jun 02, 2006 2:52 pm

Hi VanHelsing,

Very impressively!

Three short questions:

1. What about Inaki's question concerning the code :D ...?

2. For those who have no VB/VBA-License: Do you think that MSCOMM32.ocx could be replaced by XMComm from http://ourworld.compuserve.com/homepage ... xmcomm.htm ? (Sorry never tried it - just interested - and I'd like go through the using-the-COM-port-lessons in July).

3. Would it be possible for you to replace the 800 x 600 picture by a 640 x 480? I'd like to introduce your plotter to the german forum http://www.roboternetz.de/phpBB2/index.php if you don't mind - concerning the Bioloid its very lonely over there :( (and the forum authorities won't allow larger pictures).

I apologize for the bunch of queries.

Cheers!
barbar
Hi VanHelsing,

Very impressively!

Three short questions:

1. What about Inaki's question concerning the code :D ...?

2. For those who have no VB/VBA-License: Do you think that MSCOMM32.ocx could be replaced by XMComm from http://ourworld.compuserve.com/homepage ... xmcomm.htm ? (Sorry never tried it - just interested - and I'd like go through the using-the-COM-port-lessons in July).

3. Would it be possible for you to replace the 800 x 600 picture by a 640 x 480? I'd like to introduce your plotter to the german forum http://www.roboternetz.de/phpBB2/index.php if you don't mind - concerning the Bioloid its very lonely over there :( (and the forum authorities won't allow larger pictures).

I apologize for the bunch of queries.

Cheers!
barbar
barbar
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 87
Joined: Tue Apr 04, 2006 1:00 am
Location: Germany

Post by inaki » Fri Jun 02, 2006 5:40 pm

Post by inaki
Fri Jun 02, 2006 5:40 pm

One of the good things of Robotis kit is that it can be as well a waiter serving a beer as a plotter drawing a duck !
One of the good things of Robotis kit is that it can be as well a waiter serving a beer as a plotter drawing a duck !
inaki
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 233
Joined: Sun Mar 06, 2005 1:00 am
Location: EH

Post by Pev » Fri Jun 02, 2006 5:50 pm

Post by Pev
Fri Jun 02, 2006 5:50 pm

inaki wrote:One of the good things of Robotis kit is that it can be as well a waiter serving a beer as a plotter drawing a duck !


I agree whole heartedly in fact I think that is the thing about the robotis kit, it really challenges you to think of new designs and applications - hats off to VanHelsing for not only a great design but an unusual concept for a robotics kit.
inaki wrote:One of the good things of Robotis kit is that it can be as well a waiter serving a beer as a plotter drawing a duck !


I agree whole heartedly in fact I think that is the thing about the robotis kit, it really challenges you to think of new designs and applications - hats off to VanHelsing for not only a great design but an unusual concept for a robotics kit.
Carl
-------------------------
www.alt-view.co.uk
Pev
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 547
Joined: Sun Feb 26, 2006 1:00 am
Location: UK

Post by VanHelsing » Sat Jun 03, 2006 9:36 am

Post by VanHelsing
Sat Jun 03, 2006 9:36 am

Thanks for the compliments!

But, since this weekend is filled with non-robotics related stuff I will have to resort to answering the questions of inaki and barbar in a more proper way until after the weekend (sorry).

Q’s:
1. Especially the code is outstanding in user unfriendliness, so it needs a little touch-up.
2. There’s a registry solution for the license of Mscomm32.ocx, will dig it up. No experience with XMComm. Mscomm32.ocx worked for me after the registry solution.
3. Of course, no problem. <strike>Will do ASAP</strike> Done.
Thanks for the compliments!

But, since this weekend is filled with non-robotics related stuff I will have to resort to answering the questions of inaki and barbar in a more proper way until after the weekend (sorry).

Q’s:
1. Especially the code is outstanding in user unfriendliness, so it needs a little touch-up.
2. There’s a registry solution for the license of Mscomm32.ocx, will dig it up. No experience with XMComm. Mscomm32.ocx worked for me after the registry solution.
3. Of course, no problem. <strike>Will do ASAP</strike> Done.
VanHelsing
Robot Builder
Robot Builder
User avatar
Posts: 22
Joined: Tue May 30, 2006 1:00 am
Location: Netherlands

Post by VanHelsing » Wed Jun 07, 2006 10:50 am

Post by VanHelsing
Wed Jun 07, 2006 10:50 am

Weekend took a bit longer :). Here a more detailed answer on question 2 of barbar. (<strike>Q3</strike> Q1 will follow)

I never tried XMComm, and I couldn’t really check it out because I unfortunately get a ‘HTTP 404 ‘ on clicking the link. However, I know that there are more alternatives made for mscomm32.ocx, because MS is very unclear about the license policy (you cant even buy it if you would like to). Still, most users feel that mscomm32 is the most stable of them all.

Here some info on getting it working:

- If you don’t have mscomm32.ocx (search your windows folder, most comps have it) or having trouble licensing it, look at: http://www.yes-tele.com/mscomm.html. They also explain a bit about the confusing licensing policies of MS.

- Summary on how to use mscomm32: http://www.tek-tips.com/faqs.cfm?fid=6191

- Helpful forum about Excel Com port communication http://www.tek-tips.com/viewthread.cfm?qid=560230&page=1. (For license issues see posts of users: MisterCfromIT on 18 Feb 05 12:06 and GVF on1 Nov 05 17:51)

- To monitor what actually goes trough the com port while communicating with your cm-5 use http://www.sysinternals.com/ntw2k/freeware/portmon.shtml (free)
Weekend took a bit longer :). Here a more detailed answer on question 2 of barbar. (<strike>Q3</strike> Q1 will follow)

I never tried XMComm, and I couldn’t really check it out because I unfortunately get a ‘HTTP 404 ‘ on clicking the link. However, I know that there are more alternatives made for mscomm32.ocx, because MS is very unclear about the license policy (you cant even buy it if you would like to). Still, most users feel that mscomm32 is the most stable of them all.

Here some info on getting it working:

- If you don’t have mscomm32.ocx (search your windows folder, most comps have it) or having trouble licensing it, look at: http://www.yes-tele.com/mscomm.html. They also explain a bit about the confusing licensing policies of MS.

- Summary on how to use mscomm32: http://www.tek-tips.com/faqs.cfm?fid=6191

- Helpful forum about Excel Com port communication http://www.tek-tips.com/viewthread.cfm?qid=560230&page=1. (For license issues see posts of users: MisterCfromIT on 18 Feb 05 12:06 and GVF on1 Nov 05 17:51)

- To monitor what actually goes trough the com port while communicating with your cm-5 use http://www.sysinternals.com/ntw2k/freeware/portmon.shtml (free)
VanHelsing
Robot Builder
Robot Builder
User avatar
Posts: 22
Joined: Tue May 30, 2006 1:00 am
Location: Netherlands

Post by barbar » Wed Jun 07, 2006 5:43 pm

Post by barbar
Wed Jun 07, 2006 5:43 pm

VanHelsing,

thank you very much for the useful links!

I went through them (in theory because my bioloid is very far away at present) and think I'll have a very good start in learning com port conversation.

Oh, and sorry for the HTTP 404 ... it worked a week ago.

Thanks as well for the smaller plotter image ... it is linked to the german forum ... and also Pev's short legged hexabot.

Cheers!
barbar
VanHelsing,

thank you very much for the useful links!

I went through them (in theory because my bioloid is very far away at present) and think I'll have a very good start in learning com port conversation.

Oh, and sorry for the HTTP 404 ... it worked a week ago.

Thanks as well for the smaller plotter image ... it is linked to the german forum ... and also Pev's short legged hexabot.

Cheers!
barbar
barbar
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 87
Joined: Tue Apr 04, 2006 1:00 am
Location: Germany

Post by VanHelsing » Sun Jun 11, 2006 6:08 pm

Post by VanHelsing
Sun Jun 11, 2006 6:08 pm

Here the answer to question 1. The VBA code I used is in the following Excel file:

Image
http://robosavvy.com/Builders/VanHelsing/ax-12%20two%20arm%20plotter.xls

I apologize already for the fact that it is absolutely hobbyist code, full of errors and opportunities for better ways to do certain things. So if everything explodes… I didn’t do it, not my fault, 'll deny everything.

Actually, I would really like to hear it when you see an opportunity to improve it.

When you got it working, here some other pictures in portable greyscalemap (*.pgm) (zipped):
http://robosavvy.com/Builders/VanHelsing/some%20pgm%20files.zip

When you didn’t get it working, this is how it was supposed to look like:
http://robosavvy.com/Builders/VanHelsing/plotting.avi

When also that didn’t work, I maybe should mention that the Avi is a divx with mp3 audio (I always have audio decync when I make a wmv)
Here the answer to question 1. The VBA code I used is in the following Excel file:

Image
http://robosavvy.com/Builders/VanHelsing/ax-12%20two%20arm%20plotter.xls

I apologize already for the fact that it is absolutely hobbyist code, full of errors and opportunities for better ways to do certain things. So if everything explodes… I didn’t do it, not my fault, 'll deny everything.

Actually, I would really like to hear it when you see an opportunity to improve it.

When you got it working, here some other pictures in portable greyscalemap (*.pgm) (zipped):
http://robosavvy.com/Builders/VanHelsing/some%20pgm%20files.zip

When you didn’t get it working, this is how it was supposed to look like:
http://robosavvy.com/Builders/VanHelsing/plotting.avi

When also that didn’t work, I maybe should mention that the Avi is a divx with mp3 audio (I always have audio decync when I make a wmv)
VanHelsing
Robot Builder
Robot Builder
User avatar
Posts: 22
Joined: Tue May 30, 2006 1:00 am
Location: Netherlands

Post by Pev » Sun Jun 11, 2006 9:30 pm

Post by Pev
Sun Jun 11, 2006 9:30 pm

Awesome - love the video too
Awesome - love the video too
Carl
-------------------------
www.alt-view.co.uk
Pev
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 547
Joined: Sun Feb 26, 2006 1:00 am
Location: UK

Next
23 postsPage 1 of 21, 2
23 postsPage 1 of 21, 2