Showing posts with label subroute. Show all posts
Showing posts with label subroute. Show all posts

Thursday, January 8, 2009

Second Robot: Tricycle built for Line Followin'

So after Success with the Bumper bug...I read some more in the books and saw what they had to say. I like the Knudsen book best, I think, because it does a good job of getting you active and then explaining higher concepts, behind design and mechanics of building good robots. So in reading some more from it in after building bumper bug, I found that it was repeating some of what I had already read in the introduction of the Baum book. I also looked at the Baum book on what they had to say on building a bumper robot (one that knows to back up and try a different direction). The concepts were pretty close to the same although they had taken a slightly different route making the bumper and also had example code in another programming environment, which I am planning on coming back to for my final project.


I then moved on to building a new robot....which meant that there was some slight sadness as bumper bug had to be dismantled, in order to get the RCX and other parts that I had used on it. I am once again in the Knudsen book, following their building and programming guide

Here is the what I am calling the Tricycle at one of his beginning stages:

He has gotten his free movin' leg attached, but no motors. The white wheel object is part of what was left at the time of bumper bug, it is connected to part of the base that I had taken the RCX unit off of and hadn't need to fully get into other of its parts.


What Tricycle looked like most of the time while being built, flat on his back. Or on the face of the RCX unit. I believe that he is in the same state as the above picture, only in a different angle. On a side note: I would like to bring your attention to the grey tool on the bottom right corner of picture, it is a tool that helps you take a part the lego bricks...Saving my fingers from great pain in the taking a part of creations.


He has now been given his "nose", where the light sensor will go and the motors that will provide the energy/turning motion for his wheels. The light sensor part is how Tricycle will be able to tell if he is on a black line or not.


Here is the finished product of building the Robot. The big wheels are in front of the motors (there is one directly across for the one in the picture). The light sensor is the blue brick. The black bricks on the RCX unit that have wires coming out of them is how the RCX communicates with the Light Sensor and the Motors.

I have started the programming processes for Tricycle in the computer and believe that I am almost done. With this program, Knudsen is directing me through using subroute in the programming in the Lego Environment. He also brought up a point in the programming section on this robot that I would like to mention and that was: you need to prepare for the worst. I think that I already knew this, because part of robotics is the need for the robot to be able to communicate with the world and the world is not a science labitory. So in programming this robot to follow a black line, we can't just assume that if he doesn't sense the line that he needs to turn the opsite way that he did before to find it because the line could be curved. Therefore in this program, we will use a timer in order for the robot to know when he needs to turn the other way to try and find the line again.

Time spent after last time logged: 3 hours
Total for Today: 4 hours 40 minutes
Overall: 14 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