A Machine Vision-Based Adaptive Spraying Trajectory Planning Method and System for Workpieces
By acquiring 3D images of workpieces using machine vision technology, performing pixel meshing and gradient analysis, identifying feature inflection points, and dynamically adjusting the spray gun's moving speed and posture, the problem of uneven spraying in existing spraying trajectory planning is solved, achieving uniform coverage and efficient spraying of the workpiece surface.
Patent Information
- Application Number
- CN202610384084.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-03-26
- Publication Date
- 2026-11-17
- Estimated Expiration
- 2046-03-26
AI Technical Summary
Existing spray trajectory planning methods cannot dynamically adjust the spray gun's moving speed and spray angle according to the complex shape and surface characteristics of the workpiece, resulting in uneven spray quality, inconsistent coating thickness, and increased production costs and time.
Machine vision technology is used to acquire 3D images of workpieces, perform pixel meshing and gradient analysis, identify feature inflection points, dynamically adjust the speed and posture of the spray gun, and generate an adaptive spraying trajectory.
It improves the uniformity and efficiency of workpiece surface spraying, reduces paint waste and manual intervention, and improves spraying quality and production efficiency.
Smart Images

Figure CN122284308B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of vision, and more particularly to a workpiece adaptive spraying trajectory planning method and system based on machine vision. Background Technology
[0002] With the continuous development of automated spraying technology, industrial spraying has been widely used in the automotive, electronics, and aerospace industries. The quality of spraying not only directly affects the appearance of the product but is also closely related to the amount of paint used, production efficiency, and cost control. However, traditional spraying methods have some shortcomings, such as uneven spraying, coatings that are too thick or too thin, inaccurate spraying angles, and spraying speeds unsuitable for different surface shapes. These problems often lead to resource waste, unstable coating quality, and even the need for rework, thus increasing production costs and time.
[0003] To improve coating quality and efficiency, more and more companies are adopting intelligent coating technology based on computer vision. Machine vision technology, through real-time image acquisition and analysis of workpiece surfaces, can accurately perceive information such as the workpiece's geometry and surface texture, thus providing a theoretical basis for coating path planning, coating angle adjustment, and dynamic control of the spray gun's movement speed.
[0004] Existing spraying trajectory planning methods mostly employ fixed spraying paths or a single moving speed to complete the spraying task. For workpieces with complex shapes or surfaces featuring protrusions, depressions, or bends, these methods often fail to adjust the spray gun's moving speed and spraying angle according to the actual situation, thus affecting spraying quality and efficiency. Furthermore, existing spraying path planning methods fail to fully utilize the geometric information of the workpiece surface for dynamic adjustments when dealing with areas with significant surface gradient changes, leading to poor coating uniformity and increased spraying difficulty during the spraying process. Summary of the Invention
[0005] The purpose of this invention is to provide a workpiece adaptive spraying trajectory planning method and system based on machine vision, which solves the above-mentioned technical problems pointed out in the prior art.
[0006] This invention provides a machine vision-based adaptive spraying planning method for workpiece trajectories, the specific operation steps of which include:
[0007] A spraying sensor device is used to capture a stereoscopic image of the workpiece to be sprayed. The stereoscopic image of the workpiece is then preprocessed to obtain an image to be detected.
[0008] The image to be detected is uniformly meshed to form a pixel grid, and the gradient magnitude of the vertices of the pixel grid is identified; path points are obtained according to the preset spray gun travel direction, and the gradient magnitude of the vertices is assigned to the path points to identify initial feature inflection points and form feature inflection lines; the moving speed of the spray gun is dynamically adjusted based on the feature inflection lines.
[0009] The spraying trajectory is formed based on the characteristic curve and the moving speed.
[0010] Preferably, this solution uniformly meshes the image to be detected to form a pixel grid, and identifies the gradient magnitude of the vertices of the pixel grid; path points are obtained according to the preset spray gun travel direction. The specific operation steps are as follows:
[0011] The image to be detected is uniformly gridded to form multiple pixel grids;
[0012] The gradient magnitude and gradient direction of adjacent pixels are calculated using the vertex of the pixel grid as the center.
[0013] A preset spray gun travel direction is established; a virtual sampling line is drawn on the image to be detected along the preset spray gun travel direction.
[0014] The sampling path points are collected along the sampling line according to a preset fixed step size;
[0015] For each path point, find the vertex with the shortest distance in the image to be detected, and assign the gradient magnitude of that vertex to the path point to obtain the path point gradient set.
[0016] Preferably, this scheme assigns the gradient magnitude of the vertex to the path point, identifies the initial feature inflection point, and forms a feature inflection line. The specific operation steps are as follows:
[0017] For each path point in the gradient set, calculate the rate of change of the maximum gradient value between adjacent paths;
[0018] A preset mutation threshold is set; if the gradient change rate is greater than the mutation threshold, the path point is marked as an initial feature inflection point.
[0019] Preset the neighborhood radius and minimum number of points; for each initial feature inflection point, aggregate the initial feature inflection points in the neighborhood according to the neighborhood radius, and stop clustering when the number of initial feature inflection points in the aggregate equals the minimum number of points, thus obtaining a feature inflection point cluster;
[0020] The feature inflection point clusters are fitted using the least squares method to obtain the feature inflection lines.
[0021] Preferably, this solution dynamically adjusts the spray gun's moving speed based on the identified feature bends. The specific operation steps are as follows:
[0022] The feature curve is input into a pre-constructed spray coverage model, and the instantaneous coverage contribution value is output. The distance between the reference plane of the image to be detected and the current path point is used for correction to obtain the corrected instantaneous coverage contribution value. The instantaneous speed adjustment factor is calculated based on the gradient change rate between the current path point and the previous path point. The moving speed of the spray gun is dynamically adjusted based on the preset base moving speed, the instantaneous speed adjustment factor, and the instantaneous coverage contribution value.
[0023] Preferably, this scheme inputs the feature curve into a pre-constructed spray coverage model and outputs an instantaneous coverage contribution value; then, it corrects the instantaneous coverage contribution value by using the distance between the reference plane of the image to be detected and the current path point. The specific operation steps are as follows:
[0024] A pre-constructed spray coverage model is used; the characteristic bend lines are input into the spray coverage model, and the instantaneous coverage contribution value is output.
[0025] Obtain the coordinates of the current path point of the spray gun in the feature curve and the current two-dimensional coordinates of the spray gun, and calculate the Euclidean distance of the spray gun;
[0026] A sensor is installed on the spray gun to measure the straight-line distance from the tip of the spray gun to the surface of the workpiece;
[0027] Calculate the distance deviation between the Euclidean distance and the straight-line distance of the spray gun;
[0028] The current position of the preset spray gun end coordinates;
[0029] Calculate the vertical distance between the feature bend and the current position of the spray gun end coordinates, and use it as the indentation depth;
[0030] The distance deviation value is multiplied by the indentation depth to obtain the distance compensation coefficient;
[0031] The instantaneous coverage contribution value is corrected using the distance compensation coefficient to obtain the corrected instantaneous coverage contribution value.
[0032] Preferably, this scheme calculates the instantaneous velocity adjustment factor based on the gradient change rate between the current path point and the previous path point. The specific operation steps are as follows:
[0033] Calculate the gradient rate of change between the current path point and the previous path point;
[0034] Preset the maximum and minimum gradient rates of change;
[0035] The velocity fundamental factor is calculated using the maximum and minimum gradient rates of change, as well as the gradient rate of change.
[0036] Obtain the real-time axis direction vector and standard posture of the spray gun;
[0037] The orientation deviation angle is calculated using the real-time axis direction and the standard attitude.
[0038] The nonlinear mapping of the direction deviation angle is used to obtain the attitude correction factor;
[0039] The instantaneous velocity adjustment factor is obtained by multiplying the attitude correction factor with the velocity base factor.
[0040] Preferably, this solution calculates the dynamically adjustable spray gun movement speed based on the preset base movement speed, instantaneous speed adjustment factor, and instantaneous coverage contribution value. The specific operation steps are as follows:
[0041] A preset base movement speed is determined; the preset base movement speed is then multiplied by an instantaneous speed adjustment factor to obtain the latest changing speed.
[0042] The instantaneous coverage contribution value is multiplied by the latest change rate to obtain the moving speed of the dynamically adjusted spray gun.
[0043] Preferably, this solution obtains the real-time axis direction and standard posture of the spray gun; the direction deviation angle is calculated using the real-time axis direction and standard posture, and the specific operation steps are as follows:
[0044] Obtain the Z-axis direction vector of the spray gun end coordinates, and use it as the real-time axis direction vector of the spray gun;
[0045] Based on the current position of the spray gun end coordinates, filter the path points in the Z-axis direction vector that are perpendicular to the feature curve;
[0046] The coordinates of the path point in the image to be detected are determined, and the pixel grid in which it is located is determined based on the coordinates. The centroid coordinates are interpolated using the gradient vectors of the three vertices of the pixel grid to obtain the real-time normal vector, which serves as the standard pose.
[0047] The direction deviation angle is obtained by calculating using the real-time axis direction vector and the real-time normal vector of the spray gun.
[0048] Preferably, this solution nonlinearly maps the direction deviation angle into an attitude correction factor, and the specific operation steps are as follows:
[0049] The radius of the influence area is preset for each path point;
[0050] Calculate the shortest distance between the path point and the vertex, and determine whether the shortest distance is less than or equal to the radius of the preset influence area;
[0051] If so, then determine that the vertex is within the radius of the influence area; at the coordinate position of the path point, along the vertical direction of the feature curve, take one analysis point on each side of the vertical direction;
[0052] And calculate the surface gradient magnitude at the two analysis points;
[0053] The magnitude difference of the surface gradient at the computational analysis point;
[0054] Calculate the distance between the two analysis points;
[0055] The surface jump gradient is calculated using the amplitude difference and the distance to the analysis point;
[0056] An adjustable scaling factor is preset; the dynamic weighting factor is obtained by calculating the dynamic weighting factor using the adjustable scaling factor and the surface jump gradient.
[0057] The attitude correction factor is obtained by mapping the dynamic weighting coefficients with the orientation deviation angle using nonlinearity.
[0058] Accordingly, the present invention also proposes a workpiece trajectory adaptive spraying planning system based on machine vision, characterized in that it includes: a data acquisition module; an analysis module; and a recognition module;
[0059] The acquisition module is used to use a spraying sensor device to take a three-dimensional picture of the workpiece to be sprayed, and to preprocess the three-dimensional image of the workpiece to obtain the image to be detected.
[0060] The analysis module is used to uniformly mesh the image to be detected to form a pixel grid and identify the gradient magnitude of the vertices of the pixel grid; obtain path points according to the preset spray gun travel direction and assign the gradient magnitude of the vertices to the path points; identify initial feature inflection points to form feature inflection lines; and dynamically adjust the moving speed of the spray gun based on the feature inflection lines.
[0061] The identification module is used to form a spraying trajectory based on the feature curve and the moving speed.
[0062] Compared with the prior art, the embodiments of the present invention have at least the following technical advantages:
[0063] Analysis of the above-mentioned machine vision-based adaptive spraying trajectory planning method and system for workpieces provided by the present invention shows that, in specific applications, a spraying sensor device driven by a robotic arm is used to take a three-dimensional picture of the workpiece, generating a depth map that can observe the top, front, and side surfaces of the workpiece, thereby obtaining all-round geometric information of the workpiece; the three-dimensional image in the solution can not only provide accurate spatial data for spraying path planning, but also adjust the spraying distance and spray gun movement speed according to the surface morphology, achieving simultaneous coverage of multiple surfaces, significantly saving spraying materials and time;
[0064] Furthermore, the image to be detected is uniformly meshed to form a discrete pixel grid, and the gradient magnitude of each vertex is identified. In this scheme, by associating the preset travel direction of the spray gun with the path points and assigning corresponding gradient information to the path points, the system can identify the feature inflection points of the protrusions, depressions and corners on the workpiece surface, and further generate feature inflection lines. In this scheme, during the spraying process, it is difficult to spray high gradient or corner areas. The system dynamically adjusts the moving speed of the spray gun, decelerating it at protrusions or sharp corners and accelerating it in flat areas, thereby optimizing the uniformity of spraying and the coating quality.
[0065] Furthermore, the spraying trajectory is generated based on the characteristic curves and speed planning, enabling the spray gun to adapt to the complex shape of the workpiece surface, intelligently control the moving speed and spraying posture, improve spraying efficiency, and reduce manual intervention and rework rate. The spraying process is upgraded from the traditional simple linear motion to adaptive intelligent spraying based on surface features, which not only ensures uniform coating coverage, but also realizes high efficiency and material saving in spraying operations, and has good prospects for industrial application. Attached Figure Description
[0066] Figure 1 This is a flowchart of the main process of a machine vision-based adaptive spraying planning method for workpiece trajectory in Example 1.
[0067] Figure 2 This is a three-dimensional schematic diagram of a workpiece trajectory adaptive spraying planning method based on machine vision, as described in Embodiment 1.
[0068] Figure 3 This is a flowchart of the characteristic curve of a workpiece trajectory adaptive spraying planning method based on machine vision, as described in Example 1.
[0069] Figure 4 This is a flowchart of the instantaneous speed adjustment factor in a machine vision-based adaptive spraying planning method for workpiece trajectory, as described in Example 1.
[0070] Figure 5 This is a schematic diagram of the spraying coverage of a workpiece trajectory adaptive spraying planning method based on machine vision, as described in Embodiment 1.
[0071] Figure 6 This is a schematic diagram of the path point depression in an adaptive spraying planning method for workpiece trajectory based on machine vision, as described in Embodiment 1.
[0072] Figure 7 This is a flowchart of the dynamic weighting coefficients for a machine vision-based adaptive spraying planning method for workpiece trajectories, as described in Example 1.
[0073] Figure 8This is a flowchart of a workpiece trajectory adaptive spraying planning system based on machine vision, as described in Embodiment 2.
[0074] Figure 9 This is a schematic diagram of a storage medium for applying the aforementioned machine vision-based adaptive spraying planning method for workpiece trajectories.
[0075] Labels: Acquisition module 10; Analysis module 20; Identification module 30; Processor 1110; Communication interface 1120; Memory 1130; Computer storage medium 1140. Detailed Implementation
[0076] The technical solution of the present invention will now be clearly and completely described with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0077] The present invention will now be described in further detail with reference to specific embodiments and accompanying drawings.
[0078] Example 1
[0079] like Figure 1 , 2 As shown, this invention provides a machine vision-based adaptive spraying planning method for workpiece trajectories, the specific operation steps of which include:
[0080] S10: Use a spraying sensor device to take a stereoscopic picture of the workpiece to be sprayed to obtain a stereoscopic image of the workpiece, and preprocess the stereoscopic image of the workpiece to obtain an image to be detected.
[0081] It should be noted that the spraying sensor device mentioned above includes a camera and a spraying machine. A robotic arm uses the spraying sensor device to capture a stereoscopic image of the workpiece to be sprayed, which is a depth map (i.e., a depth map directly output by a 3D camera (such as a ToF or light field camera)). This stereoscopic image of the workpiece can observe the top, front, and sides of the workpiece to be sprayed, thereby analyzing the spraying trajectory and finally setting the spraying movement speed in real time. The reason for taking stereoscopic images of the workpiece to be sprayed is that, in the final spraying process, spraying time and spraying material can be saved by adjusting the spraying distance and movement speed, because stereoscopic spraying can simultaneously spray and cover multiple surfaces of the workpiece; and by adjusting the movement speed, full coverage of the workpiece can be achieved, preventing overlapping and uneven coverage.
[0082] S20: The image to be detected is uniformly meshed to form a pixel grid, and the gradient magnitude of the vertices of the pixel grid is identified; path points are obtained according to the preset spray gun travel direction, and the gradient magnitude of the vertices is assigned to the path points; initial feature inflection points are identified to form feature inflection lines; the moving speed of the spray gun is dynamically adjusted based on the feature inflection lines.
[0083] It should be noted that the image to be detected is uniformly pixelated, which divides the current image into multiple pixel grids and vertices. The pixel grid allows the surface to be discretized, which facilitates calculation and path planning. Continuous surfaces are difficult to calculate the path point attributes directly, and the gridding and discretization process facilitates calculation. The gradient magnitude (maximum / minimum gradient) of each vertex is identified. After the path points obtain gradient information, it is used to determine the surface curvature along the path. The path points themselves have no geometric attributes; the gradient of the nearest vertex reflects the local surface morphology. The spray gun travels according to the preset travel direction (the initial travel direction is set based on the current position of the spray sensor device, because the spray gun and camera are in the same direction). The process involves timing and camera analysis before the spray gun begins spraying. Spraying is based on the position of the spray sensor (i.e., the position of the spray gun nozzle) to obtain path points. The gradient of the nearest vertex is assigned to these path points. Feature inflection points and feature curves provide crucial geometric information during spraying, helping to control the spray gun's speed and attitude. Areas with large gradients may be more difficult to spray, requiring deceleration or attitude changes. The gradient changes identify initial feature inflection points, which are then connected to form feature curves. These curves are used to reduce the spray gun speed at protrusions or corners, improving spray uniformity. The spray gun's movement speed is dynamically adjusted based on the feature curve information to ensure spray quality and prevent insufficient spraying or excessive coating thickness at protrusions or sharp corners.
[0084] S30: A spraying trajectory is formed based on the characteristic curve and the moving speed.
[0085] It should be noted that when the spray gun moves along the trajectory, it can adapt to changes in surface shape and gradient. It automatically reduces speed in high gradient or corner areas and increases speed in flat areas, improving efficiency while ensuring coating uniformity. Spraying corners, protrusions, and depressions is more difficult and requires control of speed and path. Dynamic trajectory generation ensures both spraying efficiency and quality, transforming the spraying task from simple linear movement to optimized path planning, reducing the need for manual adjustment or rework.
[0086] like Figure 3 As shown, specifically, in step S20, the image to be detected is uniformly meshed to form a pixel grid, and the gradient magnitude of the vertices of the pixel grid is identified; path points are obtained according to the preset spray gun travel direction, and the gradient magnitude of the vertices is assigned to the path points; initial feature inflection points are identified to form feature inflection lines; the moving speed of the spray gun is dynamically adjusted based on the feature inflection lines. The specific operation steps are as follows:
[0087] S21: The image to be detected is uniformly gridded to form multiple pixel grids (that is, each pixel grid is composed of four connected pixels, and these four pixels are all vertices).
[0088] Using the vertex of the pixel grid as the center, calculate the gradient magnitude and gradient direction of the adjacent pixel grids (that is, the gradient magnitude is the direction of the most drastic grayscale change in the image, which may be a corner, that is, a place that is difficult to paint, such as a side direction or a slope towards the bottom; the gradient direction reflects the local texture direction of the pixel).
[0089] It should be noted that the above steps simplify calculation and analysis by decomposing the image to be detected into a uniform pixel grid; discretizing the complex image to be detected into several simple squares makes subsequent operations (such as gradient analysis) more accurate and easier to process; and the calculated gradient magnitude and gradient direction reflect the orientation of the grid and the direction of the most dramatic gray-level changes, thereby enabling the calculation of the local texture direction of the pixel, which helps to reduce local noise and obtain a smoother result (that is, it is easier to reflect the local texture direction), reduces the error caused by the gradient direction of a single pixel grid, makes the gradient vector of each vertex smoother, and avoids the influence of local anomalies on the overall image to be detected.
[0090] S22: Preset spray gun travel direction (i.e., for example, if a zigzag path is chosen, then the "travel direction" is the direction parallel to the long side of the zigzag, and this direction determines on which path the gradient changes will be analyzed next).
[0091] A virtual sampling line (which may be the spraying trajectory) is drawn on the image to be detected along the preset spray gun travel direction.
[0092] The sampling path points are collected along the sampling line according to a preset fixed step size;
[0093] For each path point, find the vertex with the shortest distance in the image to be detected, and assign the gradient magnitude of the vertex to the path point (that is, the shortest distance is determined by the two-dimensional coordinates of the path point, and then the distance is calculated with the vertex to filter the shortest distance), thus obtaining the set of gradients of the path points (that is, reflecting the gradient changes along the path).
[0094] It should be noted that a preset spray gun travel direction (such as a zigzag path) is used, and a virtual sampling line is created along this path. The path defines the spray gun's trajectory during the spraying process, accurately simulating the spraying process. Furthermore, gradient data along the path is collected through the virtual sampling line, facilitating the analysis of the spraying difficulty. For each path point, the shortest distance to a vertex in the image to be detected is calculated, and the gradient magnitude of that vertex is assigned to the path point. The gradient of the path point can realistically reflect the local geometric features on the path. The gradient changes along the path point can reflect the surface morphology changes of the spray gun during the spraying process, especially on complex surfaces, enabling accurate analysis of the spraying difficulty.
[0095] The gradient magnitude of the vertex mentioned above is assigned to the path point because path points are usually discrete sampling points without grid information. Gradient calculation requires local neighborhood information, but path points are not necessarily on grid vertices, so directly calculating the gradient is unreliable or infeasible. Therefore, assigning the gradient through the nearest vertex is a standard method that is both simple and robust.
[0096] S23: For each path point in the gradient set, calculate the rate of change of the maximum gradient value between adjacent paths (i.e., the formula is...). ;in, (This is expressed as a fixed step size, which is the distance between adjacent path points). This represents the maximum gradient value of the i-th path point in the set of path point gradients. This represents the maximum gradient value of the (i+1)th path point in the set of path point gradients.
[0097] A preset mutation threshold is set; if the gradient change rate is greater than the mutation threshold, the path point is marked as an initial feature inflection point (indicating the location of the gradient mutation).
[0098] A preset neighborhood radius and minimum number of points are set. For each initial feature inflection point, the initial feature inflection points in the neighborhood are grouped according to the neighborhood radius. When the number of initial feature inflection points in the group equals the minimum number of points, the clustering stops, resulting in a feature inflection point cluster (i.e., a center point is selected for clustering according to the neighborhood radius. Based on the principle of clustering the nearest distance, when the number of clusters reaches the minimum number of points, the clustering stops, and the remaining initial feature inflection points that are not clustered in the neighborhood radius are removed as isolated points; the feature inflection point cluster is represented as a feature boundary, exhibiting a continuous chain distribution).
[0099] The least squares method is used to fit the clusters of the feature inflection points to obtain the feature inflection lines (that is, the feature inflection lines represent the initial travel trajectory of the spray gun on the workpiece, and also represent the inflection point position that is most difficult to spray on the workpiece; if the feature is a lace edge, it can be fitted as a straight line; if it is curved, it is fitted as an arc; at the same time, the feature inflection lines are travel trajectories, mainly for subsequent identification of the spraying distance, coverage and spraying speed at different inflection points).
[0100] It should be noted that the above steps involve calculating the gradient change rate of adjacent path points to identify the location of gradient abrupt changes, i.e., feature inflection points. This step helps to locate key change points in the spray gun path. Marking key feature points in the spray gun trajectory helps to optimize the spraying trajectory, especially on workpieces with complex shapes, and is used to focus on areas that are difficult to spray. Neighborhood clustering is performed on the initial feature inflection points to select a center point, and other feature inflection points are clustered according to the neighborhood radius. This step obtains the feature boundary of the spraying path through clustering. The clustering process helps to discover continuously changing regions in the spray gun trajectory and identify key parts of the spraying path. Least squares fitting is performed on the feature inflection point clusters to obtain feature inflection lines. These feature inflection lines reflect the initial travel trajectory of the spray gun. The scheme is then fitted to determine the initial spraying trajectory of the spray gun (such as a straight line or an arc), providing accurate starting information for subsequent dynamic adjustments.
[0101] S24: Input the feature curve into the pre-constructed spray coverage model and output the instantaneous coverage contribution value; and correct the instantaneous coverage contribution value by using the distance between the reference plane of the image to be detected and the current path point; calculate the instantaneous speed adjustment factor based on the gradient change rate between the current path point and the previous path point; and calculate the dynamic adjustment speed of the spray gun based on the preset base moving speed, the instantaneous speed adjustment factor, and the instantaneous coverage contribution value.
[0102] It should be noted that inputting the feature curves into the spray coverage model and calculating the instantaneous coverage contribution value of each path point during the spraying process is the foundation for analyzing the spraying effect. Based on the geometry of each path point, the coverage contribution during the spraying process is obtained, ensuring spraying uniformity and quality. The above steps correct the instantaneous coverage contribution value by adjusting the distance between the reference plane of the image to be detected and the current path point, and further calculate the speed adjustment factor to ensure coverage consistency during the spraying process. The spray gun's moving speed is dynamically adjusted based on the actual distance of the path point and the gradient change rate to ensure the spraying quality of each point. The spray gun's moving speed is also dynamically adjusted based on the preset base moving speed, instantaneous speed adjustment factor, and instantaneous coverage contribution value. These steps maintain spraying uniformity by adjusting the spray gun speed in real time, avoiding uneven coverage caused by excessive gradient changes or inconsistent spray gun speeds.
[0103] like Figure 4 As shown, specifically, in step S24, the feature curve is input into the pre-constructed spray coverage model, and the instantaneous coverage contribution value is output; the distance between the reference plane of the image to be detected and the current path point is used for correction to obtain the corrected instantaneous coverage contribution value; the instantaneous speed adjustment factor is calculated based on the gradient change rate between the current path point and the previous path point; the moving speed of the spray gun is dynamically adjusted based on the preset base moving speed, the instantaneous speed adjustment factor, and the instantaneous coverage contribution value. The specific operation steps are as follows:
[0104] S241: Pre-build a jet coverage model; input the feature curve into the jet coverage model and output the instantaneous coverage contribution value;
[0105] Obtain the coordinates of the current path point of the spray gun in the feature curve and the current two-dimensional coordinates of the spray gun, and calculate the Euclidean distance of the spray gun (that is, the straight-line distance between the tip of the spray gun and the surface).
[0106] A sensor is installed on the spray gun to measure the straight-line distance from the tip of the spray gun to the surface of the workpiece;
[0107] Calculate the distance deviation between the Euclidean distance and the straight-line distance of the spray gun (i.e., subtract the two and then calculate the absolute value; the larger the value, the more serious the deviation from the ideal spraying distance, and the greater the threat to the uniformity of coverage).
[0108] It should be noted that the above steps construct a spray coverage model using spray gun parameters (such as nozzle type, spray angle, atomization diameter, etc.) to calculate the coverage distribution during the spraying process. This model can accurately describe the coating deposition characteristics (i.e., overlap coverage) during the spray gun spraying process. The above steps also measure the deviation between the actual distance from the spray gun tip to the workpiece surface and the ideal spraying distance to determine if the current distance between the spray gun and the workpiece surface meets the requirements; the deviation value directly affects the coverage uniformity; the spray intensity coverage is typically...
[0109] The elliptical or circular area has a diameter determined by the nozzle and distance. The assessment focuses on how many pixels belonging to the feature curves are covered within this circular area, or how much of the graphic area to be painted is covered. A high contribution value indicates the spray gun is covering the main feature areas (edges, graphic interiors), allowing for continued normal speed. A low contribution value indicates the spray gun is spraying in blank areas (wasting paint) or deviating from the target trajectory, requiring slowing down or adjustment. Therefore, the main focus is on ensuring the correct areas are being sprayed, avoiding missed areas or over-spraying (i.e., spraying too thickly, such as...). Figure 5As shown, the initial spraying of this spray gun is a three-dimensional spray, meaning it sprays according to the camera angle. This allows for spraying the workpiece at the maximum angle and range, saving time and paint. Subsequently, the spraying angle, distance, speed, and other parameters are adjusted in real time based on different inflection points.
[0110] S242: Preset the current position of the spray gun end coordinates (that is, the outlet position of the spray gun nozzle, which is the spray sensor device. As explained in step S10 above, the spray sensor device includes the spraying machine and the camera, so it can determine the current position of the spray gun end coordinates).
[0111] Calculate the vertical distance between the characteristic bend line and the current position of the spray gun end coordinates, as the recess depth (i.e., if the recess depth is large (e.g., at the bottom of a deep cavity), it indicates a high risk of space constraint; if the recess depth is close to 0 (on a flat surface), it indicates a low risk; some path points of the characteristic bend line are gentle, while others are bends representing curves, so it may be a deep cavity, such as...). Figure 6 (as shown)
[0112] The distance deviation value is multiplied by the indentation depth to obtain the distance compensation coefficient (i.e., for example, shallow pit + small deviation, such as a depth of 10mm and a deviation of 2mm, the distance compensation coefficient = 20, and the compensation requirement is low; deep pit + large deviation, such as a depth of 50mm and a deviation of 10mm, the distance compensation coefficient = 500, and the compensation requirement is high; the product amplifies the dangerous deviation that occurs in the danger zone, and even if the distance deviation value is the same, more aggressive compensation is required in the deep cavity (where the indentation depth is large)).
[0113] The instantaneous coverage contribution value is corrected using the distance compensation coefficient to obtain the corrected instantaneous coverage contribution value (i.e., because different surface depressions of the workpiece indicate different surface flatness, the final coverage will also deviate, resulting in different coverage at different locations. Therefore, the distance compensation coefficient is used to adjust the distance between the spray gun and the surface, thereby adjusting the coverage).
[0114] It should be noted that the spray coverage model is constructed using fixed parameters such as the nozzle type, spray angle, atomization diameter, and fan width of the spray gun. When this feature curve is input into the spray coverage model, the paint film coverage distribution is output when the spraying distance is d and the spray gun tilt angle is θ. The model is usually fitted by a large amount of experimental data.
[0115] The above steps determine the depth of the depression on the workpiece surface by calculating the vertical distance between the feature curve and the current position of the spray gun tip coordinates. This helps to understand the spraying difficulty of the spray gun on complex geometric surfaces. If there is a deep depression on the surface, the spraying distance of the spray gun will become more difficult, leading to uneven coverage in some areas. The above steps use the calculation of the depression depth to assess the risk of spraying in these areas. Multiplying the distance deviation value by the depression depth yields a distance compensation coefficient, which is used to quantify the impact of distance deviation on coverage uniformity and make adjustments in areas where necessary. This coefficient can amplify deviations occurring in dangerous areas (such as the bottom of deep cavities or depression areas), thereby prompting the system to compensate more actively and ensuring that the spraying quality in these areas is not significantly affected. The above steps correct the instantaneous coverage contribution value through the distance compensation coefficient, further adjusting the spraying behavior of the spray gun to make the coverage more uniform. Based on the actual situation of the workpiece surface (such as the depression depth), the distance between the spray gun and the surface is dynamically adjusted to ensure the coverage uniformity of different areas during the spraying process.
[0116] S243: Calculate the gradient rate of change between the current path point and the previous path point (the specific calculation has been explained in step S24 above and will not be repeated here).
[0117] Preset the maximum and minimum gradient rates of change;
[0118] Using the maximum gradient rate of change With minimum gradient rate of change and gradient rate of change The fundamental factor for calculating speed (i.e.) ;in This is the adjustment range coefficient (e.g., 0.5, representing the maximum adjustable value). When the gradient rate of change is at its maximum, At its maximum; when the rate of change is minimum, Approaching 1);
[0119] It should be noted that the above steps determine the surface changes on the path by calculating the gradient change rate between the current path point and the previous path point. Gradient changes directly affect the spraying quality, especially in areas with large surface changes. The gradient change rate reflects the complexity of the path. When the gradient change is large, the spray gun may need to adjust its speed or spraying strategy to avoid uneven spraying. The gradient change rate is used to calculate the basic speed factor of the spray gun. When the gradient change is large, the spray gun speed needs to be adjusted to avoid uneven coverage. This factor helps to regulate the speed of the spray gun in the path, especially in complex areas (such as raised or recessed areas), where it can adapt to gradient changes by decelerating or accelerating, thereby ensuring consistent coverage.
[0120] S244: Obtain the real-time axis direction vector of the spray gun (i.e., the Z-axis direction, which is the direction during normal vertical spraying) and the standard posture (i.e., the spray gun's posture changes differently when spraying inside the workpiece, at the bottom, or at a corner, meaning the spraying direction changes differently; therefore, the standard posture can also be represented as the real-time normal vector using the interpolation of the gradient vectors of the three vertices of the pixel grid of the image to be detected; since the real-time normal vector is perpendicular to the real-time axis direction (i.e., the Z-axis direction), and the real-time axis direction is perpendicular to the normal vector, the direction deviation angle can be calculated using the product in the following steps).
[0121] The directional deviation angle is calculated using the real-time axis direction and the standard attitude (i.e., product calculation, which is the angle deviation).
[0122] The nonlinear mapping of the direction deviation angle is used to obtain the attitude correction factor;
[0123] The instantaneous velocity adjustment factor is obtained by multiplying the attitude correction factor with the velocity base factor.
[0124] It should be noted that the above-mentioned use of a nonlinear function to map the orientation deviation angle into an attitude correction factor is because, in actual movement, due to the limitations of the robot joints, the spray gun may not be able to maintain an ideal posture that is perfectly perpendicular to the workpiece surface; this tilt also affects coverage. This step superimposes the effect of this attitude deviation into the speed adjustment factor in a "nonlinear" manner. Furthermore, the effect of attitude deviation on coverage is not linear; a deviation of 5 degrees may have little effect, but a deviation of 30 degrees may cause a sharp decrease in coverage. A dynamic weighting coefficient ω related to the normal (the degree of abrupt change in the normal on both sides of the real-time axis direction) is introduced; then, a nonlinear function (such as a sine function, exponential function, or lookup table) is used to map the angle deviation into a correction factor. ;in Functions are a manifestation of nonlinearity. This is expressed as angular deviation, at small angles. The change is gradual at large angles and drastic at large angles; β represents the scaling factor of the intensity of the effect of attitude deviation; when β is large, it means that even a slight tilt of the spray gun will have a significant impact on coverage; when β is small, it means that the spray gun is not sensitive to attitude changes, and even a slight tilt will not significantly change the coverage; when β=0, the formula degenerates into... , indicating that attitude deviations are completely ignored; ω represents the dynamic weighting coefficient;
[0125] S245: Preset base moving speed (i.e., the standard spraying speed set by the process engineer (e.g., 500 mm / s));
[0126] The latest changing speed is obtained by multiplying the preset base moving speed by the instantaneous speed adjustment factor;
[0127] The instantaneous coverage contribution value is multiplied by the latest change rate to obtain the moving speed of the dynamically adjusted spray gun.
[0128] It should be noted that the instantaneous coverage contribution value mentioned above includes the gradient change rate of the feature inflection line. When the change rate is greater than 0, it means that when moving from a flat area to a raised / depressed area, deceleration is required to prevent coverage buildup. When the change rate is less than 0, when moving from a raised / depressed area to a flat area, acceleration is required. Therefore, by multiplying the instantaneous coverage contribution value with the latest change rate, the moving speed of the spray gun can be dynamically adjusted. This is equivalent to using the instantaneous coverage contribution value to correct the latest change rate, thereby obtaining the optimal spraying.
[0129] The preset base movement speed is multiplied by the instantaneous speed adjustment factor to obtain the dynamically adjusted spray gun speed. This speed is adjusted in real time according to the complexity of the path and the spray gun posture. The above-mentioned real-time calculation of the spray gun speed is used to dynamically adjust the speed according to surface characteristics and spray gun posture during the spraying process, avoiding uneven coverage due to excessively fast or slow spraying speeds. The spray gun speed is further adjusted based on the instantaneous coverage contribution value and the latest change speed. The coverage contribution value contains gradient change information, which is used to guide the spray gun to adapt to the spraying requirements of different surfaces during the spraying process. The above-mentioned dynamic adjustment of the spray gun speed can avoid the accumulation or unevenness of coverage during the spraying process, making the spraying effect of different areas more consistent; for example, recessed areas need to be sprayed at a slower speed, while raised areas can be sprayed at a faster speed.
[0130] like Figure 7 As shown, specifically, in step S244, the real-time axis direction and standard posture of the spray gun are obtained; the direction deviation angle is calculated using the real-time axis direction and standard posture; the direction deviation angle is nonlinearly mapped to an posture correction factor. The specific operation steps are as follows:
[0131] S2441: Obtain the Z-axis direction vector of the spray gun end coordinates, as the real-time axis direction vector of the spray gun (that is, the Z-axis direction vector is the direction the spray gun is currently pointing, which is the spraying direction).
[0132] Based on the current position of the spray gun end coordinates, filter the path points in the Z-axis direction vector that are perpendicular to the feature curve;
[0133] The coordinates of the path point in the image to be detected are determined, and the pixel grid in which it is located is determined based on the coordinates. The centroid coordinates are interpolated using the gradient vectors of the three vertices of the pixel grid to obtain the real-time normal vector, which serves as the standard pose.
[0134] The direction deviation angle is calculated using the real-time axis direction vector and the real-time normal vector of the spray gun. (That is, because, in an ideal situation, the real-time normal vector is the reference for the standard posture of the spray gun; but in actual control, it is only the target, while the real-time axis of the spray gun is the actual axis, and the two are usually not equal; therefore, there is a certain direction deviation angle, which indicates the degree to which the spray gun deviates from the vertical direction).
[0135] It should be noted that obtaining the Z-axis direction vector at the end of the spray gun, i.e., the current spray direction of the spray gun, as the real-time axis direction vector, is a fundamental parameter in the spraying process, determining the precise direction of the spray gun. The above steps, by obtaining the real-time direction of the spray gun, ensure that the spray gun's spray is correctly aligned with the target surface, reducing uneven coverage caused by the spray gun deviating from the predetermined direction. Based on the coordinates of the spray gun's end, path points perpendicular to the feature curve are selected to ensure that the angle of contact between the spray gun and the workpiece surface during the spraying process meets the requirements, thereby ensuring the accuracy of the spray gun's spray path and preventing the spray gun from deviating excessively from the target spraying position. This affects the spraying quality. The coordinates of the path points in the image to be inspected are determined based on their positions, and the corresponding normal vector is obtained through interpolation as the standard spray gun posture. The standard normal vector obtained through interpolation in the above steps serves as the target direction for spray gun adjustment, helping the spray gun maintain a suitable spraying angle and ensuring uniform coverage. The deviation between the real-time axis direction of the spray gun and the standard normal vector is compared to obtain the angular deviation between the spray gun and the ideal spraying direction. The calculation of the directional deviation angle accurately reflects the degree to which the spray gun deviates from the ideal spraying angle, which helps in subsequent spray gun posture adjustments and avoids uneven coverage.
[0136] S2442: Preset the radius of influence area for each path point (e.g., 20mm, which is a process parameter indicating the range on both sides of the bend that will be affected by the sudden change in the bend).
[0137] Calculate the shortest distance between the path point and the vertex, and determine whether the shortest distance is less than or equal to the preset influence area radius (i.e., the purpose of the determination is to identify whether the spraying has an impact on the surrounding surface. For example, if the spraying is carried out along the feature curve and the other surfaces are also affected, then the other surfaces may be covered when spraying, which is equivalent to double spraying).
[0138] If so, then determine that the vertex is within the radius of the influence area; at the coordinate position of the path point, along the vertical direction of the feature curve, take one analysis point on each side of the vertical direction;
[0139] It should be noted that a pre-defined radius of influence area (e.g., 20mm) is set for each path point, representing the range of influence of the feature curve changes on the surrounding surface during the spraying process. This radius of influence area helps identify the potential impact of the spray gun path on the surrounding surface, especially when the path turns or the spray gun approaches complex areas, helping to identify potential uneven coverage. The shortest distance between the current path point and the vertex is calculated to determine whether the path point is within the influence area. By calculating the shortest distance, it is possible to determine whether the path point will have a spraying impact on the surrounding workpiece surface. If it is within the influence area, it may cause double spraying or uneven coverage. If the shortest distance is less than the pre-defined radius of influence area, it is determined that the vertex is affected, and the spraying path of the spray gun is adjusted to avoid repeated spraying. The above steps, through this determination, avoid repeated spraying between spray gun paths, thereby avoiding uneven coverage in the same area. Analysis points on both sides of the path point in the vertical direction are selected to further calculate the change in the surface gradient amplitude. The above analysis of the surface conditions on both sides of the path point is used to quantify the impact of the spray gun direction deviation angle and make targeted adjustments to ensure spraying quality.
[0140] In the above, the two analysis points are usually located on both sides of the path point. The above steps select these analysis points to analyze the possible influences on the spray gun during the spraying process, especially the influence of surface morphology (such as corners, protrusions or depressions). The analysis points are located near the spraying path and are mainly used to calculate the changes in the sprayed surface shape and the adaptability of the spray gun by the difference in normal vectors.
[0141] S2443: And calculate the surface gradient magnitude at the two analysis points (because the two sides of the feature curve are the workpiece surface, so it is the surface gradient magnitude).
[0142] The magnitude difference of the surface gradient at the computational analysis point;
[0143] Calculate the distance between the two analysis points;
[0144] The surface jump gradient is calculated using the amplitude difference and the distance to the analysis point (formula is...). ,in This is the distance between two analysis points; the larger the value, the sharper the bend. Represented as amplitude difference; (represented as surface jump gradient);
[0145] Preset adjustable scaling factor (i.e., control the influence of the jump gradient on the final result);
[0146] The dynamic weighting coefficient (also the compensation coefficient) is calculated using an adjustable scaling factor and the surface jump gradient, serving as the compensation coefficient for the attitude correction factor; the formula is as follows: Where 1 is the base value, indicating no additional weighting; This means that the larger the jump gradient, The larger; This is expressed as an adjustable scaling factor, controlling the influence of the jump gradient on the final result; even the real-time directional deviation angle of the current spray gun. It's not large, but if it's located on the edge of a very steep bend ( (If the risk is very high), the system will also consider it high, and thus... enlarge (the impact);
[0147] It should be noted that the above steps assess the degree of change in feature curves and abrupt changes in surface shape by calculating the difference in surface gradient amplitude between analysis points on both sides of the path point. The difference in normal vectors reflects changes in the workpiece surface shape (such as sharp changes at corners), which directly affects the spraying behavior of the spray gun and thus the coverage. The above calculation of surface jump gradient using amplitude difference and analysis point distance is used to quantitatively describe the severity of surface shape changes. Normal jump gradient is an important indicator of feature curve changes; a larger value indicates a sharper workpiece surface and a higher spraying difficulty. Calculating jump gradient is used to precisely adjust the spraying strategy of the spray gun. The above calculation of dynamic weighting coefficient using the product of proportional coefficient and jump gradient further corrects the spraying parameters of the spray gun. Even if the real-time directional deviation angle of the spray gun is small, if the surface changes drastically at the path point, the dynamic weighting coefficient will amplify the impact of this deviation, helping the spray gun to more accurately adapt to the spraying requirements of complex surfaces.
[0148] S2444: The dynamic weighting coefficient and the orientation deviation angle are mapped and calculated using nonlinearity to obtain the attitude correction factor (i.e., the calculation formula process is in step S244 above, and will not be repeated here).
[0149] It should be noted that by combining the dynamic weighting coefficient with the directional deviation angle through nonlinear mapping, the attitude correction factor is obtained. This correction factor is used to adjust the spray gun attitude to better adapt to the surface morphology. Nonlinear mapping ensures that the spray gun attitude adjustment has great flexibility. Small changes in the directional deviation angle have little impact, while large changes in the directional deviation angle have a greater impact. It can be dynamically adjusted according to the complexity of the workpiece surface to ensure the spraying quality.
[0150] Example 2
[0151] like Figure 8 As shown, the present invention also provides a workpiece trajectory adaptive spraying planning system based on machine vision, including: a data acquisition module 10 (preferably a high-definition CCD camera), an analysis module 20, and a recognition module 30;
[0152] The acquisition module 10 is used to acquire a stereoscopic image of the workpiece to be sprayed by using a spraying sensor device, and to preprocess the stereoscopic image of the workpiece to obtain an image to be detected.
[0153] The analysis module 20 is used to uniformly mesh the image to be detected to form a pixel grid and identify the gradient magnitude of the vertices of the pixel grid; obtain path points according to the preset spray gun travel direction and assign the gradient magnitude of the vertices to the path points; identify initial feature inflection points to form feature inflection lines; and dynamically adjust the moving speed of the spray gun based on the feature inflection lines.
[0154] The identification module 30 is used to form a spraying trajectory based on the feature curve and the moving speed.
[0155] Example 3
[0156] On the other hand, this third embodiment, based on the machine vision-based adaptive spraying planning method for workpiece trajectories provided in the first embodiment, also provides a computer storage medium 1140 (hereinafter referred to as the storage medium). For example... Figure 9 The diagram shown is a schematic of a computer storage medium structure framework provided in Embodiment 3 of the present invention, which includes:
[0157] Memory 1130 is used to store computer programs;
[0158] The communication interface 1120 is used to connect the memory 1130 to the processor 1110;
[0159] Processor 1110 is configured to execute a computer program to implement an embodiment of a machine vision-based adaptive spraying method for workpiece trajectory, as disclosed in any combination of the above embodiments.
[0160] In summary, the workpiece adaptive spraying trajectory planning method and system based on machine vision provided by this invention demonstrates that, in practical applications, a spraying sensor device driven by a robotic arm is used to perform three-dimensional imaging of the workpiece, generating a depth map that can observe the top, front, and side surfaces of the workpiece, thereby obtaining all-round geometric information of the workpiece. In this solution, the three-dimensional image not only provides accurate spatial data for spraying path planning, but also allows for adjustment of the spraying distance and spray gun movement speed according to the surface morphology, achieving simultaneous coverage of multiple surfaces and significantly saving spraying materials and time.
[0161] Furthermore, the image to be detected is uniformly meshed to form a discrete pixel grid, and the gradient magnitude of each vertex is identified. In this scheme, by associating the preset travel direction of the spray gun with the path points and assigning corresponding gradient information to the path points, the system can identify the feature inflection points of the protrusions, depressions and corners on the workpiece surface, and further generate feature inflection lines. In this scheme, during the spraying process, it is difficult to spray high gradient or corner areas. The system dynamically adjusts the moving speed of the spray gun, decelerating it at protrusions or sharp corners and accelerating it in flat areas, thereby optimizing the uniformity of spraying and the coating quality.
[0162] Furthermore, the spraying trajectory is generated based on the characteristic curves and speed planning, enabling the spray gun to adapt to the complex shape of the workpiece surface, intelligently control the moving speed and spraying posture, improve spraying efficiency, and reduce manual intervention and rework rate. The spraying process is upgraded from the traditional simple linear motion to adaptive intelligent spraying based on surface features, which not only ensures uniform coating coverage, but also realizes high efficiency and material saving in spraying operations, and has good prospects for industrial application.
[0163] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; those skilled in the art can modify the technical solutions described in the foregoing embodiments, or make equivalent substitutions for some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A machine vision-based adaptive spraying planning method for workpiece trajectory, characterized in that, The specific operating steps include: A spraying sensor device is used to capture a stereoscopic image of the workpiece to be sprayed. The stereoscopic image of the workpiece is then preprocessed to obtain an image to be detected. The image to be detected is uniformly meshed to form a pixel grid, and the gradient magnitude of the vertices of the pixel grid is identified. Path points are obtained according to the preset spray gun travel direction, and the gradient magnitude of the vertices is assigned to the path points. Initial feature inflection points are identified to form feature inflection lines. The feature inflection lines are input into a pre-constructed spray coverage model, and the instantaneous coverage contribution value is output. The distance between the reference plane of the image to be detected and the current path point is used for correction to obtain the corrected instantaneous coverage contribution value. The instantaneous speed adjustment factor is calculated based on the gradient change rate between the current path point and the previous path point. The moving speed of the spray gun is dynamically adjusted based on the preset base moving speed, the instantaneous speed adjustment factor, and the instantaneous coverage contribution value. The spray coverage model is constructed using fixed parameters such as the nozzle type, spray angle, atomization diameter, and fan width of the spray gun. The spraying trajectory is formed based on the characteristic curve and the moving speed.
2. The workpiece trajectory adaptive spraying planning method based on machine vision according to claim 1, characterized in that, The image to be detected is uniformly meshed to form a pixel grid, and the gradient magnitude of the vertices of the pixel grid is identified; path points are obtained according to the preset spray gun travel direction. The specific operation steps are as follows: The image to be detected is uniformly gridded to form multiple pixel grids; The gradient magnitude and gradient direction of adjacent pixels are calculated using the vertex of the pixel grid as the center. Preset the spray gun's direction of travel; A virtual sampling line is drawn on the image to be detected along the preset spray gun travel direction; The sampling path points are collected along the sampling line according to a preset fixed step size; For each path point, find the vertex with the shortest distance in the image to be detected, and assign the gradient magnitude of that vertex to the path point to obtain the path point gradient set.
3. The workpiece trajectory adaptive spraying planning method based on machine vision according to claim 2, characterized in that, The gradient magnitude of the vertex is then assigned to the path point to identify the initial feature inflection point and form a feature inflection line. The specific operation steps are as follows: For each path point in the gradient set, calculate the rate of change of the maximum gradient value between adjacent paths; A preset mutation threshold is set; if the gradient change rate is greater than the mutation threshold, the path point is marked as an initial feature inflection point. Preset the neighborhood radius and minimum number of points; for each initial feature inflection point, aggregate the initial feature inflection points in the neighborhood according to the neighborhood radius, and stop clustering when the number of initial feature inflection points in the aggregate equals the minimum number of points, thus obtaining a feature inflection point cluster; The feature inflection point clusters are fitted using the least squares method to obtain the feature inflection lines.
4. The workpiece trajectory adaptive spraying planning method based on machine vision according to claim 3, characterized in that, The feature curves are input into a pre-built jet coverage model, and the instantaneous coverage contribution value is output. The model is then corrected using the distance between the reference plane of the image to be detected and the current path point to obtain the corrected instantaneous coverage contribution value. The specific steps are as follows: A pre-constructed spray coverage model is used; the characteristic bend lines are input into the spray coverage model, and the instantaneous coverage contribution value is output. Obtain the coordinates of the current path point of the spray gun in the feature curve and the current two-dimensional coordinates of the spray gun, and calculate the Euclidean distance of the spray gun; A sensor is installed on the spray gun to measure the straight-line distance from the tip of the spray gun to the surface of the workpiece; Calculate the distance deviation between the Euclidean distance and the straight-line distance of the spray gun; The current position of the preset spray gun end coordinates; Calculate the vertical distance between the feature bend and the current position of the spray gun end coordinates, and use it as the indentation depth; The distance deviation value is multiplied by the indentation depth to obtain the distance compensation coefficient; The instantaneous coverage contribution value is corrected using the distance compensation coefficient to obtain the corrected instantaneous coverage contribution value.
5. The workpiece trajectory adaptive spraying planning method based on machine vision according to claim 4, characterized in that, The instantaneous velocity adjustment factor is calculated based on the gradient change rate between the current path point and the previous path point. The specific operation steps are as follows: Calculate the gradient rate of change between the current path point and the previous path point; Preset the maximum and minimum gradient rates of change; The velocity fundamental factor is calculated using the maximum and minimum gradient rates of change, as well as the gradient rate of change. Obtain the real-time axis direction vector and standard posture of the spray gun; The orientation deviation angle is calculated using the real-time axis direction and the standard attitude. The nonlinear mapping of the direction deviation angle is used to obtain the attitude correction factor; The instantaneous velocity adjustment factor is obtained by multiplying the attitude correction factor with the velocity base factor.
6. The workpiece trajectory adaptive spraying planning method based on machine vision according to claim 5, characterized in that, The dynamic adjustment of the spray gun's movement speed is calculated based on the preset base movement speed, instantaneous speed adjustment factor, and instantaneous coverage contribution value. The specific operation steps are as follows: A preset base movement speed is determined; the preset base movement speed is then multiplied by an instantaneous speed adjustment factor to obtain the latest changing speed. The instantaneous coverage contribution value is multiplied by the latest change rate to obtain the moving speed of the dynamically adjusted spray gun.
7. The machine vision-based adaptive spraying planning method for workpiece trajectory according to claim 6, characterized in that, Obtain the real-time axis direction and standard posture of the spray gun; calculate the direction deviation angle using the real-time axis direction and standard posture. The specific operation steps are as follows: Obtain the Z-axis direction vector of the spray gun end coordinates, and use it as the real-time axis direction vector of the spray gun; Based on the current position of the spray gun end coordinates, filter the path points in the Z-axis direction vector that are perpendicular to the feature curve; The coordinate position of the path point in the image to be detected is determined, and the pixel grid in which it is located is determined based on the coordinate position. The centroid coordinates are interpolated using the gradient vectors of the three vertices of the pixel grid to obtain the real-time normal vector, which serves as the standard pose. The direction deviation angle is obtained by calculating using the real-time axis direction vector and the real-time normal vector of the spray gun.
8. The workpiece trajectory adaptive spraying planning method based on machine vision according to claim 7, characterized in that, The orientation deviation angle is nonlinearly mapped to an attitude correction factor. The specific operation steps are as follows: The radius of the influence area is preset for each path point; Calculate the shortest distance between the path point and the vertex, and determine whether the shortest distance is less than or equal to the radius of the preset influence area; If so, then determine that the vertex is within the radius of the influence area; at the coordinate position of the path point, along the vertical direction of the feature curve, take one analysis point on each side of the vertical direction; And calculate the surface gradient magnitude at the two analysis points; The magnitude difference of the surface gradient at the computational analysis point; Calculate the distance between the two analysis points; The surface jump gradient is calculated using the amplitude difference and the distance to the analysis point; An adjustable scaling factor is preset; the dynamic weighting factor is obtained by calculating the dynamic weighting factor using the adjustable scaling factor and the surface jump gradient. The attitude correction factor is obtained by mapping the dynamic weighting coefficients with the orientation deviation angle using nonlinearity.
9. A workpiece trajectory adaptive spraying planning system based on machine vision, characterized in that, include: Data acquisition module; Analysis module; Recognition module; The acquisition module is used to use a spraying sensor device to take a three-dimensional picture of the workpiece to be sprayed, and to preprocess the three-dimensional image of the workpiece to obtain the image to be detected. The analysis module is used to uniformly mesh the image to be detected, forming a pixel grid, and identify the gradient magnitude of the vertices of the pixel grid. Path points are obtained according to the preset spray gun travel direction, and the gradient magnitude of the vertices is assigned to the path points to identify initial feature inflection points and form feature inflection lines. The feature inflection lines are input into a pre-constructed spray coverage model to output instantaneous coverage contribution values. The distance between the reference plane of the image to be detected and the current path point is used for correction to obtain the corrected instantaneous coverage contribution value. The instantaneous speed adjustment factor is calculated based on the gradient change rate between the current path point and the previous path point. The dynamic adjustment of the spray gun's movement speed is obtained by calculating based on the preset base movement speed, the instantaneous speed adjustment factor, and the instantaneous coverage contribution value. The spray coverage model is constructed using fixed parameters such as the nozzle type, spray angle, atomization diameter, and fan width of the spray gun. The identification module is used to form a spraying trajectory based on the feature curve and the moving speed.
Citation Information
Patent Citations
Surface-curvature-based automatic path generation method for spraying robot
CN105381912A
Furniture curved surface spraying track self-adaptive adjustment method based on machine vision
CN121722047A
