Friday, January 9, 2009

Caleb Tricycle...Different Code...Same purpose....That worked....

Note: There is a picture of the code added to this post....
So before we get to the video, I thought that I would share a picture of what I did to help flatten out a crease in the black line track (which had caused me problems)...The books that are shown there are the books that I have been using to learn about the Lego Robot. That was done while I was on a short break from the studies. It did seem to make a difference.



Here is the video of the working code that was suggest by Baum.



Baum's idea of getting the Robot to follow the line was not to directly follow the black line but the edge of the line. This way the if the sensor got values for the black line, the robot could turn accordingly. Or if the sensor sent values for the white part of the track, it would then turn the other way.



Both of the programs, give me the same result but I did notice that with Baum's algorithm that Caleb Tricycle didn't swing as far out as with Knudsen's algorithm.

Another note...one of the things that I found interesting was that the Robot was still able to run its program, when it began to run off of the mat because the carpet was dark enough...This is at the end of the video.

I worked about 30 minutes organizing the Legos, so that I had a good idea of where to find different pieces.

Time worked since last post: 1 hour
Total for today: 4 hours 10 minutes
Overall: 18 hours 20 minutes

Caleb Tricycle...Different Code...Same purpose....Needs adjustment

So only showing the successful programming code, would be unfair to people...since that is not really real world. I have now have downloaded a piece of code into Caleb Tricycle that does not work...Here are the results.....



I believe that the reason for this problem has to do with the numbers that are used by the robot coming from the light sensor are not set right. Basically, I need to go back and work with Caleb Tricycle to try and achieve numbers that allow him to turn according to what the light sensor says.

Why is this being posted after the successful post about Caleb Tricycle? Because I read in the Baum book about a different algorithm to use for a line follower and decided to try it with my modified Knudsen design. So right now...He just likes to run straight a head.

A quick note about the downloading problem....I am wondering if I am having the problem because the computer is some how getting confused, when I am switching back and forth from remote desktop to directly on the desktop. Just a guess....the last two times I downloaded a program, I was able to download it without restarting the Computer.

Back to program to try and figure out the numbers.

Hours worked since last post: 1 hour 10 minutes
Total for today: 3 hours 10 minutes
Overall: 17 hours 20 minutes

Tricycle...Continued

After reading Baum's book on the design of his line follower, I decided to modify the design of the robot to help keep as much outside light from the sensor as possible this is what I came up with....


I lowered the Light sensor by using a flat Lego piece, I then surround the light sensor with other Legos making sure that they didn't have holes that would allow light in. If they did, I used another flat Lego to cover up the hole. The picture on the far left shows what I ended up using to block out the light, I had run out of the wrap around Lego pieces that I used in the right picture, because I had used one to let the light sensor point down. The picture in the middle is what it looked like before.

I followed the program that was set out in Knudsen's book. The numbers in this picture are not the numbers I ended up using with the program, I started out with the numbers that are given in the book. Then adjusted them as I saw when using a guided mode in the Programming environment.


I once again ran into a problem of getting the program to download to the RCX, this time I decided to restart the computer and make sure that the RCX was on near the beginning of bringing up the program on the machine. It then transferred just fine and allowed me to use a mode to test the code to find out numbers that I needed to be able to tell when the sensor was picking up dark verse light. I was also able download the program a couple of times in order make adjustments to the numbers.

After watching the program run on the Robot, I had the thought that his back wheel reminded me of a dog's tail. I decided then that I should adjust his name to Caleb Tricycle...since Caleb means dog. So here is Caleb Tricycle running...including running off of the mat with the black trail that it is following. The mat came with the Lego Set.


Hours worked today: 2 hours
Hours overall: 16 hours 10 minutes

Blogger Templates by OurBlogTemplates.com 2007