NXT Module: Final Design Report ENGR 102 – Winter 2013 Engineering Design Lab II Lab Section: Group Number: Section Faculty: 083 Date Submitted: March FIX, 2013 Section Fellows: Nick Vacirca 07 Richard Primerano Dion Antao Group Members: Kelly Shiptoski Maria Nyamukuru Oyinkansola Aderele Abstract Over the past ten weeks in this module, we worked on the design and programming of a Lego NXT robot and its gripper arm to clear up the mess caused by a train wreck and separate the waste canisters appropriately using various sensors. We programmed our robot with a program called The Lego Mindstorm NXT 2.0 program which consisted of ‘blocks’ that made the robot react in certain ways and helped the sensors work with the code used in programming. After coming up with a suitable code and design, our robot participated in a competition against other robots to complete the tasks we were given in the module. We didn’t perform so well in the competition because forget to take into account the amount of power we used. We put in too much power in the code we programmed which made the robot tip over the canisters. The robot also seemed to hard time finding the canisters during the competition. ENGR 102, Winter 2012 Section 083, Group 07 Problem Statement In this module, we were presented with a scenario where some waste (nuclear and trash) was spilled due to a train wreck and we were employed to build a robot that clears up the waste. The nuclear waste canisters were yellow and magnetic while the trash waste canisters were blue. The robot was supposed to detect the blue canisters, grab them with its gripper arms and move them towards the light, detect the yellow canisters, grab them with its gripper arms and move them away from the light towards another corner and the robot does all of these while avoiding the corners of the wall and other robots. During the past ten weeks, we had to learn how to use a program called the Lego Mindstorm NXT 2.0 program to program the robot to do small tasks like move in a specific direction and turn in a specific way. We also had to learn how to program the robot to use sensors including the magnetic sensor, the light sensor, the color sensor, the ultrasonic sensor, and the touch sensor. After mastering how to use the Lego Mindstorm NXT 2.0 program to program our robot. We had to design a suitable robot and gripper arm design and come up with a suitable code that makes the robot perform all of the above tasks described in the above scenario. After designing and programming the robot, our robot was to participate in a competition where it was judged on the amount of canisters it put away in the above scenario in their proper drop off zones. If the robot won, we would be employed by Robotech to clear up the mess made by the train wreck. Design Constraints Some of the design constraints given for the above scenario were the size requirements; our robot is meant to be able to fit inside a 1’x1’x1.5’ box. That means that the robot, all the attached sensors and the gripper arm were supposed to fit into the given dimensions which meant limited options for the design of the gripper arm and the placement of the sensors we used. Also we were only allowed specific materials outside of the Lego pieces to build our robot. Some of these materials allowed in this constraint include tape, cardboard, ping pong balls, rubber bands, paper string and drinking straws. We made use of tape in our design of the robot. Another constraint was the minimal functionality constraint. This constraint allows that the robot should be able to demonstrate some basic functions like search for canisters, obstacles and drop off canisters at their specific drop off zones. We overcame this constraint by using various functions in the Lego Mindstorm NXT 2.0 program to come up with a programming code that helped the robot to perform the above tasks. NXT Platform Page 1 ENGR 102, Winter 2012 Section 083, Group 07 The NXT kit included many diverse Lego pieces with which the robot was constructed. The NXT also included the “Intelligent Brick” which was basically the brain of the robot. This “Intelligent Brick” had a 32bit microprocessor. Also, all programs were downloaded onto the robot using a USB cord attached to it. To run a code, the orange button was pressed. The NXT kit also had multiple motors. These motors were used in the robot design to turn the wheels of the robot and to motorize the gripper mechanism. Hgh The Lego Mindstorm NXT 2.0 program provided the ability to program the robot. This was done by using different “blocks” that were, in the final design, connected to each other through loops. This program was relatively easy to use because of how visual it was. All loops were orange and literally appeared as a “loop” surrounding the blocks the affected, the blocks that controlled sensors were yellow, and the blocks that controlled the motors were green. Each block could then be modified based on different measurements. For example, a motor block could be set to make the motor rotate for 1 rotation. Four sensors were used in this robot design: the touch sensor, the magnetic sensor, the light sensor, and the ultrasonic sensor. The touch sensor was placed at the base of the gripper mechanism so that when it was triggered, the code then commanded the gripper mechanism to close on the canister. This was done by using a loop triggered by the touch sensor when it was pressed. The touch sensor was characterized by testing to make sure a canister would trigger the sensor properly. Much testing also went into deciding where to place the sensor so that the gripper mechanism could effectively close on the canister in front of it. Despite all of this testing, in competition, the sensor did not always register being pressed, and sometimes the gripper mechanism did not close on the canisters properly. The next sensor that was used was the magnetic sensor. The magnetic sensor was positioned right next to the touch sensor so that as soon as the touch sensor was triggered and the gripper mechanism closed on a canister, the magnetic sensor would sense whether the canister was magnetic or not (nuclear or trash), and then go into the next loop based on this. The magnetic sensor was characterized by testing the reading of the sensor when it was held up to the magnetic canister. The trigger value that was chosen was -400. The only downfall of the magnetic sensor is if it was not directly touching the canister, it would not register its magnetism. The light sensor was positioned in line with the “Intelligent Brick” because it needed to register the light, which was a tall lamp in the arena. The robot was programmed to, once it had a non-magnetic canister, go move toward the light until it was a certain distance from the wall, and then drop off the canister and go back to the beginning of the entire loop. The light sensor was testing many times until the final value of greater than 58 (intensity) was decided upon. This value worked well in most areas of the arena because the robot registered the light and moved toward it. The downfall of the light sensor was that sometimes the robot registered the light too soon, and then the canister was dropped off well before the drop-off zone. The final sensor used was the ultrasonic sensor, which was placed between the arms of the gripper mechanism so that the sensor would not be affected by sensing them. The sensor also had to be placed above the level of the canisters. The sensor was approximately 3-4 inches above the ground, so Page 2 ENGR 102, Winter 2012 Section 083, Group 07 that it would sense the 4 inch high wall. The robot was programmed that once it was in the high light intensity zone with the canister, it would sense the wall at a certain distance and drop off the canister. It was also used in a touch sensor loop so that while the robot was waiting to be triggered by touching a canister, it was avoiding any of robots or walls that came within 23 centimeters of the robot. This distance was tested multiple times, and the value that was used was less than 23 centimeters. This sensor was very tricky to work with, and it often did not recognize the wall in time and never dropped the canister, or recognized it too early and dropped the canister in the middle of the arena. Initial Design 1) MECHANICAL DESIGN – The robot was constructed completely out of Legos provided in the NXT robotics kit. There are two motors controlling the tires of the robot. One motor is attached to the front (the end with the two larger tires). This motor is used to control the gripper. The gripper is what will push the waste containers to their designated locations. The gripper design is that of a claw. It is constructed with four curved Lego pieces, two on each side, to simulate a claw. This claw will then effectively enclose the waste containers and push them toward their designated locations. To differentiate between the nuclear waste containers and the trash containers, the robot will be equipped with sensors. So that the robot moves in the direction of the nuclear waste containers, it will be equipped with a sound sensor, because the nuclear waste will be emitting sound. The touch sensor will tell the robot when it has touched the container. It will then proceed to the nuclear waste depot to drop off the nuclear waste. When the robot touches a trash container, it will be programmed to recognize that it is not emitting a sound and so should not be taken to the part of the arena where the nuclear waste depot is. Instead, the robot will be programmed to move toward the bright area (where the trash landfill is) using the light sensor. These sensors will be attached to the robot above the claw. Figure 1 (below) is an accurate representation of the prototype of the robot. It shows the gripper mechanism and the general look of the prototype. The sensors will be attached to the robot just above the gripper mechanism. Figure 1. Proposed Robot Design. Page 3 ENGR 102, Winter 2012 Section 083, Group 07 2) ALGORITHM DESIGN – Below is a step-by-step process (similar to a flow chart) explaining the way the robot is meant to operate. START: 1. Does the color sensor detect color? YES: Runs both motors forward NO: Runs motor forward and robot spins 2. Is the touch sensor pressed? YES: Stops motors and gripper closes NO: Runs motor forward 3. Does magnetic sensor detect magnet? YES: Runs both motors forward NO: Runs both motors forward 4. Magnet detected: is light sensor detecting light intensity less than 15? YES: Runs both motors forward NO: Runs motor forward and robot spins 5. Magnet not detected: is light sensor detecting light intensity greater than 50? YES: Runs both motors forward NO: Runs motor forward and robot spins 6. Magnet detected/light < 15: is light sensor detecting light intensity less than 10? YES: Stop motor and gripper opens NO: Runs motor forward 7. Magnet not detected/ light intensity > 50: is light sensor detecting light intensity > 90? YES: Stop motor and gripper opens NO: Runs motor forward END Final Design 1) MECHANICAL DESIGN – The final design of the robot, like the initial design, was completely constructed out of Legos. Two of the wheels are controlled by their own motors. One motor is attached to the front (the end with the two larger tires), but the final orientation of the motor was that it was turned 90 degrees for the new design. This motor is used to control the gripper. The new gripper will now, instead of gripping, enclose the containers and push them to their final designated locations. The gripper design is that a square of Legos that comes down from above and encloses the container. To differentiate between the nuclear waste containers and the trash Page 4 ENGR 102, Winter 2012 Section 083, Group 07 containers, the robot will be equipped with sensors. So the robot avoids the wall and other robots, it will be equipped with an ultrasonic sensor. The robot will do this until it touches a container. Then it will sense whether it is magnetic with the magnetic sensor. If it is a nuclear container (magnetic) it will let go of it. If it is a trash container (non-magnetic), the gripper will close on the container. Then, the robot was programmed to search for light with the light sensor because that is where the drop-off zone for trash containers was. Once the robot registered a certain light intensity, it was programmed to release the canister when it was a certain distance from the wall (using the ultrasonic sensor again). The touch and magnetic sensors were positioned below the gripper mechanism, and the light and ultrasonic sensors were above it. Figure 2 (below) is an accurate representation of the final robot. Figure 2. Final Robot Design. 2) ALGORITHM DESIGN – Below is a step-by-step process (similar to a flow chart) explaining the way the robot was meant to operate. START: Is the touch sensor pressed? YES: Closes gripper on container NO: Avoids walls and other robots by backing up and turning around Is the canister magnetic? YES: Opens gripper and goes back to beginning of the loop NO: Begins to search for light Is the light intensity greater than 58? YES: Moves forward one rotation at a time NO: Continues to spin in a zero point turn until light is found Is the wall detected? Page 5 ENGR 102, Winter 2012 Section 083, Group 07 YES: Opens gripper, backs up, turns around, reverts to beginning of the loop NO: Moves forward one rotation at a time END Competition Performance During the competition, a score of 80% was attained due to failure to drop any canister in the drop off zone. The biggest problem encountered by the robot during the competition was instability on the ground. Whenever one of the tires tried to move over or past a canister, the robot would fell over and lay sideways. This is because the robot had a smaller surface area in comparison to the robot’s height. The flipping over is also due to high power in the motors. Another problem encountered was the robot got stuck on the wall. It had been programmed to back up if the ultra-sonic sensor detected a wall. However since the ultra-sonic sensor was placed at the front, if the side of the robot got stuck, the ultra-sonic sensor was unable to detect the wall. The reason the robot got stuck on the wall was that the gripper designer had a part that was projected outwards. This projection got stuck in the spaces in the fence. When the robot was headed to the light with a canister and another robot passed by it would sense this robot and so dropped the canister off at that spot which wasn’t the drop off zone. The robot also had a hard time finding canisters. It would just move in circles. Conclusions The robot avoided the wall, and avoided other robots because the ultra-sonic sensor was placed at the front of the robot. When the touch sensor was pressed, the gripper closed on the canister and the robot moved towards the light. The gripper actually caught the canister because it was designed like a net and fully enclose the canister. However the delivery of a blue canister to the drop off zone only occurred in perfect conditions. Because of the code, there was no particular way to search for canisters and move towards them. The general design of the robot could be improved by increasing the surface area and by reducing the motor power in the code to make it more stable. The projection in the gripper could be removed or a wheel could be placed at the end of the projection so that when it gets to the wall, the wheel turns and makes the gripper move so reducing chances of getting stuck in the wall. To avoid dropping the canister at the wrong spot because another robot passed by, the ultra-sonic sensor could be coded twice, if it senses an obstacle the first time, it should stop and wait and then sense again, if the obstacle is still there, then it’s the right drop off zone, if not it should keep moving towards the light. Page 6 ENGR 102, Winter 2012 Section 083, Group 07 References List your references here in IEEE standard formatting. If needed, search online for the IEEE Citation Reference. When referencing a document in the text, do it as in the following example sentence: “earlier work reported elsewhere came to a similar conclusion [1-3]”. This will instruct the reader of the sentence to go to the references section and look up references [1], [2], and [3] for supporting information. These enumerations come from the IEEE bibliography formatting. Things that you should be referencing include: 1. The module overview document 2. The competition procedure document 3. Any additional sources that document the basis of your design Every resource listed here must be cited in the narrative of the report using the IEEE formatting style (see the reference formatting guide linked in this section). Page 7
© Copyright 2026 Paperzz