Flexible and High-Precision Integration of Inserts by Combining Subtractive and Non-Planar Additive Manufacturing of Polymers

Additive manufacturing of polymers offers great potential for the production of complex structures. In particular, Fused Filament Fabrication (FFF) processes can be used to create functionally integrated components, in addition to easy handling, tool-free production and large material options. By combining a FFF system with a robot, inserts of different types can be integrated automatically during the printing process [1]. The low dimensional accuracy of FFF induces great difficulties during the insertion operation. Furthermore, with FFF, a planar layer structure leads to a stair-step effect when overprinting inserts with curved outer contours and reduces the adhesion to the insert. Further, the adhesion of FFF-filaments to the insert depends on the surface treatment of the insert [1]. A FFF system was combined with a robot [2] and has now been expanded to include a subtractive finishing unit and an inline process control based on a machine vision system, which enables the dimensional accuracy of the FFF components to be checked during the printing process. To be able to produce functionally integrated components, a flexible control architecture is being developed that enables the execution of additive and subtractive process steps. Optimal integration of inserts with complex geometries is facilitated by using non-planar layers in the FFF path planning. For this purpose, the filament layers of the FFF components follow the tilted or curved contours of the inserts. The modified process is demonstrated by manufacturing an integrated stator for an electric motor. A system for an additive-subtractive process for the integration of functional inserts was developed. In addition, a concept for the implementation of an improved connection of the inserts through non-planar FFF layers was created. First steps for the integration of the various system-modules and optical analysis of the dimensional accuracy and the development of a printing strategy for non-planar overprinting of the inserts have been realized.


Introduction
Additive manufacturing processes offer a wide range of possibilities for the production of complex components due to a layer-by-layer and tool-free manufacturing principle. One frequently used process is the fused filament fabrication process (FFF) which is based on material extrusion [3]. Thermoplastic materials, so-called filaments, are used as the feedstock. The filament is melted in the printing head of the FFF machine (printer) and extruded through a nozzle onto a printing platform (see Figure 1 left). For the movement of the print head relative to the printing bed of a Cartesian printer, three translational degrees of freedom are available. The z-direction of the printer corresponds to the build-up direction of the component and the x-and y-axis of the printer span a plane parallel to the building platform.
The FFF process offers a wide range of materials, large installation spaces and inexpensive system components. Due to the safe handling of the technology (no powder carry-over, protective gas or explosion hazard), FFF machines can be easily integrated into existing production lines [4]. In addition, the FFF process offers high flexibility during production. The extrusion and depositing of the material can be paused at any time. That enables additional work steps to be carried out, for example the integration of additional components such as inserts, bearings or cables. Hereby, a production of multifunctional components can be realized. However, the integration of inserts is difficult due to the lack of resolution, low accuracy and poor surface quality [5,6]. For these reasons, the FFF process is often only used for prototypical applications [7].
The opportunity to automatically integrate individual inserts during the additive manufacturing of polymer components has an enormous potential to increase the product design possibilities. The advantages of polymers (e.g. weight, insulation, durability) can be used in a targeted manner and combined with other material groups (metal, ceramics) or sensor technology to increase system intelligence and power density. By performing subtractive processing steps in an FFF process, the existing restrictions of insufficient dimensional accuracy, shape and positional precision could be overcome and first-time-right manufacturing would be possible.
A promising application for the combined manufacturing process is the production of electrical machines. Besides a modular and adaptable design with optimized magnetic, thermal and mechanical properties as well as an accelerated assembly are focused. The aligned integration of soft magnetic materials leads to an improved three-dimensional magnetic flux in machine types such as the axial flux machine [8]. Overall, an increased torque is achieved with decreased losses. Furthermore, additive manufacturing enables the direct cooling of loss zones, such as the electric windings, by simplifying the routing of the cooling channels [9]. Moreover, optimized mechanical properties are achieved by integrating reinforcing inserts into the zones of high load and decreasing the number of fasteners. In addition, the decreased number of fasteners and the integration of additional components, such as bearings, substantially reduce the assembly time. Finally, the electrical machine could be easily integrated in drive train concepts, including power electronics and gears, as shown in [10,11].

State of the Art
Digital process chain of the FFF. The FFF process is based on a layer-by-layer build-up and directional deposition of the semi-molten extruded polymer. The deposition of the filament onto the printing platform follows the printing path, which represents the trajectory of the printing head. The printing path typically is defined during print preparation by a slicing software. The starting point for print preparation is a CAD model of the component. The surface information is typically stored in a STL-file. For this purpose, all surfaces of the component are approximated with triangles (tessellation) and the vertices of the triangles as well as their normal vectors are saved. In the next step, the component is divided into individual layers (slicing) in the slicing software and the filament placement is planned for each layer (path planning). Based on the defined process parameters and settings, the slicing software generates a machine code (typically a G-code) for the selected FFF printer. [12] Relevant process parameters for slicing and for path planning are e.g. the layer thickness, the infill type and the infill orientation, the infill density and the number of contour lines. The layer thickness for the FFF process is typically between 0.1-0.3 mm. Due to the discretization and due to the planar layer-by-layer structure, a stair-step effect occurs for tilted or curved surfaces (see Figure 1 right).
Slicer algorithms usually divide the parts into parallel layers with a constant layer thickness over the entire component (uniform slicing) or into parallel layers with a variable layer thickness (adaptive slicing) [13,14]. For parallel and planar layers, the z-coordinate of the individual layers is constant [12]. In Tata et al. [14] an adaptive slicing algorithm for a stereolithography process with planar layers is presented. The algorithm is able to adjust the thickness of the individual layers according to the local geometry of the component. As a result, a significantly better surface quality of the components could be achieved.
In addition to these planar slicing strategies, other non-planar or curved slicing strategies are investigated [15][16][17]. Here, the finished component consists at least partially of layers with variable z-coordinates. Non-planar or curved slicing strategies are often developed with the objective of improving the surface quality. The possible number of non-planar layers varies, as does the degree of the realizable surface complexity. In Chakraborty et al. [16], a theoretical slicing algorithm for the FFF process to reduce the staircase effect on bi-directionally curved surfaces was presented. However, no change from planar and non-planar layers was provided here and an appropriately shaped deposition mould was required to produce the curved layers. For the presented slicing approach, a printer with five degrees of freedom was best suited. For a Cartesian printer, the use is limited to slightly curved components. In Huang and Singamneni [15] a mixed slicing method was presented. In this approach, a flat layer approach was combined with a curved layer approach. The objective was also to improve the surface quality by depositing non-planar layers. For this purpose, the component was divided into planar and non-planar areas and sliced with the corresponding approach.
In Ahlers [17] an approach for the generation of non-planar layers for a Cartesian FFF printer was presented. Here, a similar approach as in Huang and Singamneni [15] was used, i.e. the component was also built up of planar and non-planar layers. The basic idea was that the non-planar layers substitute the regular planar layers on top of the components. To do this, the component was first fully sliced with planar layers and the printing path was defined for all layers. In a next step, possible non-planar areas were identified and the trajectory of the non-planar layers and their printing paths was determined via a projection and an intersection calculation. This also enables a change from planar to non-planar layers. Nevertheless, even with this approach, only the top surfaces of components can be produced non-planar. A change from non-planar to planar layers is not possible. The presented algorithm was integrated into the open-source slicer "Slic3r" and the software package is freely available on Github [17].
Additive and subtractive manufacturing. Conventional manufacturing processes are increasingly being challenged in today's economy. The main reason for this are individual customer requirements under growing competition with high costs and time constraints. Various system concepts for combining additive and subtractive processing steps can be found in the state of the art and have already proven the advantages of such hybrid manufacturing processes. Particularly promising is the combination of the low-cost FFF process with the precision of CNC (Computerized Numerical Control) milling [18]. In addition to an economical production, this combination has the ability to produce components that cannot be made using conventional manufacturing [19]. For example, inserts can be integrated into the FFF component with high precision.

Achievements and Trends in Material Forming
Lee and Chung [20] were among the first to address the question of the advantages of combining FFF manufacturing with subtractive machining. For this purpose, they expanded a 5-axis machine to enable the switch between additive and subtractive manufacturing during the production process. A milling module was used for subtractive machining, which improved the manufacturing tolerances of the components.
In order for a print head and milling screw to work ideally together in the same setup, it is important to align them to each other with high precision. This was solved by a rotary module, which controls the alignment by using infrared sensors in [21]. In a further investigation, it was shown that this hybrid system could improve production tolerances by up to 70 % compared to the conventional FFF process [22].
In current research projects, the consumer sector and also in the industry, machine vision in combination with machine learning is increasingly being used to monitor FFF print jobs. For example, a failed print job that is characterized by the formation of unwanted strings (also known as spaghetti error) can be detected and aborted at an early stage [23]. The additive manufacturing process can also be monitored layer by layer to detect defects within the part [24].
The current machine vision technologies in FFF are used to save material by stopping the manufacturing process if a significant error is detected, but are not used for an aimed intervention to save the print job. As also shown in the state of the art, subtractive milling allows a significant improvement of the FFF process. Additionally, the combination of subtractive and additive manufacturing offers the possibility to integrate inserts with high accuracy into FFF components [19]. The subtractive process creates the dimensional accuracy and necessary tolerance of the area in which the insert is placed. Usually, inserts are positioned inside and not on the surface of the components. Therefore, overprinting of the inserts is necessary. For inserts with flat outer contours parallel to the layers of the FFF process, overprinting is possible [1]. In [1], good mechanical adhesion between stereographic inserts and an FFF component could be achieved.
For inserts with a curved outer contour, defects, locally higher pore density and a lack of dimensional stability of the FFF component are to be expected due to the known stair-step effect during overprinting. As a result, significantly reduced adhesion between insert and FFF component and significantly deteriorated mechanical properties are to be expected (see Figure 2 left). With a nonplanar layer structure when overprinting inserts with curved contours, the stair-step effect could be avoided and better adhesion of the inserts achieved (Figure 2 right).
For this reason, a new approach is presented that enables flexible and highly precise integration of inserts in additively manufactured components by combining different manufacturing techniques.
The manufacturing techniques to be used are the additive FFF process with planar and non-planar layers and additionally subtractive milling process combined with a machine vision system. The manufacturing process will be developed on the basis of a stator of an axial flux machine with various inserts (heat sink, bearings, electrical windings) and the potential will be demonstrated.

Description of the overall manufacturing process
To enable high-precision integration of inserts, a subtractive machining unit was integrated into an existing FFF system [1] and a machine vision system for monitoring and correcting dimensional accuracy is currently being developed (Figure 3 left). A non-planar slicing and path planning strategy for the additive process will be further developed to ensure stable adhesion and integration of the inserts with partially tilted and curved contours. Figure 3 (right) shows the planned interaction of the individual process steps, the typical process sequence and the interfaces of the planned production process. Before production begins, the slicing and path planning of the printing process takes place and the necessary G-code is generated. In this stage, the sequence of the individual process steps (FFF printing, subtractive processing and insert integration) is determined. For example, insert integration breakpoints are added to the G-code. During production, the manufacturing processes FFF, subtractive processing and insert integration run according to the defined sequence. The machine vision system analyzes the dimensional accuracy of the FFF component before milling and inserts integration. If the dimensional inaccuracies are too high, the milling and insert integration can be corrected, which results in an inline process control.

Description of the demonstrator
A conceptual stator of a double side yokeless axial flux machine is used as an application for the combined manufacturing process. This stator consists of a housing (blue), a heat sink (yellow), electrical windings with holder and pole shoes (brown and grey) as well as a bearing in green (see Figure 4). Despite of being illustrated as two segments, the housing is additively manufactured as a closed FFF component in which the other parts are inserted during the manufacturing process.
The heat sink is prefabricated with a sterolithography process (SL) to obtain a dense and sealed component with high geometric accuracy. The electrical windings of the stator represent the dominant loss zones for this type of axial flux machine and therefore the windings are the dominant source of heat. The freedom in placing and routing the cooling channels allows the heat sink to cover the total outer surface of the windings. The resulting layout of the cooling channels in the heat sink is visualized in the radial cross section on the right side of Figure 4 as the dotted zones. In comparison to an outer diameter cooling jacket this layout results in a decreased thermal path with an increased cross-sectional area thereby minimizing the thermal resistance to the cooling system. [9]

Figure 3: FFF-system with machine vision and subtractive modul (left). Planned production process (right).
For the demonstrator the electrical winding units consist of concentrated coils which are wound around preprinted FFF-coil holders. The winding units are integrated together with the pole shoes as additional inserts of the FFF housing. Consequently, the challenge of mounting the concentrated coils to the stator is directly solved by the new manufacturing process. Despite of building the connection between the coils and the housing the pole shoes fulfill another purpose. The pole shoes are made out of orientated electrical sheet metal or soft-magnetic composite and therefore have a higher magnetic conductibility than air and the used polymers. Additionally, the pole shoes cover the winding units in the axial direction and thereby increase the usable area of the air gap. Both facts lead to a decrease of the machine's magnetic resistance, therefore to an increase of the resulting flux in the air gap and finally to an increase of the resulting torque of the machine.
As can be seen in Figure 4, the stator is a circular component. The FFF housing and the SL heat sink are continuous components in the circumferential direction (t-direction). Additionally, 15 electrical winding units and one upper and one lower pole shoe each are distributed at even intervals of 24° around the circumference. The geometry of the demonstrator can be divided into several characteristic problems.
In Figure 5, various sections through the overall demonstrator and in Figure 6 various circular sectors of the FFF housing are shown. In the right area of the sections A)-C) the seating of the bearing is shown in each case. The bearing is a circular, hollow cylindrical component with flat upper and lower surfaces. It is inserted in the center of the FFF component and requires a flat seating surface as well as sufficient dimensional accuracy for the diameter of the seating. The top side of the bearing can be overprinted planar due to the flat geometry.
As a result of unbalanced axial forces of the axial flux machines, tensile forces act on the pole shoes which pull the pole shoes out of the stator in axial direction [25]. To overcome this effect, the pole shoes are covered by the FFF part which holds the pole shoes in position. Below and above the winding units, the FFF housing is therefore a closed component. The wall thickness of the FFF component has a thickness of approx. 2-3 FFF layers with 0,1 mm each (see Figure 5). Additionally, chamfers are incorporated on the radially inner and outer side of the pole shoes and at the heat sink. These chamfers exist on both the bottom and the top of the winding units and the heat sink (see Figure 5 sections A-C). In the FFF component, radial ribs are placed on the inner surface on the lower and upper side (see Figure 6) to cover the outer and inner chamfers at the pole shoes and at the heat sink. Due to these chamfers the thin FFF coating is strengthened by radial ribs. In the area of the chamfers and ribs, a non-planar slicing strategy is necessary to achieve sufficient fixation of the inserts in the FFF component. The typical stair-step effect of a planar slicing strategy would adversely affect adhesion in these areas (see Figure 2).

Non-planar slicing strategy and path planning
For the flexible manufacturing process (see Figure 3), the first stage is to generate the G-code including the definition of the process sequence and their parameters. The developed strategy for slicing and path planning is explained below. The developed strategy uses Ahlers' non-planar feature as a basis [17]. Originally, this was implemented in the Slic3r software [17]. Due to better framework conditions and more manifold path planning parameters, the non-planar feature was moved to Prusa Slicer 2.3.3. The non-planar slicing feature used is capable to change from planar to non-planar layers. However, the change from non-planar to planar layers is not feasible. To solve this challenge, a slicing

Achievements and Trends in Material Forming
strategy based on a combination of planar and non-planar component segments and an adapted infill type for each component segment is developed (see Figure 7).
The segmentation of a FFF component in z-direction is realized during the preparation of the component. In order to be able to carry out the subtractive process steps and to be able to insert the respective inserts, additional breakpoints are required in the G-code. At these breakpoints, the printing process is stopped and the respective process step is implemented. The breakpoints are also considered in the segmentation of the FFF component. For each segment, a reference point is defined on the axial axis and the required slicing principle is assigned to each segment.
The next step is to generate the G-code for each individual segment. For this purpose, the non-planar slicing feature is used. The segments are sliced planar in the first step of the slicing process and the printing path of the infills (path planning in the layer) is defined. Depending on whether the segment is to have a basically planar or non-planar layer structure, the infill orientation is selected. For planar layers, a concentric infill is always used with filament placement in the circumferential direction. For non-planar layers, either a linear, radially oriented infill (chamfers in the circumferential direction) or a concentric infill in the circumferential direction (radially orientated ribs) is used. Finally, the desired number of non-planar layers is generated and the print paths of the original planar layers are now projected onto the non-planar layers.
After generating the individual G-codes of the segments, a Matlab script is used to generate an overall G-code. The G-codes of the individual segments, the print sequence of the segments and the breakpoints for subtractive machining, machine vision and insert integration are used as input.
The analysis of the demonstrator in the outer circumferential area shows (see Figure 6) that nonplanar layers are necessary, especially at the outer chamfers of the pole shoes. In the lower region of the FFF component, a change from planar to non-planar layers is necessary in order to reproduce the chamfers of the lower pole shoes. Above the chamfers of the lower pole shoes, however, the geometry of the FFF component suggests planar layers again. Therefore, a change from non-planar to planar layers is necessary at this point. The same applies in the upper area of the FFF component. After building up the planar layers, non-planar layers are again required on the chamfers of the upper pole shoes. After overprinting the chamfers of the upper pole shoes, however, the FFF component must be closed with planar cover layers. Therefore, both a change from planar to non-planar and a change from non-planar to planar are required in this area. Due to the variety of inserts (pole pieces and electrical windings, heat sinks, bearings) and the necessary changes in slicing, two characteristic areas of the demonstrator are described below as examples with regard to segmentation, the non-planar / planar structure, the path planning and the breakpoints.
The first example is the outer area of the FFF component with the chamfers for inserting the pole shoes. In Figure 8 (left) the structure of the FFF component including all holding points is shown schematically. Here a planar layer structure with concentric infill is chosen for the most of the planar segments and a non-planar structure with linear infill in radial direction for the non-planar segments. The lower breakpoint is necessary for inserting the heat sink. A second breakpoint is created for inserting the windings with pole shoes.
Another important area are the ribs in the lower part of the FFF component (see Figure 8 right). Here, a planar layer structure with radial infill is selected in the lower area and a non-planar layer structure with concentric infill above it in order to be able to reproduce the chamfers well. A breakpoint is also necessary for inserting the heat sink.
System for non-planar additive-subtractive manufacturing with process control Figure 3 shows the current setup of the developed additive and subtractive system. The system consists of several modules and can be expanded. For example, the robot module for integrating the inserts can be added if required. Within the main module there is a kinematic system in gantry design. Currently, four print heads and a milling module are mounted on this kinematic. A machine vision system and an optimized print head are being developed as an extension to the existing system. Standard printheads are not suitable for non-planar printing because their structure can easily lead to collisions. With the newly developed optimized printhead, the freedom of non-planar printing will be significantly increased in the future. For a more reliable insertion of the inserts as well as a more precise milling, a machine vision system is developed which allows to measure theoretically each print layer. The measurement results are to be made available in a control loop for milling and insertion, resulting in an inline process control.
The basic principle for the layer-by-layer measurement of the additively manufactured components and the image processing algorithms used are explained below. Basically, the machine vision system has all the required nominal dimensions of the component that is being measured. This information is contained in the G-code and is transferred to the machine vision system. For example, the position of the center point and its radius are transferred for a circular cutout (bearing seat of the demonstrator, see Figure 4). As shown in the example in Figure 9 (left two images), two slightly shifted images of the printed component are taken with a stereo vision system. The images are first radially rectified to correct distortions caused by the lens. Then, a Canny algorithm is used to detect all edges in the image as shown in Figure 9. This also detects scratches on the print bed and the individual printed strands of the component.
Using morphological algorithms and a Hough-Transformation, unwanted fragments in the image are removed and the searched contour is made visible. This can be seen in Figure 10 (left image) as well as the merging of the right and left images. By measuring the distance (disparity) between the two circle centers and using known camera parameters, the 3D dimensions and the position of the printed part can be determined by epipolar geometry (see Figure 10 right image).
The verification of the dimensional accuracy analysis process so far has shown a measurement accuracy of +/-0.1 mm. The accuracy is to be improved further by better calibration of the stereo vision system. At this moment, only circular geometries and rectangles can be measured, but the measuring system is to be expanded for much more complicated geometries. The lighting installed in the machine room of the system is not currently suitable for reliable measurement of the internal contours of the FFF-components due to disadvantageous shadow casting. As shown in the illustration (see Figure 4) of the demonstrator, the housing is to be produced using the FFF process and contains an integrated bearing seat in the center. High accuracy requirements are demanded for the bearing seat. In order to be able to mill and measure this accurately, the illumination will be extended in such a way that the edges of different internal contours can also be recognized more accurately.

Summary
In order to enable flexible and highly precise automated integration of inserts in the FFF process, a new manufacturing process was developed and an existing system was expanded with various new modules. In particular, a machine vision system was integrated, which allows inline process control and thus enables precise milling and integration of inserts. In order to integrate inserts with better adhesion, a non-planer slicing strategy was developed. This makes it possible to overprint complex inserts closed along their upper contour and to achieve a tighter fit. The new slicing strategy also provides the flexibility to define the sequences of the newly developed process. Further improvements to the manufacturing system and the slicer are still in progress. In particular, an optimized print head is to be developed that can utilize the potential of non-planar slicing. In order to demonstrate the possibilities of this process, a demonstrator part has already been constructed which uses all the possibilities of the new production process. As soon as all components of the manufacturing system and the process have been completed and optimized, the demonstrator component will be manufactured and tested.