+ All Categories
Home > Documents > 1 Presentation based on: “Robotics: with the Boe-Bot" Parallax, Inc. 599 Menlo Drive Suite 100...

1 Presentation based on: “Robotics: with the Boe-Bot" Parallax, Inc. 599 Menlo Drive Suite 100...

Date post: 17-Dec-2015
Category:
Upload: gavin-tracy-hunt
View: 214 times
Download: 0 times
Share this document with a friend
30
1 Presentation based on: “Robotics: with the Boe-Bot" Parallax, Inc. www.parallax.com 599 Menlo Drive Suite 100 Rocklin, CA 95765
Transcript

1

                      

Presentation based on:

“Robotics: with the Boe-Bot" Parallax, Inc.

www.parallax.com599 Menlo Drive

Suite 100Rocklin, CA 95765

2

                      

Copyrights and TrademarksCopyrights and TrademarksThis documentation is copyright 2004 by Parallax, Inc. By downloading or obtaining a printed copy of this documentation or software you agree that it is to be used exclusively with Parallax products. Any other uses are not permitted and may represent a violation of Parallax copyrights, legally punishable according to Federal copyright or intellectual property laws. Any duplication of this documentation for commercial uses is expressly prohibited by Parallax, Inc. Duplication for educational use is permitted subject to the following conditions: Parallax grants the user a conditional right to download, duplicate, and distribute this text without Parallax's permission. This right is based on the following conditions: the document, or any portion thereof, may not be duplicated for commercial use; it may be duplicated only for educational purposes when used solely in conjunction with Parallax products, and the user may recover from the student only the cost of duplication.

BASIC Stamp, Stamps in Class, and Board of Education are registered trademarks of Parallax, Inc. If you decide to use the names BASIC Stamp, Stamps in Class, and/or Board of Education on your web page or in printed material, you must state that "BASIC Stamp is a registered trademark of Parallax, Inc.," "Stamps in Class is a registered trademark of Parallax, Inc.," and/or "Board of Education is a registered trademark of Parallax, Inc.," respectively, upon the first appearance of the trademark name. Other brand and product names are trademarks or registered trademarks of their respective holders.

3

                      

What's New In RoboticsWhat's New In Robotics

New Servos• Adjustable potentiometer• Faster, quieter, draw less

power New Board of Education

• Power Switch• Jumper

New Wheels and Tires New Whiskers New Infrared Emitters New Text – v2.0

B la ckR e d

X 4 X5

15 14 13 12V dd

V in

4

                      

Select the Servo Power SupplySelect the Servo Power Supply

New jumper - connects servo power to either• Vin – Battery Voltage• Vdd – Regulated 5V supply

Select Vin for use with 4 AA batteriesPull jumper off pins, then push onto Vin pin

B la ckR e d

X 4 X 5

15 14 13 12V dd

V in

5

                      

Center the Boe-Bot ServosCenter the Boe-Bot Servos Plug the battery pack into the BOE

• Note the correct polarity Plug the servos in to the BOE

• Important!! Black wire closest to breadboard! Turn the switch to Position 1 Enter and Run "CenterServoP12.bs2" pg. 65 Repeat for "CenterServoP13.bs2" pg. 66

6

                      

Center the Boe-Bot ServosCenter the Boe-Bot Servos

Move the switch to Position 2 If the servos do not stay still, adjust them

with your Parallax screwdriver• Do not push too hard• Use the Phillips end

Adjust each servo so it stays completely still

7

                      

Build the Boe-BotBuild the Boe-Bot

Build the robot by following instructions from your manual (pages 85-99)

8

                      

Build the Start/Reset IndicatorBuild the Start/Reset Indicator

Brownout• Batteries drop below 5.2 V• Brownout detector circuit resets

the BASIC Stamp• Program starts over from

beginning

Low Battery Indicator• Add speaker to Boe-Bot• "Beep" first thing in program

If Boe-Bot beeps during navigation, must have reset

Thus batteries are low

P4

Vss

P15P14P13P12P11P10P9P8P7P6P5

P3P2P1P0

P4

X 2

X 3

V dd V ssV in

Board of Education © 2000-2003Rev C

V dd

B lackR ed

X4 X5

15 14 13 12

To S ervos

+

9

                      

Test the Low Battery IndicatorTest the Low Battery Indicator

Run "StartResetIndicator.bs2"Test by pressing the Reset button on the BOEShould beep each time reset

DEBUG CLS, "Beep!!!" ' Display while speaker beeps.

FREQOUT 4, 2000, 3000 ' Signal program start/reset.

DO ' DO...LOOP

DEBUG CR, "Waiting for reset…" ' Display message

PAUSE 500 ' every 0.5 seconds

LOOP

10

                      

Servo PositioningServo Positioning Direction

• Determined by the width of the pulse Distance

• Each pulse causes the servo to rotate a small amount Speed

• Maximum at 1.3 and 1.7 ms.• Decreases as approaches 1.5 ms

Pulse Width

Direction of Rotation

PULSOUT Period

1.3 ms Clockwise 650

1.5 ms Stopped 750

1.7 ms Counter-clockwise

850

11

                      

Controlling DistanceControlling Distance

Run "BoeBotForwardThreeSeconds.bs2"Follow the instructions on p. 118 to make

the Boe-Bot go half as far forwardAdd code to make the Boe-Bot go

backward, left, and right, as shown on pages 119-120

FOR counter = 1 TO 122

PULSOUT 13, 850

PULSOUT 12, 650

PAUSE 20

NEXT

12

                      

EEPROM NavigationEEPROM Navigation

Run "EEPROMNavigation.bs2" p. 141 Modify the DATA directive to make your own

motion sequence• DATA "FFFBBLFFRFFQ"

F = Forward, B = Backward, L = Left, R = Right, Q = Quit

address VAR Byte

instruction VAR Byte

' Address: 0123456789

' ||||||||||

DATA "FLFFRBLBBQ"

DO

READ address, instruction

address = address + 1

SELECT instruction

CASE "F": GOSUB Forward

CASE "B": GOSUB Backward

CASE "L": GOSUB Left_Turn

CASE "R": GOSUB Right_Turn

ENDSELECT

LOOP UNTIL instruction = "Q"

13

                      

Tactile Navigation with WhiskersTactile Navigation with Whiskers

Activities:Building and Testing the Whiskers

• Page 154-165• See also wiring diagram next slide

14

                      

Build the Whisker CircuitBuild the Whisker Circuit

P7

P5

Vss Vss

Vdd Vdd

R igh t W hisker

LeftW hisker

10 k10 k

220

220

P15P14P13P12P11P10P9P8

P6

P3P2P1P0

P7

P5P4

X 2

X 3

V dd V ssV in

Board of Education © 2000-2003Rev C

V dd

B lackR ed

X4 X5

15 14 13 12

To S ervos

Left W h isker

R igh t W h isker

+

15

                      

Testing the WhiskersTesting the Whiskers

Run "TestWhiskers.bs2" p.160Press on each whisker and examine the

Debug Terminal output.Each whisker should display 1 when not

pressed, 0 when pressed.Position the whisker wires to make good

contact with the headers DEBUG "WHISKER STATES", CR,

"Left Right", CR,

"------ ------"

DO

DEBUG CRSRXY, 0, 3,

"P5 = ", BIN1 IN5,

" P7 = ", BIN1 IN7

PAUSE 50

LOOP

16

                      

Navigation With WhiskersNavigation With Whiskers

Run "Roaming with Whiskers.bs2"Compare with pushbuttons exercise

from the previous dayDO

IF (IN5 = 0) AND (IN7 = 0) THEN ' Both whiskers detect obstacle

GOSUB Back_Up ' Back up & U-turn (left twice)

GOSUB Turn_Left

GOSUB Turn_Left

ELSEIF (IN5 = 0) THEN ' Left whisker contacts

GOSUB Back_Up ' Back up & turn right

GOSUB Turn_Right

ELSEIF (IN7 = 0) THEN ' Right whisker contacts

GOSUB Back_Up ' Back up & turn left

GOSUB Turn_Left

ELSE ' Both whiskers 1, no contacts

GOSUB Forward_Pulse ' Apply a forward pulse

ENDIF ' and check again

LOOP

17

                      

Navigation with Infrared HeadlightsNavigation with Infrared Headlights

Activities:Understanding Infrared Object DetectionBuilding and Testing the IR CircuitObject Detection and AvoidanceObject Detection and Avoidance in Real-Time

18

                      

Using Infrared Headlights to See Using Infrared Headlights to See the Roadthe Road

IR reflect off obstacles IR LED emits light in infrared region (780 nm)Detector shows "0" if detects IR, "1" otherwiseDetector tuned to 38,500 Hz only

19

                      

Building and testing the IR PairsBuilding and testing the IR PairsVdd

Vss

P9

P8

IRLED

Vss

1 k

220

Vdd

Vss

P0

P2

IRLED

Vss

1 k

220

P 15P 14P 13P 12P 11P 10

P 7P 6P 5

P 3

P 1

P 9P 8

P 4

P 2

P 0X 2

X 3

V dd V s sV in

Board of Education © 2000-2003Rev C

Vdd

B lackR e d

X4 X 5

15 14 13 12

To S ervos

+

Run "TestLeftIrPair.bs2" Follow directions on p. 223 to

test right IR pair

20

                      

How the IR Test Program WorksHow the IR Test Program Works' Robotics with the Boe-Bot - TestLeftIrPair.bs2

' Test IR object detection circuits, IR LED connected to P8

' and detector connected to P9.

' {$STAMP BS2}

' {$PBASIC 2.5}

irDetectLeft VAR Bit

DO

FREQOUT 8, 1, 38500

irDetectLeft = IN9

DEBUG HOME, "irDetectLeft = ", BIN1 irDetectLeft

PAUSE 100

LOOP

21

                      

Object Detection and AvoidanceObject Detection and Avoidance

Run "RoamingWithIr.bs2"

Place the Boe-Bot on the floorYour Boe-Bot should roam around and

avoid objects

IF (irDetectLeft = 0) AND (irDetectRight = 0) THEN

GOSUB Back_Up

GOSUB Turn_Left

GOSUB Turn_Left

ELSEIF (irDetectLeft = 0) THEN

GOSUB Back_Up

GOSUB Turn_Right

ELSEIF (irDetectRight = 0) THEN

GOSUB Back_Up

GOSUB Turn_Left

ELSE

GOSUB Forward_Pulse

ENDIF

22

                      

Fast IR RoamingFast IR Roaming

Run "FastIRRoaming.bs2"Again the Boe-Bot should roam around

and avoid objectsObserve: How does this behavior differ

from that of "RoamingWithIr.bs2"?

IF (irDetectLeft = 0) AND (irDetectRight = 0) THEN

pulseLeft = 650

pulseRight = 850

ELSEIF (irDetectLeft = 0) THEN

pulseLeft = 850

pulseRight = 850

ELSEIF (irDetectRight = 0) THEN

pulseLeft = 650

pulseRight = 650

ELSE

pulseLeft = 850

pulseRight = 650

ENDIF

23

                      

Understanding Filter SensitivityUnderstanding Filter Sensitivity

P1 5P1 4P1 3P1 2P1 1P1 0P9

P5

P3

P8P7

P2P1P0

P6

P4

X2

X3

Vd d Vs sVin

Boar d of Education © 20 00 -2 00 3

Vd d

Black

Red

X4 X5

1 5 14 1 3 12

+

ObjectObject

Zone 5No Detectiona t any Frequency

Zone 437500 Hz

Zone 338250 Hz

Zone 239500 Hz

Zone 140500 Hz

Zone 041500 Hz

24

                      

Testing Distance DetectionTesting Distance Detection

Run "TestLeftFrequencySweep.bs2"

Place the Boe-Bot in front of some obstacle (Wall, book, etc)

Observe the readings change as you move the Boe-Bot closer to and further away from the obstacle

25

                      

Boe-Bot Shadow VehicleBoe-Bot Shadow Vehicle

Follow the detailed instructions on p. 259-260

In summary:• Run "FollowingBoeBot.bs2" • Place a sheet of paper in front of your Boe-Bot• Move the paper around • The Boe-Bot should follow the paper at a

constant distance

If the Boe-Bot backs away instead, contact the instructor for assistance. Your right/left servos are probably reversed.

26

                      

Boe-Bot Follow-the-LeaderBoe-Bot Follow-the-Leader

Place sticky notes on the back of all Boe-Bots

Now select two or three Boe-Bots from the class to be "Leader" Boe-Bots

Create "Leader" Boe-Bots by following the instructions on p. 263

All other Boe-Bots keep the previous program, "FollowingBoeBot.bs2"

The "Shadow" Boe-Bots will follow the "Leader" Boe-Bots

See how many Boe-Bots will follow in a row, like a train

27

                      

Following a StripeFollowing a Stripe

Create Stripe-Following Boe-Bots Follow the instructions on pp. 264-

271Make sure to point IR pairs

downward as detailed in text

28” (70 cm)

22

” (5

6 cm

)

w w w . st a m ps i nc la ss .c om

R eset

S TAM PS C LAS S

in

B o a r d o f E d uc a t i o n

Pw r

9 V dcB a t t er y

6-9VD C

S out

S in

AT N

V ssP 0

P 1

P 2

P 3P 4

P 5

P 6

P 7

P 11

P 9

P 8

V in

P 10

P 15

P 14

P 13

P 12

V dd

R st

V ss

Bl ack

R ed

X 4 X 5

15 1 4 13 1 2

1

X 1

V ssP 1P 3P 5P 7P 9P 11P 13P 15V in

V ssP 0P 2P 4P 6P 8P 10P 12P 14V dd

U 1

TM

0 1 2

© 2 000 -2 003

V dd

P 15P 14P 13P 12P 11P 10P 9P 8P 7P 6P 5P 4P 3P 2P 1P 0

X 2

X 3V dd V ssV in

P 15P 14P 13P 12P 11P 10P 9P 8

P 4

P 2P 1P 0

P 7P 6P 5

P 3

X 2

X 3V dd V ssV in

R ev C

+

www.stampsinclass.com

Reset

STAMPS CLASSin

Board of Education

Pwr

9 VdcBattery

6-9VDC

SoutSin

ATN

Vss

P0

P1P2

P3

P4

P5

P6P7

P11

P9P8

Vin

P10

P15

P14P13

P12

Vdd

Rst

Vss

Black

Red

X4 X5

15 14 13 12

1

X1

VssP1P3P5P7P9P11P13P15Vin

VssP0P2P4P6P8P10P12P14Vdd

U1

TM

0 1 2

© 2000-2003

Vdd

P15P14P13P12P11P10P9P8P7P6P5P4P3P2P1P0

X2

X3VddVss Vin

P15P14P13P12P11P10P9P8

P4

P2P1P0

P7P6P5

P3

X2

X3VddVss Vin

Rev C

+

Start

Finish

28

                      

Focus on Proportional ControlFocus on Proportional Control The Boe-Bot will follow a moving object by maintaining a

constant distance from it. The amount of correction is directly proportional to the error. That is, the Boe-Bot will speed up or slow down a varying amount, depending on how far away the object is.

DistanceReading

Meaning Left Wheel PULSOUT

WheelDirection

Robot motion

0 Far Away 650 Clockwise Backward fast

2 Desired distance

680 Clockwise Backward slow

5 Very close 750 Stopped Stopped

820 Counter-clockwise

Forward slow

850 Counter-clockwise

Forward fast

29

                      

Proportional Control Block DiagramProportional Control Block Diagram

DesiredDistance

MeasuredDistance

Boe-Bot is… What todo…

Error OutputAdjustment

Left Servo Output

Robot Motion

2 4 A bit too close Go backward 2–4 = -2

-35 * -2 = -70

750 + (-70) = 680

Backwards slow

2 5 Much too close Go backward 2-5 = -3

-35 * -3 = -105

750 + (-105) = 645

Backwards fast

2 1 Much too far away

Go forward ? ? ? ?

2 2 A bit too far away

? ? ? ? ?

System

Error = -2Kp X error

-35 X -2

Center pulse w idth750

O utput adjust

+70

Left servooutput

820

Measured leftd istance = 4

-

+++

30

                      

The EndThe End

We hope you enjoyed this Educator's Course

Don't hesitate to contact us for any reason!


Recommended