Sei sulla pagina 1di 4

Implementation Plan

1. Objective
The objective of this assignment is to build and program a robot that follows
a line and goes around an object. Lastly the final task that the robot must
complete is to stop on green and play a song or a tone for 5 minutes.
2. Identify Constraint
a. One of the main constraint of the project was that we could only use
one programing language.
b. The programing language made it difficult to reproduce result day to
day
3. Establish User Requirements
The only function that the user will be essential for is placing the robot on the
black line and pressing play.
4. Establish Function
a. The robot must fallow the black line around the track
b. The robot must identify the red can and go around the object and find
the black line again.
c. The robot must stop on green
d. Once the robot has stop on green it should play a song or tone for 5
seconds
5. Design Specification
e. Brixcc Command Center
i. Used for codding and programing
f. Two 9v Motors
i. Powers the robots sensor and motors
g. One Light Sensor
i. Used to follow the black line through the object
h. One Ultrasonic Sensor
i. Used to maintain a distance around the red can
i. Touch Sensor
i. Main objective is to detect the Red Can and activate the part of
the program that avoids the obstacle.
6. Alternative
j. The alternative that our team had was to add a second light sensor to
detect when the robot was over the green square in which it had to
stop.
7. Testing Table
First test

Second Test

Made sure that the line fallowing


program work. We had problems
because the track had different light
sensor reading at different spots.
Place the robot in front of the object
and when the touch sensor was
activated we made the robot back
up and turn to the right. We had to

Third Test

Fourth test
Fifth Test

Sixth test

Seventh Test

Eighth test

Ninth Test

adjust the program several time to


get the optimal position as it refers
to the numbers.
There was a problem with the
mutual exclusion. The problem was
that it was not being release for the
task avoid. Therefore I changed the
mutual exclusion to the beginning
and the end of the line fallowing
instead after each variable.
The Robot successfully avoided the
object.
We added a timer and a variable to
the program that made the robot go
around 2 and a half time. We also
had to make the robot follow the Left
side of the line so it can find the line
after going around the object.
We changed the variable to
accommodate for the robot charging
there they changed dramatically for
the line following.
We added to the code the stop on
green function but this made our
robot get false positive for green and
stopping mid-way through the line
following.
I changed the mutual exclusion to
occur after every else or if statement
but then the robot would not follow
the line for more than 3 second
before it got a false positive for
green.
We ran into our deadline therefore
we went back to the program code
with the mutual exclusion at the
beginning and the end of the task
and changed the light sensor for the
variable for green to 98-99 therefore
there wasnt any false positive. The
robot does not stop on green, but it
goes around the track.

8. Refine and Optimize Design


a. We moved the ultrasonic sensor from the side of the robot to the same
bracket that the light sensor was located because it was to flimsy and
did not have the necessary stability when running to follow the can

b. The second modification made to our design was to raise the bracket
with the light and ultrasonic sensor up an inch and a half because of
the added weight of the ultrasonic sensor was causing the light sensor
to hit the ground.
9. Modeling
Task main ()

Task line ()

Task detect_bump

Preprocessor
EYE SENSOR_3
LEFT OUT_C

RIGHT OUT_A
NEAR 19

TOO_DARK 20

TOO_BRIGHT 56

Mutex movemutex

This task was responsible of the


control of all the other task. For
example it told which task had
priority at a certain time.
This is the part of our program which
directed the line following. The code
was built in such a way that the
robot would follow the left side of
the line. Secondly in this task the
stop on green task was imbedded.
In this task when the touch sensor
was activated the robot would back
up and turn right until it was parallel
with the red can. Secondly the
ultrasonic sensor would be activated
and the robot would complete two
and a half turn around the can.
This codes for the Light sensor that
is located in port three of NXT.
LEFT was used in the code to turn
on the motor that was located in
output c.
RIGHT was the code use to turn on
the motor located in output a.
Refers to the distance that the
ultrasonic sensor would maintain
form the red can.
Refers to the sensor reading from
the light sensor that if its below to
follow the black line.
Refers to a sensor reading from the
light sensor that if its above to
refined the black line.
Gives command to different task
when a sensor or a variable is
activated.

a.

Potrebbero piacerti anche