157239n



Science and technology city contest for high school studentsYear 2016 – 2017Research, design and build 3d scanner to apply in 3d printerAuthors:1. H? Ng?c QuangClass 11A12. Nguy?n Qu?c Anh HuyClass 12A4Supervisor:Lê Th? Thúy, MSTime executed: 24/10/2016 – 30/11/2016Location: Lê Qu? ??n high school labArea: Software system - AlgorithmHCMC, Nov 2016ContentsPrelude3Section A: Introduction4Urgency of the problem4Reasons for choosing this problem4Researching purpose4Research methods4Research range and target4Section B: Content5Part I: Overview5 Ways to 3D print5 Ways to 3D scan6 Programming languages7Part 2: Theoretical framework9 3D space9 Working principle10 Applied in programming11Part 3: Calculation and assembling the machine13 The body frame13 The mechanism15Part 4: Experimental result17Part 5: Conclusion, problems and direction18Additional materials19Reference19THANK YOUIn order to finish this paper, beside efforts made by the author(s), we always receive motiation and help from supervisors, family and friendsFirst, we want to thank Ms.Lê Th? Thúy, supervisor of this paper – she has motivated, helped and created a suitable condition for us throughout the time being. She has also passionately passed down her knowledge and experience and it has been the foundation for us to complete this project.Thanks to our family and friends who has always support us throughout the time the project took place.Despite trying our best but due to a shortage of time so the project can’t avoid limitations. We look forward to receiving comments and recommendations.We sincerely thank you.Author teamHCMC, Nov 2016.Section A: IntroductionUrgencyof the problemAs economies grow and people begin to have more freedom to explore science, the need to create real-world objects, designed by the user to investigate the shape and functionality rise more and more. The economy experienced industrialization has created a huge number of devices with a low price and has satisfied the customer’s needs somewhat but to satisfy a larger amount of customer we need to use 3D printers. But 3D printing softwares already have pre-made samples, therefore the need for 3D scanners raise more and more.Benefits of our machine:Scan fast, clean, conveniently, simple and cheap, unlike big scanners containing a lot of cameras controlled by trained tecnicians that are currently in the market. In constrast our system will allow 1 people with some basic knowledge using a really small mchine to achieve results close to what’s available on the market.Reason for choosing this problemFrom the above reasons, along with the incentive to help interaction with 3d objects become easier, making the learning process more interesting and more hands-on, we have chosen this project.Researching purposeFigure out about scanning methods and both their strengths and weaknessesFigure out how to build the machin successfullyExperiment with various algorithms to scanResearching methodsTo do the project, we have used the following methods:Find, read, analyze and put together documentsCalculate, design and build the machineResearch range and target??i t??ng nghiên c?u (don’t know how to translate this): the system is composed of a static spinning table, capturing images of the object being spun to different angles.Areas of research: the system is designed to be simple, the user can easily assemble for themselves without having much knowledge. But because of its simplicity we can’t guarantee the material and equipment the user will use.Section B: ContentPart 1: Overview537210044450Ways to 3D print (AM – Additive manufacturing):+ First type (layering, topping layers on each other): Just like a typical 2D printer, the 3D printer will excrete a type of molten plastic and will move the tip (or the table below it) to the correct position and excrete plastic.In the image to the right, (1) is the tip where plastic is excreted, (2) is the object being build and (3) is the printing table that can move to correct positions.Pros: easy to manufacture, change with a low cost and don’t require much knowledge, sitable for hobbyist and studentsCons: slow (can take up to hours), poor accuracy influenced by many factors like heat expansion or humidity.431482541275+ Second type (CLIP – Continuous liquid interface production): there’s a tank filled with photopolymer, a substance when exposed to UV light in low oxygen environment will form a rigid structure (a process known as UV-Curing, picture α1.1.2). When the riid structure is formed there’ll be a frame that will lift the whole structure out of the liquid and we get our 3d object. In the above picture, UV Curable Resin is the substance photopolymer, Dead Zone is where the layers of th object are formed, Build Platform is the frame used to lift the structure up and Projector is where UV light are shun upon to harden the layers.22860028575Pros: accurate, a lot faster than type 1, object has flexible structure (which can be beneficial to some application)Cons: require in-depth knowledge, unsuitable for students and hobbyist, price for components are high, UV light are hard to create correctly, and has flexible structure (which can be harmful to some application).433387541275+ Third type (Photolithography): the surface is poured upon a photoresist layer sensitive to light and will disintegrate when exposed. Because of that people can create intricate patterns with an astounding percision, up to 22nm. Because of the immense accuracy of the method that it is used to create integrated circuits and microcontrollers in companies like AMD, Intel,… The process to create Ics involve more process depicted in picture α1.1.3. The above picture depicted the photoresist layer being disintegrated while picture beside is an actual image taken of a circuit etched through an electron microscope.5372100-685800Pros: Extreme accuracy, can be donewith a variety of materialsCons: demanding highly technical environment including using aclean room and other expensive equipment, have to work with lots of chemicals and implement safety methods to process those chemicals, unsuitable for students.53143156350 Ways to 3D scan:There’re two main way to 3D scan: time-of-flight and triangulation+ Time-of-flight: this involve a device that shine lasers and measure the time the light took to go to the location and back. By using this measured time and the fact that the speed of light doesn’t change much in air we can calculate the distance to the location. From that the operator can build a point map and from there reconstruct the initial object.Pros: Incredible range (up to several kilometers) due to lasers being used and are suitable to scan large buildings or geographial locations.Cons: Poor accuracy (by several millimeters) due to hot and cold air pockets in the laser’s path and because lasers travel fast (3?105 km/s) and timing equipment can lack accuracy.1968506985+ Triangulation: Shine a laser beam to the object and pick up the laser reflected in a camera placed far away, measure the angle at which the camera received and by using triangulation we can calculate the distance. The mechanism is somewhat like in a coincident range finderPros: very accurate (10-2 cm range), can scan sharp and smooth points.Nh??c ?i?m: Cannot scan things further than 9m. Programming languages:Currently, suitable programming languages to develop the algorithm are: Matlab, Python, and Java.4572000120650+ Matlab (Matrix laboratory): is a 4th generation language (high level), can manipulate matrices very easily (perfect for 3d spinning algorithms), can analyze data and function very effectively and can connect with other languages.Pros: simple structure, easy to learn and use. Save time to simulate concepts in science.Cons: lack flexibility because it’s a high level language (more specifically can’t do bitwise operations), and it’s not convenient for long term use.4819650403225+ Python: is a high level language, with a goal of simplifying code and make the code clean to both produce and read in comparison to Java and C++. Python is also designed to be expandable into a large application.Pros: medium structure, easy to learn, to edit, and is flexible for multiple jobs. There’re libraries like numpy, scipy that enables use of matrices and vectors. Operate well on a lot of platforms.Cons: Hard to form user-friendly statistics and other tools to help the user understand the code. 561022560325+ Java: is a medium level language but is modern and is object-oriented It’s also built to require a low amount of outside library. It recompile when changed to multiple systems and lead the “write once, run everywhere” revolution. Java is also the motivation for other languages like Android Studio, Eclipse, Processing or Arduino.Pros: easy to understand, have a tendency to abstract concepts, generate less bug and hence decrease the production time. Moreover Java is used everywhere, making it more reliable to run.We have chosen Java or more sprecifically Processing because its flexible nature.5422900-635+ Lego Mindstorms: is a high level language and uses blocks to program.Main components: ev3 brick (micro controller), sensors and engines.2597150552454572009525047942505524506350In the brick: there’re different tabs for different functionalities.Tab 1, 2: Listing out programs to runTab 3, 4: Use to quickly test sensors and engines, have 2 main part is Port View và Motor Control-2889885368935The above screen shows the Port View tab. The above line (which houses outputs), first is port A which is connected to a motor and the screen will display the turn number of the motorThe line below (which houses inputs), port 1 is connected to a touch sensor which have value of 0 (haven’t pressed), port 2 is connected to a color sensor which will measure the brightness of an object, (values ranging from 0 to 100) and port 3 connet with an ultrasonic sensor that will measure the distance to some arbitrary object.Programming in this language is fairly easy and Lego has provided a lot of tools to program efficiently and to easy to view more. The drawback is that the user tends to create spaghetti code và cost computer RAM.Ch??ng 2: Theoretical framework: 3D space:505777512065The space we encounter everyday is 3D space. It’s defined simply as every point reachable by linear combination of 3 initial, independent base vectors v1, v2 and v3. In other words, span(v1, v2), span(v2, v3), and span(v3, v1) different one by one. Mathematical structures most frequently used is the Spherical coordinate, which is a 3-tuple with 3 parameters (r, theta, azimuthal). R is the distance from the point to the origin, theta is the angle between the point and the zenith while azimuthal is the angle between the point’s projection on the Oxy plane and the Ox axis. There’re other structures like Cartesian coordinate, which is a 3-tuple with parameters (x, y, z) in which each value is the coefficient of the matching basis vector.To rotate an object in 3D, we use the following idea:Choose a plane that we will rotate, say OxyWe take those points and transform it into r?eiθ formTo rotate the plane an angle of α, we transform the above point to r?eiθ?eiα=r?ei(θ+α), or equivalently we can use the following formula: sinθ+α=sinθ?cosα+sinα?cosθ and cos(θ+α)=cosθ?cosα-sinθ?sinα257175139700Apply in code: First we have a 2 dimensional vector (50,0) and through spin function, that vector will spin. To prove it you can see after each frame the function will retain the old position but fainter. This is also the algorithm to rotate around Oz axis (we only change 2 parameter x và y)From that, we can easily switch to 3d by changing dr into 3 dimensional and define two other rotation around Ox và Oy. On the left is the way to implement this idea and is actually used in the main program.143510-720090To construct a really robust model we have added several functions to add points, lines and faces into the current mode:333375474345Through these rotation operations, we can spin the nodes at our will and from the spun nodes we can reconstruct the lines and faces:527685071120In the past we’ve rotated nodes by applying the spinning operation to obtain the new coordinates for every point. This is not ideal as it’ll consume lots of memory and the quality is not the best. Using this method we can have the voxels at 10 pixel wide, the frame rate is 0.3fps while only dealing with 3000 voxels, which is not the result we’re looking for. More over when using this algorithm, the initial coordinates no longer exist after spinning which lacks the flexibility we need (we have to destroy the object and create the new coordinates and have to spin all the points again, a costly process)Through some researching we have created a new method: Only spin the 3 basis vectors: dr0=1, 0, 0, dr1=0, 1, 0, dr2=(0, 0, 1) and by linearly combining the vectors we get the new point while still retaining the initial points: r'=rx?i+ry?j+rz?k in which r is the initial coordinate. You can see that we only rotate dr and don’t need to rotate the whole 3000 points.19050833755Linearly combining the spun basis vectors is only performed after every spinning operation is over and is ready to be displayed to the screen (“node” are the original points while “nodes” is the points after linear combining the basis vectors): Working principle:25019043815We use a scanning method called space carving: cutting out parts where the camera recognized as the background.In the left picture: The blue point is the camera and will travel in a cicular trajectory, taking pictures of the object from different angles. When we have the image, we differentiate between object pixels and background pixels and cut out the voxels whole location is in the background pixel.1449070238125Besides the new 3d spinning technique we have adapted the “devide and conquer” strategy. We start the raw object with only a sphere. Any sphere contains both the object pixel and the background pixel will disintegrate and form 8 spheres with half the size. This process is repeated until we obtain spheres with a diameter of 2. Using this method, we can focus the computer’s resources into the sharp edges of the object and ignore the center of the object. On the left is the object after being cut 1 time and we can see that the big spheres are focused in the center while smaller spheres will focus at the rear to give higher resolution. We can achieve sharpness of up to 2 pixels, the program can cut at 8 fps and the points fluctuate between 3000 and 12000 points. In general, this new method is 400 times better than the old method.36195004762530480047625 Applied in programming: There’re two programs needed: 1 on Processing, the other is on Lego Mindstorm.Ch??ng trình trên Processing ???c chia làm 4 ph?n:4762501418590Space Carving Adaptive ()This is the core file of the program and is also the place to control most of the variables.Setup function will setup necessary elements (camera, raw object, and emulator).Draw function will display the parameters and will update the object after either being cut or being spun. Displayed parameters:- frameRate: the current frame rate of the program - moved: whether mouse is interveining- bias: automatically spin the object- nodes: numbers of spheres the raw object currently have- isCutting: whether the raw object is being cut- ready to input: check for camera and made necessary camera setup- camera plugged in: constantly check for camera connection- cam #: index of camera being used (list of the available cameras are displayed in the console)mouseDragged function will receive and process signals from the mouse. keyTyped function will receive and process signals from the keyboard. Several basic keys:- “>” automatically spin the emulator and the raw object.- “s” toggle from a cutting state to a non-cutting state- “k” toggle from emulator to actual real world scanning - “c” spin the raw object 30 ?? to know what the current raw object looks like while scanning a real object- spacebar will capture the screen (while in emulator mode) and will cut and spin 30 degrees (while scanning real world objects). 36957003448050- Numbers from 0 to 9: choose different types of camerasOther functions: - prepare and nextSlice to receive data from camera- update will update the parameters, spin the emulator, raw object and cut the raw object furtherCell ()This is the class for a sphere. Instead of using real cubes, we choose to keep the spheres spheres because cubes redce the frame rate and increase the likelyhood of offsets.Object ()This is the class for the emulator (virtual object used to quickly demonstrate)Main functions:- addPoint, addLine,… to initialize the object- pointColor, lineColor,… to change colors. This function is routinely used in colorScheme function of the first file- getFrame will output the current image of the object under PGraphics type- rotateZ3D,… rotate the object as we desirePlaster ()This is the class for the raw object being cut:- getFrame: output an image of the object- splitCell: split spheres in the raw object to increase sharpness- cut: take in black and white camera data to cut the raw object- rotateZ3D,… : spin the raw object as we desire- updateNodes: linearly combining basis vectors to create new coordinates-69850442595Program on Lego Mindstorms to turn 30 degrees when a button (at port 1) is pressedCh??ng 3: Calculation and assembling the machineThe scanner include 2 main parts: a frame outside and the mechanical parts inside. The frame:Paper holding poles:8 pieces in total: 163830063500530860Top and bottom faces:Total 2 pieces:Spinning base:Total 1 piece to place the object: 698508255The mechanism:ContainingOne engine (EV3 Large Motor) to rotate and one button (MS, EV3, Touch Sensor) to activate spinning 30 degrees at a time and one microcontrollerA simple gear box to spi more accurately and a camera37655504445787400400050The finished mechanismThe finished frame:81280017145And the scanner put together:79375063501143006350Part 4: Experimental resultThe raw object after scanning a mouse:Some features:+ Sharp but the basic shape of the raw object is not obtained.+ Lighting problems.+ Despite of that this object have an advantage as it has a consistent dark black color without much detail inside.+ The base of the machine is not leveled.+ When spun the central axis is not aligned properly → still have offsets.1460506350New object, quality improved.Some features:+ Sharp, the basic shape is good.+ Background lighting fixed.+ Although there’re some problems with grey objects but the quality is still good.+ Offsets decreased a lot, when spun the raw object greatly resembles reality.Ch??ng 5: Conclusion, problems and directionAlthough the project has achieved some success but there’re still exist errors and problems not fixed: The space carving method can only scan the outside surface; the scanner can’t scan structures like the hollow part inside a cup. The scanner instead will scan a cup with a solid core. This is the case because limitations of the measuring device as they can’t measure distance to the object.This method also can’t scan color. We can incorporate color in but to keep a light program, reduce the time it takes to scan and make the project more realisticwe have excluded this functionality. Furthermore, as current 3d printers use only one type of ink it doesn’t really matter if the object scanned is only black and white.The rotating algorithm deviates from the true 3d space: In the algorithm, 2 parallel lines won’t intersect each other but in reality 2 parallel lines intersect at the horizon. This typically results in some parts of the object being cut too much.Future direction:Research and try to implement distance gauging devices.Research projective geometry to build a more realistic model to simulate 3D space.60102756350Additional materials:Picture α1.1.2Picture α1.1.3 Reference:About space carving: linear algebra: (I think this part need some sources from journals like right? But normally those are too difficult to read so it’s really hard to cite them here. Also I haven’t included really dry MLA and APA citations as this is considered a direct translation of the Vietnamese version. Also there’re some words that I don’t really know how to appropriately translate. Also in the results only the first one is really scanning the mouse while the second is the program scanning the built-in emulator (at that moment the camera got damaged pretty badly and my friends suggest faking it as the judges won’t notice). I’ve also tried different objects but really have no idea how to improve the quality of the scan.And yeah, the stuff I was told here might not be the norm in some other country so it might not look like a real paper. Sorry for any typos present. Anyway, hope you’ll give some tips to improve it :))) ) The second object truly scanned while having a bad camera (I know it’s really bad): ................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download

To fulfill the demand for quickly locating and searching documents.

It is intelligent file search solution for home and business.

Literature Lottery

Related searches