Die casting robot micro-spraying path planning and control method and system
By extracting the workpiece's 3D data and generating the optimal spraying path using the ant colony algorithm, the problem of unstable spraying quality on complex workpiece surfaces was solved, enabling efficient and smooth spraying of the die-casting robot, thus improving production efficiency and equipment lifespan.
Patent Information
- Application Number
- CN202511517360.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-23
- Publication Date
- 2026-01-20
- Estimated Expiration
- 2045-10-23
AI Technical Summary
Existing die-casting robot micro-spraying technology lacks effective feature extraction and accessibility analysis when processing complex workpiece surfaces, resulting in unstable spraying quality. Furthermore, traditional path planning algorithms lack dynamic adaptability, making it difficult to achieve optimal path planning and smooth trajectory transition, thus affecting spraying quality and production efficiency.
By acquiring the 3D data of the workpiece, extracting feature point information and calculating the reachability of spraying, the ant colony algorithm is used for path planning. Combined with the adaptive pheromone update strategy and trajectory interpolation method, the optimal spraying path sequence is generated, and the transition region between trajectory points is constructed. Combined with robot joint acceleration constraints, the continuous and smooth transition of the trajectory is achieved.
It enables efficient generation of spraying paths for complex curved workpieces, improves spraying uniformity and quality stability, reduces robot vibration and impact during the spraying process, increases spraying efficiency, and extends equipment life.
Smart Images

Figure CN120985677B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of path planning, in particular to a die casting robot micro-spraying path planning and control method and system. BACKGROUND
[0002] Die casting robot micro-spraying technology has a wide range of applications in the fields of automobile manufacturing, electronic product housings, and metal part processing. By precisely controlling the spraying path and parameters, die casting robots can achieve uniform coating on the workpiece surface, improving product quality and production efficiency. Traditional die casting robot micro-spraying technology mainly relies on manual programming or simple algorithm to plan the spraying path, and the operator sets the spraying parameters and trajectory based on experience. With the improvement of industrial automation level, automatic path planning technology based on three-dimensional data has gradually attracted attention, and the spraying path is automatically generated by computer-aided systems to reduce human intervention and improve production efficiency and product quality consistency. Currently, die casting robot micro-spraying technology has developed from simple linear spraying to three-dimensional spraying suitable for complex workpiece surfaces, and various optimization algorithms such as genetic algorithm and ant colony algorithm have been introduced into path planning to improve spraying effect.
[0003] The prior art lacks effective feature extraction and reachability analysis methods when dealing with complex workpiece surface features, resulting in unstable spraying quality in complex curved surfaces and narrow areas, especially for workpieces with variable curvature and edge features, which cannot accurately identify and reasonably plan the spraying path, causing uneven coating thickness or missed spraying phenomenon.
[0004] Traditional path planning algorithms lack dynamic adaptability, and when faced with workpieces of different shapes and sizes, manual adjustment of algorithm parameters is often required, the algorithm converges slowly and is prone to local optimal solution, making it difficult to achieve optimal path planning while ensuring spraying quality, reducing production efficiency and resource utilization.
[0005] The existing robot trajectory control method is not smooth in the transition between trajectory points, usually using simple linear interpolation or fixed parameter curve interpolation, which cannot be adaptively adjusted according to the workpiece features and robot dynamics characteristics, resulting in speed mutation, jitter or pause of the robot during spraying task execution, affecting the spraying quality and robot service life. SUMMARY
[0006] The die casting robot micro-spraying path planning and control method and system provided by the embodiments of the present application can solve the problems in the prior art.
[0007] In a first aspect of the embodiments of the present application, a die casting robot micro-spraying path planning and control method is provided, comprising:
[0008] acquire three-dimensional data of a workpiece to be sprayed, extract feature point information of a surface of the workpiece based on the three-dimensional data, and calculate spray accessibility data of the surface of the workpiece according to the feature point information;
[0009] According to the feature point information and the spray accessibility data, an ant colony algorithm is used for spray path planning, an adaptive pheromone update strategy is used to dynamically adjust path search weights, and an optimal spray path sequence meeting spray quality requirements is generated;
[0010] According to the optimal spray path sequence and the spray accessibility data, motion trajectory points and corresponding joint angle data of the die casting robot are calculated; for the motion trajectory points and the joint angle data, a trajectory interpolation method is used to construct a transition region between the trajectory points, an optimal transition curve is calculated according to the positions and postures of adjacent trajectory points, a trajectory smoothness evaluation index is constructed in combination with robot joint acceleration constraints, and the spatial distribution and time parameters of the trajectory points are optimized through iterative calculation, so as to realize continuous and smooth transition of the trajectory;
[0011] Based on the motion trajectory points and the joint angle data after smooth transition, the die casting robot is controlled to perform a spraying operation, and spraying process parameters are collected in real time.
[0012] Based on the three-dimensional data, feature point information of the surface of the workpiece is extracted, and spray accessibility data of the surface of the workpiece is calculated according to the feature point information, including:
[0013] Based on the three-dimensional data, a multi-scale feature hierarchy is constructed, and feature point information of the surface of the workpiece is extracted from the three-dimensional data; based on the multi-scale feature hierarchy, the feature point information is processed hierarchically, shape, texture, surface geometry attributes of the feature points are extracted, and corresponding weight coefficients are assigned to the shape, texture, surface geometry attributes according to the importance of features at each level;
[0014] According to the weight coefficients, the shape, texture, surface geometry attributes are adaptively fused to generate a comprehensive feature description of the feature points; based on the comprehensive feature description, a local coordinate system is established for the feature points, a neighborhood point set of the feature points is acquired, and normal vector information of the feature points is obtained by calculating the vector cross product between adjacent points in the neighborhood point set;
[0015] According to the normal vector information of the feature points, a spray posture space containing position coordinates and attitude angles is constructed, and an accessibility scoring function is constructed based on the spray posture space; the distance factor, the attitude factor and the collision factor of the feature points are substituted into the accessibility scoring function, and the accessibility score of the feature points is obtained by weighted calculation according to the corresponding weight coefficients assigned according to the influence degree of each factor;
[0016] The accessibility score of a single feature point is calculated based on the accessibility score function, and the spraying accessibility data of the workpiece surface is generated by weighting and accumulating the feature points in the region with the accessibility score, wherein the accessibility score function adopts a linear weighting form, which can ensure the consistency and additivity of the scoring standard.
[0017] The spraying path planning is performed by using the ant colony algorithm, the path search weight is dynamically adjusted by using the adaptive pheromone update strategy, and the optimal spraying path sequence meeting the spraying quality requirement is generated, including:
[0018] A set of grid nodes and a set of feasible paths are established on the surface of the workpiece to form a search space, the path length between nodes in the set of grid nodes and the spraying quality at the nodes are respectively assigned to the path quality weight coefficient to construct a search objective function;
[0019] The ant colony size corresponding to the current iteration number is calculated based on the search objective function, and a search ant equal in number to the ant colony size is set in the search space;
[0020] The pheromone concentration, heuristic information and path direction factor in the search space are respectively assigned to the navigation weight ratio to calculate the state transition probability, and the search ant is guided to select the next grid node sequence in each iteration cycle based on the state transition probability;
[0021] The local pheromone update is performed on the grid node sequence selected by the search ant, and the global update coefficient is calculated according to the iteration cycle, and the pheromone concentration of the optimal path in the grid node sequence is increased by using the global update coefficient;
[0022] The optimization evaluation value of the path is calculated based on the pheromone concentration of the optimal path, the pheromone update amount of the next iteration cycle is adjusted according to the optimization evaluation value, the pheromone concentration of the high-quality path is continuously enhanced through multiple rounds of iteration optimization, and the optimal spraying path sequence meeting the spraying quality requirement is obtained.
[0023] The pheromone concentration, heuristic information and path direction factor in the search space are respectively assigned to the navigation weight ratio to calculate the state transition probability, including:
[0024] The pheromone concentration, heuristic information and path direction factor in the search space are respectively assigned to the navigation weight coefficient to construct the basic state transition probability;
[0025] The prediction compensation amount is calculated based on the difference between the prediction probability value and the basic state transition probability according to the historical search trajectory of the path selection in the previous steps, and the navigation weight coefficient is optimized by using the prediction compensation amount;
[0026] Re-calculate the pheromone concentration, heuristic information and state transition probability of the path direction factor according to the optimized navigation weight coefficient.
[0027] Calculate the motion trajectory points and corresponding joint angle data of the die casting robot, and construct the transition region between the trajectory points by using a trajectory interpolation method for the motion trajectory points and the joint angle data, including:
[0028] Sample the workspace of the die casting robot to obtain a motion trajectory point sequence, and obtain the joint angle data corresponding to the motion trajectory point sequence through inverse kinematics solving;
[0029] Establish the motion trajectory point sequence, joint angle data, joint speed data and joint acceleration data in the historical execution trajectory of the die casting robot as a trajectory database, calculate the similarity of the motion trajectory point sequence and historical trajectory according to the historical trajectory data in the trajectory database, and select the historical trajectory with the highest similarity from the trajectory database as a reference trajectory based on the similarity;
[0030] Calculate a predicted compensation based on the reference trajectory according to the current joint angle, current joint speed and current joint acceleration of the die casting robot, superimpose the predicted compensation to the motion trajectory point sequence to obtain an optimized motion trajectory point sequence;
[0031] For adjacent trajectory points in the optimized motion trajectory point sequence, a quintic polynomial interpolation method is used to construct the transition region between the trajectory points.
[0032] Obtaining the joint angle data corresponding to the motion trajectory point sequence through inverse kinematics solving includes:
[0033] Obtain a motion trajectory point sequence of a die casting robot, construct an end effector pose matrix according to the motion joint parameters of the die casting robot, input the motion trajectory point sequence into the end effector pose matrix, and calculate the wrist point position corresponding to each trajectory point by using a geometric decoupling method, and solve the first three-axis joint angles corresponding to each trajectory point based on the wrist point position by using a trigonometric function relationship;
[0034] Coordinate transform the first three-axis joint angles and the attitude component of the end effector pose matrix to solve the last three-axis joint angles corresponding to each trajectory point, and obtain the complete joint angles composed of the first three-axis joint angles and the last three-axis joint angles;
[0035] Obtain the current joint angle of the die casting robot, calculate the weighted sum of squares between the complete joint angle and the current joint angle to obtain an evaluation index, select the complete joint angle that minimizes the evaluation index as the optimal solution joint angle, and take the optimal solution joint angle as the joint angle data corresponding to the motion trajectory point sequence.
[0036] According to the position and pose of adjacent trajectory points, an optimal transition curve is calculated, and a trajectory smoothness evaluation index is constructed in combination with robot joint acceleration constraints, including:
[0037] According to the position and pose of adjacent trajectory points, a virtual stress field inversely proportional to the distance from the obstacle is constructed in the robot workspace, and a quintic polynomial transition curve is constructed based on the position and the pose;
[0038] The position, velocity and acceleration of the adjacent trajectory points are substituted into the quintic polynomial transition curve as boundary constraint conditions, the integral of the virtual stress field on the quintic polynomial transition curve is taken as a stress field constraint condition, and a transition curve satisfying the constraint is obtained through the stress field constraint condition;
[0039] A mapping relationship between the transition curve and the robot joint motion is established through the virtual stress field, the maximum allowable acceleration of each joint of the robot is obtained, the mapping relationship is combined with the maximum allowable acceleration to establish a joint acceleration constraint, and a trajectory smoothness evaluation index is constructed based on the transition curve according to the joint acceleration constraint.
[0040] In a second aspect of the embodiment of the present application, a die casting robot micro-spraying path planning and control system is provided, including:
[0041] A first unit is configured to obtain three-dimensional data of a workpiece to be sprayed, extract feature point information of a workpiece surface based on the three-dimensional data, and calculate spraying accessibility data of the workpiece surface according to the feature point information;
[0042] A second unit is configured to perform spraying path planning by using an ant colony algorithm according to the feature point information and the spraying accessibility data, dynamically adjust path search weights by using an adaptive pheromone update strategy, and generate an optimal spraying path sequence meeting spraying quality requirements;
[0043] A third unit is configured to calculate motion trajectory points and corresponding joint angle data of a die casting robot according to the optimal spraying path sequence and the spraying accessibility data, construct a transition area between trajectory points by using a trajectory interpolation method for the motion trajectory points and the joint angle data, calculate an optimal transition curve according to the position and pose of adjacent trajectory points, construct a trajectory smoothness evaluation index in combination with robot joint acceleration constraints, and optimize the spatial distribution and time parameters of the trajectory points through iterative calculation to realize continuous and smooth transition of the trajectory.
[0044] The fourth unit is configured to control the die casting robot to perform a spraying operation based on the smoothed motion trajectory points and the joint angle data, and collect spraying process parameters in real time.
[0045] The beneficial effects of the present application are as follows:
[0046] The present application realizes efficient spraying path generation for complex curved surface workpieces by acquiring three-dimensional data of a workpiece to be sprayed and extracting feature point information, calculating spraying accessibility data, and combining an ant colony algorithm for path planning, thereby improving spraying uniformity and quality stability.
[0047] The present application dynamically adjusts path search weights by using an adaptive pheromone update strategy, and constructs a transition area between trajectory points by using a trajectory interpolation method, calculates an optimal transition curve, so that the motion trajectory of the die casting robot is smoother and more continuous, effectively reducing shaking and impact of the robot during spraying, and prolonging the service life of the equipment.
[0048] The present application combines robot joint acceleration constraints to construct a trajectory smoothness evaluation index, and optimizes the spatial distribution and time parameters of the trajectory points through iterative calculation, realizes continuous and smooth transition of the trajectory, greatly improves spraying efficiency, reduces paint waste, and realizes intelligent and precise control of die casting workpiece surface treatment. BRIEF DESCRIPTION OF DRAWINGS
[0049] Figure 1 FIG. 1 is a flowchart of a die casting robot micro-spraying path planning and control method according to an embodiment of the present application;
[0050] Figure 2 FIG. 2 is a complete flowchart of calculating workpiece surface spraying accessibility data based on three-dimensional data according to an embodiment of the present application;
[0051] Figure 3 FIG. 3 is a die casting robot inverse kinematics solving and optimization flowchart according to an embodiment of the present application. DETAILED DESCRIPTION
[0052] To make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative labor fall within the scope of protection of the present application.
[0053] The technical solutions of the present application are described in detail below with specific examples. The following specific examples can be combined with each other, and the same or similar concepts or processes may not be described in detail in some examples.
[0054] Figure 1 The flowchart of the method for planning and controlling the micro-spraying path of the die casting robot according to an embodiment of the present application is shown in FIG. 1, which comprises the following steps: Figure 1
[0055] Three-dimensional data of a workpiece to be sprayed is acquired, and feature point information of the surface of the workpiece is extracted based on the three-dimensional data, and spray accessibility data of the surface of the workpiece is calculated according to the feature point information;
[0056] An ant colony algorithm is used to plan a spraying path according to the feature point information and the spray accessibility data, an adaptive pheromone update strategy is used to dynamically adjust the path search weight, and an optimal spraying path sequence meeting the spraying quality requirements is generated;
[0057] According to the optimal spraying path sequence and the spray accessibility data, motion trajectory points and corresponding joint angle data of the die casting robot are calculated; a trajectory interpolation method is used to construct a transition region between the trajectory points according to the motion trajectory points and the joint angle data, an optimal transition curve is calculated according to the positions and postures of adjacent trajectory points, a trajectory smoothness evaluation index is constructed in combination with the joint acceleration constraint of the robot, and the spatial distribution and time parameters of the trajectory points are optimized through iterative calculation to realize continuous and smooth transition of the trajectory;
[0058] Based on the motion trajectory points and the joint angle data after smooth transition, the die casting robot is controlled to perform a spraying operation, and spraying process parameters are collected in real time.
[0059] In an optional embodiment, extracting feature point information of the surface of the workpiece based on the three-dimensional data and calculating spray accessibility data of the surface of the workpiece according to the feature point information comprises:
[0060] A multi-scale feature hierarchy is constructed based on the three-dimensional data, and feature point information of the surface of the workpiece is extracted from the three-dimensional data; the feature point information is processed hierarchically based on the multi-scale feature hierarchy, shape, texture, surface geometry attributes of the feature points are extracted, and the shape, texture, surface geometry attributes are assigned with corresponding weight coefficients according to the importance of features at different levels;
[0061] Adaptively fusing the shape texture surface geometry attributes according to the weight coefficients to generate a comprehensive feature description of the feature point; establishing a local coordinate system for the feature point based on the comprehensive feature description, obtaining a neighborhood point set of the feature point, and obtaining normal vector information of the feature point by calculating the vector cross product between adjacent points in the neighborhood point set;
[0062] According to the normal vector information of the feature point, a spraying posture space containing position coordinates and attitude angles is constructed, and an accessibility scoring function is constructed based on the spraying posture space; the distance factor, the attitude factor and the collision factor of the feature point are substituted into the accessibility scoring function, and corresponding weight coefficients are assigned according to the influence degree of each factor for weighted calculation to obtain the accessibility score of the feature point.
[0063] Based on the accessibility scoring function, the accessibility score of a single feature point is calculated, and by weighted accumulation of the feature points in the region with the accessibility score, spraying accessibility data of the workpiece surface can be generated, wherein the accessibility scoring function adopts a linear weighting form, which can ensure the consistency and additivity of the scoring standard.
[0064] As shown in Figure 2 The method comprises:
[0065] Based on three-dimensional data, a multi-scale feature hierarchy is constructed, and multi-level resolution processing is performed on the three-dimensional point cloud data of the workpiece. The three-dimensional data is usually obtained by a laser scanner or a structured light camera, and represents the geometric shape of the workpiece surface in the form of a point cloud. The multi-scale feature hierarchy is constructed by different degrees of downsampling of the original point cloud, and usually contains 3 to 5 levels. The first level retains all the information of the original point cloud; the second level performs voxelization processing on the original point cloud, and the voxel size is set to 5mm×5mm×5mm. The points falling within the same voxel are combined into one point, and the number of point clouds is reduced to about 100,000 points; the voxel size of the third level is set to 10mm×10mm×10mm, and the number of point clouds is further reduced to about 25,000 points; the voxel size of the fourth level is set to 20mm×20mm×20mm, and the number of point clouds is reduced to about 6,000 points. The point cloud resolution of different levels corresponds to features of different scales. Low-level point clouds are used to extract detailed features, and high-level point clouds are used to extract macro features.
[0066] Feature points on the workpiece surface are extracted from the three-dimensional data. A feature point detection algorithm is applied to the point cloud data. A feature point refers to a point on the workpiece surface that has a significant geometric characteristic. Principal component analysis is used for feature point extraction. The covariance matrix is calculated for the local neighborhood of each point, which typically includes 30 nearest neighbor points within a 10 mm range around the point. Then, the eigenvalues of the matrix are analyzed. These feature response values are calculated for each point, and feature points are selected based on pre-set thresholds, such as a flatness less than 0.05, a linear feature greater than 0.6, or a sphericity greater than 0.8. For an engine cover workpiece, about 5,000 feature points are extracted, which are mainly distributed on the edges, concave-convex structures, and areas with obvious curvature changes of the engine cover.
[0067] The feature point information is processed hierarchically based on a multi-scale feature hierarchy. Feature points are extracted on each level of the point cloud, and a correspondence relationship between levels is established. For each level, the feature point set for that level is obtained using the feature point extraction method described above. Then, for each feature point at a high level (low resolution), its corresponding feature point group is found in a low level (high resolution). This hierarchical processing allows gradual refinement of feature description from macro to micro, forming a hierarchical representation of feature points.
[0068] The shape texture surface geometry attributes of the feature points are extracted, which mathematically describe the local geometric shape of the feature points. Shape texture surface geometry attributes refer to the shape characteristics (such as planes, edges, and corner points), surface texture characteristics (such as roughness and directionality), and surface attributes (such as color and material) of the region where the point is located. For shape characteristics, local curvature, principal curvature direction, and shape index are calculated. For surface attributes, if there is color information, RGB or grayscale values can be extracted; if there is material information, reflectivity or absorbance can be extracted. These shape texture surface geometry attributes together form a complete description of the feature points.
[0069] According to the importance of features at each level, corresponding weight coefficients are assigned to the shape texture surface geometry attributes. The influence of different level features on spray accessibility is considered. Features at a low level (high resolution) have a greater impact on local accessibility, while features at a high level (low resolution) have a greater impact on global accessibility. Therefore, weights can be assigned according to the specific requirements of the spraying task. This weight assignment strategy allows flexible adjustment of the importance of features at different scales to adapt to different spraying needs.
[0070] According to the weight coefficients, the shape texture surface geometry attributes are adaptively fused by weight, and the feature information of different levels is fused into comprehensive features according to the weight. For each feature point, the shape texture surface geometry attributes in each level are collected, and then weighted summation is performed according to the corresponding weight coefficients. Similarly, for shape index, roughness, anisotropy and other shape texture surface geometry attributes, similar weighted fusion is also performed to obtain the comprehensive shape texture surface geometry attributes of each feature point.
[0071] The comprehensive feature description of the feature point is generated, and the shape texture surface geometry attributes after weighted fusion are organized into a unified feature vector. The feature vector usually includes three parts of geometric features, texture features and surface attributes. The geometric feature part includes average curvature, Gaussian curvature, shape index and the like; the texture feature part includes roughness, anisotropy and the like; and the surface attribute part includes color, reflectivity and the like. Such comprehensive feature description comprehensively captures the geometric and physical attributes of the feature point, and provides a basis for subsequent spray accessibility evaluation.
[0072] A local coordinate system is established for the feature point based on the comprehensive feature description. A coordinate system related to the surface shape is determined by using the geometric characteristics of the feature point. The z-axis of the local coordinate system is usually defined as the direction of the surface normal vector, and the x-axis and y-axis are defined on the tangent plane. For each feature point, first, its neighborhood (such as the point set in a spherical region with a radius of 15 mm) is determined, and then principal component analysis is applied to the neighborhood point set to obtain three orthogonal principal directions. Usually, the principal direction corresponding to the smallest eigenvalue is taken as the z-axis (normal vector), and the principal directions corresponding to the largest and second largest eigenvalues are taken as the x-axis and y-axis, respectively. Such local coordinate system reflects the geometric structure of the region where the feature point is located, and provides a reference for determining the spraying posture.
[0073] The neighborhood point set of the feature point is obtained, and all points within a certain range from the feature point are searched in the original point cloud data. The neighborhood size is usually determined according to the size and complexity of the workpiece. For an engine cover workpiece, it can be set to a spherical region with a radius of 10-20 mm. The k-d tree data structure can be used to efficiently realize neighborhood query.
[0074] The specific implementation process of obtaining the normal vector information of the feature point is to estimate the normal vector by using the geometric relationship of the local surface. For each pair of adjacent points in the neighborhood point set (which can be determined by triangulation or neighborhood relationship), two vectors formed by the points and the feature point are calculated, and then the cross product of the two vectors is calculated to obtain an approximate normal vector. The final normal vector estimate is obtained by weighted averaging of all such normal vectors (the weight can be inversely proportional to the distance from the feature point). In order to ensure the consistency of the normal vector, global optimization of the normal vector is usually required to make the direction of the normal vector of the adjacent points change smoothly.
[0075] According to the normal vector information of the feature points, a spraying pose space containing position coordinates and attitude angles is constructed, and a spraying direction is defined for each feature point. The spraying pose space is a six-dimensional space, including three-dimensional position coordinates of the spraying point and three-dimensional attitude angles of the spraying direction. The position coordinates are directly taken from the coordinates of the feature points, such as (150mm, 200mm, 50mm); the attitude angles are determined based on the normal vector, and the spraying direction should generally maintain a certain angle (such as 20°-30°) with the surface normal vector to ensure the best spraying effect. Therefore, for each feature point, a series of spraying directions can be generated around its normal vector, forming a conical pose space.
[0076] Based on the spraying pose space, an accessibility score function is constructed, and a mathematical model is designed to evaluate the feasibility of the spraying pose. The accessibility score function considers multiple factors: distance factor, attitude factor, and collision factor. The distance factor evaluates whether the distance between the spraying point and the spraying equipment is within the working range of the equipment; the attitude factor evaluates whether the spraying direction is suitable for the surface characteristics; and the collision factor evaluates whether collision occurs during spraying. The value range of the score function is usually 0 to 100, and the higher the score, the better the accessibility.
[0077] The accessibility score function is a comprehensive evaluation model that accepts distance factor, attitude factor, and collision factor as input parameters, calculates the score of each factor respectively, and then combines them by weighting. The distance factor evaluates the optimality of the distance between the spraying point and the equipment through a Gaussian function, the attitude factor evaluates the angle relationship between the spraying direction and the surface normal vector based on a cosine function, and the collision factor evaluates the collision risk based on the minimum distance. The final accessibility score is calculated by the formula: Score Accessibility = w1 × Distance Score + w2 × Orientation Score + w3 × Collision Score where w1, w2, and w3 are weight coefficients determined according to the characteristics of the spraying task. This method can comprehensively consider multiple influencing factors and provide accurate accessibility evaluation for each possible spraying pose of each feature point.
[0078] The attitude factor evaluates the angle relationship between the spraying direction and the surface normal vector, and the optimal effect is usually achieved when the spraying angle is 20°-30° with the normal vector. The collision factor evaluates whether collision occurs during spraying, which is usually achieved by calculating the minimum distance between the spraying equipment and other parts of the workpiece.
[0079] According to the influence degree of each factor, corresponding weight coefficient is allocated for weighted calculation, the importance of each factor is determined according to the characteristics of the spraying task, and for fine spraying task, the weight of the posture factor is usually high; for spraying of complex workpieces, the weight of the collision factor needs to be improved. According to these weights, the weighted accessibility score of each spraying posture of each feature point is calculated.
[0080] The feature points with accessibility scores in the region are weighted and accumulated, the workpiece surface is divided into a grid, and then the accessibility scores of the feature points are mapped onto the grid. The grid size is usually set to 5-10mm, and for an engine cover workpiece, a 100x150 grid is formed. For each grid unit, all feature points falling within or near the unit are collected, and the comprehensive accessibility score of the unit is calculated according to the inverse ratio of the distance. This way can smooth the accessibility scores between feature points and form a continuous accessibility distribution.
[0081] The spraying accessibility data of the workpiece surface is generated, and the accessibility scores of all grid units are organized into a complete data structure, usually a two-dimensional array or a three-dimensional voxel grid, each element corresponding to the accessibility score of a position. This data structure can intuitively show the spraying difficulty of each region of the workpiece surface, and usually uses color coding for visualization: green represents high accessibility (score 90-100), yellow represents medium accessibility (score 70-90), and red represents low accessibility (score 0-70). This accessibility data provides an important basis for subsequent spraying path planning, which can guide the algorithm to give priority to areas with high accessibility and design special processing strategies for areas with low accessibility.
[0082] The method of the present application realizes accurate evaluation of the spraying accessibility of the workpiece surface through multi-scale feature extraction and accessibility analysis of the three-dimensional data of the workpiece. The method considers multiple factors such as distance, posture and collision, and can provide comprehensive accessibility information for the spraying robot to guide it to generate efficient and high-quality spraying paths. In practical application, the method can significantly improve the efficiency and quality of the spraying process, reduce spraying defects and reduce production costs.
[0083] In an optional embodiment, an ant colony algorithm is used for spraying path planning, an adaptive pheromone update strategy is used to dynamically adjust the path search weight, and an optimal spraying path sequence that meets the spraying quality requirements is generated, including:
[0084] A set of grid nodes and a set of feasible paths are established on the surface of the workpiece to form a search space, the path length between nodes in the set of grid nodes and the spraying quality at the nodes are respectively assigned to the path quality weight coefficient to construct a search objective function;
[0085] calculating an ant colony size corresponding to a current iteration number based on the search target function, and setting a search ant equal to the ant colony size in the search space;
[0086] assigning a pheromone concentration, a heuristic information and a path direction factor in the search space to a navigation weight ratio calculation state transition probability, and guiding the search ant to select a next grid node sequence based on the state transition probability in each iteration cycle;
[0087] performing a local pheromone update on the grid node sequence selected by the search ant, calculating a global update coefficient with the iteration cycle, and increasing a pheromone concentration of an optimal path in the grid node sequence by using the global update coefficient;
[0088] calculating an optimization evaluation value of the path based on the pheromone concentration of the optimal path, adjusting a pheromone update amount in a next iteration cycle according to the optimization evaluation value, continuously enhancing a pheromone concentration of a high-quality path by a multi-round iteration optimization, and obtaining an optimal spraying path sequence meeting a spraying quality requirement.
[0089] establishing a search space composed of a grid node set and a feasible path set on a workpiece surface, and discretizing the workpiece surface into uniformly distributed grid nodes according to a three-dimensional model of the workpiece. For a typical automobile bumper workpiece, the surface thereof can be divided into 500*300 grids, and there are 150000 nodes in total. Each node represents a spraying robot nozzle position point, and attributes of the node include three-dimensional coordinates (x, y, z) and a normal vector (nx, ny, nz). For example, coordinates of node 1 are (150mm, 200mm, 50mm), and a normal vector thereof is (0.2, 0.3, 0.9); coordinates of node 2 are (155mm, 200mm, 52mm), and a normal vector thereof is (0.18, 0.32, 0.93). On the basis of the node set, a feasible path between adjacent nodes is determined according to a motion constraint of the spraying robot. Generally, whether a path from node i to node j is feasible depends on a distance between the two nodes and a change in direction. If the distance between the two nodes is less than 20mm and an included angle of the normal vectors is less than 30 degrees, it is considered that there is a feasible path between the two nodes. In this way, a set containing all feasible paths can be constructed, and a complete search space is formed.
[0090] The path length between nodes in the grid node set and the spraying quality at the node are respectively assigned to the path quality weight coefficient to construct a search objective function, both the path length and the spraying quality are considered comprehensively, the path length refers to the Euclidean distance between two adjacent nodes, and the calculation method is the square root of the sum of squares of the coordinate difference between two points. For example, the distance between node 1 (150mm, 200mm, 50mm) and node 2 (155mm, 200mm, 52mm) is 5.83mm. The spraying quality refers to the uniformity and coverage of spraying at the node, which is related to the position of the spray head, the spraying angle and the spraying distance. The spraying quality score of each node can be calculated by simulation or empirical model, and the score range is 0 to 100, the higher the score, the better the spraying quality. For example, the spraying quality score of node 1 is 85, and the spraying quality score of node 2 is 88. The path quality weight coefficient is set to w1=0.4 and w2=0.6, which respectively correspond to the weights of the path length and the spraying quality. The search objective function is defined as minimizing the total path length under the premise of ensuring that the spraying quality score is not lower than a preset threshold (such as 80 points). For the path from node i to node j, the objective function value is calculated as 0.4 x distance(i,j) / (maximum distance)-0.6 x spraying quality(j) / 100. The distance value is normalized by dividing the maximum distance, and the spraying quality is normalized by dividing 100, so that the two factors have the same dimension.
[0091] Based on the search objective function, the ant colony size corresponding to the current iteration number is calculated, and an adaptive ant colony size adjustment mechanism is designed. In the initial stage, a larger ant colony size is set to ensure extensive coverage of the search space; as the iteration proceeds, the ant colony size is gradually reduced to concentrate computing resources. Specifically, the ant colony size of the tthiteration is calculated as initial ant colony size x (1-t / maximum iteration number)^2+minimum ant colony size. For example, the initial ant colony size is set to 100, the minimum ant colony size is set to 30, and the maximum iteration number is set to 200, then the ant colony size of the 20thiteration is 100 x (1-20 / 200)^2+30=100 x 0.81+30=111. At the beginning of each iteration, according to the calculated ant colony size, a corresponding number of search ants are set in the search space. Each ant starts from the starting node of the search space and searches along the feasible path. The starting node is usually selected as the edge point of the workpiece surface or the set entry point, such as the node with coordinates (0mm, 150mm, 30mm).
[0092] The pheromone concentration, heuristic information and path direction factor in the search space are respectively assigned to the navigation weight ratio calculation state transition probability, and the ant path selection strategy is designed. The pheromone concentration represents the walking frequency of historical ants on the path, and the pheromone concentration of all paths is set to the same value τ0=0.01 at the initial time. The heuristic information is calculated based on the local characteristics of the path and is defined as 1 divided by the objective function value, representing the immediate attractiveness of the path. The path direction factor considers the continuity of spraying and is defined as the cosine value of the angle between the current path direction and the candidate path direction. The navigation weight ratio is set to α=1.0, β=2.0, and γ=1.5, corresponding to the weights of pheromone concentration, heuristic information and path direction factor respectively. The state transition probability is calculated as the weighted product of the normalized three factors. For example, the current node i has three feasible next nodes j1, j2 and j3, and their pheromone concentrations are 0.05, 0.03 and 0.08 respectively, the heuristic information is 0.2, 0.4 and 0.1 respectively, and the path direction factor is 0.9, 0.6 and 0.7 respectively. According to the state transition probability formula, the probabilities of transferring to j1, j2 and j3 are 0.32, 0.41 and 0.27 respectively. The ant selects the next node according to these probabilities to form a grid node sequence.
[0093] The local pheromone update is performed on the grid node sequence selected by the search ant, and the pheromone update is performed on the path just walked immediately after each ant completes one step of movement. The local pheromone update uses the evaporation coefficient ρ=0.1 and the update amount Δτ=0.05. Specifically, the pheromone update of path (i, j) is (1-ρ)×current pheromone+ρ×τ0. For example, if the current pheromone of path (i, j) is 0.05, the updated pheromone is (1-0.1)×0.05+0.1×0.01=0.046. The purpose of local pheromone update is to reduce the probability of subsequent ants selecting the same path and promote the diversity of search. At the same time, the global update coefficient is calculated according to the iteration period, and the global update coefficient is defined as 1-(1-basic coefficient)×(current iteration number / max iteration number)^2. The basic coefficient is set to 0.5, and the maximum iteration number is 200. For example, in the 50th iteration, the global update coefficient is 1-(1-0.5)×(50 / 200)^2=1-0.5×0.0625=0.96875. The global update coefficient is used to increase the pheromone concentration of the optimal path in the grid node sequence. The optimal path refers to the path with the minimum objective function value found in the current iteration. For each segment (i, j) on the optimal path, the pheromone increase amount is global update coefficient×Q / L, where Q is a constant (such as 100) and L is the total length of the optimal path. For example, if the length of the optimal path found in the current iteration is 500 mm, then in the 50th iteration, the pheromone increase amount of each segment on the optimal path is 0.96875×100 / 500=0.19375.
[0094] The optimization evaluation value of the path is calculated based on the pheromone concentration of the optimal path. An evaluation mechanism is designed to judge the optimization effect of the current iteration. The optimization evaluation value is defined as the ratio of the average pheromone concentration of the optimal path to the global average pheromone concentration. The average pheromone concentration is calculated as the sum of the pheromone concentrations of all segments on the path divided by the number of segments. For example, if the optimal path contains 100 segments and the sum of the pheromone concentrations of these segments is 15, then the average pheromone concentration of the optimal path is 15 / 100 = 0.15. Assuming that the average pheromone concentration of all feasible paths globally is 0.05, the optimization evaluation value is 0.15 / 0.05 = 3.0. The pheromone update amount of the next iteration period is adjusted according to the optimization evaluation value. Specifically, if the optimization evaluation value is greater than a threshold value (such as 2.5), it indicates that the current optimal path has been sufficiently reinforced, and the pheromone update amount of the next iteration can be appropriately reduced, calculated as the base update amount x (1 / optimization evaluation value). If the optimization evaluation value is less than the threshold value, it indicates that the current optimal path needs further reinforcement, and the pheromone update amount of the next iteration remains unchanged or is appropriately increased. For example, if the base update amount is 0.2 and the optimization evaluation value is 3.0, the pheromone update amount of the next iteration is 0.2 x (1 / 3.0) = 0.067. Through multiple rounds of iteration optimization, the pheromone concentration of the high-quality path is continuously enhanced, and the optimal spraying path sequence that meets the spraying quality requirements is obtained.
[0095] The iteration termination condition is designed as a multi-criteria termination mechanism. When any of the following conditions is met, the algorithm terminates: 1) the maximum number of iterations (such as 200 times) is reached; 2) the change amplitude of the optimal path is less than a threshold value (such as 1% of the total path length) for consecutive n iterations (such as 20 times); 3) the optimization evaluation value is greater than a termination threshold value (such as 5.0). After the algorithm terminates, the optimal spraying path sequence found is output, including a list of grid nodes arranged in order. For example, a typical spraying path sequence contains 200 nodes, indicating that the spraying robot nozzle should move and spray in the order of these points.
[0096] A plurality of indexes are designed to evaluate the quality of the optimal spraying path sequence, including: total path length, calculated as the sum of the distances between adjacent nodes in the path sequence, for example 2500 mm; average spraying quality, calculated as the average of the spraying quality scores of all nodes in the path sequence, for example 87 points; minimum spraying quality, calculated as the minimum value of the spraying quality scores in the path sequence, for example 81 points; path smoothness, calculated as the average of the angles between adjacent segments in the path sequence, for example 15 degrees. If these indexes meet the preset requirements (such as total path length not exceeding 3000 mm, average spraying quality not less than 85 points, minimum spraying quality not less than 80 points, and path smoothness not exceeding 20 degrees), the optimal spraying path sequence found is considered acceptable; if these indexes do not meet the preset requirements (such as total path length exceeding 3000 mm, average spraying quality being less than 85 points, minimum spraying quality being less than 80 points, or path smoothness exceeding 20 degrees), the algorithm parameters need to be adjusted to re-plan the path. The specific adjustment strategies include: increasing the weight of spraying quality in the objective function to improve the average spraying quality; modifying the pheromone update strategy to optimize the path smoothness; or increasing the path length penalty term to reduce the total path length. If all requirements cannot be met after multiple adjustments, the preset requirements need to be appropriately relaxed according to the actual process requirements, or the workpiece can be divided into zones and independent spraying paths are designed for different zones.
[0097] In practical applications, the method of the present application can be adjusted in parameters according to different spraying tasks and workpiece characteristics. For example, for a workpiece with a complex curved surface, the density of the grid nodes can be increased; for a workpiece with high requirements for spraying quality, the weight of spraying quality in the objective function can be increased; for a task with strict requirements for spraying time, the weight of path length in the objective function can be increased. Through such flexible parameter adjustment, the method of the present application can adapt to various different spraying scenarios and requirements.
[0098] The effectiveness of the method of the present application can be verified through actual spraying experiments or simulation experiments. In a typical automobile bumper spraying task, the spraying path planned by the method of the present application has a total path length reduced by 15%, an average spraying quality improved by 8%, and a spraying time shortened by 12% compared with the traditional method. These improvements significantly improve the spraying efficiency and quality, reduce the waste of spraying materials, and lower the production cost.
[0099] The ant colony algorithm spraying path planning method provided by the present application can effectively generate an optimal spraying path sequence that meets the spraying quality requirements by establishing a search space composed of grid nodes and feasible paths on the surface of a workpiece, combined with adaptive ant colony size and pheromone update strategy. This method has important value in industrial spraying robot applications and can significantly improve spraying efficiency and quality, providing strong support for intelligent manufacturing.
[0100] In an alternative embodiment, assigning the pheromone concentration, heuristic information and path direction factor in the search space to the navigation weight respectively to calculate the state transition probability includes:
[0101] Assigning the pheromone concentration, heuristic information and path direction factor in the search space to the navigation weight respectively to construct the basic state transition probability;
[0102] Calculating a prediction compensation amount based on the historical search trajectory of the previous several steps of path selection according to the difference between the prediction probability value and the basic state transition probability, and optimizing the navigation weight coefficient through the prediction compensation amount;
[0103] Recalculating the state transition probability of the pheromone concentration, the heuristic information and the path direction factor according to the optimized navigation weight coefficient.
[0104] By combining the pheromone concentration, heuristic information and path direction factor, a more efficient navigation path planning method is constructed. In the specific implementation process, first, the grid representation of the search space needs to be determined, and the physical space is discretized into an n x n grid network, and each grid point can be represented by coordinates (i, j), where i and j are the row index and column index respectively. For each grid point, record its pheromone concentration τ(i, j), and the initial value can be set to a fixed constant τ0=0.01.
[0105] To construct the basic state transition probability, three key factors need to be calculated: pheromone concentration, heuristic information and path direction factor. In the actual navigation scene, the pheromone concentration τ(i, j) represents the cumulative effect of historical path selection; the heuristic information η(i, j) is usually related to the distance of the target point, which can be defined as η(i, j)=1 / d(i, j), where d(i, j) is the Euclidean distance from the current grid point to the target point; the path direction factor δ(i, j) is used to represent the continuity of the current movement direction, which can be defined as δ(i, j)=cos(θ), where θ is the included angle between the current moving direction and the last step moving direction.
[0106] The setting of the navigation weight coefficient has a significant impact on the algorithm performance. In this embodiment, the weight coefficients α, β and γ are assigned to the pheromone concentration, heuristic information and path direction factor respectively, and the initial values can be set as α=1.0, β=2.0, γ=0.5. Before calculating the state transition probability, the three key factors need to be normalized, and the pheromone concentration normalization is represented as τ norm (i, j)=τ(i, j) / max(τ), where max(τ) is the maximum pheromone concentration value of all current grid points; the heuristic information normalization is represented as η norm(i,j) = (1 / d(i,j)) / max(1 / d), where max(1 / d) is the maximum of the inverse distance of all grid points to the target point; the path direction factor is normalized as δ norm (i,j) = (cos(θ) + 1) / 2, mapping the value range to the interval [0, 1]. Based on the three normalized factors, the basic state transition probability p(i,j) is constructed, and the calculation process is as follows: for the adjacent feasible grid points (i,j) of the current position (x,y), multiply τ norm (i,j) by the αth power of η norm (i,j) by the βth power of δ norm (i,j) by the γth power of γ, to obtain the probability value of each adjacent grid point, then sum the probability values of all adjacent grid points as the denominator, and divide the probability value of each grid point by the denominator to obtain the final state transition probability p(i,j).
[0107] In order to further improve the efficiency of path planning, the embodiment introduces a prediction compensation mechanism based on historical search trajectories. In specific implementation, the system records the path selection of the previous m steps, with the default value m = 5. By analyzing the movement trend of the m steps, the next step movement direction can be predicted. The prediction method can use linear regression or weighted average technology to obtain the predicted probability value ppred(i,j).
[0108] The calculation of the prediction compensation amount is the core innovation of this method. For each next step position (i,j), calculate the difference Δp(i,j) = ppred(i,j) - p(i,j) between the predicted probability ppred(i,j) and the basic state transition probability p(i,j). If the difference is positive, it indicates that the probability of the next step direction predicted by the historical trajectory analysis is higher than that predicted by the basic model, and the selection tendency of this direction should be enhanced at this time; otherwise, the selection tendency of this direction should be weakened.
[0109] According to the prediction compensation amount Δp(i,j), the navigation weight coefficient is optimized and adjusted. The adjustment of the weight coefficient follows the following rules: if Δp(i,j) > 0, increase the weight coefficient related to this direction, and the adjustment amplitude is proportional to |Δp(i,j)|; if Δp(i,j) < 0, decrease the related weight coefficient. The specific adjustment method is: α new = α + λα· Δp, β new = β + λβ· Δp, γ new = γ + λγ· Δp, where λα, λβ and λγ are adjustment step parameters, which are set to 0.05, 0.1 and 0.02 respectively.
[0110] To prevent the weight coefficient from being adjusted too much, set the upper and lower limit constraints: 0.5 ≤ α ≤ 2.0, 1.0 ≤ β ≤ 3.0, 0.2 ≤ γ ≤ 1.0. After the weight coefficient is adjusted, the optimized αnew , β new and γ new Recalculate state transition probability p new (i,j).
[0111] In a practical application case, assume that in a 10x10 grid environment, the starting point is (1,1) and the ending point is (8,8), and there are obstacle areas in between. The initial pheromone concentration of all grid points is 0.01, the navigation weight coefficients are α=1.0, β=2.0, and γ=0.5. During navigation, the path passes through five points (1,1)--(2,2)--(3,3)--(4,3)--(5,4). At this time, the system analyzes the historical trajectory and predicts the probability distribution of the next position as: ppred(6,4)=0.15, ppred(6,5)=0.65, and ppred(5,5)=0.20.
[0112] At the same time, the basic state transition probability calculated based on the current navigation weight coefficients is: p(6,4)=0.25, p(6,5)=0.45, and p(5,5)=0.30. The prediction compensation amount is calculated as: Δp(6,4)=-0.10, Δp(6,5)=0.20, and Δp(5,5)=-0.10. Based on these compensation amounts, the navigation weight coefficients are adjusted: for the direction (6,5), since Δp is positive, the weight of this direction is increased, and after adjustment α=1.01, β=2.02, and γ=0.504; for other directions, the weight is appropriately reduced. The state transition probability is recalculated using the adjusted weight coefficients, and p new (6,4)=0.22, p new (6,5)=0.52, and p new (5,5)=0.26, and finally the system selects the direction with the highest probability (6,5) as the next moving position.
[0113] Through continuous iteration of this process, the system can continuously optimize the navigation weight ratio, achieve efficient path planning, effectively avoid obstacles, and find a near-optimal path solution. This method combines the global search ability of pheromone accumulation, the local guiding role of heuristic information, and the smoothing characteristics of path continuity, and simultaneously performs dynamic adjustment through historical trajectory analysis, showing excellent navigation performance in complex environments.
[0114] In an alternative embodiment, the motion trajectory points and corresponding joint angle data of the die casting robot are calculated; and a trajectory interpolation method is used to construct the transition region between the trajectory points based on the motion trajectory points and the joint angle data, including:
[0115] Sample the work space of the die casting robot to obtain a sequence of motion trajectory points, and solve the corresponding joint angle data of the sequence of motion trajectory points through inverse kinematics;
[0116] Establish the sequence of motion trajectory points, the joint angle data, joint speed data and joint acceleration data in the historical execution trajectory of the die casting robot as a trajectory database, calculate the similarity of the sequence of motion trajectory points and historical trajectories according to the historical trajectory data in the trajectory database, and select the historical trajectory with the highest similarity from the trajectory database as a reference trajectory based on the similarity;
[0117] Calculate a predicted compensation amount based on the reference trajectory according to the current joint angle, current joint speed and current joint acceleration of the die casting robot, superimpose the predicted compensation amount to the sequence of motion trajectory points to obtain an optimized sequence of motion trajectory points;
[0118] For adjacent trajectory points in the optimized sequence of motion trajectory points, a quintic polynomial interpolation method is used to construct a transition region between the trajectory points.
[0119] Sample the work space of the die casting robot to obtain a sequence of motion trajectory points, which can be based on offline planning, online teaching or sensor perception. Based on offline planning, key positions that the die casting robot needs to reach are marked in a three-dimensional simulation environment according to the requirements of the die casting process, forming a sequence of trajectory points. For example, in a typical die casting material taking and placing task, key points such as material taking position, intermediate transition position and material placing position can be set. Specifically, the coordinates of the material taking position are (500mm, 300mm, 800mm), and the attitude angle is (30°, 45°, 60°); the coordinates of the intermediate transition position are (600mm, 400mm, 900mm), and the attitude angle is (35°, 50°, 55°); the coordinates of the material placing position are (700mm, 500mm, 750mm), and the attitude angle is (40°, 40°, 50°).
[0120] The joint angle data corresponding to the motion trajectory point sequence is obtained by inverse kinematics solution, the motion trajectory point sequence of the die casting robot is obtained, and the end effector pose matrix is constructed according to the motion joint parameters of the die casting robot; the motion trajectory point sequence is input into the end effector pose matrix, and the wrist point position corresponding to each trajectory point is calculated by using a geometric decoupling method, and the first three-axis joint angles corresponding to each trajectory point are solved based on the wrist point position by using a trigonometric function relationship; the first three-axis joint angles and the attitude component of the end effector pose matrix are subjected to coordinate transformation, and the last three-axis joint angles corresponding to each trajectory point are solved, and the complete joint angles composed of the first three-axis joint angles and the last three-axis joint angles are obtained; the current joint angles of the die casting robot are obtained, the weighted sum of squares between the complete joint angles and the current joint angles is calculated to obtain an evaluation index, the complete joint angles that make the evaluation index minimum are selected as the optimal solution joint angles, and the optimal solution joint angles are used as the joint angle data corresponding to the motion trajectory point sequence. For the picking position (500mm, 300mm, 800mm), the attitude angle (30°, 45°, 60°), the joint angles obtained by inverse kinematics solution are (22.73°, 32.02°, 93.23°, 68.99°, 49.16°, 101.15°).
[0121] The motion trajectory point sequence, joint angle data, joint speed data and joint acceleration data in the historical execution trajectory of the die casting robot are established as a trajectory database to record the actual execution trajectory information of the die casting robot in the production process. Each record in the database contains the following fields: trajectory ID, timestamp, trajectory type, trajectory point sequence, joint angle sequence, joint speed sequence, joint acceleration sequence and execution effect score. The trajectory point sequence is represented in the Cartesian coordinate system and contains position coordinates (x, y, z) and attitude angles (a, b, g); the joint angle sequence contains the angle values of the six joints (q1, q2, q3, q4, q5, q6); the joint speed sequence contains the speed values of the six joints (w1, w2, w3, w4, w5, w6); and the joint acceleration sequence contains the acceleration values of the six joints (a1, a2, a3, a4, a5, a6). During data acquisition, the die casting robot control system records data once every certain time interval (such as 10 milliseconds), including the current Cartesian coordinates, joint angles, joint speeds and joint accelerations.
[0122] The similarity between the motion trajectory point sequence and the historical trajectory is calculated according to the historical trajectory data in the trajectory database, the dynamic time warping (DTW) algorithm is used to calculate the similarity between the current trajectory and the historical trajectory, and the similarity calculation is divided into three levels: Cartesian space similarity, joint space similarity and task feature similarity. The Cartesian space similarity calculates the difference between the current trajectory point sequence and the historical trajectory point sequence in position and attitude. For each pair of trajectory points, the Euclidean distance and the attitude angle difference value are calculated, and then the weighted sum is obtained. The joint space similarity calculates the difference between the current joint angle sequence and the historical joint angle sequence. For each pair of joint angles, the weighted sum of the joint angle difference values is calculated. The task feature similarity calculates the similarity according to the task type, workpiece type, execution time and other features of the trajectory. The similarities of the three levels are combined according to the weight proportion (such as 0.3:0.5:0.2) to obtain the final similarity.
[0123] The historical trajectory with the highest similarity is selected as the reference trajectory from the trajectory database based on the similarity, the similarity of all historical trajectories in the database is calculated, and then the historical trajectories are sorted from high to low according to the similarity, and the historical trajectory with the highest similarity is selected as the reference trajectory. In order to improve the calculation efficiency, the initial screening can be carried out according to the task features (such as trajectory type, workpiece type), and only the potentially relevant historical trajectories are calculated for detailed similarity. In addition, a similarity threshold (such as 0.8) can be set, and only the historical trajectories with a similarity higher than the threshold are considered as effective references. When there are multiple historical trajectories with similar similarities (such as a difference less than 0.05), the execution effect score of the trajectory can be further considered, and the historical trajectory with the highest score is selected as the reference.
[0124] The predicted compensation amount is calculated based on the current joint angle, current joint speed and current joint acceleration of the die casting robot according to the reference trajectory, and the compensation required for the subsequent trajectory points is predicted by comparing the state difference between the current state and the state of the reference trajectory at the corresponding time. The predicted compensation amount calculation includes position compensation and attitude compensation. The position compensation is calculated by comparing the current joint angle with the joint angle at the corresponding time in the reference trajectory, calculating the angle difference value, and then converting the angle difference value into a position compensation amount through forward kinematics. Specifically, for a six-axis robot, the joint angle difference vector (Δθ1, Δθ2, Δθ3, Δθ4, Δθ5, Δθ6) is calculated first, and then the Jacobian matrix is used to convert the joint space difference into a position compensation vector (Δx, Δy, Δz) in Cartesian space. The attitude compensation is calculated by comparing the current joint speed, acceleration and the joint speed, acceleration at the corresponding time in the reference trajectory, predicting the difference of the subsequent motion trend, and calculating the attitude compensation amount.
[0125] The predicted compensation amount is superimposed on the motion trajectory point sequence to obtain an optimized motion trajectory point sequence, and the position compensation amount and the attitude compensation amount are superimposed on the position coordinates and the attitude angles of the original trajectory points, respectively. For each trajectory point, the optimized coordinates (x', y', z') = (x, y, z) + (Δx, Δy, Δz) and the attitude angles (α', β', γ') = (α, β, γ) + (Δα, Δβ, Δγ) are calculated. For example, the position coordinates of the original trajectory point are (500 mm, 300 mm, 800 mm), the attitude angles are (30°, 45°, 60°), the position compensation amount is (2.5 mm, -1.8 mm, 3.2 mm), and the attitude compensation amount is (0.5°, -0.3°, 0.4°), then the optimized trajectory point position coordinates are (502.5 mm, 298.2 mm, 803.2 mm), and the attitude angles are (30.5°, 44.7°, 60.4°). For each point in the trajectory point sequence, similar compensation calculations are performed to obtain a complete optimized trajectory point sequence. In order to ensure the smoothness of the trajectory, the compensation amount can be gradually reduced along the trajectory to avoid sudden changes at the end of the trajectory.
[0126] For adjacent trajectory points in the optimized motion trajectory point sequence, a quintic polynomial interpolation method is used to construct the transition region between the trajectory points, and a quintic polynomial function is used to describe the smooth transition between the trajectory points. The quintic polynomial has enough degrees of freedom to satisfy the continuity constraints of position, velocity and acceleration at the same time, thereby ensuring the smoothness of the robot motion. For each pair of adjacent points in the optimized trajectory point sequence, the three components of the position coordinates (x, y, z) and the three components of the attitude angles (α, β, γ) are interpolated by a quintic polynomial. For each component, a polynomial function of the form f(t) = a0+ a1t + a2t 2 +a3t 3 +a4t 4 +a5t 5 is constructed, where t is a normalized time parameter ranging from [0, 1]. The polynomial coefficients (a0, a1, a2, a3, a4, a5) are determined by applying boundary conditions. The boundary conditions include the position, velocity and acceleration values at the starting point (t = 0) and the position, velocity and acceleration values at the end point (t = 1). Using these polynomial functions, the position and attitude at any time between the trajectory points can be calculated to achieve smooth transition.
[0127] After constructing the transition region with quintic polynomial interpolation, it is necessary to verify the feasibility of the interpolated trajectory to ensure that it meets the kinematic and dynamic constraints of the robot. Discretely sample the interpolated trajectory, calculate the joint angle, joint velocity, and joint acceleration at each sampling point; check if the joint angle is within the allowed range, and if the joint velocity and acceleration exceed the limits of the robot; if there are cases that do not meet the constraints, adjust the boundary conditions of the polynomial (such as reducing the velocity or acceleration value), and recalculate the interpolated trajectory. If the calculated velocity of joint 4 at t=0.3 is 145° / s, which exceeds the limit value of 140° / s, the velocity value in the boundary condition needs to be reduced, and the interpolated trajectory needs to be recalculated.
[0128] For complex die casting processes, additional constraints such as obstacle avoidance, minimum trajectory length, and minimum energy consumption need to be considered during trajectory optimization. These constraints can be implemented by introducing corresponding penalty terms in the calculation of the predicted compensation.
[0129] In practical applications, the effectiveness of the method of the present application can be evaluated by the following indicators: trajectory execution time, position accuracy, attitude accuracy, joint velocity smoothness, joint acceleration smoothness, and energy consumption. By comparing these indicators before and after optimization, the effectiveness of trajectory optimization can be quantitatively evaluated. For example, in a typical die casting material taking and placing task, the optimized trajectory execution time is reduced by 10%, the position accuracy is improved by 15%, the joint acceleration peak value is reduced by 20%, and the energy consumption is reduced by 12%.
[0130] The method of the present application obtains a trajectory point sequence by sampling the workspace of the die casting robot, and realizes the optimization and smooth transition of the trajectory points by combining inverse kinematics solving and historical trajectory reference. This method is particularly suitable for repetitive tasks in die casting production, and can automatically optimize the trajectory based on historical experience to improve the smoothness and accuracy of the die casting robot's movement. For example, in a die casting material taking and placing task, the robot needs to take material from the conveyor belt, move to the front of the die casting machine for loading, and then return to the material taking position. Through the method of the present application, the system can learn the best path from the historical execution trajectory, automatically adjust the current trajectory, avoid obstacles, and achieve smooth acceleration and deceleration, thereby reducing the mechanical wear of the robot, prolonging the service life of the equipment, improving the production efficiency and product quality.
[0131] In an alternative embodiment, the joint angle data corresponding to the motion trajectory point sequence obtained by inverse kinematics solving comprises:
[0132] The motion trajectory point sequence of the die casting robot is acquired, and an end effector pose matrix is constructed according to the motion joint parameters of the die casting robot; the motion trajectory point sequence is input into the end effector pose matrix, and the wrist point position corresponding to each trajectory point is calculated by using a geometric decoupling method, and the first three-axis joint angles corresponding to each trajectory point are solved based on the wrist point position by using a trigonometric function relationship;
[0133] The first three-axis joint angles are subjected to coordinate transformation with the attitude component of the end effector pose matrix, and the last three-axis joint angles corresponding to each trajectory point are solved, so that the complete joint angles composed of the first three-axis joint angles and the last three-axis joint angles are obtained.
[0134] The current joint angles of the die casting robot are acquired, a weighted sum of squares between the complete joint angles and the current joint angles is calculated to obtain an evaluation index, the complete joint angles that minimize the evaluation index are selected as optimal solution joint angles, and the optimal solution joint angles are taken as the joint angle data corresponding to the motion trajectory point sequence.
[0135] As shown in Figure 3 the method comprises:
[0136] The die casting robot is generally composed of six rotary joints, which can be represented as the first three-axis and the last three-axis. The first three-axis is mainly responsible for the position positioning of the end effector of the robot, and the last three-axis is mainly responsible for the attitude adjustment. The specific steps of acquiring the motion trajectory point sequence of the die casting robot are as follows: trajectory planning is performed through an offline programming software, key points are recorded in a manual teaching mode through a teach pendant, or trajectory points are automatically generated by real-time acquisition of workpiece position information through a sensor. In the offline programming mode, the operator selects a workpiece surface point in a three-dimensional environment through a mouse, and sets a tool attitude, and the software automatically generates a trajectory point; in the manual teaching mode, the operator moves the end effector of the robot to a desired position, and saves the position and attitude information of the point through a record button on the teach pendant; in the sensor acquisition mode, a vision sensor or a laser scanner can be used to scan the workpiece, and feature points are extracted as trajectory points.
[0137] The end effector pose matrix is constructed according to the kinematic joint parameters of the die casting robot. The link parameters of the robot, including link length, link twist angle, link offset, and joint angle, are obtained from the technical manual provided by the robot manufacturer. Assume that the link parameters of a six-axis die casting robot are as follows: the link length of joint 1 is 350 mm, the twist angle is 90°, and the offset is 0 mm; the link length of joint 2 is 750 mm, the twist angle is 0°, and the offset is 0 mm; the link length of joint 3 is 150 mm, the twist angle is 90°, and the offset is 0 mm; the link offset of joint 4 is 860 mm, the twist angle is -90°, and the link length is 0 mm; the link length of joint 5 is 0 mm, the twist angle is 90°, and the offset is 0 mm; and the link length of joint 6 is 160 mm, the twist angle is 0°, and the offset is 0 mm. Then, according to these parameters, the pose matrix from the robot base to the end effector is constructed by the link coordinate transformation method. Specifically, for each joint, a local coordinate system is established, and the transformation matrix between adjacent coordinate systems is calculated, and finally these transformation matrices are multiplied in sequence to obtain the total transformation matrix from the base to the end effector, i.e., the end effector pose matrix. This matrix is a 4x4 homogeneous transformation matrix, of which the upper 3x3 part represents the rotation matrix describing the pose of the end effector, and the right 3x1 part represents the position vector describing the position of the end effector.
[0138] The sequence of motion trajectory points is input to the end effector pose matrix, and the wrist point position corresponding to each trajectory point is calculated using the geometric decoupling method. For each trajectory point, a rotation matrix R is first constructed according to its attitude angles (α, β, γ). The Euler angle ZYX sequence is used, i.e., first rotate γ degrees around the Z axis, then rotate β degrees around the Y axis, and finally rotate α degrees around the X axis. The distance vector d from the end effector to the wrist point is calculated. According to the robot structure, this vector in the end effector coordinate system is represented as (0, 0, -d6), where d6 is the link length of joint 6, i.e., 160 mm. This vector is transformed to the base coordinate system by the rotation matrix R to obtain d' = R·d = (-113.14 mm, 43.30 mm, -104.53 mm). According to the position (x, y, z) of the end effector and the transformed distance vector d', the wrist point position wrist pos = (x, y, z) - d' = (500 mm, 300 mm, 800 mm) - (-113.14 mm, 43.30 mm, -104.53 mm) = (613.14 mm, 256.70 mm, 904.53 mm). For the second trajectory point, the wrist point position is calculated similarly as (657.85 mm, 284.92 mm, 879.38 mm).
[0139] Based on the wrist position, the first three joint angles corresponding to each trajectory point are solved using trigonometric relationships. For the first joint angle θ1, it can be calculated through the wrist point projection on the XY plane. Specifically, θ1 = atan2(y wrist ,x wrist ), where atan2 is the arctangent function considering the quadrant factor. For the wrist position of the first trajectory point (613.14 mm, 256.70 mm, 904.53 mm), θ1 = atan2(256.70, 613.14) = 22.73° is calculated. For the second and third joint angles (θ2 and θ3), the wrist point is first transformed from the base coordinate system to the joint 1 coordinate system, i.e., rotating around the Z axis by -θ1 angle. The transformed wrist position is (wrist x' ,wrist y' ,wrist z' ) = (665.83 mm, 0 mm, 904.53 mm). Then, the planar distance from joint 1 to the wrist point r = sqrt(wrist x' 2 +wrist y' 2 ) = 665.83 mm and the height difference h = wrist z' -d1 = 904.53 mm - 350 mm = 554.53 mm, where d1 is the link height of joint 1. Next, the cosine law is applied to calculate the angles of joint 2 and joint 3. Let the link length of joint 2 be a2 = 750 mm, the link length of joint 3 be a3 = 150 mm, and the distance from the wrist point to joint 1 be sqrt(r 2 +h 2 ) = 866.32 mm. Then cos(θ3) = (r 2 +h 2 -a2 2 -a3 2 ) / (2a2a3) = (866.32 2 -750 2 -150 2 ) / (2750150) = -0.0563, so θ3 = acos(-0.0563) = 93.23°. For joint 2, cos(β) = (a2 2 +r 2 +h 2 -a3 2 ) / (2a2sqrt(r 2 +h 2 )) = (750 2 +866.32 2 -150 2) = 0.9909, sin(β) = sqrt(1 - cos(β)) 2 ) = 0.1346, and tan(a) = h / r = 554.53 / 665.83 = 0.8329, a = atan(0.8329) = 39.76°. Thus, θ2= a - β = 39.76° - asin(0.1346) = 39.76° - 7.74° = 32.02°. Similarly, for the second trajectory point, θ1= 23.41°, θ2= 34.58°, θ3= 91.65° are calculated.
[0140] The first three joint angles are transformed with the pose component of the end-effector pose matrix to obtain the last three joint angles for each trajectory point. The transformation matrix T03from the base to joint 3 is calculated based on the first three joint angles (θ1, θ2, θ3). Specifically, the transformation matrices T01, T12, T23for each joint are calculated respectively, and then T03= T01·T12·T23is obtained by matrix multiplication. For example, for the first trajectory point with the first three joint angles θ1= 22.73°, θ2= 32.02°, θ3= 93.23°, the T03matrix elements are calculated as follows: 11 -0.1322, T03 12 -0.9912, T03 13 0.0000, T03 21 -0.9912, T03 22 0.1322, T03 23 0.0000, T03 31 0.0000, T03 32 0.0000, T03 33 -1.0000, and the position part T03 14 = 714.79 mm, T03 24 -95.37 mm, T03 34 = 1010.33 mm. The rotation matrix R36from joint 3 to the end-effector is calculated based on the rotation part R03of the target pose matrix R and T03, R36= R03 (-1) · R, where R03 (-1) is the inverse matrix of R03. For the first trajectory point, the R36matrix elements are calculated as follows: 11 -0.3536, R36 12 0.6124, R36 13 0.7071, R36 21 -0.9239, R36 22 -0.2722, R36 23=-0.2706,R36 31 =0.1464,R36 32 =-0.7413,R36 33 =0.6533. Extract the rear three-axis joint angles (θ4, θ5, θ6) from R36. Specifically, θ5 = acos(R36 33 =acos(0.6533)=49.16°; Since sin(θ5)>0, therefore θ4=atan2(R36) 23 / sin(θ5),-R36 13 / sin(θ5))=atan2(-0.2706 / 0.7570,-0.7071 / 0.7570)=atan2(-0.3574,-0.9341)=-111.01°;θ6=atan2(R36 32 / sin(θ5),R36 31 / sin(θ5))=atan2(-0.7413 / 0.7570,0.1464 / 0.7570)=atan2(-0.9791,0.1934)=-78.85°. Considering that joint angles are usually defined in the range of [-180°,180°], θ4 and θ6 are adjusted to obtain θ4=68.99°, θ6=101.15°. Similarly, for the second trajectory point, the calculated joint angles of the last three axes are θ4=71.52°, θ5=51.34°, θ6=98.77°.
[0141] In the inverse kinematics solution process, since the mapping relationship between joint space and Cartesian space is many-to-one, there are multiple sets of joint angle solutions. To obtain all solutions, different robot configurations need to be considered, such as above-elbow / below-elbow, above-wrist / below-wrist, etc. For the above-elbow configuration, θ3 is positive; for the below-elbow configuration, θ3 is negative; for the above-wrist configuration, θ5 is positive; for the below-wrist configuration, θ5 is negative. Furthermore, for specific values of θ3 and θ5, θ4 and θ6 can be increased or decreased by 180° while keeping the pose of the end effector unchanged. For example, for the first trajectory point, in addition to the above solutions (θ1=22.73°, θ2=32.02°, θ3=93.23°, θ4=68.99°, θ5=49.16°, θ6=101.15°), there is another set of solutions: θ1=22.73°, θ2=32.02°, θ3=93.23°, θ4=-111.01°, θ5=-49.16°, θ6=-78.85°, or θ1=202.73°, θ2=-32.02°, θ3=-93.23°, θ4=158.99°, θ5=49.16°, θ6=11.15°, etc.
[0142] The current joint angles of the die casting robot are obtained by reading the current angle values of each joint through the joint encoders of the robot control system. These encoders are usually installed on the motor of each joint and can measure the rotation angle of the joint in real time. The control system converts the encoder readings into angle values and transmits them to the upper computer through a communication interface such as Ethernet, RS-232 or fieldbus. Suppose the current joint angles of the robot are θ1=20.50°, θ2=30.25°, θ3=90.75°, θ4=65.30°, θ5=47.80°, θ6=100.20°.
[0143] The weighted sum of squares between the complete joint angles and the current joint angles is calculated to obtain the evaluation index, and weight coefficients are set for each joint, which are usually determined according to the importance, flexibility or dynamic characteristics of the joint. The specific calculation formula is: J=w1(θ1-θ1 current ) 2 +w2(θ2-θ2 current ) 2 +w3(θ3-θ3 current ) 2 +w4(θ4-θ4 current ) 2 +w5(θ5-θ5 current ) 2 +w6(θ6-θ6 current ) 2 For the first set of solutions for the first trajectory point, the evaluation index J=1.0×(22.73-20.50) 2 +1.2×(32.02-30.25) 2 +1.2×(93.23-90.75) 2 +0.8×(68.99-65.30) 2 +0.8×(49.16-47.80) 2 +0.6×(101.15-100.20) 2 =1.04.97+1.23.13+1.26.15+0.813.62+0.81.85+0.60.91=4.97+3.76+7.38+10.90+1.48+0.55=29.04. For the second set of solutions for the first trajectory point, the evaluation index J=1.0×(22.73-20.50) 2 +1.2×(32.02-30.25) 2 +1.2×(93.23-90.75) 2 +0.8×(-111.01-65.30) 2 +0.8×(-49.16-47.80) 2+ 0.6 x (-78.85 - 100.20) 2 = 4.97 + 3.76 + 7.38 + 0.83 1021.86 + 0.89 417.53 + 0.6 x 320 202.05 = 4.97 + 3.76 + 7.38 + 248 17.49 + 753 4.02 + 1921.23 = 34288.85. Since the evaluation index value 29.04 of the first set of solutions is much smaller than the evaluation index value 34288.85 of the second set of solutions, the first set of solutions is selected as the optimal solution joint angles.
[0144] The specific steps of selecting the complete joint angles that minimize the evaluation index as the optimal solution joint angles are as follows: for each trajectory point, generate all joint angle solutions, calculate the evaluation index of each set of solutions, and select the solution with the minimum evaluation index as the optimal solution for the trajectory point. If there are multiple sets of solutions with similar evaluation indexes (e.g., with a difference less than a preset threshold 1.0), the continuity with adjacent trajectory points can be further considered. For example, for the second trajectory point, suppose two sets of solutions with similar evaluation indexes are generated: solution A (θ1=23.41°, θ2=34.58°, θ3=91.65°, θ4=71.52°, θ5=51.34°, θ6=98.77°) and solution B (θ1=23.41°, θ2=34.58°, θ3=91.65°, θ4=-108.48°, θ5=-51.34°, θ6=-81.23°), with evaluation indexes of 30.56 and 30.92, respectively. Although the evaluation index of solution A is slightly smaller, the sum of the squared differences in joint angles between the two sets of solutions and the optimal solution of the first trajectory point can be further calculated as a continuity index. The continuity index of solution A with the optimal solution of the first trajectory point is (23.41-22.73) 2 +(34.58-32.02) 2 +(91.65-93.23) 2 +(71.52-68.99) 2 +(51.34-49.16) 2 +(98.77-101.15) 2 = 0.46 + 6.55 + 2.49 + 6.41 + 4.75 + 5.66 = 26.32. The continuity index of solution B with the optimal solution of the first trajectory point is (23.41-22.73) 2 +(34.58-32.02) 2 +(91.65-93.23) 2 +(-108.48-68.99) 2 +(-51.34-49.16) 2 +(-81.23-101.15) 2= 0.46 + 6.55 + 2.49 + 31511.94 + 10094.25 + 3831.50 = 45447.19. Since the continuity index of solution A is much smaller than that of solution B, solution A is selected as the optimal joint angle of the second trajectory point.
[0145] The optimal joint angle of each trajectory point is organized into a joint angle data sequence in the order of the trajectory points, and saved as a file or directly sent to the robot control system. These joint angle data can be transmitted to the robot control system through a standard industrial communication protocol, and the control system plans the joint motion trajectory according to these data to realize the precise control of the die casting robot.
[0146] The method of the present application realizes efficient solution of die casting robot inverse kinematics through geometric decoupling, and selects the optimal solution through evaluation index to ensure the smoothness and continuity of robot motion. The method is suitable for planning and control of various complex trajectories in die casting process, and can significantly improve the working efficiency and precision of die casting robot. Through the method of the present application, the joint angle data of the entire trajectory can be quickly and accurately calculated to realize the precise control of the robot, meeting the high precision and high efficiency requirements of die casting production.
[0147] In an alternative embodiment, the optimal transition curve is calculated according to the position and pose of adjacent trajectory points, and a trajectory smoothness evaluation index is constructed in combination with robot joint acceleration constraints, including:
[0148] A virtual stress field inversely proportional to the distance from the obstacle is constructed in the robot workspace according to the position and pose of adjacent trajectory points, and a quintic polynomial transition curve is constructed based on the position and the pose;
[0149] The position, velocity and acceleration of the adjacent trajectory points are substituted into the quintic polynomial transition curve as boundary constraint conditions, and the integral of the virtual stress field on the quintic polynomial transition curve is taken as a stress field constraint condition, and the transition curve satisfying the constraint is obtained through the stress field constraint condition;
[0150] The mapping relationship between the transition curve and the robot joint motion is established through the virtual stress field, the maximum allowable acceleration of each joint of the robot is obtained, the mapping relationship is combined with the maximum allowable acceleration to establish joint acceleration constraints, and a trajectory smoothness evaluation index is constructed based on the transition curve according to the joint acceleration constraints.
[0151] In practical application scenarios, robots need to move from one position to another in the workspace, and these position points constitute the motion trajectory of the robot. The transition between adjacent trajectory points is crucial to the smoothness of robot motion. The method of the present application first obtains trajectory point data in the robot workspace, including position coordinates and attitude information. These trajectory point data can be obtained through offline planning or online sensor acquisition, accurately describing the position and attitude of the robot end effector in space, providing basic data for subsequent trajectory optimization.
[0152] After obtaining the trajectory point data, a virtual stress field proportional to the distance from the obstacle is constructed in the robot workspace. The strength of the virtual stress field is inversely proportional to the distance between the robot and the obstacle, the closer the distance, the greater the stress field strength. Assuming that there is an obstacle in the workspace, its position is (125mm, 230mm, 320mm), and the radius is 50mm. For any point (x, y, z) in space, calculate the shortest distance d from the point to the obstacle surface. When the distance is greater than the preset safety distance (such as 100mm), the stress field strength of the point can be set to zero; when the distance is less than the safety distance, the stress field strength can be set to k / d, where k is the proportional coefficient, which can take the value of 1000. For the case of multiple obstacles, the stress field strength of the robot to each obstacle can be calculated, and then the maximum value is taken as the total stress field strength of the point. The construction of the virtual stress field enables the robot to perceive the obstacles in the environment, providing the necessary information for obstacle avoidance.
[0153] Based on the position and attitude of adjacent trajectory points, a quintic polynomial transition curve is constructed. For each component of the position coordinates (x, y, z) and each component of the attitude angles (α, β, γ), a quintic polynomial function is constructed respectively. The quintic polynomial can be expressed as a function of time t, and the time parameter t ranges from 0 to 1, corresponding to the transition process from the starting point to the ending point. Similarly, for y, z coordinates and α, β, γ attitude angles, the corresponding quintic polynomials are also constructed. The reason for choosing quintic polynomial is that it can satisfy the six boundary conditions of position, velocity and acceleration at the starting point and ending point, so that the generated trajectory realizes smooth transition between adjacent trajectory points, avoiding the discontinuity of velocity and acceleration.
[0154] The position, velocity and acceleration of adjacent trajectory points are substituted into the quintic polynomial transition curve as boundary constraints. Specifically, for the start point (t = 0) and the end point (t = 1), the following boundary conditions are applied: position value, velocity value and acceleration value. By solving the equation set, the coefficients of the quintic polynomial can be obtained: a0= 100, a1= 0, a2= 0, a3= 150, a4= -400, a5= 300. Similarly, the quintic polynomial coefficients of y, z coordinates and a, b, g attitude angles are solved respectively. In practical applications, the velocity and acceleration values of the start point and the end point can be set according to the current motion state of the robot.
[0155] The integral of the virtual stress field to the quintic polynomial transition curve is taken as the stress field constraint condition. Along the transition curve, the stress field intensity of each point on the curve is calculated, and the total stress is obtained by integration. To simplify the calculation, discrete sampling points can be used for approximate integration. In specific implementation, for time parameters t = 0.01, 0.02,..., 0.99, 1.00, the position coordinates of the corresponding points on the transition curve are calculated, and then the stress field intensity of the point is calculated. The stress field intensities of all sampling points are weighted and summed to obtain the total stress value 85.2.
[0156] For the case where the total stress value is greater than the preset threshold (such as 50), the transition curve needs to be adjusted to reduce the total stress. The adjustment method is to modify the velocity and acceleration values in the boundary conditions and re-solve the quintic polynomial coefficients. Through iterative optimization, a transition curve that satisfies the stress field constraint condition is found. Using the new transition curve, the total stress value is reduced to 42.8, which satisfies the constraint condition. The optimization process can use optimization algorithms such as gradient descent method or genetic algorithm, and through multiple iterations, the velocity and acceleration values in the boundary conditions are adjusted until a solution is found that satisfies the constraint condition of the total stress value. In practical applications, the maximum number of iterations (such as 100 times) and the convergence threshold (such as 0.1) can be set to ensure the convergence and efficiency of the algorithm.
[0157] The mapping relationship between the transition curve and the joint motion of the robot is established by the virtual stress field. For each point on the transition curve, the corresponding joint angle is calculated by the inverse kinematics of the robot. For the above optimized transition curve, the position at t = 0.5 is (127.34mm, 227.34mm, 327.34mm), and the attitude angle is (32.5°, 47.5°, 62.5°). The joint angle value obtained by inverse kinematics is (15.3°, 25.7°, 85.2°, 55.4°, 30.1°, 75.6°). The kinematics inverse process needs to consider the structural parameters of the robot, such as link length, joint offset, etc., and usually uses analytical or numerical iterative method to solve. For redundant robots, there are multiple solutions, at this time we can choose the solution with the smallest joint angle change to reduce the joint motion amplitude. By performing kinematics inverse on multiple sampling points on the transition curve, the trajectory in the joint space can be obtained, thereby establishing the mapping relationship between the Cartesian space and the joint space.
[0158] The maximum allowable acceleration of each joint of the robot is obtained, which is usually provided by the robot manufacturer. The mapping relationship is combined with the maximum allowable acceleration to establish the joint acceleration constraint. For each time point on the transition curve, the acceleration value of each joint is calculated and ensured not to exceed the maximum allowable value. The calculation of joint acceleration can be obtained by second-order numerical differentiation of joint angle, or by Jacobian matrix and second-order derivative of transition curve. If the joint acceleration of a certain time point exceeds the maximum allowable value, the parameters of the transition curve need to be adjusted to reduce the joint acceleration.
[0159] Based on the transition curve, the trajectory smoothness evaluation index is constructed according to the joint acceleration constraint. The smoothness evaluation index can be defined as the integral of the square sum of joint acceleration. The calculation method is to calculate the acceleration value of each joint for the uniformly sampled points on the transition curve, then sum the square of these acceleration values, and then integrate with respect to time. Suppose the calculated smoothness evaluation index value is 450.6. In specific implementation, for time parameters t = 0.01, 0.02,..., 0.99, 1.00, the acceleration values of the six joints θ1''(t), θ2''(t),..., θ6''(t) are calculated respectively, and then the square sum of the accelerations S(t) = θ1''(t) 2 + θ2''(t) 2 +... + θ6''(t) 2 is calculated. The weighted sum of the acceleration square sums of all sampling points is obtained, and the smoothness evaluation index value is 450.6.
[0160] In practical applications, the smoothness evaluation index of each feasible transition curve scheme can be calculated, and the scheme with the minimum index value is selected as the optimal transition curve. For example, by adjusting the speed and acceleration values in the boundary conditions, multiple different transition curves are generated, and the calculated smoothness evaluation indexes are 450.6, 523.8, 398.2, and 475.1, respectively. The scheme with the index value of 398.2 is selected as the optimal scheme. Specifically, the grid search method can be used to discretely sample the speed and acceleration parameters in the boundary conditions. For each combination, a transition curve is generated, the smoothness evaluation index is calculated, and the combination with the minimum index value is selected as the optimal solution. To improve computational efficiency, heuristic algorithms such as simulated annealing or particle swarm optimization can be used to find the optimal solution in the parameter space.
[0161] The spatial distribution and the time parameter respectively refer to the position coordinate distribution of the trajectory points in the three-dimensional space and the time allocation in the trajectory execution process. The spatial distribution involves the positions (x, y, z) and attitudes (a, b, g) of the trajectory points, which determine the motion path of the robot end effector; the time parameter defines the time required for the robot to move from one trajectory point to the next, which affects the speed and acceleration characteristics of the motion.
[0162] For the optimization of spatial distribution, the curvature variation between the original trajectory points is first calculated, and the curvature mutation points are identified. For these curvature mutation points, transition points are inserted before and after them, and Bezier curves or spline curves are used for smoothing processing. After 5-10 iterations of optimization, the original sharp corners can be converted into smooth curves, and the maximum curvature is reduced to about 0.07 / mm.
[0163] For the optimization of the time parameter, the system allocates time parameters based on the length, curvature, and process requirements of the trajectory segment. For high-curvature areas, more time is allocated to reduce the speed; for straight-line segments, the robot can be accelerated. Through 5-8 iterations of calculation by the speed planning algorithm, a speed curve that satisfies the acceleration and jerk constraints is generated, so that the robot smoothly decelerates at key points and appropriately accelerates on straight-line segments, thereby achieving global smooth transition and avoiding mechanical vibration and impact.
[0164] Considering the stress field constraint and joint acceleration constraint comprehensively, the method can ensure that the robot avoids obstacles while realizing smooth transition of the trajectory. The method is suitable for trajectory planning of various robots such as industrial robots and service robots, especially in scenes where the motion trajectory of the robot needs to be accurately controlled in a complex environment. For example, in the task of part picking and placing on an assembly line, the robot needs to move smoothly in an environment with multiple obstacles. The method can generate a trajectory that can both avoid obstacles and maintain smooth motion, improving work efficiency and safety. Another application scenario is in a human-robot collaboration environment, where the robot needs to move safely and smoothly around people, avoiding sudden acceleration or deceleration. The method can generate a human-predictable and comfortable robot motion trajectory by optimizing the transition curve and evaluating the trajectory smoothness, enhancing the safety and efficiency of human-robot collaboration.
[0165] By constructing a virtual stress field and a quintic polynomial transition curve, combined with the joint acceleration constraint of the robot, the smooth optimization of the robot trajectory is realized. This method considers obstacle avoidance and joint motion characteristics, so that the generated trajectory not only meets the spatial constraint but also has good smoothness, providing an effective technical means for robot trajectory planning. In practical applications, the strength coefficient of the virtual stress field, the safety distance threshold, and the weight of the smoothness evaluation index can be adjusted according to the specific structure parameters and task requirements of the robot to obtain the most suitable trajectory planning result for a specific application scenario. The trajectory generated by this method not only ensures the safety of robot motion, but also prolongs the service life of robot components, improves the overall performance and reliability of the system.
[0166] In a second aspect of the embodiment of the present application, a die casting robot micro-spraying path planning and control system is provided, comprising:
[0167] A first unit is configured to obtain three-dimensional data of a workpiece to be sprayed, extract feature point information of the surface of the workpiece based on the three-dimensional data, and calculate spraying accessibility data of the surface of the workpiece according to the feature point information;
[0168] A second unit is configured to perform spraying path planning using an ant colony algorithm according to the feature point information and the spraying accessibility data, dynamically adjust path search weights using an adaptive pheromone update strategy, and generate an optimal spraying path sequence that meets spraying quality requirements;
[0169] The third unit is configured to calculate motion trajectory points and corresponding joint angle data of the die casting robot according to the optimal spraying path sequence and the spraying accessibility data; for the motion trajectory points and the joint angle data, a trajectory interpolation method is used to construct a transition region between the trajectory points, an optimal transition curve is calculated according to positions and postures of adjacent trajectory points, a trajectory smoothness evaluation index is constructed in combination with robot joint acceleration constraints, and spatial distribution and time parameters of the trajectory points are optimized through iterative calculation, so as to realize continuous and smooth transition of the trajectory;
[0170] The fourth unit is configured to control the die casting robot to perform a spraying operation based on the motion trajectory points and the joint angle data after smooth transition, and collect spraying process parameters in real time.
Claims
1. A method for die-casting robot micro-jet spray path planning and control, characterized in that, The method comprises the following steps: acquiring three-dimensional data of a workpiece to be sprayed, extracting feature point information of a surface of the workpiece based on the three-dimensional data, and calculating spray accessibility data of the surface of the workpiece according to the feature point information; adopting an ant colony algorithm to plan a spraying path according to the feature point information and the spray accessibility data, dynamically adjusting path search weights by adopting an adaptive pheromone updating strategy, adaptively adjusting the balance between global search and local search by introducing a simulated annealing mechanism, predicting the quality distribution of the spraying trajectory based on a recurrent neural network, realizing intelligent decision of the path planning, and generating an optimal spraying path sequence meeting the spraying quality requirements; calculating motion trajectory points and corresponding joint angle data of a die casting robot according to the optimal spraying path sequence and the spray accessibility data, adopting a trajectory interpolation method to construct a transition region between the trajectory points according to the motion trajectory points and the joint angle data, calculating an optimal transition curve according to the positions and postures of adjacent trajectory points, combining robot joint acceleration constraints to construct a trajectory smoothness evaluation index, and optimizing the spatial distribution and time parameters of the trajectory points through iterative calculation, so as to realize continuous and smooth transition of the trajectory; controlling the die casting robot to perform spraying work based on the motion trajectory points and the joint angle data after the smooth transition, and collecting spraying process parameters in real time.
2. The method of claim 1, wherein, The method comprises the following steps: constructing a multi-scale feature hierarchy based on the three-dimensional data, and extracting feature point information of a surface of the workpiece from the three-dimensional data; performing hierarchical processing on the feature point information based on the multi-scale feature hierarchy, extracting shape, texture, surface geometry attributes of the feature points, and assigning corresponding weight coefficients to the shape, texture, surface geometry attributes according to the importance of features at each level; performing adaptive weight fusion on the shape, texture, surface geometry attributes according to the weight coefficients, generating a comprehensive feature description of the feature points; establishing a local coordinate system for the feature points based on the comprehensive feature description, acquiring a neighborhood point set of the feature points, and acquiring normal vector information of the feature points by calculating the vector cross product between adjacent points in the neighborhood point set; constructing a spraying posture space containing position coordinates and posture angles according to the normal vector information of the feature points, and constructing an accessibility scoring function based on the spraying posture space; substituting distance factors, posture factors and collision factors of the feature points into the accessibility scoring function, and calculating the accessibility scores of the feature points by assigning corresponding weight coefficients to the factors according to the influence degree of each factor; calculating the accessibility scores of individual feature points based on the accessibility scoring function, and generating spray accessibility data of the surface of the workpiece by weighted accumulation of the feature points with the accessibility scores in the region, wherein the accessibility scoring function adopts a linear weighting form, which can ensure the consistency and additivity of the scoring standard.
3. The method of claim 1, wherein, The ant colony algorithm is used for spraying path planning, an adaptive pheromone updating strategy is used to dynamically adjust path search weights, and an optimal spraying path sequence meeting spraying quality requirements is generated, including: A grid node set and a feasible path set are established on the surface of a workpiece to form a search space, path lengths between nodes in the grid node set and spraying quality at nodes are respectively assigned to path quality weight coefficients to construct a search objective function; An ant colony size corresponding to a current iteration order is calculated based on the search objective function, and a search ant equal in number to the ant colony size is set in the search space; A state transition probability is calculated by respectively assigning a pheromone concentration, heuristic information and path direction factor in the search space to navigation weight proportions, and the search ant is guided to select a next grid node sequence in each iteration cycle based on the state transition probability; Local pheromone updating is performed on the grid node sequence selected by the search ant, a global updating coefficient is calculated according to the iteration cycle, and the optimal path in the grid node sequence is increased in pheromone concentration by using the global updating coefficient; An optimization evaluation value of the path is calculated based on the pheromone concentration of the optimal path, the pheromone updating amount of the next iteration cycle is adjusted according to the optimization evaluation value, the pheromone concentration of the high-quality path is continuously enhanced through multiple rounds of iteration optimization, and an optimal spraying path sequence meeting spraying quality requirements is obtained.
4. The method of claim 3, wherein, The state transition probability is calculated by respectively assigning a pheromone concentration, heuristic information and path direction factor in the search space to navigation weight proportions, including: The pheromone concentration, heuristic information and path direction factor in the search space are respectively assigned to navigation weight coefficients to construct a basic state transition probability; A prediction compensation amount is calculated based on a difference between a prediction probability value and the basic state transition probability according to historical search trajectories of previous path selections, and the navigation weight coefficients are optimized by using the prediction compensation amount; The state transition probability of the pheromone concentration, the heuristic information and the path direction factor is recalculated according to the optimized navigation weight coefficients.
5. The method of claim 1, wherein, Motion trajectory points and corresponding joint angle data of a die casting robot are calculated; and a transition region between the trajectory points is constructed in a trajectory interpolation manner for the motion trajectory points and the joint angle data, including: A workspace of the die casting robot is sampled to obtain a motion trajectory point sequence, and joint angle data corresponding to the motion trajectory point sequence is obtained through inverse kinematics solving; The motion trajectory point sequence, the joint angle data, joint speed data and joint acceleration data in a historical execution trajectory of the die casting robot are established as a trajectory database, similarity between the motion trajectory point sequence and historical trajectories is calculated according to historical trajectory data in the trajectory database, and a historical trajectory with the highest similarity is selected from the trajectory database as a reference trajectory based on the similarity; A prediction compensation amount is calculated based on the reference trajectory according to current joint angle, current joint speed and current joint acceleration of the die casting robot, and the prediction compensation amount is superimposed to the motion trajectory point sequence to obtain an optimized motion trajectory point sequence. The transition region between the trajectory points is constructed by using a quintic polynomial interpolation method for adjacent trajectory points in the optimized trajectory point sequence.
6. The method of claim 5, wherein, The joint angle data corresponding to the trajectory point sequence is obtained by inverse kinematics solution, including: Obtaining a trajectory point sequence of a die casting robot, constructing an end effector pose matrix according to motion joint parameters of the die casting robot; inputting the trajectory point sequence into the end effector pose matrix, and calculating a wrist point position corresponding to each trajectory point by using a geometric decoupling method; solving a first three-axis joint angle corresponding to each trajectory point based on the wrist point position by using a trigonometric function relationship; Performing coordinate transformation on the first three-axis joint angle and an attitude component of the end effector pose matrix to obtain a second three-axis joint angle corresponding to each trajectory point, and obtaining a complete joint angle composed of the first three-axis joint angle and the second three-axis joint angle; Obtaining a current joint angle of the die casting robot, calculating a weighted sum of squares between the complete joint angle and the current joint angle to obtain an evaluation index, selecting the complete joint angle that minimizes the evaluation index as an optimal solution joint angle, and taking the optimal solution joint angle as the joint angle data corresponding to the trajectory point sequence.
7. The method of claim 1, wherein, According to the position and attitude of adjacent trajectory points, an optimal transition curve is calculated, and a trajectory smoothness evaluation index is constructed in combination with robot joint acceleration constraints, including: According to the position and attitude of adjacent trajectory points, a virtual stress field inversely proportional to the distance from the obstacle is constructed in the robot workspace, and a quintic polynomial transition curve is constructed based on the position and the attitude; The position, velocity and acceleration of the adjacent trajectory points are substituted into the quintic polynomial transition curve as boundary constraint conditions, and the integral of the virtual stress field on the quintic polynomial transition curve is taken as a stress field constraint condition, and a transition curve satisfying the constraint is obtained through the stress field constraint condition; A mapping relationship between the transition curve and robot joint motion is established through the virtual stress field, the maximum allowable acceleration of each joint of the robot is obtained, the mapping relationship is combined with the maximum allowable acceleration to establish a joint acceleration constraint, and a trajectory smoothness evaluation index is constructed based on the transition curve according to the joint acceleration constraint.
8. A die-casting robot micro-jet spray path planning and control system for implementing the method of any one of the preceding claims 1-7, characterized by, Including: The first unit is configured to obtain three-dimensional data of a workpiece to be sprayed, extract feature point information of a workpiece surface based on the three-dimensional data, and calculate spray accessibility data of the workpiece surface according to the feature point information; The second unit is configured to perform spray path planning by using an ant colony algorithm according to the feature point information and the spray accessibility data, dynamically adjust path search weights by using an adaptive pheromone update strategy, and generate an optimal spray path sequence meeting spray quality requirements. a third unit configured to calculate motion trajectory points and corresponding joint angle data of the die casting robot according to the optimal spraying path sequence and the spraying accessibility data; for the motion trajectory points and the joint angle data, a trajectory interpolation method is used to construct a transition area between the trajectory points, an optimal transition curve is calculated according to positions and postures of adjacent trajectory points, a trajectory smoothness evaluation index is constructed in combination with robot joint acceleration constraints, and spatial distribution and time parameters of the trajectory points are optimized through iterative calculation to realize continuous and smooth transition of the trajectory; a fourth unit configured to control the die casting robot to perform a spraying operation based on the motion trajectory points and the joint angle data after smooth transition, and to collect spraying process parameters in real time.
9. An electronic device, comprising: comprise: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to invoke the instructions stored in the memory to execute the method of any one of claims 1 to 7.
10. A computer-readable storage medium having stored thereon computer program instructions, wherein, The computer program instructions, when executed by the processor, implement the method of any one of claims 1 to 7.
Citation Information
Patent Citations
Robot spraying path planning method and system based on technological parameter collaborative optimization
CN118493378A
Trajectory planning method and planning system based on improved ant colony algorithm
CN118927239A