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

Walking code

Hitec robotics including ROBONOVA humanoid, HSR-8498HB servos, MR C-3024 Controllers and RoboBasic
15 postsPage 1 of 1
15 postsPage 1 of 1

Walking code

Post by chilau » Thu Apr 27, 2006 5:52 pm

Post by chilau
Thu Apr 27, 2006 5:52 pm

Hi

I have had my RN-1 for a week now and was wondering if anyone has managed to improve on the original walking code that comes with the RN-1.
Hi

I have had my RN-1 for a week now and was wondering if anyone has managed to improve on the original walking code that comes with the RN-1.
chilau
Newbie
Newbie
User avatar
Posts: 6
Joined: Sun Apr 23, 2006 1:00 am

Post by Octovir » Fri Apr 28, 2006 12:43 am

Post by Octovir
Fri Apr 28, 2006 12:43 am

i've slowed it down a little in the spots that he shifts, and that seems to stableize some, but otherwise im hoping for some up and coming tutorials to be of great help..
i've slowed it down a little in the spots that he shifts, and that seems to stableize some, but otherwise im hoping for some up and coming tutorials to be of great help..
Octovir
Robot Builder
Robot Builder
User avatar
Posts: 10
Joined: Mon Apr 24, 2006 1:00 am
Location: Here, Now

Re: Walking code

Post by Lomruz » Sat Apr 29, 2006 5:41 pm

Post by Lomruz
Sat Apr 29, 2006 5:41 pm

chilau wrote:Hi

I have had my RN-1 for a week now and was wondering if anyone has managed to improve on the original walking code that comes with the RN-1.



First week eh. I bet you want your RN do more than just take a baby step. You might wish to try this modified OTP where I simply have RN take a few more baby steps :)

http://robosavvy.com/Builders/Lomruz/00_OTP_longerwalk_pushup_keyE&F.bas

I hope it is working :) since I just modified them now but could not test on my RN since I took out the IR to give way for something else.
chilau wrote:Hi

I have had my RN-1 for a week now and was wondering if anyone has managed to improve on the original walking code that comes with the RN-1.



First week eh. I bet you want your RN do more than just take a baby step. You might wish to try this modified OTP where I simply have RN take a few more baby steps :)

http://robosavvy.com/Builders/Lomruz/00_OTP_longerwalk_pushup_keyE&F.bas

I hope it is working :) since I just modified them now but could not test on my RN since I took out the IR to give way for something else.
Lomruz
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 34
Joined: Sat Apr 01, 2006 1:00 am
Location: Seoul, South Korea

Re: Walking code

Post by KurtE » Fri Jun 09, 2006 9:45 pm

Post by KurtE
Fri Jun 09, 2006 9:45 pm

chilau wrote:Hi

I have had my RN-1 for a week now and was wondering if anyone has managed to improve on the original walking code that comes with the RN-1.


So has any one made any major improvements in the walking and turning code? If so would you share?

Thanks
chilau wrote:Hi

I have had my RN-1 for a week now and was wondering if anyone has managed to improve on the original walking code that comes with the RN-1.


So has any one made any major improvements in the walking and turning code? If so would you share?

Thanks
KurtE
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 28
Joined: Thu Apr 13, 2006 1:00 am
Location: Washington State

hi

Post by Chrisbie » Tue Jun 20, 2006 1:31 pm

Post by Chrisbie
Tue Jun 20, 2006 1:31 pm

I love this longer walk and pushups you have shared. But if I run the longer walk, HOW DO YOU STOP IT FROM WALKING... Is there a button to stop it or it will stop after walking a few steps? Please reply...
I love this longer walk and pushups you have shared. But if I run the longer walk, HOW DO YOU STOP IT FROM WALKING... Is there a button to stop it or it will stop after walking a few steps? Please reply...
Chrisbie
Savvy Roboteer
Savvy Roboteer
Posts: 78
Joined: Sat May 27, 2006 1:00 am

Post by Gman » Fri Jun 30, 2006 2:09 pm

Post by Gman
Fri Jun 30, 2006 2:09 pm

Hi all
I thought I'd register and share my code for choosing how many steps Robonova takes, and looping the default walk.
I'm certainly no expert but BASIC is fairly basic after all. Maybe this can help people who are just learning to program.
for/next and if/then are your friends, get to know them if you don't already.
the following is the first changes I've made to the overall template program.

1) First declare these variables with the rest so they can be used

DIM C10 AS BYTE 'counts how many sets of steps
DIM steps AS BYTE 'used in for/next loop with C10

C10 = 1 'set default value at 1 set of steps

2) assign a key to act as the counter input like this
'================================================
k32: ' F
TEMPO 230
MUSIC "D"
C10 = C10 + 1 'add another set of steps C10 default is 1 set of steps

IF C10 > 10 THEN 'If button pressed more than 9 times
TEMPO 230 'Makes a different beep and resets C10 to 1
MUSIC "O1 D" 'So your robot won't run away too far.be carefull near edges!!
C10 = 1
ENDIF
GOTO main_exit
'================================================

3) change forward_walk: to loop the main part like this
'================================================
forward_walk:

SPEED 5
MOVE24 85, 71, 152, 91, 112, 60, 100, 40, 80, , , , 100, 40, 80, , , , 112, 76, 145, 93, 92, 60,

SPEED 14
'left up
MOVE24 90, 107, 105, 105, 114, 60, 90, 40, 80, , , , 100, 40, 80, , , , 114, 76, 145, 93, 90, 60,
'---------------------------------------
FOR steps = 1 TO C10 'loops main part of walk according to value of C10
'---------------------------------------
'left down
MOVE24 90, 56, 143, 122, 114, 60, 80, 40, 80, , , , 105, 40, 80, , , , 113, 80, 145, 90, 90, 60,
MOVE24 90, 46, 163, 112, 114, 60, 80, 40, 80, , , , 105, 40, 80, , , , 112, 80, 145, 90, 90, 60,

SPEED 10
'left center
MOVE24 100, 66, 141, 113, 100, 100, 90, 40, 80, , , , 100, 40, 80, , , , 100, 83, 156, 80, 100, 100,
MOVE24 113, 78, 142, 105, 90, 60, 100, 40, 80, , , , 100, 40, 80, , , , 90, 102, 136, 85, 114, 60,

SPEED 14
'right up
MOVE24 113, 76, 145, 93, 90, 60, 100, 40, 80, , , , 90, 40, 80, , , , 90, 107, 105, 105, 114, 60,

'right down
MOVE24 113, 80, 145, 90, 90, 60, 105, 40, 80, , , , 80, 40, 80, , , , 90, 56, 143, 122, 114, 60,
MOVE24 112, 80, 145, 90, 90, 60, 105, 40, 80, , , , 80, 40, 80, , , , 90, 46, 163, 112, 114, 60,

SPEED 10
'right center
MOVE24 100, 83, 156, 80, 100, 100, 100, 40, 80, , , , 90, 40, 80, , , , 100, 66, 141, 113, 100, 100,
MOVE24 90, 102, 136, 85, 114, 60, 100, 40, 80, , , , 100, 40, 80, , , , 113, 78, 142, 105, 90, 60,

SPEED 14
'left up
MOVE24 90, 107, 105, 105, 114, 60, 90, 40, 80, , , , 100, 40, 80, , , , 113, 76, 145, 93, 90, 60,
'---------------------------------------
NEXT steps 'end of loop
'---------------------------------------
SPEED 5
MOVE24 85, 71, 152, 91, 112, 60, 100, 40, 80, , , , 100, 40, 80, , , , 112, 76, 145, 93, 92, 60,

C10 = 1 'reset to default value 1 set of steps
RETURN
'================================================

this can also be applied to backward_walk: and fast_walk: by looping the appropriate part of the routine.

NOTE: if you apply these changes to fast_walk:
you can delete the local declaration
DIM A10 as BYTE as A10 will no longer be used.
reuse the variables C10 and steps for each walking routine.

have fun and always save a working copy of your program before making changes.
Hi all
I thought I'd register and share my code for choosing how many steps Robonova takes, and looping the default walk.
I'm certainly no expert but BASIC is fairly basic after all. Maybe this can help people who are just learning to program.
for/next and if/then are your friends, get to know them if you don't already.
the following is the first changes I've made to the overall template program.

1) First declare these variables with the rest so they can be used

DIM C10 AS BYTE 'counts how many sets of steps
DIM steps AS BYTE 'used in for/next loop with C10

C10 = 1 'set default value at 1 set of steps

2) assign a key to act as the counter input like this
'================================================
k32: ' F
TEMPO 230
MUSIC "D"
C10 = C10 + 1 'add another set of steps C10 default is 1 set of steps

IF C10 > 10 THEN 'If button pressed more than 9 times
TEMPO 230 'Makes a different beep and resets C10 to 1
MUSIC "O1 D" 'So your robot won't run away too far.be carefull near edges!!
C10 = 1
ENDIF
GOTO main_exit
'================================================

3) change forward_walk: to loop the main part like this
'================================================
forward_walk:

SPEED 5
MOVE24 85, 71, 152, 91, 112, 60, 100, 40, 80, , , , 100, 40, 80, , , , 112, 76, 145, 93, 92, 60,

SPEED 14
'left up
MOVE24 90, 107, 105, 105, 114, 60, 90, 40, 80, , , , 100, 40, 80, , , , 114, 76, 145, 93, 90, 60,
'---------------------------------------
FOR steps = 1 TO C10 'loops main part of walk according to value of C10
'---------------------------------------
'left down
MOVE24 90, 56, 143, 122, 114, 60, 80, 40, 80, , , , 105, 40, 80, , , , 113, 80, 145, 90, 90, 60,
MOVE24 90, 46, 163, 112, 114, 60, 80, 40, 80, , , , 105, 40, 80, , , , 112, 80, 145, 90, 90, 60,

SPEED 10
'left center
MOVE24 100, 66, 141, 113, 100, 100, 90, 40, 80, , , , 100, 40, 80, , , , 100, 83, 156, 80, 100, 100,
MOVE24 113, 78, 142, 105, 90, 60, 100, 40, 80, , , , 100, 40, 80, , , , 90, 102, 136, 85, 114, 60,

SPEED 14
'right up
MOVE24 113, 76, 145, 93, 90, 60, 100, 40, 80, , , , 90, 40, 80, , , , 90, 107, 105, 105, 114, 60,

'right down
MOVE24 113, 80, 145, 90, 90, 60, 105, 40, 80, , , , 80, 40, 80, , , , 90, 56, 143, 122, 114, 60,
MOVE24 112, 80, 145, 90, 90, 60, 105, 40, 80, , , , 80, 40, 80, , , , 90, 46, 163, 112, 114, 60,

SPEED 10
'right center
MOVE24 100, 83, 156, 80, 100, 100, 100, 40, 80, , , , 90, 40, 80, , , , 100, 66, 141, 113, 100, 100,
MOVE24 90, 102, 136, 85, 114, 60, 100, 40, 80, , , , 100, 40, 80, , , , 113, 78, 142, 105, 90, 60,

SPEED 14
'left up
MOVE24 90, 107, 105, 105, 114, 60, 90, 40, 80, , , , 100, 40, 80, , , , 113, 76, 145, 93, 90, 60,
'---------------------------------------
NEXT steps 'end of loop
'---------------------------------------
SPEED 5
MOVE24 85, 71, 152, 91, 112, 60, 100, 40, 80, , , , 100, 40, 80, , , , 112, 76, 145, 93, 92, 60,

C10 = 1 'reset to default value 1 set of steps
RETURN
'================================================

this can also be applied to backward_walk: and fast_walk: by looping the appropriate part of the routine.

NOTE: if you apply these changes to fast_walk:
you can delete the local declaration
DIM A10 as BYTE as A10 will no longer be used.
reuse the variables C10 and steps for each walking routine.

have fun and always save a working copy of your program before making changes.
Last edited by Gman on Fri Jun 30, 2006 3:26 pm, edited 1 time in total.
Gman
Robot Builder
Robot Builder
User avatar
Posts: 15
Joined: Fri Jun 30, 2006 1:00 am
Location: Canada

Post by Gman » Fri Jun 30, 2006 2:10 pm

Post by Gman
Fri Jun 30, 2006 2:10 pm

Hello again

If you have a tilt sensor installed AND the last bit of code is working, you can add these lines.
This will abort the walking sequence and stand up if the robot falls while walking.
And of course you can modify fast_walk: and backward_walk: in the same way also.

1) at the start of main: add this line

IF C10 = 0 THEN C10 = 1 'if walk sequence was aborted reset C10


2) in robot_tilt: under tilt_low: and tilt_high: add
IF A < 30 THEN C10 = 0 'aborts walking loop
IF A > 200 THEN C10 = 0 'aborts walking loop
like this
'================================================
robot_tilt:
A = AD(5)
IF A > 250 THEN RETURN

IF A < 30 THEN GOTO tilt_low
IF A > 200 THEN GOTO tilt_high

RETURN
tilt_low:
A = AD(5)
IF A < 30 THEN C10 = 0 'aborts walking loop
IF A < 30 THEN GOTO backward_standup
RETURN
tilt_high:
A = AD(5)
IF A > 200 THEN C10 = 0 'aborts walking loop
IF A > 200 THEN GOTO forward_standup
RETURN
'================================================

3) Finally forward_walk: should be changed to look like this
'================================================
forward_walk:

SPEED 5
MOVE24 85, 71, 152, 91, 112, 60, 100, 40, 80, , , , 100, 40, 80, , , , 112, 76, 145, 93, 92, 60,

SPEED 14
'left up
MOVE24 90, 107, 105, 105, 114, 60, 90, 40, 80, , , , 100, 40, 80, , , , 114, 76, 145, 93, 90, 60,
'---------------------------------------
FOR steps = 1 TO C10 'loops walk according to value of C10
'---------------------------------------
'left down
MOVE24 90, 56, 143, 122, 114, 60, 80, 40, 80, , , , 105, 40, 80, , , , 113, 80, 145, 90, 90, 60,
MOVE24 90, 46, 163, 112, 114, 60, 80, 40, 80, , , , 105, 40, 80, , , , 112, 80, 145, 90, 90, 60,

SPEED 10
'left center
MOVE24 100, 66, 141, 113, 100, 100, 90, 40, 80, , , , 100, 40, 80, , , , 100, 83, 156, 80, 100, 100,
MOVE24 113, 78, 142, 105, 90, 60, 100, 40, 80, , , , 100, 40, 80, , , , 90, 102, 136, 85, 114, 60,

SPEED 14
'right up
MOVE24 113, 76, 145, 93, 90, 60, 100, 40, 80, , , , 90, 40, 80, , , , 90, 107, 105, 105, 114, 60,

'right down
MOVE24 113, 80, 145, 90, 90, 60, 105, 40, 80, , , , 80, 40, 80, , , , 90, 56, 143, 122, 114, 60,
MOVE24 112, 80, 145, 90, 90, 60, 105, 40, 80, , , , 80, 40, 80, , , , 90, 46, 163, 112, 114, 60,

SPEED 10
'right center
MOVE24 100, 83, 156, 80, 100, 100, 100, 40, 80, , , , 90, 40, 80, , , , 100, 66, 141, 113, 100, 100,
MOVE24 90, 102, 136, 85, 114, 60, 100, 40, 80, , , , 100, 40, 80, , , , 113, 78, 142, 105, 90, 60,

SPEED 14
'left up
MOVE24 90, 107, 105, 105, 114, 60, 90, 40, 80, , , , 100, 40, 80, , , , 113, 76, 145, 93, 90, 60,
'---------------------------------------
GOSUB robot_tilt 'check if still upright
IF C10 = 0 THEN GOTO endfwd 'if robot fell, aborts walking sequence
NEXT steps
'---------------------------------------
SPEED 5
MOVE24 85, 71, 152, 91, 112, 60, 100, 40, 80, , , , 100, 40, 80, , , , 112, 76, 145, 93, 92, 60,

endfwd:
C10 = 1 'default value 1 step
RETURN
'================================================

Hope this is helpfull for learning to program your Robonova-1.

Great forum. Thanks to everyone who has helped me by sharing their experiences!
Hello again

If you have a tilt sensor installed AND the last bit of code is working, you can add these lines.
This will abort the walking sequence and stand up if the robot falls while walking.
And of course you can modify fast_walk: and backward_walk: in the same way also.

1) at the start of main: add this line

IF C10 = 0 THEN C10 = 1 'if walk sequence was aborted reset C10


2) in robot_tilt: under tilt_low: and tilt_high: add
IF A < 30 THEN C10 = 0 'aborts walking loop
IF A > 200 THEN C10 = 0 'aborts walking loop
like this
'================================================
robot_tilt:
A = AD(5)
IF A > 250 THEN RETURN

IF A < 30 THEN GOTO tilt_low
IF A > 200 THEN GOTO tilt_high

RETURN
tilt_low:
A = AD(5)
IF A < 30 THEN C10 = 0 'aborts walking loop
IF A < 30 THEN GOTO backward_standup
RETURN
tilt_high:
A = AD(5)
IF A > 200 THEN C10 = 0 'aborts walking loop
IF A > 200 THEN GOTO forward_standup
RETURN
'================================================

3) Finally forward_walk: should be changed to look like this
'================================================
forward_walk:

SPEED 5
MOVE24 85, 71, 152, 91, 112, 60, 100, 40, 80, , , , 100, 40, 80, , , , 112, 76, 145, 93, 92, 60,

SPEED 14
'left up
MOVE24 90, 107, 105, 105, 114, 60, 90, 40, 80, , , , 100, 40, 80, , , , 114, 76, 145, 93, 90, 60,
'---------------------------------------
FOR steps = 1 TO C10 'loops walk according to value of C10
'---------------------------------------
'left down
MOVE24 90, 56, 143, 122, 114, 60, 80, 40, 80, , , , 105, 40, 80, , , , 113, 80, 145, 90, 90, 60,
MOVE24 90, 46, 163, 112, 114, 60, 80, 40, 80, , , , 105, 40, 80, , , , 112, 80, 145, 90, 90, 60,

SPEED 10
'left center
MOVE24 100, 66, 141, 113, 100, 100, 90, 40, 80, , , , 100, 40, 80, , , , 100, 83, 156, 80, 100, 100,
MOVE24 113, 78, 142, 105, 90, 60, 100, 40, 80, , , , 100, 40, 80, , , , 90, 102, 136, 85, 114, 60,

SPEED 14
'right up
MOVE24 113, 76, 145, 93, 90, 60, 100, 40, 80, , , , 90, 40, 80, , , , 90, 107, 105, 105, 114, 60,

'right down
MOVE24 113, 80, 145, 90, 90, 60, 105, 40, 80, , , , 80, 40, 80, , , , 90, 56, 143, 122, 114, 60,
MOVE24 112, 80, 145, 90, 90, 60, 105, 40, 80, , , , 80, 40, 80, , , , 90, 46, 163, 112, 114, 60,

SPEED 10
'right center
MOVE24 100, 83, 156, 80, 100, 100, 100, 40, 80, , , , 90, 40, 80, , , , 100, 66, 141, 113, 100, 100,
MOVE24 90, 102, 136, 85, 114, 60, 100, 40, 80, , , , 100, 40, 80, , , , 113, 78, 142, 105, 90, 60,

SPEED 14
'left up
MOVE24 90, 107, 105, 105, 114, 60, 90, 40, 80, , , , 100, 40, 80, , , , 113, 76, 145, 93, 90, 60,
'---------------------------------------
GOSUB robot_tilt 'check if still upright
IF C10 = 0 THEN GOTO endfwd 'if robot fell, aborts walking sequence
NEXT steps
'---------------------------------------
SPEED 5
MOVE24 85, 71, 152, 91, 112, 60, 100, 40, 80, , , , 100, 40, 80, , , , 112, 76, 145, 93, 92, 60,

endfwd:
C10 = 1 'default value 1 step
RETURN
'================================================

Hope this is helpfull for learning to program your Robonova-1.

Great forum. Thanks to everyone who has helped me by sharing their experiences!
Gman
Robot Builder
Robot Builder
User avatar
Posts: 15
Joined: Fri Jun 30, 2006 1:00 am
Location: Canada

Post by limor » Fri Jun 30, 2006 2:30 pm

Post by limor
Fri Jun 30, 2006 2:30 pm

thanks for sharing the code :)

Which tilt sensor have you used?
can you please post a picture of how you connected it to the RN1..
thanks for sharing the code :)

Which tilt sensor have you used?
can you please post a picture of how you connected it to the RN1..
limor
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 1845
Joined: Mon Oct 11, 2004 1:00 am
Location: London, UK

Post by Gman » Fri Jun 30, 2006 4:14 pm

Post by Gman
Fri Jun 30, 2006 4:14 pm

It's nice to share

For the tilt sensor I have a 2g buffered accelerometer from dimension engineering.

http://www.dimensionengineering.com/DE-ACCM2G.htm

Sorry I have no camera at the moment to show my work.
but thanks for showing me where to upload when I do get one.

I soldered an old cd audio cable to a 14 pin ic socket
made sure the wires were going to the proper pins
(ground at the outer edge, signal at the inward pin and +voltage in the middle)
I am only using the x axis right now. y axis output is not connected

put the accelerometer into the socket and it fits nicely inside the head behind the LED.
It's held in place with some double sided foam tape

then plug into AD(5) and fine tune the tilt values in the program

My sensor is very sensitive it seems, and I had to change the values to this to get it to work.
IF A < 95 THEN GOTO tilt_low
IF A > 160 THEN GOTO tilt_high


My latest trick is to get the robot to step away when it gets bumped from the front or behind.
but it still needs some work.
Maybe it will act angry if tapped to many times......

This is my first robot with servos and a microcontroller.
I have only built B.E.A.M. robots before this and it has been helpfull for learning all kinds of applicable robot knowledge.

I'm having so much fun with Robonova, can't wait to try adding some sonar or IR for obstacle detection.
It's nice to share

For the tilt sensor I have a 2g buffered accelerometer from dimension engineering.

http://www.dimensionengineering.com/DE-ACCM2G.htm

Sorry I have no camera at the moment to show my work.
but thanks for showing me where to upload when I do get one.

I soldered an old cd audio cable to a 14 pin ic socket
made sure the wires were going to the proper pins
(ground at the outer edge, signal at the inward pin and +voltage in the middle)
I am only using the x axis right now. y axis output is not connected

put the accelerometer into the socket and it fits nicely inside the head behind the LED.
It's held in place with some double sided foam tape

then plug into AD(5) and fine tune the tilt values in the program

My sensor is very sensitive it seems, and I had to change the values to this to get it to work.
IF A < 95 THEN GOTO tilt_low
IF A > 160 THEN GOTO tilt_high


My latest trick is to get the robot to step away when it gets bumped from the front or behind.
but it still needs some work.
Maybe it will act angry if tapped to many times......

This is my first robot with servos and a microcontroller.
I have only built B.E.A.M. robots before this and it has been helpfull for learning all kinds of applicable robot knowledge.

I'm having so much fun with Robonova, can't wait to try adding some sonar or IR for obstacle detection.
Gman
Robot Builder
Robot Builder
User avatar
Posts: 15
Joined: Fri Jun 30, 2006 1:00 am
Location: Canada

Post by robodude666 » Fri Jun 30, 2006 6:07 pm

Post by robodude666
Fri Jun 30, 2006 6:07 pm

Thats cool. So the accelerometer basically outputs what g force its going under? With a maximum of 2g. Interesting how the 5g and 2g both sell for the same price. So with this sensor you can see if the robot just got pushed back/foward. Sort of like a gyro, no?

If you wouldn't mind, could you please use this board image to make an example of how you connected it to the robot? You can upload the picture to RoboSavvy :)

You think it would be possible to use this sensor to detect if the robot has fallen off of a table edge for example? Like if it is falling chest first, it would extend its arms out to take some of the impact so the chest won't get damaged or if its falling back first, it would move hands back so the board won't get damaged, etc.
Thats cool. So the accelerometer basically outputs what g force its going under? With a maximum of 2g. Interesting how the 5g and 2g both sell for the same price. So with this sensor you can see if the robot just got pushed back/foward. Sort of like a gyro, no?

If you wouldn't mind, could you please use this board image to make an example of how you connected it to the robot? You can upload the picture to RoboSavvy :)

You think it would be possible to use this sensor to detect if the robot has fallen off of a table edge for example? Like if it is falling chest first, it would extend its arms out to take some of the impact so the chest won't get damaged or if its falling back first, it would move hands back so the board won't get damaged, etc.
robodude666
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 62
Joined: Sat Jun 17, 2006 1:00 am
Location: Brooklyn, New York

Post by Octovir » Sat Jul 01, 2006 12:02 am

Post by Octovir
Sat Jul 01, 2006 12:02 am

Application: "Cute little tables for lego men " exactly what I needed!

I think i will get that dimensionengineering 3 axis accelerometer.. 3.5-15v, no need for a regulator!

but how would it be implemented into balancing walking? My robonova goes limp if you tell him to do more than one thing at a time(such as play music and stand :roll: ) so i have a feeling he wont be able to check his balance while walking..?

I also got to thinking.. ive got a gyro hooked up, it seems to run as a sort of background process, directly controlling the set servos.. anyway, a gyro's output is similar to an RC receiver's so could a receiver be connected in the gyro's place, and vice versa? And then, could an accelerometer be used in a gyro's place/with the gyro commands to allow direct control of the servos?

Sorry for all the rambling! Eventually i'll learn all this stuff LOL
Application: "Cute little tables for lego men " exactly what I needed!

I think i will get that dimensionengineering 3 axis accelerometer.. 3.5-15v, no need for a regulator!

but how would it be implemented into balancing walking? My robonova goes limp if you tell him to do more than one thing at a time(such as play music and stand :roll: ) so i have a feeling he wont be able to check his balance while walking..?

I also got to thinking.. ive got a gyro hooked up, it seems to run as a sort of background process, directly controlling the set servos.. anyway, a gyro's output is similar to an RC receiver's so could a receiver be connected in the gyro's place, and vice versa? And then, could an accelerometer be used in a gyro's place/with the gyro commands to allow direct control of the servos?

Sorry for all the rambling! Eventually i'll learn all this stuff LOL
Octovir
Robot Builder
Robot Builder
User avatar
Posts: 10
Joined: Mon Apr 24, 2006 1:00 am
Location: Here, Now

Post by Gman » Sat Jul 01, 2006 3:45 am

Post by Gman
Sat Jul 01, 2006 3:45 am

I added connection diagram of the accelerometer and a photo of the finished work to the topic
RN1- 3024 Diagram's for Add-Ons - Please STICKY!
http://robosavvy.com/modules.php?name=F ... =2427#2427

accelerometers can measure tilt and acceleration so it can have many uses for sure. Experiment to your hearts content. However do be carefull when pushing your robot around. Broken robots aren't much fun.
I added connection diagram of the accelerometer and a photo of the finished work to the topic
RN1- 3024 Diagram's for Add-Ons - Please STICKY!
http://robosavvy.com/modules.php?name=F ... =2427#2427

accelerometers can measure tilt and acceleration so it can have many uses for sure. Experiment to your hearts content. However do be carefull when pushing your robot around. Broken robots aren't much fun.
Gman
Robot Builder
Robot Builder
User avatar
Posts: 15
Joined: Fri Jun 30, 2006 1:00 am
Location: Canada

Post by robodude666 » Sat Jul 01, 2006 5:12 am

Post by robodude666
Sat Jul 01, 2006 5:12 am

Thanks. No, broken robots are not fun. Especially when they have a $1,000+ price tag!

What did you mean by that comment?
"if you use both x and y axies a single input pin is required for each axis"

So in that picture it only connects to use the x axis as it is the one connected to the pin where the vcc and gnd is? So if i wanted to use x axis and y axis, i would have to run a wire for vcc and gnd to the col of pins where the y is? and in my script i would have 2 different AD() ? one for x readings and one for y readings? And if it was a 3d accelerometer then i would have to have another set of pins used for the z axis and i would need 3 variables. What sort of values does the accelerometer output? in the manuals it says stuff about volt it outputs.
Thanks. No, broken robots are not fun. Especially when they have a $1,000+ price tag!

What did you mean by that comment?
"if you use both x and y axies a single input pin is required for each axis"

So in that picture it only connects to use the x axis as it is the one connected to the pin where the vcc and gnd is? So if i wanted to use x axis and y axis, i would have to run a wire for vcc and gnd to the col of pins where the y is? and in my script i would have 2 different AD() ? one for x readings and one for y readings? And if it was a 3d accelerometer then i would have to have another set of pins used for the z axis and i would need 3 variables. What sort of values does the accelerometer output? in the manuals it says stuff about volt it outputs.
robodude666
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 62
Joined: Sat Jun 17, 2006 1:00 am
Location: Brooklyn, New York

Post by Gman » Sat Jul 01, 2006 6:41 am

Post by Gman
Sat Jul 01, 2006 6:41 am

The Vcc and Gnd only have to be connected ONCE for the accelerometer.
However, as far as I know 1 AD() port signal pin must be used for each axis signal.

for example
if I have the X-axis and power ( Vcc and Gnd) all connected to AD(5)
I will need to connect the Y-axis signal to AD(4) signal pin
then connect Z-axis signal to AD(3) signal pin ....if you have a Z-axis
or whatever AD ports are free on your robot
no other power ( Vcc and Gnd) connections are required

The diagram shows both axis connected and ready to read
http://robosavvy.com/Builders/Gman/dime ... ometer.jpg
My personal robot only uses the X-axis.

the 2g accelerometer outputs an analog voltage value between 0V and 3V (more like 2.5V in mine, according to one testing session while drinking vodka drinks .....d'oh) depending on tilt or acceleration..


also the full modified template with step counter and auto stop/standup on fall is here
http://robosavvy.com/Builders/Gman/step ... %20OTP.bas

please read the comments and verify robot_voltage: and robot_tilt: settings before loading to your robot!!

If you don't have a tilt sensor... comment all instances of
GOSUB robot_tilt:
Found in Main: forward_walk: backward_walk: and fast_walk:
and the rest should work fine.

Includes a bonus move that you should preview before showing to friends, co-workers, Big Bosses and family. :wink:
It's commented so you'll find it in the code no problem.
The Vcc and Gnd only have to be connected ONCE for the accelerometer.
However, as far as I know 1 AD() port signal pin must be used for each axis signal.

for example
if I have the X-axis and power ( Vcc and Gnd) all connected to AD(5)
I will need to connect the Y-axis signal to AD(4) signal pin
then connect Z-axis signal to AD(3) signal pin ....if you have a Z-axis
or whatever AD ports are free on your robot
no other power ( Vcc and Gnd) connections are required

The diagram shows both axis connected and ready to read
http://robosavvy.com/Builders/Gman/dime ... ometer.jpg
My personal robot only uses the X-axis.

the 2g accelerometer outputs an analog voltage value between 0V and 3V (more like 2.5V in mine, according to one testing session while drinking vodka drinks .....d'oh) depending on tilt or acceleration..


also the full modified template with step counter and auto stop/standup on fall is here
http://robosavvy.com/Builders/Gman/step ... %20OTP.bas

please read the comments and verify robot_voltage: and robot_tilt: settings before loading to your robot!!

If you don't have a tilt sensor... comment all instances of
GOSUB robot_tilt:
Found in Main: forward_walk: backward_walk: and fast_walk:
and the rest should work fine.

Includes a bonus move that you should preview before showing to friends, co-workers, Big Bosses and family. :wink:
It's commented so you'll find it in the code no problem.
Gman
Robot Builder
Robot Builder
User avatar
Posts: 15
Joined: Fri Jun 30, 2006 1:00 am
Location: Canada

Post by Zembot » Thu Aug 24, 2006 2:13 am

Post by Zembot
Thu Aug 24, 2006 2:13 am

Yaaah Gman, it’s just what I wanted! Now my RN can walk and run beyond a few measly steps.

Although I don’t know squat about robobasic, I’ve been having the most fun trying to tweak it. So far I’ve added your Gman step code, Matt’s kung fu (awesome), and Hitec pushup. It just gets better and better yeehaa!

Thanks
Yaaah Gman, it’s just what I wanted! Now my RN can walk and run beyond a few measly steps.

Although I don’t know squat about robobasic, I’ve been having the most fun trying to tweak it. So far I’ve added your Gman step code, Matt’s kung fu (awesome), and Hitec pushup. It just gets better and better yeehaa!

Thanks
Zembot
Robot Builder
Robot Builder
User avatar
Posts: 24
Joined: Wed Aug 16, 2006 1:00 am


15 postsPage 1 of 1
15 postsPage 1 of 1