Anda di halaman 1dari 28

Sumobot Final Report

ME 4543: Mechatronics
Lab Section: 0AC

Instructor: Dr. Amir Jafari


TA: Christian Emil Wahrmund
Group: Dirty T & the Gang
Group Members: Tyrell Lewis, Jessica Miller, Daniel Willis

Due Date: 4/28/2017


Date Submitted: 4/28/2017

1
Table of Contents
2.0 Personnel ............................................................................................................................... 1
3.0 Intro and Summary .................................................................................................................. 2
3.1 Intro ...................................................................................................................................... 2
3.2 Summary ............................................................................................................................ 2
4.2 Component Fabrication ........................................................................................................ 3
4.2.1 Chassis ............................................................................................................................ 3
4.2.2 Propulsion .................................................................................................................... 4
4.2.3 Housing Dome .............................................................................................................. 6
4.3 Electronics .......................................................................................................................... 7
4.3.1 Sensors ............................................................................................................................ 7
4.3.2 Actuators ...................................................................................................................... 7
4.3.3 Miscellaneous Electronics .............................................................................................. 8
4.4 Bill of Materials (BOM) ....................................................................................................... 8
6.0 Lessons Learned and Suggestions ............................................................................................12
6.1 Lessons learned......................................................................................................................12
6.2 Suggestions........................................................................................................................13
7.0 Appendix ..............................................................................................................................15
7.1 Arduino Code ........................................................................................................................15
7.2 Tables and Figures ..............................................................................................................23
7.2.1 Tables.............................................................................................................................23
7.2.2 Figures ........................................................................................................................25

ii
2.0 Personnel

Table 1 below provides a breakdown of the task responsibilities by main and secondary
personnel on them.
Table 1: Project Responsibilities Broken Down by Personnel
TASK MAIN PERSONNEL SECONDARY PERSONNEL
Articulated Structure Design Jessica Jessica, Danny
Chassis Design Ty Danny, Jessica
Chassis Modifications Danny Ty, Jessica
Sensor Interfacing Ty Danny
Programming Ty Jessica
Motor Controller Ty Jessica
Programming
Project Report: Danny Jessica, Ty
Aesthetic Modifications Jessica Ty
Wire Routing and Clean Up Jessica, Ty Danny
Project Organization Jessica Ty, Danny
General Technician Work Jessica, Danny Ty
3D Printing Ty, Danny Jessica

Table 2 below provides a breakdown of the report (in order of the report).

Table 2: Report Breakdown by Personnel

Report Section Personnel

Table of Contents Danny

Personnel Danny

Intro and Summary Jessica

Robot Selection and Enhancements Danny

1
Robot and Sensor Programming Ty

Lessons Learned and Suggestions Jessica

References Jessica, Ty

Appendix Danny, Jessica, Ty

3.0 Intro and Summary


3.1 Intro

As a group, we applied the skills for Arduino learned in the mechatronics lab. We were
instructed to design, program and build a wheeled robot that in 60 seconds will push another robot
out of a circle with a three-foot diameter. We were given mass, volume, cost and power constraints.

3.2 Summary

The first group meeting we had for this project we strategized a plan of attack for the
competition. Then, we created the base to fit the dimensions we were required to meet. As a group,
we designed every single piece that went into our robot: the gears, the gear box, gear pinions, the
frames for the motors to sit in wheels, rims, and axles and frame. All the designs were 3D printed
and tested before applying an epoxy for permanent positioning. We positioned the sensors in the
most desirable positions and created a protective layer of foam to place on the base. Wiring the
components was the last step to finish the mechanical part of the robot. We had issues with wiring
the day the milestones were due. A few wires were not secured and became unfastened while
transporting and became tangled. So, we placed a breadboard under a cover we printed to connect
all the wires more securely and easier to diagnose any future issues.

4.0 Robot Selection and Enhancement


4.1 Introduction
The team wanted to approach this project from a different angle from the beginning. As
opposed to easily buying a robot kit and assembling it, the team decided to 3D print the majority
of the robots parts. With access to Tys personal SolidWorks license and 3D printer, the team
was able to create many parts of the robot, which allowed for maximum customization of the

2
robot. A MonoPrice Select Mini 3D Printer was used with 1.75mm PLA plastic to fabricate the
main components of the robot, excluding the wheels, rims, and axles.

4.2 Component Fabrication


4.2.1 Chassis

The main components fabricated, where the chassis, and the housing dome. Smaller
components fabricated were stability bars for the ultrasonic sensor, and pinions for the DC motor
gears. Refer to Figure 1 for a view of the bottom of the robots chassis.

Figure 1: Bottom View of Chassis


From this image, one can see how two identical pieces were printed and mirrored to each
other. The two blue pieces that make the chassis were assembled together by way of a bracket
and bolts (the bolts extend into the inside of the yellow motor gearbox housing). The pieces were
designed to have a hole at the center when assembled to provide for a pathway to route the
necessary wires required to reach the ultrasonic and IR sensors.

3
On top and below of the chassis sit pieces of foam. The foam serves as support for other
components that were attached to the robot, including the motor driver, and the vertical supports
for the ultrasonic sensor. On the underside, pieces of foam were attached to provide housing and
connection for the IR sensors on either side of the robot. See Figure 2 below.

Figure 2: Partially Assembled Robot Showing Support Foam

4.2.2 Propulsion

Parts that were bought include the small wheels and their shafts, serving as axles. The
two large wheels were already owned. Figure 2 above shows how the configuration is set up in a
way that the two large wheels serve as the main mode of transportation, distributing the torque
generated from the DC motors, through the gearbox, into the ground. The smaller wheels serve
as supports for the robot when it moves in any direction.

4
One of the more challenging tasks was to modify the gearboxes to be fully assembled,
both onto the chassis as well as fixed to the DC motors. The first problem was tackled by drilling
small holes into the gearboxes to allow the clamping bolts, holding the chassis together, to stick
into the gearboxes. Adhesion of the gearboxes to the chassis was performed by using a hot glue
gun. The other major task was fixing the DC motors to the gearboxes. Before the team could do
this, a second problem had to be addressed. Gear pinions had to be design, printed, tested and
outfitted to allow for the best contact between the DC motor shaft and the gears within the gear
box. Figure 3 below shows a sample of the different gear pinions printed out.

Figure 3: Custom 3D Printed Gear Pinions


This process took some time due to the fact that the printer has tolerances, and a
multitude of gears had to be printed and tested at different scale sizes to select the best gear
pinion providing maximum contact.
Another part that had to be designed and 3D printed was a housing for the DC motor.
This was necessary to provide for a better way to mount the DC motor to the Gearbox. These are
blue and can be seen in the back of the image in Figure 4 below.
Once appropriate gear pinions were assembled, the DC motor had to be fixed to the
gearbox, meanwhile ensuring that the gear pinions were making optimal contact with the gears
within the gearbox housing. This was done by delicately shifting the running DC motors
orientation until proper contact was found, then the motor was fixed to the housing using hot
glue.

5
4.2.3 Housing Dome

The housing dome, pictured in Figure 4 below, was also 3D printed. Its purpose is to
protect much of the wiring that routes from the sensors to the Arduino Nano. The sides of the
dome were designed to serve as a protective wheel well, in efforts to minimize damage or
disconnection of parts by impacts from other robots. The face of the dome also serves for
aesthetic pleasure, with LEDs inside indicating different modes within the program being
triggered.

Figure 4: Housing Dome


A RGB LED was used inside the housing dome to indicate different parts of the program
running. The RGB LED was pasted to the back of the elevated servo motor. The purple color,
pictured above, indicates the robot is calm and searching for its target and monitoring the
white lines. The blue indicates that the robot has sensed a white line and is working to correct
itself in not running over it. Red indicates the robot is in aggressive mode and has targeted an
opponent. A hole was cut out on the top of the dome to allow for the ultrasonic sensor to
protrude from. The ultrasonic sensor was clamped to the servo motor. The servo motor was held
at an elevated position by clamping it with spacers onto axles used from the purchased mini

6
wheel set. These axles were fixed into place by poking them into the foam. This enabled the
ultrasonic sensor to be at a center of the robot, have a commanding view of the robot, and to
be, theoretically, furthest away and therefore relatively safe from enemy robots.

4.3 Electronics
4.3.1 Sensors

For this robot, the two types of sensors used were an ultrasonic range finder sensor and
six infrared obstacle avoidance sensors (referred to as IR throughout the report).
The ultrasonic sensor used is an Ultrasonic Ranging Module HC-SR04. Its purpose is to
send out ultrasonic waves through the echo pulse output and receive them back through the
trigger pulse input. By measuring the time it took for the signal to return the program is able to
estimate an object's approximate location. Apart from this being a very commonly used
ultrasonic sensor and already owned, this sensor was selected because it provides adequate
measurement given the conditions of the competition. It is able to give measurements between 2
cm to 400 cm of non-contact distance at an accuracy of up to 3 mm. As mentioned above, the
ultrasonic sensor was clamped to the rotating arm of the servo motor at the very top of the robot.
This was done to ensure full visibility of the battle area. The ultrasonic sensors purpose is to
detect where the enemy robot is located.
The IR sensors used were six OSOYOO Infrared Obstacle Avoidance Sensor Module
sensors. These were selected because they are cheap, widely available, and relatively easy to set
up on the programming end. The IR sensors were strategically placed, three at each end,
separated at an angle of around 45 degrees from the center axis of the robot. This sensor
placement selection was done to ensure that full visibility of the white line would be achievable
come battle day.

4.3.2 Actuators

Two actuators were used for this robot. A servo motor was used to provide for rotation of
the ultrasonic sensor atop the robot. Two DC motors were used to provide propulsion of the
wheels.
The servo motor used was a SG90 9g Micro Servo motor by Tower Pro. This motor was
previously owned and selected because it provided the necessary arm rotation of 180 degrees. As

7
mentioned above, the servo motor is elevated from the center of the robot and has the ultrasonic
sensor clamped to its rotating arm. With the 180-degree rotation and ultrasonic sensor clamped
in place on the arm, the servo motor provides a full 360 view of the battle area for ultrasonic
sensor above.
The two DC motors used are 3V Small DC Motors. These motors are used to provide
propulsion of the robot by providing torque through the rotation of the motor shafts to the gears
within the gearbox and provide rotation of the large wheels. They are used in consonance with a
motor driver.

4.3.3 Miscellaneous Electronics

As mentioned above, the DC motors were used with a L298N Dual Motor Control
Module. This motor driver served as the connection between the DC motors and the Arduino
program created, which allowed the voltage provided to the motors to be reversed, cut off, and
modulated to the motors to provide for rotation and propulsion of the robot.
An Arduino Nano was used as the microcontroller for the robot. It was pasted to the
underside of the chassis, as pictured in Figure 1 above.
A generic breadboard was also used along with a four double-A battery housing. These
were also pasted on the underside of the chassis.
A generic RGB LED module was used as the source of light within the housing dome to
provide aesthetic and visual indicators of the robots mode.

4.4 Bill of Materials (BOM)

Table 3: Bill of Materials

Part Part Part Part Quantity Price Total


Already Number Supplier [$] [$]
Owned (If
Available)

DC Motor No T010160 Studica 2 3.20 6.40

Servo Yes B001CFU Amazon 1 3.79 3.79

8
Motor BN8

Ultrasonic Yes B01M13S2 Amazon 1 3.42 3.42


Sensor 6V

IR Sensor No B01I57HIJ Amazon 1 9.99 9.99


(10 Pack) 0

RGB LED Yes N/A Resistor 1 1.12 1.12


Park

Motor Yes B014KMH Amazon 1 6.99 6.99


Driver SW6

Wires Yes B00PBZM Amazon 1 4.99 4.99


N7C

Breadboard Yes B0084A7P Amazon 1 4.97 4.97


I8

Battery Yes B00O5AZI Amazon 1 6.95 6.95


Pack 12

Small No B00QC32E Amazon 1 7.84 7.84


Wheel CG
Axles (20
Pcs.)

Small No B0147XSD Amazon 1 7.00 7.00


Wheels CW

Foam Yes N/A N/A N/A 0.50 0.50

Plastic for Yes B00J0ECR Amazon ~ 150 3.00 3.00


3D Printed 5I grams

9
Parts

Miscellane Yes/No N/A N/A N/A 20 20


ous

Table 4: Total Costs

Total Project Cost $ 86.96

Total Project Cost to Team $ 41.23

The BOM considers all materials used in the fabrication of CHIP.

5. Robot and Sensor Programming


To meet the required milestones of the project, separate functions were written that could
be called independently in the loop to operate the motors, interface with the sensors, etc. For
competition purposes, several functions were written that referenced each other so that the loop of
the program would only run one to two functions. Before the loop and setup were written, the
external library to reference the servo motor functions was included with the header file <Servo.h>,
and all integers associated with specific electronic pin connections and program variables were
initialized and organized based on which component they influenced.
Interfacing the sensors involved several steps before they were used to control the behavior of the
bot as a whole; first confirming a successful connection between the IR sensors, the sensors were
connected to the Arduino and serial data was displayed on the serial monitor so that the group
could obtain an idea of the analog values being transmitted whenever the IR detection occurred.
In competition, this detection would be used to recognize a white line in the path of the
bot. In the final assembly, 6 IR sensors were placed evenly around the front and back sections of
the bot so that detection of a white line from a specific IR sensor would call a certain function to
activate the motor behavior and allow the bot to traverse away from the line. The function
lineCheck() used to perform this task is shown in the full code in the appendix, where the IR sensor
serial values were continuously updated, and detection from any one of them would call a different
motor function and control the robots behavior.

10
To detect another object in its path, the bot held a servo-mounted ultrasonic range finder
that continuously rotated between 0 and 180 degrees in front of its path. Similar to the testing
method for the IR sensors, the serial values received from the ultrasonic sensor were first observed
in the serial monitor so that specific values could be converted to centimeters and allow the bot to
run a specific function if an object was detected within a certain distance.
To control the servo motor, the function scanEnvironment() allowed the servo motor to
rotate its position between 0 and 180 degrees, indicated by the pos integer. While the servo motor
turned the ultrasonic sensor, lineCheck() was called in every iteration of the for loop and the
ultrasonic sensor updated its readings as well. This allowed the bot to continuously check for a
white line or an object in its path while the loop was running, where white line detection was the
overarching controller of the robots behavior.
Operation of the two DC motors was accomplished by utilizing the l298n motor driver. In
the program code, the integers enA and enB provided pwm voltage values to a specific motor to
control their speed, and the integers In1, In2, In3, and In4 were given either HIGH or LOW output
values (sent 5 volts from the Arduino) to control the direction of the motors. For example, if In1
and In2 connected to each of the terminals on one of the DC motors, sending HIGH to In1 and
LOW to In2 would run the motor shaft in the clockwise direction, and reversing these output values
would turn the motor shaft in the opposite direction.
The final component included in the robot design was the RGB led that displayed a specific
color and brightness if a specific function was called. For instance, if the ultrasonic sensor detected
an object within a set range, the led would flash red to indicate the object detection. This proved
to be very useful while iterating the design so that the detection of a white line or object could be
indicated with assurance.
Ultimately, by separating the electronic controls into different functions, the development
of the code was a quick process, and the overall script was more organized because of the
minimal redundancy in the code.

11
6.0 Lessons Learned and Suggestions
6.1 Lessons learned

1. We inaccurately defined dimensions for items we 3D printed due to miscalculation. The


problem was solved by recalculating dimensions and reprinting.
2. Some parts we 3D printed would not fit together well due to the tolerance allowed in the
3D printing process. We reprinted and the parts could fit together better.
3. The first day we tried building the robot, we noticed it was difficult to all work on the same
task at once due to how small the project was. We fixed this problem by separating the work we
could all do in separate areas.
4. We bought wire that was too large for the breadboard. We had to order new wires that were
smaller in diameter.
5. We had wire that was too thin to strip without damaging the ends of the wire. We decided
to use another wire.
6. The first few nights we worked on the robot, it took several hours for us to build the robot.
The building process was faster and smoother if we soldered the wires to the sensors we needed in
advance.
7. It was difficult to get wires soldered to the IR sensors because of the metal on the IR
sensors. We fixed this problem by using female to female and female to male wires given in the
Arduino kit.
8. The motors had a challenging time making the wheels turn because the motor wasnt
spinning the gears in the gearbox we attached. We 3D printed an attachment that would make
better contact with the wheels.
9. The gearbox made a larger gap than anticipated between the motors and robot base. We
used hot glue to close the gap, then used an epoxy to glue the motor (with special 3D printed cover)
onto the frame.
10. One of the wires came loose the day our milestones were due because they werent securely
attached to the robot. We made sure every wire was securely attached.
11. Due to the amount of wires and lack of organization, when the wire came loose, we could
not find the origin of where it went. We unplugged all the wires, used a ribbon cable and color
coded all our wires.

12
6.2 Suggestions

I would suggest forming a game plan before beginning the project. This allows people to
discuss what they are more experienced with doing. To form a great plan, read all sources of
instructions and designate a clear list of responsibilities. I would not only suggest an overall plan
for the entire project but a plan for each meeting. This will ensure less downtime and better
efficiency with the sub-projects happening.
Prepare in advance when possible. Due to us 3D printing most of our components, it took
a lot of time to just have the components ready for build. We also had to double check
compatibility due to mistakes in calculations, typos or large tolerances. 3D printing early is key
to ensuring everything is compatible. If the team is unable to 3D print, make sure parts are
ordered and ready to build as soon as possible.
Dont wait until last minute. Even if everyone on the team is experienced with robotics and
understands the fundamentals, everyone has a different method of problem solving. Starting early
will help the team figure out how to balance roles and communicate effectively. Finishing the
project early will also help to any last-minute glitches that could happen with bad software or
hardware. Transporting the robot could also be a test with how well the robot is put together. So,
get the parts, start early, finish early and transport to campus for milestones as soon as possible.
Make sure the robot can sense from all directions constantly. Our robot has a rotating
ultrasonic sensor on the top. It was pointed out after our robot that was finished that our robot has
a potential blind spot. One suggestion to improve our robot would be to eliminate any potential
blind spots or weaknesses for the competition.
If possible, start from scratch. As a group, we designed every single piece that went into
our robot. We designed the base, the gears, the gearbox and the frame. Though this project was
much more work compared to a kit, we could learn more and apply more previously learned skills.
We could see the entire engineering process from this project. We created a game strategy,
designed the parts, 3D printed those parts, programmed everything using our own methods, built
the robot and did our own wiring. Building the robot from the ground gave every team member
the ability to get the maximum learning experience from the project.

13
7.0 Appendix
7.1 Arduino Code // motor one
int enA = 5;
#include <Servo.h>
int in1 = 4;
int in2 = 6;
// servo motor
Servo myServo;
// motor two
int delta = 1;
int enB = 9;
int angle = 0; // change to float
int in3 = 7;
int in4 = 8;
// ultrasonic sensor
#define trigPin 2
// leds
#define echoPin 3
int greenPin = 13;
int bluePin = 10;
long distance; // 54.5 readings per cm
int redPin = 11;
boolean detected = false;

int brightness = 0;
// IR sensors
int fadeAmount = 5;
int IR1 = A1;
int IR2 = A2;
void setup()
int IR3 = A3;
{
int IR4 = A4;
myServo.attach(12);
int IR5 = A5;
int IR6 = A6;
Serial.begin(9600);
pinMode(trigPin, OUTPUT);
int detect1;
pinMode(echoPin, INPUT);
int detect2;
int detect3;
pinMode(enA, OUTPUT);
int detect4;
pinMode(enB, OUTPUT);
int detect5;
pinMode(in1, OUTPUT);
int detect6;
pinMode(in2, OUTPUT);

15
pinMode(in1, OUTPUT); digitalWrite(in3, LOW);
pinMode(in2, OUTPUT); digitalWrite(in4, HIGH);

pinMode(redPin, OUTPUT); lineCheck();


pinMode(greenPin, OUTPUT);
pinMode(bluePin, OUTPUT); frightened();
}
delay(10);
void loop() }
{ }
pinkIsForMen();
void CUTLEFT()
scanEnvironment(); {
} for (int i = 50; i < 256; i++)
{
analogWrite(enA, 0);
// FUNCTIONS analogWrite(enB, i);

digitalWrite(in1, LOW);
// motor operations digitalWrite(in2, LOW);
digitalWrite(in3, HIGH); // turn right
wheel
void HOLYSH*TREVERSE() digitalWrite(in4, LOW);
{
for (int i = 0; i < 150; i++) frightened();
{
analogWrite(enA, i); delay(10);
analogWrite(enB, i); }
}
digitalWrite(in1, LOW);
digitalWrite(in2, HIGH); void CUTLEFTJUSTALITTLE()

16
{ frightened();
for (int i = 50; i < 150; i++)
{ delay(10);
analogWrite(enA, 0); }
analogWrite(enB, i); }

digitalWrite(in1, LOW); void CUTRIGHTJUSTALITTLE()


digitalWrite(in2, LOW); {
digitalWrite(in3, HIGH); // turn right for (int i = 50; i < 150; i++)
wheel {
digitalWrite(in4, LOW); analogWrite(enA, i);
analogWrite(enB, 0);
frightened();
digitalWrite(in1, HIGH); // turn left
delay(5); wheel
} digitalWrite(in2, LOW);
} digitalWrite(in3, LOW);
digitalWrite(in4, LOW);
void CUTRIGHT()
{ frightened();
for (int i = 50; i < 256; i++)
{ delay(10);
analogWrite(enA, i); }
analogWrite(enB, 0); }

digitalWrite(in1, HIGH); // turn left void ONWARD()


wheel {
digitalWrite(in2, LOW); analogWrite(enA, 0);
digitalWrite(in3, LOW); analogWrite(enB, 0);
digitalWrite(in4, LOW);
digitalWrite(in1, HIGH);

17
digitalWrite(in2, LOW);
digitalWrite(in3, HIGH); angry();
digitalWrite(in4, LOW);
lineCheck();
for (int i = 0; i < 100; i++)
{ delay(5);
analogWrite(enA, i); }
analogWrite(enB, i); }

angry(); void MOTORSOFF()


{
lineCheck(); digitalWrite(in1, LOW);
digitalWrite(in2, LOW);
delay(5); digitalWrite(in3, LOW);
} digitalWrite(in4, LOW);
} }

void SLOWLYONWARD()
{
analogWrite(enA, 0); // color sequences
analogWrite(enB, 0);

digitalWrite(in1, HIGH); void pinkIsForMen()


digitalWrite(in2, LOW); {
digitalWrite(in3, HIGH); brightness = 255;
digitalWrite(in4, LOW);
analogWrite(bluePin, (brightness/3));
for (int i = 0; i < 25; i++) analogWrite(greenPin, 0);
{ analogWrite(redPin, brightness);
analogWrite(enA, i); }
analogWrite(enB, i);

18
if (brightness == 0 || brightness > 150) //
void frightened() reverse the direction of the fading at the
{ ends of the fade:
brightness = 100; {
fadeAmount = -fadeAmount;
brightness = brightness + fadeAmount; }

analogWrite(bluePin, brightness); }
analogWrite(greenPin, 0);
analogWrite(redPin, 0);
// bot behavior
if (brightness == 0 || brightness == 255)
// reverse the direction of the fading at the
ends of the fade: void scanEnvironment()
{ {
fadeAmount = -fadeAmount; MOTORSOFF();
}
} myServo.write(0);

void angry() detected = false;


{
brightness = 50; for (int i = 0; i < 256; i++)
{
brightness = brightness + fadeAmount;
angle = angle + delta;
analogWrite(bluePin, 0); digitalWrite(trigPin, LOW); // Added this
analogWrite(greenPin, 0); line
analogWrite(redPin, brightness); delayMicroseconds(2); // Added this line
digitalWrite(trigPin, HIGH);
delayMicroseconds(10); // Added this line
digitalWrite(trigPin, LOW);

19
distance = pulseIn(echoPin, HIGH); digitalWrite(trigPin, HIGH);
Serial.println(distance); delayMicroseconds(10); // Added this line
digitalWrite(trigPin, LOW);
myServo.write(angle); distance = pulseIn(echoPin, HIGH);
delay(15); Serial.println(distance);

lineCheck(); /* Serial.println("distance in cm:");

// function: slowly circle around in an Serial.println("CONGRATULATIONS!!");


adorable fashion Serial.println((distance)/54.5);
Serial.println("");*/
if (angle == 0 || angle > 255)
{ }
delta = -delta;
}
void lineCheck()
{
if (distance < 200) detect1 = analogRead(IR1); // while the
{ IR sensors aren't picking up anything
ONWARD(); detect2 = analogRead(IR2);
} detect3 = analogRead(IR3);
} detect4 = analogRead(IR4);
detect5 = analogRead(IR5);
} detect6 = analogRead(IR6);

void ultraSound() if (detect1 < 50)


{ {
scaredBotdetect1();
digitalWrite(trigPin, LOW); // Added this detected = true;
line }
delayMicroseconds(2); // Added this line

20
if ((detect2 < 50))
{ MOTORSOFF();
scaredBotdetect2();
} }

if ((detect3 < 50)) void scaredBotdetect2() // quick left turn


{ {
scaredBotdetect3(); CUTLEFT();
}
MOTORSOFF();
if ((detect4 < 50)) }
{
scaredBotdetect4(); void scaredBotdetect3() // reverse & find
} center
{
if ((detect5 < 50)) HOLYSH*TREVERSE();
{
scaredBotdetect5(); for (int i = 50; i < 200; i++) // iterate
} through testing
{
if ((detect6 < 50)) analogWrite(enA, 0);
{ analogWrite(enB, i);
scaredBotdetect6();
} digitalWrite(in1, LOW);
digitalWrite(in2, LOW);
} digitalWrite(in3, HIGH); // turn right
wheel
void scaredBotdetect1() // slow left turn digitalWrite(in4, LOW);
{
lineCheck;
CUTLEFTJUSTALITTLE();

21
delay(10);
}

ONWARD();

MOTORSOFF();
}
void scaredBotdetect4() // sharp right turn
{
CUTRIGHT();
MOTORSOFF();
}
void scaredBotdetect5() // slow right turn
{
CUTRIGHTJUSTALITTLE();

MOTORSOFF();
}
void scaredBotdetect6() // GTFO
{
ONWARD();
MOTORSOFF();
}

22
7.2 Tables and Figures
7.2.1 Tables

Table 1: Project Responsibilities Broken Down by Personnel


TASK MAIN PERSONNEL SECONDARY PERSONNEL
Articulated Structure Design Jessica Jessica, Danny
Chassis Design Ty Danny, Jessica
Chassis Modifications Danny Ty, Jessica
Sensor Interfacing Ty Danny
Programming Ty Jessica
Motor Controller Ty Jessica
Programming
Project Report: Danny Jessica, Ty
Aesthetic Modifications Jessica Ty
Wire Routing and Clean Up Jessica, Ty Danny
Project Organization Jessica Ty, Danny
General Technician Work Jessica, Danny Ty
3D Printing Ty, Danny Jessica

Table 2: Report Breakdown by Personnel

Report Section Personnel

Table of Contents Danny

Personnel Danny

Intro and Summary Jessica

Robot Selection and Enhancements Danny

Robot and Sensor Programming Ty

Lessons Learned and Suggestions Jessica

References Jessica, Ty

Appendix Danny, Jessica, Ty

23
Table 3: Bill of Materials

Part Part Part Part Quantity Price Total


Already Number Supplier [$] [$]
Owned (If
Available)

DC Motor No T010160 Studica 2 3.20 6.40

Servo Yes B001CFU Amazon 1 3.79 3.79


Motor BN8

Ultrasonic Yes B01M13S2 Amazon 1 3.42 3.42


Sensor 6V

IR Sensor No B01I57HIJ Amazon 1 9.99 9.99


(10 Pack) 0

RGB LED Yes N/A Resistor 1 1.12 1.12


Park

Motor Yes B014KMH Amazon 1 6.99 6.99


Driver SW6

Wires Yes B00PBZM Amazon 1 4.99 4.99


N7C

Breadboard Yes B0084A7P Amazon 1 4.97 4.97


I8

Battery Yes B00O5AZI Amazon 1 6.95 6.95


Pack 12

Small No B00QC32E Amazon 1 7.84 7.84


Wheel CG
Axles (20

24
Pcs.)

Small No B0147XSD Amazon 1 7.00 7.00


Wheels CW

Foam Yes N/A N/A N/A 0.50 0.50

Plastic for Yes B00J0ECR Amazon ~ 150 3.00 3.00


3D Printed 5I grams
Parts

Miscellane Yes/No N/A N/A N/A 20 20


ous

Table 4: Total Costs

Total Project Cost $ 86.96

Total Project Cost to Team $ 41.23

7.2.2 Figures

25
Figure 1: Bottom View of Chassis

Figure 2: Partially Assembled Robot Showing Support Foam

Figure 3: Custom 3D Printed Gear Pinions

26
Figure 4: Housing Dome

27

Anda mungkin juga menyukai