Professional Documents
Culture Documents
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()
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.
#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;
}