DOC PREVIEW
TCC EGR 120 - Navigating the BOE BOT with whiskers

This preview shows page 1-2-3-4-5-6 out of 17 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 17 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 17 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 17 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 17 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 17 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 17 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 17 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

PowerPoint PresentationSlide 2Slide 3Slide 4Slide 5Slide 6Slide 7Slide 8Slide 9Slide 10Slide 11Slide 12Slide 13Slide 14Slide 15Slide 16Slide 171BOE-BOT Lecture #4 EGR 120 – Introduction to EngineeringNavigating the BOE-BOT with whiskersReference: For more complete documentation, the following items are available from www.parallax.com or www.tcc.edu/faculty/webpages/PGordy • Robotics with the BOEBOT Version 2.2• BASIC Stamp Syntax and Reference Manual Version 2.12Tactile Navigation with the BOE-BOT(Wall following using whiskers)The following is an excerpt from Robotics, Version 2.2:“Many types of robotic machinery rely on a variety of tactile switches. For example, a tactile switch may detect when a robotic arm has encountered an object. The robot can be programmed to pick up the object and place it elsewhere. Factories use tactile switches to count objects on a production line, and also for aligning objects during industrial processes. In this chapter, you will build tactile switches, called whiskers, onto your BOE-BOT and test them. You will then program the BOE-BOT to monitor the state of these switches, and to decide what to do when it encounters an obstacle. The end result will be autonomous navigation by touch.The whiskers are so named because that is what these bumper switches look like, though some argue they look more like antennae. Whiskers give the BOE-BOT the ability to sense the world around it through touch, much like the antennae on an ant or the whiskers on a cat.BOE-BOT Lecture #4 EGR 120 – Introduction to Engineering3BOE-BOT Lecture #4 EGR 120 – Introduction to EngineeringWhiskers4Adding whiskers to the BOE-BOTIf your BOE-BOT is not already equipped with whiskers, following the instructions shown from Robotics, Version 2.2 to add the whiskers. If your BOE-BOT is equipped with whiskers, skip to the next page.BOE-BOT Lecture #4 EGR 120 – Introduction to EngineeringHeader5Adding a whisker circuit to the BOE-BOTShown below is a circuit to read the status of each whisker. It works as follows: The whiskers are connected to standoffs on the BOE which are connected to ground (Vss). When the BOE-BOT runs into a wall, the whisker touches a “header” on the breadboard which will make a connection to a point in the circuit below (see next page). A whisker hitting a wall is equivalent to closing a switch in the circuit below. In the circuit, if the right whisker hits a wall, it makes a connection to Vss making P7 LOW. If the whiskers is not pressed, P7 remains HIGH. In this way we can tell when each whiskers hits a wall by monitoring the states of P5 and P7.BOE-BOT Lecture #4 EGR 120 – Introduction to Engineering6Adding a whisker circuit to the BOE-BOTShown below is a circuit to read the status of each whisker. It works as follows: TheBOE-BOT Lecture #4 EGR 120 – Introduction to EngineeringWhen the left whisker hits a wall, it is pushed into the header, essentially connecting the header to ground (Vss).HeaderThe whisker is connected to the corner of the BOE, which is connected to ground (Vss)7Whisker test circuit It is nice to have a test circuit, so that we can tell if the whiskers are working properly. An easy solution if to add two LED (with series resistors) so that one LED lights when the left whisker hits a wall and the other LED lights when the right whisker hits a wall.BOE-BOT Lecture #4 EGR 120 – Introduction to Engineering8Final result: Whisker control circuit with LED test circuit.Shown below is the BOE-BOT with the whisker control circuit (see Figure 5-4) and the LED whisker test circuit (see Figure 5-7). You will need to add this circuit to your BOE-BOT.BOE-BOT Lecture #4 EGR 120 – Introduction to EngineeringNote: Ignore the round, black buzzer and the wire connecting it to P4. We will not be using the buzzer.9Additional PBASIC InstructionsBefore testing the whiskers, a few new PBASIC instructions need to be introduced.BOE-BOT Lecture #4 EGR 120 – Introduction to EngineeringInputs to the Basic StampThe BASIC Stamp can easily determine whether an input connected to a pin is HIGH or LOW by checking its value. This is done using:INpin where pin can be 0 through 15so IN3 will have the value 1 if a HIGH (5V) input is connected to P3 IN4 will have the value 0 if a LOW (0V) input is connected to P410BOE-BOT Lecture #4 EGR 120 – Introduction to EngineeringDecision structuresMost programming languages support various types of decision structures which allows the program to branch and perform different tasks based on some sort of logical test. A common type of decision structure is the IF .. THEN structure.IF (Logical Statement) THEN statements so that the program can respond one way when the logical statement is true and another way when it is false. Sometimes this is illustrated with a diagram as shown.Do this if true Do this if falseLogicalTestTF11BOE-BOT Lecture #4 EGR 120 – Introduction to EngineeringIF .. THEN statement in PBASICIF (Logical Test) THEN Instructions to perform if the test is trueENDIFOrIF (Logical Test) THEN Instructions to perform if the test is trueELSE Instructions to perform if the test is falseENDIFExamples of Logical Tests:X > 2IN3 = 0IN7 <> 0 (not equal)A <= BA+B >= C+DExample:IF (X < 0) THEN DEBUG “X is negative”ENDIFExample:IF (IN8 = 0) THEN DEBUG “P8 is LOW”ELSE DEBUG “P8 is HIGH”ENDIF12BOE-BOT Lecture #4 EGR 120 – Introduction to EngineeringSubprograms in PBASICIn order to repeat useful sections of code, subprograms (or subroutines) are often used. Functions are also used for this purpose in other programming languages.For example, suppose that at several points in a program you wanted to cause an LED connected to P3 to blink on and off ten times. Instead of repeating the instructions several times, they could be placed in a subprogram as shown below.‘ Main programN VAR BYTEGOSUB Blink ‘Call subroutine BlinkOther instructions….GOSUB Blink ‘Call subroutine BlinkOther instructions….GOSUB Blink ‘Call subroutine BlinkOther instructionsOther instructions….END ‘End of main program‘-----Subroutine Blink is listed below---------Blink:FOR N = 1 TO 10 HIGH 3 PAUSE 500 LOW 3 PAUSE 500NEXTRETURNNote that three new PBASIC commands were introduced in this example. Discuss each.GOSUB LabelLabel:RETURN13Testing the


View Full Document
Download Navigating the BOE BOT with whiskers
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Navigating the BOE BOT with whiskers and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Navigating the BOE BOT with whiskers 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?