Tuesday, March 1, 2011

Introduction to LabView—2/18/2011

After presenting our birds at the beginning of class (gearbird did a great job!), we had our first introduction to intelligent design! (Not the anti-evolution kind . . .)  Clara and I were partners again today, and we were first faced with the challenge of building an NXT robot that moves itself across the ground using two rotators, but no wheels.  This would be our first experience using LabView to write a program that would allow our robot to move by itself.  After watching the awesomely inspirational videos Chris showed to us, Clara and I set to work.  We walked over to the Lego table and quickly fell in love with the claw-like parts that we found there—we knew right away they must be part of our creation. We first connected our claws to just one rotator, and when we turned it on we were pleased and slightly terrified to watch the vigor with which the claws whipped around.  We quickly discovered our creation’s favorite food was cord, since it did not hesitate to wrap itself in any that happened to cross its path (although it certainly did not object to the occasional finger or arm).
In giving life to the claws, we had our very first experience with LabView, programming our little robot to move its rotators forward when we pushed a touch sensor once, and to stop when we pushed it again.  A very simple program, but it was still very exciting to see it work, especially since it was our first one!  We built our other claw and discovered that we had to change our program so that one rotator moved forward and one backward, so that the claws would move together and hopefully propel our creation in the correct direction.  We deemed our creation the Bucking Bronco.

Bucky
Stage one of building time was over, and it was time for a race! Bucky did not let us down—he pulled out ahead, kept his strong lead, and crossed the finish line first! We were very proud.

After the race we returned to our computer with the new goal to make our creations stop of their own accord when they reached the white finish line.  Clara and I at first wanted to use an LED light sensor to indicate the difference between the dark carpet and the light tape and send the stop signal accordingly, but before we got too far with our idea, Chris kindly informed us that Bucky, being what he was, would probably fling off the LED sensor, or at least make it very difficult to get an accurate reading.  We decided to switch tactics and switch our stop signal to a certain amount of time, since we knew the distance Bucky would have to travel.  We went out to the hallway to time a few of Bucky’s runs, but unfortunately his carefree movements did not lend themselves to being measured, since his time varied to an extreme degree each run we timed. (He was slightly off balance despite our stabilization attempts, and sometimes decided to veer off in random directions.)  We did our best to take an average of his time, and ended up with ten seconds.

When the trial began, Bucky ended up veering of course and therefore ten seconds ran up before he got to the line, so he stopped early.  On the bright side though, he came nowhere near knocking over the granny Lego person on the other side of the white finish line!

Here is our program—It uses forward, wait for touch, and stop commands, as well as a fore loop.  Each claw is controlled separately (one rotates forward, the other backward), and both stop after 10 seconds.


Here is a movie of Bucky's attempt to stop at the line:


Although our timed stopping attempt did not work with Bucky, after quite a bit of trial and error and attempting to figure out the functions of the plethora of Lego pieces of many shapes and sizes, I really feel like I learned a lot about LabView and am starting to understand the many things it is capable of doing.

No comments:

Post a Comment