Robot arm path planning method, device, equipment, medium and program for hull surface
By using a particle swarm optimization algorithm that dynamically adjusts inertia weights and learning factors, combined with a multi-objective fitness function and a polyhedral boundary model, the problem of path planning for a robotic arm on a ship's hull surface easily getting trapped in local optima is solved. This achieves efficient and accurate path planning in dynamic environments, meeting the needs of multiple constraints and multiple objectives.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- JINJIANG COLLEGE OF SICHUAN UNIV
- Filing Date
- 2025-12-16
- Publication Date
- 2026-04-21
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing methods for path planning on ship hull surfaces using robotic arms are prone to getting trapped in local optima, making it difficult to respond in real time in dynamic and time-varying environments. Furthermore, obstacle modeling is simple, making it difficult to accurately match irregular obstacles. The fitness function design is also simplistic, failing to fully balance the multi-objective requirements such as path length and energy consumption.
A particle swarm optimization algorithm with dynamically adjusted inertia weights and learning factors is adopted to optimize global search and local refinement in stages. Combined with a multi-objective fitness function, the global search capability is enhanced by linearly reducing the inertia weight from 1.2 to 0.7 and switching the learning factor from 2.5-3.0 to 1.0-1.5. In the later stage of iteration, local optimization is focused on, and the particle velocity is optimized by combining a polyhedral boundary model for accurate obstacle modeling and Jacobian pseudo-inverse correction.
This effectively prevents the robotic arm from getting stuck in local optima when working on complex ship surfaces, improves the efficiency and accuracy of path planning, meets the needs of multiple constraints and multiple objectives, and ensures the safety and efficiency of the robotic arm in dynamic environments.
Smart Images

Figure CN121893243A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of robotic arm technology, and in particular to a method, apparatus, electronic device, computer-readable storage medium, and computer program product for robotic arm path planning on ship hull surfaces. Background Technology
[0002] With the development of automation in the shipbuilding industry, multi-degree-of-freedom robotic arms have been widely used in ship surface operations, replacing manual labor in high-altitude and dangerous scenarios for painting, welding, cleaning, and other tasks, significantly improving operational efficiency and safety.
[0003] Chinese patent CN116352697A discloses a method for optimizing and obtaining the trajectory of a robotic arm based on an improved multi-objective PSO (particle swarm optimization) algorithm. The PSO algorithm uses pBesti+1≥pBesti or gBesti+1≥gBesti as the termination loop condition, which is too simple and easy to get trapped in local optima.
[0004] In the publicly available paper "Design and Path Planning Research of a Six-DOF Robotic Arm for Ship Surface Operations" (Vol. 44, No. 12, *Ship Science and Technology*), authored by Jia Chengfen et al., a spatial motion model of a six-DOF robotic arm was established. Based on this model, the path optimization and obstacle avoidance of the robotic arm were studied using a particle swarm optimization (PSO) algorithm. Specifically, the inertial weights in the PSO algorithm varied linearly, while the learning factor was fixed. It is easy to get trapped in local optima. Summary of the Invention
[0005] The purpose of this invention is to provide a method, apparatus, electronic device, computer-readable storage medium, and computer program product for path planning of a robotic arm on the hull surface, aiming to solve the technical problem that existing path planning methods for robotic arms on the hull surface are prone to getting trapped in local optima.
[0006] In a first aspect, this application provides a method for path planning of a robotic arm on a ship's hull surface, comprising the following steps: S100: Constructing the kinematic model of the robotic arm; S200: Collects environmental data on the ship's surface, identifies obstacles, and determines the obstacle area; S300: Initializes the particle swarm optimization algorithm parameters and performs iterative updates, specifically including: S301: Set the population size N, the number of iterations k, and the maximum number of iterations K. max Initial value of inertial weight ω max =1.2、ω min =0.3, intermediate threshold ω mid =0.7, initial range of learning factor Initialize particle position x i (0) and velocity v i (0); S302: When k <K max When / 2, the inertia weight update formula is: Learning factor =2.5-3.0; When k≥K max When / 2, the inertia weight update formula is: Learning factor =1.0-1.5; S303: The particle velocity update formula is: ;in, , The result is a uniformly random number in the range [0,1]. Let be the optimal position for the i-th particle. The optimal position for the entire population; The particle position update formula is: ; S400: Construct a multi-objective fitness function that integrates attention weights to evaluate the fitness of each particle. Wherein: path length weight Energy consumption weight Obstacle avoidance safety weight all ,and + + =1; For particles The corresponding path length, It is 1.1 to 1.5 times the maximum working range of the robotic arm; For path energy consumption; For the robotic arm to operate at full load K max The upper limit of energy consumption for the next iteration; This is the minimum safe distance from the particle to the boundary of the barrier region. This refers to the safe distance threshold for operations on the ship's hull. S500: If the current iteration number k = If the global optimal fitness value satisfies the convergence threshold after H consecutive iterations, then the global optimal trajectory is output.
[0007] Secondly, this application provides a path planning device for a robotic arm on a ship's hull surface, comprising: The motion modeling module is used to build the kinematic model of the robotic arm; The environmental perception module is used to collect environmental data on the surface of the ship, identify obstacles, and determine the obstacle area. The particle swarm optimization module is used to initialize the particle swarm optimization algorithm parameters and perform iterative updates, specifically including: The initial unit of the population is used to set the population size N, the number of iterations k, and the maximum number of iterations K. max Initial value of inertial weight ω max =1.2、ω min =0.3, intermediate threshold ω mid =0.7, initial range of learning factor Initialize particle position x i (0) and velocity v i (0); Factor update unit, used when k <K max When / 2, the inertia weight update formula is: Learning factor =2.5-3.0; when k≥K max When / 2, the inertia weight update formula is: Learning factor =1.0-1.5; The particle velocity-position update unit is used to update particle velocities using the following formula: ;in, , The result is a uniformly random number in the range [0,1]. Let be the optimal position for the i-th particle. The optimal position for the population; and the position for updating particles using the following formula: ; The multi-objective fitness function module is used to construct a multi-objective fitness function that incorporates attention weights, and to evaluate the fitness of each particle. Wherein: path length weight Energy consumption weight Obstacle avoidance safety weight all ,and + + =1; For particles The corresponding path length, It is 1.1 to 1.5 times the maximum working range of the robotic arm; For path energy consumption; For the robotic arm to operate at full load K max The upper limit of energy consumption for the next iteration; This is the minimum safe distance from the particle to the boundary of the barrier region. This refers to the safe distance threshold for operations on the ship's hull. The path output module is used to output the path at the current iteration number k= If the global optimal fitness value satisfies the convergence threshold after H consecutive iterations, the global optimal trajectory is output.
[0008] Thirdly, this application provides an electronic device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the hull surface path planning method for a robotic arm as described in any of the preceding claims.
[0009] Fourthly, this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the hull surface path planning method for a robotic arm as described in any of the preceding claims.
[0010] Fifthly, this application provides a computer program product, including a computer program that, when executed by a processor, implements the steps in the hull surface path planning method for a robotic arm described in any of the preceding claims.
[0011] The beneficial effects of the robotic arm path planning method, device, electronic device, computer-readable storage medium, and computer program product for ship hull surface provided by this invention are: in the early iteration stage of the PSO algorithm (k <K max / 2), employing a large inertia weight linearly decreasing from 1.2 to 0.7, coupled with a large learning factor of 2.5-3.0, enhances the particle's global search capability. At this point, the particle is more inclined to jump out of the initial region and extensively traverse the complex working space on the hull surface (such as areas with dense obstacles and curved surfaces), avoiding prematurely getting trapped in local optima. In the later stages of iteration (k≥K), max / 2), the inertia weight is linearly reduced from 0.7 to 0.3, and the learning factor is switched to a small value of 1.0-1.5, focusing on local fine-grained optimization. That is, within the global optimal candidate region found in the early stage of iteration, the particle slowly adjusts its position to accurately discover the optimal path and avoid missing the optimal solution due to excessive search range. The improved PSO algorithm uses inertia weight for staged dynamic optimization to balance global exploration and local focus, avoiding getting trapped in local optima. Attached Figure Description
[0012] To more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0013] Figure 1 A flowchart illustrating the path planning method for a robotic arm on a ship's hull surface provided in an embodiment of the present invention; Figure 2 A flowchart illustrating step S100 in the method for path planning on the surface of a ship using a robotic arm. Figure 3 The coordinate system for the motion of the robotic arm on the ship's hull surface; Figure 4 Another flowchart illustrating the path planning method for a robotic arm on the surface of a ship's hull; Figure 5 A flowchart illustrating step S200 in the method for path planning on the surface of a ship using a robotic arm. Figure 6 Another flowchart illustrating the path planning method for a robotic arm on the surface of a ship's hull; Figure 7 A flowchart illustrating step S300 in the method for path planning on the surface of a ship using a robotic arm. Figure 8 Another flowchart illustrating the path planning method for a robotic arm on the surface of a ship's hull; Figure 9 A schematic diagram of path planning for a robotic arm on the ship's hull surface; Figure 10 A schematic diagram of a robotic arm path planning device for the surface of a ship's hull. Figure 11 This is a schematic diagram of the electronic device. Detailed Implementation
[0014] Embodiments of the present invention are described in detail below, examples of which are illustrated in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain the present invention, and should not be construed as limiting the present invention.
[0015] Throughout this specification, references to "an embodiment" or "an embodiment" mean that a particular feature, structure, or characteristic described in connection with an embodiment is included in at least one embodiment of this application. Therefore, the phrases "in one embodiment" or "in some embodiments" appear in various places throughout the specification, and not all refer to the same embodiment. Furthermore, in one or more embodiments, particular features, structures, or characteristics may be combined in any suitable manner.
[0016] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined with "first" or "second" may explicitly or implicitly include one or more of that feature.
[0017] The working environment on the surface of a ship is unique. For example, large ships of more than 5,000 tons have a large surface area and complex shape, with irregular obstacles such as sharp edges and shellfish attached to them. During the operation, the ship may be in a dynamic and time-varying state, and the robotic arm needs to consider its own motion and the coupled motion of the ship at the same time. The path planning needs to meet the requirements of multiple constraints (geometric constraints, physical constraints) and multiple objectives (shortest path, low energy consumption, and high safety).
[0018] Existing path planning technologies for robotic arms based on particle swarm optimization (PSO) have the following shortcomings in ship surface operation scenarios: First, treating the coupled motion of the ship (time-varying angular velocity and angle) as a static disturbance, the basic PSO algorithm with linear inertia weights and fixed learning factors cannot respond to time-varying environments in real time, causing the robotic arm path to easily deviate from the preset trajectory, especially when operating while the ship is sailing. In dynamic time-varying environments, it is prone to getting trapped in local optima, resulting in low optimization efficiency. Second, the fixed learning factor and linear inertia weight strategy is prone to getting trapped in local optima in areas with dense obstacles (such as complex curved surfaces of the ship hull or areas with multiple overlapping obstacles), requiring a large number of iterations (usually more than 500) to converge, which is difficult to meet the efficiency requirements of batch operations. Third, the obstacle modeling is simple, mostly using circular envelopes, which is difficult to accurately match irregular obstacles on the ship hull surface, easily leading to incomplete obstacle avoidance or path redundancy. Fourth, the fitness function design is simple and does not fully balance the multi-objective requirements such as path length and energy consumption, making it difficult to adapt to complex operation scenarios.
[0019] Example 1
[0020] Please refer to Figure 1 This application provides a method for path planning of a robotic arm on a ship's hull surface, comprising the following steps: S100: Construct the kinematic model of the robotic arm.
[0021] S200: Collects environmental data on the ship's surface, identifies obstacles, and obtains obstacle areas.
[0022] S300: Initialize particle swarm optimization algorithm parameters and perform iterative updates.
[0023] Step S300 specifically includes: S301: Set the population size N, which can be a natural number between 40 and 60, such as N=40, 45, 50, 55, or 60. Set the number of iterations k, initially 0, and the maximum number of iterations K. max K max A natural number between 400 and 600. For example, K. max =400, 450, 500, 550, or 600. Initial value of inertia weight ω. max =1.2、ω min =0.3, intermediate threshold ω mid=0.7, initial range of learning factor Initialize particle position x i (0) and velocity v i (0) allows particles to be dispersed in the working space of the robotic arm, reducing premature convergence caused by initial particles clustering in local areas.
[0024] S302: When k <K max When / 2, the inertia weight update formula is: , Learning factor =2.5-3.0. Based on this, in the early stage of iteration, a large inertia weight is adopted, which is linearly reduced from 1.2 to 0.7, and a large learning factor of 2.5-3.0 is adopted to enhance the global search capability of the particles. At this time, the particles are more inclined to jump out of the initial region and extensively traverse the complex working space on the hull surface (such as areas with dense obstacles and curved working areas), avoiding getting trapped in local optima too early.
[0025] When k≥K max When / 2, the inertia weight update formula is: , Learning factor =1.0-1.5. Based on this, in the later stages of iteration, the inertia weight is linearly reduced from 0.7 to 0.3, and the learning factor is switched to a small value of 1.0-1.5 to focus on local fine-grained optimization. Within the global optimal candidate region found in the early stages of iteration, the particles slowly adjust their positions to accurately discover the optimal path and avoid missing the optimal solution due to excessive search range.
[0026] S303: The particle velocity update formula is: , The particle position update formula is: ,in, , The purpose of using uniform random numbers in the range of [0,1] is to retain a certain degree of uncertainty when updating particles. Faced with the complex distribution of obstacles on the hull, there is an opportunity to explore a better detour path, such as avoiding large-radius sharp corners while not going far around the shell attachment area. Let be the optimal position for the i-th particle. This is the globally optimal position for the population.
[0027] S400: Construct a multi-objective fitness function that integrates attention weights to evaluate the fitness of each particle. , Where: path length weight Energy consumption weight Obstacle avoidance safety weight all ,and + + =1. Specifically, when the robotic arm performs operations in high-altitude hazardous areas, =0.2、 =0.2、 =0.6. Specifically, when the robotic arm performs painting operations, =0.6、 =0.2、 =0.2.
[0028] For particles The corresponding path length, It is 1.1 to 1.5 times the maximum working range of the robotic arm. Optionally, It is 1.1, 1.2, 1.3 or 1.5 times the maximum working range of the robotic arm. This refers to path energy consumption. Specifically, ; Joint angular velocity; The time step is 0.01s. For the robotic arm to operate at full load K max The upper limit of energy consumption for the next iteration. This represents the minimum safe distance between the particle and the boundary of the obstacle region. For example, the safe distance threshold for ship operations. The value is 0.1~0.3m.
[0029] S500: If the current iteration number k = If the globally optimal fitness value after H consecutive iterations satisfies the convergence threshold ε, then the globally optimal trajectory is output. Specifically, H can be a natural number from 5 to 10. The convergence threshold ε ranges from 0.001 to 0.00001.
[0030] In some embodiments, in step S100, the kinematic model of the robotic arm can be constructed using the DH parameter method, vector method, analytical method, numerical method, or geometric method. .
[0031] In one embodiment, combined Figure 2 The kinematic model of the robotic arm is established step by step, following the sequence of coordinate system, attitude tool, pose tool, and motion model. Step S100 specifically includes the following steps: S101: Combination Figure 3 Construct a static coordinate system O-xyz, which will serve as the reference coordinate system for the movement of the robotic arm.
[0032] S102: The direction cosine of the position of the robotic arm's end effector relative to the static coordinate system O-xyz is expressed by the following formula: , It is a rotation matrix with three unit column vectors. Each column vector is perpendicular to the others, and the coordinate axes x / y / z are rotated by an angle of... rotational transformation, c Represents cosθ, s sin The rotation matrix is as follows:
[0033] S103: The homogeneous coordinate form of the robotic arm's position is [xyzw]. T The homogeneous transformation matrix G of the robotic arm position is synthesized from the attitude matrix R (obtained from step S102) and the position matrix P, as follows:
[0034] Rotate the coordinate axes x, y, z The rotation matrix of the homogeneous transformation matrix G is as follows:
[0035] S104: Define the angular displacements of the coordinate axes of a multi-degree-of-freedom robotic arm as follows: , , , These represent the rotational angular velocities of the robotic arm around the three coordinate axes. , , Let the angles between the three coordinate axes be the angles between the axes, then the motion model is established as follows: .
[0036] In some embodiments, combined with Figure 4 Step S100 further includes the following steps: S105: Uses an inertial measurement unit (IMU) to collect hull-robotic arm coupled motion data, including the change in angular velocity Δ of the hull or robotic arm base. Δ Δ ; Change in included angle Δ Δ Δ Specifically, it can also obtain the joint angles, angular velocities, and angular accelerations at the end of the robotic arm.
[0037] S106: Construct a coupled motion disturbance model of the hull and robotic arm, and calculate the disturbance amplitude. ΔD th The value ranges from 0.08 rad / s to 0.12 rad / s. Optionally, ΔD th The values are 0.08 rad / s, 0.1 rad / s, 0.11 rad / s, or 0.12 rad / s.
[0038] Based on this, when >Perturbation threshold ΔD th For example, to illustrate that the ship is rocking violently, it is necessary to enhance the global search capability and path robustness of particles. In step S302, when k <K max / 2 o'clock, =2.8-3.0, when k≥K max / 2 o'clock, =1.3-1.5, to avoid particles getting trapped in local optima due to drastic environmental changes. When ≤ Disturbance threshold ΔD th The ship's swaying was gentle, when k <K max / 2 o'clock, =2.5-2.8, when k≥K max / 2 o'clock, =1.0-1.3, focusing on path accuracy and efficiency optimization.
[0039] In some embodiments, combined with Figure 5 The S200 specifically includes: S210: Collects 3D point cloud data of the ship's hull surface using lidar.
[0040] S220: Preprocess the 3D point cloud data. Specifically, the preprocessing includes Gaussian filtering for noise reduction, Euclidean clustering for segmentation, and removal of background noise points.
[0041] S230: Reconstruct the polyhedral boundary model of the obstacle using the PCL (Point Cloud Library) point cloud processing library, and generate the planar equation for each obstacle face. Let i = 1, 2, ..., n, where n is the number of obstacle faces. Using a polyhedral boundary model, compared to a circular envelope, more accurately recreates the actual geometric contours of the obstacles. Furthermore, the industrial-grade open-source library includes built-in interfaces for polyhedral reconstruction and plane fitting, eliminating the need to develop algorithms from scratch and reducing the cost of technology implementation.
[0042] S240: Constraints for Constructing the Obstacle Region During the particle swarm optimization iteration, it can directly determine whether the particle position (end-effector pose) has entered the obstacle region, thus avoiding ineffective particle searches within the obstacle region.
[0043] It is understood that in other embodiments, step S230 is changed to: combining Figure 3 The obstacle model is established using the circular envelope method, where (x0, y0, z0) are the coordinates of the obstacle center, and r is the radius of the obstacle. The obstacle region formed by the obstacle on the ship's surface in space is: γ is the safety margin. In one possible example, the obstacle is a hull edge (coordinates (2.5, 1.8, 3.2)), and its obstacle area is a circular envelope with the obstacle as the center and a radius of r = 0.3m; in another possible example, the obstacle is a shellfish (coordinates (1.2, 2.4, 2.8)), and its obstacle area attachment zone is a circular envelope with the obstacle as the center and a radius of r = 0.15m; in yet another possible example, the obstacle is a weld protrusion (coordinates (3.1, 2.1, 3.5)), and its obstacle area attachment zone is a circular envelope with the obstacle as the center and a radius of r = 0.2m.
[0044] In some embodiments, combined with Figure 6 In step S303, the particle velocity update formula is replaced with: , in, Let be the velocity of the i-th particle in the k-th iteration. This represents the position of the i-th particle in the k-th iteration. β is the pseudo-inverse estimate of the Jacobian matrix of the robotic arm, which can convert the desired end-effector velocity into the optimal joint velocity; β is the Jacobian correction coefficient, which can be set to 0.5~0.8. Optionally, β is 0.5, 0.6, 0.7 or 0.8.
[0045] Jacobi pseudo-inverse correction term ( This allows for simultaneous consideration of the motion limits of the robotic arm joints (such as angular velocity and angular acceleration limits) when updating particle velocity. The Jacobi pseudo-inverse correction term constrains abrupt changes in particle velocity (corresponding to abrupt changes in the robotic arm joint velocity), making particle position updates smoother. The final output globally optimal trajectory, after fifth-order polynomial interpolation, has a small rate of change in joint angular velocity, avoiding impacts on the joint motors due to sudden velocity changes and extending equipment life.
[0046] In some embodiments, combined with Figure 7 Step S300 further includes the following steps: S304: Sorted in descending order of particle fitness value, the top C% are type A particles, whose current path is closer to the global optimum and have higher fitness; the rest are type B particles, with slightly lower fitness, but may have untapped global information.
[0047] S305: When k≤ When the value is / 3, C is 25~35, meaning that type A particles account for 25%~35%, and most particles are type B particles. Prioritize global exploration to allow particles to traverse the ship's working space extensively and avoid getting trapped in local optima too early.
[0048] when / 3 <k≤2* When the value is / 3, C is 45~55, meaning that the ratio of type A particles to type B particles is close to 1:1. This allows type A particles to optimize the high-quality paths they have found and converge toward local refinement, avoiding inefficiency due to overexploration. At the same time, it allows type B particles to continue exploring uncovered areas, supplementing global information, and preventing premature convergence that could lead to missing the optimal solution.
[0049] When k > 2* When the value is / 3, C is 65~75, meaning that the proportion of type A particles is 65%~75%, focusing on optimizing the verified high-quality paths, while only a small number of type B particles are retained for exploration.
[0050] At this point, in step S303, Optionally, The values are 0.2, 0.3, 0.5, or 0.6.
[0051] Formula for updating the velocity of type A particles: This weakens the global optimal g. best The influence of strengthening the individual's optimal p best,i The weights are adjusted to perform local fine-grained optimization, avoiding being swayed by minor fluctuations in the global optimum and improving path accuracy.
[0052] Formula for updating the velocity of type B particles: This weakens the influence of the individual optimal pbest,i and strengthens the weight of the global optimal gbest. Since the path quality of type B particles is relatively low, the focus is on approaching the global optimum, quickly abandoning ineffective exploration directions, and converging towards verified high-quality regions to reduce ineffective iterations. For example, the original path of a type B particle might detour around the shell attachment area; by strengthening the guidance of the global optimum, it can quickly adjust its direction to fit a better detour trajectory.
[0053] In some embodiments, step S300 includes the following steps: S306: For each particle position Feasibility is determined based on the obstacle area: if the minimum safe distance corresponding to the particle... Less than the feasible threshold S feas If it is determined to be infeasible, the offset velocity component is increased. This allows particles to smoothly transition to feasible regions, rather than forcibly jumping, ensuring that the subsequently generated trajectories have no breaks or abrupt changes.
[0054] in, This is the offset coefficient, with a value between 0 and 1. The values are 0.2, 0.3, 0.5, or 0.8. To minimize And satisfy Greater than or equal to the feasible threshold S feas The solution finds the nearest feasible point outside the obstacle area, accurately fitting the obstacle boundary, ensuring that after the particle is offset, it not only escapes the danger zone, but also does not deviate from the optimization direction due to excessive offset.
[0055] Based on this, step S306 directly transforms infeasible particles into feasible particles through a single offset correction, without the need for additional iterations, thus improving the efficiency of a single iteration. It is the closest feasible point outside the obstacle zone. Even after the particle deviates, it is still near the global optimal candidate region. The deviation will not cause the exploration direction to go astray, ensuring that the population as a whole converges to the preset target and improving the iteration convergence speed.
[0056] Specifically, the most recent feasible point The solution can be quickly achieved through the "point-to-polyhedron distance" interface of the PCL point cloud library. Feasible threshold S feas It can be adjusted according to the type of work. For example, it can be set to 0.1m for high-altitude welding and 0.05m for painting.
[0057] In some embodiments, combined with Figure 8 This method also includes the following steps: S600: Performs fifth-order polynomial interpolation on the globally optimal trajectory to eliminate trajectory inflection points and sudden changes in joint angular velocity. The smoothed trajectory parameters are then sent to the robotic arm controller to control the robotic arm to perform the task.
[0058] The globally optimal trajectory, processed by fifth-order polynomial interpolation, exhibits no abrupt changes, preventing end-effector jitter such as spray gun deviation during painting or welding gun wobbling during welding. This meets the high-precision requirements of precision painting on ship surfaces and weld repair, while the smooth trajectory ensures uniform robotic arm movement speed. Optionally, the coefficients of the fifth-order polynomial interpolation can be quickly calculated using the MATLAB / Simulink toolbox without complex programming. The interpolation processing time for a single trajectory is less than 0.05 seconds, without affecting the overall path planning efficiency. The smoothed trajectory parameters can be directly converted to formats supported by industrial control protocols such as EtherCAT and CANopen without additional format conversion, allowing for integration with mainstream robotic arm controllers (such as KUKA, ABB, and domestic brands like Inovance). This results in a short development cycle and low adaptation costs.
[0059] Example 2
[0060] This embodiment provides a path planning method for a robotic arm used on the surface of a ship hull, applied to high-altitude welding operations on a ship hull, including the following steps: S100: Construct the kinematic model of the robotic arm.
[0061] Specifically, this includes: S105: Using an inertial measurement unit to collect coupled motion data between the hull and the robotic arm. Wherein, Δ =0.05rad / s, Δ =0.03rad / s, Δ =0.02rad / s; The welding area is scanned by lidar to obtain 3D point cloud data including weld protrusions and small marine organisms attached; The initial angles of the six-axis robotic arm joints are collected as [0°, 30°, 60°, 0°, 45°, 0°].
[0062] S106: Construct a coupled motion disturbance model of the hull and the robotic arm, and calculate the disturbance amplitude ΔD(k)≈0.062rad / s.
[0063] S200: Collects environmental data of the ship's hull surface, identifies obstacles, and obtains obstacle areas. Specifically, after denoising the 3D point cloud, it reconstructs the boundary models of weld protrusions (polyhedrons, n=5 faces) and marine organisms (polyhedrons, n=4 faces) and generates plane equations.
[0064] S300: Initialize particle swarm optimization algorithm parameters and perform iterative updates.
[0065] Step S300 specifically includes: S301: Initialize particle swarm size N=50, K max =500; For the high-altitude welding scenario, the attention weights are set as α1=0.2, α2=0.2, and α3=0.6.
[0066] S302: When k < 250, When the linear value decreases from 1.2 to 0.7, c1=c2=2.8; when k≥125, As the linear value decreases from 0.7 to 0.3, c1=c2=1.2.
[0067] S303: The particle velocity update formula is: , The particle position update formula is: , , The value is 0.3.
[0068] S400: Construct a multi-objective fitness function that integrates attention weights to evaluate the fitness of each particle. Wherein, L... max =5m, E max =100J,S max =10mm, =0.2、 =0.2、 =0.6.
[0069] S500: The globally optimal fitness value satisfies the convergence threshold after 5 consecutive iterations, and the globally optimal trajectory is output (participating in...). Figure 9 ).
[0070] Example 3
[0071] Combination Figure 10 This application provides a path planning device for a robotic arm on a ship's hull surface, the device comprising: Motion modeling module 21 is used to build the kinematic model of the robotic arm.
[0072] The environmental perception module 22 is used to collect environmental data on the surface of the ship, identify obstacles, and obtain the obstacle area.
[0073] Particle swarm optimization module 23 is used to initialize the particle swarm optimization algorithm parameters and perform iterative updates, specifically including: Population initialization unit 231 is used to set the population size N, the number of iterations k, and the maximum number of iterations K. max Initial value of inertial weight ω max =1.2、ω min =0.3, intermediate threshold ω mid =0.7, initial range of learning factor Initialize particle position x i (0) and velocity v i (0).
[0074] Factor update unit 232, used when k <K max When / 2, the inertia weight update formula is: Learning factor =2.5-3.0; when k≥K max When / 2, the inertia weight update formula is: Learning factor =1.0-1.5. Based on this, in the early stages of iteration, a large inertia weight is linearly reduced from 1.2 to 0.7, and a large learning factor of 2.5-3.0 is used to enhance the global search capability of the particles. At this time, the particles are more inclined to jump out of the initial region and extensively traverse the complex working space on the hull surface (such as areas with dense obstacles and curved working areas), avoiding getting trapped in local optima too early. In the later stages of iteration, the inertia weight is linearly reduced from 0.7 to 0.3, and the learning factor is switched to a small value of 1.0-1.5 to focus on local fine-grained optimization. Within the global optimal candidate region found in the early stages of iteration, the particles slowly adjust their positions and accurately discover the optimal path, avoiding missing the optimal solution due to excessive search amplitude.
[0075] Particle velocity and position update unit 233 is used to update particle velocity using the following formula: ;in, , The result is a uniformly random number in the range [0,1]. Let be the optimal position for the i-th particle. The optimal position for the population; and the position for updating particles using the following formula: .
[0076] The multi-objective fitness function module 24 is used to construct a multi-objective fitness function that incorporates attention weights to evaluate the fitness of each particle. .
[0077] Where: path length weight Energy consumption weight Obstacle avoidance safety weight all ,and + + =1; For particles The corresponding path length, It is 1.2 times the maximum working range of the robotic arm; For path energy consumption; For the robotic arm to operate at full load K max The upper limit of energy consumption for the next iteration; This represents the minimum safe distance between the particle and the boundary of the obstacle region. This is the threshold for safe distance during ship operations.
[0078] Path output module 25 is used to output the current iteration number k= If the global optimal fitness value satisfies the convergence threshold after H consecutive iterations, the global optimal trajectory is output.
[0079] In some embodiments, the motion modeling module 21 includes a static coordinate system unit, a pose transformation unit, a homogeneous coordinate unit, and a motion model unit. The static coordinate system unit is used to construct a static coordinate system O-xyz, and the pose transformation unit is used to represent the pose of the robotic arm's end effector in the static coordinate system O-xyz using a rotation matrix. The rotation matrix is as follows:
[0080] The homogeneous coordinate element is used to generate the homogeneous coordinate form of the robot arm position, which is [xyzw]. T The homogeneous transformation matrix G of the robotic arm position is synthesized from the attitude matrix R (obtained from step S102) and the position matrix P, as follows:
[0081] Rotate the coordinate axes x, y, z The rotation matrix of the homogeneous transformation matrix G is as follows:
[0082] The motion model unit is used to establish the motion model of the robotic arm's end effector. Specifically:
[0083] The angular displacements of the coordinate axes of the multi-degree-of-freedom robotic arm are respectively , , , These represent the rotational angular velocities of the robotic arm around the three coordinate axes. , , These are the included angles of the three coordinate axes.
[0084] In some embodiments, the motion modeling module 21 includes a coupled motion data acquisition unit and a disturbance model unit. The coupled motion data acquisition unit acquires hull-manipulator coupled motion data via an inertial measurement unit (IMU), including the change in angular velocity Δ of the hull or manipulator base. Δ Δ ; Change in included angle Δ Δ Δ The disturbance model element is used to construct the hull-robotic arm coupled motion disturbance model and calculate the disturbance amplitude. .
[0085] At this time, when >Perturbation threshold ΔDth Factor update unit 232 in k <K max / 2 o'clock, =2.8-3.0; in k≥K max / 2 o'clock, =1.3-1.5. This avoids particles getting trapped in local optima due to drastic environmental changes. When ≤ Disturbance threshold ΔD th Factor update unit 232 in k <K max / 2 o'clock, =2.5-2.8, when k≥K max / 2 o'clock, =1.0-1.3.
[0086] Example 3 includes any of the technical solutions in Example 1, which will not be described again here.
[0087] Example 4
[0088] Combination Figure 11 This application provides an electronic device 1, including a memory 11, a processor 10, and a computer program 12 stored in the memory 11 and executable on the processor 10. When the processor 10 executes the computer program 12, it implements any of the hull surface robotic arm path planning methods in Embodiment 1.
[0089] For example, the computer program 12 may be divided into one or more units, which are stored in the memory 11 and executed by the processor 10 to complete the present application. The one or more units may be a series of computer program instruction segments capable of performing a specific function, which describe the execution process of the computer program 12 in the electronic device 1.
[0090] The electronic device 1 can be any electronic device with control functions. The electronic device 1 may include, but is not limited to, a processor 10 and a memory 11. Those skilled in the art will understand that... Figure 11 This is merely an example of electronic device 1 and does not constitute a limitation on electronic device 1. It may include more or fewer components than shown, or combine certain components, or different components. For example, electronic device 1 may also include input / output devices, network access devices, buses, etc.
[0091] The processor 10 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor.
[0092] The memory 11 can be an internal storage unit of the electronic device 1, such as a hard disk or RAM. The memory 11 can also be an external storage device of the electronic device 1, such as a plug-in hard disk, Smart Media Card (SMC), Secure Digital (SD) card, or Flash Card. Furthermore, the memory 11 can include both internal and external storage units of the electronic device 1. The memory 11 is used to store the computer program and other programs and data required by the terminal device. The memory 11 can also be used to temporarily store data that has been output or will be output.
[0093] Example 5
[0094] This application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program that, when executed by a processor, implements a robotic arm path planning method for a ship's hull surface as described in Embodiment 1.
[0095] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be performed by instructions, or by instructions controlling related hardware. These instructions can be stored in a computer-readable storage medium and loaded and executed by a processor.
[0096] The computer-readable storage medium may include: read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.
[0097] Since the instructions stored in the computer-readable storage medium can execute the steps in any of the path planning methods for a robotic arm on the hull surface provided in the embodiments of this application, the beneficial effects that any of the path planning methods for a robotic arm on the hull surface provided in the embodiments of this application can achieve can be realized, as detailed in the preceding embodiments, and will not be repeated here.
[0098] Example 6
[0099] This application also provides a computer program product, including a computer program. When executed by a processor, the computer program implements the steps in the path planning method for a robotic arm on the hull surface according to any one of the embodiments. The computer program includes computer program code, which may be in the form of source code, object code, executable file, or some intermediate form.
[0100] In the above five embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0101] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0102] In the embodiments provided in this application, it should be understood that the disclosed devices / terminal equipment and methods can be implemented in other ways. For example, the device / terminal equipment embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
[0103] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment, depending on actual needs.
[0104] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0105] If an integrated module / unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. A computer-readable medium may include: any entity or device capable of carrying computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content included in a computer-readable medium can be appropriately added to or subtracted according to the requirements of legislation and patent practice in a jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electrical carrier signals and telecommunication signals.
[0106] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0107] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for path planning of a robotic arm on the surface of a ship's hull, characterized in that, Includes the following steps: S100: Constructing the kinematic model of the robotic arm; S200: Collects environmental data on the ship's surface, identifies obstacles, and determines the obstacle area; S300: Initializes the particle swarm optimization algorithm parameters and performs iterative updates, specifically including: S301: Set the population size N, the number of iterations k, and the maximum number of iterations K. max Initial value of inertial weight ω max =1.2、ω min =0.3, intermediate threshold ω mid =0.7, initial range of learning factor Initialize particle position x i (0) and velocity v i (0); S302: When k <K max When / 2, the inertia weight update formula is: Learning factor =2.5-3.0; When k≥K max When / 2, the inertia weight update formula is: Learning factor =1.0-1.5; S303: The particle velocity update formula is: ;in, , The result is a uniformly random number in the range [0,1]. Let be the optimal position for the i-th particle. The optimal position for the entire population; The particle position update formula is: ; S400: Construct a multi-objective fitness function that integrates attention weights to evaluate the fitness of each particle. Wherein: path length weight Energy consumption weight Obstacle avoidance safety weight all ,and + + =1; For particles The corresponding path length, It is 1.1 to 1.5 times the maximum working range of the robotic arm; For path energy consumption; For the robotic arm to operate at full load K max The upper limit of energy consumption for the next iteration; This is the minimum safe distance from the particle to the boundary of the barrier region. This refers to the safe distance threshold for operations on the ship's hull. S500: If the iteration number k= If the global optimal fitness value satisfies the convergence threshold after H consecutive iterations, then the global optimal trajectory is output.
2. The method for path planning of a robotic arm on the hull surface according to claim 1, characterized in that, In step S303, the particle velocity update formula is replaced with: , in, Let be the velocity of the i-th particle in the k-th iteration. Let i be the position of the i-th particle in the k-th iteration. β is the pseudo-inverse estimate of the Jacobian matrix of the robotic arm, and β is the Jacobian correction coefficient.
3. The method for path planning of a robotic arm on the hull surface according to claim 1, characterized in that, Step S300 also includes the following steps: S304: Sorted in descending order of particle fitness value, the first C% are type A particles, and the rest are type B particles; S305: When k≤ When / 3, C takes values from 25 to 35; when / 3 <k≤2* When k > 2, C takes values from 45 to 55; When / 3, C takes values from 65 to 75; In step S303, the velocity update formula for type A particles is as follows: Type B particle velocity update formula: ;in, To explore and develop a balance coefficient.
4. The method for path planning of a robotic arm on the hull surface according to claim 1, characterized in that, Step S300 includes the following steps: S306: For each particle position Feasibility is determined based on the obstacle area: if the minimum safe distance corresponding to the particle... If the value is less than the feasible threshold, it is determined to be infeasible, and the offset velocity component is increased. , This is the offset coefficient. To minimize And satisfy If the value is greater than or equal to the feasible threshold, the nearest feasible point outside the obstacle region is obtained.
5. The method for path planning of a robotic arm on the hull surface according to claim 1, characterized in that, S200 specifically includes: S210: Collects 3D point cloud data of the ship's hull surface using lidar; S220: Preprocess the 3D point cloud data; S230: Reconstruct the polyhedral boundary model of the obstacle using the PCL point cloud processing library, and generate the planar equation for each obstacle face. i = 1, 2, ..., n, where n is the number of obstacle surfaces; S240: Constraints for Constructing the Obstacle Region .
6. The method for path planning of a robotic arm on a ship's hull surface according to any one of claims 1 to 5, characterized in that, The method further includes the following steps: S600: Perform fifth-order polynomial interpolation on the global optimal trajectory to eliminate trajectory inflection points and sudden changes in joint angular velocity; send the smoothed trajectory parameters to the robotic arm controller to control the robotic arm to perform the operation.
7. A robotic arm path planning device for ship hull surface, characterized in that, The device includes: The motion modeling module is used to build the kinematic model of the robotic arm; The environmental perception module is used to collect environmental data on the surface of the ship, identify obstacles, and determine the obstacle area. The particle swarm optimization module is used to initialize the particle swarm optimization algorithm parameters and perform iterative updates, specifically including: The initial unit of the population is used to set the population size N, the number of iterations k, and the maximum number of iterations K. max Initial value of inertial weight ω max =1.2、ω min =0.3, intermediate threshold ω mid =0.7, initial range of learning factor Initialize particle position x i (0) and velocity v i (0); Factor update unit, used when k <K max When / 2, the inertia weight update formula is: Learning factor =2.5-3.0; when k≥K max When / 2, the inertia weight update formula is: Learning factor =1.0-1.5; The particle velocity-position update unit is used to update the particle velocity using the following formula: ;in, , The result is a uniformly random number in the range [0,1]. Let be the optimal position for the i-th particle. The optimal position for the population; and the position for updating particles using the following formula: ; The multi-objective fitness function module is used to construct a multi-objective fitness function that incorporates attention weights, and to evaluate the fitness of each particle. Wherein: path length weight Energy consumption weight Obstacle avoidance safety weight all ,and + + =1; For particles The corresponding path length, It is 1.1 to 1.5 times the maximum working range of the robotic arm; For path energy consumption; For the robotic arm to operate at full load K max The upper limit of energy consumption for the next iteration; This is the minimum safe distance from the particle to the boundary of the barrier region. This refers to the safe distance threshold for operations on the ship's hull. The path output module is used to output the path at the current iteration number k= If the global optimal fitness value satisfies the convergence threshold after H consecutive iterations, the global optimal trajectory is output.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the hull surface robotic arm path planning method as described in any one of claims 1 to 6.
9. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the path planning method for a robotic arm on the hull surface as described in any one of claims 1 to 6.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the steps in the method for planning the path of a robotic arm on the hull surface as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Mechanical arm track optimization obtaining method based on improved multi-target PSO algorithm
CN116352697A