Anda di halaman 1dari 24

Page |1

ROBOT DESIGN
PROJECT
BY:
Virinder Kaur, Michael Frasco, Shane Raymond

E121: Engineering Design @ Stevens Tech


Date: December 06, 2010
Section B, Group 2
Page |2

TABLE OF CONTENTS
Main Paragraphs:
Abstract………………………………………………………………………….3
Intro………………………………………………………………………………4
Requirements……………………………………………………………………5
System Design………………………………………………………………….5-7
Mechanical Design……………………………………………………………..7-9
Software Design/Programming……………………………………………….9-11
Electrical Wiring………………………………………………………………..11-13
Assembly………………………………………………………………………..14
Integration Testing and Evaluation…………………………………………..14
Final Competition………………………………………………………………14
Tables:
Table1: Light Sensor Suites…………………………………………………..6
Table2: Motor Functions……………………………………………………….9
Table3: Bumper Switches……………………………………………………..11
Table4: Top3 Class Ranks……………………………………………………14
Figures:
Figure1: Voltage Divider Circuit………………………………………………7
Figure2: High Current LED for FSM…………………………………………8
Figure3: Programmable LED Lights’ Schematic…………………………..10
Figure4: PIC Board Diagram…………………………………………………12
Figure5: Connections for Bumper Interrupt…………………………………13
Attachments:
Gant Chart……………………………………………………………………..15
Organization Chart……………………………………………………………16
Software Flow Chart………………………………………………………….17-18
Logo Depiction………………………………………………………………..19
Hard Copy of C program…………………………………………………….20-23
Page |3

Abstract
The primary objective of this report is to provide a basic insight into the
mechanics of building a robot. This report will convey the obstacles faced throughout
the construction of the robot, as well, as the numerous accomplishments made by the
team. This account will further delineate the group’s thought process for the duration of
the project; the physical construction, the programming, and the failed test runs that
pointed out faults to be fixed (in programming and/or wiring).
Page |4

Introduction
Engineering Design I at Stevens involves an introduction to various design
elements such as software programming and the construction of hardware. Throughout
this course, such elements of engineering were emphasized and were an integral part
of the system as a whole. The principal purpose of this project was to expose groups to
common engineering problems and common solutions to those problems. The robot
project also conveyed the importance of teamwork in the field of engineering. For
example, the team faced a lot of difficulty in terms of compromising and agreeing on
various ideas regarding the design mechanics of the robot.
Despite such conflicts, however, in time, compromise was reached as is required
for successful project management. Such an environment, in which one experiences
friendly competition, also aided in nurturing innovation and productivity among the
numerous groups involved in the robot project. This project also introduced new ideas
as well as new areas of studies for the individuals involved; for example, a group that
involved a Chemical Engineer, a Naval Engineer, and a Computer Engineer, was
exposed to all general elements of Engineering including, but not limited to,
programming, electrical wiring, and common software applications such as MS Project,
MS PowerPoint, and the like.
The project also included certain requirements and restrictions. The group was
provided with a set of materials including the chassis, PIC board (complete with
charger/battery/ and other hardware) but were allowed to use other materials provided
for by themselves. This project delivered rules in which, basically “everything goes” as
long as it does not harm the opponent robot or the non-expendable parts offered. The
basic size, shape, and layout of the arena on which the competition was held were
known in advance. However, the team was not informed in advance as to what their
home color would be or where the target lights would be placed. In order to achieve a
clear cut winner, the competition continued until only one robot was deemed the winner
for the class.
The team’s primary concern in taking on this project was time. In response to this
concern, the group first divided different jobs involved in the creation of the robot
amongst them, afterwards constructing an easily understood yet detailed Gant Chart as
to the scheduling of the progress of the robot car. The Gant Chart was extremely
instrumental in the group’s ability to construct, program, and test the robot. The group
members divided their duties in such a manner: Virinder Kaur, a Computer Engineering
major, took on the job to program the robot to perform essential functions; Shane
Raymond, a Chemical Engineering major, was involved in the wirring and circuitry of the
robot; and lastly, Michael Frasco, a Naval Engineer, dealt mainly with the construction
and proper operation of the bumpers.
Page |5

Requirements

The objective of the Engineering Design project was to expose the team and to
instill in the students the importance and value of time management as well as project
management. This project provided for a suitable means of reinforcing the
indispensable significance of team work and competition in the field of Engineering. The
primary objectives of the robot project were to construct and program a functioning
robot car, which would then be tested and used in the robot competition, the final object
of the project. The group’s program was to be written in such a way that it adequately
provided for the effective functioning of all parts of the robot car such as the bumper
switches, the programmable LED lights, and the different types of light sensors. The
testing of whether these functions were performed successfully was held at our
individual team station as well as on the actual arena for the competition.

The group was guided by a set list of rules and requirements for the robot
project. At the end of the design and construction of the robot car, it should be able to
perform the essential functions and then carry out necessary tasks. The robot was to be
able to take readings of the floor in order to differentiate between home and enemy
territory; it had to have the ability to read the navigation light, cross to the opponent’s
side of the arena and knock out the two target lights provided, thus determining it as the
winner. However, this assignment also brought with it rules and restrictions. The team
was provided with a set of non-expendable materials and all other required items were
to be acquired through the group resources. The nonexpendable materials provided for
by the Design lab included an already prepared chassis complete with PIC board
mounted; the lab also provided extra LED lights, light sensors, wiring, batteries/charger,
USB connection bales, and many other important tools.

Despite having the freedom to add various desired elements to the robot, the
team was not allowed to make any direct changes to the prepared chassis such as
drilling into it and the like. Also, any elements that could or would ultimately hurt or
irreparably damage the opponent’s robot were off limits. For example, while adding
extra LED lights was an acceptable deviation in order to “trick” the other team’s robot, it
was inacceptable to have anything that could physically harm the construction of the
robot.
System Design

Despite the limits that were placed on the extent that any group could deviate the
robot car, the team was able to create a strategy to ensure a simple, yet tactical
approach to the assignment. The group’s win strategy in order to successfully complete
this Engineering Design task was to stick to the Gant chart that was completed as a part
of the pre-planning, and to keep the process as simple and organized as possible.
Rather than trying to create complex functions for the robot, the group’s chief interest
was that the final product delivered. In sticking with this strategy, the finished robot car
was product of not only efficiency but sufficiency as well.
Page |6

Regardless of the simplicity of the design of the robot, it has many distinctive
characteristics about it. Our design for this robot ensured time efficiency, allowing us
enough extra time for finishing touched. The final product promised distinguishing
features, some of which are blatantly obvious. The most noticeable of these unique
features is the décor of the robot car. The group decided, in the extra time, that a theme
for the robot would create a friendly and enjoyable working atmosphere; the theme the
groups went with in the end was a Mario Kart scenario. In accordance with the idea,
Virinder Kaur created the bust of “Toad” the “1-up” mushroom seen in variations of
Mario. Following the making of the mushroom via papier-mâché, Shane Raymond and
Michael Frasco were responsible for creating a support structure for and mounting of
Toad. I believe that this is maybe the most unique part about our robot.

Another unique characteristic of the robot is the fact that team used only one
target light sensor rather than multiple ones. There were other teams that similarly used
only one target light sensor; however, in this group’s case, the single target light sensor
was a strategic move and not a product of inadequate time. The team assumed that if
they’d gone with the prior arrangement of having two light sensors in the front, they’d be
making a pointless venture. Both target light sensors being placed in such close
proximity would be receiving the exact same data; in such a case, it had been a safe
and strategic move to stick with only one light sensor as it would minimize the raw
material used as well as increase proficiency.

Bit I/O Analog/Digital Assignment To Access


0 I Analog Light Sensor #1 Use “read_adc” function
1 I Analog Light Sensor #2 Use “read_adc” function
2 I Analog Light Sensor #3 Use “read_adc” function
Table 1: Light Sensor Suites
The above are the light sensor suites used; Light sensor #1 was the floor sensor, #2 was the Nav Light
sensor and #3 was the target light sensor. All used the read_adc (or read at channel ‘x’) function.
Page |7

Figure 1: Voltage Divider Circuit 


The voltage divider circuit shown above is supplied by a 5 volt DC source, so it reads a voltage ranging
from 0 to 5; this is the range of the voltage for LED lights.

Mechanical Design

Another crucial part of this design project was the construction of individual
pieces of hardware for the robot. A large part of this was handled by Michael Frasco
with help from Shane Raymond. The most central component mounted was the frame
surrounding the PIC board. This component was mounted on the sides of the top layer
of the chassis with screws securing the plastic body components. This component was
mounted to protect the PIC Board, have a frame available to secure the battery to, and
to have a frame available to mount our LOGO and our piece to secure our mushroom
component to.

Our mushroom was mounted to the top of the frame with crazy glue. This was
the only way the group could mount it because it was made of papier-mâché and
therefore could not be screwed into the frame. The robot’s bumpers were mounted on
an extra piece of plastic on the side of the bottom chassis. The purpose of this extra
piece was to extend the distance of the bumper farther out from the chassis. This allows
our bumpers to be farther out, therefore allowing it to hit walls further compared to the
distance without the extension.

The battery was mounted under the added support frame (originally for the
mounting of the mushroom) with electrical tape. This was not our best choice but had to
Page |8

be placed there due to the wires getting in the way of the area between the top and
bottom parts of the chassis. Our PIC board is also located under the top chassis but
glued to the inner wall. Placing it there gets it out of the way of all other components.
Lastly, our side bumpers are mounted on the front, center piece of the chassis. A center
bumper is attached to the two side bumpers two prevent the robot from getting stuck in
corners.

The next component to mount was the floor sensor module; this was also
constructed and mounted by Raymond and Frasco. The purpose of the floor sensor
(mounted with an accompanying LED light) was to differentiate between the Home and
opponent court by reading the light that bounced off the floor. The floor sensor was
located on the bottom of the completed chassis. It was in between the front chassis
piece and the motor. These two pieces helped the board remain stationary and attached
to the chassis. It is clear of all components which allowed it to see the floor without the
hassle of any obstructions and obstacles, allowing for an accurate reading of the floor.

Figure 2: High current LED for Floor Sensor Module


FSM works through light sensor and so reads the light that bounces off the floor. The above
shows proper connection of high current LED used for the FSM

Following the construction and mounting of the floor sensor, the construction and
mounting of the bumpers became the top priority. The bumpers are located on the front
of the chassis and extend halfway along the side of the structural support of said
chassis. The bumper sensors/switches are located at the end of the bumpers so the
bumpers can be extended further away from the chassis. Attached to the end of the
bumpers is a one inch piece of plastic placed vertically. This piece ensures that the
bumper will still hit the sensor even if the bumpers wobble up and down. There is also a
Page |9

center bumper that triggers both sensors when hit. This center bumper is attached to
the front of the side bumpers and extends further forward to be able to sense corners
more easily. The program for the two bumper system we used tells the robot to move
back farther before it turns to prevent it from getting stuck in corners.

Bit I/O Analog/Digital Assignment To Access


Motor #1 Direction Bit A Use “output_high” or
0 O Digital
(See Table Below) “output_low” functions
1 O Analog Motor #2 Speed Use “motorspeed” function
2 O Analog Motor #1 Speed Use “motorspeed” function
Motor #2 Direction Bit A Use “output_high” or
3 O Digital
(See Table Below) “output_low” functions
Motor #2 Direction Bit B Use “output_high” or
4 O Digital
(See Table Below) “output_low” functions
Motor #1 Direction Bit B Use “output_high” or
5 O Digital
(See Table Below) “output_low” functions
Table 2: Motor Functions
The above table highlights the ports used to wire the motors. It also delineates the various motor
subroutines that were employed in the final bumper program.

The next concern that mechanical design came into contact with was the
positioning and shielding of the light sensors. Our navigation light sensor is located on
the top of our mushrooms head. The allows it to have a clear reading of the navigation
light placed 30 inches above the exact center of the arena. It is shielded by a piece of
tape on the backside of the light. This shields the sensor from picking up the center light
bulb once it crosses to enemy territory to prevent it from possibly crossing back to home
territory. Lastly, with all essential components mounted onto the chassis, Frasco had
only the logo left to mount. The logo design was created by Raymond in Solid Works.
Following Raymond’s completion of that task, Kaur was to go to the CNC cutting
session to complete the construction of the logo. The logo was then mounted on the
front of the robot, directly onto the additional support frame the group had added. It was
front and center and was mounted with glue. Glue seemed to be the safest way to
mount the logo as drilling into it provided for the threat of it cracking and ultimately being
destroyed.

Software Designing and Programming


The approach the team took towards the programming process was to first
create a program flow chart. This flowchart was instrumental in depicting to any
audience the object of our program. It delineated the group’s thought process when
considering the desired performance of the robot on the arena. The programmer of the
group, Virinder Kaur, took each separate program before compiling it into a single
program for the robot. The main issues with the software design that were encountered
P a g e | 10

were glitches in to the Hi-Tide application and lost ports where the robot would not
accept the program build.

For convenience’ sake, subroutines were employed and played a significant part
in the programming of the robot. The group used a total of seven subroutines. These
subroutines were responsible for the movement of the motors and the functioning of
LED lights, all of which were called upon frequently in the program. The movement of
the motors included directional instruction (moving right, left, forward, and back), and
stopping of the motors. The LED light subroutines handled the programmable LED
lights on the PIC board (at (‘A’,2) and (‘E’,2)). Our win strategy was also incorporated
into our programming as it was kept simple and to the point, keeping true to the planned
schedule. On the other hand, the testing and troubleshooting for the program took much
longer than expected.

Figure 3: Programmable LED Lights’ Schematic


The programmable LED lights on the PIC board were used in large part to help debug programs by
assigning different functions to these LEDs as responses to program commands.

Another unique feature of the robot’s program was a very generalized bumper
interrupt system. Rather than to write an entirely new function for when both bumper
switches are activated, we allowed for the robot to move back double the distance and
then follow the same command as was assigned to the right bumper switch : to turn left
60 degrees and continue forth. The bumper system proved to be quite successful as it
lead to the group’s overall success in the arena. This was seen in that the robot
P a g e | 11

approached the target lights with the sole aid of the bumpers, Nav light sensor, and floor
light sensor.

Bit I/O Analog/Digital Assignment To Access


Use “read_input” function
0 I Digital Bumper #1 0 = bumper closed (activated)
1 = bumper open
Use “read_input” function
1 I Digital Bumper #2 0 = bumper closed (activated)
1 = bumper open
Table 3: Bumper switches
The above table portrays the two bumper switch system that we used. A ‘read_input’ function was applied
to induce a given reaction at program interrupt.

Electrical and Wiring Design


There were different organization schemes for each part that required electrical
maintenance. The light sensors each had white as the ground wire, which were all
placed in the same ground port labeled “GND.” These sensors also had black wires
connected to the RA ports on the PIC Board. As for the Bumper Interrupt System (BIS)
and the Floor Sensor Module (FSM), the organization was not so much in the colors of
the wires (due to the amount of wires needed, and not enough colors), but the
placement into the ports on the PIC Board. Each was far apart and easy to take note of
their ports’ location.
P a g e | 12

Figure 4: PIC Board Diagram


The above diagram of the PIC board used for this project portrays the different ports that were
employed in wiring the robot together and some that were not used at all.

Wires were cut just right so that absolutely none of the wire would be sticking out
of the port. It was also made sure that wires would not touch so that a short could not
exist and the robot’s performance would be hindered. In order to establish a complete
electrical connection, wires were not only wrapped around to the resistors, transistors,
LED lights, and light sensors, but also soldered ever so slightly with solder and a
soldering iron. This would completely attach the wire forming a solid, undisputable
connection. However, it was made sure that one connection would not touch with
another causing a possible short and causing electrical. Therefore, the connections
were spread out across the circuit boards.
P a g e | 13

Figure 5: Connections for Bumper Interrupt


The above chip was plugged into a socket that was soldered onto a blank printed circuit board
and interconnected to the PIC board as shown in the above diagram.  

There were few electrical problems that occurred with the robot. Our
organization caused a few problems such as wires snapping off of the solder, but our
navigation light and target light sensors had their wires touch at one point causing them
to short. The group had to make a quick maneuver and just make sure of their
separation so that we continue working. As for the wires popping off of the solder, the
remaining solder was removed from the switch, a longer wire was taken and simply
soldered back onto the freshly cleaned switch.
Recommendations for the future would include a much better organization
system. One should try and keep the wires color coated as much as possible and be
careful when placing the wires in the ports on the PIC Board. One should try and
discover a system that is the least confusing. However, one system may work for one
group that does not seem beneficial to another. It is all about finding a system that
works for you. One thing is for sure, the circuit boards should be as small as possible,
but with the connections spread apart as much as it can be. This would avoid problems
with space when placing the circuit boards on the robot, yet maintain solid electrical
connections that will not short. The key is to just stay organized so that confusion does
not become an issue and the builder is not soldering wrong wires, or placing wrong
wires in wrong ports.
P a g e | 14

Assembly
The assembly of the robot proved to be one of the easiest tasks needed to be
completed. Although construction of the different parts often had to be redone to suit the
purposes of the robot, the team often used temporary methods of holding the assembly
together so as to not compromise too much time. For example, the team used tape to
hold the logo onto a mounting possibility while exploring bumper placement options;
without a doubt, after the bumpers and mushroom top had been positioned, the logo
also had to be moved slightly. The final product was held together by the likes of crazy
glue, electrical tape, and bolts and screws.

Integration Testing and Evaluation


The team approached testing and changing of the program with much precaution
in order to avoid further malfunctioning. To achieve this, singular components of the
program were commented out rather than completely deleted; this way, if something
went wrong with the new program, the old program would still be ready for use. The first
thing tested was the whole program, just to get the gist of what components were
running as should be and which were erring. It was then discovered that the target light
sensors were not reading; in response to this, the whole program except for the said
light sensor program, was commented out and the program for the target light sensor
was run. In the end, the channel that the light sensor was attached to had been faulty.
That was changed and necessary changes to the program (i.e. indicative change in light
sensor channel) were made.

Final Competition
During one of the final test runs, the robot did manage to hit both lights at a time
that was the record in our class. Although it ran most functions correctly, the target light
sensors appeared to have failed yet again. Although, the floor sensor and the navigation
light sensor was being read and reacted to correctly, once the robot crossed over to the
other side, it approached the lights only in lieu of the bumper program. The team
continuously made changes to the program to counteract this only to realize that the
target light sensor was not reading again. In the end, although the target light remained
a failure, we managed to hit both target lights in a time that was the record for our class.

Rank 1 2 3
Team #6 #2(Our Group) #8
Table 4: Top3 Class Ranks
P a g e | 15

Gant Chart
(These were supposed to be printed out separately but this was the only way to incorporate the
Gant/flow chart into the report to email it to you.)

Gant Chart (part1)

Gant Chart (part2)


P a g e | 16

Organization Chart
Name Role Responsibilities

Virinder Kaur Programmer/ In charge of writing the C++


Misc. program to run with the robot.
Also in charge of Misc. tasks
such as the creation of the
mushroom head out of Papier
Mache. Was also responsible
for the writing and compilation
of the written report.

Shane Raymond Electrical circuitry/ Handled the electrical wiring


Design and mounting of key electrical
components. Created the
bumper interrupt system for
the robot as well as mounting
it onto the chassis. Also
maintained control of the
wiring for the motors and light
sensors.

Michael Frasco Assembly/Mechanical Design Given the task of constructing


and mounting bumper
switches. Also in charge of
constructing floor sensor
module and assembling it
onto the bottom of the chassis
for proper functioning.
P a g e | 17

Flow Chart

Flow Chart (part1)


P a g e | 18

Flow Chart (part2)

Flow Chart (cont’d)

Flow Chart (Part3)


P a g e | 19

Logo Depiction (in SolidWorks)

A Mario Kart Trademark Logo


P a g e | 20

Hard Copy of C++ Program


#include <htc.h>
#include <PICinit.h>
#include <PICinit.c>

void motorsoff ();


void pivotleft ();
void LED1on ();
void LED1off ();
void pivotright ();
void forward ();
void backward ();

main (void)
{
unsigned int sensor0 = 0;
unsigned int sensor1 = 1; //nav light
unsigned int sensor2 = 2; //target light sensor
unsigned int Home, current;

configurePIC ();
INTE=1;
GIE=1;
motorspeed (1, 75);
motorspeed (2, 75);
output_high('D',0);

if (read_adc(0) < 19000)


{
Home = 1;
//output_low('A',4);
}
else
{
Home = 0;
//output_low('E',2);
}

while (1)
{
if (read_adc(0) < 19000)
{
current = 1;
}
else
{
current = 0;
}

if (Home = current)
{
//output_high ('A',4);
//output_high ('E',2);

if(read_adc(1) < 12500)


P a g e | 21

{
forward ();
}
else
{
pivotleft ();
}
/*if(sensor1 > 12500)
{
pivotleft ();
}
else
{
forward ();

} */
}
else
{
if(read_adc(2) < 12250)
{
forward ();
}
else
{
pivotleft ();
}
/*if(sensor2 > 12250)
{
forward ();
}
else
{
backward ();

}*/
}
/*pivotleft ();
LED1on ();
pause (1000);
LED1off ();

pivotright ();
pause (250);
motorsoff ();
LED1on ();
pause (1000);
LED1off ();*/

forward ();
//LED1on ();
pause (250);
//LED1off ();

/*backward ();
LED1on ();
pause (250);
LED1off ();*/
P a g e | 22

}
}

void interrupt isr (void) // This function will be automatically called upon an interrupt
{
save_data ( ); // Save function variables in use during main() so they
// can be restored upon returning from interrupt

pause (5); // Pause 5 msec to allow for bumper switch contact bounce

if ((PORTB & 0x01) == 1) // Check to make sure interrupt not caused


{ // by noise
INTF = 0;
restore_data ( ); //Restore function variables used in main()
forward ();
return;
}

motorsoff ();
//Always allow some time (50ms) for the motors to stop
if ((read_input ('E', 0)) == 0) // Read Bumper#1 pin, if closed (activated)
{
output_low ('A', 4); // Turn LED#1 on
backward ();
pause (900);
motorsoff (50);
pivotleft ();
pause (800);
motorsoff (50);

}
// else
//{
// output_high ('A', 4); // Otherwise, turn LED#1 off
// forward ();
//}

if ((read_input ('E', 1)) == 0) // Read Bumper#2 pin, if closed (activated)


{
output_low ('E', 2);
backward ();
pause (900);
motorsoff (50);
pivotright ();
pause (800);
motorsoff (50);
// Turn LED#2 on
}
//else
//{
// output_high ('E', 2); // Otherwise, turn LED#2 off
// forward ();
//}

if ((PORTB & 0x01) == 1) // If all bumpers have cleared their obstacles


{
INTF = 0; // Clear interrupt flag bit
output_high('A',4);
P a g e | 23

output_high('E',2);
}
restore_data ( ); //Restore function variables used in main()
return;
}
void motorsoff ()

{
output_low ('C', 0);
output_low ('C', 5);
output_low ('C', 3);
output_low ('C', 4);
pause (100);
return;
}

void pivotleft ()
{
output_low ('C', 0);
output_high ('C', 5);
output_low ('C', 3);
output_high ('C', 4);
return;
}

void pivotright ()
{
output_high ('C', 0);
output_low ('C', 5);
output_high ('C', 3);
output_low ('C', 4);
return;
}

void forward ()
{
output_high ('C', 0);
output_low ('C', 5);
output_low ('C', 3);
output_high ('C', 4);
return;
}

void backward ()
{
output_low ('C', 0);
output_high ('C', 5);
output_high ('C', 3);
output_low ('C', 4);
return;
}

void LED1on ()
{
output_low ('A', 4);
return;
}

void LED1off ()
{
output_high ('A', 4);
P a g e | 24

return;
}

Anda mungkin juga menyukai