Group 10_Lab 3x

thunderclingΤεχνίτη Νοημοσύνη και Ρομποτική

13 Νοε 2013 (πριν από 3 χρόνια και 4 μήνες)

49 εμφανίσεις



Department of
Electrical

Engineering

Henry Samueli School of Engineering & Applied Sciences

University of California


Los Angeles



Winter 2010

EE 181D



Robotic Systems Design

Prof.
Mani Srivastava and Mr. Dustin Torres



Lab 3

Fluke Add
-
on Board

Group

Report




Group Id 10

Henry Hsieh


Electrical Engineering

Saurabh Pillai



Mechanical and Aerospace Engineering


1

|
P a g e


1


T a b l e o f C o n t e n t s




Item
s








Page no.

1
. Table of Contents






1

2.

List of Figures






2

3
.

Introduction






3

4
.

Required Tasks and Implementation



4


4
.1.
Required Tasks





4


4
.2.
Implementation


ME aspects



4


4
.3.
Implementation


CE and EE aspects


5

5
.

Discussion







6

7.
Conclusion







1
2



2

|
P a g e


2


L i s t o f F i g u r e
s




No.

Figure
Description

Page no.

1

Flowchart outlining the logic for task 3

7

2

Grayscale image of yellow balls as seen by the Fluke

8

3

Blob image seen by the Fluke corresponding to figure 2

8

4

Flowchart outlining the logic for task 4

9

5

A blob image detecting

a blue ball for task 4

1
0

6

Work Breakdown Structure

12

List of figures



3

|
P a g e


3


I n t r o d u c t i o n




The thir
d

lab was performed to familiarize the

group
with the IPRE Fluke Add
-
on board and its
working
.

This was done by completing four tasks assigned to the group by the instructor. These
tasks involved the sensing of light and different colored balls by the Fluke and accordingly
performing some functions. The tasks are discussed in detail in section 4
.1

of the report.

This report outlines the procedures and mechanical structures used in order to complete the
given tasks. The report also discusses the logic behind the source code written for the same
(actual source code attached to report).

The results and

analyses for some of the tasks are also
presented.
The problems encountered and sources of errors along with the Work Breakdown
Structure are also presented.



4

|
P a g e


4


R e q u i r e d T a s k s

a n d I m p l e m e n t a t i o n




4
.1

Required Tasks

For the thir
d lab, four simple tasks needed to be completed
.
The tasks are the following:

1.

Have the iRobot
sense a light source using the Fluke and rotate clockwise or
counterclockwise to “face” the moving light source
.

2.

Have the
Fluke detect the amount of r
ed it “sees” and accordingly change the brightness
on the back LED on the Fluke (more red pixels corresponding to more brightness).

3.

Have the iRobot
detect the number of yellow balls in front of it and display the number
in binary on the Qwerk’s LEDs
.

4.

Three

balls (red, blue and yellow) will be placed around the iRobot
.

Have the iRobot
rotate and sense the distance of the three balls from it and order the three balls from
shortest distance to longest distance.


4
.2 Implementation


ME aspects

The mechanical aspects of this lab were quite straightforward with the major task being just the
mounting of the
Fluke
.

It was decided that the Fluke lens be mounted so that it is around 13.5
inches above the ground for optimum viewing of the colored balls

(radius = 1.5 inches) that
were to be placed on 12 inches high cylinders.

The mechanical structure of the robot begins
with a metallic platform that mounts on top of the iRobot.
This platform is elevated off the
iRobot by around 3 inches using spacer rods
. This platform is used for mounting
a beam
vertically using an L
-
bracket
.

The fluke was mounted in this vertical beam so that the lens was
13.5 inches above the ground. The fluke was mounted using duct tape and two spacer supports
for the Female Serial Co
nnector. The idea of bolting the Serial

Connector directly on the beam
was investigated but couldn’t be furthered due to the lack of thin enough bolts.
The tape
worked fine for our purpose since the
Fluke

doesn’t need to undergo any stresses and
therefore,

need not be mounted very firmly.

5

|
P a g e


4
.2
Implementation



CS and EE aspects

The first task was completed very easily
simply using the getBright
() function for the fluke. First,
light readings were taken to acclimatize the fluke to its ambient conditions. Next, the fluke used
the getBright() function again to sense light intensity on its left, right and center. According to
the sensed intensity, t
he iRobot was made to rotate left, right or stay put depending on where
the light intensity was the highest.

The second task was done with the help

of the getBlob() function. First, the Fluke was
configured to sense the color red using the configureBlob()
function with the required
parameters for the color red. Next, the getBlob() function was used to get the number of red
pixels “seen” by the Fluke. This number was converted to a ratio (0
-
1) to get the back LED
brightness.

The third task involved sensing a
nd counting the number of yellow balls in front of the Fluke.
For this, first the Fluke was configured to sense the color yellow using the configureBlob()
function with the required parameters for the color yellow. Next, a blob image was taken

and
was divi
ded into multiple columns. Each column was analyzed differently for white (since the
blob would show yellow as white and everything else as black). If white was found in a certain
number of columns consecutively, a yellow ball’s existence was established a
nd the ball counter
was increased by one. Once all columns were analyzed, the number of balls sensed was
outputted using the Qwerk LEDs.

For the fourth task, three balls (blue red and yellow) were placed around the robot and the
robot was supposed to rank
the balls according to their distance from it. First, the Fluke was
configured to sense the three different colors (using configureBlob()) and then, the fluke took
many pictures to analyze as the robot rotated.
Each of the pictures was broken down into
mu
ltiple rows for analysis (not columns, since height was being analyzed this time). Each
picture was analyzed to see how many rows
of white

(corresponding

to one of the three colors)
appear. This number of rows corresponded to how high the balls appeared
which is
proportional to the distance from the Fluke. The balls were ordered accordingly.


6

|
P a g e


5


D i s c u s s i o n




This section discusses the tasks completed and obtained results:

1.

The robot was able to successfully track a light source using the Fluke.

2.

The Fluke was successfully able to detect the amount of red it “saw” and accordingly
change the brightness of the back LED.

3.

The Fluke was able to count the number of yellow balls in front of it and display the
number on the Qwerk LEDs. Figure 1 indicates
the algorithm
for the task completion.
Figures 2 and 3 show the gray image seen by the Fluke and the blob picture respectively.

4.

The Fluke was able to successfully distinguish between the three colored balls and order
them according to distance. The algorit
hm for the task is displayed in Figure 4. Figure 5
shows one of the blob pictures used for the task.

7

|
P a g e



Figure 1:
Flowchar
t outlining the logic for task 3

8

|
P a g e



Figure 2:
Grayscale image of yellow balls as seen by the Fluke


Figure 3:
Blob image seen by the
Fluke corresponding to figure 2

9

|
P a g e



Figure 4: Flowchar
t outlining the logic for task 4


10

|
P a g e



Figure
5
:
A blob image detecting a blue ball for task 4

The original distances of the 3 balls in task 4 were:

Red = 42.42cm

Yellow = 84.85cm

Blue = 94.87cm

Using the
code for task 4, the image height (H
i
) was obtained. The object height (H
o
) was given
to be 7.5cm. The image distance from lens (D
i
) was given to be 5mm or 0.5cm. Each pixel size is
14 microns or 0.0014cm. The pixel height for each ball was:

Red:
11

Yellow
: 13

Blue: 15

The pixel height was converted to centimeters for calculations. Using the lens equation:








The calculated distance for the 3 balls was found to be:

Red = 179.57cm

Yellow = 206.04cm

11

|
P a g e


Blue = 243.506cm

Obviously, the errors in th
e absolute numbers obtained compared to the real distances are
huge.

The most probable reason for the errors would have to be the low quality of the blob
images from the fluke (since the code for obtaining H
i

is entirely blob dependent).

With the low
reso
lution, one pixel makes a large difference in the calculated values of the distance from the
fluke to each of the colored ball. Also slight shift in color temperature or reflectivity of the balls
would throw our blob pictures off by a few pixels. In addi
tion to that, the camera on the fluke
also has a focus adjustment which will change the intern distance from the lens to the image
sensor, again because the numbers we are using are very small, a slight change in this distance
would also affect our calcula
tion. These account for a large percentage of our error in the
distance calculations. Even on top of that, there are slight error factors such as the fact that the
fluke was not mounted in the middle of the robot and would rotate slightly closer or farth
er

away from the ball. All of these factors add up to the large amount of error in the distance
calculations, however since these factors affect all three ball images the relative order of the
balls was computed correctly. We can see that using the imag
e processing is not a great way
to estimate distance, but it is doable. It is much easier and more precise to use the ultrasonic
sensors.


12

|
P a g e


6


C o n c l u s i o n




The lab was completed successfully and all the assigned tasks were also completed and
demonstrated effectively. The lab helped the group members get familiar with the

Fluke

and its
working
.
In addition, the group members also learned to work together as a team consisting of
talents coming from different academic backgrounds.

With regards t
o problems, the
third

lab went quite smoothly for the most part.
The major
drawback in the lab was the resolution of the Fluke and the quality of the pictures it took. As
can be seen from figures 3 and 5, the blob images from the Fluke are very poor. In ad
dition,
sometimes the iRobot was performing translator motion even though it was only supposed to
be rotating. Also, there is a focus on the lens, which can cause D
i

to change, but that is
negligible for our purpose.

Figure
6

outlines the work breakdown in

the group:


Figure
6
: Work Breakdown Structure


Robot

Mechanical Structure

Chassis and Mechanism
Design (Saurabh)

Fluke and Cable Mounting
(Saurabh)

Computer Progamming

Algorithm (Henry)

Coding (Henry)

Documentation

Data Analysis
(Henry/Saurabh)

Report Writing (Saurabh)

Compilation/Formatting
(Saurabh)