0% found this document useful (0 votes)
130 views7 pages

3D Scanner MRD Project Report: Abstract-As We Look Throughout History, The Wealthy

This document summarizes a project to design an inexpensive 3D scanner. The scanner will cost under $250 and perform scans without needing to connect to an external device like a laptop. It will use a Raspberry Pi 2 for processing, along with a camera and lasers. Scans will be accurate to within 1mm and take less than 15 minutes. The design includes a turn table driven by a stepper motor to rotate the object as it is scanned. This will allow the system to capture a 360-degree view and create 3D models of objects.

Uploaded by

Hilman Hazmi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
130 views7 pages

3D Scanner MRD Project Report: Abstract-As We Look Throughout History, The Wealthy

This document summarizes a project to design an inexpensive 3D scanner. The scanner will cost under $250 and perform scans without needing to connect to an external device like a laptop. It will use a Raspberry Pi 2 for processing, along with a camera and lasers. Scans will be accurate to within 1mm and take less than 15 minutes. The design includes a turn table driven by a stepper motor to rotate the object as it is scanned. This will allow the system to capture a 360-degree view and create 3D models of objects.

Uploaded by

Hilman Hazmi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

Team 8 Midway Design Review Report 1

3D Scanner MRD Project Report


Vangjel F. Author, CSE, Siyan L. Author, EE, Chenkai Z. Author, EE

 are to be printed need to be exact (nuts and bolts), which takes


Abstract—As we look throughout history, the wealthy time and effort. The time it takes to learn how to use the tool,
and privileged have had access to useful technologies, and the time it takes to implement your knowledge every time
before the masses. When cars, televisions, and even you want to print something, is a thing of the past. With 3D
computers first entered the market, they were scanners you can save time and just place the object in the
revolutionary but overpriced. This discouraged people scanner and let the computer do the work for you [2].
from acquiring them. These technologies are not necessities 3D scanners can be used to scan parts, building supplies,
to life, but they play big roles in making life more props for movies, digital animation, and much more. The
convenient. 3D scanners are relatively new technologies usefulness of 3D scanners is wide and vast; however, it seems to
that have many useful applications, but yet very few people be more of a nuisance, due to the cost of owning one.
own them, mostly due to the expense of the product. We will In order to provide a solution, we designed a 3D scanner that
talk about a way to create a cheap standalone 3D scanning can be made for under $250 dollars. In addition to this, this
system, which through the use of processing information scanner will be able to perform scans by being plugged into a
taken by a camera and line lasers, can create digitized 3D wall, without the need of another device to run. Because of
models. These models can be used in digital animation or necessary precision, the scans must be accurate to within 1mm
printed with 3D printers for a wide verity of applications. of the actual object size. The scanner will have a length of 12
inches a width of 10 inches and a height of 8 inches, making it a
convenient size relative to most scanners. We also are
I. INTRODUCTION designing the scanner to perform the scans in under 15minutes.
The world is advancing technologically faster and faster Scanning something should not be a time consuming processes
every year. However, the more revolutionary technologies tend that makes scanning an object a hassle for the end consumer.
to be too expensive for the average consumer. One of these Especially since people using scanners in the business world are
technologies is a 3D scanner. These scanners have a starting usually busy people and time is a commodity of the essence.
price of $400. This is a high price for an item that can be useful, TABLE I
SPECIFICATIONS
but not necessary to have, “Generally, most 3D scanners are too
large and expensive to be used by consumers. That's at odds Specification Value
with the culture of 3D printing right now, considering most of Weight <3kg
the developments are in desktop 3D printers made for home use. Height >20cm
Length >40cm
Most of the 3D scanners out there are more than $1,000…” [1].
Width ~20cm
Besides the cost of just the scanner, there are other issues.
Scanners that exist have another flaw as well, which is that
they are not standalone systems. This means that they do not run
unless there is an external device that is necessary to control the
scanner. In most cases, this external device is a desktop or a Design
laptop. With the advancement of technology there are A. Overview
appliances with applications that can control the scanner such as
There are very inexpensive ways to create a 3D scanner.
smart phones and tablets. Scanners are expensive enough, and
Essentially, you need to capture the image of an object, then
consumers shouldn’t have to purchase another device, which is
once you have that data, you need to capture another image of
also hundreds or even thousands of dollars, to use their scanner.
that object at a different angle. Repeat this process until you
Before 3D scanning had a huge role in 3D printing, people
have images for the entire 360-degree view of the object. The
used Computer Aided Design (CAD) tools in order to create the
data is then processed together through an algorithm in order
object for 3D printing (they would design the object on a
to create a 3D model of that object in a STereo Lithography
computer digitally). Although the use of CAD tools is still a
file (STL files are the files containing information about the
very viable option, it has its own set of issues. The use of these
3D model that a 3D printer can take in as input to create a 3D
tools is a skill; A skill that most people do not have. Not to
object). In order to provide the 360-degree view, we are going
mention that for a lot of practical uses, sizing of the objects that
to use a turn table to rotate the object that we are trying to
scan. This turn table is driven by a stepper motor, which will
receive .35A of current to take a step. It is controlled to do so
Team 8 Midway Design Review Report 2

by A9488 chip, which takes instructions for our computing


component.
In order to run the algorithm and do the computing, we
will be using a Raspberry Pi 2 (RP2). We decided to go with
the RP2 because of its convenient size, it is compatible with a
small camera that fits our purposes for the data collection.
We will be using both a camera (the RP2 camera) and lasers
retrieve information about the dimensions of the object that
we are scanning.

Fig. 2. This is a representation of how the lasers should be in


relation to the camera. It would be placed in the direct path of
the camera lens and the laser lights would be adjusted to shine
though the center

There were a few alternatives that we considered when


developing our design. We considered using only a camera for
the data collection. This method of 3D scanning is called
photogrammetry. This requires taking multiple pictures, but
you also need to take the images at different angles. This
would make the design much more difficult to implement, due
Fig. 1. This is a block diagram of our overall design. The arrows are numbered to the necessity of having more than one camera, each at a
in the flow of how to run a scan, starting from when a user interacts with the different angle. This is problematic because it drives up cost if
GUI to start. we need more than one camera. The RP2 also only has one slot
for a camera input. With the laser component, we can get the
information we need, which we will go over later.
Also, in order to create the standalone system, we need to be
able to have a user interface to communicate with the system.
The RP2 is compatible with LCD screens. This component is
relatively inexpensive, considering the alternatives mention A. Hardware design
earlier cost hundreds. Lasers
The overall design consists of the camera being fixed at a Two red LED line laser were selected to be the transmitter
certain location. Everything else is in relation to the camera. which its light will projected onto the target sample and is
The lasers are each located at an arbitrary distance to the left monitored by the camera. The distance between the camera and
and to the right of the camera, however, both lasers must be laser diode is fixed and known. A picture of the object is taken
the same distance away from the camera. The turn table is without any lasers being turn on. One laser is switched on and
placed so that the center of the table aligns perfectly with the another picture is taken. Since the laser is by far the brightest
camera, and it can be any distance away. Each laser must shine element in the image, the line it makes on an object is easily
their light directly through the center point of the turn table distinguishable from the rest of the image. [4] Our software will
(refer to Figure 2). be computing the difference between the two images, a laser
The distances between the camera and the lasers, as well as trace is obtained. We chose red LED since it consumes the least
the camera and the center of the table must be known in order amount of power in comparison with other LED’s of different
to properly take a scan. Knowing how far the center of the colors.
table is from the camera provides a reference z- coordinate in We realized some of the irregular shapes are unable to scan,
3D space. Knowing the height of the camera provides a for example a wine glass due to its concave part. We found out
reference y- coordinate, and having the table centered that when you scan an irregularly shaped object, there are areas
provides an origin for the x-coordinate. Then by having the that one laser can’t see, but the other laser does. Using two
lasers some fixed known distance from the camera, and having lasers does increase the quality because it reduces the number of
them cross the center of the table, we can calculate the “gaps” in the model due to concave areas on the part.
hypotenuse when the light hits an object.
Team 8 Midway Design Review Report 3

To test this component, I also wrote a short python code to


drive the stepper motor. It took the number of steps as a
parameter, as well as the direction (clockwise or
counterclockwise) to turn. After my success, I wrote yet another
short python code to control the lasers and motor at the same
time, to ensure that we had enough current to drive both at the
same time.

Camera
We ended up using the raspberry pi camera module. It is 5MP
camera module is capable of 1080p video and still images and it
can be connecting directly to the raspberry Pi. Here is some data
Fig 3. Object scanned with one laser we get from the software of how long it takes to scan when we
run a scanner on different resolution of the camera. The size of
file is about 2MB-100MB depends on the resolution the user
chooses.

Resolution time
5 Megapixel( 2592 X 1944) 55mins
1.9Megapixel( 1600 X 1200) 10 mins
1.2Megapixel ( 1280 X 960 ) 8 mins
1.2Megapixel ( 1280 X 960 ) 4 mins

The RP2 has a command to test whether the camera is correctly


Fig 4. Same object scanned with 2 lasers functioning.

In the figures above, we scanned an object in the shape of a Power


bridge. In figure 3, the object was scanned with one laser. In the The raspberry pi requires high performance to run the Freelss
image there is a gap of space in which no data was gathered. software which required a lot power. As a result, we are not
This was due to the sharp corners of the object. Although the building a portable 3D scanner. Instead using battery, we
laser was hitting this part of the image, the corner prevented the decided to use a dual power supply which can power the 5V
camera from taking a picture of line laser on the object. Since raspberry pi and 12V stopper motor at the same time. The
there was no red line, no points of data were added to the STL 12V/5V AC to DC power adapter takes 100-240VAC as input
file. However in figure 4, when we scanned it with both lasers, voltage and output 12V and 5V. The output current will be 2A.
the gap was filled in. This is because the other laser hit the area The maximum power is 34W and it is calculated below.
where the gap was, however this time it hit the object in the view 12V*2A=24W, 5V*2A=10W, 24W+10W=34W. The
of the camera, which allowed the camera to capture the line raspberry pi takes 5V and 1.8A as input source, 50mA to draw
laser, and map the points accordingly. the GPIO pins and roughly 250mA to drive the keyboard and
After wiring the LED’s to the bread board, I connected them mouse. As a result, the power consumption roughly is 1.8A*5V
to a GPIO pin on the RP2. I wrote a python code that would turn (raspberry pi2) +1A*12V (table) +250mA*5V (Camera)
that particular pin to HIGH, which supplied enough voltage to =22.25W. Our dual power supply should good enough to handle
turn the laser on (3.3V). The python code would enter a for loop the power consumption.
that toggled the laser on an off. As a parameter it took in how
many times to blink and how long to say on before turning off. B. Software
This was important because we need the lasers to turn on and off
The software block (the purple block in Figure 1) is the block
again. I used what I learned in electronics lab and computer
that will control the hardware components, use these hardware
systems lab to accomplish these tasks, as well as learning a little
components to control the hardware to gather data, and process
bit of python on my own.
the data being gathered to produce the output STL file. These
processes are being controlled by the RP2.
Stepper Motor
The RP2 uses the Rasbian OS which is downloaded onto the
Our scanner able to do a 360-degree scans thought the
SD card. With this OS, the RP2 is able to run open source
implantation of a rotation table platform. Due to the high
software on GitHub known as freelss. Working with the
precision of control, we decided to use a stepper motors for our
terminal required some knowledge from software intensive
rotation motor. We choose NEMA-17 stepper motor; it is
engineering. The RP2 is driven on 5V, which will be supplied
4-wire bipolar stepper motor has 200 steps per revolution which
from a dual power supply that outputs 12V as well as 5V (the
is 1.8 degree per steps [5]. It has a maximum current of 350mA
12V are required to drive the stepper motor).
and therefore it required a stepper motor driver which driven
with 2 full H-bridge.
Team 8 Midway Design Review Report 4

As far as building this block is concerned, it is necessary to


get the Raspbian OS onto the RP2, and attaching the camera.
The software running on the RP2 needs to command the
physical hardware, which requires a library call WiringPi.
Finally, wiring must be done connecting the hardware to the
GPIO pins on the pi, in order to send commands to the
hardware.
When the scan begins, the RP2 sets the pin for the right laser
to HIGH, this enables the laser to shine a vertical red line over
the object that we are scanning. Similar to setting signals to
HIGH in computer systems lab. By capturing the image with the
camera, the software calculates an (x, y, z) coordinate for each
point of the vertical line that hits the object. After, that pin is set
to LOW and the laser turns off. The other laser gets set to HIGH
and the process is repeated again. Note that you can choose to Fig 5. This is how the user interface on our LCD screen looks
do a scan with either of the lasers instead of both, however the like.
quality of your scan would be lower due to less data points and We implemented a start button, which would run all of the
more gaps. terminal commands that we manually had to type into the
Once both lasers have been had their data obtained, the RP2 terminal. Essentially this button automatically opens a terminal,
sends a signal to the pins connected to the A9488 chip which changes directories to where the freelss software is located, and
controls the stepper motor. The stepper motor turns in steps of then runs the sudo ./freeless. Once the software is running, it
1.8 degrees. Once it steps, the data collection process begins automates another process for the user. It goes into the terminal
again. The process is repeated for 3200 steps, which is command ifconfig which allows you to find the IP address that
equivalent to 5760 degrees, or 16 revolutions. However there is you need to access the website. Finally, it opens up a web
no point in taking the same data points 16 times. What we browser and enters the IP address in the search bar, which brings
realized since MDR is that we want to reduce the step size of the you to the website needed to start scans. This entire process is
motor to 1/16 of a step. Now you can collect 16 more data points done with the touch of a button.
which will allow for less gaps in your scan. We changed the way Next we wanted to implement a way for a user to send his
our scanner worked by having a more productive single scans to a 3D printer, in order for our system to be end to end. In
revolution, as opposed to 16 less accurate ones. order to accomplish this we automated another process.
By taking all the data points of the line lasers from each step Originally, once we completed a scan, we would have to
of the way, the software combines them all in order to create the download the stl file, open a web browser, and email the file to
3D model of the object. ourselves. This was a time consuming process and required
In order to build this block, we had to familiarize ourselves knowledge of directories, as well as the system of the raspberry
with wiringPi. We ran into multiple roadblocks while pi. Since we wanted this to be user friendly, we created the shoot
integrating our blocks together due to our lack of understanding button. This immediately opens a folder that contains all the stl
of this concept. WiringPi had its own pin layout which the code files that you currently have. All the user has to do is select the
corresponded to, not the pin layout of the RP2. Once I figured file. The system will then prompt the user to put in the
destination email address. Once they do, they can click send and
this out I was able to drive the current to the correct locations in
what used to be a five to ten minute process, is now completed in
order to operate the hardware. I also had to learn how to work
less than a minute. Finally we created the exit button to close the
with open source code, this was the first time I work with
interface.
GitHub code.

C. The user Interface II. PROJECT MANAGEMENT


This is a block of a user interface. This consists of a capacitive Each team member’s individual roles were first assigned after
LCD panel and a user interface, which will allow user to interact the team broken down the project requirement.
with the device. At the beginning, according to our Siyan Lin has experience with microcontrollers and thus took
understanding of Freelss software, such software is a completely the responsibility for the putting together the hardware parts,
terminal based software. But as soon as we complied the supplying power to these parts, and designing the physical
software and ran it, we found out Freelss has its own interface. structure of the 3D scanner. This included building a fully
However, opening such interface involved typing commands functions stepper motor to precisely control the rotation of the
into terminal. You also needed to enter the I.P address into web turn table. Siyan also made sure the hardware was able to
browser. retrieve signals when the Pi sent them out. Siyan has
Based on situation discussed above, we’ve decided our user successfully demonstrated functioning hardware.
interface should save the trouble of going through all the tedious Vangjel expressed interest in software, so his responsibilities
steps and directly bring user to start a scan. include installed the Freelss software on the raspberry pi and
Team 8 Midway Design Review Report 5

making sure that it compiled. Vangjel made all the necessary expected! However, this strategy would only work for the lasers
changes corresponding to our 3D scanner project, including the because we knew that they would receive 3.3V or 1V (high or
use of WiringPi to which helps the software control the low). The stepper motor, however, had three different
hardware. Vangjel has gotten the software to do a full scan and components that needed to be wired correctly (the enable pin,
output an STL file. He also implemented the team website. the direction pin, and the step pin). Because they received the
Chenkai expressed interest in building a user-friendly voltage they needed from the 12V power source, finding the
graphical interface with start and how to button to guide the user right combination of the three pins was not as simple.
to use the software. Chenkai was able to demonstrated the user Considering there are forty pins on the RP2, finding the correct
interface on LCD to displace connectivity between GUI and three would be near impossible and inefficient.
However, being low on options and ideas, Siyan and
raspberry pi 2.
Chenkai, started using the voltmeter anyway to try and locate
As a team, we all took part in calibrating the lasers in order to
the correct pins. Meanwhile, Vangjel started to look into
take accurate scans. This was the most time consuming part of
WiringPi. Upon his research, we figured out that WiringPi had
the project. Until the lasers were correctly aligned, and the its own set of pins, which mapped to certain pins on the RP2.
software matched the distances of the laser accurately, the scans The pins for each of the lasers mapped to the same pins we
we were taking were of poor quality. discovered by using the voltmeter. We reconnected the
turntable by following this mapping and finally got all the
Team communication hardware components to work, after many days of
All the team members produced a schedule of their available troubleshooting.
times. We met at least once every week. Occasionally, team
members will meet with one another to clarify any question or
receive help and support. There was constant communication
though Facebook group chat. Weekly team meetings were
scheduled for Thursday and Sunday and meetings with our
Advisor, Professor Tessier were on Wednesday morning.
During each team meeting with our advisor, we each start off
with an overview of each member’s accomplishments. We had
different interactions depend on what stage of the project we
were in, and also what to try to improve on before the next
meeting. If we had any problems or concerns, we would discuss
how to move forward. We collaborate to share information as
well as work on PowerPoint presentations using Google drive.

III. CHALLENGES
Although we accomplished a huge milestone by being able to
output the STL file, it wasn’t without some serious challenges.
When we read through the code, we located the section that
assigned hardware components to certain pins (see Figure 6).
This code was written to be used by the original RP, so we
modified the pin numbers in the code, by looking up the pin
layout for the RP2. We connected the lasers and turntable to the
numbers that corresponded. However when we ran the software,
neither the turn table nor the lasers were working. At first we
considered that there might be something wrong with the
physical hardware of our system. We reran the python code for
the lasers and turntable, and they both worked fine. Our next Fig 7. The object we tried scanning
thought was that we weren’t getting the 3.3V that we needed to
operate the lasers.
By taking the voltmeter to the pins we thought were correct,
we realized that the voltage at this pin was constantly low. After
many attempts at debugging on the software level, we took a
new approach. We ran the code, and used the voltmeter on all
the pins to see which ones would toggle from low to high. Once
we found the pins, we hooked up the lasers and tried running the
code again. This time the lasers were working to the level we
Team 8 Midway Design Review Report 6

Once the structure new structure was in place, and the lasers
were calibrated, our results dramatically improved. Fig 9 shows
our results after these changes.

VI. CONCLUSION
By demo day, Siyan has successfully assembled all necessary
hardware and tested them. Vangjel has complied Freelss
software and Chenkai has written the user interface. The
calibration process was done, and the quality of the scans
greatly improved. We also managed to output an STL file
generated by Freelss. With the user interface completed, not
only is everything more user friendly but the speed at which you
can access the software improved dramatically. It also made the
Fig 8. Output STL file at MDR pre calibration system end to end with the incorporation of the shoot button.
With the incorporation of the soldering board, the wiring
The other challenge was calibrating the lasers. During MDR became much cleaner and out of sight. This also means it is less
likely that a wire will accidentally be disconnected.
we managed to get our system working, however we didn’t have
Most importantly we were able to not only scan our objects,
our lasers calibrated. We tried scanning a small white out (Fig 7),
but managed to print them too! (See figure 10)
and the results we received are shown in figure 8. This showed
that the hardware is working together with the software and
producing raw data. We can see there are many points
connected together to create the whole STL file. The big gray
part on the right is the surface of the turntable. The part on the
left is the object being scan. Since the calibration is off, we
didn't successful getting the exact shape of the object. We also
need to find a better way to hold or stabilize the part when
scanning the object.
In order to fix this, we changed our physical structure. We
attach the turn table to the component that holds the camera and
lasers. By doing so, the turntable was always a fixed distance
and the lasers could be angled properly. This also prevented the
turn table from vibrating which cause the object we are trying to
scan from moving. Fig 10. The object on the left is the original and the object on the
right is the print out of our scan.

The object that we scanned was 4 inches in diameter, while our


printed object was smaller by 1/8 of an inch. This means that our
accuracy was 31/32 which is equal to 0.96875. This means that
the accuracy of our scanner is about 96.875% accurate. We had
originally wanted to be within +/- 2mm of accuracy, but then we
realized that depending on the size of the object 2mm might be
an issue, for example scanning nails or nuts or bolts. We were
very satisfied with the accuracy that we were able to produce.
However, our scanner did have it’s limitations. Depending on
the color of the object, the red line laser might be difficult for the
camera to pick up. Green objects for example tended to have
gaps in some areas, because the red line laser wouldn’t shine as
bright. Also reflective metals, or clear materials like plastic or
glass also were incapable of being scanned.

REFERENCES
Fig 9. The scan once the calibration was done
Team 8 Midway Design Review Report 7

[1] L. Gilpin, '8 things you need to know about 3D scanners -


TechRepublic', TechRepublic, 2015. [Online]. Available:
http://www.techrepublic.com/article/8-things-you-need-to-
know-about-3d-scanners/. [Accessed: 08- Dec- 2015].
[2] 3dscanco.com, 'Benefits of 3D Scanning, 3D Scanners and
Reverse Engineering', 2015. [Online]. Available:
http://www.3dscanco.com/about/3d-scanning/benefits.cfm
. [Accessed: 08- Dec- 2015].
[3] LIM Innovations, 'Photogrammetry: Turning photos into
3D scans - LIM Innovations', 2015. [Online]. Available:
http://www.liminnovations.com/photogrammetry-photos-3
d-scans/. [Accessed: 09- Dec- 2015].
[4] D. Lanman and G. Taubin, "Build Your Own 3D Scanner:
Optical Triangulation for Beginners", Mesh.brown.edu,
2016. [Online]. Available:
http://mesh.brown.edu/byo3d/links.html. [Accessed: 20-
Nov- 2016].
[5] Pololu.com, "Pololu - A4988 Stepper Motor Driver
Carrier", 2016. [Online]. Available:
https://www.pololu.com/product/1182. [Accessed: 17-
Oct- 2016].

You might also like