A Workflow for the Compensation of Substrate Defects When Overprinting in Extrusion-Based Processes

: Fused granular fabrication (FGF) is used in industrial applications to manufacture complex parts in a short time frame and with reduced costs. Recently, the overprinting of continuous fibre-reinforced laminates has been discussed to produce high-performance, functional structures. A hybrid process combining FGF with Automated Fibre Placement (AFP) was developed to implement this approach, where an additively manufactured structure is bonded in situ onto a thermoplastic laminate. However, this combination places great demands on process control, especially in the first printing layer. When 3D printing onto a laminate, the height of the first printed layer is decisive to the shear strength of the bonding. Manufacturing-induced surface defects of a laminate, like thermal warpage, gaps, and tape overlaps, can result in deviations from the ideal geometry and thus impair the bonding strength when left uncompensated. This study, therefore, proposes a novel process flow that uses a 3D scan of a laminate to adjust the geometry of the additively manufactured structure to achieve a constant layer height in the 3D print and, thus, constant mechanical properties. For the above-listed surface defects, only thermal warpage was found to have a significant effect on the bonding strength.


Introduction
Additive Manufacturing (AM) has become significantly more widespread in industrial applications in recent years.AM of high-temperature thermoplastics like polyether ether ketone (PEEK) is used to produce complex and lightweight parts more quickly and at a lower cost than traditional manufacturing technologies, while having mechanical properties comparable to light metals like aluminium [1,2].AM using a robotic arm with six degrees of freedom (DOF) is especially suited for industrial applications and processes since it can be applied to a variety of complex geometries [3].This is particularly attractive in the context of the repairing of defects.
The combination of 3D printing and in situ Automated Fibre Placement (AFP) is one method to achieve high-performance parts with the utilisation of the design freedom of AM.Laminates manufactured by AFP can withstand significantly more force than 3D-printed structures and can therefore be used as skins of sandwich structures.Extrusion-based 3D printing, like fused granular fabrication (FGF), can be used to manufacture a core structure of a sandwich.By using FGF to manufacture the core structure, these structures can be designed with integrated electronics or radiation shielding for aerospace applications and bonded onto the laminate in situ.This enables a compact design, e.g., satellites [4,5].
This overprinting of thermoplastic laminates has already been demonstrated [6,7].A prior study showed that the height of the first printed layer significantly influences the shear strength of the bonding with a laminate [6].A thin layer height results in improved shear strength in comparison with a thicker layer height.
Defects in the thermoplastic laminate can lead to geometric deviations from the ideal geometry and thus influence the bonding strength.Several defects in laminates deformation of a laminate [8][9][10].
The multiple parameters of the AFP process make it difficult to give exact dimensions and shape characteristics of defects due to the high degree of variability in the process.This fact is also reflected in the results of review articles highlighting different effects of the same defect category [11].However, multiple studies have been published, giving information on certain defects' exact shape and effect.Rectangular gap defects with a width of 0.76 mm-2.50 mm reduced the compressive strength of laminates by up to 27% [12].Triangular gap defects with an opening angle of 12° and a base width of 0.25 inches decreased tensile strength by up to 22% [13].A combination of multiple gap and overlap defects in one laminate can result in decreased mechanical properties or no effect of those defects [11,14].
Since the mechanical properties of the bond between the 3D-printed structure and the laminate is significantly influenced by the layer height of the first 3D-printed layer, and the above-listed defects result in a deviation of the real geometry from the ideal geometry of the laminate, it is crucial to account for those defects in the FGF process.The repair of defects with robotic AM has been widely researched in medical engineering.Due to the restricted field of view in medical applications, tactile scanning methods or manual reverse engineering are often used to digitalise defects [15][16][17].Process chains using optical scanning methods were only demonstrated in ex vivo applications [18,19].Since optical scanning allows for the scanning of large areas with high scanning resolution, it is more suitable for non-medical industrial applications.For industrial applications, manual measuring and reverse engineering of gap defects in laminates have already been demonstrated for high-performance composites [20].However, inherent to this approach are high processing times and a need for extensive manual work.Using in-process images of parts and in-process monitoring of parameters enables the detection and correction of defects in the 3D print using a machine-learning approach [21].
This study aimed to develop a workflow that considers the relevant defects in the laminate for overprinting and compensates for them through adapted toolpath planning.The effects of certain defects of AFP laminates on the bonding with AM structures are unknown.Hence, this study was divided into two parts: Firstly, the effect of gaps and overlaps on the shear strength of the bonding was investigated.Using these results, a suitable resolution of a digital model could be defined as only including defects that needed to be accounted for in the FGF process.By excluding other defects, the file size of the digital twin could be minimal.Afterwards, a process flow was developed and tested to adjust the geometry of the 3D-printed structure based on the defects of the The multiple parameters of the AFP process make it difficult to give exact dimensions and shape characteristics of defects due to the high degree of variability in the process.This fact is also reflected in the results of review articles highlighting different effects of the same defect category [11].However, multiple studies have been published, giving information on certain defects' exact shape and effect.Rectangular gap defects with a width of 0.76 mm-2.50 mm reduced the compressive strength of laminates by up to 27% [12].Triangular gap defects with an opening angle of 12 • and a base width of 0.25 inches decreased tensile strength by up to 22% [13].A combination of multiple gap and overlap defects in one laminate can result in decreased mechanical properties or no effect of those defects [11,14].
Since the mechanical properties of the bond between the 3D-printed structure and the laminate is significantly influenced by the layer height of the first 3D-printed layer, and the above-listed defects result in a deviation of the real geometry from the ideal geometry of the laminate, it is crucial to account for those defects in the FGF process.
The repair of defects with robotic AM has been widely researched in medical engineering.Due to the restricted field of view in medical applications, tactile scanning methods or manual reverse engineering are often used to digitalise defects [15][16][17].Process chains using optical scanning methods were only demonstrated in ex vivo applications [18,19].Since optical scanning allows for the scanning of large areas with high scanning resolution, it is more suitable for non-medical industrial applications.For industrial applications, manual measuring and reverse engineering of gap defects in laminates have already been demonstrated for high-performance composites [20].However, inherent to this approach are high processing times and a need for extensive manual work.Using in-process images of parts and in-process monitoring of parameters enables the detection and correction of defects in the 3D print using a machine-learning approach [21].
This study aimed to develop a workflow that considers the relevant defects in the laminate for overprinting and compensates for them through adapted toolpath planning.The effects of certain defects of AFP laminates on the bonding with AM structures are unknown.Hence, this study was divided into two parts: Firstly, the effect of gaps and overlaps on the shear strength of the bonding was investigated.Using these results, a suitable resolution of a digital model could be defined as only including defects that needed to be accounted for in the FGF process.By excluding other defects, the file size of the digital twin could be minimal.Afterwards, a process flow was developed and tested to adjust the geometry of the 3D-printed structure based on the defects of the thermoplastic laminate.A constant height of the first layer needed to be achieved to realise optimal mechanical properties of the bonding.

Manufacturing Facilities
For the in situ bonding of PEEK and Carbon-Fibre-Reinforced Polymer (CFRP) laminates with a matrix of a polyaryl ether ketone, a DXR system developed by Hans Weber Maschinenfabrik GmbH (Kronach, Germany) was used, and is shown in Figure 2a.It consists of a single screw extruder mounted on a robotic arm with six DOF.The extruder is divided into three heating zones, which can be heated to a temperature of up to 450 • C. The nozzle diameter can be set to 1 mm, 2 mm, or 3 mm.The print bed can be heated to a temperature of up to 300 • C.
laminates with a matrix of a polyaryl ether ketone, a DXR system developed by Hans Weber Maschinenfabrik GmbH (Kronach, Germany) was used, and is shown in Figure 2a.It consists of a single screw extruder mounted on a robotic arm with six DOF.The extruder is divided into three heating zones, which can be heated to a temperature of up to 450 °C.The nozzle diameter can be set to 1 mm, 2 mm, or 3 mm.The print bed can be heated to a temperature of up to 300 °C.
The AFP facility (AFPT GmbH, Dörth, Germany) of the DLR in Stuttgart was used for the fabrication of the thermoplastic laminates (Figure 2b).The setup consists of a six-DOF robotic arm with a Multi-Tape Laying Head (MTLH) as its end effector.The MTLH is manufactured by AFPT GmbH and can lay up to 3 tapes with a width of 0.5 in (12.7 mm) simultaneously.

Materials
The PEEK granulate TECACOMP PEEK 150 CF30 was used as a feedstock material for the FGF process.The material, fabricated by Ensinger Plastics (Nufringen, Germany), consists of carbon-fibre-reinforced PEEK with a fibre mass fraction of 30%.The properties of the material are listed in Table 1.The process parameters for the FGF process are stated in Table 2.

Property
TECACOMP PEEK 150 CF30 Density/g/cm 3  1  The AFP facility (AFPT GmbH, Dörth, Germany) of the DLR in Stuttgart was used for the fabrication of the thermoplastic laminates (Figure 2b).The setup consists of a six-DOF robotic arm with a Multi-Tape Laying Head (MTLH) as its end effector.The MTLH is manufactured by AFPT GmbH and can lay up to 3 tapes with a width of 0.5 in (12.7 mm) simultaneously.

Materials
The PEEK granulate TECACOMP PEEK 150 CF30 was used as a feedstock material for the FGF process.The material, fabricated by Ensinger Plastics (Nufringen, Germany), consists of carbon-fibre-reinforced PEEK with a fibre mass fraction of 30%.The properties of the material are listed in Table 1.The process parameters for the FGF process are stated in Table 2.The CFRP laminates were made from the unidirectional thermoplastic prepreg tape Toray Cetex TC1225, produced by Toray Advanced Composites (Morgan Hill, CA, USA).The prepreg has a PAEK as the matrix material.The PAEK has a lower bulk melting temperature than PEEK and is called low-melting PAEK (LM-PAEK).The melt temperature and glass transition temperature of the LM-PAEK are 305 • C and 147 • C, respectively.The prepreg tapes have a fibre mass fraction of 66% [23].

Methodology
In order to develop an effective workflow for the overprinting of laminates, the influence of the various defects in the laminate must be known, and a manageable digital process chain for web planning must be developed.This study, therefore, consisted of two main steps.Firstly, the influence of possible sources of defects on the joining of the 3D print to the laminate was analysed.The focus here was on defects from the AFP process.These were divided into local defects, in particular, gaps and overlaps, and global defects, in particular, warpage and waviness.The error potential of digital data acquisition and handling had to also be taken into account.
The second step followed a workflow that included measuring both the real geometry and the compensating defects.The results of the previous series of tests determined, in particular, which defects had to be taken into account and the necessary level of detail of the 3D measurement.Finally, the workflow was verified using a simple test print.The schematic structure of the study is shown in Figure 3.
Temperature of print bed/°C 280 Ambient temperature/°C 30 Printing speed/mm/s 20 Layer height/mm 0.6 Nozzle diameter/mm 3.0 The CFRP laminates were made from the unidirectional thermoplastic prepreg tape Toray Cetex TC1225, produced by Toray Advanced Composites (Morgan Hill, CA, USA).The prepreg has a PAEK as the matrix material.The PAEK has a lower bulk melting temperature than PEEK and is called low-melting PAEK (LM-PAEK).The melt temperature and glass transition temperature of the LM-PAEK are 305 °C and 147 °C, respectively.The prepreg tapes have a fibre mass fraction of 66% [23].

Methodology
In order to develop an effective workflow for the overprinting of laminates, the influence of the various defects in the laminate must be known, and a manageable digital process chain for web planning must be developed.This study, therefore, consisted of two main steps.Firstly, the influence of possible sources of defects on the joining of the 3D print to the laminate was analysed.The focus here was on defects from the AFP process.These were divided into local defects, in particular, gaps and overlaps, and global defects, in particular, warpage and waviness.The error potential of digital data acquisition and handling had to also be taken into account.
The second step followed a workflow that included measuring both the real geometry and the compensating defects.The results of the previous series of tests determined, in particular, which defects had to be taken into account and the necessary level of detail of the 3D measurement.Finally, the workflow was verified using a simple test print.The schematic structure of the study is shown in Figure 3.

Determining the Effect of Defects
To determine the effect of certain surface defects of a thermoplastic laminate on the bonding with additively applied PEEK, single-lap shear specimens based on ASTM D3846-08 [24] were used.Five specimens were produced for each investigated defect.Specimens were manufactured by printing a cuboid per specimen onto the defect of a laminate (Figure 4b).Afterwards, the specimens were separated and notched using a disk saw (Figure 4c).
To determine the effect of certain surface defects of a thermoplastic laminate bonding with additively applied PEEK, single-lap shear specimens based on A D3846-08 [24] were used.Five specimens were produced for each investigated d Specimens were manufactured by printing a cuboid per specimen onto the defec laminate (Figure 4b).Afterwards, the specimens were separated and notched using saw (Figure 4c).As the substrate for the printing of specimens, a laminate made from 0.5 in unidirectional carbon fibre prepreg tapes with LM-PAEK as the matrix material was The laminate had a [0°/90°]n layup and was manufactured using the AFP facility DLR in Stuttgart.
Using literature [8,9] and analysis of the used laminates, three surface defects identified as the most common.Gaps between tapes and overlapping tapes were t those.Thermal stress in a laminate can result in warpage and, depending on the waviness.Gaps and overlaps can result in the laminate surface deviating from the plane by up to 0.4 mm.The waviness of a laminate can result in a deviation of up mm.
For this study a laminate was produced which had gaps and overlaps in v places.The top layer intentionally missed some gaps to allow the placement of spec in different orientations onto defects, as shown in Figure 4a.Five specimens were p in an area with no identifiable defects, as a reference, and named in the followi specimens.Gaps and overlaps were placed parallel and orthogonal to the axis applied force in specimens.For each variation, five specimens were produced and t Specimens with gaps and overlaps parallel to the direction of load are named G ‖ ‖, respectively (see Figure 5b).Specimens with gaps and overlaps orthogonal direction of load are named G ⟂ and O ⟂ (see Figure 5a).As the substrate for the printing of specimens, a laminate made from 0.5 in wide unidirectional carbon fibre prepreg tapes with LM-PAEK as the matrix material was used.The laminate had a [0 • /90 • ] n layup and was manufactured using the AFP facility of the DLR in Stuttgart.
Using literature [8,9] and analysis of the used laminates, three surface defects were identified as the most common.Gaps between tapes and overlapping tapes were two of those.Thermal stress in a laminate can result in warpage and, depending on the layup, waviness.Gaps and overlaps can result in the laminate surface deviating from the ideal plane by up to 0.4 mm.The waviness of a laminate can result in a deviation of up to 0.6 mm.
For this study a laminate was produced which had gaps and overlaps in various places.The top layer intentionally missed some gaps to allow the placement of specimens in different orientations onto defects, as shown in Figure 4a.Five specimens were printed in an area with no identifiable defects, as a reference, and named in the following R-specimens.Gaps and overlaps were placed parallel and orthogonal to the axis of the applied force in specimens.For each variation, five specimens were produced and tested.Specimens with gaps and overlaps parallel to the direction of load are named G ∥ and O ∥, respectively (see Figure 5b).Specimens with gaps and overlaps orthogonal to the direction of load are named G ⊥ and O ⊥ (see Figure 5a).Global warpage or waviness of a laminate results in a global inconsistent layer height.This can impair the bonding strength.To investigate the effect of a global warpage or a large systematic defect, like waviness, of LM-PAEK laminates on the bonding with PEEK in extrusion-based processes, single-lap shear specimens based on ASTM D3846-08 [24] were produced.The toolpath was generated for the printing of specimens with a set layer height of 0.6 mm.Since the warpage of a substrate will result in over-or underextrusion, the layer height was manually changed to 0.4 mm and 0.8 mm.For both variations, five specimens were produced and tested.The specimens were notched using a disk saw.
If local or global defects need to be accounted for in the bonding process, the Global warpage or waviness of a laminate results in a global inconsistent layer height.This can impair the bonding strength.To investigate the effect of a global warpage or a large systematic defect, like waviness, of LM-PAEK laminates on the bonding with PEEK in extrusion-based processes, single-lap shear specimens based on ASTM D3846-08 [24] were produced.The toolpath was generated for the printing of specimens with a set layer height of 0.6 mm.Since the warpage of a substrate will result in over-or underextrusion, the layer height was manually changed to 0.4 mm and 0.8 mm.For both variations, five specimens were produced and tested.The specimens were notched using a disk saw.
If local or global defects need to be accounted for in the bonding process, the deviation of the real geometry from the ideal geometry progresses into the AM part.When successively changing the form of layers from the real geometry of the substrate to the ideal geometry of the AM part, changes in layer height in the individual layers themselves are the result.This leads to an over-and/or underextrusion, which can influence the interlaminar shear strength of the AM part.This effect was, therefore, investigated using single-lap shear specimens based on ASTM D3846-08 [24].Specimens were printed with a nozzle size of 3 mm and a layer height of 0.6 mm, which is the usual used setting.Without changing the amount of extrusion, specimens were produced with a layer height of 0.4 mm and 0.8 mm, resulting in an over-and underextrusion.For all variations, five specimens were produced and tested.The specimens were notched using a disk saw.
Table 3 summarises the defects considered, their effects on the printing process, and the corresponding tests carried out.Finally, data handling during path planning can also lead to deviations between the real laminate geometry and the robot's path planning during 3D printing.In order to capture the real geometry of the laminate, including the defects, the geometry was scanned in 3D.This measurement resulted in a mesh-based representation of the laminate surface.The more precise this measurement is, the larger the amount of data.However, very fine meshes are difficult to process in toolpath planning.It, therefore, makes sense to reduce the resolution of the mesh and, therefore, the amount of data.This reduction in the digital model can lead to a deviation between the real geometry and the digital model.The test results for over-and underextrusion were used to assess which deviations and, therefore, which data reduction can be tolerated.For this investigation, a scan of a laminate with significant waviness was used.The number of vertices was reduced to 90%, 80%, 70%, 60%, 50%, 40%, 30%, 20%, 10%, 5%, 2%, and 1% of that in the original scan.The data sets were then exported as .stl-filesand compared to the original scan data.The maximal deviations for each file were noted.

Workflow Implementation
The basic structure of the here-developed process chain is shown in Figure 6.Firstly, the geometry of a CFRP laminate has to be digitalised.An optical scanner, GOM ATOS 5, was used for this purpose.Afterwards, the scanning data are reduced to the necessary degree of detail using the mechanical test and used to modify the ideal geometry of the AM structure to account for the deviations between the ideal and the real geometry of the substrate.Using this modified geometry, a toolpath can be created.To achieve a constant layer height in the AM process, the toolpath needs to be non-planar, utilising three degrees of freedom of a 3D printer.degree of detail using the mechanical test and used to modify the ideal geometry of the AM structure to account for the deviations between the ideal and the real geometry of the substrate.Using this modified geometry, a toolpath can be created.To achieve a constant layer height in the AM process, the toolpath needs to be non-planar, utilising three degrees of freedom of a 3D printer.A demonstrator was produced to validate the workflow.Two lines with a width of 3 mm and a length of 500 mm were printed onto a laminate with significant warpage and surface waviness.One line was applied with an ideal planar geometry, while the other's geometry was changed using the described workflow.The height profiles of the lines were measured to calculate the layer thickness over the length of the lines.The measurements were then compared using a paired t-test.

Software
For the editing of 3D scanning data and .stl-files, the software GOM Inspect Suite 2020 (Carl Zeiss IQS Deutschland GmbH, Oberkochen, Germany) and Blender Version 3.4.1 by the Blender Foundation (Amsterdam, Netherlands) was used.The toolpath was generated using a modified version of the software Slic3r (Version 1.2.9) [25].A demonstrator was produced to validate the workflow.Two lines with a width of 3 mm and a length of 500 mm were printed onto a laminate with significant warpage and surface waviness.One line was applied with an ideal planar geometry, while the other's geometry was changed using the described workflow.The height profiles of the lines were measured to calculate the layer thickness over the length of the lines.The measurements were then compared using a paired t-test.

Software
For the editing of 3D scanning data and .stl-files, the software GOM Inspect Suite 2020 (Carl Zeiss IQS Deutschland GmbH, Oberkochen, Germany) and Blender Version 3.4.1 by the Blender Foundation (Amsterdam, Netherlands) was used.The toolpath was generated using a modified version of the software Slic3r (Version 1.2.9) [25].

Testing and Statistics
The single-lap shear tests were performed using a RetroLine 1475 testing machine built by Zwick Roell GmbH & Co. KG.(Ulm, Germany).The testing machine is equipped with a 5 kN load cell.The testing speed was 1 mm/s.The crosshead travel and the measured force were recorded throughout the test.
For the evaluation of the process flow, the surfaces of specimens were scanned using a Keyence VR5000 profilometer (Keyence Deutschland GmbH Leinfelden-Echterdingen, Germany).
An unpaired two-sided t-test was used to compare the two groups and evaluate the effect of defects.A paired t-test was used to later evaluate the effect of the process chain on the continuity of the layer height.p values ≤ 0.05 were considered statistically significant.The Bonferroni-Holm correction was used to adjust for alpha errors.

Effects of Defects
Gaps had an average width of 0.43 mm, and overlaps had an average width of 0.03 mm with a standard deviation of 0.15 mm and 0.06 mm.R-specimens achieved a mean shear strength of 18.87 MPa with a standard deviation of 4.78 MPa.
The adjusted p values for the comparison of the reference values with those of O ∥, O ⊥, G ∥, and G ⊥-specimens were 0.62, 0.31, 0.11, and 0.62 and thus indicated no statistically significant difference in shear strength between the reference specimens and the specimens with defects.The arithmetic mean values of the shear strength of the O ∥, O ⊥, G ∥, and G ⊥-specimens were 21.17 MPa, 23.38 MPa, 26.08 MPa, and 21.34 MPa and are shown with the corresponding standard deviation in Figure 7.

Effects of Defects
Gaps had an average width of 0.43 mm, and overlaps had an average width of 0.03 mm with a standard deviation of 0.15 mm and 0.06 mm.R-specimens achieved a mean shear strength of 18.87 MPa with a standard deviation of 4.78 MPa.
The adjusted p values for the comparison of the reference values with those of O ‖, O ⟂, G ‖, and G ⟂-specimens were 0.62, 0.31, 0.11, and 0.62 and thus indicated no statistically significant difference in shear strength between the reference specimens and the specimens with defects.The arithmetic mean values of the shear strength of the O ‖, O ⟂, G ‖, and G ⟂-specimens were 21.17 MPa, 23.38 MPa, 26.08 MPa, and 21.34 MPa and are shown with the corresponding standard deviation in Figure 7.The effect of over-and underextrusion is shown in Figure 9 and was determined to be −54.45MPa mm −1 .The effect of over-and underextrusion is shown in Figure 9 and was determined to be −54.45MPa mm −1 .The effect of over-and underextrusion is shown in Figure 9 and was determined to be −54.45MPa mm −1 .

Conceptualizing the Process Chain
To compensate for surface defects of laminates while in situ bonding with PEEK in the FGF process, the following process flow (Figure 10) was used:

Conceptualizing the Process Chain
To compensate for surface defects of laminates while in situ bonding with PEEK in the FGF process, the following process flow (Figure 10) was used: Firstly, a laminate was held on the print bed using vacuum bagging and was heated to 280 • C. A GOM ATOS 5 was then used to scan the laminate's surface, creating a point cloud.The scanning setup is shown in Figure 11.To include reference points in the scan, the tip of the extruder was positioned in three different positions near the laminate's surface, and is also scanned, which can be seen in Figure 12b.Using the robotic arm software, the coordinates of these reference points could be noted and later used to transform the point cloud coordinates using the GOM Inspect Suit software.Besides the laminate's surface, the scan also included the surrounding print bed and extruder parts, as seen in Figure 12a.By deleting these, only the laminate's surface was left, and the file size was reduced.The cleansed scan is shown in Figure 12c.To further reduce the amount of data, the GOM Inspect Suit software can be used to set a specific number of points used to describe the scanned surface.
Points were not distributed evenly.The point cloud was denser in areas of high detail.Gaps and overlaps are local defects, and thus, more points are necessary to describe those areas.Warpage and waviness of laminates affect the geometry of the whole laminate but still allow a continuous surface in contrast to gaps and overlaps.
Considering that gaps and overlaps do not have a significant influence on the bonding of PEEK on the laminate, these defects did not have to be accounted for in the described process flow and, thus, did not need to be included in the digital twin.By reducing the number of points used to describe the laminate surface, small details like gaps and overlaps are removed while preserving more global defects like warpage and waviness of the laminate.
To evaluate the effect of the reduction in vertices, scan data of the laminate shown in Figure 12c was used to compare .stl-files of the original scan with .stl-fileswith reduced vertices.Down to a reduction of 40% of the original number of vertices, no deviation was measurable, as shown in Figure 13d.When reduced to 10% of the original data, an .stl-fileshowed local deviations of up to ±0.01 mm (Figure 13c).Those deviations increased to ±0.02 mm when reducing the data to 5% (Figure 13b).At 1% of the original number of vertices, the deviations extended over larger areas and amounted to up to ±0.05 mm (Figure 13a).Firstly, a laminate was held on the print bed using vacuum bagging and was heated to 280 °C.A GOM ATOS 5 was then used to scan the laminate's surface, creating a point cloud.The scanning setup is shown in Figure 11.To include reference points in the scan the tip of the extruder was positioned in three different positions near the laminate's surface, and is also scanned, which can be seen in Figure 12b.Using the robotic arm software, the coordinates of these reference points could be noted and later used to transform the point cloud coordinates using the GOM Inspect Suit software.Besides the laminate's surface, the scan also included the surrounding print bed and extruder parts as seen in Figure 12a.By deleting these, only the laminate's surface was left, and the file size was reduced.The cleansed scan is shown in Figure 12c.To further reduce the amount of data, the GOM Inspect Suit software can be used to set a specific number of points used to describe the scanned surface.Points were not distributed evenly.The point cloud was denser in areas of high detail.Gaps and overlaps are local defects, and thus, more points are necessary to describe those areas.Warpage and waviness of laminates affect the geometry of the whole laminate but still allow a continuous surface in contrast to gaps and overlaps.
Considering that gaps and overlaps do not have a significant influence on the bonding of PEEK on the laminate, these defects did not have to be accounted for in the described process flow and, thus, did not need to be included in the digital twin.By reducing the number of points used to describe the laminate surface, small details like gaps and overlaps are removed while preserving more global defects like warpage and waviness of the laminate.
To evaluate the effect of the reduction in vertices, scan data of the laminate shown in Figure 12c was used to compare .stl-files of the original scan with .stl-fileswith reduced vertices.Down to a reduction of 40% of the original number of vertices, no deviation was measurable, as shown in Figure 13d.When reduced to 10% of the original data, an .stl-fileshowed local deviations of up to ±0.01 mm (Figure 13c).Those deviations increased to ±0.02 mm when reducing the data to 5% (Figure 13b).At 1% of the original number of vertices, the deviations extended over larger areas and amounted to up to ±0.05 mm (Figure 13a).Using these results and the effect of under-/overextrusion (see Section 3), an expected reduction in shear strength when reducing the number of vertices of an .stl-filecould be estimated.The corresponding diagram is shown in Figure 14.Since the effect of over-and underextrusion was greater on the interlaminar shear strength of the AM part, this effect was used in the model shown in Figure 14.Using these results and the effect of under-/overextrusion (see Section 3), an expected reduction in shear strength when reducing the number of vertices of an .stl-filecould be estimated.The corresponding diagram is shown in Figure 14.Since the effect of over-and underextrusion was greater on the interlaminar shear strength of the AM part, this effect was used in the model shown in Figure 14.
Using these results and the effect of under-/overextrusion (see Section 3), an expected reduction in shear strength when reducing the number of vertices of an .stl-filecould be estimated.The corresponding diagram is shown in Figure 14.Since the effect of over-and underextrusion was greater on the interlaminar shear strength of the AM part, this effect was used in the model shown in Figure 14.Dependent on the required mechanical properties of a part, Figure 14 can be used to lower the resolution of an .stl-file to ease the further use of the data without risking the impairment of the bonding strength in an unsuitable manner.
The digital twin of the laminate can then be exported as an .stl-fileand imported in the software blender together with the geometry of the structure to be 3D printed, the so-called core geometry.When designing the core geometry, attention should be paid to placing the geometry on the xy-plane and letting it extend in z-direction.Using the 'Boolean' operator, the digital twin of the laminate can be used to remove everything from the core geometry above the laminate surface.The modified core geometry can then be exported as an .stl-file.
To generate the toolpath for the 3D printer, a modified version of the software Slic3r is used.This slicer divides the part into two parts: one printed using a traditional planar toolpath and the other printed using a nonplanar toolpath.The planar printed segment functions as a scaffolding for the nonplanar top layers.By deleting the planar scaffolding, a purely nonplanar toolpath can be achieved easily and exported as a .gcode-file.
The robotic FGF system of the DLR requires a postprocessor to convert the .gcode-fileinto a .dxr-file,which is specific to the system.Lastly, the toolpath needs to be shifted in the z-direction since the top layer of the modified core geometry is at the same height as the laminate surface.The distance the toolpath needs to be shifted depends on the number of layers and the layer height.

Testing the Process Flow
A demonstrator was manufactured to evaluate the benefit of the developed process flow.It consisted of two 3 mm wide lines, which were printed onto a laminate.The laminate had a unidirectional layup, resulting in a substantial waviness of the surface, as shown in Figure 12c.To compare the profile of the laminate with that of the 3D-printed lines, the demonstrator was scanned using the Keyence VR-5000 profilometer.Figure 15a shows the 3D surface scan of the demonstrator.The profile of the laminate was measured between the two printed lines.Based on the scan shown in Figure 12c, it was assumed that the profile of the laminate between the lines was similar to that under the lines.In Figure 15b, the profile of the uncorrected line is shown.It can be seen that in places where the laminate is elevated, the layer height of the 3D print is thinned.The result of the corrected toolpath is shown in Figure 15c.The layer height is more constant compared with the uncorrected line.

Discussion
Preliminary studies [4] have shown that the thickness of the first 3D-printed layer is decisive for the shear strength of the bonding on the laminate.The influence of layer thickness on the mechanical properties of 3D-printed PEEK had already been researched and found to be significant [26].Ref. [27] was able to show, both experimentally and simulatively, that initial contact is an essential component of bond formation in 3D printing.These results are in good agreement with the experiments on over-and underextrusion shown in this study.Gaps and overlaps of tapes led to a local deviation from the target layer height.Therefore, the bonding has to be impaired in these areas.A form closure which improves the relative shear strength could be possible but can only be proven by further testing with a high sample size.The results of the single-lap shear tests had, in relation to the mean value, a high standard deviation of 3.12 MPa on average.With a significance value of 0.05 and a statistical power of 0.8, a sample size of 156 specimens would be required to detect a difference of 1 MPa between two groups with statistical significance.It is still important to note that even with no significant influence of gaps and overlaps of tapes on the strength of the bonding with PEEK, a layer height which is smaller than the tape thickness would lead to a collision of the extruder with the part.Further, it could be possible that the investigated effects of defects increase with smaller nozzle diameters.Further research is needed to characterise the effect of defects with their

Discussion
Preliminary studies [4] have shown that the thickness of the first 3D-printed layer is decisive for the shear strength of the bonding on the laminate.The influence of layer thickness on the mechanical properties of 3D-printed PEEK had already been researched and found to be significant [26].Ref. [27] was able to show, both experimentally and simulatively, that initial contact is an essential component of bond formation in 3D printing.These results are in good agreement with the experiments on over-and underextrusion shown in this study.Gaps and overlaps of tapes led to a local deviation from the target layer height.Therefore, the bonding has to be impaired in these areas.A form closure which improves the relative shear strength could be possible but can only be proven by further testing with a high sample size.The results of the single-lap shear tests had, in relation to the mean value, a high standard deviation of 3.12 MPa on average.With a significance value of 0.05 and a statistical power of 0.8, a sample size of 156 specimens would be required to detect a difference of 1 MPa between two groups with statistical significance.It is still important to note that even with no significant influence of gaps and overlaps of tapes on the strength of the bonding with PEEK, a layer height which is smaller than the tape thickness would lead to a collision of the extruder with the part.Further, it could be possible that the investigated effects of defects increase with smaller nozzle diameters.Further research is needed to characterise the effect of defects with their spectrum of different shapes and characteristics.This includes, in particular, investigating the effects of defects on curved structures and more complex dynamic profiles of path planning.The investigations must also be extended to other material systems in order to be able to use the process on a large scale.
The principle suitability of the developed process chain was demonstrated in this study.By using open-source software for the editing of .stl-filesand for generating the toolpath, this process flow is adaptable for a variety of FFF/FGF-machines, and costs are reduced.It was possible to adjust for the waviness and general warpage of a laminate with the developed process flow, as shown in Figure 9.This can be used to realise layer heights smaller than the height of a defect without the risk of a collision between the print head and substrate.
Reducing the detail of a scan reduces the file size, easing further data processing.However, reducing the detail of a scan increases the deviation from the ideal geometry, which can negatively influence the bonding of PEEK on the laminate.The software GOM Inspect Suite can be used to compare the original scan with the edited data, which allows one to estimate the change in bonding strength.
The used slicing software is only capable of generating a toolpath with three DOF, thus only being usable to account for small defects on a planar laminate.Using other toolpath-generating software, like AI Sync, all six degrees of freedom of the robotic arm can be utilised to orient the nozzle always orthogonal to the substrate.Furthermore, more advanced software can be used to adjust the toolpath successively to an ideal geometry.This is to prevent the surface defects of the laminate from progressing in other regions of a part.However, it is noteworthy that the used software, excluding those specific to hardware, was open-source and, thus, enables the applicability of the proposed workflow to a variety of AM processes.The part of the workflow used to compensate surface defects and generate a toolpath uses .stl-filesas input, and .gcode-filesare used as output.Thus, this process chain is adaptable for using any surface measuring system that can export the collected data as an .stl-fileand with any robotic manufacturing system that accepts .gcode-filesas an input.
Current systems for the compensation of substrate defects in 3D printing are either integrated into specific products, and thus expensive and hard to modify, or require extensive manual data collection and processing [20,28].Future research should focus on automating the presented workflow and integrating multiple systems into one software solution.An algorithm for deleting defects, which do not need to be compensated for, out of the data set, without lowering the resolution of the data set in general, might be necessary when overprinting complex curved surfaces.

Conclusions
In this thesis, a novel process chain for the overprinting of AFP laminates is proposed, which takes into account, and compensates for, surface defects in the FGF process.For this purpose, the different defects that occur in AFP laminates were first analysed with regard to their effect on overprinting in the FGF process.It was shown that deviations from the set layer height, which result in an underextrusion of the first layer, lead to a weakened bond between FGF-printed structures and laminates.This effect mainly occurs with global defects such as warpage or waviness.However, the results of this work show that gaps and overlaps of tapes in AFP laminates have no significant influence on the bond strength despite the unavoidable local deviation from the target layer height.Overall, there are three main factors that must be taken into account for toolpath planning:

•
Global underextrusion due to excessive distance between the nozzle and the laminate in the order of the layer height leads to poor bonding;

•
Local defects such as gaps and overlaps have no significant influence on bonding; • Recording the real geometry and taking it into account in the path planning is essential for a stable process.
A global deviation from the ideal geometry could be successfully compensated with the help of 3D scanning of the real geometry of an open-source software for path plan-ning.The workflow was visualised on a wavy surface, which led to a significantly more constant layer height.By keeping the layer thickness and the extrusion ratios constant on flawed surfaces, the presented workflow is suitable for implementing a stable process on large structures.
The demonstrated process chain is adaptable for a variety of AM methods where a constant distance between the print head and the substrate is required to control a part's properties.For non-planar parts or more complex defects, software utilising all six DOF of a robotic arm must be used, which will be the subject of further study.

Figure 3 .
Figure 3. Schematic structure of the study.Figure 3. Schematic structure of the study.

Figure 3 .
Figure 3. Schematic structure of the study.Figure 3. Schematic structure of the study.

Figure 4 .
Figure 4. Print and test setup for single-lap shear specimens: (a) laminate before printing, mo on the print bed; (b) printed specimens on laminate; (c) compression test for shear specimen

Figure 4 .
Figure 4. Print and test setup for single-lap shear specimens: (a) laminate before printing, mounted on the print bed; (b) printed specimens on laminate; (c) compression test for shear specimen.

Figure 5 .
Figure 5. Schematic representation of specimen configuration for laminate defects.(a) Defect perpendicular to the test direction.(b) Defect parallel to the test direction.

Figure 5 .
Figure 5. Schematic representation of specimen configuration for laminate defects.(a) Defect perpendicular to the test direction.(b) Defect parallel to the test direction.

Figure 6 .
Figure 6.Basic structure of the developed process chain.

Figure 6 .
Figure 6.Basic structure of the developed process chain.

Figure 7 .
Figure 7. Shear strength of the bonding of PEEK on certain surface defects.An overextrusion and underextrusion resulting from a deviation of the actual layer height from the set layer height significantly influenced the shear strength of the bonding.The results of the mechanical tests are shown in Figure 8 and indicate an effect of −18.28 MPa mm −1 .

Figure 7 .
Figure 7. Shear strength of the bonding of PEEK on certain surface defects.An overextrusion and underextrusion resulting from a deviation of the actual layer height from the set layer height significantly influenced the shear strength of the bonding.The results of the mechanical tests are shown in Figure 8 and indicate an effect of −18.28 MPa mm −1 .J. Manuf.Mater.Process.2024, 8, 147 9 of 17

Figure 8 .
Figure 8.Effect of under-/overextrusion on the shear strength of the bonding of PEEK on PEEK/CFlaminates.

Figure 8 .
Figure 8.Effect of under-/overextrusion on the shear strength of the bonding of PEEK on PEEK/CFlaminates.

Figure 8 .
Figure 8.Effect of under-/overextrusion on the shear strength of the bonding of PEEK on PEEK/CFlaminates.

Figure 9 .
Figure 9.Effect of over-and underextrusion on the interlaminar shear strength in 3D-printed structures out of CF-PEEK.

Figure 9 .
Figure 9.Effect of over-and underextrusion on the interlaminar shear strength in 3D-printed structures out of CF-PEEK.

Figure 10 .
Figure 10.Process flow used in this study.

Figure 10 .Figure 11 .
Figure 10.Process flow used in this study.

Figure 11 .
Figure 11.Scanning of a laminate on the print bed.

Figure 11 .
Figure 11.Scanning of a laminate on the print bed.

Figure 12 .
Figure 12.Scan of the laminate on the print bed: (a) unedited, (b) extruder tip included in the scan, and (c) cleaned scan data.

Figure 12 .
Figure 12.Scan of the laminate on the print bed: (a) unedited, (b) extruder tip included in the scan, and (c) cleaned scan data.

Figure 14 .
Figure 14.Geometric deviations of a scan from the real geometry dependent on the relative reduction in vertices in an .stl-fileand the subsequent change in shear strength of the bonding of PEEK on planar CF/PEEK laminates.

Figure 15 .
Figure 15.Data of a scan of the demonstrator with the profilometer VR-5000: (a) surface scan of the demonstrator, (b) surface profiles along a line on the laminate (black) and the printed structure (grey) without usage of the process flow, and (c) surface profiles along a line on the laminate (black) and the printed structure (grey) with the usage of the process flow.

Figure 15 .
Figure 15.Data of a scan of the demonstrator with the profilometer VR-5000: (a) surface scan of the demonstrator, (b) surface profiles along a line on the laminate (black) and the printed structure (grey) without usage of the process flow, and (c) surface profiles along a line on the laminate (black) and the printed structure (grey) with the usage of the process flow.

Table 2 .
Used parameters of the 3D printing process for the manufacturing of specimens.

Table 3 .
AFP defects and the corresponding tests performed.