Objective: To build a robot that simulates the walk of a human being. I consider this to be one of the challenging projects I ever worked on and I am very happy to share this work with you.
Description: I always wanted to build a robot that simulates the walk of a human being with the parts available around. This robot walks with the help of two legs and the third leg (at the center) just for balancing. Balancing the robot with two legs is very challenging and I tried hard to implement in this project but I could not achieve it. I hope in future I would be able to do this. The legs are built to simulate the movement of the thighs and the knees. The string connected to the toe of the each leg is connected to the tin cap which is attached to the servo motor at the back which moves the knee portion of the leg whenever the tin cap rotates. The thighs are attached to different servos which controls it movement individually and separately from the knee portion. I used a photo sensor which is used to start and stop the robot. It took me around 2 months to complete this project and most of the time I spent in search of the parts and design.
How it works: When the 9v battery is inserted the power is on; closing the photo sensor will start the robot motion. The robot starts walking by moving the left and right legs individually. The robot can be stopped by again closing the photo sensor. The video explains better how the robot works.
Parts:
BASIC Stamp Microcontroller: 1 $80 from Radio shack
4 Standard servos
Photo sensor – 1 (to stop and start the robot)
Umbrella strings – 2 (to connect the knee to the tin cap)
Tin cap – 2 (for rotating the Umbrella strings)
CD spindle (for balancing the robot)
Old caterpillar toy for the case and legs
Necessary tools for cutting and drilling holes
1 9V battery for the BASIC Stamp
Programming Language used:
I used the same BASIC STAMP microcontroller used in my previous project (Convert a DVD case to a robot) and hence the same programming language. The basic technique used here is to rotate the servo to the correct angle such that the leg movement is achieved accordingly. Most of the time it is done using trial and error method. Here is the source code for this work:
' {$STAMP BS2}
' {$PBASIC 2.5}
'Author : vijay narayan
'Date Created : 7/29/07
'Date Modified : 8/28/07
'Purpose: program to simulate a walking robot
i VAR Word
time VAR Word
off VAR Byte
cnt VAR Byte
walkCount VAR Byte
'Constants for legs and knee
LeftLeg CON 15
LeftKnee CON 12
RightLeg CON 7
RightKnee CON 4
PhotoSensor CON 2
USSensor CON 1
BaseWheel CON 9
off = 1
cnt = 1
walkCount = 1
PULSOUT BaseWheel, 580
'stand still position
FOR i = 1 TO 10
PULSOUT LeftLeg,650
PULSOUT LeftKnee,650
PULSOUT RightLeg,600
PULSOUT RightKnee,600
PAUSE 10
NEXT
DO
DEBUG HOME, "Walkcount outside ", DEC walkCount, CR
IF walkCount = 3 THEN
DEBUG HOME, "Walkcount inside ", DEC walkCount, CR
walkCount = 1
ENDIF
HIGH PhotoSensor
RCTIME PhotoSensor,1, time
IF time > 700 THEN
IF off = 1 THEN
off = 0
ELSEIF off = 0 THEN
off = 1
cnt = 1
ENDIF
ENDIF
'if off =1 then make it stand still
IF off = 1 THEN
'stand still position
IF cnt = 1 THEN
PULSOUT LeftLeg,650
PULSOUT LeftKnee,650
PULSOUT RightLeg,600
PULSOUT RightKnee,600
cnt = 0
ENDIF
ENDIF
'make the robot walk only of the flag = 0
IF off = 0 THEN
'''''''''''''''''''''''''''''''Left leg movement
FOR i = 650 TO 900
PULSOUT LeftLeg,i
PULSOUT LeftKnee,i 'move up the knee'
NEXT
' 'move the knee from back to front
FOR i = 900 TO 600
PULSOUT LeftKnee,i
NEXT
'bring back the leg to straight position
FOR i = 900 TO 650
PULSOUT LeftLeg,i
NEXT
PULSOUT LeftKnee,650
PULSOUT LeftLeg,650
'This should bring the right leg to the straight position
'''''''''''''''''''''''''''''''Right leg movement
'Move the right leg front
FOR i = 600 TO 350
PULSOUT RightLeg,i
NEXT
'move the knee from back to front
FOR i = 600 TO 650
PULSOUT RightKnee,i
NEXT
PAUSE 100
'bring back the leg to straight position
FOR i = 350 TO 600
PULSOUT RightLeg,i
NEXT
PAUSE 100
PULSOUT RightKnee,580
PULSOUT RightLeg,580
walkCount = walkCount + 1
ENDIF
Pictures:
I would like to share the video. I am having trouble attaching the youtube video here hence I am sharing the link.
Conclusion: This is my second project and I am really proud of this great achievement. I believe this would help people who ever wanted to build a robot that walks. Also I guess this would encourage the beginners who wanted to build robots with the parts available around you. Thanks for your time in reading this and expect to drop your comments.
More robots to come!