Dynamic Parameter Identiﬁcation of Collaborative Robot Based on WLS-RWPSO Algorithm

: Parameter identiﬁcation of the dynamic model of collaborative robots is the basis of the development of collaborative robot motion state control, path tracking, state monitoring, fault diagnosis, and fault tolerance systems, and is one of the core contents of collaborative robot research. Aiming at the identiﬁcation of dynamic parameters of the collaborative robot, this paper proposes an identiﬁcation algorithm based on weighted least squares and random weighted particle swarm optimization (WLS-RWPSO). Firstly, the dynamics mathematical model of the robot is established using the Lagrangian method, the dynamic parameters of the robot to be identiﬁed are determined, and the linear form of the dynamics model of the robot is derived taking into account the joint friction characteristics. Secondly, the weighted least squares method is used to obtain the initial solution of the parameters to be identiﬁed. Based on the traditional particle swarm optimization algorithm, a random weight particle swarm optimization algorithm is proposed for the local optimal problem to identify the dynamic parameters of the robot. Thirdly, the ﬁfth-order Fourier series is designed as the excitation trajectory, and the original data collected by the sensor are denoised and smoothed by the Kalman ﬁlter algorithm. Finally, the experimental veriﬁcation on a six-degree-of-freedom collaborative robot proves that the predicted torque obtained by the identiﬁcation algorithm in this paper has a high degree of matching with the measured torque, and the established model can reﬂect the dynamic characteristics of the robot, effectively improving the identiﬁcation accuracy.


Introduction
At present, robot technology is developing towards intelligence, and the manufacturing mode is also changing. In recent years, collaborative robots have received extensive attention and research around the world. According to the definition in ISO10218-2, a robot that can interact directly with humans in a designated collaborative area is called a collaborative robot. Compared with traditional industrial robots, collaborative robots have the benefits of high security, good versatility, sensitivity, precision, ease of use, and human-machine collaboration. The above advantages make collaborative robots not only applicable in the manufacturing field, but also gives them potential application value in the fields of home service and rehabilitation medicine-for example, compliant robotic arms in the industrial field, surgical robots in the medical field, wearable rehabilitation assistance robots, and antiterrorist and explosion-proof robots in special applications [1,2]. Utilizing the technology of human-machine fusion, the establishment of a fusion robot technology with intrinsic safety, human-machine collaborative cognition, and behavioral mutual assistance can provide support for emerging new application scenarios such as industry, service, and medical care. To break through the challenges of existing robots in the four aspects of environmental adaptability, task adaptability, safety, and interactive capabilities, it is urgent to study a new generation of human-machine fusion robots [3,4].
As collaborative robot technology is developing towards high speed and high intelligence, people also put forward higher requirements on its control accuracy. In the course of human-robot collaboration-affected by uncertain factors such as robot joint friction, the moment of inertia and nonlinearity, end load, and external disturbance-people cannot directly measure robot parameters and it is challenging to model [5]. In addition, the precision requirements of the machining process are gradually increasing. If the method of obtaining inertia parameters from CAD software is used to model each part of the robot, the dynamic model of the robot cannot be accurately established. Currently, the only effective way to obtain the precise dynamic parameters of the robot is the robot parameter identification method based on experiments [6,7]. The identification of robot dynamic parameters includes six steps: dynamic modeling, model linearization, excitation trajectory optimization, experimental data sampling and preprocessing, parameter calculation, and experimental authentication [8]. The parameter estimation determines the accuracy of the entire identification. The joint model of the robot is an important part of dynamic modeling. In many previous research results, the method of joint modeling was neglected, and the Coulomb viscous friction model or Stribec friction model were often used to represent the overall friction of the joint [9,10]. The current difficulties in dynamic parameter identification mainly lie in the following: (1) Insufficient prediction accuracy. Due to the limitation of the identification algorithm on the model, the precision of the robot model used in the identification method is insufficient and the accuracy of the predicted torque based on this model is also limited.
(2) Predict torque fluctuations, which are caused by discontinuous jumps in a large range of predicted values at certain nodes in the dynamic model. (3) The error peak, which is due to the inaccurate description of the dynamic characteristics of the special motion state by the traditional friction model, resulting in a large deviation compared with the actual required torque value near these motion states. Therefore, obtaining accurate robot dynamic parameters becomes particularly important [11,12].
For tandem robots represented by collaborative robots, it is necessary to establish their joint models to improve the overall model accuracy. Kircanski et al. [13] carried out identification work on joint friction and joint stiffness. However, the friction torque is not estimated approximately, which leads to inaccurate parameters and does not improve the accuracy of the model. Atkeson et al. [14] used the WLS-based serials identification method to obtain the robot's dynamic parameters, which can accurately predict the force and torque generated by load movement; however, this method has many identification times and ignores the coupling between joints. This leads to increased recognition time and the inability to obtain the dynamic parameters of complex robot joints accurately and in a timely manner. Liu et al. [15] improved the genetic algorithm by using the inter-cell generation method and the large mutation strategy, which effectively improved the identification accuracy of the dynamic parameters of the space robot; however, the algorithm is complex in the calculation, slow in convergence, and needs to adjust many parameters. Sun et al. [16] used genetic algorithms to identify the parameters of the dynamics model of industrial robots. This algorithm can effectively avoid local optimal solutions but its efficiency will be affected because of the need to design a tedious coding and decoding process. Chen et al. [17] discussed the application of the artificial neural network algorithm in robot dynamic parameter identification such that the structure and weight of the neural network have clear physical meaning, but only the identification of inertial parameters on both sides of the end of the robot was analyzed, and there was no research on parameter identification of other joints of the robot. Wang et al. [18] proposed an identification algorithm based on an adaptive particle swarm optimization genetic algorithm for the dynamic parameter identification of flexible joint robots. In order to improve the convergence speed of the particle swarm optimization algorithm, the algorithm uses a dynamic adaptive adjustment strategy and introduces a new genetic algorithm hybrid cross-mutation mechanism to avoid particle swarms getting stuck in local optima. Due to joint flexibility and complex friction sources, this method cannot accurately reflect the internal friction of joints. Zhang et al. [19] proposed a model parameter identification method based on combination, proposed a hybrid genetic algorithm and cosine trajectory, took the multi-joint series robot as the research object, and carried out friction parameter identification experiments, which further improved the accuracy of the robot dynamics model. However, this article did not study other nonlinear disturbance factors in the joint. Guo et al. [20] designed an identification method based on particle swarm optimization (PSO) for robot dynamics parameter identification. In order to obtain the dynamic parameters of the robot, the PSO algorithm was used to calibrate the dynamic model of the robot according to the motion state and torque of each joint. Experiments show that the parameters obtained by this method are correct and feasible. However, the algorithm is not conducive to global search and is prone to local optimum problems. Lin et al. [21] proposed a hybrid estimation strategy for the parameter identification of underwater vehicles; for the rough estimation of the dynamic parameters of underwater vehicles, the least squares (LS) algorithm is used, and the improved particle swarm optimization (IPSO) algorithm is used for the accurate estimation. The advantage of the least squares method is that it can improve the identification accuracy; however, its calculation is complex. When the amount of computation is large, the real-time performance will be greatly reduced [22] and there is a problem of limited search space. Cao et al. [23] designed a dual quantum behavior PSO algorithm for parameter identification of parallel robots. For the covariance matrix of measurement noise and process noise, the QPSO-1 algorithm is suitable. For the optimization of motion parameter error estimated by the EKF algorithm, the QPSO-2 algorithm is adopted. Experimental results show that this method significantly improves localization accuracy. Liu et al. [24] proposed a connection combination method based on improved artificial fish swarm algorithm for dynamic parameter identification, which can identify the independent value of the required parameters and avoid the impact of load changes. However, the convergence speed of this algorithm is slow and it is difficult to ensure real-time performance.
Inspired by the above point of view, to ensure the cooperation between humans and collaborative robots and realize the precise and stable control of the collaborative robots system, this paper designs an improved algorithm based on weighted least squares and random weight particle swarm optimization to identify the parameters of robot dynamics. Firstly, the Lagrange method is used to establish the dynamic model of the collaborative robot and determine the joint dynamic parameters to be identified. Because measurement noise will be generated when collecting raw data, the weighted least squares method is adopted. The identification algorithm is designed by adding the measurement torque noise to form the weight coefficient matrix. The weighted least squares method is used to generate the initial solution, and the search range is set to about 10% according to the absolute value of the initial solution. Secondly, based on traditional particle swarm optimization (TPSO), a random weight particle swarm algorithm is proposed, and the random weight particle swarm algorithm is used to make the dynamic parameters to be identified quickly jump out of a small local search range under the influence of random weights, speed up the identification in a large search range, and obtain accurate optimal parameters. Finally, due to the noise and burr in the original data collected, the Kalman filtering algorithm is used to filter the data, and good denoising and smoothing effects are achieved. The validity of the WLS-RWPSO algorithm is verified on a 6-DOF collaborative robot. The results show that the identification algorithm used in this paper can accurately identify the dynamic parameters and effectively improve the identification accuracy of the dynamic parameters compared with the identification results of LS-PSO and WLS-PSO identification algorithms.
The rest of the paper is organized as follows: Section 2 establishes the dynamic equations of the collaborative robot system subject to frictional disturbances. Section 3 introduces the weighted least squares algorithm and the random weight particle swarm algorithm, and analyzes the stability and convergence of the random weight particle swarm algorithm. Section 4 introduces the design of the excitation trajectory for parameter identification and the preprocessing of the experimental raw data. Section 5 introduces the experimental collaborative robot system and its dynamics parameter identification process using the WLS-RWPSO algorithm, and verifies the performance and efficiency of the WLS-RWPSO method by comparing it with the WLS-PSO algorithm. Section 6 presents the conclusions.

Robot Dynamics Modeling
The robotic arm is assumed to be a tandem robotic arm in the study. Without loss of generality, the dynamic equation of the n-DOF tandem robot is obtained by using the Lagrangian method [25]: In order to improve the real-time performance, reduce the identification cost, and improve the identification accuracy, the dynamic equation of the collaborative robot is linearized. Without changing the robot model, according to the method proposed by Swevers et al. [26], this paper includes the influence of other factors on the inertial parameters of the robotic arm through the identification process to obtain a set of comprehensive parameters that meet the accuracy of calculation. The dynamic equation is expressed in the linear form of dynamic parameters through parameter transformation: where Ψ dyn (q,q,q) ∈ R n×m is the observation matrix and E dyn is the inertial parameter matrix to be identified. For a given robot whose inertial parameters are constant, the linearization of robot joint moments greatly simplifies the entire parameter identification process. In addition to the joint torque required to drive the link movement, the dynamic equation of the robot actually includes additional torque caused by factors such as friction and the moment of inertia of the motor rotor [27]. The joint friction includes Coulomb friction, viscous friction and static friction. This paper does not model static friction. The joint friction moment consists of Coulomb viscous friction: where τ f is the friction torque, ν is the coefficient of viscous friction, and c is the Coulomb coefficient of friction. By approximating this function to a tangent hyperbolic function, the non-smooth function in the robot model can be avoided, which is expressed as follows: where ε is a constant that makes the slope of the tangent hyperbolic function very steep near zero. Simultaneous Equations (2) and (3) can obtain the complete robot dynamics linearization equation: where τ s ∈ R n is the motor torque vector, Y s ∈ R n×12n is the observation matrix, and θ s ∈ R 12n is the robot dynamics parameter vector. The parameters of the dynamic equation are determined by the unknown parameter θ * , which is expressed as where θ * i is the actual parameter of connecting rod i; j is the number of robot joints; and m * , I * , ν * , and c * , respectively, represent the actual mass, moment of inertia, viscous friction coefficient, and Coulomb friction coefficient of the connecting rod.
In addition, because not every dynamic parameter has an impact on torque, Y s is not a full rank matrix. For removing redundant parameters, the linear recombination method is used to obtain a minimum set of parameters [8]: where Y ∈ R n×(p+2n) is the observation matrix, θ ∈ R p+2n is the total dynamic parameter vector containing the minimum dynamic parameters and friction parameters of the connecting rod, p is the minimum number of kinetic parameters, and 2n is the number of friction parameters.

Weighted Least Squares Algorithm
During the identification process, the robot is moved along a certain trajectory, the joint torque and joint angle of the robot at N different times are sampled, and the joint angular velocity and angular acceleration of the collaborative robots are calculated and filtered by difference. The processed data are substituted into Equation (7) as follows: represents the observation matrix. In fact, due to measurement errors and other reasons, non-homogeneous linear Equation (8) will generally result in incompatible equations. Although the incompatible equations cannot find the solution that fully satisfies the conditions, it can find the least squares solution θ OLS θ OLS = arg min Wθ − Γ The least squares solution of Equation (8) is Since the motor torque data of each joint of the robot have different levels of noise, for the parameter estimation problem of heteroscedasticity, the weighted least squares estimation has a better effect and the weighted least squares method is used: where r j is the number of dynamic parameter combinations of joint j, and the weighting matrix is The robot dynamic parameter identification adopts the least squares method to solve, and the dynamic parameter θ of the robot can be obtained: where Σ is the diagonal matrix [28] formed by measuring the variance of moment Γ, which is called weight matrix.

Basic Particle Swarm Algorithm
The particle swarm algorithm is an optimization method for parameter calculation, in which the solution of each optimization problem is a bird in the search space, called a particle, and the fitness value of each particle is determined by the optimization function. There is always a speed to determine the orientation and removal of each particle, and to follow the current optimal particle to search in the solution space. The benefits of the PSO algorithm are as follows: Compared with other intelligent algorithms, PSO relies on particle speed to complete the search. There is no crossover and mutation operation, and the search speed is fast. Only the best particles will transfer information to other particles in iterative evolution. Since the particle swarm algorithm has the characteristic of memory, the best historical position of the particle swarm can be remembered and transferred to other particles. The particle swarm optimization algorithm adopts real number coding, which is directly determined by the solution of the problem, and the number of variables of the solution of the problem is directly used as the dimension of the particle. It has few adjustment parameters, simplicity in formation, and is easy to apply in engineering.
The particle velocity and update position equation are where t = 1, 2, · · · , G; G is the search space dimension; i = 1, 2, · · · , N is the population size; c 1 is the local learning factor; c 2 is the global learning factor; W is the inertia weight; r 1 and r 2 are the random numbers that obey the r(0, 1) distribution; and p t i and S t i are the local optimum and the global optimum, respectively.

Particle Swarm Algorithm Based on Random Weight
In the particle swarm optimization algorithm, parameter particles will gather to their own best historical position and the best historical position of the population; so, it is easy to form a rapid convergence effect of the particle population, and it is prone to local extreme, premature astringency, or stagnation phenomena, resulting in imprecise parameter identification [29]. In particular, the local and global optimal search ability of parameter particles will be affected by inertia weight. Larger weights are conducive to jumping out of local optima, while smaller weights will enhance local search capabilities and facilitate algorithm convergence [30]. Aiming at the problems, POS tends to be limited in the search space, easily falls into local optima, and has unsatisfactory convergence rates. In this paper, we have designed a method of randomly selecting weight values so that the influence of the historical speed of parameter particles on the current speed is random, which can effectively increase the large search range and prevent parameters from falling into local optimal solutions, speed up parameter identification, and improve parameter identification accuracy. In the random weight method, the dynamic parameters to be identified can quickly jump out of the local small search range under the influence of the random weight, accelerate the identification speed in the large search range, and obtain accurate optimal parameters. The random weight W can be calculated by the following formula: where µ is the parameter adjustment factor, N(0, 1) represents random numbers from a standard normal distribution, and rand(0, 1) represents a random number between 0 and 1. The random weight particle swarm algorithm can avoid falling into the local optimum to a certain extent, increase the range of parameter particle search, and help improve the accuracy of the parameter identification of the robot. The dynamic parameter identification process of the collaborative robot is shown in Figure 1.

Stability and Convergence Analysis of Random Weight Particle Swarm Algorithm
Assuming that the number of population particles is Φ, the global optimal position of population particles can be obtained: Let θ 1 = c 1 r 1 , θ 2 = c 2 r 2 , · · · , θ = θ 1 + θ 2 , by sorting out Equations (13) and (14): where ; w, θ 1 , and θ 2 change adaptively during the iterative process; and θ 2 = c 1 r 1 + c 2 r 2 varies randomly in the interval with iteration. At this time, C(t) belongs to the time-varying matrix. According to the system theory, it can be known that where Θ(t, k) is the system state transition matrix, expressed as where T ; define scalar function as vector norm V(y(t)) = y(t) ; then, the following hold: However, the values of w, θ 1 , and θ 2 make C(t) < 1, so ∆V(y(t)) is negatively determined.
According to the Lyapunov stability theorem, the system is asymptotically stable-that is, the algorithm is stable.
According to Equation (18), when the modulus of eigenvalues of C(t) is less than 1, it can be obtained that When p t i and S t i are fixed, t → ∞ and v i (t) → 0. x i (t) → θ 1 p t i +θ 2 S t i θ is a point on the line connecting p t i and S t i . According to Equation (13) and the root mean square error, it can be seen that p t i eventually tends to S t i , which shows that the algorithm converges.

Design of Excitation Trajectory
A reasonable design of excitation trajectory for parameter identification can hasten the convergence speed of parameter estimation and improve the precision of parameter estimation. The robot excitation trajectory design can be performed in two steps: The first step is to parameterize the joint trajectory. The second step uses the optimization algorithm to determine the undetermined coefficients in the joint trajectory function according to the designed objective function and motion constraint conditions.
In view of the fact that the finite Fourier series has the advantages of convenient data processing, insensitivity to measurement noise, and easy implementation in the parametric representation of the robot joint trajectory [31,32], this paper uses the finite Fourier series to realize the joint trajectory of the collaborative robot parameterization [33]. The joint angle of the i-th joint of the collaborative robot is denoted as where ω f is the fundamental frequency of the Fourier series and q i0 is the joint angle offset.
Each joint of the robot uses the same fundamental frequency to ensure the periodicity of the excitation trajectory. The parameterized motion trajectory of each joint of the space robot contains 2N + 1 undetermined coefficients. By reasonably selecting a i l , b i l , and q i0 , the motion of the manipulator can meet the PE conditions of parameter identification.
In order to obtain the angular velocity and angular acceleration of joint i, the first and second derivatives of Equation (21) with respect to time can be calculated: Since the excitation trajectory is constrained by conditions such as motor torque, joint position, joint velocity, joint acceleration, and workspace, the designed trajectory needs to meet the following conditions: where cond(W) is the condition number of the observation matrix. To reduce the theoretical error of identification, it is necessary to optimize the parameters in the above trajectory, and reduce the influence of noise on the identification accuracy by reducing the condition number of the observation matrix [34]. q min and q max are the minimum and maximum joint positions, respectively;q max is the maximum joint velocity;q max is the maximum joint acceleration; β is the trajectory parameter; and τ max is the maximum joint torque. The essence of the parameter optimization of the excitation trajectory is a multi-variable constrained nonlinear function optimization problem [35,36]. The parameters are optimized using the fmincon function in the Matlab optimization toolbox.

Data Preprocessing
When the collaborative robot tracks the excitation trajectory, the joint position and motor current are collected, and the motor current is converted into the motor torque through the torque constant. Due to the measurement noise interference of the original data, it is necessary to denoise and smooth the collected data before the identification experiment.
Combining with the problems studied in this paper, the torque displayed by the theoretical model of the collaborative robot at a certain moment is used as the predicted torque in the Kalman filter algorithm, and the torque of the collaborative robot measured by the sensor is used as the measured torque in the Kalman filter algorithm; then, the established state equation and the measurement equation are expressed as where x k is the system state variable at time k, A k and B k are the system parameters, u k is the control variable of the system, B k is the system input relationship matrix, H is the state output transition matrix, w k is the noise deviation of the robot control system, and v k is the sensor measurement noise deviation.
The essence of the Kalman filter algorithm is to use recursive thinking to reduce the impact of noise. Each operation cycle contains two stages: time update and measurement update. The former uses the system model and the estimates for the previous cycle to obtain the prior estimate; the latter uses the actual measured output together with the prior estimate to obtain a posterior estimate of the state.
Time update stage: transition from time k − 1 to time k.
wherex k − is to use the optimal estimate at time k − 1 to predict the estimated state variable, which is called the prior estimate value, at time k. Q is the noise covariance of the control system; P k − is the estimated value of the covariance of the system at time k.
Measurement update phase: Use the output at time k to correct the prior estimate where K k is the Kalman gain at time k and R is the measurement noise covariance. The Kalman filter only uses the first two-order information (mean and covariance) of the state in the update rule; so, the Kalman filter has the following advantages: (1) The acquisition of the mean and covariance of the unknown distribution only needs to save less.
(2) The mean and covariance have linear transitivity. (3) The set of mean and covariance estimates can be used to characterize additional characteristics of the distribution.
Therefore, for the torque signal collected by the sensor, the Kalman filter algorithm [37] is used to preprocess the original data and compare them with the five-point thrice smoothing method [38]. The comparison between the torque signal before and after processing is shown in Figure 2.
The experiment usually cannot directly measure the joint velocity and acceleration. If the joint position is differentiated, the measurement noise will be amplified. In order to reduce the impact of measurement noise when collecting the original torque signal, through the Butterworth filter function in Matlab, the joint angle q is first differentially calculated and then low-passed. The actual angular velocityq and angular acceleration q of the connecting rod are obtained by filtering and noise reduction to reduce the noise influence caused by differential processing.
In Figure 2a-f, the collected original torque data are represented by a blue line; the green line and the red line are the torque data processed by the five-point thrice smoothing method and the Kalman filtering method, respectively. It can be obtained from Figure 2 that before signal processing, the acceleration signal is noisy, has many burrs, and has certain data mutation points. If it is used for parameter identification calculation, it will lead to a large deviation. However, the torque signal after Kalman filter processing is smooth and has low data distortion; it also has a better processing effect than the five-point thrice smoothing method, which can be used for parameter identification calculation.

Simulation Verification of Structure Simplification Results
The experiment was carried out on the six-degree-of-freedom collaborative robot ROCR6, as shown in Figure 3, and the modified DH parameters are also shown in Table 1. The excitation trajectory of the joint is a 5-order Fourier series with a fundamental frequency of 0.05 Hz and a bandwidth of 0.25 Hz. The joint angle and joint torque in motion are sampled at a frequency of 1000 Hz, with a total 20,000 sets of original data. An excess of data will reduce the efficiency of identification and cause the fluctuation of bad data. To improve the efficiency, 2000 groups of joint positions and motor current signals required for identification are obtained in the 20 s motion process as the original data required for identification.
The experiments send the excitation trajectories to the control platform, which ensures that all joints reach the commanded positions and receive real-time measurements of the actual values (joint position q, joint torque τ).
The system is identified by basic PSO and RWPSO, respectively. The number of population is selected as 200, the learning factor c 1 is 1.5, c 2 is 3, the inertia weight is 1.3, and the maximum number of iterations is 200.
The fitness change curve during the identification process is shown in Figure 4. It can be seen from the figure that the initial particle search range (0-370) obtained by applying the RWPSO is obviously larger than the search range (0-201) of the basic PSO. When updating the position and velocity information, the basic PSO takes about 83 generations to converge, while the RWPSO takes about 20 generations to reach convergence, which shows that the improved algorithm has significantly improved the convergence speed and parameter particle search range. To identify the inertial parameters of the collaborative robot, given the excitation track of the joint, as shown in Figure 5, drive the joint axis to track the excitation track and identify the inertial parameters of the link. Taking the first three joints of the collaborative robot as an example, the identification values of the robot dynamics parameters are obtained through the WLS-RWPSO algorithm identification, and the results are shown in Table 2. Among the 21 identification parameters in Table 2, the first 15 are inertia parameters and the last 6 are friction parameters. According to the dynamic parameters identified by the WLS-PSO, LS-PSO, and WLS-RWPSO algorithms, the predicted torque under the excitation track is calculated and compared with the actual torque. The results are shown in Figure 6. Figure 6a-f show the predicted torque of each joint under three different algorithms. It can be seen from Figure  6 that under the identification trajectory, the predicted torque of the three algorithms is close to the actual torque; however, on the whole, the predicted torque of the WLS-PSO algorithm is better than that of the other two algorithms, which shows that the WLS-RWPSO algorithm has a better effect on the prediction of torque. The identification effect of the algorithm will be further analyzed in combination with the verification trajectory.
To further compare the identification accuracy of the two algorithms, this paper introduces the root mean square error (RMS) λ to verify the validity of the identified model: whereτ pa is the average torque value after identification. If the value of λ is closer to 0, the identification accuracy is higher. In addition, in order to show the advantages of our method compared with traditional recognition methods, we list the root mean square (RMS) of the validation residuals of different recognition methods in Table 3, where LS-PSO is the standard least-squares particle swarm optimization algorithm, and WLS-PSO is the weighted least-squares particle swarm optimization algorithm.  The above results show that our proposed WLS-RWPSO algorithm is compared with these two methods. Taking joint 2 and joint 3 as examples, the predicted torque obtained by the three recognition methods is compared with the measured joint torque. The recognition accuracy of this algorithm for joint 2 is 16.1% and 10.5% higher than that of the LS-PSO algorithm and WLS-PSO algorithm, respectively, and the recognition accuracy of joint 3 is 12.2% and 11.5% higher than that of the LS-PSO algorithm and WLS-PSO algorithm, respectively. The corresponding predicted torque is closer to the measured joint torque. It can be seen that WLS-RWPSO algorithm has stronger optimization ability and higher recognition accuracy.

Model Validation
After the completion of parameter identification, it is necessary to evaluate and verify the accuracy of parameters. It is worth noting that the significance of parameter identification itself is that under any given trajectory, the predictive value of motor output torque can be obtained based on the identified parameters; then, the control current of the joint motor can be obtained. In order to verify the validity of the dynamic parameters identified by WLS-RWPSO, the verification trajectory is selected as a Fourier series different from the previous excitation trajectory, and the robot joint is driven by the controller to track according to the verification trajectory. The identified dynamic parameters are used to predict the torque of the verification track. The experimental verification process is shown in Figure 7. After sorting out the torque vector obtained, the joint torque of each joint under the verification track can be obtained, as shown in Figure 8, Figure 8a It can be seen from Figure 8 that the deviation between the joint torque calculated by this identification method and the actual torque is small, and the torque curve is closer to the actual torque on the whole, which further proves that the WLS-RWPSO algorithm has higher accuracy in identifying the robot dynamic model and can accurately predict the dynamics characteristics of the robot system.

Conclusions
This paper summarizes the basic knowledge of dynamics model identification of collaborative robots and proposes identification strategies based on WLS-RWPSO. The optimal value of the fitness function obtained by the WLS-RWPSO algorithm is the smallest, which is not prone to local optima, is convenient for global search, and can better improve the accuracy of parameter identification. In the data preprocessing, the raw data collected by the sensor are preprocessed with the Kalman filter algorithm, which achieved good denoising and smoothing effects. In order to ensure the accuracy of parameter identification under disturbance, the excitation trajectory is designed based on finite Fourier series.
The identification algorithm proposed by the collaborative robot is tested to evaluate its performance and compared with WLS-PSO. The experimental results show that the WLS-RWPSO parameter identification algorithm proposed in this paper can accurately identify the dynamic parameters of the cooperative robot and has fast convergence speed, strong optimization ability, and certain engineering significance.
The identification algorithm proposed in this paper is helpful to improve the accuracy and stability of the trajectory control of the collaborative robot; however, there are still some shortcomings: (1) This paper does not consider its inherent complex nonlinear behavior.
(2) When the collaborative robot moves along the specified excitation track, the sudden change of friction torque is not considered at the joint commutation, which makes us unable to obtain more accurate friction prediction.
Therefore, in future work, we will be committed to integrating these factors into the proposed parameter identification process. In addition, the control system of the collaborative robot can be designed by using the improved identification algorithm to further expand its application scope.