Research on Key Technologies of FDM 3D Printing Based on Computer Assisted 3D Reconstruction

As a core technology in the field of high and new tech manufacturing,3D printing occupies an important position in the production process of aviation, shipbuilding, and automobiles. With the rapid development of 3D printing basic theory in recent years, how to further improve product accuracy, quality and modeling efficiency has become the current research focus in this field. Firstly, we conducted further research on the key technologies of FDM 3D printer, and combining 3D reconstruction technology with pretreatment technology. Secondly, we constructed and optimized the corresponding model layered slice and filling path planning algorithm. Thirdly, we designed a 3D suitable for rapid prototyping products printing control system. The research can provide an effective experience for the application of 3D printing technologies.


Introduction
As the core technology of the current vigorous development of the manufacturing industry, 3D printing can print out prototypes of highly complex and lightweight and stable products through the realization of incremental manufacturing. It is a manufacturing technology with the significance of the industrial revolution [1]. According to research findings [2], the current basic theory of 3D printing is relatively mature, and its application and promotion in various fields at home and abroad have achieved remarkable results. Therefore, the current research difficulties focus on how to further improve product accuracy and modeling efficiency [3], and complete 3D reconstruction of the surface characteristics of the target part, so as to optimize the model support structure and nozzle path planning in 3D printing, and reduce the overall printing cost.
Since the development of 3D printing technologies, in terms of the specific implementation mechanism of 3D printers, it can be divided into fused deposition modeling (FDM), stereolithography (SLA), and selective laser sintering (SLS) etc. Among them, FDM is a more typical one. According to statistics, FDM printing currently occupies about 60% of the market share [4]. Therefore, from the perspective of technology promotion, this research chooses the FDM printer that has become the mainstream in the market as the main research body, and plans and explores the path of the FDM printer nozzle. For example, Xu et al. [5] realized the lossless compression of the position information data set and the restoration and reconstruction of the layer section data according to the irregularly  [6] used design experiments to effectively test the maximum damage load, model thickness and modeling time of 3D printing materials, which were used to optimize various preset parameters in FDM technologies, such as layer thickness, filling percentage, and extruder temperature. Liu et al. used FDM technology to print the working characteristics of layer by layer and voxel, transform the planning problem of nozzle movement path into traveling salesman problem and improve the backtracking algorithm to solve it, which can greatly reduce the path repetition rate and position jump rate of the nozzle [7].
In the works, the research team mainly focused on FDM layered slicing and path planning algorithms to improve 3D printing efficiency and modeling quality. Although the type of work can achieve better performance under normal printing conditions, it does not combine pre-processing technology such as 3D model layering, filling paths, and model support with 3D modeling, so that it cannot further improve the efficiency of product rapid prototyping and quality (pre-processing technology is a key factor affecting the performance of FDM 3D printing). Therefore, this research through the in-depth study of the 3D reconstruction technology in the field of computer vision, try to combine the 3D reconstruction with FDM pretreatment technology, and strive to design and implement a 3D printing control system suitable for rapid prototyping products, for 3D printing provide reference for the intelligent development of high and new tech manufacturing technology.

Key technologies
Based on FDM 3D printing technology is one of the research hotspots in academia and industry in recent years. It faces the challenges of improving 3D printing performance (currently mostly focused on optimizing the 3D model layering, filling path and model support fields, However, there is no 3D printing control system that combines 3D reconstruction with pretreatment technology), and it is urgent to design a new 3D printing control system for the target product. The research will develop an FDM printing control system suitable for rapid product prototyping, construct and optimize the corresponding model layered slice and its filling path planning algorithm.

FDM printing control system
The research is oriented to the rapid prototyping technology of FDM products, and uses the existing open source system (such as Linux) as the carrier to design a printing control system consisting of a hardware layer, a system layer, a driver layer and an application layer. The system mainly includes the following three parts of functions: (1) Carry out 3D reconstruction of the target product through monocular vision technology, realize the conversion between sparse point cloud and dense point cloud, and finally complete the data export of the STL model.
(2) In the 3D printing pre-processing technology, the data loading and model restoration of STL files are realized, the model is triangulated and discrete layered and sliced, and the path planning of the data contour information of each section after layering is carried out to ensure the G-Code command Effective generation.
(3) The G-Code instruction file can be loaded into the hardware drive system to ensure that the 3D printer realizes the layer-by-layer printing of the 3D model and realizes the rapid prototyping of the target product.

Model hierarchical slicing and path planning
The pros and cons of the model layered slicing and nozzle path planning algorithms used in the print control system have a great impact on the improvement of product accuracy and modeling quality. However, how to select appropriate layered slicing and path planning algorithms based on the surface topology and geometric feature information of the 3D model is still a technical difficulty in current 3D printing rapid prototyping. So far, there is no perfect solution that can realize the seamless connection 3 from the input of the 3D model to the output of the G-Code command. Therefore, the research aims at the problem of 3D model configuration information and 3D printing data conversion, designs and optimizes model layered slicing and nozzle path planning algorithms suitable for rapid prototyping, and tests and verifies printer performance in actual environments, based on the solution. The realized printing control system strives for the overall system to exchange control information and drive hardware operation more reliably, robustly and efficiently.
In summary, the research aims to improve the modeling efficiency and accuracy of the FDM printing control system, and uses the 3D reconstruction technology of monocular vision as the theoretical basis, and explores the model layered slicing and nozzle path planning algorithms from the perspective of market applications. The content is the strategic goal and policy focus of the development of my country's manufacturing industry in recent years, and has important academic significance and practical value.

Application
The research is aimed at the rapid prototyping technology of FDM products, as well as the problem of optimal model layered slicing and nozzle path planning. Through the development of an FDM printing control system based on 3D reconstruction technology, a specific solution can be applied to model data conversion and hardware drive modules. In the application process, each stage is dependent on each other and can be independently developed. According to the requirements of the technical route, the research plan can be subdivided into four stages.
(1) Based on the 3D reconstruction technology, develop the FDM printing control system.
(2) Under the FDM printing control system in stage (1), design and implement the model layered slicing and nozzle path planning algorithm.
(3) Deploy the FDM printing control system in stage (1) on a unified hardware platform, and optimize the algorithm model of stage (2).
(4) By presetting various printing parameters (such as layer thickness, etc.), the overall deployment, testing and optimization of the FDM printing control system.
(1) System construction. This research uses the i3 3D printer as the carrier of the FDM printing control system, and builds a hardware system based on ATmega 2560 microcontroller, RAMPS 1.4 expansion board, A4988 drive module, MK3 hot bed and 42 stepper motor, and Establish a monocular vision model for the realization of 3D reconstruction related functions. First, the sparse point cloud is generated by passing the target image through SFM (Structure from Motion). Then use Multi-View Stereo (MVS, Multi-View Stereo) to generate dense point cloud data, and triangulate the dense point cloud into STL format; load the STL data through 3D printing pre-processing technology to restore the 3D model, and discretize the model data Hierarchical slicing (slicing can be carried out by using the triangle surface topology information, model geometric characteristics and model geometric continuity), and then path planning can be performed on the contour information of each section data after layering (by implementing the scanning and filling path generation algorithm), and finally Generate G-Code instruction codes; load G-Code instructions into the FDM printing control system, and realize the layer-by-layer printing of the 3D model by controlling the 3D printer (using ATmega 2560 core RAMPS 1.4 as the microcontroller) to obtain the rapid prototyping effect of the target product.
Through the above-mentioned FDM printing control system design scheme, the construction of a unified hardware platform can be initially realized, and then the monocular camera can be connected to the microcontroller to complete the overall system construction.
(2) Algorithm design. The key of FDM 3D printing technology is to realize layered manufacturing, and its core is to discretely process the data of 3D model. Through layered slicing and path planning, the STL format data can be converted into FDM printing system. Directly processed G-Code instruction file. Hierarchical slicing and path planning are directly related to the modeling quality and processing efficiency of the target product. Therefore, according to the data format and hardware characteristics of the FDM printing control system, this research designs different types of hierarchical slicing and path planning algorithms to improve product accuracy and quality and modeling efficiency.
For the model layered slicing algorithm, according to the use of triangular patch topology information, model geometric characteristics or model geometric continuity, this study designed and implemented three types of models layered slicing algorithms.
(1) A slicing algorithm based on the topological information of the triangle patch. According to the relationship between points and lines, lines and surfaces in the STL model, in the case of obtaining the coordinate information of a target triangle that intersects with the tangent plane, find the next triangle that is linked to it, and then find again cross. Repeat the above operations until the solution is completed to get the coordinates of the intersection of the new triangle. Finally, according to the known order of intersection points, two-dimensional contour lines are obtained by connecting the intersection points.
(2) A slicing algorithm based on the geometric features of the model. First, classify and classify all triangles in the STL model, and then sort the triangles to determine the coordinates of the vertices of the triangles. By judging the intersection of the vertex coordinates of the triangles that meet a certain relationship, and finally connecting end to end to generate a closed contour; (3) a slicing algorithm based on the geometric continuity of the model. The algorithm uses the continuity of the STL model, including the continuity of all triangles, edges and intersections that intersect with the slice plane, to establish a data link relationship graph. By layering the triangles, the intersection of each layer is obtained and executed in turn to obtain the closed contour line.
For sprinkler path planning, this research designs and implements a type of scanning and filling path generation algorithm. The scanning and filling algorithm must first consider the width of the printing silk material, and the silk material compensation can be realized by offsetting the polygonal contour obtained by the slice. Secondly, the scan area is constructed, which can be used for the generation of scan lines. Finally, the scan line and the contour line are intersected to obtain the twodimensional filling pattern of each layer, and then the filling pattern of each layer is accumulated layer by layer to complete the filling work of the final target model.
(3) Deployment optimization. The designed and optimized model hierarchical slicing and nozzle path planning algorithm, offline analysis through the actual measurement results, can determine whether it is necessary to modify the algorithm or optimize the parameters again. In the algorithm optimization of this research, for the layered slicing algorithm, four performance indicators of layered processing speed, layered efficiency, information storage memory size, and processing operation difficulty are used to measure; And for the path planning algorithm, the forming accuracy is used. The 3 performance indicators of printing speed, density and stability.
In order to avoid the model's layered slicing algorithm causing a large volume error (staircase effect) on the target model, thereby reducing the layering efficiency, so as to generate redundant and disordered data information, the slice thickness and the optimal slice direction can be adjusted. And after excluding the triangular faces that are not intersected, the set of intersection lines between the remaining faces and the layered plane is quickly obtained. By optimizing the parameters in the above manner, the link relationship of all intersecting lines can be established under the condition of removing redundant information, and orderly line segments are obtained and connected in order, and finally a two-dimensional contour curve is generated to ensure the efficiency of slicing and layering.
By analyzing the printing speed, printing path and the extrusion volume of the nozzle of the FDM printer, the algorithm parameters of the scanning and filling path generation algorithm in the nozzle path planning can be adjusted. Among them, the printing speed and the extrusion volume of the nozzle directly affect the quality of the processed surface. Common defects include the step effect, wire drawing, etc., and the poor printing path often causes warpage and deformation. Therefore, in order to reduce the impact of the dimensional accuracy caused by the step effect, it is necessary to repeatedly adjust the initial offset value of the slice polygon contour to ensure that the scan filling path generation algorithm can achieve the optimal filling effect of the target model. (4) Actual measurement analysis. After obtaining the FDM printer that meets the system performance requirements, this research will deploy and test the target print model (such as the use of a three-dimensional model with a maximum number of convex hulls of 64, etc.), and access different external cameras at the same time Perform 3D reconstruction and analyze the results. In order to analyze the results more accurately, this study imported the final G-Code code into the CNCSimulator Pro platform to realize the simulation of FDM 3D printing. In the actual three-dimensional 3D printing test analysis, the G-Code code can be analyzed to simulate the layer-by-layer printing process of the three-dimensional printer, that is, the conversion between the nozzle path and the G-Code command can be realized through calculation. The G command is usually composed of G plus a number. The function of the command is to notify the nozzle to complete the specified action at a specified time point, such as fast movement, slow squeezing, and linear interpolation.

Conclusion
The research focuses on the rapid prototyping technology of FDM products, as well as the optimal model layered slice and nozzle path planning, and conducts in-depth research on the key technologies of FDM 3D printers based on 3D reconstruction. We have completed the development of the FDM printing control system by combining the 3D reconstruction technology with the FDM printer. The system is applied to model data conversion and hardware drive modules, and ultimately improves the accuracy, quality and modeling efficiency of the target product.