You are on page 1of 10

LEGO MINDSTORMS NXT Robot Programming EGR 100 002 Team 5 Alexandra Ainsworth, John Arrowsmith, Charles Bean,

Katelyn Culler 01/18/13

Introduction The team was instructed to build and program a robot to go through a specifically designed course. The team was directed to use only the parts provided in the kit for construction, as well as the LEGO MINDSTORMS NXT software for programming. In the first phase of this course (Figure 1), the robot was instructed to follow a white line and, after detecting a block placed on the line, turn and move the block until it was over a second line. After repeating this process with a second block, the robot moved on to phase two. Phase two involved programming the robot to detect two lights (Figure 2), each on separate walls, and turn them off. When both lights were turned off and the robot exited the area, the course was complete. There were many obstacles that hindered the team from being able to complete the project. The first problem this team came across was being able to use the program effectively. No members of the team had any previous knowledge regarding the LEGO MINDSTORMS NXT program. In order to create a successful robot, a great deal of time had to be put into getting together and ensuring that each member of the team learned to use the program correctly. In order to achieve that goal, time management was crucial. The team was given a time limit of four weeks to complete the entire project. With conflicting personal schedules, this proved to be a major constraint. With a limited number of parts, the objective was to create a working robot that would complete both zones of the course in a timely manner.

The objective of zone one is to move the blocks from the center line to the safe zones on the sides.

The objective of zone two is to detect and turn off the lights, and then exit the course.

Methods The team began to build the robot by following the instructions in the book provided in the kit. The design in the instruction book was very simple and proved a good starting point for the design of the robot. The team then took steps in order to improve on this basic design by adding additional parts, with the initial goal of completing phase one. The first part we added was the light sensor, which would be used to follow the line to get to the blocks. This was accomplished by again following the instructions in the provided book. This allowed the robot to follow the white line, but in order to push the blocks to the side, it was necessary to attach a sensor that would detect the block itself. The team decided to do this using the ultrasonic sensor because the blocks were not dense and the touch sensor required a forceful push to activate it. The ultrasonic sensor was originally attached at the top of the robot, as shown in the instruction book (Figure 3).

However, this was problematic due to the ultrasonic sensor being unable to detect the blocks on the line. The sensor was too high off the ground to see them. The

team addressed this problem by moving the ultrasonic sensor to the front of the robot near the wheels. Yet, when the sensor was attached there it was still too high to detect the blocks, so it was flipped upside down to get the sensor as close to the ground as possible (Figure 4).
Figure 4

The teams robot with the ultrasonic sensor upside down.

With the sensor properly placed to detect the blocks, the team now needed a method of moving the blocks into the safe zones. Use of a motor was considered to move the blocks, but it was more advantageous to build simple arms that would keep the block centered in front of the robot as it drove to each safe zone. Originally, the arms were too short and allowed for the block to be pushed incorrectly, so the team widened and lengthened the arms in order to efficiently trap the block in between the arms. The arms were now long enough to trap the block, but the power of the motors was at 100 percent and they were hitting the block out of the path, before the robot could trap it and move it to the safe zone. To resolve this, the power was adjusted

multiple times, from 100 percent, to 75 percent, and then back up to 85 percent. At 85 percent power the robot functioned with maximum speed while still maintaining control of its movements and not hitting the block. Eventually, wheels were added to the arms in order to facilitate easier movement from phase one to phase two. The wheels allowed the robot to roll along the walls without getting caught. The programming for phase one proved very troublesome for the team. The basic functions were fairly easy to get the robot to do, but when it was necessary to perform more complicated actions such as following a line, programming became challenging. Very often the team would turn to the programming guide inside the LEGO MINDSTORMS NXT software to get help with the programming. The programming guide was very helpful in showing the team how to use the sensors correctly, how to create loops, and how to do the harder functions such as following a line. However, the team could not use the programming guide too often, as the program would frequently close itself after opening the guide. For part two it was very clear to the team that they needed to use the light sensor, however, the light sensor had already been used as the sensor pointed down at the line. The team then discovered that the color sensor also had a light sensor function included, which saved the team the time it would have taken to switch the two sensors and then reprogram the robot. To use the color sensor effectively it was agreed upon to place it on the side of the robot, so the robot could be programmed to drive along the sides of the course while in a loop. The loop would tell the robot to continue forward until it detected a light. Once the sensor detected a light, the robot was programmed to turn away from the light at a 90 degree angle, and then back itself into the light to deactivate

it. After deactivating the light, the program instructed the robot to turn back to the right and drive towards the opposing wall. At first, the team programmed the robot to drive continuously toward the next wall for a specific amount of time, but this harmed the overall course time for the robot. Due to that issue, the team decided to use a touch sensor on the end of one of the arms. The touch sensor was used in a loop to program the robot to drive forward to the opposing wall until the sensor at the end of the arm was pushed. The robot would then stop, turn to its left, and again progress forward in a loop until it detected a light. Using the same program as before, the robot was to turn away from the light and reverse into it to deactivate it. From there, the robot just had a straight path into the exit after it turned to its left once again. Since the teams program had the robot go to its right first and progress along the wall that way, it was believed that the program the team developed would be faster than the programs of the other teams.

Discussion Overall, the team tried to keep the design of the robot simple, as well as the programming. When compared to the other teams robots, the robot was far simpler yet worked just as well. Phase one was performed faster than most of the other teams, but phase two did not do so well. One of the troubles with phase two was the programming. The robot would not perform the turns to the exact degree or rotation that was specified in the program. This became a major issue in phase two because the robot did not have a line to follow. Without a line to guide the robot, it was very important for the robot to make pinpoint turns and to drive straight. However, this was not the case; the robot would veer to the left when programed to drive straight. To try and help this issue, the team turned the power of the motors down. On the right side of the robot is where the team placed the color sensor. After observing other groups designs, the team realized it would have been more efficient to have switched the placement of the color sensor with the light sensor. Because of this issue, the team had to change to function of the color sensor to a light sensor for zone two of the project.

The team completed checkpoint one with a time of 29.4 seconds. When testing the robot before the first checkpoint, it was running too quickly. The robot was striking the block with too much force, causing the block to be pushed in the wrong direction. The team attributed this to the charging of the robot beforehand, and remedied it by letting the robot run for a minute or two before performing checkpoint one. Checkpoint two was completed with a time of 91.1 seconds. The robot had a lot of trouble with the turns specifically, as they were rather inconsistent. Depending on the level of the battery charge and where the axle of the wheel was, the turns would be either wider or shorter. Turning near the wall was also an issue, as often the robot would get stuck on the wall when turning. The final competition was completed with a time of 120.5 seconds. Phase one went as planned, and was performed with about the same time as the first checkpoint. Phase two did not go as well, and the team had to readjust the robot twice, as the turns were a little off. Overall, the robot did well, but not as well as they had expected.

Conclusion The teams goal was to create an engineered robot that was not only simple, but effective. After all of the time put into this project and the multiple constraints involved, the robot ran better than expected. The problems encountered were numerous, but most of them overcome. At first, the team could not get the sensors to function properly, but after numerous trial and errors, the team managed to figure out what worked and what did not. After rearranging parts on the robot, the team found that the lower the light and color sensors were located on the robot, the better they detected the blocks and light sensors on the course. This was due to the fact that the objects that needed to be detected on the course were located at a low level. Several other problems, such as the turn angles, were not fixed, but dealt with as best as possible. If the team could change anything regarding their process, they would change the consistency of the robot and try to perfect minor issues, such as which wheel to use on the arm of the robot in order for the robot to glide against the wall, the battery level of the robot, and how to place each sensor in an ideal spot on the robot.

You might also like