1. The HardwareThe newest technology from Lego is the MindStorm robot kit. Each kit comes with one brain, two motors, and lots of miscellaneous pieces. However, it was obvious from the beginning that there would be a great need for two kits. Our robot needed to be able to move in three dimensions, grab a chess piece, move the piece, set the piece down and release it, and then return to the starting location. We decided that the easiest method was to build a gantry crane to perform all of these functions. The very first stage in the design of the robot began by using one motor to travel a track.Next, we added the capability to move in the x-direction. Since we decided on the gantry crane model to cross over the board, we needed a lot of Lego pieces to make the gantry crane sturdy enough for three motors and the car. The night before our first presentation, we completed the first version of the car. This car was capable of moving across the gantry crane's y-axis as well as the x-axis. We had also designed a method of lowering and raising the crane's claw. The gantry crane's claw went through many different changes and modifications. The original design was to use two different boomerang-shaped pieces and anchor one piece and have a motor swivel. While this worked some of the time, the robot claw tended to place pieces into the corner of the board. We needed to come up with a better way to aid the vision group. We finally came up with a solution that allowed for much better results. Instead of having just one claw swivel, we made both swivel using long rods that flexed around each other. When first observing the robot, one might assume that the claw would entirely miss the piece, but quite surprisingly, pieces ended up being centered on the board. Each Lego MindStorm robot kit comes with a light sensor. We utilized both light sensors that we obtained for this project. The first light sensor was on the x-axis and the other was on the y-axis. Both the x and y-axis had a strip of paper with black and white lines to signal to the "brain" units where the robot was. By doing this, the robot became completely independent of the chessboard used. To use another chessboard, only the strips of paper needed to be changed. Also, this made programming the robot a whole lot easier since there were fewer timing loops in the programs that would need to be updated to work with a new chessboard. The Lego MindStorm robot kits also come with a couple touch sensors. For our robot, we used the touch sensors mainly as calibration tools at the end of, and during, each move. The first touch sensor is located on the y-axis track. This particular touch sensor is used to tell the brain units that the gantry crane has reached its original position in the y direction. The second touch sensor has the same operation on the x-axis. The third touch sensor that we used is located on the car itself. This touch sensor is used to tell the brain units that the claw is as far down as it can go without doing damage to the car. When this touch sensor activates, the claw opens or closes around a piece. The third touch sensor also calibrates like the other touch sensors do. The first and second touch sensors calibrate the chess robot before the game even starts and after every move. The third sensor calibrates the chess robot when the claw drops down for the first time. Also, the "brain" units were quite heavy and needed to be in direct line with the PC's infrared port. Since this could not always be the case, we decided to make them stationary. This required us to use every long cable that we could find so that the brain units could communicate with touch and light sensors as well as motors...and even themselves! At the beginning of programming, it was discovered that the units could talk among themselves but they could not communicate with the computer except to receive commands. This required us to also put the robots in such a position that they could receive IR commands as well as send them between both units. During this entire process, we had to keep everything small and compact. If the robot got too big, it would get in the way of the vision group. If the robot was too small, it would slip along the track. Thus, we had to find a way to incorporate all three motors onto the car and keep it within size restrictions. To do this, we used worm gears and rubber bands that came with the kits. This allowed us to increase the torque and enable the gears to not grind as much as in the first model of the car. 2. The Software (Not Quite C = NQC)The Lego MindStorm robots come with a very difficult programming language called RCX. Using graphical blocks to program the robot to be unpredictable would have made the gantry crane project impossible. Instead, we decided to use a programming language that is called Not Quite C (NQC). Using a language format similar to what we were used to, the programming became easier and timing loops became very reliable.The first programming feat that we accomplished was the communication between the computer and the robot. The problem was that there are only 3 sensor inputs and 3 motor outputs on each brain unit. Since there are 2 light sensors, 3 touch sensors, and 4 motors total, we needed to have two brain units. To complicate things even more, we found that the PC can only send IR information but not receive it. This required the robots to receive all directional commands and execute them instead of getting each command individually and letting the PC do most of the work. So, the solution we came up with was to use a header for each brain unit. When the brain unit received its header, then the next number(s) received became the commands to act upon. So, the PC communicated all of the moves to brain 'A' and then brain 'A' send commands to 'B' at the appropriate times. Moving in the directions of the x-axis and y-axis were simple to program: count how many black lines the robot has crossed. Each black line symbolized the location of the robot relative to the chessboard. However, the z-axis became a little more difficult. We used timing loops for this portion of the robot since we did not have any more light sensors and we were running out of long wires. The first timing loop dropped the claw arm down just below the gantry crane...just barely above the king's head. After this, the claw opens and then the arm continues on down until it hits the touch sensor discussed previously. At this point, the claw closes and the motor continues running as the gantry arm moves back up. At the point where the claw closed before, the claw motor stops and the arm continues up for a little more. The gantry crane then moves to the drop position, where it drops the arm until it hits the touch sensor. The claw motor opens the claw and then stops. The claw arm moves to the point just under the gantry crane, the claw closes, and the arm returns to (roughly) its original position. Then, the crane returns to start. 3. Robot FeaturesThroughout this process, the robot design group got silly and decided to add some 'features' that makes it more appealing to the human eye. The first features that we created were eyes. After version two of the robot, the eyes disappeared, but eventually reappeared in version six. The reasoning behind the eyes was that they would help to make Dr. Spiegel more comfortable with playing a machine. The eyes also 'helped' to hold the cables down onto the robot.The second set of features was a set of bat wings. These were intended to give the robot more speed in making the move, but in reality did not (see statistics). So, instead they were put on one of the brain units mostly to make people ask questions. The final feature for the robot consisted of a name. A majority of the group decided that the name Machbanai should be the name of the robot. We did not, however, have enough time to put the homemade sign above Machbanai in the competition. |