Walking robot problems

Jakerader

New Member
hi guys im using a picaxe AXE230 microcontroller and ive hooked it up to three servos nad a battery pack, the board works fine, its just the robot won't walk forward it will only march on the spot, here is the code i am using i got this code from http://letsmakerobots.com/node/29379, it for some reason wont walk forward, please tell me if i need to change anything about the code, heere is the code:
symbol lfoot = 1 ' set the pin number for servo
symbol rfoot = 4 ' set the pin number for servo
symbol balance =2 ' set the pin number for servo
symbol round = b6 ' variable used to loop one left + right footstep
Symbol LFoo = b0 LFoo = 120 ' Set and initiate feet twister variable
symbol balanservo = b3 balanservo = 166 ' Set and initiate balance variable (10 more than optimal balance / middle for the balance servo)

servo lfoot, LFoo ' initiate servo
servo rfoot, LFoo ' initiate servo
servo balance, balanservo ' initiate servo

symbol speed = 1' set to higher for slower walking
wait 5 ' wait for the robot to be placed on ground before moving


main:
for round = 1 to 120 ' main variable to dictate all action flow
select case round
case 1 to 60
inc lfoo

if round < 15 then
balanservo = balanservo +1
endif
if round > 40 and round < 50 then
balanservo = balanservo -2
endif
if round> 49 then
balanservo = balanservo -1
endif

case 61 to 120
dec lfoo

if round < 75 then
balanservo = balanservo -1
endif
if round > 100 and round < 110 then
balanservo = balanservo +2
endif
if round > 109 then
balanservo = balanservo +1
endif

end select

' Set servos:
servopos balance, balanservo
servopos lfoot, lfoo
servopos rfoot, lfoo
pause speed
next round
goto main



can you see any reason why it would not walk forward?its got legs.jpg
its not fully built it still needs neck and battery head, haha
 

neiltechspec

Senior Member
Looking at the video, I suspect its because you haven't got the weight balance right, i.e missing the neck & battery head.
 

John West

Senior Member
I used it once, but please don't tell anyone! I promise I won't do it again! I'll go back to using SNOBOL. Honest! :)
 

Jakerader

New Member
nah my battery pack broke i have to wait till wednesday to solder it all back up, but i thought i could try sometbing else in the meantime.
 

srnet

Senior Member
nah my battery pack broke i have to wait till wednesday to solder it all back up, but i thought i could try sometbing else in the meantime.
If you read the thread describing the robot, its clear the batteries are used as a counter balance and are necessary to make it wobble, then walk.
 

Jakerader

New Member
has anyone used a SRF05 sensor before, if so please could u tell me how to add it to this code:
Code:
symbol lfoot = 1 ' set the pin number for servo
symbol rfoot = 4 ' set the pin number for servo
symbol balance =2 ' set the pin number for servo
symbol round = b6 ' variable used to loop one left + right footstep
Symbol LFoo = b0 LFoo = 120 ' Set and initiate feet twister variable
symbol balanservo = b3 balanservo = 166 ' Set and initiate balance variable (10 more than optimal balance / middle for the balance servo)

servo lfoot, LFoo ' initiate servo
servo rfoot, LFoo ' initiate servo
servo balance, balanservo ' initiate servo

symbol speed = 1' set to higher for slower walking
wait 5 ' wait for the robot to be placed on ground before moving


main:
for round = 1 to 120 ' main variable to dictate all action flow
select case round
case 1 to 60
inc lfoo

if round < 15 then
balanservo = balanservo +1
endif
if round > 40 and round < 50 then
balanservo = balanservo -2
endif
if round> 49 then
balanservo = balanservo -1
endif

case 61 to 120
dec lfoo

if round < 75 then
balanservo = balanservo -1
endif
if round > 100 and round < 110 then
balanservo = balanservo +2
endif
if round > 109 then
balanservo = balanservo +1
endif

end select

' Set servos:
servopos balance, balanservo
servopos lfoot, lfoo
servopos rfoot, lfoo
pause speed
next round
goto main
 
Last edited by a moderator:

rossko57

Senior Member
First, decide what you would like to happen in response to which SRF05 information. Stop, fall over, turn right ?
Then think about inserting into your code loop to
Read the sensor
Based on ther sensor result, do this or do that
 

eclectic

Moderator
Wouldn't it be best to solve the
movement problem from your other thread first?
In the meantime, look at the instructions for the SRF005
and decide
a. What you want it to do.
b. Where in the program it computes distance.
 

Jakerader

New Member
yh its just i want something to do before i get home from holiday, becuase i was going to build my robot this week but i broke my battery pack and i won't be able to fix it untill wednesday, haha
 

Jakerader

New Member
hi please could you watch this video, i am making this robot and i have come across this, is this a problem or does it really matter, when the right servo is in the air, the middle one is flat against both of the servos, but when the left servo is in the air, the middle servo is diagonallly touching both the right and left servos, watch the video to understand, either comment on the video or back on here, here is the link for the video: http://www.youtube.com/watch?v=MZg50gkjmBM
 
Top