Showing posts with label NQC. Show all posts
Showing posts with label NQC. 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

Thursday, January 15, 2009

More on Trouble Shooting...Back Tracking....

As I have been informed, dealing with hardware related issues can make life tough and difficult. Through out my independent study, I have dealt with the problem of getting programs to transmit from the computer to the RCX unit. And just when I thought that I had figured it out (problem being that it didn't want to transmit when I was remoted into the computer), I find that once again, I am trying to figure why it won't transmit.

Since the last post I have:

  • Changed the battery in the IR transmitter (Doesn't seem to make a difference, although plugging it in fully does)
  • Tried changing a setting on the Serial Port through Windows, since someone mentioned on a forum that they had been able to get it to work but that it ran slow...so I tried turning off a buffer setting to see if that made a difference. It didn't. I then turned it back on.
  • So I then decided to see if I could load the Lego firmware back onto the RCX, it did it. Just fine and dandy!! I was able to load a NQC program on to the RCX brick and it worked just fine.

What I am thinking could be the problem is that the leJOS for the RCX is no longer being supported and Java has since moved onto a newer version. According to the leJOS website, it should work with Java 1.1 -1.5, I think that we might be on Java 1.6 or version 6 (that is if they haven't changed their confusing ways ;-) )So my next plan of action is to go dig up an older installer of Java that I have, in hopes that maybe installing an older Java will fix the problem and that any problems I do face, I will be able to solve quickly since I might have already seen them.

On a happier note: In doing this trouble shooting, I reinstalled the NQC program for my LucyLeia (she was still all together....Just wasn't connected to her brain ;-)). Then after reconnecting her up and running the program, I noticed she switch which side of her that she was putting the colors on. Taking a wild guess that this might have to do with the orientation of the Lego block with the wire was plugged onto the RCX, I turned it by 90 degrees so that the wire was now running off the side instead of the bottom, like I had first reconnected it. Ran the program again. And Exciting stuff....she switched back to the sides that she was dropping them before, when I first had connected her up.

Time since last post: 2 hours
Overall: 33 hours 25 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

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

Blogger Templates by OurBlogTemplates.com 2007