Walking Robot

by Angela Magee

lego

First I made a robot with Lego. I did a small one from the book. Then I designed my own walking robot. There is a structure that the controller is held up on that has four legs and connections across the middle that the controller sits on. The two motors are underneath the controller, one on each side. Connected to the motors and structure are two gears, one on each side of each motor. The gears are connected to legs.

legoLego model: views from top and sides

lego

Next I started to make the robot with metal with similar design. First I was going to use the Lego motors. So I made a frame and legs with metal ships and screws and nuts. Then Dr. Perkowski changed his mind and said I should just start using servos. I tried to put another metal strip across the top and attach the servos and legs to that but there wasn't enough space for the servos and the legs within the frame. I tried for about a week to rearrange everything but I decided I had to start over. I rebuilt the frame bigger, rebuilt the legs, and connected the servos to separate strips of metal. I put everything together and tried to use the radio controller to make it move. I had modified the servos for continuous rotation earlier but one had burnt out so I had to modify another. Then I was having problems with the legs. Some nuts were unscrewing or getting tighter as it moved so the legs would fall apart. Also, some needed to be tight and loose at the same time for it to move, which wasn't possible. I fixed these problems by either using lock nuts or by putting bearings, which I didn't know existed before, in so that everything that needed to could move and it could still be tight. Another problem I had at the beginning was that the metal strips I used had holes in them already. The holes were in the wrong place and were the wrong size, so they made it harder to make the holes I needed. After that I only used metal strips without holes.

walking robotWalking Robot

walking robotView from side

walking robotView from back

walking robotView from top

I put together a Next Step Basic Stamp kit. This will control the robot. I also put together a board with infrared detectors. I put some of the header pins in upside-down on the Basic Stamp but that still works fine. The servo with the blue plastic gear is connected to pin 1. The servo with the red plastic gear is connected to pin 0. To put together the boards with the infrared detectors I used the diagrams on the packets of IR detectors and emitters, diagrams from the parallax website, and got help from one of the other students. I don't yet know which pins on the Basic Stamp the infrared detectors will be connected to because I have had some problem with getting the infrared detectors to work. There are two infrared detectors, one at each side in the front of the robot. Here is a diagram where I have drawn how they are connected:

diagram

I have also started programming the robot. First I programmed it to move forward. The value for the servos for not moving is 1770. The values for the servos to move forward are 1570 for the servo with the blue gear and 1970 for the servo with the red gear. Before the program is started, the legs are supposed to be all the way up. When the program starts, there is a pause of 5 seconds before anything starts moving. Then it starts moving forward. I also have a program that makes the robot turn when the detectors see something in front of it.

The robot can also be controlled with radio. There is a radio receiver on the robot. The robot can move forward by both legs moving in the same direction. It can turn by the legs moving in opposite directions or by moving one leg. The robot can kick for robot soccer by moving the legs back and forth a little without moving the robot.

walking robot

There are some things that still need to be done on the robot. The detectors need to work. More locknuts need to be added to keep the nuts from coming undone, especially the for the parts that keep the gears in place. There also seems to be a problem with the servo with the blue gear.

Here are the programs for the robot, they are in Basic. First one that just makes the robot move forward, then one that uses the sensors.:

'{$STAMP BS2sx}
'declarations
pulsecount var word
leftIRdet var bit
rightIRdet var bit

'initalization
low 0
low 1

'main routine
main:
pause 5000

forward:
		for pulsecount = 1 to 200
			pulsout 1, 1570
			pulsout 0, 1970
			pause 20
		next
		goto forward


'{$STAMP BS2sx}
'declarations
pulsecount var word
leftIRdet var bit
rightIRdet var bit

'initalization
output 9
output 15
low 0
low 1

'main routine
main:

pause 5000
move:    
	freqout 9, 1, 38500
	leftIRdet = in8            
	freqout 15, 1, 38500 
	rightIRdet = in14
	if leftIRdet = 1 and rightIRdet = 1 then backtrack
	if leftIRdet = 1 then right
	if rightIRdet = 1 then left
		

for pulsecount = 1 to 200
	pulsout 1, 1570
	pulsout 0, 1970
	pause 20
next
goto move

	left:
		gosub backward
		for pulsecount = 1 to 50
			pulsout 1, 1570 
			pulsout 0, 1570
			pause 20
		next
		goto move

	right:
		gosub backward
		for pulsecount = 1 to 50
			pulsout 1, 1970
			pulsout 0, 1970
			pause 20
		next
		goto move

	backtrack:
		gosub backward
		goto right
		
	backward:
		for pulsecount = 1 to 100
			pulsout 1, 1970
			pulsout 0, 1570
			pause 20
		next
		return

Go back to Student Projects
Go back to Dr. Perkowski's web