Research on Additive Manufacturing Path Planning of a Six-Degree-of-Freedom Manipulator

: The research on additive manufacturing (AM) path planning mainly focuses on the traditional three-axis AM path planning and five-degree-of-freedom (DOF) AM path planning, while there is less research on six-DOF AM path planning. In the traditional AM path planning algorithm, the filling path is discontinuous and there is long straight-line printing in a certain direction, which can easily lead to warpage deformation. Therefore, in this work, the six-DOF manipulator is taken as the main object to build an AM platform, and the mechanism of AM path planning of the manipulator is studied. The path planning algorithm combining the contour offset filling method and Hilbert curve filling is optimized by using a cubic uniform B-spline curve, and an AM path planning algorithm suitable for a six-DOF manipulator is obtained. A continuous printing path can be generated by this algorithm. It reduces the existence of long straight-line printing in a certain direction, thereby reducing the warpage deformation of the model and improving the molding quality of the model. The traditional three-axis AM device and the six-DOF AM platform were used to print two kinds of models. By comparing the printing time, the six-DOF AM platform was 43.70% and 37.94% shorter than the traditional three-axis AM device. The same model was printed on a six-DOF AM platform by using the parallel scanning filling method, the path planning algorithm combining contour offset and Hilbert curve, and the method proposed in this paper. Through experimental verification, the average warpage deformation of the model printed by the method proposed in this paper was reduced by 37.81% and 13.79%, respectively, compared with the other two methods.


Introduction
Additive manufacturing (AM), also known as 3D printing, is a kind of rapid prototyping technology.Because of its advantages of fast forming speed, high processing precision, and high material utilization rate, it has broad application prospects [1].It has been applied in industrial production [2,3], biomedical [4], aerospace [5], emerging education [6], emerging consumption, and so on.
Commonly used path planning algorithms mainly include the parallel scanning filling method, contour offset filling method, and spatial curve filling method.As an important part of AM research, path planning has been studied by many scholars.In the aspect of traditional AM path planning, Jin et al. [7] proposed a parallel scanning path planning optimization algorithm for fused deposition modeling.By selecting the optimal scanning

Kinematics Analysis Based on the Homogeneous Transformation Matrix and Modified D-H Method 2.1. Motion Principle of Mechanical Arm
The six-DOF manipulator used in this paper is the Yaskawa GP8 manipulator, and its six kinematic pairs are all rotating joints.The first three joints of the GP8 manipulator determine the position of the wrist reference point, and the last three joints determine the direction of the wrist, which belongs to the 6R manipulator.The body structure and joint coordinate system are shown in Figure 1.
model, and the warping deformation of the model is compared to prove the effect and practicability of the proposed method.

Motion Principle of Mechanical Arm
The six-DOF manipulator used in this paper is the Yaskawa GP8 manipulat its six kinematic pairs are all rotating joints.The first three joints of the GP8 mani determine the position of the wrist reference point, and the last three joints determ direction of the wrist, which belongs to the 6R manipulator.The body structure an coordinate system are shown in Figure 1.Commonly used manipulator motion modeling methods mainly include the ard D-H method and the modified D-H method [18].According to the joint coordin the manipulator, the modified DH method is used to model the motion of the ma tor.The D-H parameters are shown in Table 1: The offset term in the above table is the angle between the drive shaft and the mission shaft when the robot is at zero, where D1 = 330, L2 = 40, L3 = 345, L4 = 40, a 340.

Forward Kinematics Analysis and Inverse Kinematics Analysis of the Manipulator
The forward kinematics of the manipulator describes that the joint angle i θ joint in the joint space of the manipulator is known, and the pose of the end effecto manipulator in the Cartesian coordinate system is obtained.According to the Commonly used manipulator motion modeling methods mainly include the standard D-H method and the modified D-H method [18].According to the joint coordinates of the manipulator, the modified DH method is used to model the motion of the manipulator.The D-H parameters are shown in Table 1: The offset term in the above table is the angle between the drive shaft and the transmission shaft when the robot is at zero, where D 1 = 330, L 2 = 40, L 3 = 345, L 4 = 40, and D 4 = 340.

Forward Kinematics Analysis and Inverse Kinematics Analysis of the Manipulator
The forward kinematics of the manipulator describes that the joint angle θ i of each joint in the joint space of the manipulator is known, and the pose of the end effector of the manipulator in the Cartesian coordinate system is obtained.According to the law of translation and rotation [18], the following conversion relationship between the two adjacent coordinate systems can be obtained.
where cθ i = cos θ i and sθ i = sin θ i .According to the established D-H parameter table, the homogeneous transformation matrix i−1 i T(i = 1, 2, • • • , 6) of each joint coordinate system can be obtained.Substituting the parameters of the manipulator in Table 1 into Formula (1), the homogeneous transformation matrix of each joint can be obtained.
The expression of the homogeneous transformation matrix 0 6 T of the end effector relative to the base coordinate system is as follows: An expansion of Formula (8) can be obtained.
r 11 r 12 r 13 p x r 21 r 22 r 23 p y r 31 r 32 r 33 p z 0 0 0 1 The meaning of each element in the matrix is as follows, where c 23 = c 2 c 3 − s 2 s 3 and The inverse kinematics of the manipulator describes the joint angle θ i of each joint in the manipulator when the parameters of each joint and connecting rod of the manipulator and the relative pose relationship between the end effector and the base coordinate system are determined.At present, the methods for solving inverse kinematics mainly include the analytical method and the numerical method [18].

Mechanical Arm Motion Space Solution and Print Trajectory Simulation
According to the DH parameters of the manipulator shown in Table 1, the motion modeling of the manipulator is carried out, and the modeling results are shown in Figure 2, the unit here is mm.
The meaning of each element in the matrix is as follows, where The inverse kinematics of the manipulator describes the joint angle i θ of each joint in the manipulator when the parameters of each joint and connecting rod of the manipulator and the relative pose relationship between the end effector and the base coordinate system are determined.At present, the methods for solving inverse kinematics mainly include the analytical method and the numerical method [18].

Mechanical Arm Motion Space Solution and Print Trajectory Simulation
According to the DH parameters of the manipulator shown in Table 1, the motion modeling of the manipulator is carried out, and the modeling results are shown in Figure 2, the unit here is mm.The Monte Carlo method is used to solve the motion space of the manipulator.The basic idea of the algorithm is that each joint of the manipulator is randomly traversed within the motion limit range, and the space is discretized by its forward kinematics mapping.The set of all random values of the end effector in the space constitutes the workspace of the manipulator.The Monte Carlo method is used to solve the motion space of the manipulator.The basic idea of the algorithm is that each joint of the manipulator is randomly traversed within the motion limit range, and the space is discretized by its forward kinematics mapping.The set of all random values of the end effector in the space constitutes the workspace of the manipulator.
The specific steps are as follows: Step1: Within the limit of the motion range of each joint of the manipulator, the random number rand (N, 1) in the interval of [0, 1] is generated by a random function, and the random value of each joint is calculated: In formula (10), N is the number of random numbers and θ i is the i-th joint angle, Step2: The pseudo-random value θ i solved in Step1 is substituted into the obtained forward kinematics equation of the manipulator to obtain the position point of the end effector of the manipulator in space.The set of end effectors corresponding to the random values of all joints in space points can be obtained by reciprocating circulation, and the workspace of the corresponding manipulator can be obtained.The motion space of the GP8 manipulator is shown in Figure 3.
In formula (10), N is the number of random numbers and i θ is the i-th joint angle, , Step2: The pseudo-random value i θ solved in Step1 is substituted into the obtained forward kinematics equation of the manipulator to obtain the position point of the end effector of the manipulator in space.The set of end effectors corresponding to the random values of all joints in space points can be obtained by reciprocating circulation, and the workspace of the corresponding manipulator can be obtained.The motion space of the GP8 manipulator is shown in Figure 3.The GP8 manipulator follows the Pieper criterion, that is, the last three axes of the manipulator intersect at one point.The inverse kinematics can be solved by using this criterion to obtain the optimal solution of six joints.According to the position of the wrist of the manipulator, the angle of six joints is solved by the analytical method, and then all eight groups of solutions of the manipulator are obtained.Finally, according to the constraints of each joint, the solutions that are not within the joint range of the manipulator are deleted, and the optimal solution that meets the conditions is obtained.values of all joints in space points can be obtained by reciprocating circulation, and the workspace of the corresponding manipulator can be obtained.The motion space of the GP8 manipulator is shown in Figure 3.The GP8 manipulator follows the Pieper criterion, that is, the last three axes of the manipulator intersect at one point.The inverse kinematics can be solved by using this criterion to obtain the optimal solution of six joints.According to the position of the wrist of the manipulator, the angle of six joints is solved by the analytical method, and then all eight groups of solutions of the manipulator are obtained.Finally, according to the constraints of each joint, the solutions that are not within the joint range of the manipulator are deleted, and the optimal solution that meets the conditions is obtained.The GP8 manipulator follows the Pieper criterion, that is, the last three axes of the manipulator intersect at one point.The inverse kinematics can be solved by using this criterion to obtain the optimal solution of six joints.According to the position of the wrist of the manipulator, the angle of six joints is solved by the analytical method, and then all eight groups of solutions of the manipulator are obtained.Finally, according to the constraints of each joint, the solutions that are not within the joint range of the manipulator are deleted, and the optimal solution that meets the conditions is obtained.
Based on the above solution method, the inverse kinematics of the printing path is solved, and the printing path simulation is performed.Figure 5 is the printing path simulation.Based on the above solution method, the inverse kinematics of the printing path is solved, and the printing path simulation is performed.Figure 5 is the printing path simulation.

The Basic Idea of the Algorithm
The contour offset filling method is used to fill the contour edge of the model several times, and the offset number taken in this paper is 1.The external contour is offset inward, and the internal contour is offset outward.According to the profile data after offset, the Hilbert curve is used to fill it.The cubic uniform B-spline curve is used to fit the generated Hilbert curve, and the optimization is carried out based on ensuring continuity.The overlapping part and the out-of-bounds part are processed.Finally, the manipulator program is generated.

Hilbert Curve
The Hilbert curve is a fractal curve that is a continuous, self-avoiding, filled unit square curve.The definition of the Hilbert curve is to divide a unit square into 2 n × 2 n small equal squares of equal size.The side length of each small square is 1/2 n , where n is the order of the Hilbert curve.Small squares are numbered from small to large in a certain order.The center points of small squares are connected with curves in order to obtain the corresponding order Hilbert curve [19].Figure 6 is a diagram of the change process of the Hilbert curve.The change process of the second-order Hilbert curve is as follows: and Improved Hilbert Curve Filling Method

The Basic Idea of the Algorithm
The contour offset filling method is used to fill the contour edge of the model several times, and the offset number taken in this paper is 1.The external contour is offset inward, and the internal contour is offset outward.According to the profile data after offset, the Hilbert curve is used to fill it.The cubic uniform B-spline curve is used to fit the generated Hilbert curve, and the optimization is carried out based on ensuring continuity.The overlapping part and the out-of-bounds part are processed.Finally, the manipulator program is generated.

Hilbert Curve
The Hilbert curve is a fractal curve that is a continuous, self-avoiding, filled unit square curve.The definition of the Hilbert curve is to divide a unit square into 2 2 n n × small equal squares of equal size.The side length of each small square is 1 / 2 n , where n is the order of the Hilbert curve.Small squares are numbered from small to large in a certain order.The center points of small squares are connected with curves in order to obtain the corresponding order Hilbert curve [19].Figure 6  Step1: Copy four copies of the first-order Hilbert curve graph shown in Figure 6a; Step2: Flip the two first-order Hilbert curves of the lower left corner 1 ⃝ and the lower right corner 4  ⃝; Step3: Connect and form the second-order Hilbert curve, as shown in Figure 6b.Similarly, the n-order Hilbert curve is based on the n − 1-order Hilbert curve for Step1-Step3.

Cubic Uniform B-spline Curve
The B-spline curve segment is defined by a series of control points and node vectors.The node vector determines the parameter values on the curve, and the control points determine the shape of the curve.The fitting process of the cubic uniform B-spline function is as follows: firstly, the coordinates of all points of the original curve are input, and the cubic B-spline smoothing is carried out.The given points are smoothed to the B-spline curve without increasing the number of points.Then, the cubic uniform B-spline fitting is performed, and a specified number of points are uniformly inserted between the nodes to complete the fitting.Given n + 1 control points V i (i = 0, 1, 2, . . ., n, n ≥ 3), the r-degree B-spline function can be defined as follows: where B i,r (u) is the basis function of the B-spline function of degree r, where u ∈ [0, 1].By the De Boor recursive formula [20]: when the degree r is 3, the i-th trajectory can be expressed as: The interval of the cubic uniform B-spline is [0, 1].Expanded by intervals, the Formula (13) becomes: The cubic uniform B-spline function formula can be obtained by expanding Formula (11).

The Basic Steps and Effect Diagram of the Algorithm
The flow chart of the path planning algorithm is shown in Figure 7.The specific implementation process is as follows: Actuators 2024, 13, 249 9 of 19

The Basic Steps and Effect Diagram of the Algorithm
The flow chart of the path planning algorithm is shown in Figure 7.The specific implementation process is as follows:

Contour Offset
The model is sliced and layered to obtain the inner contour and outer contour data of the model.The outer contour is offset inward and the inner contour is offset outward to obtain the offset contour data.Figure 8 is the contour offset effect diagram, where the red line is the outer contour and the blue line is the inner contour.

Contour Offset
The model is sliced and layered to obtain the inner contour and outer contour data of the model.The outer contour is offset inward and the inner contour is offset outward to obtain the offset contour data.Figure 8 is the contour offset effect diagram, where the red line is the outer contour and the blue line is the inner contour.

Contour Offset
The model is sliced and layered to obtain the inner contour and outer contour data of the model.The outer contour is offset inward and the inner contour is offset outward to obtain the offset contour data.Figure 8 is the contour offset effect diagram, where the red line is the outer contour and the blue line is the inner contour.

Hilbert Curve Filling
The first to eighth-order Hilbert curves obtained by MATLAB programming are shown in Figure 9.The area of each order Hilbert curve is 2 2 n ( -1).Therefore, the area of the offset contour is as follows: The minimum order n of the Hilbert curve of the current offset contour is calculated by Formula (17).

Hilbert Curve Filling
The first to eighth-order Hilbert curves obtained by MATLAB programming are shown in Figure 9.The area of each order Hilbert curve is (2 n − 1) 2 .Therefore, the area of the offset contour is as follows: Actuators 2024, 13, 249 10 of The above formula is equivalent to the following formula.
The Hilbert curve of the corresponding order is generated to complete the filling o the offset contour.According to the cross-section data, the Hilbert curve is used to fill the model, an the filling effect is shown in Figure 10.The blue line is the offset contour, and the orang line is the Hilbert curve.The minimum order n of the Hilbert curve of the current offset contour is calculated by Formula (17). ( The above formula is equivalent to the following formula.
n ≥ log 2 The Hilbert curve of the corresponding order is generated to complete the filling of the offset contour.
According to the cross-section data, the Hilbert curve is used to fill the model, and the filling effect is shown in Figure 10.The blue line is the offset contour, and the orange line is the Hilbert curve.According to the cross-section data, the Hilbert curve is used to fill the model, and the filling effect is shown in Figure 10.The blue line is the offset contour, and the orange line is the Hilbert curve.

Curve Clipping and Intersection
The polygonal Boolean operation is used to complete the clipping of the fitting Hilbert curve and the model contour.The coordinate point data of the optimized Hilbert curve is stored in array A, the outer contour data of the model is stored in array B, and the inner contour data of the model is stored in array C.
Firstly, the Hilbert curve beyond the outer contour is truncated.The intersection of array A and array B is obtained by using polygon Boolean operation, and the truncated data is stored in array D.
Then, the Hilbert curve inside the inner contour is intersected.The difference set of arrays C and D is obtained, and the intercepted data is stored in array E.
Figure 12a is the filling effect diagram without curve clipping and intersection, and Figure 12b is the filling effect diagram after curve clipping and intersection.In Figure 12, the red curve is the outer contour, the blue curve is the optimized Hilbert curve after the intersection, and the magenta curve is the inner contour.

Curve Clipping and Intersection
The polygonal Boolean operation is used to complete the clipping of the fitting Hilbert curve and the model contour.The coordinate point data of the optimized Hilbert curve is stored in array A, the outer contour data of the model is stored in array B, and the inner contour data of the model is stored in array C.
Firstly, the Hilbert curve beyond the outer contour is truncated.The intersection of array A and array B is obtained by using polygon Boolean operation, and the truncated data is stored in array D.
Then, the Hilbert curve inside the inner contour is intersected.The difference set of arrays C and D is obtained, and the intercepted data is stored in array E.
Figure 12a is the filling effect diagram without curve clipping and intersection, and Figure 12b is the filling effect diagram after curve clipping and intersection.In Figure 12, the red curve is the outer contour, the blue curve is the optimized Hilbert curve after the intersection, and the magenta curve is the inner contour.

Data Integration
The contour data of each layer is integrated with the internal filling data to obtain the printing path point data.The printing path effect diagram is shown in Figure 13.
Figure 12a is the filling effect diagram without curve clipping and intersection, and Figure 12b is the filling effect diagram after curve clipping and intersection.In Figure 12, the red curve is the outer contour, the blue curve is the optimized Hilbert curve after the intersection, and the magenta curve is the inner contour.

Data Integration
The contour data of each layer is integrated with the internal filling data to obtain the printing path point data.The printing path effect diagram is shown in Figure 13.

Program Generation
According to the format requirements of the associated mode program, it is necessary to convert the coordinates of the printing path points into the coordinates of the printing path in the printing platform relative to the base coordinate system of the manipulator.The position relationship between the coordinate system of the original point data, the coordinate system of the printing platform, and the base coordinate system of the manipulator is shown in Figure 14, the unit here is mm.The specific steps of data conversion and program generation are as follows: Step1: Coordinate origin to zero.In order to ensure the accuracy of coordinate transformation, before coordinate transformation, the starting coordinate origin of this group of coordinate data should be set to (0, 0, 0).The specific operation is to take the minimum value of the three coordinates in the first layer of the model as the zero point so that the minimum value of the component layer data is subtracted, that is, the zeroing operation is completed.
Step2: Coordinate data offset.After Step1 processing, the data after the coordinate origin is zeroed are obtained, and the newly obtained data are offset to the coordinate

Program Generation
According to the format requirements of the associated mode program, it is necessary to convert the coordinates of the printing path points into the coordinates of the printing path in the printing platform relative to the base coordinate system of the manipulator.The position relationship between the coordinate system of the original point data, the coordinate system of the printing platform, and the base coordinate system of the manipulator is shown in Figure 14, the unit here is mm.

Program Generation
According to the format requirements of the associated mode program, it is necessary to convert the coordinates of the printing path points into the coordinates of the printing path in the printing platform relative to the base coordinate system of the manipulator.The position relationship between the coordinate system of the original point data, the coordinate system of the printing platform, and the base coordinate system of the manipulator is shown in Figure 14, the unit here is mm.The specific steps of data conversion and program generation are as follows: Step1: Coordinate origin to zero.In order to ensure the accuracy of coordinate transformation, before coordinate transformation, the starting coordinate origin of this group of coordinate data should be set to (0, 0, 0).The specific operation is to take the minimum value of the three coordinates in the first layer of the model as the zero point so that the minimum value of the component layer data is subtracted, that is, the zeroing operation is completed.
Step2: Coordinate data offset.After Step1 processing, the data after the coordinate origin is zeroed are obtained, and the newly obtained data are offset to the coordinate system of the printing platform.The specific steps of data conversion and program generation are as follows: Step1: Coordinate origin to zero.In order to ensure the accuracy of coordinate transformation, before coordinate transformation, the starting coordinate origin of this group of coordinate data should be set to (0, 0, 0).The specific operation is to take the minimum value of the three coordinates in the first layer of the model as the zero point so that the minimum value of the component layer data is subtracted, that is, the zeroing operation is completed.
Step2: Coordinate data offset.After Step1 processing, the data after the coordinate origin is zeroed are obtained, and the newly obtained data are offset to the coordinate system of the printing platform.
Step3: Relative coordinate calculation.According to the relative position relationship between the base coordinate system of the manipulator and the coordinate system of the printing platform, the relative coordinates of the coordinate system of the printing platform and the base coordinate system of the manipulator are obtained.
Step4: Interpolation information confirmation.Interpolation information mainly includes interpolation point coordinates, interpolation angle, interpolation method, and interpolation speed.Interpolation point coordinates are obtained by Step1-Step3.The interpolation angle is determined according to the angle between the normal vector of the current printing plane and the Z-axis of the base coordinate system.The interpolation methods of the GP8 manipulator mainly include joint interpolation, linear interpolation, arc interpolation, and free curve interpolation.Because of the large number of point data, the manipulator is prone to alarm when using circular interpolation and free curve interpolation, which will cause the manipulator to stop running.Joint interpolation will produce trajectory offset during the printing process, so the interpolation method combining joint interpolation and linear interpolation is selected.Joint interpolation is used before entering the initial point of printing and after the end point of printing, and linear interpolation is used during the printing process.Through experimental comparison and material properties, the joint interpolation speed is set to 0.78% (the joint interpolation speed is expressed as a ratio to the highest speed), and the linear interpolation speed is 23.0 mm/s.

Experiment and Discussion
In order to verify that the six-DOF AM platform is more efficient than the traditional AM device in model printing, the models are printed on the traditional three-axis AD device and the six-DOF AM platform by using the parallel scanning filling method.The printing time is compared.
In order to verify the effectiveness and practicability of the proposed method, experiments are carried out.Firstly, the model is sliced hierarchically to obtain contour data.Secondly, the parallel scanning filling method, the path planning algorithm combining contour offset and Hilbert curve, and the method proposed in this paper are used for path planning.Then, simulation software is used to improve printing path programs and convert print programs.Finally, the six-DOF AM platform is used to complete the printing of multiple models, and the three-coordinate measuring instrument is used to detect the degree of warpage deformation of the models filled by the three methods.

Printing Path Program Improvement and Program Conversion
Simulation software is used to build the simulation environment, and the improvement in the printing path program and the program conversion are completed in the simulation environment.Through the algorithm steps described in Section 3.3, the printing path program can be obtained.Using the simulation environment to improve the printing path program, it is necessary to control the consumables conveying mechanism to obtain the printing program.Because the manipulator of this printing platform is limited by the program format, it is necessary to convert the associated mode program into the standard mode program.

Improving the Printing Path Program
For the motor control of the consumables conveying mechanism, the I/O signal is used to start and stop the control.OT# (2) is the start signal and OT# (3) is the end signal.The start signal is added before the start of model printing, and the end signal is added after the end of model printing.
In order to ensure the uniformity of the printing sprinkler head during printing, it is necessary to add free distance outside the printing model range before the printing program starts to avoid the lack of consumables supply during the printing process.
The single program of the GP8 manipulator can accommodate up to 9998 interpolation points.Because of the large number of printing path points generated by the method in this paper, the program needs to be split when generating the program, and each program is connected in series by CALL statement.

Standard Mode Program Generation
The GP8 manipulator program can be divided into two categories as follows: the associated mode program and the standard mode program.The point data format in the associated mode program is the coordinates and angles relative to the base coordinate system, and the point data format in the standard mode program is the pulse value of each joint.
The converted standard pattern program is shown in Figure 15, where 0418A011 is the printing path program.The GP8 manipulator program can be divided into two categories as follows: the associated mode program and the standard mode program.The point data format in the associated mode program is the coordinates and angles relative to the base coordinate system, and the point data format in the standard mode program is the pulse value of each joint.
The converted standard pattern program is shown in Figure 15, where 0418A011 is the printing path program.

Model Printing and Result Analysis
Two additive manufacturing devices are shown in Figure 16.The main specifications of the six-DOF AM platform are shown in Table 2.

Model Printing and Result Analysis
Two additive manufacturing devices are shown in Figure 16.The main specifications of the six-DOF AM platform are shown in Table 2.The GP8 manipulator program can be divided into two categories as follows: the associated mode program and the standard mode program.The point data format in the associated mode program is the coordinates and angles relative to the base coordinate system, and the point data format in the standard mode program is the pulse value of each joint.
The converted standard pattern program is shown in Figure 15, where 0418A011 is the printing path program.

Model Printing and Result Analysis
Two additive manufacturing devices are shown in Figure 16.The main specifications of the six-DOF AM platform are shown in Table 2.The molding temperature is 25 • C, the temperature of the printing sprinkler head is 200 • C, the printing platform temperature is 60 • C, the layer thickness is 0.2 mm, and the filling density is 100%.With PLA as the printing material, the cube model with a size of 63 × 63 × 4 (mm) and the cylinder model with a radius of 30 (mm) and a height of 4 (mm) are filled by the parallel scanning filling method.The traditional three-axis additive manufacturing device and the six-DOF AM platform are used to print the two kinds of models each.In order to ensure the fairness of the experiment, the moving speed of the printing sprinkler head and the diameter of the printing sprinkler head are consistent.The model printing time (excluding the pre-planning algorithm time) is shown in Table 3.The traditional three-axis AM device prints two kinds of models, and the average time is 1.785 h and 1.265 h, respectively.The six-DOF AM platform prints two kinds of models, and the average time is 1.005 h and 0.785 h, respectively.Compared with the traditional three-axis AM device, the printing time of the six-DOF AM platform is shortened by 43.70% and 37.94%, respectively.The main reason for the difference between the two devices is that the response speed of the motor is different.When the corner is encountered, the motor response speed of the six-DOF AM device is faster, so the overall printing time is shorter, and the printing efficiency is higher.
Under the above experimental conditions, the parallel scanning filling method, the path planning algorithm combining the contour offset filling method and the Hilbert curve, and the method proposed in this paper are used to fill the cube model with a part size of 63 × 63 × 4 (mm), and the six-DOF AM platform is used for printing.Three models are printed for each method.The printing process is shown in Figure 17.Comparing the printing effect, the model printing effect of the three methods is shown in Figure 18.The molding temperature is 25 °C, the temperature of the printing sprinkler head is 200 °C, the printing platform temperature is 60 °C, the layer thickness is 0.2 mm, and the filling density is 100%.With PLA as the printing material, the cube model with a size of 63 × 63 × 4 (mm) and the cylinder model with a radius of 30 (mm) and a height of 4 (mm) are filled by the parallel scanning filling method.The traditional three-axis additive manufacturing device and the six-DOF AM platform are used to print the two kinds of models each.In order to ensure the fairness of the experiment, the moving speed of the printing sprinkler head and the diameter of the printing sprinkler head are consistent.The model printing time (excluding the pre-planning algorithm time) is shown in Table 3.The traditional three-axis AM device prints two kinds of models, and the average time is 1.785 h and 1.265 h, respectively.The six-DOF AM platform prints two kinds of models, and the average time is 1.005 h and 0.785 h, respectively.Compared with the traditional three-axis AM device, the printing time of the six-DOF AM platform is shortened by 43.70% and 37.94%, respectively.The main reason for the difference between the two devices is that the response speed of the motor is different.When the corner is encountered, the motor response speed of the six-DOF AM device is faster, so the overall printing time is shorter, and the printing efficiency is higher.
Under the above experimental conditions, the parallel scanning filling method, the path planning algorithm combining the contour offset filling method and the Hilbert curve, and the method proposed in this paper are used to fill the cube model with a part size of 63 × 63 × 4 (mm), and the six-DOF AM platform is used for printing.Three models are printed for each method.The printing process is shown in Figure 17.Comparing the printing effect, the model printing effect of the three methods is shown in Figure 18.Based on the Z coordinate of the midpoint at the bottom of the model, the Z coordinate values of the four corners at the bottom of the model are measured by the threecoordinate measuring instrument.Nine points are taken from each corner, and the average value is taken as the warpage deformation of the corner.The three-coordinate measuring instrument is shown in Figure 19.The experimental results are shown in Tables 4-6, where angle 1, angle 2, angle 3, and angle 4 are the measurement angle numbers.Table 7 is the average warpage deformation of the model filled by the three different methods.Figure 20 is the average warpage deformation change diagram of the four corners of the three filling methods.It can be seen in Figure 20 that the model filled by the method proposed in this paper is superior to the model filled by the other two filling methods as a whole.Based on the Z coordinate of the midpoint at the bottom of the model, the Z coordinate values of the four corners at the bottom of the model are measured by the three-coordinate measuring instrument.Nine points are taken from each corner, and the average value is taken as the warpage deformation of the corner.The three-coordinate measuring instrument is shown in Figure 19.The experimental results are shown in Tables 4-6, where angle 1, angle 2, angle 3, and angle 4 are the measurement angle numbers.Table 7 is the average warpage deformation of the model filled by the three different methods.Figure 20 is the average warpage deformation change diagram of the four corners of the three filling methods.It can be seen in Figure 20 that the model filled by the method proposed in this paper is superior to the model filled by the other two filling methods as a whole.Based on the Z coordinate of the midpoint at the bottom of the model, the Z coordinate values of the four corners at the bottom of the model are measured by the threecoordinate measuring instrument.Nine points are taken from each corner, and the average value is taken as the warpage deformation of the corner.The three-coordinate measuring instrument is shown in Figure 19.The experimental results are shown in Tables 4-6, where angle 1, angle 2, angle 3, and angle 4 are the measurement angle numbers.Table 7 is the average warpage deformation of the model filled by the three different methods.Figure 20 is the average warpage deformation change diagram of the four corners of the three filling methods.It can be seen in Figure 20 that the model filled by the method proposed in this paper is superior to the model filled by the other two filling methods as a whole.It can be seen from the data in Table 7 that the average warpage deformation of the filling model of the parallel scanning filling method is 0.108712 mm, the average warpage deformation of the filling model of the path planning algorithm combining the contour offset filling method and the Hilbert curve is 0.078429 mm, and the average warpage deformation of the filling model of the proposed method is 0.067613 mm.Compared with the other two methods, the warpage deformation of the model filled with the proposed method is reduced by 37.81% and 13.79%, respectively.The degree of warpage deformation is affected by the cooling rate of the model, the thickness of the model, and the force of the model when the model is taken out.The slower the cooling rate of the model, the smaller the warpage deformation; the larger the thickness of the model, the smaller the warpage deformation; when the model is taken out, the more uniform the external force on the model is, the smaller the warpage deformation is.It can be seen from the data in Table 7 that the average warpage deformation of the filling model of the parallel scanning filling method is 0.108712 mm, the average warpage deformation of the filling model of the path planning algorithm combining the contour offset filling method and the Hilbert curve is 0.078429 mm, and the average warpage deformation of the filling model of the proposed method is 0.067613 mm.Compared with the other two methods, the warpage deformation of the model filled with the proposed method is reduced by 37.81% and 13.79%, respectively.The degree of warpage deformation is affected by the cooling rate of the model, the thickness of the model, and the force of the model when the model is taken out.The slower the cooling rate of the model, the smaller the warpage deformation; the larger the thickness of the model, the smaller the warpage deformation; when the model is taken out, the more uniform the external force on the model is, the smaller the warpage deformation is.

Conclusions
In this paper, the six-DOF manipulator is taken as the object to study the path planning mechanism of six-DOF AM.The path planning method combining the contour offset filling method and Hilbert curve filling is optimized by using a cubic uniform B-spline curve, and a six-DOF path planning algorithm combining the contour offset filling method and improved Hilbert curve filling is obtained.The six-DOF AM platform is built and related experiments are carried out.The experimental results show that: 1.
Compared with the traditional three-axis AM device, when the six-DOF AM platform is used for model printing, the printing time is reduced by 43.70% and 37.94%, respectively, and the molding efficiency is significantly improved.

2.
Compared with the parallel scanning filling method and the path planning algorithm combining contour offset and the Hilbert curve, the average warpage deformation degree of the model filled by the method proposed in this paper is reduced by 37.81% and 13.79% respectively.Model printing by the method proposed in this paper improves the molding quality of the model to a certain extent.
In the future, the six-DOF AM platform will be further optimized to give full play to the flexibility of the six-DOF manipulator.For models with complex surfaces, the related hierarchical algorithms will be studied in the future, and the path planning algorithm will be further optimized to improve printing efficiency and realize unsupported printing.Some new methods will be used to solve the existing problems, such as multilayer neurocentral of high-order uncertain nonlinear systems with active disturbance rejection, asymptotic tracking with novel integral robust schemes for mismatched uncertain nonlinear systems, and so on.

Figure 1 .
Figure 1.The body structure and joint coordinate system of GP8 manipulator.

Figure 1 .
Figure 1.The body structure and joint coordinate system of GP8 manipulator.

Figure
Figure 4a is the xoy section projection of the manipulator motion space, Figure 4b is the xoz section projection of the manipulator motion space, and Figure 4c is the yoz section projection of the manipulator motion space.[ 709.3663, 725.1195]X ∈ − , [ 721.4648,725.2185]Y ∈ − , and [ 293.7268,1017.3194]Z ∈ − .

Figure
Figure 4a is the xoy section projection of the manipulator motion space, Figure 4b is the xoz section projection of the manipulator motion space, and Figure 4c is the yoz section projection of the manipulator motion space.X ∈ [−709.3663,725.1195],Y ∈ [−721.4648,725.2185], and Z ∈ [−293.7268,1017.3194].

Figure
Figure 4a is the xoy section projection of the manipulator motion space, Figure 4b is the xoz section projection of the manipulator motion space, and Figure 4c is the yoz section projection of the manipulator motion space.[ 709.3663, 725.1195]X ∈ − , [ 721.4648,725.2185]Y ∈ − , and [ 293.7268,1017.3194]Z ∈ − .

Figure 5 .
Figure 5. Printing path simulation.3.A Six-DOF Path Planning Algorithm Combining Contour Offset Filling Method and Improved Hilbert Curve Filling Method 3.1.The Basic Idea of the Algorithm

Figure 6 .
Figure 6.The change process of the Hilbert curve: (a) first-order Hilbert curve and (b) second-order Hilbert curve.

Figure 7 .
Figure 7.The flow chart of the path planning algorithm.

Figure 7 .
Figure 7.The flow chart of the path planning algorithm.

Figure 7 .
Figure 7.The flow chart of the path planning algorithm.

Figure 9 .
Figure 9.The first to eighth-order Hilbert curves.

Figure 9 .
Figure 9.The first to eighth-order Hilbert curves.

Figure 9 .
Figure 9.The first to eighth-order Hilbert curves.

Figure 10 .
Figure 10.The filling effect.3.3.3.Optimization of the Hilbert Curve 1. Cubic Uniform B-spline Fitting According to the generated Hilbert curve coordinates, the control points of the cubic uniform B-spline curve are obtained, and the fitting curve is constructed.The curve after interpolation fitting of the Hilbert curve using the cubic uniform B-spline function is shown in Figure 11.The blue solid line is the original Hilbert curve, and the magenta solid line is the fitting curve.

Figure 10 . 19 Figure 11 .
Figure 10.The filling effect.3.3.3.Optimization of the Hilbert Curve 1. Cubic Uniform B-spline Fitting According to the generated Hilbert curve coordinates, the control points of the cubic uniform B-spline curve are obtained, and the fitting curve is constructed.The curve after interpolation fitting of the Hilbert curve using the cubic uniform B-spline function is shown in Figure 11.The blue solid line is the original Hilbert curve, and the magenta solid line is the fitting curve.Actuators 2024, 13, 249 11 of 19

Figure 12 .
Figure 12.Curve clipping and intersection diagrams: (a) the filling effect diagram without curve clipping and intersection and (b) the filling effect diagram after curve clipping and intersection.

Figure 12 . 19 Figure 13 .
Figure 12.Curve clipping and intersection diagrams: (a) the filling effect diagram without curve clipping and intersection and (b) the filling effect diagram after curve clipping and intersection.Actuators 2024, 13, 249 12 of 19

Figure 14 .
Figure 14.Schematic diagram of coordinate transformation coordinate system pose relationship.

Figure 13 .
Figure 13.The printing path effect diagram.

Figure 14 .
Figure 14.Schematic diagram of coordinate transformation coordinate system pose relationship.

Figure 14 .
Figure 14.Schematic diagram of coordinate transformation coordinate system pose relationship.

Figure 16 .
Figure 16.Additive manufacturing devices: (a) a traditional 3-axis AM device and (b) the 6-DOF AM platform.

Figure 16 .
Figure 16.Additive manufacturing devices: (a) a traditional 3-axis AM device and (b) the 6-DOF AM platform.

Figure 16 .
Figure 16.Additive manufacturing devices: (a) a traditional 3-axis AM device and (b) the 6-DOF AM platform.

Figure 17 .
Figure 17.Model printing process.(a) Contour offset filling.(b) The optimized Hilbert curve is filled once.(c) The optimized Hilbert curve is filled 3 times.Figure 17.Model printing process.(a) Contour offset filling.(b) The optimized Hilbert curve is filled once.(c) The optimized Hilbert curve is filled 3 times.

Figure 17 .
Figure 17.Model printing process.(a) Contour offset filling.(b) The optimized Hilbert curve is filled once.(c) The optimized Hilbert curve is filled 3 times.Figure 17.Model printing process.(a) Contour offset filling.(b) The optimized Hilbert curve is filled once.(c) The optimized Hilbert curve is filled 3 times.

Figure 18 .
Figure 18.Experimental model.(a) The parallel scanning filling method.(b) The contour offset filling method combined with the Hilbert curve filling method.(c) The method proposed in this paper.

Figure 18 .
Figure 18.Experimental model.(a) The parallel scanning filling method.(b) The contour offset filling method combined with the Hilbert curve filling method.(c) The method proposed in this paper.

Figure 18 .
Figure 18.Experimental model.(a) The parallel scanning filling method.(b) The contour offset filling method combined with the Hilbert curve filling method.(c) The method proposed in this paper.

Figure 20 .
Figure 20.The average warpage deformation of the model.

Figure 20 .
Figure 20.The average warpage deformation of the model.

Table 1 .
D-H parameter table of the GP8 manipulator.

Table 1 .
D-H parameter table of the GP8 manipulator.

Table 2 .
The main specifications of the 6-DOF AM platform.

Table 2 .
The main specifications of the 6-DOF AM platform.

Table 4 .
The warpage deformation of the model filled by the parallel scanning filling method (unit: mm).

Table 4 .
The warpage deformation of the model filled by the parallel scanning filling method (unit: mm).

Table 4 .
The warpage deformation of the model filled by the parallel scanning filling method (unit: mm).

Table 5 .
The warpage deformation of the model filled by the contour offset filling method combined with the Hilbert curve path planning algorithm (unit: mm).

Table 6 .
The warpage deformation of the model filled by the method proposed in this paper (unit: mm).

Table 7 .
The average warpage deformation of the model filled by three different methods (unit: mm).

Table 5 .
The warpage deformation of the model filled by the contour offset filling method combined with the Hilbert curve path planning algorithm (unit: mm).

Table 6 .
The warpage deformation of the model filled by the method proposed in this paper (unit: mm).

Table 7 .
The average warpage deformation of the model filled by three different methods (unit: mm).