Sunday, January 30

Line follower update 02

I have gotten far on my program, and will post a screen-shot for you now. Just a minute...     Ok, here it is:
First page out of three!
As you can see, the layout is quite messy.  I have too many global variables, most of which task DISPLAY() is using.  I think that I will turn DISPLAY() into a function that is called by the other two main tasks.  If you will notice, the screen-shot shows only one third of the code I have written.  That is too much code for a simple line follower, but as I get each part perfected, I hone it down.  For example:  The function MOTOR_CONTROL(), was at first a complicated task, but as I saw that I only wanted it to run after a certain part of task DATA_LOG(), I converted it into a function.  This conversion enabled me to eliminate a few global variables that were used only by MOTOR_CONTROL(), substituting them for parameters.

Well, that is all for now... I'd better get back to programming!

P.S. I recognize that by posting my code to the public, I have given you the permission to use, modify to any extent the said code.  But, this code may not be sold without permission from me, and I would appreciate it if you would give me credit if you do use this code.  Thank you!

Tuesday, January 18

Building a Line follower. Easy?

Ok, I guess that from my last post I sounded pretty much an expert on the whole line following thing... well ever since then I've been working on a follower myself, and I'll tell you what, it ain't easy.  I find myself in the lower end of  "the middle class of programmers"  which I established in my last post.  (Those who understand the basics and essentials of programming, but have not mastered the art.)  I finished the robot in a few hours, but I've made, and rejected, three complex programs each of which I spent considerable time designing.  I am now on my fourth,  I decided to do it in NXC because I was running out of file space on my NXT when using NXT-G.  So far, I haven't got quite as far as I did in NXT-G, but I had to overcome many obstacles and bugs (not being very fluent in NXC.)  I will be posting updates on my robot as well as code snippets as I get them finished.

Monday, January 10

Line Following

Continuous Line Follower
   Following a line...  An idea that to the extreme beginner and the expert seems easy, but to the middle class of programmers (those who understand the basics and essentials of programming, but have not mastered the art,) the task is quite complicated.  Most of the line followers I have seen on NXTLog and elsewhere follow continuous lines.  A few of them have the capability of traversing cross-roads and road split.  And one or two can cross breaks in the track and avoid obstacles in the way.  I have seen multiple light sensors on a single bot and have observed but one on a bot.
Four Light Sensors
 I think there are definite downfalls and gains to be had from either of the two; on the one hand, more sensors mean more accuracy but is more expensive; while on the other, when using only one light sensor, you don't need to buy extra parts but the robot will be slower and less accurate.
  There are many other alternatives to the methods of line following described above, one being to buy non-lego sensors for your robot such as the five sensor array below.  One alternative that I have thought of is to have a light sensor mounted on an arm or boom and swing back and forth in front of the robot.  The light sensor would detect the line edges and, depending on the position of the servo controlling it, the NXT could tell how hard to turn, and what direction to turn. 
   The algorithm used to decide the turn would run something like this.
   
#define RIGHT true;
#define LEFT false;

{  // when pointed straight ahead, the rotation sensor is at zero.
  int turnpct = degrees / 2;

  if (degrees > 0){ direction = RIGHT; }
  else if (degrees < 0){ direction = LEFT; }

 
RotateMotorEx(BC, 100, 90,
     turnpct, true, false);

}// I have not tested this algorithm.
  //I made it up as I was sitting here,
  //but it is something like that which you would use.

The GreyHound
I recently discovered a project on NXTLog that uses this mode of line following.  It is a simple bot named the GreyHound built by hydrogenhead.
  The main advantage of such a design is:
   Although a little slower than using multiple light sensors, the 'sweeping' method is much more accurate, providing the ability to get a reading on every degree that the motor controlling it is able to turn to. 
  For example, say that we have four different light sensors across the front of our robot similar to what we see in the third picture up.  We could get four readings. We could vaguely tell how wide the line is, and generally where it is in respect to the front of the robot.  Now let's say that the line our robot is trying to follow is wide enough to fit one light sensor.  The robot randomly picks one of the middle sensors (we'll call it Jared.)  Now on following the line, the robot tries to keep the line under the chosen sensor (Jared,) and when Jared losses the line, the two other sensors start checking for it in order to alert the NXT as to where it is.  On receiving information as to the direction the line has turned, the NXT gives the appropriate information to the drive motors who respond accordingly.  This sounds great, but there are two problems to this method.  If the line turns too sharply, the robot loses it, and upon adjusting the turn radius, the bot follows the line in zig-zags thereby considerably reducing its speed.
 
   If we use the sweeping method however, our results are much more promising.  The light sensor (we'll continue using the name Jared for familiarities sake,) goes back and forth across the line, stopping precisely at the edges so as not to get confused with any other lines that may be in the near vicinity.  Every time Jared gets to one edge of the line, he informs the NXT, who in turn, gets the motor degrees from the motor moving Jared.  After receiving two such motor positions, the NXT finds the average, ( the middle of the line, ) and adjusts the turn percent accordingly.  When our robot comes to a corner, it slows down so as to not overrun and get lost.

   To sum it all up, the sweeping method of line following is slower going in a straight line because of the time taken to move the sensor, but because of the added locations possible for the sensor to be in, the robots precision is greatly advanced and therefore the speed and smoothness in traversing curves surpasses greatly the performance of other robots.

Saturday, January 1

4 DOF mobile robotic arm

Have you ever tried to build a big robot, so big that you'd need multiple brains and definitely multiple power sources?  Well, up to now I have wanted to, but I did not have all the pieces, motors, and ways to control them.
  For maybe a year I have gotten close to big because of the amount of Legos I had obtained, but I still wasn't quite there.  This year for my birthday I received an Arduino and decided to use it for a second motor controller.  Since the Arduino can provide five volts only, I used it to manipulate the servos controlling the pneumatic switches.


  Now, this may seem great, but after putting it all together, the parts I still needed coming in the mail, I ran the quick test program I always do (to work out the last details,) and realized something important. Even though I had geared the motors down, they were not moving... the robot was just too heavy.  I decided to remodel using worm gears this time to see if I could get any movement at all.  Now that that is done, it is all moving smoothly, though extremely slowly. 
  After witnessing the extreme slowness produced by the heavy-ness of my machine, I decided to do a bit of  research on NXTLog to see if anybody had gotten a large and complex robot to go very fast at all.  It seems that nobody has... at least, I did not see any body getting a robot with as many motors and all in all weight as my bot to traverse with any speed to talk about.  Well that is interesting, I wonder if there are any other, more powerful motors for cheap that could be adapted for use in a Lego robot.

for more pictures of my Mobile Robotic Arm, click HERE.

Thursday, December 16

Surveillance 101




There are many different types of surveillance robots;
stationary robots-
mobile robots-
and even flying robots-
       








My Bot - Surveillance 101

 I recently built my own stationary wall-mounted one to record a party we held in our home.  As you can see, it doesn't look like much, but it is capable of rotation on the Z axis, and tilt on the Y axis.  It is secured to a coat rack with rubber bands, and stabilized with rubber wheels.  The camera, (not shown in pictures,) is just a web cam which rests on the top of the robot.  Live video from the camera is passed through the usb cord into a computer which stores the data for further use.  The program for Surveillance was very simple because I had only an hour to build it.  It ran two loops; one controlling the tilt, and the other, the rotation.

For more pics please go HERE.

Tuesday, December 14

Oglesniper II

Ok folks, the plans for the great fire shooting machine have been found. King Armendon's mechanics have built the "tank" as it is called in the plans, and I now present it to you (quite informally.) For the details on how this was achieved, I have started writing out all the events that took place between the invasion and now, and publishing them in the Legoton Press.
for more pics please go here.

Thursday, November 25

Follow up: Thanksgiving

This information is no longer available. To view what used to be here, please visit the Legoton Press (my other blog.)

Thursday, November 11

A report on Legoton

This information is no longer available. To view what used to be here, please visit the Legoton Press (my other blog.)

Tuesday, November 9

Oglesniper

| Oglesniper 1 is a tank with an automatic rubber band gun. The gun can tilt up and down, as well as discharging two rounds of 24 rubber bands. The tank moves with two PF XL motors, and is remote controlled using the PF IR system. The Battery Box, through the IR system, directly controls the driving and gun tilting motors, while communicating with the NXT using my PF to NXT light system* to trigger the gun.
| The gun's "rounds" are just 24 tooth gears attached to a motor each. When the NXT senses that one motor has completed a full rotation (thus emptying it's round,) the second motor is used for firing instead.
| For more pictures, click HERE.

Friday, October 29

The Twin Paddler

The Twin Paddler is a remote controlled floating vehicle. I built it out of a twice used milk-shake bottle, two NXT motors the PF IR system and a lot of assorted Technic pieces. I sat it in the bath tub for an hour and it didn't ship any water. I've run it out on the lake for a while and there doesn't seem to be any thing wrong with it. The handling is very good, it doesn't tip much, and overall I would say it is a good NXT boat. For a few more Pictures click HERE.
There isn't really any thing else to say about the Twin Paddler, so I will have to cut it short. Until next time, so long!

Thursday, October 28

Mission Hexawheel Exploration II

Mission Hexploration is under way.
The object; To navigate through enemy territory under the guise of a toy, and come back with useful information in the form of pictures and video.
The means; A fully autonomous NXT robot with a bluetooth and camera enabled phone, mounted onto an X and Y axis turret. (At the present I am using the PF IR setup for the turret, but everything else is autonomous. This could be substituted for the IR Link sensor from HiTechic to make the robot fully autonomous.)
Other info; click HERE to see this bot's predecessor; the Hexawheel Explorator I, or HERE to see more pictures of this robot.

Sunday, October 24

Music Bot

Are you interested in music? Well, if you are I have built an NXT music maker!
Yes it really makes music, the knob on the right controls the tone, while the knob on the left controls the volume. Pressing the orange button in the middle starts the sound, and releasing it makes the sound stop. For more pictures, click here.

Saturday, October 23

A few minor creations

I know these are not built using an NXT, but I thought I would post them anyway.





Tuesday, October 19

A new form of Lego clockwork

I have seen many analogue clocks on NXTLog; Some of them complex,


And some of them very simple.


Many of them have second hands, but very few have them coming out of the middle along with the minute and hour hands.
I have recently discovered a very simple way of doing this.

All you need is a turn table, a four wide differential, and some other assorted parts. The hand attached to the turn-table is the hour hand. The hand connected to the differential is the minute hand. And the last one counts the seconds.
So there you have it. A much easier way to build the hand part to a clock. Make sure to give me credit if you use it in your design.
For more pictures, click HERE.

Monday, October 18

The Marble Express

This project was just an experiment. The hypothesis which spawned the Marble Express was, "Marble contraptions are easy to build." The test thoroughly disproved this theory.
But, although relatively hard to build, the Marble Express was fun to build and play with. I made it into a sort of game, the marble goes up the long right track, and when it gets to the top, it rolls down into the lifter. The lifter is remote controlled and you have to tilt it so that the marble rolls down to the slide on the left, which allows the marble to roll at terrifying speeds back to the start where it gets picked up by the track again.
The goal of the game is to keep the balls in play for as long as possible.
To see more pictures, click HERE.

Saturday, October 16

The Sorting Machine

I built this machine to sort 4x4 Lego cubes. They move slowly down the ramp onto a conveyor belt which moves the brick under the grabber. This then moves the brick onto the Sorting Belt. The Sorting Belt moves the brick out from under the claw and in front of the light sensor. The said sensor will detect color and tell the Sorting belt which side to dump the brick off of. This process repeats itself until the ramp is empty. You are left with two piles of of different colored bricks.

You will find more pictures of the Sorting Machine HERE.

Thursday, July 22

Try-bot a sumo version


The robot:
I built this robot as a sumo version of the NXT 1.0 tribot(base).
all I did to the tribot was add a lifter to the front and move the US to a better position.
I also limited my piece usage to allow NXT 2.0 users to build this bot.

The RC opponent:
I purposed in my mind to not stop work on the program for the autonomous bot until it could beat a human controlled sumo at least 2 bouts out of 3. To accomplish this goal, I built a robot using the Power Functions system.

The Board:
The board was built using a 2' x 2' x 1/2" piece of plywood. I tacked a white sheet to it and with a compass drew a black circle. Electrical tape stretches, so I used that to go around the circle.

I don't know how to post .rbt or .ldd files, so I'll link to NXTLog where you can find them.
You can see more pictures here.

Monday, July 19

Robo Arm T-1000

Robo Arm T-1000 is a heavy duty, 5 DOF (counting the hand,) remote controlled robotic arm. it uses every single NXT and PF motor I own (6 in all,) two PF receivers, the NXT, the PF Battery Box, and the pneumatics add on set from LegoEducation. Plus a lot of other parts and pieces of Lego. The NXT powers the arm rotation and pneumatics. The PF IR system controls the elbow, wrist, hand, and lights. The lights are used to communicate with the NXT via the light sensor.