You are on page 1of 12

Team 8

Devin Rose
Sarah Yee
Nick Cowen
BE 1200 Basic Engineering
Midterm
Final Report
[Clarify Objectives]
The objective of the final project is to create a robot that will accomplish a set
of tasks. The main task for the robot to accomplish is to go around the arena and
pick up green ping pong balls and throw them out of the arena over the three-inch
wall. There are problems that the robot has to face and we have to face as well. We
have to be able to program the robot to move autonomously around the arena and
be able to identify white ping pong balls from the green ones. Also, once it has the
green ball in its grasp it has to be able to direct itself over to the wall and throw it
over the wall.
[Establish User Requirements]
The user has to be able to press the orange button on the robot and then
place it in the arena to let it run. As well as pressing the button we also have to be
able to program the robot using the NXC program to the bot that we made.
[Establish Functions]
The robot will have a random number generator in the program so it will
move around the arena while looking for a green ball to grab. While the random
number generator is running and it is moving around the arena a light sensor
attached to the front of the bot will be running. The light sensor is programed to
only pick up green ping pong balls. Once it reads the number of the green ball it will
lift the lift up a little bit so the ball is off of the ground. Then once it is off of the
ground it will go backwards until the touch sensor is pushed. The touch sensor
when pressed will lift the arm and throw the ball off of the back, and just in case it
throws the ball too short it will has a slide that will help guide the ball off of the
arena. Once the ball is thrown then the arm will lower and the random code
generator will begin again to help it find another green ball.
If the robot gets too close to the wall we have also programed touch sensor
that when it is pressed by the front lift (when the lift hits the wall) it will turn the
robot around and then let it run the random number generator again.
[Establish Design Specifications]
We build express bot and made some modifications off of that. We added a
lift to the bot it was an option to the express bot and we adapted it to help fit our
goal better. To the front of the bot we also added a touch sensor that is right behind
the lift. The bumper from the bug bog we used on the back of the bot so even if we
hit a corner we could still throw the ball out of the arena. We placed it there so while

we were running the random number generator to move randomly around the
arena we werent able to get stuck going only forward. As well to the touch sensor
on the front we also added one to the back. The back touch sensor is apart of the flip
program. During the flip program it will be running in reverse and as soon as the
touch sensor is pressed it will tell the arm to flip and land it on our next
modification. The ramp, we strategically placed to ramp in the middle of the bot so
when the ball is thrown it will fall on the ramp and ride down it and out of the arena.
The most important part of the design has to be the light reader. Reading the
different ping pong balls was a challenge because the ball had to roll up the ramp
but once it got up there the light sensor would have to decide if the ball was white or
green. Once it decides if it is green or white will dictate on what the next program
will run. If the white ball is detected it will keep running the random number
generator and the ball will fall off; however, if it reads green it will run the flip
program and back up into a wall and flip the ball over the wall.
[Generate Alternatives]
There were multiple ways to go about the robot and how to make it work.
We could have made a smaller lift and then also take the motor hooked up to the
arm and gear it up. The gears ratio we probably would have done would have been a
3:1 ratio to speed it up to help throw it out. If we would have made the 3:1 gear
ratio we would have been able to read the green ball and throw it from wherever we
were in arena, but we decided to go the route of just running the balls to the side of
the arena and flipping them out.
[Model or Analyze Design]
We took the express bot and added a few things to help increase our
accuracy and movement for flipping the ping pong balls out of the arena. Those
small modifications were the touch sensor on the front, back and the slide on the top
of the bot. The top of the bot was a little weak spot because when we would try to
throw the ball sometimes it wouldnt go as far as we would want it, or it would go
right into the back of the bot so we decided to put a slide on it. The slide is selfexplanatory in the sense that it literally lets the ball slide off of the back like a little
kid going down a slide at a playground.
Making a simple bot was the best way to go because for us there was less to
go wrong;. We could make the program simpler. Every part of the bot was so
individualized that we could see what was going on in the program while we were
running it. That really helped with programing because it allows us to only program
really one main sensor per task. Also, if anything were to go wrong mechanically we
could fix it very easily because there werent as many stationary or moving parts on
the bot. If the bot ever had any real problems we could also just make some
mechanical adjustments as well fairly easily without changing our whole program,
maybe just a few lines of code if any.

[Program Table]
#define EYE SENSOR_1
#define LEFT OUT_C
#define RIGHT OUT_B
#define LIFT OUT_A
task flip()

task random()

task main()

This is what we defined as the light


sensor so we could make a shortcut in
the code for writing it.
This is another definition and it was a
shortcut to let us control the left wheel.
This shortcut is for us to control the
right wheel so we could write it in the
code faster and more efficient.
This is a shortcut created to run the
motor that lifts the arm. Also, it allowed
us to write it in the code faster.
This task was one that ran the whole flip
program. This started the finding green
ball and then backing it up until it hit a
wall and then would throw the ball over
the wall.
This is another task that helped run the
robot around the arena. In this program
there were random number generators
that would allow us to run the robot
randomly around the arena. Also there
was a code in the program that would
allow us to run into a wall and sense
that it did and back us up and turn us
around.
This task was a task that would startup
all of the sensors as well as start all of
the other tasks at the same time.

[Refine and Optimize Design]


If we were to go back and rebuild the design we would probably make it with
the 3:1 gear ratio so as soon as we picked up a green ball we could just throw it from
anywhere in the arena and most likely make it out. It would have been a lot more
efficient for us to do it that way; it would have saved us time and effort to do it that
way. The only reason why we didnt do this was because by the time we realized
that making the 3:1 gear ratio would have worked it was just too late to go back and
make that big of an adjustment to our design.
[Description of Advanced Strategies]
Using the slide may not have seen like an advanced strategy but when
analyzed it really was. We were watching other teams bots throwing the ball and

when it was being throw there was a real big inconsistency with it, but everyone
insisted to use it. Our bot with the slide it was more consistent than most other bots
out there. Taking the more consistent side was our choice and even though it was
going to take longer to across the arena to drop the ball, we wanted consistency. We
would rather sacrifice time for consistency.

[Flowchart]

Final

Task Random

Random turns

move-time =
Random(1000)

Task Flip

if (i==0)

OFF(OUT_B)
OnFwd(OUT_C)

OFF(OUT_C)
OnFwd(OUT_B)

cid:FA335E83CAD3-4D21B243DAE3868767CD
@wirelessuser.w2.wayne.
edu

Task Main

When sensor
reads green

When Sensor
reads white

Reverse until
back touch
sensor hits wall

Task Random
continues

Set Sensor
(light, touch,
speed)

Start Setup
Function (task
flip, random,
touch)

Task Touch

if(SENSOR_4 ==
1)

Else

Stop random,
back up, turn,
start flip

continue task
random

[Data Table]
Verson
1

Problem
The bot wouldnt run, we
would press start and it
wouldnt go.

Fix/Change
We were missing a
semicolon in the code that
wouldnt let us run the
way we needed it too.
It wouldnt lift the ball
The lift would run when
the back bumper was
pressed but still
wouldnt recognize the
green ball.
Then we programed the It would see and
light sensor
recognize if it had a ball
in its grasp and then run
the task flip.
We ran into the problem We put a bumper on the
that we would run into a front of the bot and then
wall and it would get
we put a code into the
stuck
program to turn it
around whenever it hit a
wall
Then we ran into the
There was the only one
problem that it wouldnt way to fix this problem
recognize which ball
and that was to add a
was which.
second light sensor to
the robot, but by the
time we found this
solution out it was too
late. We didnt have the
time to write the code
and put on the other
sensor.
Another problem we ran The robot and all the
into was the durability
parts werent very
of the parts.
structurally sound so we
would have to reinforce
a lot of the parts with
multiple building bricks
so it would stay
together.

[Description of Team Members contribution]


Every member on the team contributed a lot to this final project. Nick Cowen
did a lot of mechanical work. He made most of the bot and any adjustment that we
needed to be done on the bot he made with ease. As well as making the bot, he also
made the flowchart for the final report. Sarah Yee was an overall helper. She helped
with the programming, and building of the bot. She helped nick make modifications
to the bot as well as helped Devin make modifications to the code. She also made the
data table. Devin Rose made the program for the bot, and also wrote the rest of the
final report. Overall, everyone helped with the design and modifications to the
robot.
[Code]

#define
#define
#define
#define
#define
#define
#define

LEFT OUT_B
LIFT OUT_A
RIGHT OUT_C
EYE SENSOR_1
TOUCH SENSOR_3
TOUCHS SENSOR_4
Green 30

int move_time;
int i;
task random(){
OnFwd(OUT_BC, 75);
while(true)
{
i = Random(2);
if(i == 0)
{
Off(OUT_B);
OnFwd(OUT_C, 75);
move_time = Random(1000);
Wait( move_time);
}
else

{
Off(OUT_C);
OnFwd(OUT_B, 75);
Wait( move_time);
}
}
}
task flip(){
{
while(true){
if (SENSOR_1>(Green-5)&&SENSOR_1<(Green+5))
{
stop random;
OnRev(OUT_A, 20);
Wait(400);
Off(OUT_A);
OnRev(OUT_BC, 75);
until (SENSOR_3 == 1);
Off(OUT_BC);
OnRev(OUT_A, 100);
Wait(200);
OnFwd(OUT_A, 75);
Wait(400);
Off(OUT_A);
start random ;
}
}
}
}
task touch(){
{
while(true){
if(SENSOR_4 == 1)
{
stop random;
OnRev(OUT_BC, 85);
Wait(600);
OnFwd(OUT_C, 85);
OnRev(OUT_B, 85);
Wait(1050);
start random;
start flip;

}
}
}
}
inline void setup(){
}
task main(){
SetSensorLight(IN_1);
SetSensorTouch(IN_3);
SetSensorTouch(IN_4);
setup();
start random;
start flip;
start touch;
}

You might also like