The following text was automatically extracted from the image on this page using optical character recognition software:
Tabs
- 4
Fig. 5: Line follow program II (key: Li= light sensor,
Ma = math block, S= Switch, Blu= Bluetooth Send
message, Mo Motor blocks, Tabs organize motor
action based on light sensor output, Ultr- Ultrasonic
sensor)
Table 1. Light Sensor Intensity Output Ranges
a) Light sensor reads 100 gradients of light/ dark
b) Mindstorms program converts 100 potential data
c) In a simple "left-right" program, the output comment
from the sensor is less specific.
The initial program was modified to fit the current
configuration on the robot built [2]. Changes included
orientation of the motors and incorporation of the
Bluetooth communication factor to serve the greater
purpose of attaining a follow scenario.
Table 2.: Motor Actions Based on Light Intensity
Readings
Light Sensor
Calculated Action of Motors
Reading
0 Hard Right turn by greatly reducing
power to motor C
1 Gradual Right turn by slightly
reducing power to motor C
2 Straight Ahead with motors equal
3 Gradual Left turn by slightly
reducing power to motor B
Hard Left turn by greatly reducing
4_power to motor B
The tabs seen on the inside loop in Fig. 5 are
each assigned the differing scenario 0- 4, and the
motor blocks within each tabbed window drive the
robot in a different direction as described in Table 1.
D. Bluetooth Message Sent and Received
Each of the programs I and II involved the lead
robot sending a numerical message to the following
robot. This was chosen over logic or text, the only
other option available for the Lego NXT robots. The
light sensor reads the intensity of brightness and sends
this information as a number. It was easier to keep this
output information as a number rather than convert it
to text or logic when designing the Bluetooth
component of the send and receive message.
Program I:." The send message blocks of program I
are located within each switch tab. Whether light or
dark was sensed depends on which block was
activated. Randomly assigned numbers facilitated
this; when the sensor detected the dark of the tape, a
"5" was sent via Bluetooth to the follow robot. When
the sensor detected the lighter color of the floor, a "2"
was sent via Bluetooth to the follow robot. For
example, if a message of 2-5-2-5-2-5-2-5 is sent from
the lead robot to the follower robot, both robots were
capable of following the line.
In the receive program, Fig. 6, two possible
scenarios are simultaneously occurring. Either the
follow robot is receiving a "2" or it is receiving a "5".
Whichever number is received dictates what the
wheels will do, or how much the robot will turn. A
0.25 second delay is in place to accommodate for the
distance between the two robots, and all commands are
placed in a loop until the ultrasonic sensor detects a
potential obstacle.
j ,25
j:- t B I
-,
S5-- C
."drt -J
Jl 4
j"
Fig. 6.: Program I for following robot
Program II. In program II the Bluetooth module in
the lead robot receives its numerical input directly
from the math block. Intensity, read numerically, from
the light sensor is converted to the previously
discussed scale of 0-4, and the Bluetooth command
block sends exactly that number to the follower robot.