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

C Coding

Korean company maker of Robot kits and servos designed for of articulated robots. Re-incarnation of Megarobotics.
57 postsPage 3 of 41, 2, 3, 4
57 postsPage 3 of 41, 2, 3, 4

Post by Joe » Tue Feb 24, 2009 7:11 pm

Post by Joe
Tue Feb 24, 2009 7:11 pm

Perhaps it would be helpful to start a Wiki for technical details about RoboBuilder? That might make it easier for us all to pool our knowledge, and for newcomers to catch up. I would be happy to contribute what I learn.

Best,
- Joe
Perhaps it would be helpful to start a Wiki for technical details about RoboBuilder? That might make it easier for us all to pool our knowledge, and for newcomers to catch up. I would be happy to contribute what I learn.

Best,
- Joe
Joe
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 204
Joined: Tue Sep 05, 2006 1:00 am

Post by Joe » Tue Feb 24, 2009 11:40 pm

Post by Joe
Tue Feb 24, 2009 11:40 pm

l3v3rz wrote:http://robosavvy.com/Builders/l3v3rz/robobuilder_0_3.zip

l3v3rz, can you describe what this program is supposed to do once it's loaded and run? I'd like to verify that I've built and installed it correctly, but when I turn on my RBC after doing so, the little guy just sits there... no LEDs on and all servos limp. Does it need an IR remote input, or should it do something on its own?

Getting there bit by bit,
— Joe
l3v3rz wrote:http://robosavvy.com/Builders/l3v3rz/robobuilder_0_3.zip

l3v3rz, can you describe what this program is supposed to do once it's loaded and run? I'd like to verify that I've built and installed it correctly, but when I turn on my RBC after doing so, the little guy just sits there... no LEDs on and all servos limp. Does it need an IR remote input, or should it do something on its own?

Getting there bit by bit,
— Joe
Joe
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 204
Joined: Tue Sep 05, 2006 1:00 am

Post by l3v3rz » Tue Feb 24, 2009 11:44 pm

Post by l3v3rz
Tue Feb 24, 2009 11:44 pm

Press the red button on your IR controller - it should go to basic pose if working. It should also display a welcome message on your serial port - so connect a terminal to it (I use latest version of putty on windows).
Press the red button on your IR controller - it should go to basic pose if working. It should also display a welcome message on your serial port - so connect a terminal to it (I use latest version of putty on windows).
l3v3rz
Savvy Roboteer
Savvy Roboteer
Posts: 473
Joined: Fri Jul 18, 2008 2:34 pm

Post by l3v3rz » Tue Feb 24, 2009 11:46 pm

Post by l3v3rz
Tue Feb 24, 2009 11:46 pm

Beware in this version of you get to close your robot punches to the left !! new version disable behaviour by default until you press 'r'.

just loaded 0.5 -
http://robosavvy.com/Builders/l3v3rz/robos-0.5.zip

New features:
After initialisation Red Button on IR - and then type h for help (on terminal) !!
Help
L left
R right
F forward
B back
z tilt on/off - to try the autobalance hit z (and turn it off z again!) - don't do near edge of table - suggest have 'r' in off mode as well in case you trigger a behaviour
i ADC test (PSD, Mic, Bat Level) - good for test and debugging
t Tilt test (loop showing accelerometer values until IR pressed
p Basic pose - set him upright
w lean fwd
s lean back
a lean left [not implemented yet]
d lean right [not implmented yet]
v version number (say 0.5)
m modify param [n][+|-|=] [nn]
r respond to event on/off - Robo will start behaving (or is that misbehaving !) - try a clap or push your hand in its face and see what happens !
l light flash test (this doesn't work - anyone tell me why??
nn action nn (two digits) - try 17 for a wave (18 motions built in including soccer kicks (10,11) and side step (12,13)

Have fun !!

BTW - I'm also working on a C# program that drives robos via the com port. The program is linked to a webcam and Im using Aforge.net library for image processing. Thats why all robos features can be access via serial commands.
Beware in this version of you get to close your robot punches to the left !! new version disable behaviour by default until you press 'r'.

just loaded 0.5 -
http://robosavvy.com/Builders/l3v3rz/robos-0.5.zip

New features:
After initialisation Red Button on IR - and then type h for help (on terminal) !!
Help
L left
R right
F forward
B back
z tilt on/off - to try the autobalance hit z (and turn it off z again!) - don't do near edge of table - suggest have 'r' in off mode as well in case you trigger a behaviour
i ADC test (PSD, Mic, Bat Level) - good for test and debugging
t Tilt test (loop showing accelerometer values until IR pressed
p Basic pose - set him upright
w lean fwd
s lean back
a lean left [not implemented yet]
d lean right [not implmented yet]
v version number (say 0.5)
m modify param [n][+|-|=] [nn]
r respond to event on/off - Robo will start behaving (or is that misbehaving !) - try a clap or push your hand in its face and see what happens !
l light flash test (this doesn't work - anyone tell me why??
nn action nn (two digits) - try 17 for a wave (18 motions built in including soccer kicks (10,11) and side step (12,13)

Have fun !!

BTW - I'm also working on a C# program that drives robos via the com port. The program is linked to a webcam and Im using Aforge.net library for image processing. Thats why all robos features can be access via serial commands.
l3v3rz
Savvy Roboteer
Savvy Roboteer
Posts: 473
Joined: Fri Jul 18, 2008 2:34 pm

Post by Joe » Wed Feb 25, 2009 12:30 am

Post by Joe
Wed Feb 25, 2009 12:30 am

l3v3rz wrote:Beware in this version of you get to close your robot punches to the left !!

I'm pretty sure my robot won't do that — it doesn't have a distance sensor!

l3v3rz wrote:just loaded 0.5 -
http://robosavvy.com/Builders/l3v3rz/robos-0.5.zip

New features:
After initialisation Red Button on IR - and then type h for help (on terminal) !!

Sounds great! I'll keep the serial cable hooked up and give it a try.

Any idea how hard it would be to make it use the BT module instead of the serial port?

This sounds like a really great test program — can't wait to dig into it!

Best,
— Joe
l3v3rz wrote:Beware in this version of you get to close your robot punches to the left !!

I'm pretty sure my robot won't do that — it doesn't have a distance sensor!

l3v3rz wrote:just loaded 0.5 -
http://robosavvy.com/Builders/l3v3rz/robos-0.5.zip

New features:
After initialisation Red Button on IR - and then type h for help (on terminal) !!

Sounds great! I'll keep the serial cable hooked up and give it a try.

Any idea how hard it would be to make it use the BT module instead of the serial port?

This sounds like a really great test program — can't wait to dig into it!

Best,
— Joe
Joe
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 204
Joined: Tue Sep 05, 2006 1:00 am

Post by Joe » Wed Feb 25, 2009 1:19 am

Post by Joe
Wed Feb 25, 2009 1:19 am

It works!!! When I press the Home button on the controller, my bot straightens up, and then begins madly punching left over and over. :) (This because my bot lacks a distance sensor — I'm not too worried about that, especially since version 0.5 has that behavior off by default.)

I'll try to post my downloader tool tonight, and if I have more time after that, I'll load 0.5 and hook up a terminal program to it.

Thanks again for your code... hopefully I'll be able to contribute something soon!
[/b]
It works!!! When I press the Home button on the controller, my bot straightens up, and then begins madly punching left over and over. :) (This because my bot lacks a distance sensor — I'm not too worried about that, especially since version 0.5 has that behavior off by default.)

I'll try to post my downloader tool tonight, and if I have more time after that, I'll load 0.5 and hook up a terminal program to it.

Thanks again for your code... hopefully I'll be able to contribute something soon!
[/b]
Joe
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 204
Joined: Tue Sep 05, 2006 1:00 am

Post by l3v3rz » Wed Feb 25, 2009 1:24 am

Post by l3v3rz
Wed Feb 25, 2009 1:24 am

Great news !

No PSD sensor - good point :) Mine was included in free with 5710 kit (from Robosavy).

I think the bluetooth looks just like PC terminal input (i.e. on USART1) - so the program won't know the difference. Interested to hear how you get on though.

The autobalance is very crude at the moment and only works in the z axis, but its quite fun. Put your robot on a flat surface - like a big book, press 'z' and then slowly raise one end of the book, either the one it facing or the opposite end, as the slope inclines, your robot will bend its knees (servos 2 and 7) to keep itself in an upright position. Then slowly lower ad it will straighten. If it gets lopsided, level the book and press p to reset to basic pose.

cheers
Great news !

No PSD sensor - good point :) Mine was included in free with 5710 kit (from Robosavy).

I think the bluetooth looks just like PC terminal input (i.e. on USART1) - so the program won't know the difference. Interested to hear how you get on though.

The autobalance is very crude at the moment and only works in the z axis, but its quite fun. Put your robot on a flat surface - like a big book, press 'z' and then slowly raise one end of the book, either the one it facing or the opposite end, as the slope inclines, your robot will bend its knees (servos 2 and 7) to keep itself in an upright position. Then slowly lower ad it will straighten. If it gets lopsided, level the book and press p to reset to basic pose.

cheers
l3v3rz
Savvy Roboteer
Savvy Roboteer
Posts: 473
Joined: Fri Jul 18, 2008 2:34 pm

Post by Joe » Wed Feb 25, 2009 5:13 am

Post by Joe
Wed Feb 25, 2009 5:13 am

I'm trying your 0.5 code now. When I initialize the robot with the Home button on the IR, it starts displaying a bunch of stuff like this:

Code: Select all
0:1:6-201 PSD event 0078

0:1:6-255 PSD event 0078

0:1:6-308 PSD event 0078

0:1:6-362 PSD event 0079

0:1:6-416 PSD event 0078

It still responds to things like [h]elp, [v]ersion, etc., but I can't seem to find a way to turn this repeated event reporting off. Any tips?

Then, I tried [r]espond, and it printed this:

Code: Select all
r0:1:7-392 Response (0000)

0:1:7-445 PSD event 0076

~~x~ˇ~~xpp`@@`b~xp0`


That's a bunch of non-ASCII data at the end there. At that point, the robot went completely dead.

And now I can't seem to resurrect it — even after turning it off for several seconds and turning it back on again, none of the LEDs light briefly, and it no longer responds to the IR remote. Even the bootloader appears broken, as it no longer sends "^" when the device is reset. It acts for all the world like a brick.

But I doubt the ATmega128 could have bricked itself just running normal user code... any idea what could be going on here?

Thanks,
— Joe
I'm trying your 0.5 code now. When I initialize the robot with the Home button on the IR, it starts displaying a bunch of stuff like this:

Code: Select all
0:1:6-201 PSD event 0078

0:1:6-255 PSD event 0078

0:1:6-308 PSD event 0078

0:1:6-362 PSD event 0079

0:1:6-416 PSD event 0078

It still responds to things like [h]elp, [v]ersion, etc., but I can't seem to find a way to turn this repeated event reporting off. Any tips?

Then, I tried [r]espond, and it printed this:

Code: Select all
r0:1:7-392 Response (0000)

0:1:7-445 PSD event 0076

~~x~ˇ~~xpp`@@`b~xp0`


That's a bunch of non-ASCII data at the end there. At that point, the robot went completely dead.

And now I can't seem to resurrect it — even after turning it off for several seconds and turning it back on again, none of the LEDs light briefly, and it no longer responds to the IR remote. Even the bootloader appears broken, as it no longer sends "^" when the device is reset. It acts for all the world like a brick.

But I doubt the ATmega128 could have bricked itself just running normal user code... any idea what could be going on here?

Thanks,
— Joe
Joe
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 204
Joined: Tue Sep 05, 2006 1:00 am

Post by Joe » Wed Feb 25, 2009 5:22 am

Post by Joe
Wed Feb 25, 2009 5:22 am

Hum — looks like the battery is simply out of juice. I didn't expect that so soon, but in retrospect I guess I did have it on a lot today with all the serial comm tests. The bot works properly when plugged in to the power adapter, and I popped the case open and measured the voltage on the battery pack at 1.65 v.

So... what's the word on recharging the batteries while the custom software is installed? Is this doable, or do I need to reinstall the standard firmware for each recharge?

Thanks,
— Joe
Hum — looks like the battery is simply out of juice. I didn't expect that so soon, but in retrospect I guess I did have it on a lot today with all the serial comm tests. The bot works properly when plugged in to the power adapter, and I popped the case open and measured the voltage on the battery pack at 1.65 v.

So... what's the word on recharging the batteries while the custom software is installed? Is this doable, or do I need to reinstall the standard firmware for each recharge?

Thanks,
— Joe
Joe
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 204
Joined: Tue Sep 05, 2006 1:00 am

Post by l3v3rz » Wed Feb 25, 2009 9:24 am

Post by l3v3rz
Wed Feb 25, 2009 9:24 am

The simplest way is to edit the dio.c module and put and ifdef around the psd check lines:

// -------------------------------------------------------------------------------------------------------
// Simple behaviour
// -------------------------------------------------------------------------------------------------------

#ifdef PSD_SENSOR

if (adc_psd()>params[PSDL]) // if PSD sensor goes off
{
ptime(); rprintf("PSD event %x\r\n", psd_value);
etc .....
}
#endif

You could also just set params[PSDL] to above 0x78 in main.c

either will work

Battery charging - not looked at - I'm sure its possible - I run my on mains when I'm playing at the moment - next version I guess.

cheers
The simplest way is to edit the dio.c module and put and ifdef around the psd check lines:

// -------------------------------------------------------------------------------------------------------
// Simple behaviour
// -------------------------------------------------------------------------------------------------------

#ifdef PSD_SENSOR

if (adc_psd()>params[PSDL]) // if PSD sensor goes off
{
ptime(); rprintf("PSD event %x\r\n", psd_value);
etc .....
}
#endif

You could also just set params[PSDL] to above 0x78 in main.c

either will work

Battery charging - not looked at - I'm sure its possible - I run my on mains when I'm playing at the moment - next version I guess.

cheers
l3v3rz
Savvy Roboteer
Savvy Roboteer
Posts: 473
Joined: Fri Jul 18, 2008 2:34 pm

Post by i-Bot » Wed Feb 25, 2009 1:19 pm

Post by i-Bot
Wed Feb 25, 2009 1:19 pm

I saw this and wondered if it was an alternative to Procyon AVRlib and a more structured basis for the Robobuilder library.

http://piconomic.berlios.de/main.html

Or you might look at libavr and libbioloid from Matt in the bioloid forum.

Richard
I saw this and wondered if it was an alternative to Procyon AVRlib and a more structured basis for the Robobuilder library.

http://piconomic.berlios.de/main.html

Or you might look at libavr and libbioloid from Matt in the bioloid forum.

Richard
i-Bot
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 1142
Joined: Wed May 17, 2006 1:00 am

Post by Joe » Thu Feb 26, 2009 5:23 am

Post by Joe
Thu Feb 26, 2009 5:23 am

l3v3rz wrote:l light flash test (this doesn't work - anyone tell me why??

I think it's because you don't have any delay between turning the light on, and turning it off again:

Code: Select all
      for (i=0; i<20; i++) {
         PF1_LED1_OFF;
         _delay_ms(250);
         PF1_LED1_ON;
      }


Insert another _delay_ms after the PF1_LED1_ON, and it works.

Cheers,
— Joe
l3v3rz wrote:l light flash test (this doesn't work - anyone tell me why??

I think it's because you don't have any delay between turning the light on, and turning it off again:

Code: Select all
      for (i=0; i<20; i++) {
         PF1_LED1_OFF;
         _delay_ms(250);
         PF1_LED1_ON;
      }


Insert another _delay_ms after the PF1_LED1_ON, and it works.

Cheers,
— Joe
Joe
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 204
Joined: Tue Sep 05, 2006 1:00 am

Post by Joe » Thu Feb 26, 2009 5:39 am

Post by Joe
Thu Feb 26, 2009 5:39 am

I've been exploring your code and experimenting with the bot. Really great stuff! But I have some questions:

1. In comm.c, I see that the guts of PosRead have been entirely commented out, and it's just calling through to PosMove. Did you do that, or did it come that way from RoboBuilder? And how is this able to read the position of a servo without also changing it?

2. If I wanted to do my own motion capture, how would I set a servo "limp" so that it can be positioned manually?

3. Do you know how we can read other information from the servos besides their position? For example, their current holding torque?

That last point is of special interest to me, because I think that by measuring the torque in the leg servos, we can tell how the bot's weight is distributed, which (in conjunction with the acceleration sensor) will make dynamic balance a lot easier.

Thanks,
— Joe
I've been exploring your code and experimenting with the bot. Really great stuff! But I have some questions:

1. In comm.c, I see that the guts of PosRead have been entirely commented out, and it's just calling through to PosMove. Did you do that, or did it come that way from RoboBuilder? And how is this able to read the position of a servo without also changing it?

2. If I wanted to do my own motion capture, how would I set a servo "limp" so that it can be positioned manually?

3. Do you know how we can read other information from the servos besides their position? For example, their current holding torque?

That last point is of special interest to me, because I think that by measuring the torque in the leg servos, we can tell how the bot's weight is distributed, which (in conjunction with the acceleration sensor) will make dynamic balance a lot easier.

Thanks,
— Joe
Joe
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 204
Joined: Tue Sep 05, 2006 1:00 am

Post by l3v3rz » Thu Feb 26, 2009 10:12 am

Post by l3v3rz
Thu Feb 26, 2009 10:12 am

Thanks about the light flash - can't believe I missed that ! I think I was looking for a complex explanation (is the port set up correctly) when it was straightforward. as to your questions
1. yes that my code - I modified the original code so I could both read and write to the servo. Its the same sequence but read uses a '5' rather han a 0-4 torque setting. You also supply a target postion which is ignored in the read command

2. Yes you can make them go limp - which is what motion builder does. Its a very similar command but you put it int passive mode. see P37 ofthe wCK module manual

3. I think so - but the PosRead command should return 2 bytes, the load and the position, but I was only seeing the pos - but it might be the code that was wrong.

Its all the manual - you can download freely from the robobuilder.net website you just need to register.

How about if we load the src into Google Project then we can contribute??

Plus it seems to offer issues log and wiki types pages ?
Thanks about the light flash - can't believe I missed that ! I think I was looking for a complex explanation (is the port set up correctly) when it was straightforward. as to your questions
1. yes that my code - I modified the original code so I could both read and write to the servo. Its the same sequence but read uses a '5' rather han a 0-4 torque setting. You also supply a target postion which is ignored in the read command

2. Yes you can make them go limp - which is what motion builder does. Its a very similar command but you put it int passive mode. see P37 ofthe wCK module manual

3. I think so - but the PosRead command should return 2 bytes, the load and the position, but I was only seeing the pos - but it might be the code that was wrong.

Its all the manual - you can download freely from the robobuilder.net website you just need to register.

How about if we load the src into Google Project then we can contribute??

Plus it seems to offer issues log and wiki types pages ?
l3v3rz
Savvy Roboteer
Savvy Roboteer
Posts: 473
Joined: Fri Jul 18, 2008 2:34 pm

Post by l3v3rz » Thu Feb 26, 2009 11:42 am

Post by l3v3rz
Thu Feb 26, 2009 11:42 am

This is now a google project

Please see :-

http://code.google.com/p/robobuilderlib/
This is now a google project

Please see :-

http://code.google.com/p/robobuilderlib/
l3v3rz
Savvy Roboteer
Savvy Roboteer
Posts: 473
Joined: Fri Jul 18, 2008 2:34 pm

PreviousNext
57 postsPage 3 of 41, 2, 3, 4
57 postsPage 3 of 41, 2, 3, 4