1
Autonomous Rover A Path Following and Obstacle Avoidance Vehicle RIT Computer Engineering Senior Design Project Bryan Allen and Jonathan Wyant Thursday, February 10, 2005 Inspiration: This project is a prototype for a naval autopilot system. The proposed system would guide naval vessels in and out of harbors avoiding traffic and shallow areas. Description: The autonomous rover is a self-contained path following and obstacle avoidance vehicle. It will traverse a path defined by red and green tape and avoid obstacles within the path without going outside path boundaries. No input is required from the user other than turning the system on or off. Implementation: •The system utilizes an Infra- red Sensor Network to view the environment around it. The sensor network can cover roughly a 180 degree arc 6-10 inches away from the vehicle. •The sensor arc is divided into sectors. Each sector represents a different path that the rover can take when it needs to avoid an obstacle. •As long as one sector is free, the rover will continue to operate. Figure 1: Autonomous Rover on Path Figure 2: Autonomous Rover – Front View •Light-to-Voltage sensors are used for path boundary detection. •If a path boundary was encountered, it will not be possible for the rover to move back in the direction of the boundary for the next 3 seconds. Sector 1 Sector 3 Sec tor 5 Sector 2 Rover Sec to r 4 IR1 IR2 IR3 IR4 IR6 IR5 IR8 IR7 In this situation we assume we just hit the Green Path Edge, meaning we cannot go to the right. This blocks Sector 3 and Sector 5. There is an obstacle in front of us that we have to avoid. This blocks Sector 1. There is an obstacle blocking Sector 4. The only free sector we can turn to is Sector 2. So the rover will turn so that it is facing Sector 2 and proceed forward. Sector 1 Sector 3 Secto r 5 S e c t o r 2 Rover S ect o r 4 IR1 IR2 IR3 IR4 IR6 IR5 IR8 IR7 Obstacle Obstacle Cost Breakdown Description Vendor Unit Cost Unit s Our Cost Total Cost Acroname Brainstem GP 1.0 Acroname 79.00 1 79.00 79.00 TAOS TSLX257 LTV Sensors TAOS, Inc. 6.74 4 Free Samples 26.96 Sharp GP2D15 IR Sensors w/ Cable Acroname 11.50 8 92.00 92.00 Sheet of Material (Lexan) Niagara Hobby & Craft Mart 17.59 1 17.59 17.59 Battery Pack w/ Connector Acroname 3.50 2 7.00 7.00 Colored Duct Tape Jo-Ann Ect. 4.29 4 17.16 17.16 4Pk AAA Battery Case Radio Shack 1.89 1 1.89 1.89 ICB86 PC Boards Radio Shack 1.79 3 5.37 5.37 LM341T-0.5 Voltage Regulator (+5V) DigiKey 0.82 1 0.82 0.82 4Pk AAA Batteries (Energizer E2 Lithium) BestBuy 11.99 1 11.99 11.99 4Pk AA Batteries (Energizer E2 Lithium) BestBuy 12.99 2 25.98 25.98 Serial Interface Connector Acroname 10.00 1 10.00 10.00 Black Wheels with Black Bands Acroname 2.50 4 10.00 10.00 Standard Servo w/cont, BB Acroname 21.00 4 84.00 84.00 IC Socket (16pin) Radio Shack 1.29 1 1.29 1.29 Wiring (22 Guage) Radio Shack 4.29 1 4.29 4.29 35 Crimps and Housings Acroname 11.00 2 22.00 22.00 Servo Motor Mount Brackets Reynolds Electronics 5.75 2 11.50 11.50 Heat Sink Radio Shack 1.69 1 1.69 1.69 Heat Sink Mounting Hardware Radio Shack 1.69 1 1.69 1.69 Servo Encoder Acroname 32.95 1 32.95 32.95 PermaMount Tape Radio Shack 1.99 2 3.98 3.98 Two-Way Toggle Switch Radio Shack 2.99 1 2.99 2.99 SN74LS257BN Multiplexer DigiKey 0.72 1 On Hand 0.72 Lego Blocks Various Kits N/A N/A N/A N/A DM74LS02N NOR Gates DigiKey 0.53 2 On Hand 1.06 Red LEDs DigiKey 0.07 5 On Hand 0.35 100 Flat Lego 2x2 Squares Lego@Home 6.99 1 6.99 6.99 Grand Total (less tax, s/h) $452.2 7 $481.46 -All aspects ofN avigation are handled atthe R eflex Level. -The TEA VM Level includes tw o program s,one to view IR Sensordata and m ake a decision on w here to turn,and the otherto countrevolutions from the ShaftEncoder. IR Sensor s LT V S ensor s Brainstem S e rvo M otors Logic C ode (TEA VM ) L T V S en sors tri gge rR ef l exe s t o hand le Path Follow ing. Se r vo M otor s respo nd to co m m and s from the R eflexes. The Sha f t En coderpasses its in f o r mation to a TEA VM prog r am . The TEA VM the n passes the info rm ation to the R ef lexes, which control t he Servo M ot ors. IR Sens o r s c om m uni c ate w ith the Log i c C ode atthe TE A VM level. The code th en pas s es i nformation on to t he R e fl exes to handle Na v i ga t i on . R eflex C ode (EEPROM) Sh a f t En co der Figure 3: System Block Diagram illustrating the relationship between different layers of processing and control. Bryan Allen Jonathan Wyant 6V (Servos) U1 74LS257 15 1 4 7 9 12 2 5 11 14 3 6 10 13 G A/B 1Y 2Y 3Y 4Y 1A 2A 3A 4A 1B 2B 3B 4B A - + MG1 MOTOR SERVO 1 2 U2C 74LS02 8 9 10 D5 LED SW1 SW 3PDT LTVGR TSLG257 GND PWR Output BT12 1.5V AA BT6 1.5V AA BT9 1.5V AA U4 LM341/TO (5V) 1 3 IN OUT A - + MG0 MOTOR SERVO 1 2 R3 750 D1 LED BT1 1.5V AAA R1 750 BT11 1.5V AA U2B 74LS02 5 6 4 Shaft Encoder WW01 ChA ChB GND VCC Dir GND Clk VCC 6V (Sensor) Sensor_1 GP2D15 Output PWR GND LTVRR TSLR257 GND PWR Output BT3 1.5V AAA U3A 74LS02 2 3 1 U2A 74LS02 2 3 1 R2 750 Sensor_4 GP2D15 Output PWR GND Sensor_5 GP2D15 Output PWR GND BT10 1.5V AA A - + MG2 MOTOR SERVO 1 2 LTVGL TSLG257 GND PWR Output Sensor_3 GP2D15 Output PWR GND U2D 74LS02 11 12 13 Sensor_6 GP2D15 Output PWR GND LTVRL TSLR257 GND PWR Output BT5 1.5V AA BT4 1.5V AAA BT8 1.5V AA D2 LED Sensor_8 GP2D15 Output PWR GND R5 750 D4 LED Sensor_7 GP2D15 Output PWR GND D3 LED Brainstem GP 1.0 I2C[0..12] Serial[0..4] Servo-PWR Servo-GND Logic-PWR Logic-GND Servo3 Servo2 Servo1 Servo0 Digital0 Digital1 Digital2 Digital3 Digital4 Analog0 Analog1 Analog2 Analog3 Analog4 A - + MG3 MOTOR SERVO 1 2 BT2 1.5V AAA Sensor_2 GP2D15 Output PWR GND 6V (Logic) BT7 1.5V AA R4 750 Figure 4: Sector Definitions and IR Sensor Placements Figure 6: Algorithm Example Figure 5: LTV Mounting Housings Figure 7:Hardware Schematic IR SensorN etw ork Initialize Variables -Turn D irection -Turn Am ount -H itPath C ode -IR SensorD ata (0-7) -WaitCode=1 M ain Loop SelectLeftIR Sensors R ead IR Sensor Values SelectR ightIR Sensors R ead IR Sensor Values H itPath Code O verride Sensors 3,6,8 G etHitPathCode O verride Sensors 4,5,7 Right Left Sensor1 or2 DetectObstacle W e hitthe leftside ofthe path less than 3 seconds ago and are notallow ed to go leftyet. W e hitthe right side ofthe path less than 3 seconds ago and are notallow ed to go rightyet. STO P True Sensor4 and 5 do notDetectO bstacle -Save LeftTurn C ode -Save SoftTurn C ode True Sensor3 and 6 do notDetectO bstacle False -Save R ight Turn C ode -Save SoftTurn C ode True Sensor5 and 7 do notDetectO bstacle -Save LeftTurn C ode -Save H ard Turn C ode True Sensor6 and 8 do notDetectO bstacle False -Save R ight Turn C ode -Save H ard Turn C ode True False Save D ata to ScratchPad TURN False ShaftEncoder Initialize Variables -C urrentV alue -Previous Value -C ounter -TurnAm ount R ead A2D Port and save as Prev. Value C ounting Loop R ead A2D Port and save as C ur. Value C ur.> (Prev.+ 512) Prev.Value = C ur.Value W ill detectonly Low -to-H igh transitions on the A2D Port N ote:This code runs significantly faster than the m axim um speed ofthe servo m otor.(otherw ise itw ill m iss transition counts) M ax servo rotation period w ith no friction = 1 transition per30m s True A G et TurnAm ount from the S cratchPad Assign counter based on how far w e are turning. Valid TurnAm ount C ode? D ecrem ent C ounter ENABLERS GO False C ounter= 0 C ounter> 0 W rite W aitCode to ScratchPad C onfigure D igital I/O Ports WaitLoop R ead W aitCode from ScratchPad -W rite W aitC ode=1 to ScratchPad -SetWaitCode=1 This loop keeps anotherinstance ofthis code from running until w e have com pleted the chosen turn action. W ithoutitw e w ill chose and attem ptto enacta turn every tim e w e read new data values,w hich is far too fastforthe firstaction to have been com pleted. W aitC ode is cleared by EN ABLER S w hich is called at the com pletion ofa TU R N eventby ShaftEncoder. W aitC ode != 0 Figure 8: TEA VM Software Flowcharts Figure 8: Project Cost Breakdown Acroname’s Brainstem GP 1.0 Texas Advanced OptoElectronic’s LTV Sensors Sharp’s GP2D15 Digital IR Sensors Acroname’s Continuous Rotation Servo Motors Special Thanks to Mark Whitney from Acroname, Inc.

Autonomous Rover A Path Following and Obstacle Avoidance Vehicle RIT Computer Engineering Senior Design Project Bryan Allen and Jonathan Wyant Thursday,

  • View
    223

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Autonomous Rover A Path Following and Obstacle Avoidance Vehicle RIT Computer Engineering Senior Design Project Bryan Allen and Jonathan Wyant Thursday,

Autonomous RoverA Path Following and Obstacle Avoidance Vehicle

RIT Computer Engineering Senior Design Project

Bryan Allen and Jonathan WyantThursday, February 10, 2005

Inspiration: This project is a prototype for a naval autopilot system. The proposed system would guide naval vessels in and out of harbors avoiding traffic and shallow areas.

Description: The autonomous rover is a self-contained path following and obstacle avoidance vehicle. It will traverse a path defined by red and green tape and avoid obstacles within the path without going outside path boundaries. No input is required from the user other than turning the system on or off.

Implementation: •The system utilizes an Infra-red Sensor Network to view the environment around it. The sensor network can cover roughly a 180 degree arc 6-10 inches away from the vehicle.•The sensor arc is divided into sectors. Each sector represents a different path that the rover can take when it needs to avoid an obstacle.•As long as one sector is free, the rover will continue to operate.

Figure 1: Autonomous Rover on Path Figure 2: Autonomous Rover – Front View

•Light-to-Voltage sensors are used for path boundary detection.•If a path boundary was encountered, it will not be possible for the rover to move back in the direction of the boundary for the next 3 seconds.

Sector 1 Sector 3

Sector 5

Sec

tor 2

Rover

Sec

tor

4

IR1 IR2IR3 IR4

IR6 IR5

IR8 IR7

In this situation we assume we just hit the Green Path Edge, meaning we cannot go to the right. This blocks Sector 3 and Sector 5. There is an obstacle in front of us that we have to avoid. This blocks Sector 1. There is an obstacle blocking Sector 4. The only free sector we can turn to is Sector 2. So the rover will turn so that it is facing Sector 2 and proceed forward.

Sector 1

Sector 3

Sector 5

Sec

tor

2

Rover

Sec

tor

4

IR1

IR2

IR3

IR4

IR6

IR5

IR8

IR7

Obstacle

Obstacle

Cost BreakdownDescription Vendor Unit Cost Units Our Cost Total Cost

Acroname Brainstem GP 1.0 Acroname 79.00 1 79.00 79.00

TAOS TSLX257 LTV Sensors TAOS, Inc. 6.74 4 Free Samples

26.96

Sharp GP2D15 IR Sensors w/ Cable Acroname 11.50 8 92.00 92.00

Sheet of Material (Lexan) Niagara Hobby & Craft Mart 17.59 1 17.59 17.59

Battery Pack w/ Connector Acroname 3.50 2 7.00 7.00

Colored Duct Tape Jo-Ann Ect. 4.29 4 17.16 17.16

4Pk AAA Battery Case Radio Shack 1.89 1 1.89 1.89

ICB86 PC Boards Radio Shack 1.79 3 5.37 5.37

LM341T-0.5 Voltage Regulator (+5V) DigiKey 0.82 1 0.82 0.82

4Pk AAA Batteries (Energizer E2 Lithium) BestBuy 11.99 1 11.99 11.99

4Pk AA Batteries (Energizer E2 Lithium) BestBuy 12.99 2 25.98 25.98

Serial Interface Connector Acroname 10.00 1 10.00 10.00

Black Wheels with Black Bands Acroname 2.50 4 10.00 10.00

Standard Servo w/cont, BB Acroname 21.00 4 84.00 84.00

IC Socket (16pin) Radio Shack 1.29 1 1.29 1.29

Wiring (22 Guage) Radio Shack 4.29 1 4.29 4.29

35 Crimps and Housings Acroname 11.00 2 22.00 22.00

Servo Motor Mount Brackets Reynolds Electronics 5.75 2 11.50 11.50

Heat Sink Radio Shack 1.69 1 1.69 1.69

Heat Sink Mounting Hardware Radio Shack 1.69 1 1.69 1.69

Servo Encoder Acroname 32.95 1 32.95 32.95

PermaMount Tape Radio Shack 1.99 2 3.98 3.98

Two-Way Toggle Switch Radio Shack 2.99 1 2.99 2.99

SN74LS257BN Multiplexer DigiKey 0.72 1 On Hand 0.72

Lego Blocks Various Kits N/A N/A N/A N/A

DM74LS02N NOR Gates DigiKey 0.53 2 On Hand 1.06

Red LEDs DigiKey 0.07 5 On Hand 0.35

100 Flat Lego 2x2 Squares Lego@Home 6.99 1 6.99 6.99

Grand Total (less tax, s/h)       $452.27 $481.46

-All aspects of Navigation are handled at the Reflex Level.-The TEA VM Level includes two programs, one to view IRSensor data and make a decision on where to turn, and theother to count revolutions from the Shaft Encoder.

IR Sensors

LTV S

enso

rs

Brainstem

Servo Motors

Logic Code

(TE

A V

M)

LTV S

enso

rs tr

igger

Ref

lexes

to h

andle

Pat

h Foll

owing

.

Servo Motors respond to

comm

ands from the Reflexes.

The S

haft

Encod

er p

asse

s its

infor

mat

ion

to a

TEA V

M p

rogr

am.

The T

EA VM

then

pass

es th

e inf

orm

ation

to th

e Ref

lexes

,

which

cont

rol th

e Ser

vo M

otor

s.

IR Sensors communicate with the

Logic Code at the TEA VM level.

The code then passes information on

to the Reflexes to handle Navigation.Reflex Code(EEPROM)

Shaft

Encod

er

Figure 3: System Block Diagram illustrating the relationship between different layers of processing and control.

Bryan Allen

Jonathan Wyant

6V (Servos)

U1

74LS257

151

47912

25

1114

36

1013

GA/B

1Y2Y3Y4Y

1A2A3A4A

1B2B3B4B

A-

+

MG1

MOTOR SERVO

12

U2C

74LS02

8

910

D5

LED

SW1

SW 3PDT

LTVGR

TSLG257

GNDPWR

Output

BT121.5V AA

BT61.5V AA

BT91.5V AA

U4

LM341/TO (5V)

13INOUT

A-

+

MG0

MOTOR SERVO

12

R3750

D1

LED

BT11.5V AAA

R1750

BT111.5V AA

U2B

74LS02

5

64

Shaft Encoder

WW01

ChA

ChBGND

VCC

DirGNDClkVCC

6V (Sensor)

Sensor_1

GP2D15

Output

PWRGND

LTVRR

TSLR257

GNDPWR

Output

BT31.5V AAA

U3A

74LS02

2

31

U2A

74LS02

2

31

R2750

Sensor_4

GP2D15

Output

PWRGND

Sensor_5

GP2D15

Output

PWRGND

BT101.5V AA

A-

+

MG2

MOTOR SERVO

12

LTVGL

TSLG257

GNDPWR

Output

Sensor_3

GP2D15

Output

PWRGND

U2D

74LS02

11

1213

Sensor_6

GP2D15

Output

PWRGND

LTVRL

TSLR257

GNDPWR

Output

BT51.5V AA

BT41.5V AAA

BT81.5V AA

D2

LED

Sensor_8

GP2D15

Output

PWRGND

R5750

D4

LED

Sensor_7

GP2D15

Output

PWRGND

D3

LED

Brainstem GP 1.0

I2C[0..12]

Serial[0..4]

Servo-PWRServo-GND

Logic-PWRLogic-GND

Serv

o3Se

rvo2

Serv

o1Se

rvo0

Digit

al0Di

gital1

Digit

al2Di

gital3

Digit

al4

Analo

g0An

alog1

Analo

g2An

alog3

Analo

g4

A-

+

MG3

MOTOR SERVO

12

BT21.5V AAA

Sensor_2

GP2D15

Output

PWRGND

6V (Logic)

BT71.5V AA

R4750

Figure 4: Sector Definitions and IR Sensor Placements

Figure 6: Algorithm Example

Figure 5: LTV Mounting Housings

Figure 7:Hardware Schematic

IR Sensor NetworkInitialize Variables

-Turn Direction-Turn Amount-Hit Path Code

-IR Sensor Data(0-7)

-WaitCode=1

Main Loop

Select Left IRSensors

Read IR SensorValues

Select Right IRSensors

Read IR SensorValues

Hit Path CodeOverride Sensors

3, 6, 8Get HitPathCode

Override Sensors4,5,7

Right

Left

Sensor 1 or 2Detect Obstacle

We hit the left side of thepath less than 3 seconds

ago and are not allowed togo left yet.

We hit the right side of thepath less than 3 seconds

ago and are not allowed togo right yet.

STOP

True

Sensor 4 and 5 donot Detect Obstacle

-Save Left TurnCode

-Save Soft TurnCode

True

Sensor 3 and 6 donot Detect Obstacle

False

-Save RightTurn Code

-Save Soft TurnCode

True

Sensor 5 and 7 donot Detect Obstacle

-Save Left TurnCode

-Save HardTurn Code

True

Sensor 6 and 8 donot Detect Obstacle

False

-Save RightTurn Code-Save HardTurn Code

True

False

Save Data toScratchPad

TURN

False

Shaft Encoder

Initialize Variables-Current Value-Previous Value

-Counter-TurnAmount

Read A2D Portand save as Prev.

Value

Counting Loop

Read A2D Portand save as Cur.

Value

Cur. > (Prev. + 512)

Prev. Value = Cur. Value

Will detect only Low-to-Hightransitions on the A2D Port

Note: This code runs significantly fasterthan the maximum speed of the servomotor. (otherwise it will miss transitioncounts)

Max servo rotation period with no friction =1 transition per 30ms

True

A

GetTurnAmount

from theScratchPad

Assign counterbased on how farwe are turning.

ValidTurnAmount

Code?

DecrementCounter

ENABLERS

GO

False

Counter = 0

Counter > 0

Write WaitCodeto ScratchPad

Configure Digital I/OPorts

Wait Loop

Read WaitCodefrom ScratchPad

-WriteWaitCode=1 to

ScratchPad-Set WaitCode=1

This loop keeps another instance of this code fromrunning until we have completed the chosen turnaction. Without it we will chose and attempt to enact aturn every time we read new data values, which is fartoo fast for the first action to have been completed.WaitCode is cleared by ENABLERS which is called atthe completion of a TURN event by Shaft Encoder.

WaitCode != 0

Figure 8: TEA VM Software Flowcharts

Figure 8: Project Cost Breakdown

Acroname’s Brainstem GP 1.0

Texas Advanced OptoElectronic’s LTV Sensors

Sharp’s GP2D15 Digital IR Sensors

Acroname’s Continuous Rotation Servo Motors

Special Thanks to Mark Whitney from Acroname, Inc.