COES Lab Report Template  · Web viewBoe-Bots are rolling robots with a BASIC Stamp 2 programmable...

15
Engineering Design/Physics Programming the Boe-Bot Through the Maze and Up the Ramp Ryan Guidry and Rachel Lindley September 23, 2013

Transcript of COES Lab Report Template  · Web viewBoe-Bots are rolling robots with a BASIC Stamp 2 programmable...

Page 1: COES Lab Report Template  · Web viewBoe-Bots are rolling robots with a BASIC Stamp 2 programmable microcontroller brain, and the objective of this project was to study a variety

Engineering Design/Physics

Programming the Boe-Bot Through the Maze and Up the Ramp

Ryan Guidry and Rachel Lindley

September 23, 2013

Page 2: COES Lab Report Template  · Web viewBoe-Bots are rolling robots with a BASIC Stamp 2 programmable microcontroller brain, and the objective of this project was to study a variety

Programming the Boe-Bot Through the Maze and Up the RampLindley and Guidry

September 2013ENGR DES

Abstract:

Throughout the past month, students learned about four different sensors that could be used to program a personal robot to move autonomously: whiskers, photoresistors, infrared LEDs, and an accelerometer. Boe-Bots are rolling robots with a BASIC Stamp 2 programmable microcontroller brain, and the objective of this project was to study a variety of sensors that work in accordance with the robot’s microcontroller in order to complete a given task. The users then chose the most effective sensors studied and programmed them into the Boe-Bot using a code developed by the users themselves so that the robot can autonomously travel through a maze and up a ramp, where it must stop on its own.

The most effective sensors that were studied were the infrared sensors and the accelerometer. By wiring the infrared sensors to the Boe-Bot and developing a BASIC Stamp code to run the program, the Boe-Bot was able to successfully and autonomously travel through a test maze with very few problems. Two infrared sensors were wired to the front of the Boe-Bot so that when the infrared detectors received a signal from the LED, it would then tell the robot to turn left or right depending on the location of the walls. Similarly, the accelerometer was wired to the breadboard of the robot and a program was developed using the x and y coordinates that the accelerometer received. This is what told the robot to stop at the top of the ramp.

On the day of the final maze competition the robot struggled in both rounds one and two, but in the final round three, the Boe-Bot successfully travelled to the end of the maze on its own using the infrared sensors. Sadly, the Boe-Bot did not stop at the top of the maze due to the incorrect code running the accelerometer, but the accomplishments of the Boe-Bot were good enough to receive third place in the class.

i

Page 3: COES Lab Report Template  · Web viewBoe-Bots are rolling robots with a BASIC Stamp 2 programmable microcontroller brain, and the objective of this project was to study a variety

Programming the Boe-Bot Through the Maze and Up the RampLindley and Guidry

September 2013ENGR DES

Table of Contents

Abstract:............................................................................................................................................i1. Introduction and Background..................................................................................................12. Theory......................................................................................................................................13. Description of Experimental Setup......................................................................................1-24. List of Equipment Used...........................................................................................................25. Procedure..............................................................................................................................2-36. Data......................................................................................................................................4-77. Analysis of Data......................................................................................................................78. Discussion of Results...............................................................................................................29. Conclusions..............................................................................................................................210. References............................................................................................................................211. Appendix..............................................................................................................................3

ii

Page 4: COES Lab Report Template  · Web viewBoe-Bots are rolling robots with a BASIC Stamp 2 programmable microcontroller brain, and the objective of this project was to study a variety

Programming the Boe-Bot Through the Maze and Up the RampLindley and Guidry

September 2013ENGR DES

1. Introduction and Background

The Boe-Bot will be presented with the task of completing a maze with a ramp within a short period of time. The main challenge is to program the Boe-Bot using the compatible BASIC software so that the Boe-Bot can perform the said tasks autonomously without external interference. When the Boe-Bot encounters a problem, it must manage the problem on its own and solve that problem. In order for the Boe-Bot to work this way, an array of programming skills must be acquired. From there, programs that yield autonomous actions must be created. Many trial runs and tests must be performed in order to validate the Boe-Bot’s autonomy in a variety of situations. The main components to be programmed into the Boe-Bot include movement, sensory, and an ability to ascend elevated ground and stop at leveled ground. Factors to consider include the hardware, vehicle weight when ascending the ramp, speed, and time.

2. Theory

Boe-Bots use the Parallax BASIC Stamp computer program. Users must develop their own individual code using stamp mode: BS2 and PBasic language 2.5 so that the robot can autonomously complete a given task. The theory was that the robot would use the infrared detectors and infrared LEDs wired on its breadboard to sense nearby walls and tell the Boe-Bot to pulse the wheels right, left, forward or backward depending on its distance from the wall. The task at hand was also to have the robot stop at the top of the ramp at the end of the maze. This is where the accelerometer came to use. The accelerometer recorded the Y value of the robot’s location so that it knew whether the robot was on a flat or slanted surface. A program was developed so that the robot would use the infrared sensors to travel through the maze and to the ramp and then the accelerometer would kick in once the robot began travelling up the ramp and once the robot reached the top, the Y value would return to those of a flat surface and the robot would stop.

3. Description of Experimental Setup

The product of this experiment required a Parallax Boe Bot as the hardware component, which depended on BASIC Stamp Editor v2.5.3 as the software component. First, the Boe Bot was assembled according to the manufacturer’s instructions, and BASIC Stamp Editor was installed on the computers. The manufacturer’s instructions yielded a basic design of the Boe Bot that included servo motors for wheel rotation. All features would rely on the BASIC Stamp Editor to function.

Second, learning the BASIC Stamp programming language was a necessary step toward getting the Boe Bot to function in a certain way. Even if the Boe Bot could simply move by itself, it must have also been able to sense and respond to the environment autonomously. Hence, programming skills were the most crucial element of autonomous function.

Lastly, three different sensors were tried and tested to see what would yield the most efficient time. The whiskers worked by allowing the Boe Bot to respond to the environment after a physical touch was made with it. Although the whiskers suited the term “autonomy,” it took longer for the Boe Bot’s response to be triggered. On the other hand, the infrared LED sensors worked by detecting an interruption in the LED stream and responding before the Boe Bot physically touched the interruption. How this provided a more efficient run was that the Boe Bot did not have to waste time running into an object, then back up, and then turn left or right; the

1

Page 5: COES Lab Report Template  · Web viewBoe-Bots are rolling robots with a BASIC Stamp 2 programmable microcontroller brain, and the objective of this project was to study a variety

Programming the Boe-Bot Through the Maze and Up the RampLindley and Guidry

September 2013ENGR DES

infrared LED sensor prevented the extra subroutines from being needed. Navigation up a ramp without a sensor was extremely difficult for the Boe Bot because of the traction and vehicle weight that slowed it.

4. List of Equipment Used

Parallax Continuous Rotation Servo 2

Flat head Phillips screw 4

Battery Pack with center-positive plug 1

AA Batteries 4

Board of Education 1

Wire Segments 6

Infrared LED 2

Infrared Receiver 2

Parallax Screwdriver 1

Boe-Bot Chassis 1

1” Standoffs 4

Pan Head Screws ¼” 4-40 8

Rubber Grommet 1

1/16” Cotter Pin 1

Tail wheel ball 1

Rubber Band Tires 2

Plastic machined wheels 2

Nuts 4-40 10

Accelerometer 1

220Ω Resistor 4

10kΩ Resistor 2

5. Procedure

First assemble the Boe-Bot according to the manufacturer’s instructions. Some of that equipment is listed above. Next, wire the resistors that will be used for the Infrared LEDs and Accelerometer. Wire a 10kΩ resistor going from P2 to the first row on the breadboard under Vss. Wire a 220Ω resistor from P3 to the next row on the breadboard under Vss. Wire a 220Ω resistor from P6 across to the row under Vss, and another from P7 across to Vdd. Next, wire a 10kΩ resistor from P10 to a row under Vss. Wire the last 220Ω resistor from P11 to Vss.

Connect the positive end of one of the infrared LEDs to the P2 10kΩ resistor. The negative end should go two Vss rows up. Next, connect the first pin of an LED Receiver to the P3 220Ω

2

Page 6: COES Lab Report Template  · Web viewBoe-Bots are rolling robots with a BASIC Stamp 2 programmable microcontroller brain, and the objective of this project was to study a variety

Programming the Boe-Bot Through the Maze and Up the RampLindley and Guidry

September 2013ENGR DES

resistor. The other pins should follow two rows up. Connect a wire segment from the row of the middle pin of the 220Ω resistor to Vss, and connect another wire segment from the last receiver pin to Vdd. Now to wire the other infrared sensors, place the positive pin of the other infrared LED in the Vss row of the P10 10kΩ resistor. Next, place the first pin of the infrared receiver in the Vss row of the P11 220kΩ resistor. To finish off the wiring, connect a wire from the middle pin of the infrared receiver to Vss, and connect another wire from the last receiver pin to Vdd. Install the accelerometer with the middle of the three prongs between the 220Ω resistors at P6 and P7. Connect one of the last two wires from the accelerometer to Vdd, and the other to Vss. Wiring the breadboard and connecting the sensors is complete.

The Boe-Bot must now be programmed according to the location of the resistors in pins 0-15 that the sensors were connected to. By using programs learned in class, adjust the numbers and combine program statements used for the accelerometer and the infrared LEDs into one program. Values are determined by trial and error, or tests. For example, the accelerometer test yields the given value of an incline on the DEBUG screen. This can be used t determine the value of the ramp’s incline when the Boe-Bot is on it.

3

Page 7: COES Lab Report Template  · Web viewBoe-Bots are rolling robots with a BASIC Stamp 2 programmable microcontroller brain, and the objective of this project was to study a variety

Programming the Boe-Bot Through the Maze and Up the RampLindley and Guidry

September 2013ENGR DES

6. Data

4

Page 8: COES Lab Report Template  · Web viewBoe-Bots are rolling robots with a BASIC Stamp 2 programmable microcontroller brain, and the objective of this project was to study a variety

Programming the Boe-Bot Through the Maze and Up the RampLindley and Guidry

September 2013ENGR DES

5

Page 9: COES Lab Report Template  · Web viewBoe-Bots are rolling robots with a BASIC Stamp 2 programmable microcontroller brain, and the objective of this project was to study a variety

Programming the Boe-Bot Through the Maze and Up the RampLindley and Guidry

September 2013ENGR DES

6

Page 10: COES Lab Report Template  · Web viewBoe-Bots are rolling robots with a BASIC Stamp 2 programmable microcontroller brain, and the objective of this project was to study a variety

Programming the Boe-Bot Through the Maze and Up the RampLindley and Guidry

September 2013ENGR DES

7

Page 11: COES Lab Report Template  · Web viewBoe-Bots are rolling robots with a BASIC Stamp 2 programmable microcontroller brain, and the objective of this project was to study a variety

Programming the Boe-Bot Through the Maze and Up the RampLindley and Guidry

September 2013ENGR DES

Competition Results: (see Appendix A)ROUND TIME (min:sec:ms)1 Incomplete2 Incomplete3 2:42:86

7. Analysis of Data

The program written in BASIC Stamp contained variables for each infrared sensor, a counter for the pulses to each wheel, and a y variable for the accelerometer. In the program, a do-loop was created for the y value and for the IR sensors. If-then and else-if statements were created based on the IR sensors. If both sensors sensed an interruption, the Boe-Bot would react by turning left twice to get out of the corner it’s in. If the right sensor (irright) senses an interruption, the Boe-Bot will turn left once. If the left sensor (irleft) senses an interruption, it will turn right once. All the turns are administered by subroutines at the end of the code. The end of the first do-loop is regulated by the y variable, which changes based on the incline of the Boe-Bot. When the y value becomes less than the maximum incline level, another do-loop is triggered, and subroutines command the Boe-Bot to move forward (while it is on the ramp.) Another command says when the y value is greater than 2615 (minimum for the incline of the top of the ramp) the Boe-Bot stops with the halt subroutine.

8

Page 12: COES Lab Report Template  · Web viewBoe-Bots are rolling robots with a BASIC Stamp 2 programmable microcontroller brain, and the objective of this project was to study a variety

Programming the Boe-Bot Through the Maze and Up the RampLindley and Guidry

September 2013ENGR DES

The SolidWorks files show the hardware details of the Boe-Bot. The hardware of the Boe-Bot plays a major role in programming because the location of the hardware (pin numbers of wires, parts, etc) determines what is written in the program. Some of the hardware can affect the outcome of the experiment independent of the software. For example, the first round was incomplete because the rubber track came off of the wheel and the Boe-Bot could not turn.

The data table simply shows the results of rounds 1-3 on competition day. For the first two rounds, the Boe-Bot did not complete the maze at all. Both times the Boe-Bot was physically stuck. However, the third round the Boe-Bot did complete the maze and escalate the ramp after 2 minutes and 42.86 seconds.

8. Discussion of Results

Programming a Boe-Bot to perform the task at hand in an autonomous and efficient manner was quite a challenge. Until the very last minute, the Boe-Bot had a hard time navigating through the maze. It would run into walls, flip over, get stuck in corners, and the infrared sensors had to be adjusted numerous times to get the Boe-Bot to work as desired. Eventually, though, those problems were resolved. The most difficult aspect overall was not in the programming itself, but modifying the hardware or physicalities of the experiment. Already stated were the issues with the IR Sensor position. Also, each time a trial run was conducted, the starting position became a great variable in the end result. Being human, it was impossible for students to place the Boe-Bot in the exact same starting position each time. Therefore, the student may have received mixed results even if the software or hardware was unchanged.

Another factor that determined the results was the course itself. It was not a perfect maze or perfect ramp because there were separations in the floor and an unsmooth transition between them. Although velcro was placed between the obstacles, the width of the ramp was smaller than the maze opening, so the Boe-Bot ran into the corner of the ramp during the second round.

Without making any real adjustments, the BoeBot began the third round and succeeded. There were too many variables that came into play, including the starting position, that affected the results of each round. In a perfect world, it would have been much easier to get the desired results from the BoeBot. Despite the many variables, getting the BoeBot to the top of the ramp was satisfactory.

9

Page 13: COES Lab Report Template  · Web viewBoe-Bots are rolling robots with a BASIC Stamp 2 programmable microcontroller brain, and the objective of this project was to study a variety

Programming the Boe-Bot Through the Maze and Up the RampLindley and Guidry

September 2013ENGR DES

9. Conclusions

The BoeBot completed all of the objective goals except for one: stopping at the top of the ramp. When testing the BoeBot, there were too many variables that came into play, so several trials were necessary to get an average result. If an additional week was added to the project time length, there would have been modifications to the accelerometer program so that the BoeBot would be less likely to run up the side of the ramp. The infrared sensors would be fixed into a better position, and wired differently so that they are extended on the sides and can better detect the surroundings. An additional infrared sensor would be added to detect the top of the ramp. All of these factors would lead to more efficient and consistent results so that there would not be the need for so many trials. Paying close attention to detail, being patient, and understanding the presence of different variables were major attainments from this experiment.

10. References

Lindsay, Andy. Robotics with the Boe-Bot | Student Guide. N.p.: Parallax, n.d. Print. Version 3.0.

11. Appendix

(Appendix A) This chart only covers the quantitative data of the experiment. The first round could not be completed due to the BoeBot being unable to turn at the first turn. The second round could not be completed due to the BoeBot getting stuck at the base of the ramp. The third round was completed, but the BoeBot did not come to a stop at the top of the maze.

10