A path generation method for wire and arc additive remanufacturing of complex hot forging dies

Wire and arc additive remanufacturing (WAAR) technology has become a new solution for hot forging dies repair and remanufacturing. In this study, a path generation method is proposed for WAAR of hot forging dies. At first, a WAAR process of the hot forging die is presented, and considering the characteristics of large welding heat input and complex 3D digital model, the hybrid path planning strategy is confirmed as an appropriate strategy for WAAR. The developed hybrid path generation method for WAAR consists of three main steps: determine the direction of the scan line; divide and fill the internal area; and connect the sub-paths. The relatively optimal scanning direction is determined by calculating the length and inclination angle of each line segment in the contour lines, which reduces the possibility of sharp angles. The internal region is divided according to the position of the selected extreme points, and the path space is adjusted to avoid the occurrence of the unfilled phenomenon. At the stage of sub-path connection, some criteria are proposed to reduce the number of sub-paths. At last, the effectiveness and robustness of the proposed method are validated through the planar deposition experiment and the WAAR process of four damaged hot forging dies.


Introduction
In the past few decades, researchers have shown an increased interest in additive manufacturing (AM) technology due to its distinguished advantage of design flexibility, material saving, and time efficiency [1][2][3]. Gradually, AM technology has been increasingly applied in the aerospace, medical, and automotive industries [4,5]. As one of the AM processes, wire and arc additive manufacturing (WAAM) fabricates metallic components by depositing beads of weld metal layer by layer, using existing arc welding process such as the gas tungsten arc welding (GTAW) and the gas metal arc welding (GMAW) [6][7][8]. Compared with other AM processes, WAAM is now widely accepted as a more appropriate method for manufacturing large-scale components due to its higher deposition rate and lower costs [9,10]. In addition, WAAM technology has recently been tried and found suitable for remanufacturing large-scale industrial hardware such as hot forging dies, which is urgent for market demand.
In general, a WAAM process consists of four essential steps, namely, the building of a 3D model, slicing, path generation, and process parameters designing [11]. The contours of each layer can be available from slicing the 3D model, and the tool-path is the trajectory of the welding torch to fill the interior areas of each layer according to these contours. As path generation in the process plays a crucial role in building efficiency and geometrical quality, developing appropriate path planning algorithms to satisfy different requirements has always been a research hotspot. Direction-parallel paths and contourparallel paths are the most commonly employed path patterns in WAAM technology [12]. The generation algorithm of direction-parallel paths is easy and fast to realize, but it always leads to an unsatisfactory manufacturing accuracy due to discretization errors. In contrast, the contour-parallel paths have the advantage of superior manufacturing accuracy, while the offset algorithm is rather complicated especially when the shapes of the boundaries are comparatively complex. Furthermore, gaps may appear during the depositing process in this pattern. Several path strategies have been proposed based on these two patterns. Zhang et al. put forward a hybrid path planning strategy for WAAM [13]. The outline vector path is used to fill the outline of the image to obtain satisfactory surface accuracy, while the interior is filled with the zigzag path which is faster and universal. Ding et al. proposed a MAT (medial axis transformation) path planning methodology for the WAAM process [12]. This path strategy can tackle the gap problem completely by offsetting the medial axis of the cross-sectional geometry towards its boundary. Nevertheless, the MAT-based path was proved to be more suitable for WAAM of thin-walled structures, and the outline accuracy of solid structures is still poor. Besides, to fulfill the requirements of tool-paths for WAAM including continuity, high geometrical accuracy, and simple implementation, a novel path generation strategy has been introduced by Ding et al [14]. The strategy is capable of generating one closed curve that can fill the given 2D geometry. Similarly, early studies by Dwivedi et al. have developed a continuous path planning strategy for WAAM [15]. Both of them have the same limitation, that is, they cannot be effective and robust for arbitrarily shaped geometries. As opposed to the approach that generates paths using the same path strategy, an alternative approach is designing different path strategies according to the diverse geometric feature of parts, such as cross structures [6] and T-crossing features [16]. Furthermore, Michel et al. introduced a new path planning solution called modular path planning (MPP) [17]. The MPP solution combining the efficiency of the layer-by-layer deposition strategy to the adaptability of the feature-based approach can guarantee a more uniform deposition in WAAM. However, this kind of approach still requires excessive user intervention and is particularly beneficial for WAAM of thin-walled structures compared with solid structures.
Compared with the general WAAM process, the wire and arc additive remanufacturing (WAAR) of complex hot forging die generally adopts larger heat input considering deposition efficiency, which makes the collapse of the deposited metal and unevenness phenomenon more prone to occur. Moreover, the digital model in the WAAR process of hot forging dies is more complex and diverse. According to those specific characteristics, requirements of the path strategies for WAAR can be summarized as follows: (1) to obtain satisfactory geometrical accuracy; (2) to ensure that the surface quality of each layer is good, without collapse or unevenness; and (3) to be effective and universal for arbitrary geometry. However, the above-described path strategies were mainly developed for WAAM and have their own advantages and limitations; little attention has been paid to WAAR. This paper proposes a path generation method for WAAR of complex hot forging dies to improve deposition quality. The remaining part of the paper proceeds as follows. Section 2 presents the remanufacturing processes of hot forging dies and figures out the special requirements of path planning for WAAR. In Section 3, a hybrid path generation method is proposed in detail. The strategy consists of three main steps: determine the direction of the scan line, divide and fill the internal area, and connect the sub-paths. The implementation and the discussions of the proposed strategy are presented in Sect. 4, followed by a conclusion in Sect. 5.

The remanufacturing processes
Hot forging dies need to be in direct contact with hightemperature metals during the work process and at the same time bear huge impact loads [18]. The working environment is relatively harsh, so it is prone to various forms of failure such as cracking, wear, deformation, and fatigue [19]. To improve the service time of the hot forging die, the GMAW-based manual surfacing welding method is usually used in the production practice to repair and remanufacture the hot forging die [20]. It can produce new properties on the surface of the die which improves toughness, hardness, and strength. However, the method has a poor working environment, and the accuracy and quality of the die after surfacing are directly related to the level of the welding worker, which will cause material waste and cost increase.
The wire and arc additive remanufacturing technology has become a new solution for hot forging dies repair and remanufacturing. With this technology, the repair and remanufacturing process can be automated, while saving a large number of welding materials and improving production efficiency. As shown in Fig. 1, a wire and arc additive remanufacturing process of hot forging dies is as follows: 1. Gouging: After surface cleaning of the damaged die ( Fig.  1a), the defective region of the die is usually removed by arc gouging (Fig. 1b). The reason why the arc gouging method is chosen instead of the machine milling method is because of the consideration of costs and efficiency. 2. 3D scanning: Scan the gouged die with a 3D scanner to get the point cloud data (Fig. 1c). 3. 3D reconstruction: With the help of some reverse engineering software, like Imageware or Geomagic, the 3D model of the gouged die is reconstructed based on the point cloud data (Fig. 1d). 4. Boolean operations: Perform a Boolean operation on the gouged die model and the original intact die model to obtain the model (WAAR model) representing the removed part of the die (Fig. 1e). 5. Slicing and path generation: The WAAR model is usually sliced from the bottom to the top with the preset thickness, and each resulting layer adopts the same path generation strategy (Fig. 1f). 6. Simulation: Perform off-line simulation of robot motion in specific software to check the rationality of robot motion and avoid undesirable situations (Fig. 1g). 7. Metal deposition: Translate the path information into the program that can be executed by the specified robot. And then, the metal deposition process by GMAW is performed with preset welding parameters (Fig. 1h).

8.
After the die is repaired, heat treatment and milling are required. The former aims to improve its structure and performance, and the latter is used to restore its size.

Path planning strategy for WAAR
The hybrid path planning strategy that is generating contour paths along the boundary firstly and then filling the internal area with zigzag paths is considered the most appropriate strategy for WAAR. The specific reasons for choosing this strategy are stated as follows: the first is that the contour paths (including inner and outer boundaries) can ensure satisfactory dimensional accuracy of the deposited metal; the second is that the paths generated by this strategy can be applied to the arbitrary geometry. Generally, the shape of the hot forging dies cavity surface is complex. Moreover, due to the manual Fig. 1 The WAAR process of the hot forging die. a damaged die, b gouged die, c 3D scanning, d reverse reconstruction, e WAAR model, f path generation, g simulation, h metal deposition gouging process, this problem is further exacerbated. Consequently, the adopted algorithms must be effective and universal for arbitrary geometry; and the third is that filling the boundaries of contours first can avoid incomplete fusion and the weld bead collapse. As shown in Fig. 2, the part of the contour paths close to the die base can ensure the fusion between the deposited metal and the die base. And if only the zigzag paths are used, it is likely to result in incomplete fusion defects. On the other hand, when filling the internal area, due to the large welding heat input, the liquid metal in the molten pool at the position away from the die base cannot solidify rapidly and will flow around. Eventually, the weld bead may collapse. In this case, the contour paths can act as a barrier to prevent this phenomenon from happening. When adopting the hybrid path planning strategy in a WAAR process, it is worth noting that overfilled or unfilled phenomenon is prone to occur in the area close to the contour line. One of the cases occurs at the location where two directionparallel line segments are connected. As shown in Fig. 3, the unfilled area is approximately regarded as a triangle region, and the overfilled area is the same according to geometric symmetry. The area of this triangle region is calculated as Eq. (1): where d is the path space and α is the angle between the scan line and the contour line. It is clear that the smaller the angle α, the more serious the overfilled or unfilled phenomenon.
Especially, when the angle α is π/2 (the scan line is perpendicular to the contour line), it can be considered that there is no overfilled or unfilled phenomenon. Besides, the path space of the WAAR process keeps constant generally, which may lead to another case of unfilled. Since the internal zigzag path and the contour path must be separated by a path space, the internal path is generated by the intersection of the scan lines and the offsetting contour lines instead of the contour lines. Hence, the distance between the extreme point of the contour line and its adjacent scan line is always greater than the path space, which means that there must be an unfilled area between them, as shown in Fig. 4.
It is generally believed that overfilled or unfilled phenomenon will deteriorate the deposition quality. Since the deposited metal cannot reach the corners of the unfilled area, voids may be produced during the process. And when the next layer of metal is deposited, weld bead collapse is likely to occur in the overfilled area. In particular, in the WAAR process of hot forging dies, the diameter of the welding wire and the welding heat input is generally large, which leads to a relatively large width of the single-pass weld bead (typically greater than 10mm). This means that the overfilled or unfilled phenomenon in WAAR could be a severe problem. In addition, the weld bead geometry is usually uneven at the start and end of the weld paths. Moreover, in the WAAR process of hot forging dies, to avoid collisions with the die base, the welding torch must be raised to a certain height after each welding pass is deposited. Hence, the number of path passes should be minimized to improve manufacturing efficiency and quality. The path generation method introduced in this paper focuses on dealing with the issues described above.

Determination of the direction of the scan line
According to the requirements of path planning for WAAR, the contour path needs to be implemented first, and then the internal path follows. The contour lines of each layer are obtained after the model is sliced with the predetermined layer thickness. Obviously, the contour path consists of a number of Fig. 2 The hybrid path planning strategy Fig. 3 The overfilled and unfilled phenomenon in corners Fig. 4 Illustration of the unfilled phenomenon straight line segments. And as explained previously, the internal zigzag path is generated by the intersection of the scan lines and the offsetting contour lines. In this stage, the direction of the scan line has a great influence on the generated path. First, it affects the size of the unfilled and overfilled areas at the corners of the path. In addition, it also affects the number of sub-regions, which means the number of weld passes may increase. Compared with the latter, the former should be given priority because it may prevent the deposition process from continuing. However, due to the complex and irregular contour shapes, it is difficult to find an optimal direction to minimize the overfilled or unfilled area. In fact, only sharp corners in the path may cause severe forming problems [21,22]. A sharp corner will appear usually when the angle between the scan line and the contour line is small. Hence, a compromise is to find the relatively optimal direction of the scan line so that the possibility of sharp corners is greatly reduced.
Take the contour lines shown in Fig. 5 as an example to introduce a method for selecting the direction of the scan line, and the inclination angle θ between the scan line and the positive direction of the x-axis represents the direction of the scan line. The method is as follows: Firstly, calculate the length of each line segment in the contour lines and the angle between it and the x-axis. The angle ranges from 0°to 180°, which is divided into six intervals on average. Secondly, count the total length of line segments in each interval. Finally, select the interval with the minimum total length of the line segments, and the inclination angle θ is equal to the median value of this interval. In particular, when the selected interval has only one line segment, the inclination angle θ is equal to the angle between the line segment and the x-axis.
After a series of calculations, the statistical results are shown in Fig. 6. It is easy to conclude that the interval with the minimum total length of the line segments is [60, 90). According to the proposed method, the relatively optimal inclination angle θ of the scan line is 75°. As shown in Fig. 7, for the contour lines in Fig. 5, scan lines in several directions are used to generate the internal zigzag path. It is clear from the figure that when the inclination angle is 75°or 105°, there are almost no sharp corners in the internal zigzag path. Compared with other inclination angles, 75°is a relatively ideal inclination angle, although it is not necessarily the best one. The effectiveness of the proposed method is verified by this case.

Division and filling of the internal areas
After the direction of the scan line is determined, the next step is to divide the internal region of the contour into several subregions and fill each sub-region with a continuous zigzag curve. Without loss of generality, assume that the direction of the scan line is perpendicular to the x-axis, and the paths to fill the interior can be obtained by intersecting a number of scan lines with the offsetting contour lines. To avoid the unfilled phenomenon as illustrated in Fig. 4, the proposed toolpath generation method will accurately define the position of the sub-region. This method for division and filling of the internal areas mainly contains three steps.
Step 1: Pick out extreme points and sort them. As mentioned previously, the offsetting contour is composed of line segments. In practice, they are stored in the buffer in the form of point sets. The points of external offsetting contour lines are stored in an anti-clockwise manner, while the points of internal offsetting contour lines are stored in a clockwise manner. In the following sections, as shown in Fig. 8a, a point in the point set is called an extreme point if its x-value is greater than or less than the x-value of two adjacent points. Specifically, when the x-value of a point is equal to the x-value of one of its adjacent points, the previous point or the next point is selected as the new adjacent point (Fig.  8b). Considering the subsequent operations, the extreme points need to be identified as concave points or convex points. Concave and convex points are defined as follows: as shown in Fig.  8c, assuming V is the extreme point, V 1 is the Fig. 5 The direction of the scan line After all the extreme points of the offsetting contour are picked out, sort them according to their x-value from small to large. As shown in Fig. 9, there are 21 extreme points, including 9 convex points and 12 concave points. These extreme points divide the internal area into 8 subsections.
Step 2: Determine the position of all scan lines. First of all, it can be determined that there must be a scan line at the extreme point, as shown in Fig. 10. In particular, to avoid the situation where the intersecting line segments cannot be obtained, for extreme points with the same x-value, if the number of convex points is odd, the scan line needs to be adjusted by a certain distance. For example, the first scan line in Fig. 10 is moved to the right by a distance of 0.1d (d is the path space), because there are three convex points. Besides, the positions of other scan lines between two adjacent scan lines going through the extreme point are determined according to the path space. To ensure manufacturing quality and efficiency, process parameters in WAAR should not be changed significantly. Therefore, the path space is usually determined as a certain value before the WAAR process. Assuming that the preset path space is d, the distance between two adjacent scan lines going through the extreme point is L. Since L is not always an integer multiple of d, a slight adjustment to d is required. The specific method is as follows: The second is that if the intersection point is a concave point, it needs to be discarded. According to the number of line segments obtained after the intersection operation, each sub-section ( Fig. 9) is divided into several sub-regions. In each sub-region, all the line segments can be connected as a continuous curve. As shown in Fig. 11, there are 21 sub-regions, that is, there are 21 subpaths.

Connection of sub-paths
In terms of deposition efficiency and quality, the less the number of sub-paths, the better. Therefore, the sub-paths should be connected as much as possible. Assume that the positive direction of the x-axis is the filling direction of the path. As shown in Fig. 11, for each sub-path, there are two potential starting points (point A and B) and two corresponding ending points (point A ′ and B ′ ). By default, the point with large y-value (point A) is the starting point, and the corresponding ending point (point A ′ ) is also determined. Only the sub-paths of two adjacent sub-sections can be connected. Among the potential starting points of each sub-path of the next sub-section, the point closest to the ending point of the current sub-path is regarded as the potential connection point. Two sub-paths can be connected into a continuous curve, and the following two conditions need to be met: the first is that the connecting segment between the ending point of the current sub-path and the potential connection point of the next sub-section  Because if the length is excessively long, the overfilled phenomenon will occur as shown in Fig. 3.
The extreme value of this length can be determined by the user. In the current case, twice the path space is taken as the extreme value. In addition, there is a special case when connecting two sub-paths. As shown in Fig. 11, according to the default rules, point A is the starting point, and the ending point is A ′ . However, because the second condition mentioned above cannot be satisfied, this sub-path cannot be connected to the subpath of the next sub-section. In view of this situation, the problem can be solved by adopting point B as the starting point of the sub-path. It must be noted that in the process of forming a continuous curve, this method of changing the starting point can only be used once. As shown in Fig. 12, after the sub-path connection process, the number of sub-paths is reduced from 21 to 6.

Implementation and discussion
In order to demonstrate the ability of the developed algorithm to solve the unfilled problem, a simple planar deposition experiment is carried out. The experiment was implemented on a mild steel plate, and the filler material is the micro-slag self-shielded flux-cored wire with the diameter of 1.6 mm. The shielding gas with 80% Ar and 20% CO2 was used with a flow rate of 20 L/min. The following parameters remain constant during the experiment: welding current 340A, welding voltage 30V, welding speed 8mm/s, and path space 7mm. Two types of paths generated by the general hybrid method and the proposed hybrid method and the corresponding experimental results are presented in Fig. 13. It is clear that there are some unfilled areas in the bounded plane of deposited metal adopting the general hybrid paths. By contrast, the surface of the deposited metal adopting the proposed hybrid paths is better in terms of evenness and flatness.
In addition, to further validate the effectiveness and robustness of the developed algorithm for WAAR, four damaged hot forging dies (blade die, turbine disk die, valve body die, crankshaft die) were repaired with WAAR technology adopting the proposed path generation method, as shown in Fig. 14. All the WAAR processes were conducted by an ABB robot and a Fronius MIG/MAG welding machine. During the WAAR processes, there were no incomplete fusion defects and no phenomenon of weld bead collapse. Meanwhile, all the hot forging dies after remanufacturing show satisfactory dimensional accuracy. It can be concluded that the developed algorithm is not only applicable to hot forging dies of various geometric shapes, but also can ensure the quality and accuracy of deposition.

Conclusions
This paper presents a path generation method for the wire and arc additive remanufacturing (WAAR) process of hot forging dies. Different from the WAAM process, the WAAR process is performed on the gouged die with arbitrary geometric shapes, and its welding heat input is generally large. With consideration of these specific characteristics, the hybrid path planning strategy is an appropriate strategy for WAAR process. The proposed hybrid path generation algorithms firstly determine the relatively optimal direction of the scan line according to the inclination angle interval with the minimum total length of the contour lines, which can greatly reduce the appearance of sharp angles. And then, the internal region is divided into several sub-regions according to the location of the extreme points and makes an adaptive adjustment to the path space for each sub-region. These operations can prevent the occurrence of unfilled phenomenon. At last, the number of sub-paths is greatly decreased by adopting the proposed strategy for interconnection. Through a comparative experiment, the proposed hybrid paths can obtain a flatter surface of the deposited metal than the general hybrid paths. Furthermore, the repair trials of four damaged hot forging dies with WAAR technology validate the effectiveness and robustness of the developed algorithm.
Author contribution Yonghua Shen: conceptualization, experiments, and writing; Yanhong Wei: conceptualization, writing, and editing; Renpei Liu: conceptualization and project supervision. Availability of data and material Not applicable.

Declarations
Ethics approval Not applicable.
Consent to participate Not applicable.

Consent for publication Not applicable.
Competing interests The authors declare no competing interests.