A Method for Solving Inverse Kinematics of a Robotic Arm Based on an Improved Particle Swarm Optimization Algorithm

By improving the particle swarm optimization algorithm, adopting adaptive inertial weights and asynchronous learning factors, and combining mutation to generate offspring particles, the local optimum problem in solving the inverse kinematics of the robotic arm was solved, improving the solution accuracy and efficiency, and achieving higher solution accuracy and shorter computation time.

CN118446242BActive Publication Date: 2026-11-10HUNAN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410576415.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-10
Publication Date
2026-11-10
Estimated Expiration
2044-05-10

AI Technical Summary

Technical Problem

Existing analytical and numerical methods for solving inverse kinematics of robotic arms suffer from problems such as high computational cost, unsatisfactory accuracy, and susceptibility to local optima. In particular, when solving inverse kinematics problems of high-dimensional and nonlinear robotic arms, the particle swarm optimization (PSO) algorithm is prone to getting stuck in local optima or stagnation, resulting in inaccurate solutions.

Method used

An improved particle swarm optimization (IPSO) algorithm is adopted, which uses adaptive inertia weights and asynchronously changing learning factors to generate new offspring particles through mutation, thereby improving the diversity and search capability of the PSO algorithm and transforming the inverse kinematics problem into an optimization problem for solution.

Benefits of technology

It improves the accuracy and efficiency of solving the inverse kinematics of the robotic arm, avoids the tedious inverse kinematics derivation process, enhances the particle search capability, reduces the possibility of getting trapped in local optima, and achieves higher solution accuracy and shorter computation time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118446242B_ABST
    Figure CN118446242B_ABST
Patent Text Reader

Abstract

This invention proposes a method for solving the inverse kinematics of a robotic arm based on an improved particle swarm optimization (IPSO) algorithm, comprising the following steps: Step 1, determining the MDH parameters of the robotic arm based on its structure; Step 2, deriving the forward kinematics model of the robotic arm based on the MDH parameters; Step 3, defining the fitness function, transforming the problem of solving the inverse kinematics model of the robotic arm into an optimization problem of finding the minimum value of the fitness function; Step 4, using the improved particle swarm optimization algorithm to find the minimum value of the fitness function. The solution method provided by this invention improves the parameter selection method of the particle swarm optimization algorithm, such as the inertia weight. It randomly selects some initial particles for mutation and selects the optimal mutated particle to replace the initial particles, proposing an improved particle swarm optimization algorithm with particle diversity, adaptive inertia weight, and asynchronously changing learning factors. This balances the global search capability and local search capability of the particle swarm optimization algorithm, thus solving the inverse kinematics problem of the robotic arm.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of industrial robot kinematics technology, and in particular relates to a method for solving the inverse kinematics of a robotic arm based on an improved particle swarm optimization algorithm. Background Technology

[0002] The inverse kinematics (IK) problem of robotic arms has always been a key research topic, playing a crucial role in trajectory planning, dynamic characteristic analysis, and motion control. Common methods for solving the IK problem include analytical and numerical methods. Analytical methods are only applicable when the robotic arm's geometry satisfies the Piper criterion. However, in reality, robotic arms vary greatly in shape and not all satisfy the Piper criterion. Therefore, some scholars have proposed numerical methods such as methods based on the Jacobian matrix and fast iteration methods to solve the IK problem. These methods involve high computational costs, and the inability to invert the Jacobian matrix at singular positions prevents the generation of numerical solutions. Furthermore, as the complexity of robotic arm geometry increases, kinematic modeling becomes more difficult, making the inverse kinematics problem increasingly complex and challenging. To address the unsatisfactory convergence speed and accuracy of analytical and numerical methods in solving the IK problem, more and more scholars have recently attempted to use intelligent algorithms. Among these intelligent algorithms, the Particle Swarm Optimization (PSO) algorithm has received widespread attention due to its advantages of fewer parameters, simple configuration, and ease of control. Although the PSO algorithm can be used to solve multimodal and high-dimensional optimization problems, it is prone to getting stuck in local optima or stagnation when faced with inverse kinematics problems of high-dimensional and nonlinear robotic arms, resulting in inaccurate solutions. Summary of the Invention

[0003] The purpose of this invention is to improve the efficiency and accuracy of solving inverse kinematics problems for robotic arms, and an improved particle swarm optimization algorithm is proposed.

[0004] This patent proposes a method for solving the inverse kinematics of a robotic arm based on an improved particle swarm optimization algorithm. The method includes the following steps:

[0005] Step 1: Determine the MDH parameters of the robotic arm based on its structure;

[0006] Step 2: Derive the forward kinematics model of the robotic arm based on the MDH parameters;

[0007] Step 3: Define the fitness function, transforming the problem of solving the inverse kinematics model of the robotic arm into an optimization problem of finding the minimum value of the fitness function;

[0008] Step 4: Use the improved particle swarm optimization algorithm to find the minimum value of the fitness function.

[0009] Furthermore, in step 1, the robotic arm is composed of multiple links connected by joints, and the MDH parameters of each link include link length, link torsion angle, link offset and joint angle;

[0010] The link number of the fixed base is 0, the link number of the end effector is N, and the coordinate system fixed on link i is called coordinate system {i}.

[0011] Furthermore, in step 2, the positive kinematics model is the pose of the end effector relative to the base obtained based on the rotation angle of the robotic arm, expressed as:

[0012]

[0013] In the formula, N is the link number of the end effector, and R 3×3 p represents the rotation matrix of the robotic arm's end effector relative to the base coordinate system. 3×1 It is the position vector of the origin of the robotic arm's end effector in the base coordinate system;

[0014] (n x ,n y ,n z Let be the direction cosine of the unit vector along the X-axis of coordinate system {N} in coordinate system {0};

[0015] (o x ,o y ,o z Let be the direction cosine of the unit vector along the Y-axis in coordinate system {N} in coordinate system {0};

[0016] (a x ,a y ,a z (p) is the direction cosine of the unit vector along the Z-axis in coordinate system {N} in coordinate system {0}; x ,p y ,p z Let be the position of the origin of coordinate system {N} in coordinate system {0};

[0017] The attitude angle can be calculated as A = arctan(-a) y / a z ), C = arctan(-o) x / n x Therefore, the position and orientation of the robotic arm's end effector can be expressed as P = [p x p y p z ABC], where [P x P y Pz [] is the position vector, representing the position of the origin of the coordinate system fixed on the end effector in the coordinate system {0} fixed on the base. [ABC] is the attitude represented by xyz Euler angles, representing the attitude of the coordinate system fixed on the end effector relative to the coordinate system {0} fixed on the base.

[0018] Furthermore, in step 3, the fitness function is defined as:

[0019]

[0020] In the formula, P0 = [p x0 p y0 p z0 [A0 B0 C0] represents the position and orientation of the robotic arm end effector relative to the base, i.e., the desired pose, obtained during inverse kinematics solving. P i =[P xi P yi P zi A i B i C i ] is the joint angle vector θ of the robotic arm. i The position and orientation of the end effector are obtained through forward kinematics.

[0021] Furthermore, step 4 also includes the following steps:

[0022] Step 41, initialize particle swarm parameters;

[0023] Step 42: Calculate the fitness value for each particle based on its position according to a predefined fitness function;

[0024] Step 43: Compare the fitness value of each particle's current position with its historical best position to determine whether to update the individual's best position;

[0025] Step 44: Select the best position among all individual particle positions and use it as the global optimal position;

[0026] Step 45: Each particle updates its velocity and position based on its current position and velocity, its global best position, and its individual historical best position.

[0027] Step 46: After the t-th iteration, calculate the fitness value of each particle. According to the principle that the closer the fitness value is to the global optimum, the greater the probability of being selected, use the roulette wheel method to select p% of the particles as the parent particles for the offspring to be mutated. p% is the selection ratio.

[0028] Step 47: Mutate the selected particles to produce several offspring;

[0029] Step 48: After the particle generates several offspring, calculate the fitness value of each offspring, compare the fitness values ​​of the offspring and the parent, select the best of the two for the (t+1)th iteration, and update the individual optimal and global optimal values ​​after completion.

[0030] Step 49: Sort the unmutated particle swarm according to the fitness value, select the top (1-p)% of particles and the mutated offspring particles to form a new swarm for the (t+1)th iteration.

[0031] Step 410: Determine whether the condition for ending the iteration is met. If not, repeat steps 42 to 49 until the condition for ending the iteration is met.

[0032] Furthermore, in step 45, the expression for updating the particle's velocity and position based on the current position and velocity, the global optimal position, and the particle's individual historical optimal position is as follows:

[0033]

[0034]

[0035] In the improved particle swarm optimization algorithm, w is defined as:

[0036]

[0037] Among them, w max For the maximum inertia weight, w min It is the minimum inertia weight, f max,t f is the maximum fitness value at generation t. min,t f is the minimum fitness value at generation t. i,t The fitness value of the i-th particle in iteration t, together with the inertia weight w of the i-th particle in generation t+1, determines the inertia weight w of the i-th particle in generation t+1. t+1 ;

[0038] In the improved particle swarm optimization algorithm, the self-learning factor c1 and the social learning factor c2 are defined as follows:

[0039]

[0040]

[0041] Among them, c 1,max and c 2,max These are the maximum values ​​of c1 and c2, respectively. 1,min and c 2,min These are the minimum values ​​of c1 and c2, respectively, and t max t represents the maximum number of iterations, and t represents the current iteration number.

[0042] Furthermore, in step 47, each replacement of the value at a point will generate a child representation as follows:

[0043]

[0044] Where k = r(1-t / t) max ) 2 x is the value of a particle at a certain point before mutation. min and x max These are the lower and upper bounds of the point, respectively, and r is a random number in the interval (0,1).

[0045] Furthermore, in step 48, the method for comparing the fitness values ​​of offspring and parents is as follows:

[0046] Select the particle with the best fitness value among all offspring. If the fitness value of this particle is better than that of its parent, then this particle will replace the parent in the (t+1)th iteration, and its parent will be discarded. If there is no particle with a better fitness value than the parent particle among all the generated offspring, then all generated offspring will be discarded, and the parent will continue to participate in the (t+1)th iteration.

[0047] The beneficial effects achieved by this invention are:

[0048] The solution method provided in this invention improves upon the particle swarm optimization (PSO) algorithm, proposing an improved PSO algorithm with particle diversity, adaptive inertia weights, and asynchronously changing learning factors, effectively solving the inverse kinematics problem of a robotic arm. Compared with the results of GA, PSO, LDWPSO, and BLPSO algorithms in solving the inverse kinematics problem of a robotic arm, the IPSO algorithm proposed in this invention has higher accuracy in solving practical inverse kinematics problems of robotic arms.

[0049] The solution method provided by this invention improves the selection method of inertia weight in particle swarm optimization by adopting adaptive nonlinear dynamic inertia weight, which automatically updates the inertia weight according to the position of the particle, thereby improving the particle search efficiency.

[0050] The solution method provided by this invention improves the selection method of the learning factor in the particle swarm optimization algorithm by adopting an asynchronously changing learning factor that is automatically adjusted as the iteration progresses. This allows the particles to take into account both global and local search capabilities at different stages, thereby enhancing the search ability of the particles.

[0051] The solution method provided by this invention introduces the idea of ​​mutation in particles to generate new offspring, thereby increasing the diversity of the population and reducing the possibility of particles getting trapped in local optima.

[0052] The solution method provided by this invention simplifies the inverse kinematics problem of the robotic arm into a general optimization problem and solves it using an optimization algorithm, thus avoiding the tedious derivation process of inverse kinematics. Attached Figure Description

[0053] Figure 1 This is a flowchart of a method for solving the inverse kinematics of a robotic arm based on an improved particle swarm optimization algorithm, provided by the present invention.

[0054] Figure 2 This is a schematic diagram of the structure of a six-degree-of-freedom cooperative robotic arm model in a robotic arm inverse kinematics solution method based on an improved particle swarm optimization algorithm provided by the present invention.

[0055] Figure 3 This is a comparative analysis diagram of scenario one in the inverse kinematics solution method for a robotic arm based on an improved particle swarm optimization algorithm provided by the present invention.

[0056] Figure 4 This is a comparative analysis diagram of scenario two in the inverse kinematics solution method for a robotic arm based on an improved particle swarm optimization algorithm provided by the present invention.

[0057] Figure 5 This is a schematic diagram illustrating the average solution time for 50 random points in scenario two of the inverse kinematics solution method for a robotic arm based on an improved particle swarm optimization algorithm provided by this invention. Detailed Implementation

[0058] The technical solution of the present invention will be described in more detail below with reference to the accompanying drawings. The present invention includes, but is not limited to, the following embodiments.

[0059] Example 1

[0060] As attached Figure 1 As shown, this invention provides a method for solving the inverse kinematics of a robotic arm based on an improved particle swarm optimization algorithm, comprising the following steps:

[0061] Step 1: Determine the MDH parameters of the robotic arm based on its structure;

[0062] A robotic arm can be viewed as a series of rigid bodies connected by joints; these rigid bodies are called links. The links are numbered starting from the base, so the link number fixed to the base can be called i = 0. The first movable link is link i = 1, and so on, with the link number of the end effector being N. To clearly describe the positional relationship between each link and its adjacent links, a coordinate system is fixed to each link and named after the link number it belongs to. Therefore, the coordinate system fixed to link i is called coordinate system {i}.

[0063] MDH parameters include α i a id i and θ i :

[0064] a i Indicates the length of the link, indicating the length along the X-axis. i Axis, from Z i Move to Z i+1 The distance;

[0065] α i Indicates the link twist angle, and indicates the angle about X. i Axis, from Z i Rotate to Z i+1 Angle;

[0066] d i Indicates the link offset, indicating the offset along the Z-axis. i Axis, from X i-1 Move to X i The distance;

[0067] θ i Indicates the joint angle, indicating the angle around Z. i Axis, from X i-1 Rotate to X i The angle.

[0068] In this implementation case, the appendix is ​​adopted. Figure 2 The robotic arm in the example has six rotary joints, and its MDH parameters are shown in Table 1 below:

[0069] Table 1. Parameters of the Six-DOF Collaborative Robotic Arm (MDH)

[0070]

[0071] Step 2: Derive the forward kinematics model of the robotic arm based on the MDH parameters;

[0072] For appendix Figure 2 The forward kinematics model of the collaborative robotic arm consisting of six rotary joints can be obtained from the rotation angles of the six joints, and the pose of the end effector relative to the base can be expressed by the following equation (1):

[0073]

[0074] In the formula, (n x n y n z ) is the direction cosine of the unit vector in the X-axis direction of coordinate system {6} in coordinate system {0};

[0075] (o x o y o z) is the direction cosine of the unit vector in the Y-axis direction of coordinate system {6} in coordinate system {0};

[0076] (a x a y a z ) is the direction cosine of the unit vector in the Z-axis direction of coordinate system {6} in coordinate system {0};

[0077] (p x p y p z Let be the position of the origin of coordinate system {6} in coordinate system {0}.

[0078] R 3×3 p represents the rotation matrix of the robotic arm's end effector relative to the base coordinate system, describing their relative attitude relationship. 3×1 It is the position vector of the origin of the robotic arm's end effector in the base coordinate system.

[0079] In the formula:

[0080] n x =(s1s5+c1c 234 c5)c6+c1s 234 s6;

[0081] n y =(s1c 234 c5-c1s5)c6+s1s 234 s6;

[0082] n z =s 234 c5C6-c 234 s6;

[0083] o x =-(s1s5+c1c 234 c5)s6+c1s 234 c6;

[0084] o y =(c1s5-s1c 234 c5)s6+s1s 234 c6;

[0085] o z =-s 234 c5s6-c 234 c6;

[0086] a x =c1c 234 s5-s1c5;

[0087] a y =s1c234 s5+c1c5;

[0088] a z =s 234 s5;

[0089] p x =s1d4+c1c 23 a3+c1s 234 d5+c1c2a2-(s1c5-c1c 234 s5)d6;

[0090] p y =-c1d4+s1s 234 d5+s1c 23 a3+s1c2a2+(c1c5+s1c 234 s5)d6;

[0091] p z =d1+s2a2-c 234 d5+s 23 a3+s 234 s5d6;

[0092] Where: s i =sin(θ) i );c i =cos(θ) i );s 23 =sin(θ2+θ3); c 23 =cos(θ2+θ3); s 234 =sin(θ2+θ3+θ4); c 234 =cos(θ2+θ3+θ4);

[0093] Furthermore, the attitude angle can be calculated as A = arctan(-a) / a y / a z ), C = arctan(-o) x / n x Therefore, the position and orientation of the robotic arm's end effector can be expressed as P = [p x p y p z A BC], where [P x P y P z [] is the position vector, representing the position of the origin of the coordinate system fixed on the end effector in the coordinate system {0} fixed on the base. [ABC] is the attitude represented by xyz Euler angles, representing the attitude of the coordinate system fixed on the end effector relative to the coordinate system {0} fixed on the base.

[0094] Step 3: Define the fitness function, transforming the inverse kinematics problem of the robotic arm into an optimization problem of finding the minimum value of the fitness function;

[0095] The fitness function is defined as:

[0096]

[0097] In the formula, P0 = [p x0 p y0 p z0 [A0 B0 C0] represents the position and orientation of the robotic arm end effector relative to the base, i.e., the desired pose, obtained during inverse kinematics solving. P i =[P xi P yi P zi A i B i C i ] is the joint angle vector θ of the robotic arm. i The position and orientation of the end effector are obtained through forward kinematics.

[0098] Since the order of magnitude of attitude is much smaller than that of position, to avoid neglecting the attitude error during optimization, it is multiplied by m, where m is 1000. When the fitness function reaches its minimum value, P... i The corresponding θ i It is the inverse kinematics solution of the robotic arm.

[0099] Step 4: The improved particle swarm optimization algorithm is used to solve for the minimum value of the fitness function defined in Step 3. For the IPSO algorithm used to solve the inverse kinematics problem of the robotic arm, the position of the particle is the joint angle vector, i.e., x i =θ i The search range for particles is the range of joint angle values. Step 4 specifically includes the following steps:

[0100] Step 41, initialize particle swarm parameters;

[0101] The particle swarm parameters include a particle count of 200, a maximum number of iterations of 500, an inertia weight w ranging from 0.729 to 0.6, a minimum value of 1 and a maximum value of 2 for the self-learning factor c1 and the social learning factor c2, a parent mutated particle ratio of 50%, each parent producing 3 offspring, and each particle being randomly assigned a position and velocity within the specified range.

[0102] Step 42, assess fitness;

[0103] For each particle, a fitness value is calculated based on its position according to a predefined fitness function. The fitness value reflects how well a particle is positioned in the solution space.

[0104] Step 43, update the individual's optimal position;

[0105] Each particle compares its current position with the fitness value of its historical best position to determine whether to update its optimal position. If the fitness of the current position is better than that of the historical best position, the optimal position will be updated to the current position; otherwise, it will not be updated.

[0106] Step 44: Update the global optimal position;

[0107] Select the best position among all individual particle positions and use it as the global optimal position.

[0108] Step 45, update particle velocity and position;

[0109] Each particle updates its velocity and position based on its current position and velocity, as well as its global best position and its individual historical best position.

[0110] The key to particle swarm optimization lies in updating the velocity and position of the particles, and the update formulas are shown in equations (3) and (4) below:

[0111]

[0112]

[0113] In the improved particle swarm optimization algorithm, w is defined as:

[0114]

[0115] Among them, w max For the maximum inertia weight, w min It is the minimum inertia weight, f max,t f is the maximum fitness value at generation t. min,t f is the minimum fitness value at generation t. i,t The fitness value of the i-th particle in iteration t, together with the inertia weight w of the i-th particle in generation t+1, determines the inertia weight w of the i-th particle in generation t+1. t+1 .

[0116] In the improved particle swarm optimization algorithm, the self-learning factor c1 and the social learning factor c2 are defined as follows:

[0117]

[0118]

[0119] Among them, c 1,max and c 2,max These are the maximum values ​​of c1 and c2, respectively. 1,min and c 2,min These are the minimum values ​​of c1 and c2, respectively, and t max t represents the maximum number of iterations, and t represents the current iteration number.

[0120] Step 46: Select the parent particle to participate in the mutation;

[0121] After the t-th iteration, the fitness value of each particle is calculated. According to the principle that the closer the fitness value is to the global optimum, the greater the probability of being selected, the roulette wheel method is used to select p% of the particles as the parent particles for the offspring generated by mutation. Here, p% is the selection ratio, and the value can be flexibly adjusted according to the specific problem. In this embodiment, 50% of the particles are selected as the parent particles for the offspring generated by mutation.

[0122] Step 47: Mutate the selected particles to produce several offspring;

[0123] The mutation method is to randomly select a point on the particle's position and replace the value. Each replacement of the value at a point will generate a offspring (Equation (8)).

[0124]

[0125] Where k = r(1-t / t) max ) 2 x is the value of a particle at a certain point before mutation. min and x max These are the lower and upper bounds of the point, respectively, and r is a random number in the interval (0,1).

[0126] Step 48: Select the optimal particle;

[0127] After a particle generates several offspring, the fitness value of each offspring is calculated. In this embodiment, each particle participating in mutation generates 3 offspring. The particle with the best fitness value among all offspring is selected. If the fitness value of this particle is better than that of its parent, then this particle will replace its parent in the (t+1)th iteration, and its parent will be discarded. If there is no particle with a better fitness value than its parent among all generated offspring, then all generated offspring are discarded, and the parent continues to participate in the (t+1)th iteration. After the mutation operation is completed, the individual optimal and global optimal values ​​are updated.

[0128] Step 49: Generate a new particle swarm;

[0129] The unmutated particle swarm is sorted according to its fitness value. The top (1-p)% of the particles are selected and combined with the mutated offspring particles to form a new swarm for the (t+1)th iteration.

[0130] Step 410, repeat the iteration;

[0131] Determine if the condition for ending the iteration is met. If not, repeat steps 42 to 49 until the condition for ending the iteration is met.

[0132] Example 2

[0133] This embodiment uses a six-DOF cooperative robotic arm as the research object to verify the effectiveness of the IPSO algorithm in solving the inverse kinematics problem of a robotic arm. The robotic arm model and its MDH parameters are as follows: Figure 2 As shown in Table 1.

[0134] Two different scenarios were used to verify the effectiveness of the IPSO algorithm in solving the IK problem of robotic arms. The results were compared with those of the GA, PSO, LDWPSO, and BLPSO algorithms. The population size was set to 200 and the maximum number of iterations was set to 500.

[0135] In the first scenario, a point P = [-436.742 -637.332856.1880.01770.8422.606] is randomly generated in the workspace of the robotic arm. Figure 3 (a) The inverse kinematics of this point were solved using the IPSO algorithm and other comparative algorithms to compare the solution accuracy of each algorithm when solving the IK problem on a collaborative robotic arm. Each algorithm was run 10 times, and the best result was selected from the 10 runs and plotted on [the graph]. Figure 3 (b) From Figure 3 (b) It can be seen that each algorithm can solve the IK problem with different levels of accuracy, but the IPSO algorithm converges to the optimal value with fewer iterations and achieves the best fitness value. Therefore, the IPSO algorithm achieves the best results in the first scenario. The solution results of the IPSO algorithm are simulated and verified in MATLAB. Based on the solved joint angle values, the posture of the robotic arm is obtained. Figure 3 (c)) It can be seen that the position and orientation of the end effector of the robotic arm are the same as those of the end effector of the robotic arm. Figure 3 (a) Consistent, according to the definition of the fitness function and Figure 3 (b) It can be seen that both the position error and the attitude error are much smaller than 10. -10 Therefore, the solution is valid.

[0136] In the second scenario, to eliminate the impact of randomness in point selection, 50 different points were randomly generated within the robotic arm's workspace. Figure 4(a)). The five algorithms described above are used to perform 10 inverse kinematics calculations for each point, and the best result is plotted on [the graph]. Figure 4 (b) in. By Figure 4 (b) It can be seen that when using different algorithms to solve for 50 random points, the IPSO algorithm obtained the best results at 41 of these points, far exceeding the other algorithms compared. Since the 0.1mm accuracy of the robotic arm's end effector can meet the application requirements of most scenarios, the IPSO algorithm can obtain solutions that meet the accuracy requirements for all points. In addition, considering the efficiency of the solution, the running time of the IPSO algorithm was compared with other intelligent algorithms when the solution accuracy reached 0.1mm. For points that never reached 0.1mm accuracy, the running time to find the optimal solution was calculated. All calculations were performed in MatLab on a computer equipped with an Intel(R) Core(TM) i5-8250U processor. Figure 5 The results show that the IPSO algorithm has a faster solution time than GA, LDWPSO, and BLPSO. Although the solution times of PSO and IPSO are almost the same, Table 3 further shows that IPSO has the shortest average computation time and higher computational efficiency among 50 random points.

[0137] Table 2 Average Solution Time

[0138]

[0139] analyze Figure 3 (b) and Figure 4 The experimental results in (b) show that, compared to other algorithms, the IPSO algorithm can solve the IK problem with fewer iterations, and can obtain results that meet the accuracy requirements at any point. Furthermore, it achieves the best results at more points than other algorithms compared to the others. Therefore, the IPSO algorithm proposed in this invention has superior performance in the inverse kinematics problem of robotic arms.

[0140] This invention is not limited to the specific embodiments described above. Those skilled in the art can implement this invention using various other specific embodiments based on the disclosed content of the embodiments and accompanying drawings. Therefore, any design that adopts the design structure and concept of this invention and makes some simple changes or modifications falls within the protection scope of this invention.

Claims

1. A method for solving the inverse kinematics of a robotic arm based on an improved particle swarm optimization algorithm, characterized in that, The method for solving the inverse kinematics of a robotic arm based on the improved particle swarm optimization algorithm includes the following steps: Step 1: Determine the MDH parameters of the robotic arm based on its structure; Step 2: Derive the forward kinematics model of the robotic arm based on the MDH parameters; Step 3: Define the fitness function, transforming the problem of solving the inverse kinematics model of the robotic arm into an optimization problem of finding the minimum value of the fitness function; Step 4: Use the improved particle swarm optimization algorithm to find the minimum value of the fitness function; In step 1, the robotic arm is composed of multiple links connected by joints. The MDH parameters of each link include link length, link torsion angle, link offset and joint angle. The link number of the fixed base is 0, and the link number of the end effector is N, which is fixed to the link. A coordinate system on the coordinate system is called a coordinate system. ; MDH parameters include , , and : Indicates the length of the link, indicating along Axis, from Move to The distance; Indicates the torsion angle of the connecting rod, and indicates the angle of rotation around the rod. Axis, from Rotate to Angle; Indicates the link offset, indicating the distance along the link. Axis, from Move to The distance; Indicates joint angle, indicates rotation Axis, from Rotate to Angle; In step 2, the forward kinematics model is the pose of the end effector relative to the base obtained based on the rotation angle of the robotic arm, expressed as: ; In the formula, N is the link number of the end effector. This represents the rotation matrix of the robotic arm's end effector relative to the base coordinate system. It is the position vector of the origin of the robotic arm's end effector in the base coordinate system; ( , , ) is a coordinate system { The direction cosine of the unit vector along the X-axis in coordinate system {0}; ( , , ) is a coordinate system { The direction cosine of the unit vector along the Y-axis in coordinate system {0}; (a x ,a y ,a z ) is a coordinate system { The direction cosine of the unit vector along the Z-axis in coordinate system {0}; (p x ,p y ,p z ) is a coordinate system { The position of the origin of {} in the coordinate system {0}; ; ; ; ; ; ; ; ; ; ; ; ; in: ; ; ; ; ; The attitude angle can be calculated as follows: , , Therefore, the position and orientation of the robotic arm's end effector can be represented as: ,in It is a position vector, representing the position of the origin of the coordinate system fixed on the end effector in the coordinate system {0} fixed on the base. The attitude is represented by xyz Euler angles, indicating the attitude of the coordinate system fixed on the end effector relative to the coordinate system {0} fixed on the base; In step 3, the fitness function is defined as: ; In the formula, It is the position and orientation of the end effector of the robotic arm relative to the base, i.e., the desired pose, which is solved during inverse kinematics. It is the joint angle vector of the robotic arm. The position and orientation of the end effector are obtained through forward kinematics.

2. The method for solving the inverse kinematics of a robotic arm based on an improved particle swarm optimization algorithm according to claim 1, characterized in that, Step 4 also includes the following steps: Step 41, initialize particle swarm parameters; Step 42: Calculate the fitness value for each particle based on its position according to a predefined fitness function; Step 43: Compare the fitness value of each particle's current position with its historical best position to determine whether to update the individual's best position; Step 44: Select the best position among all individual particle positions and use it as the global optimal position; Step 45: Each particle updates its velocity and position based on its current position and velocity, its global best position, and its individual historical best position. Step 46: After the t-th iteration, calculate the fitness value of each particle. According to the principle that the closer the fitness value is to the global optimum, the greater the probability of being selected, use the roulette wheel method to select p% of the particles as the parent particles for the offspring to be mutated. p% is the selection ratio. Step 47: Mutate the selected particles to produce several offspring; Step 48: After the particle generates several offspring, calculate the fitness value of each offspring, compare the fitness values ​​of the offspring and the parent, select the best of the two for the (t+1)th iteration, and update the individual optimal and global optimal values ​​after completion. Step 49: Sort the unmutated particle swarm according to the fitness value, select the top (1-p)% of particles and the mutated offspring particles to form a new swarm for the (t+1)th iteration. Step 410: Determine whether the condition for ending the iteration is met. If not, repeat steps 42 to 49 until the condition for ending the iteration is met.

3. The method for solving the inverse kinematics of a robotic arm based on the improved particle swarm optimization algorithm according to claim 2, characterized in that, In step 45, the expression for updating the particle's velocity and position based on the current position and velocity, the global optimal position, and the particle's individual historical optimal position is as follows: ; ; In the improved particle swarm optimization algorithm, The definition of is: ; in, For maximum inertia weight, It is the minimum inertia weight. The maximum fitness value at generation t. The minimum fitness value at generation t. The fitness value of the i-th particle in iteration t, together with the inertia weight value of the i-th particle in generation t+1, determines the inertia weight value of the i-th particle in generation t+1. ; In the improved particle swarm optimization algorithm, the self-learning factor Social learning factors Defined as: ; ; in, and They are and The maximum value, and They are and The minimum value, t represents the maximum number of iterations, and t represents the current iteration number.

4. The method for solving the inverse kinematics of a robotic arm based on the improved particle swarm optimization algorithm according to claim 3, characterized in that, In step 47, each value replacement at a point will generate a child representation, as shown below: ; in x is the value of a particle at a certain point before mutation. and These are the lower and upper bounds of the point, respectively, and r is a random number in the interval (0,1).

5. The method for solving the inverse kinematics of a robotic arm based on the improved particle swarm optimization algorithm according to claim 4, characterized in that, In step 48, the method for comparing the fitness values ​​of offspring and parents is as follows: Select the particle with the best fitness value among all offspring. If the fitness value of this particle is better than that of its parent, then this particle will replace the parent in the (t+1)th iteration, and its parent will be discarded. If there is no particle with a better fitness value than the parent particle among all the generated offspring, then all generated offspring will be discarded, and the parent will continue to participate in the (t+1)th iteration.