My first biped 2.0

This is my first attempt into making a biped walker.  I have no such background in either electronics or robotics.  Nor do i have any experience with tools or crafting. 

My first robot was the start here bot kit that i got from solarbotics.  I had a blast putting it together. While i learned a lot from that kit it made me hungry for more. So for Christmas I got a new Picaxe 28 board and 8 servos and went to work trying to do something else. After a while and many failed attempts to produce something worthwhile i shelved it. I was digging around on youtube and i saw a Lynxmotion robot biped walker. It sparked and interest in me making a walker of my own and i thought i would give it a shot. The above videos are what I came up with after about 3ish hours of work.

The frame is built from 1/8 inch PVC sheets that I cut using a jigsaw and held together with hotglue and screws.  I am currently using zip ties to hold the battery and picaxe board on as I haven't figured out a more permanent solution (I am thinking Velcro.)  As seen in the video above i am using one servo to push a foot up and change the center of balance so when the second foot servo moves it balances the weight over that foot (if that makes any sense)  Then i use the hip servos to move the other leg forward.  Then both leg servos center and then the hips center.  Then it repeats the process over and over. 

This is still very much a work in progress and i am looking for any feed back, comments, or criticism.  Realize that I have little grasp of complicated concepts and have never worked with anything but what is in the start here kit.

 

Update 2/13/12

Just uploaded a video of my newest changes.  I increased the servo move speed to max thanks to a suggestion from merser.  I also added some rubber bands for traction and reduced the hip motion to help with stability.  I am going to look for a permanent solution since I do not like the look or feel on the rubber bands.

 

Update 2/20/12

I took a suggestion from Ro-Bot-X and tried moving the legs in closer to the center of the "waist" and it worked like a charm.  It is now really easy to change the center of balance and it makes walking much smoother.  I also slowed down the walking to Pause 500 in picaxe and that helped stop most of the sliding i was having (some is still there and it still slides hard to the right (as seen in the new video it was going to walk off my desk.))  My next step is to work on left and right turning and some fine tuning of walking straight.  After that i am planning on adding a sensor for object avoidance.  I was thinking ultrasound but i am not sure.  If anyone has any suggestions or feedback i would love to get some.  Thanks.

Sorta walks

  • Actuators / output devices: 4 servos
  • CPU: Picaxe 28
  • Power source: 3 AAA
  • Programming language: Picaxe basic
  • Target environment: indoor flat surfaces

This is a companion discussion topic for the original entry at https://community.robotshop.com/robots/show/my-first-biped-2-0

Great!

Looks like the start of a great project!

Nice! Have you tried

Nice! Have you tried speeding up the motors yet? It walks pretty slowly, but at least it works :wink:

Not gonna lie

I am an absolute noob so I have no idea how to speed up the servos.  Here is the code I am using for the walking motion:

walk:
Wait 1

Servo 1, 205
wait 1
Servo 3, 180
wait 1
servo 5, 100
servo 7, 100
wait 1
servo 3, 145
servo 1, 160
wait 1
servo 5, 155
Servo 7, 140
Wait 1
Servo 3, 100

wait 1
servo 1, 125
wait 1

Servo 5, 200
servo 7, 200
Wait 1
servo 3, 145
servo 1, 160
wait 1
servo 5, 155
Servo 7, 140
wait 1


goto walk

 

That is as complex as i know how to do if you can suggest anything let me know.

Use Pause instead of wait

At the moment you have a 1 second delay between movements. Use Pause (milliseconds) will speed things up. Your servo has a speed rating usually like fractions of a second per 60 degrees turned.

One I have for instance has a rating of .19 seconds per 60 degreees. That is the same as 190 milliseconds to turn 60 degrees. If I want to turn the full 180 degrees that it is capable then that would be 3x190milliseconds or 570 milliseconds.

Always allow a little extra on top to allow for variations between servos. If you cut the delay down too short you will experience wierd behaviour because the servo is unable to reach the commanded position before receiving another movement command.

Also in the end you could get your servos turning at maximum speed they are capable of but need to slow them down because of balance issues in the design.

Whoa

I had no idea.  Thank you so much.

Nice robot! I built a micro

Nice robot! I built a micro biped that looks similar and it walks easier. The key is having the legs closer together. Then it’s easy to move the COG (center of gravity) from one leg to the other. In the code I move the servos in 5 degrees steps with 20ms delay between the steps. I also don’t straighten the legs between 2 walking steps. Take a look at the video to get more ideas. In that video, the robot was taking a left-right step forward then stop to take a sensor reading and continue with another left-right step. I have changed the code so the robot will start with a right-left step and change it after the next sensor reading, making the walking more fluid. I set the speed to medium, but the robot can walk faster without falling. I think I’ll change the code a bit to interpolate intermediar servo positions to be able to move very fast or extremely slow, like doing Thai-Chi.

Another thing you could do is,

move both ankle servos at the same time. Rather than one after the other.

something that will help with your coding, aslo, is to make aliases for the servo numbers/pins. That way you can read your code and know what is going on. Heck, you could even alias your rotation numbers to make it really readable. :slight_smile:

Unfortunately if i move both

Unfortunately if i move both ankle servos at the same time it just stands on its tip toes.   How exactly do I make aliases?  I am not super familiar with coding at all.

Also, :slight_smile:

One more thing, you could set your pause/delay number as a constant and then you would only need to change the number in one place.

alright

the SYMBOL directive/function will allow you to set variable names to numbers.
SYMBOL lefthip = 1
SYMBOL leftankle = 3
etc 

You should also be able to use SYMBOL to set constants

Ok i just did this and it

Ok i just did this and it looks awesome and much more like what i had envisioned it doing.  I will up load a video later.  Thanks a ton. 

Wow that will make it look

Wow that will make it look much cleaner.  Thanks.

It looks like you have done
It looks like you have done a great job here. I think that there are things that we all should learn about making robots and making them actually move. I hope that you can create more in the future.

 

When someone builds their first walking robot with legalization it is really awesome to show it off online so that others can be inspired and get more ideas.

Did you try my code? It is

Did you try my code? It is attached to my robot’s page, in the zip file. You can play with the Speed value to get it to move faster (lower value) or slower (higher value).

Sorry, I didn’t notice you’re using Picaxe…

In this case, open the files in a text editor to see how I defined every move. A Forward Step is defined as a suite of tilts and swings. Same for a turning step. Then each tilt or swing is defined as a for loop. It starts from the curent servo position and increases (or decreases) it by 5 degrees at each pass through the loop until it gets to the destination position. You can step less degrees, say 2 at a time for more smoothness. The Speed variable is used to delay the next servo pulse. If we wait just a little, the servo will gp faster to the desired position, if we wait more, it will go there slowly. In the Picaxe program you will need to use global variables because you can’t pass speed and angle arguments to subroutines (as far as I know…) so I hope you can manage to do it. I’m sorry I can’t help you out more with this, I do not know Picaxe programming.

Okay

I got the jist of what you are saying here and I just tried it out (I did Download and check out your code but it looked greek to me in my noobish ways).  I am now moving the servos at 2 pluse intervals and it moves slower and 5 puls intervals and it moves faster but both methods have far more traction.  It looks like this (I havent cleaned the code up yet)

Right:
Servo 3, 130
servo 1, 150
pause 300
Servo 7, 145
pause 30
Servo 7, 140
pause 30
Servo 7, 135
pause 30
Servo 7, 130
pause 30


servo 1, 170
Servo 3, 150
pause 300




Servo 7, 130
pause 30
Servo 7, 135
pause 30
Servo 7, 140
pause 30
Servo 7, 145
pause 30

servo 7, 150
pause 30

goto Right

 

AND

Right:
Servo 3, 130
servo 1, 150
pause 300
Servo 7, 148
pause 30
Servo 7, 146
pause 30
Servo 7, 144
pause 30
Servo 7, 142
pause 30
Servo 7, 140
pause 30
Servo 7, 138
pause 30
Servo 7, 136
pause 30
Servo 7, 134
pause 30
Servo 7, 132
pause 30
Servo 7, 130
pause 30


servo 1, 170
Servo 3, 150
pause 300




Servo 7, 130
pause 30
Servo 7, 132
pause 30
Servo 7, 134
pause 30
Servo 7, 136
pause 30
Servo 7, 138
pause 30
Servo 7, 140
pause 30
Servo 7, 142
pause 30
Servo 7, 144
pause 30

Servo 7, 146
pause 30
Servo 7, 148
pause 30


servo 7, 150
pause 30

goto Right

Ok, why don’t you use a for

Ok, why don’t you use a for loop? Instead of writing a long list of servo 7, position you can write the for loop like this:

for i = 145 to 130 step -5
       servo 7, i
       pause 20
next i

for i = 130 to 145 step 5
       servo 7, i
       pause 20
next i

 

Now say in the first for loop the robot is tilting right about 15 degrees. You can write a subroutine called Tilt_right_15:

Tilt_right_15:

for i = 145 to 130 step -5
       servo 7, i
       pause 20
next i
return 

 

then another subroutine called Tilt_right_center:

Tilt_right_center:
for i = 130 to 145 step 5
       servo 7, i
       pause 20
next i 

Similar, you can write subroutines for swinging forward. Another thing, it is better to move both feet servos at the same time and both shoulder servos at the same time. For example, if Servo 7 is the right foot and Servo 6 is the left foot, withe the Tilt_right_15 like this:


Tilt_right_15:
for i = 145 to 130 step -5
       servo 7, i
       servo 6, i
       pause 20
next i
return 

 

Then you can wite a subroutine Forward_step:

Forward_step:
       gosub Tilt_right_15
       gosub  Swing_forward_left_40
       gosub  Tilt_right_center
       gosub  Tilt_left_15
       gosub  Swing_forward_right_40
       gosub  Tilt_left_center
       gosub  Tilt_right_15
       gosub  Swing_forward_left_20
       gosub  Tilt_right_center
return

This is similar with the code I wrote for Arduino. Take a look again and play around a bit.

Cheers!

I know this might go overboard, but,

I was wondering if you could pass variables to PICAXE basic subroutines. I forgot that all variables in PICAXE basic are global. You could write a subroutine that tilted right and before calling it set the necessary variables.

SYMBOL tilt = b12
;These SYMBOLs are set just incase 150 isn’t exactly center for your servos
SYMBOL leftFootCenter = 147
SYMBOL leftHipCenter = 151
SYMBOL rightFootCenter = 154
SYMBOL rightHipCenter = 149

Forward_step:
   tilt = 15
   gosub Tilt_right
   tilt = 40
   gosub Swing_forward_left
   …
return

Tilt_right:
   for i = tilt to 0 step -5
   servo 7, leftFootCenter - i
   servo 6, rightFootCenter - i
   pause 20
   next i
return

You may kindly disregard my comment if it seems Greek.

Hehe, that’s exactly what I

Hehe, that’s exactly what I did in my code. I use the center value for each servo and I substract or add the necessary angle for the feet/hips to be in the correct position. But I tried to simplify the code a bit for him to understand it. Not sure I made it simply enough though. Usually, when you talk to people you kind of see what is their level of knowledge and start explaining accordingly. You get immediate feedback and you can adjust the level of your explanation until your message is understood. In a forum is a bit hard to determine that, so I took a shot and hoped for the best. I figure that if I find other people’s code too advanced for my level of understanding, other people will find themselves in my shoes when looking at my code.

Thank you for thaking the next step, as it was hard for me to find how to properly write the code in basic. Funny, a few years ago I was programming in basic, seems that I forgot the sintax and what works and what doesn’t. 

Sorry

Thanks for all the help and good conversation from you and birdmun.  I am picking up a little here and there but i think it is time for me to buckle down and study some basic for picaxe.  Most of everything you guys said was really fuzzy and thats on me not you guys.  I have only programmed the Start Here bot I bought and I learned a little from that project but it seems like it was a drop in the bucket.  So if you will indulge me on question what is the purpose of the "for i =’ in the code.  What does it tell the program to do.