Process Simulation and Optimization of Arc Welding Robot Workstation Based on Digital Twin

: For the welding cell in the manufacturing process of large excavation motor arm workpieces, a system framework, based on a digital twin welding robot cell, is proposed and constructed in order to optimize the robotic collaboration process of the welding workstation with digital twin technology. For the automated welding cell, combined with the actual robotic welding process, the physical entity was digitally modeled in 3D, and the twin welding robot operating posture process beats and other data were updated in real time, through real-time interactive data drive, to achieve real-time synchronization and faithful mapping of the virtual twin as well as 3D visualization and monitoring of the system. For the robot welding process in the arc welding operation process, a mathematical model of the kinematics of the welding robot was established, and an optimization method for the placement planning of the initial welding position of the robot base was proposed, with the goal of smooth operation of the robot arm joints, which assist in the process simulation veriﬁcation of the welding process through the virtual twin scenario. The implementation and validation process of welding process optimization, based on this digital twin framework, is introduced with a moving arm robot welding example.


Introduction
As the manufacturing industry continues to develop towards intelligence and flexibility, industrial robots are becoming increasingly mature in terms of development and application technologies [1], and are now used as specialized equipment in different specialized fields, such as welding, grinding, handling, and painting, and in specialized application scenarios, such as assembly [2].As welding is an essential production process, welding robots are widely used in the field of welding.However, traditional welding robots are generally programmed to optimize the path according to manual experience, and it is difficult to ensure the welding quality and welding efficiency.With the new generation of industrial Internet of Things technology [3], ubiquitous perception is becoming a new driver to promote the development of welding processes.The drive for ubiquitous perception is integral in the research and development of new welding systems with digitalization and automation as the main features, so that welding equipment and processes can operate in three-dimensional space and time, providing multi-dimensional ubiquitous perception and transparency [4], which is important to improve product performance quality and production efficiency.
This paper is a study of the arc welding workstation system in the moving arm digital welding system, which consists of a robot system, welding system, welding auxiliary system, sensing system and control system.With the widespread use of welding robots, there are still several problems in the process of welding line applications, such as the following: (1) Programming of complex weldments.Existing robotic welding programming occurs Machines 2023, 11, 53.https://doi.org/10.3390/machines11010053https://www.mdpi.com/journal/machinesmainly by means of teach-in programming.For the robotic welding of complex weldments, the number of welds is usually large, so it takes a lot of time to teach programming, and it is difficult to achieve the best welding process, due to the lack of holistic grasp of the entire space and welding process operation in manual teaching.Once the relative position of the welded parts and the robot changes, the welding procedure needs to be reprogrammed, which takes longer.(2) The problem of long robot position-seeking time.Since the initial welding of the workpiece by the teaming tool cannot meet the requirements of direct robot welding, it is generally necessary to perform position-seeking operations on the weld seam before robot welding is performed.Usually, a weld requires at least four position finding points, and the actual position of the weld is determined and corrected by the contact between the welding wire and the workpiece weld, on the basis of the shape characteristics of the weld.Once the welded part is relatively complex, the corresponding position-finding work takes longer, thus affecting the overall speed of the robot welding.(3) Long auxiliary time for wire shear gun cleaning.For arc welding robots, a crucial step in the welding operation is the cleaning of the gun nozzle after a certain amount and time of welding.Generally, the gun cleaning device is placed away from the workpiece.The welding robot needs to go back and forth frequently between the welding seam and the gun cleaning station, and if the robot does not choose the gun cleaning position properly, the robot becomes empty, which seriously affects the robot's welding efficiency [5].
In recent years, digital twin (DT) technology has been explored and applied in traditional manufacturing industries [6].The intersection of multiple disciplines is used to achieve real-time synchronization and faithful mapping of the physical and digital worlds, paving the way for the integration of physical and information spaces [7,8].Digital twin technology uses data interaction, information fusion, iterative computing, and command optimization to form a real-time intelligent closed-loop system of "data perception-realtime analysis-intelligent decision-precise execution".It uses high-fidelity digital models and sensor data to do the following: reflect the functions of the corresponding physical entities; construct the correlation between physical entities and virtual models; comprehensively interact with, and deeply fuse, physical real-time data, such as operation status, environmental changes and sudden disturbances with information space data, such as simulation prediction, statistical analysis and domain knowledge; enhance the synchronization and consistency between the physical world and the information world; provide more real-time, efficient and intelligent information for product life cycle; provide more real-time, efficient and intelligent services.
The robot's base position is closely related to the robot's structure and the task it is required to perform.Different optimization methods were given by Xue Y et al. [9] and Yang et al. [10] using robot accessibility as the only criterion.Franceschi P et al. proposed a cascade connected two-level optimizer to improve robot maneuverability as a way to optimize robot work cell design [11].Gadaleta M et al.. in order to reduce the energy consumption of the robot cell, designed a layout optimization tool to optimize the placement of industrial robots relative to a specific task [12].In addition many existing methods are mainly aimed at improving the performance of the robot, and the relevant criteria include maneuverability or flexibility [13,14], speed performance [15], singularity avoidance [16], collision avoidance [17], etc. Optimization of the base position has now attracted the attention of many researchers, because it can effectively improve the efficiency and quality of task completion.
There are fewer existing studies on the digital twin aspect regarding welding robots.Liu et al. proposed a digital twin-based process knowledge reuse and evaluation method by constructing a digital twin model of process knowledge containing geometric information and real-time states of process equipment, and proposed the use of the model similarity calculation method to filter process knowledge, as well as the real-time processing state and process reusability evaluation method [18].Li et al. studied the prediction and control of ship assembly and welding process quality using a digital twin approach, established a twin model, connected physical entities to the twin model through twin data, and used artificial neural network algorithms to achieve quality prediction, which, in turn, fed back to physical entities to control welding quality [19].Wang et al. proposed the use of digital twin technology to analyze welding and welder behavior using human-computer interaction and data-driven methods to improve the operational efficiency and comfort of human users [20].
In response to the above problem analysis, this paper presents a digital simulationbased digital twin framework for welding robot cells to support welding process visualization, welding process optimization and other functions for the low efficiency of welding operations and unreasonable welding process beats in the welding process of large moving arm workpieces.The impact of the robot's initial welding position on the welding process is investigated, and a particle swarm optimization algorithm is used to find the optimal initial welding position under collision-free interference constraints.The integration and mapping of the process and digital simulation is achieved through real-time acquisition and transfer of welding process data.Finally, the feasibility of the method was verified through an example in the digital twin system of a moving arm welding workstation.
The main contributions of this paper are summarized as follows.

1.
By analyzing the process of the arc welding robot workstation, a five-dimensional framework, based on the digital twin of the arc welding robot cell, is proposed, including the physical layer, network layer, data layer, model layer and service layer.

2.
The impact of the initial welding position of the robot on the welding process is investigated, and a particle swarm algorithm is proposed to optimize the initial welding position with the best operational smoothness under the constraints, which improves the overall welding efficiency.

3.
In the service layer of the established digital twin five-dimensional model, realtime data interaction is performed through the data management module for data visualization and optimization of the welding process.
The rest of the paper is organized as follows: Section 2 analyzes the arc welding workstation process architecture and provides a detailed description of the main components of a digital twin system.Section 3 proposes a digital twin-based optimization method for the initial welding position of the welding robot and describes the corresponding methodology.Section 4 uses a case study of an arc welding workstation for research analysis and experiments.Finally, Section 5 presents its conclusions and an outlook for the future.The structure of the large excavator arm is shown in Figure 1.As shown, the bearing supports at 1, 3, 4, 6, etc. were machined and shaped by turning, and then transferred to the robotic welding workstation after the upper top plate, lower bottom plate, and left and right-side plates were initially spot welded and fixed by the group pairing tool.As the structure of the movable arm was not complicated, but the size was large and the weld seam mostly a space curve, the welding workload was large.When considering the welding process, it is usually necessary to weld the seam between the side plates and the upper and lower panels symmetrically in sections to prevent excessive welding stress and deformation.

Framework
The welding process of the excavator arm mainly includes the basic processes of arm loading, displacement machine clamping and positioning, robot welding, and arm discharging.In the welding process, the robot end-effector is welded along the workpiece seam, and the workpiece is fixed and rotated to the corresponding attitude by the positioner so that the welding robot can complete the welding task well.Current industrial production mainly relies on the experience of workers to determine the layout of the welding workstation and robot welding movement.The quality and efficiency of welding are affected by the welding operations, welding process, robot base position, and welding sequence, such as unreasonable situation.In summary, the welding robot workstation can be optimized in the following three aspects: (1) through the process of welding parts and position constraints, the establishment of the kinematic model of the welding robot to optimize the trajectory of the welding robot and the displacement machine; (2) through the analysis of the actual production line welding beat to find the unreasonable places for the beat optimization; (3) the welding robot welding process needs to find the position, welding, wire cutting and other operations with the best global operability of the initial welding position, and optimizing the welding beat can also reduce the distance of the robot empty walk during the wire cutting operation, to further improve welding efficiency.

Robot Welding Workstation Cell with Twin Frame
The robot welding cell is the most important component of the welding production line.A typical arc welding robot workstation consists of a robot system, gantry system, positioner system, welding system, etc.According to the process requirements of the welded workpiece, the robot is equipped with the corresponding end-effector welding torch for welding.Figure 2 is a schematic diagram of the structure of a basic welding robot workstation cell, in which the loading table holds the workpiece to be welded, the feed buffer is used to store the finished welded parts, the welding table is used by the displacer to hold the workpiece to be welded, and the robot is used to weld the workpiece.The motion of the welding workstation cell is cyclic, and the welding cycle consists of the delivery of the parts to be welded from the loading buffer to the welding work area, and then the delivery of the finished welded parts to the lower material buffer.After the welding condition is triggered, the workpiece is delivered to the welding operation area, the position changer clamps and fixes it, and the robot motion completes the welding operation through the steps of position finding, welding and gun clearing, etc.After the welding is completed, the finished part flows to the lower material buffer area and the next part to be welded flows to the welding operation area, and the robot returns to the initial position after each weld or welding of the complete workpiece.
Due to the complexity of welding operations and the harsh welding environment, the robot welding workstation in the layout planning, motion control, offline simulation, debugging and verification of the process, there is a long cycle time, and iterative and other characteristics.The use of data interaction, information fusion, iterative computing and decision analysis and optimization methods to build a virtual simulation environment with high-fidelity mapping of the real physical behavior, and to construct a modular, universal, digital twin welding workstation system to realize the integration of the welding process in various aspects, such as model, control and digital services, are key to achieving a breakthrough in the existing technological bottleneck.This paper presents a block diagram of the digital twin welding workstation, as shown in Figure 3, including the physical welding workstation unit, the virtual welding workstation unit, twin data, and service system 4 parts.(1) The physical unit is an actual welding production system consisting of a welding robot and related production equipment, specifically including physical entities, such as welding robots, welding guns, position changers, controllers, moving arm workpieces, sensors, guide mechanisms, wire shearing and gun clearing devices, etc.It also includes specific welding information associated with robot position changer movement, such as workpiece welding process, welding current, position finding status, welding arc status detection, space planning, size, position, and other data information.
(2) The virtual cell is composed of a virtual digital model of the welding robot workstation, which mainly contains the construction of the model at three levels: elements (such as workstation layout, physical equipment, environment and other production elements), behaviors (such as welding process, linkage and other behavioral characteristics), and rules (such as welding process optimization and other evolutionary rules) to achieve the mapping of digital space to physical space.(3) The service system is driven by the twin data as the core, providing services such as logic driving and motion control of the digital twin, analyzing and optimizing the welding process, such as welding process, time beat, and robot welding path of the physical entity cell, and mapping it to the virtual entity cell in order to perform motion simulation of the welding process.
(4) The twin data is composed of physical unit data, virtual unit data and service system data, and provides corresponding analysis, verification, and decision information for the service system through data transfer, interaction, and update between each layer.

Welding Workstation Physical Unit
The physical unit is a collection of all physical entities involved in the welding process, including hardware devices, such as welding robots, shifters, welding guns, welding parts, auxiliary devices, such as controllers, manual demonstrators, gun clearing stations, and different functional areas such as loading and unloading areas.In addition, the physical entity of the welding workstation contains various types of physical sensing equipment (current sensors, displacement sensors) supporting the collection and transmission of information, such as the position of the welding robot and the displacement machine, the position finding signal, displacement signal, and wire shearing and gun clearing.The welding workstation operating system has functions for data and information upload and execution according to data commands, which can provide support for real-time interconnection of virtual and real interactions.
The welding cell for large welded parts mainly includes a six-axis robot, electric control cabinet, positioners, RGV trolley, truss, and other equipment.Each welded part is transferred from the loading area to the welding station, where the robot and the positioner and other equipment work together to complete the corresponding welding task, and the part is then transferred to the lower material area via an RGV trolley.
In this paper, the operational logic of the welding workstation welding operation was clarified to plan the trajectory of the robot operation and realize synergistic cooperation among the devices, so as to avoid problems, such as interference and collision in the welding process of the welding workstation.As the welding process of each weld welding process is the same, one of the selected welding seams (the right-side plate and the top plate between the welding seam) process is shown in Table 1.In order for the welding robot to complete the welding operation, it is necessary to combine the actual moving arm welding process and path planning.The main purpose of the path planning is to find a reasonable motion path and the best initial welding position under the constraints of environmental and operational tasks, so that the welding robot welding process does not interfere and collide with related equipment in the workstation, and, thereby, improve the efficiency of the welding operation.

Welding Workstation Virtual Unit
The key to the implementation of a digital twin system for welding workstations lies in the creation of a digital twin model that is equivalent to the actual physical unit.Through digital modeling of virtual scenes, the working environment of the physical welding line can be realistically presented and information decisions can be made for the operation and maintenance of the actual line, etc.

Digital Modeling
The virtual twin model is the core of the realization of the digital twin, and not only requires one-way mapping of physical entities but also needs to have the ability to guide physical entities.The digital modeling object of this paper was the welding robot welding workstation, and digital modeling using a multidimensional model fusion approach, mainly divided into four aspects of geometric modeling, physical modeling, behavioral modeling and rule modeling.The detailed process is shown Figure 4 below.According to the above multidimensional modeling method, for the geometric dimension, based on the geometric characteristics and parameters of the equipment in the movable arm welding workstation, SolidWorks industrial modeling software was used to construct 3D models of the welding robot, the displacement machine, workpiece, truss and other equipment.For the physical dimensions, based on the material properties and physical parameters of the equipment, 3D Max was used to render the model.For the behavioral dimension, based on the geometric model, the kinematic and kinetic equations of the robot model were defined, the robot joint motion relations were calculated, and the construction was carried out according to the behavioral coupling between the devices.For the rule dimension, XML language was used to describe the operation and evolution rules of the devices, according to the actual welding process and welding procedures.By fusing the 3D visualization model, physical model, behavioral model, and rule model, the virtual model of the welding workstation built in the virtual engine Unity3D software was able to portray the actual operation state and realistically map its physical entities.

Behavior Mapping
The virtual simulation of the twin welding workstation was performed by collecting data from hardware devices, such as on-site robot controllers and sensors, for real-time transmission of the welding process and operational information from the physical shop, using the actual welding data information as the driving source.The virtual twin system has relatively complex model subordination relationships between the welding robot, the welding robot, and the displacement machine, and between the displacement machine and the welded workpiece.
The virtual twin model of the welding workstation can be divided into static and dynamic models, depending on the different states of the equipment in the physical unit.Static models usually consist of different subtypes of models that can be equated as a single whole to establish the hierarchy of models, such as trusses, barrels, storage tables, etc. Dynamic models are divided into two categories according to the operational logic.The first category is for models with the same operational logic, e.g., welding robot, welding gun, etc. and the second category is for models with different operational logic, e.g., workpieces, displacement machines, etc.For the dynamic models, the first category takes the welding robot as an example and establishes the subordination relationship through the parent-child motion relationship between the joints of the robot.The specific structure is shown in Figure 5.For example, the parent-child relationship between the movable arm workpiece and the positioner can be linked by weldment.Transform, parent = positioner.The robot cell in the welding workstation has two states of motion: translation and rotation, and the virtual model is driven by the translate and rotate functions in the virtual scene.In the virtual simulation process, the welding robot may collide with itself or interfere with other devices in the scene when performing welding operations, and in this process collision detection can issue an alert signal in time.Collision detection technology determines whether two convex bodies intersect, and the collision detection algorithm for polyhedral intersection detection has high detection accuracy [21].Unity 3D software supports a variety of collision detection methods.Due to the high accuracy requirements of the virtual welding process, this paper used the orientation bracketing box (OBB) detection method [22] for the collision detection of the model.The OBB wrapping box can wrap the collision body model completely, its direction is determined by the structure of the enclosed model, and collision is detected by the intersection of the wrapping box, which is simple to implement and can effectively reduce the task of collision detection in the virtual system.

Welding Workstation Twin Data Management System
The twin data is the basic element of the virtual twin system, and the data management system enables data collection, transfer, analysis, and calculation.The physical welding unit and the virtual welding unit interact with each other through the data management system.The welding workstation data management system provides intelligent decisionmaking and services for the welding operations of the constructed digital twin welding system, based on the integrated management of data and information.

Digital Twin Data for Welding Workstations
The welding robot workstation digital twin system is a dynamically updated and changing virtual system, in which the welding robot and its displacement machine digital twin are process models that continuously generate and update data following the movement of the workpiece welding process.The data of the digital twin is divided into static data and dynamic data.Static data includes data such as geometric characteristics of the equipment, materials, scene location layout, etc., which is used to establish the virtual welding workstation system and realize the transfer mapping of information, such as model data, scene layout, and materials of the real workshop.Dynamic data include data collected by various types of sensors in the robot welding process as well as real-time production data and other data.Dynamic visualization data, as shown in Figure 6, is used to carry out real-time action simulation of the virtual welding robot and to realize the transfer mapping of process data, simulation and service optimization of the workshop.The data of the digital twin of the welding robot workstation mainly includes four kinds of basic data, namely design data, process data, welding process data, and production data, details of which are given below.(3) Welding process data refers mainly to various types of sensor detection data, equipment process information, such as data on the angle of each joint of the welding robot, data on the rotation angle of the translator, and data on the position of the robot base, etc.It also includes automation information, such as data on the position finding status, welding current, wire feeding speed, gun clearing status, running status information, etc. and simulation data, such as virtual welding workstation simulation operation data.Finally, optimization analysis data generated by the service system data, such as robot kinematic equations, particle swarm optimization (PSO) algorithms, and other data also fall into this category.(4) Production data includes mainly the total production plan of the workshop, the current number of completed products, product production efficiency and production quality, and other real-time dynamic data.

Data Communication
The robot welding operation process involves the collection of equipment data, resource data, welding material information, and other data, with multiple hardware and software systems, a wide range of data collection methods and interface types, and data showing multiple sources of heterogeneity.The twin system realizes the continuous update and optimization of the unit twin through the interaction of data, and is able to realize the matching articulation of workshop data through the transmission relationship and interface exchange mode between data.The basic flow of data communication in the virtual system of welding workstations is shown in Figure 7.The digital twin system for welding workstations built in this paper achieved accurate and complete data collection and integrated management of the welding process through the data communication flow shown above.The collected data was uploaded to the IOT platform for storage via fieldbus, User Datagram Protocol (UDP), Ethernet, Ether CAT and other communication protocols.The API function was used to read PLC information and pass the data to the digital twin workshop system in the form of JSON data strings, and the virtual system achieved virtual real synchronization by sample value and interpolation processing of real-time data.The data processing flow is illustrated in Figure 8.

Welding Workstation Service System
The function of the welding workstation service system is to monitor, predict, and optimize the welding operation process in the workshop.The welding system consists of automated equipment arc welding robots, and shifters working together to complete the welding operation.In order to avoid the impact of the initial welding position set by the robot cell and the welding running trajectory on the overall operational stability of the workstation, the actual welding operation is simulated and optimized in the service system using the twin data transfer between them.Before the actual welding of the physical cell, the service system can use the production line history data to simulate and evaluate the process and production plan through internal algorithms, so that adjustments and optimizations can be made.
The constantly updated physical cell operation status and virtual cell simulation data in the data management system adjusts the production schedule in real time.The welding workstation service system contains mathematical algorithms for robot kinematics, changer kinematics, robot particle swarm path placement optimization algorithms, and man-hour calculations, and the system uses these algorithms for continuous iterative optimization of the digital twin.

Robot Kinematics Analysis
The core of the faithful mapping of the moving arm welding workstation is to achieve accurate control of the arc welding robot model.The robot model initially constructed in the twin system is a static model, and the parent-child linkage between the joints was not established, so it was not possible to drive the robot motion through the data.A 6-axis industrial robot has a linkage mechanism with six rotating joints and six links, each joint and corresponding linkage has its corresponding coordinate system, as seen in Figure 9.A simplified diagram of the robot D-H linkage coordinate system is shown.In this paper, we use the D-H parametric method to establish the kinematic model of the robot.Firstly, we use the flush transformation matrix to describe and establish the relative position and orientation relationships between these linkage coordinate systems, and then transform the four matrix elements of linkage length, linkage rotation angle, linkage offset and joint angle to construct the kinematic equations of the robot.In this paper, the FANUC 6-axis robot was used as an example, and the D-H parameters of this robot are provided in Table 2, where a i is the length of the link i, d i is the distance between link i and link i + 1, α i is the i the angle of twist of the connecting rod and θ i is the angle between the connecting rod i and i + 1.

Rods i a i (mm)
The robot kinematic equations are divided into forward kinematics and inverse kinematics.Forward kinematics is obtained from the known joint angle by the flush transformation of the adjacent linkage coordinate system to obtain the robot end position and pose.The inverse kinematics is determined from the known end-effector position and pose to determine the robot joint angle.According to the known D-H parameters, to establish the flush transformation equation between each linkage, the transformation matrix j−1 j T is generalized as follows: The transformation matrix of each linkage of the six-axis robot can be obtained according to Equation (1).
In Equation (2) above, s denotes sin θ, and c denotes cos θ.The positive kinematic equation of the robot is obtained by the concatenated multiplication operation of the linkage transformation matrix.
In Equation (3).n o e denotes the end-effector pose vector, and [p] denotes the end-effector position vector.The robot inverse kinematics solution process uses an analytical solution to find the angle of each joint of the robot by stepwise backpropagation of the total transformation matrix of Equation ( 3) with known end poses.

Arc Welding Robot Base Position Optimization Problem
Robot base position optimization is a complex nonlinear optimization problem with multiple variables and constraints.The goal is to optimize the process beat during workpiece welding by minimizing the overall robot movement during weld seam welding while maintaining robot kinematic performance.In this section, the problem discussed above is described more clearly in Figure 10.The scenario shown in the following section is illustrated in detail.
The application scenario of a welding robot system with external extension axes in the welding process is shown in the Figure 10.Some of the main coordinate systems in the system are given along with the corresponding coordinate transformation relationships, which are described below.The value {W} is the world coordinate system, also known as the reference coordinate system, {Tcp} is the tool TCP coordinate system and {6} is the robot end joint coordinate system.
The value {P i } is the coordinate system of weld points on the weld seam, the position vector of discrete points of any weld seam can be obtained by offline programming software pi = [xi, yi, zi] T , and the attitude vector Ri = [ni, oi, ai] and the weld joint coordi- nate system can be obtained according to the coordinate transformation relationship {P i } transformation matrix with respect to the world coordinate system W P i T = ni oi ai 0 0 0 pi 1 .
The transformation matrix of the weld point coordinate system with respect to the world coordinate system can be obtained from the coordinate transformation relationship.The value {B} is the robot base coordinate system.Since in practice the first joint rotation axis of the robot is perpendicular to the fixed plane of the robot or the guideway moving plane, and the first three joints of the robot affect the position of the end-effector and the last three joints affect the attitude of the end-effector, it is not necessary to consider the direction of the guideway moving plane in the optimization.This gives the transformation matrix of the robot-based coordinate system with respect to the world coordinate system , where bp = [x, y, z] T is the number of unknown quantities varies, according to the base placement.For example, the base position is searched in a certain horizontal plane, and z is a known quantity z 0 , determined by the height of the robot placement platform.The base position is searched on a horizontal rail, and x, z or y, z are known quantities.In this paper, the robot was suspended on a horizontal rail, so the base position could be expressed as bp = [x, y 0 , z 0 ] T .Similarly, the transformation matrix of the robot-based coordinate system, with respect to the world coordinate system, can be obtained from the transformation relationship between the coordinate systems in the Figure 10 For a given welding task, i.e., the determined welding path, process parameters, robot, and welding gun, the corresponding coordinate transformation matrix are W P i T, and T T, and 6 T T. This implies that the robot base position determines the joint angle of the robot.Therefore, considering that the joint angle of the robot determines its kinematics, the problem of optimizing the base position of the mobile robot arm can be defined as follows: under the condition that the welding path, the process parameters, the robot, and the welding gun are determined, an effective optimization method is established to accurately find the most suitable welding position on the rail, i.e., the optimal base position of the robot.

Optimization of Path Placement Based on Particle Swarm Optimization Algorithm
In this paper, the particle swarm algorithm was used for optimal control of the extended axis joint variables for robot placement.According to the above analysis, each weld is in the optimal welding position during the welding process, the robot end torch is limited to the weld position along the spatial weld movement, and the robot base is placed and moved by satisfying certain constraints and rules, so that the trajectory of each joint of the robot is smoothest during the whole weld, and, finally, the welding operation time is optimized.
The Particle Swarm Optimization (PSO) algorithm was proposed by Kennedy and Eberhart in 1995, inspired by the movement of flocks of birds.The basic concept of the PSO algorithm is to perform a search based on a population of particles, where each particle represents a potential solution and is accelerated towards a better or more optimal solution by constant updating [23].The original algorithm is described in detail as follows.
In the D-dimensional space, there are N particles, each representing a potential solution to the optimization problem, having both position and velocity properties, and orienting themselves according to their own best solution and with reference to the best solution of the whole population.The current position vector of the first particle X i as a candidate solution to the optimization problem, i.e., x i = x i 1 , x i 2 , . . ., x i D , and the current velocity is denoted as The optimal solution of the current individual search by the first i is denoted as the individual extremum p i best = p i 1 , p i 2 , . . ., p i D , and the optimal solution of current particle group searched by the first particles i is denoted as the global extreme value g i best = g i 1 , g i 2 , . . ., g i D .The velocity and position of the particles are updated by the iterative process, and the kth iteration updates the formula as follows: x In the formula, i = 1, 2, . . ., N; d = 1, 2, . . ., D;. ω 0 are the inertia factors, c 1 and c 2 are the learning factors for the individual and global optimal particles, all of which are positive constants and r 1 and r 2 are random numbers uniformly distributed on the interval of [0, 1].The individual extremes and global extremes are obtained by the above particle update formula continuously iterated until the optimal solution, satisfying the termination condition, is obtained.
The optimization of the robot's initial welding position must take into account the speed of each joint, acceleration and other motion attributes, as well as various performance indicators related to robot welding operations.The particle swarm optimization fitness function is shown in the following equation: Equation ( 6) is the objective function, where θ i j denotes the angle of the jth joint at the ith weld point, and k j denotes the weight of the degree of influence of the jth joint on the robot motion performance.Equation ( 7) is the constraint function, where θ jmin is the lower limit of the jth joint, and θ jmax is upper limit of the jth joint.Furthermore, d is the  As can be seen from the table, after optimizing the initial welding position, the overall welding operation time reduced by 20.55 s, the robot empty walking distance reduced by 15,010.03mm, and the process optimization efficiency increased by 7.809%.After optimization of the robot base position to obtain the robot joint angle, as shown in Figure 12 below, the joint angle fluctuated slowly during the welding process, which showed that the optimal initial welding position could not only ensure the smooth operation of the robot arm, but also optimized the welding time and achieved the effect of enhancing process optimization.Figure 13 Virtual welding experiment screenshot shown is a screenshot of the arc welding robot for welding operations and virtual experiments, through the virtual simulation of the welding workstation welding operations, the ability of real-time calculation of the robot motion path, process visualization, and real-time analysis of the weld point accessibility.The experiment proved that the welding robot workstation digital twin system could realize the robot welding operations and process optimization in the virtual system.

Digital Twin Experiment
The digital twin system of the robotic welding workstation drives the twin model motion through data scripting and realizes the virtual real mapping between physical space and virtual space through twin data interaction.To further validate the usefulness of the digital twin system, the virtual real system was connected, the initial welding position obtained from the virtual simulation optimization, the path planning transmitted to the physical space, and the data tracking of the welding cell realized through the twin data management system, which provided a comprehensive view of the entire operation.During the creation of the welding workstation arc welding robot twin, the welding process joint data, external axis data, and process data were reflected in the digital twin in real time, thus achieving real-time monitoring of the robot welding process.
Physical space and virtual space reality mapping, as shown in Figure 14, in the welded parts welding solution experiments, first initialized the state of the production line model in the virtual system, so that the virtual cell body of the workpiece, robot, changer and all other components, and the initial state of the physical cell body.This was necessary to ensure that the physical cell and virtual cell data connection achieved virtual-physical space state synchronization, and then the physical and virtual system could be run for welding operations.The experimental results are shown in the table, and the kinematic and path placement optimization algorithms in the welding workstation service system were used to optimize the robot base placement and drive the robot motion through the control system.From Table 5 it can be seen that the global operability of the robot welding operation in the physical welding workstation at the optimal initial welding position, as well as the weld reachability, achieved better production results, along with the normal twin data acquisition and sending.Figure 15 shows the single-station digital twin system for robotic welding.This paper realized the data interaction between physical space and virtual space through HTTP protocol, completed the real-time synchronization and faithful mapping between the virtual and real systems, and visualized the welding process and process data through the system's UI interface in real time.Compared with the traditional process beat spreadsheet statistics, the digital twin was real-time and effective in delivering and displaying welding operation process data.

Figure 2 . 23 Figure 3 .
Figure 2. Schematic diagram of the cell structure of the welding robot workstation.Machines 2023, 11, x FOR PEER REVIEW 6 of 23

Figure 4 .
Figure 4. Block diagram of multidimensional model construction.

Machines 2023 , 2 Figure 6 .( 1 )
Figure 6.Dynamic data.(1) Design data is mainly divided into global and local design data.Global design data includes environmental layout, scene rendering, lighting, and other data.Local design data includes unit 3D model data, specifically geometric information, coordinate information, dimensions, materials, parent-child linkage and other data.(2) Process data mainly includes welding methods for welded parts, specifically process information, welding seam sequence, welding process characteristics, and other parameters.(3)Welding process data refers mainly to various types of sensor detection data, equipment process information, such as data on the angle of each joint of the welding robot, data on the rotation angle of the translator, and data on the position of the robot base, etc.It also includes automation information, such as data on the position finding status, welding current, wire feeding speed, gun clearing status, running status information, etc. and simulation data, such as virtual welding workstation simulation operation data.Finally, optimization analysis data generated by the service

Figure 9 .
Figure 9. Simplified diagram of the D-H linkage coordinate system of the robot.

Machines 2023 , 23 Figure 12 .
Figure 12.Angle of each joint of the robot.

Table 4 .
Experimental results of different initial welding positions of the robot.