Showing posts with label Baum. Show all posts
Showing posts with label Baum. Show all posts

Wednesday, January 21, 2009

JohnMoses....The Presentation Robot

I decided that for my presentation that I wanted a moving Robot, so I took apart LucyLeia and built up another "bumper bug". Once again a different model.

JohnMoses once again has a different way of making the bumpers that he uses to figure out if he has bumped into something. He also has a program in NQC that is different from the past ones used. But I was also able to use the program from Bumper Bug, which he was able to run fine with. So right now, he is sitting with 3 different programs in his brain....waiting to be able to show off...Let's hope that he obeys correctly ;-)



Here is the base of JohnMoses.


Note: The Lego bricks with the wires were later connected to the RCX and his antennas were made longer.

To see the final product and him running about you will need to come to the presentation....Unless I end up feeling generous and posting it afterwards... ;-)

Time Spent Since Last Post: 3 hours 45 minutes
Overall: 43 hours 40 minutes

Wednesday, January 14, 2009

LucyLeia

So yesterday after posting on Luke, I broke him down and built up a new Robot: LucyLeia. Her purpose in life is to sort 1x2 Lego bricks by color. Depending on the color depends on which side she puts them on and what sound she makes.

Here is the main component of her. On the top is the motor, which moves her arm. The next brick with the wire, down is the touch sensor, which allows her to figure out where the holes are in the arm to all the Lego bricks to slide through the arm and move them to one side of her or another. The bottom wire in the picture is the light sensor. It is this sensor that allows her to figure out which color the brick is. The light sensor has a red LED that provides constant light, so by making the dark tunnel, the light sensor readings should be pretty close each time.

Here she is on her stand which allows the bricks to slide down, hit the light sensor, which activates code to move her arm and make the right noise.





Here is a video of her in action. (Make sure that the volume is on so that you can hear her make noise) ;-)




The coding of LucyLeia was in NQC. One of the interesting things about her code that I found, was that Baum took advantage of the NQC code and used "toggle" to move the arm in the opposite direction, after it had dropped the Lego. Because I ran into problems with some of the 1x2 bricks in the Mindstorms set, because of holes, I brought some of my own in. This provided me with the opportunity to use more than two colors of bricks. To see if LucyLeia could tell the colors a part, I programmed her to make certain sounds, depending on the color of the brick.

Time worked since last post: 2 hours 30 minutes
Overall: 26 hours 50 minutes

Tuesday, January 13, 2009

Introducing the one that I shall call Luke

Added an update about him going in circles underneath the first video.
Yesterday after the last post, I began work on a new model of Robot. The purpose behind this robot is pretty similar to the Bumper Bug, he bumps into something, he changes direction. The reason though that I wanted to build this Robot from Baum's book is because to turn the wheels it only takes one motor, unlike the previous ones which would take two. The problem with the robot taking two motors to move is that it takes up all of my motors so then I can't have another one to be able to do other neat features with.

This Robot once again goes with a "three" wheel approach.

The structure on the left is what the back wheels are attached to. By looking inside you can see the gear structure that turns the back wheels.

This is the ratchet, which locks the left wheel up, when going backwards or turning. This allows the robot to be able to turn with only one motor. In the earlier models of the robots, one of the motors would be turned off, when the robot needed to turn.



The finished project.



Videos of him running around...


He seems to enjoy running around in circles.... I think that he might enjoy going around in circles in this video because his front wheel is not pointed straight a head.....


Here he ran himself up the table foot and ended up sitting on his rear.

Time Since last post: 2 hours 10 minutes
Overall: 23 hours 50 minutes

Monday, January 12, 2009

Working NQC Code...With Caleb Tricycle

So exciting news...okay maybe not so exciting...same robot doing same things...but once again with different code.

To code Caleb Tricycle this time, I used the NQC code that was mentioned in the last post. What I enjoy about this code is that it is taking me back to the good old writing of code, not the "dragging and placing" of code. Being able to comment what I was doing, writing the code in Notepad++ :-D



So believe it or not, he was running just fine before I got my camera out...apparently he is camera shy. What I noticed though, when he couldn't find the line was that he just kept going back and forth, then into doing circles. So if I can come up with some brilliant way to get him to realize that he is in the middle of the circle, when he is...then I might add it to the code. But as I have limited time this J-term and more to do, I will probably go on and continue learning, coming back to it if time/or a brilliant idea jumps into my head.

Time Since Last Post: 1 hour 20 minutes
Time for today: 3 hours 20 minutes
Time overall: 21 hours 40 minutes

A new week begins...With new programming environments

This morning I began to download some different environments to program in for the RCX unit. I decided to start with using Not Quite C (NQC), which is described in good detail in Baum's book.

When I first tried to download NQC test code to the RCX unit, I once again received a dreaded IR error, of not being able to transmit. Having received these sort of errors in the Lego environment that came with the Lego set, I began to use the same techniques that I had used there. Starting with the classic trouble shooting technique of restarting the computer. That didn't work. Next up, can I get it to transmit a program to the RCX through the Lego environment. Nope. Check the cable, securely plugged in from what I could tell. Tried restarting the Lego environment with the RCX unit turned on. Once again got no where. And after all of this trouble shooting, what did I figure out? That some how when I am remoted into the computer, I can NOT get the IR transmitter to transmit the programs to the RCX. So that means that I have to go over to the actual server to be able to get it transmit. Hopefully this will be the last post with this problem....

I tried to jump into programming RCX for the current robot that is built, but in looking at the code in the book, I decided that I might need to go do the reading at the beginning of the book, so that I will have a better idea of how to modify it for the line follower design by Knudsen. The biggest difference from what I can tell, is that Knudsen used wheels and Baum used the treads. In many ways I am excited to be getting into NQC because it is putting me back into a good old command line programming interface, versus the Graphical User Interface, which I am having problems completing understanding what I am telling the Robot to do.

Time So far today: 2 hours
Overall: 20 hours 20 minutes (Cool Time!) :-D

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

Tuesday, January 6, 2009

Day 2...More Reading and the beginning of Building :-D

Today was spend doing quite a bit of reading from Baum's book. He does a really good job introducing the RIS.
I will be doing a quick overview of what I learned today from my reading, then I will be showing the beginning of building one of the Robot models in the Knudsen book.



For the RCX (the brain):

  • The programming code is not compiled into an assembly code like you might think. It actually compiled into byte codes that are read by the firmware in the RCX brick. Which makes the RCX able to maintain a safe and reliable environment.
  • The program it can hold 10 tasks, which are a list of instructions for the Robot.
  • Subroutines are a way to call code within a task that you do not want to write directly into a task or that you might want to call over again.
  • The variables that are used in the Lego code, are global and can be used in any task. But the value that it will hold will be the last one that was assigned it.
  • There are three output ports with three modes: on, off, floating. The floating mode means that no energy is going to the motor but that it is allowed to spin freely.
  • Sensors come in two different types with the basic model of the kit: touch and light.
  • The touch sensor has a button that gets pushed in by something and then sends a signal.
  • The light sensor uses a phototransistor in order to sense light. It also can sense colors by this sensor. The light sensors are know to be picky and can cause the need to readjust code in order for it to work properly.
  • The RCX keeps track of time from the moment that it is turned on.
  • The datalog that it can keep can be loaded onto a computer in order to be able to see it.
  • It will automatically shut itself down after a certain amount of time, even if it is running a program.
Now for some pictures of the beginning of the Robot.....
I am following a design in the Knudsen book. I have found the pictures to be helpful in constructing a good base. Although because they are black and white and on regular paper, some of the details can be hard to figure out at first, making you back track with the snapping together of pieces.




Hours Worked: 2.5

Blogger Templates by OurBlogTemplates.com 2007