Chapter 8: Robot Control with Distance Detection
· Page 291
√
Change
Kpr
from 35 to -35.
√
Run the program (shown below).
√
Place your Boe-Bot at the “Start” location shown in Figure 8-13. The Boe-Bot
should wait there until you place your hand in front of its IR pairs. It will then
roll forward. When it clears the starting stripe, take your hand away, and it
should start tracking the stripe. When it sees the “Finish” stripe, it should stop
and wait there.
√
Assuming that you can get distance readings of 5 from the electrical tape and 0
from the poster board,
SetPoint
constant values of 2, 3, and 4 should work.
Try different
SetPoint
values and make notes of your Boe-Bot’s performance
on the track.
28” (71 cm)
22”
(
5
6 cm
)
w w w . st a mp si nc la ss .c om
R eset
S TAMPS
C LAS
S
in
B o a rd o f E d uc a t i o n
Pw r
9 V dc
B a t t ery
6- 9VD C
S out
S in
AT N
V ss
P 0
P 1
P 2
P 3
P 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 ss
P 1
P 3
P 5
P 7
P 9
P 11
P 13
P 15
V in
V ss
P 0
P 2
P 4
P 6
P 8
P 10
P 12
P 14
V dd
U 1
TM
0 1 2
© 2 000 -2 003
V dd
P 15
P 14
P 13
P 12
P 11
P 10
P 9
P 8
P 7
P 6
P 5
P 4
P 3
P 2
P 1
P 0
X 2
X 3
V dd
V ss
V in
P 15
P 14
P 13
P 12
P 11
P 10
P 9
P 8
P 4
P 2
P 1
P 0
P 7
P 6
P 5
P 3
X 2
X 3
V dd
V ss
V in
R ev C
+
ww
w.s
tam
psin
cla
ss.
co
m
Re
se
t
S T
A M
P S
C
LAS
S
in
Bo
ar
d
of
E
du
ca
tio
n
P w
r
9 Vd
c
Ba
t te
ry
6 -9
VD
C
So
u t
Sin
A TN
Vs
s
P 0
P 1
P 2
P 3
P 4
P 5
P 6
P 7
P1
1
P9
P8
Vin
P1
0
P1
5
P1
4
P1
3
P1
2
Vd
d
Rs
t
Vs
s
Bla
ck
Re
d
X 4
X
5
15
1
4
13
1
2
1
X 1
Vss
P1
P3
P5
P7
P9
P11
P1
3
P1
5
Vin
V ss
P 0
P 2
P 4
P 6
P 8
P 10
P 12
P 14
V dd
U1
T M
0
1
2
©
2 00
0 -2
0 0
3
Vd
d
P15
P14
P13
P12
P11
P10
P9
P8
P7
P6
P5
P4
P3
P2
P1
P0
X2
X 3
Vd
d
Vss
Vin
P 15
P 14
P 13
P 12
P 11
P 10
P 9
P 8
P 4
P 2
P 1
P 0
P 7
P 6
P 5
P 3
X2
X 3
Vd
d
Vss
Vin
Re
v C
+
Start
Finish
Figure 8-13
Stripe
Following
Course
' -----[ Title ]--------------------------------------------------------------
' Robotics with the Boe-Bot - StripeFollowingBoeBot.bs2
' Boe-Bot adjusts its position to move toward objects that are closer than
' zone 3 and away from objects further than zone 3. Useful for following a
' 2.25 inch wide vinyl electrical tape stripe.
' {$STAMP BS2} ' Stamp directive.
' {$PBASIC 2.5} ' PBASIC directive.
DEBUG "Program Running!"
' -----[ Constants ]----------------------------------------------------------
Kpl CON 35 ' Change from -35 to 35