How Do Human Sensors Work? - TeachEngineering

Transcription

Maze Challenge

Pre-Activity Quiz1.What is a design challenge?2.How do you program a robot to move2 feet forward in a straight line?2

Pre-Activity Quiz Answers1.2.What is a design challenge?A design challenge starts with problem you want to solve.You think through the challenge logically and plan a designsolution. Using suitable and available materials and followingthe steps in the engineering design process, you create, testand evaluate your best solution to the challenge. Asnecessary, you iterate (repeat) this process until a successfuldesign is achieved.How do you program a robot to move 2 feet forward in astraight line?Calculate the distance that the robot moves forward for onemotor rotation. Let’s say, it moves X inches with one motorrotation. Then divide 2 feet, which is 24 inches, by X, that 3is, calculate 24/X and program the motor to rotate 24/X.

What Is a Design Challenge?Day 1 - 50 minutesIn our modern world, challenges are everywhere!How can we waste less? How can we harness solarenergy and other renewable energy more effectively?How can improve transportation? How can we buildroads and bridges? How can we design a house that is nottoo expensive? How can we build smarter cars? How canwe use technology to make our cars safer?These are big ideas that engineers and scientists work on tohelp improve the world we live in.We will investigate how to complete a few design challengesthrough two different methods: Creating different robot designs to help it better complete the challenges Creating programs to help the robot complete the design challenge4

Your Engineering Challenge:To build and program a robot to travelthrough a maze. Wewill look at different robot designs (withand without sensors) in order to determinewhich is more reliable and which is faster. Boththe design of the robot and how it’sprogrammed are important for thischallenge!5

Let’s Look at Some Basics Beforewe start the design challenge, it isimportant to understand how and why we needto be careful with designing the robot anddesigning its program. Also, it is very important that we understandhow a robot follows instructions so we canunderstand how to program it. Let’s do an activity to help us understand twoimportant ideas:How a robot follows instructions2. The importance of sensors1.6

Let’s Look at Some Basics (continued)Maze 1 is a 3-ft wide path in a corner of the classroom.It looks like this diagram Use tape (or boxes) to mark the boundariesshown in fine lines.wall3 ftwallBlindfold a student “robot” and have himstand at the maze start.Have a student “programmer” give a seriesof commands to instruct the “robot” tocomplete the maze without touching themaze edges (keeping hands at his/her sides).6 ftendCommand examples: go forward X steps, turn left, etc.6 ftstart7

Let’s Look at Some Basics (continued)What did you observe? Did the “programmer” get the blindfolded “robot”through the maze? Did the “commander” always tell the “robot” to gothe correct number of steps?Often, it is easier for the “programmer” to giveinstructions if s/he can tell the “robot” to go forwarduntil s/he senses somethingBy doing it that way, the “programmer” does nothave to worry about telling the “robot” exactly how 8many steps to move.

Let’s Look at Some Basics (continued) Choosea different volunteer“robot” to be blindfolded.wall Thistime, permit the volunteer wall“robot” to stretch his/her handsout in front to sense when s/he isapproaching a wall. Haveanother student givecommands to instruct thevolunteer to get through the maze3 ft6 ftendcommands such as “go forward untilyou sense a wall” are allowed.6 ftstart Now,9

Let’s Look at Some Basics (continued)What did you observe? Was it easier to giveinstructions the firsttime or second time? Itis generally easier to tell a robot to goforward until it senses something (like awall) than to tell it exactly how far itshould go before turning. This approachalso tends to be faster.10

Let’s Look at Some Basics (continued)What else did you observe? Didyou notice that the “commander” had tomake sure to tell the “robot” EVERYTHING? which direction to move, how far or how long tomove, when to turn, which way to turn, etc. Likewise,the LEGO MINDSTORMS NXT intelligentbrick must be given exactly the same information.It knows nothing and will do exactly what you tellit to do. If you make a programming error, therobot will follow that incorrect command, and thefault is with the programmer, and not the robot!11

Before you start Beforewe start our maze challenges, let’s learnthe relationship between motor (or wheel)rotation and the corresponding distance therobot travels. Whyis this important? Because, when we havethe robot travel the maze without any sensors,we must tell it how much distance to move. Useyour results from the Master Driver activityto inform your programming! (Recall that this is theactivity where you determined the distance traveled bythe taskbot for every rotation of the NXT motor.)12

A Real MazeDay 2 - 50 minutesChallenge 1: Make the LEGO robot navigate themaze without using any sensorsChallenge 2: Make the LEGO robot navigate themaze using the sound sensor, the touch sensor,and ultrasonic sensor at least once each13

The Challenges MazeSuggested dimensions for the maze are shown in the diagrambelow, with “start” and “finish” locations indicated. 7 ft4 ftMake the mazeat least 1-ft highand 1.5-ft wide1.5 ftstart1 ftfinish1 ft14

Challenge 1To program the taskbot to travel the mazewithout using sensors. For this first challenge, the robot must go throughthe maze without using sensors! How will you program the robot to do this? Think back to the Master Driver activity and whatyou learned about the relationship between thenumber of rotations of the motor and the distancethe robot moved. You will be provided with a measuring stick ortape measure for this challenge. Be resourceful!15

Challenge 2To program the taskbot to travel the maze usingthe sound sensor, touch sensor, and ultrasonicsensor each at least once. For this challenge, your robot must use the touch sensor,sound sensor and ultrasonic sensor at least once each whennavigating the maze. Think back to how we did basic programming with the touchsensor, ultrasonic sensor and sound sensor, and combine thatinformation to get the robot to travel through the maze. In the robot documentation, find information about attachingsensors to the robot. Or, come up with your own designs for 16attachment also for this challenge. Be creative!

Post-Activity Quiz1.What types of problems did you encounter whentrying to complete the design challenges?2.How did you change the design of your robot oryour programs to help you complete the tasks?17

Post-Activity Quiz Answers1. What types of problems did you encounter when tryingto complete the design challenges?Calculating how many rotations to use in order to havethe robot move a measured distance in the maze.Recalling how to begin programming; how to programeach sensor.2. How did you change the design of your robot or yourprograms to help you complete the tasks?We re-attached the sensors to position them correctly toreceive the necessary input information.Through troubleshooting we corrected someprogramming errors.18

Challenge 1Maze without Sensors Solution Recallthe relation between rotations and distance:For each rotation, the robot travels a certaindistance (inches or cms) and we can usemultiplication to approximate how far the robotwill travel. So,we must measure each section of the maze andguess how many rotations we need based off eachdistance! Thismay not work perfectly the first time, but thenumber of rotations can be modified so iteventually works.19

Challenge 1 Program SolutionIn an effort to keep the robot as far from the walls as possible,calculate path distances so that the robot stays in the center ofeach corridor (.75 ft away from the wall).7 ft4 ftstart1 ft1.75 ft1.5 ft1.75 ftend1 ft4 ft2.5 ft5.5 ft20

Challenge 1 Program Solution (continued)123421

Challenge 1 Program Solution (continued)567822

Challenge 1 Program Solution (continued)9101123Note: Durations are approximate and may need to be adjusteddifferently for different robots.

Challenge 2Maze Using Sensors SolutionHow to complete the maze by using the LEGO robotsound, touch and ultrasonic sensors: Remember, since we can use the sensors, we do not haveto worry about distance and guessing how many rotationswe need! For each section of the maze, we can program the forwardand backward movement blocks using unlimited, and thenimmediately place a sensor block after the movementblock. We must use the ultrasonic and sound sensor once in thisprogram, then we can choose to use the sound sensor forthe rest of the maze or the ultrasonic sensor for the rest ofthe maze or both.24

Challenge 2 Program Solution123425

Challenge 2 Program Solution (continued)567826

Challenge 2 Program Solution (continued)910111227

Challenge 2 Program Solution (continued)1314151628

Challenge 2 Program Solution (continued)17181920Note: Block 20is not strictly29necessary.

Vocabularydesign: Loosely stated, the art of creatingsomething that does not exist.engineering: The use of science andmathematics to solve problems to improvethe world around us.30

Creating different robot designs to help it better complete the challenges . the taskbot for every rotation of the NXT motor.) 12 . Make the LEGO robot navigate the maze without using any sensors Challenge 2: Make the LEGO robot navigate the maze using the sound sensor, the touch sensor,