A method and system for controlling the pose of a spray gun for curved surface spraying

CN122975673APending Publication Date: 2026-10-27HANGZHOU BODA WEIYE PUBLIC SAFETY TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611318684.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-28
Publication Date
2026-10-27

AI Technical Summary

Technical Problem

然而,对于车门弧面、翼子板等曲率连续变化的复杂三维曲面,仅依靠法向跟随或二维路径导向难以唯一确定喷枪绕喷流轴的旋转姿态,导致在曲面转折处容易出现喷幅投影畸变、搭接宽度不均以及漆膜厚度波动等问题

Benefits of technology

[0043]与现有技术相比,通过基于三维任务曲面的局部几何特征构建包含局部表面法向、路径切向和喷幅横向的局部空间标架,建立了与曲面形态及路径走向自适应的六自由度位姿参考系,相较于仅依赖单一法向或二维路径走向的控制方式,能够有效减少曲面转折处的喷幅投影畸变与搭接不均现象。在此基础上,通过对相邻轨迹点位姿进行连续性平滑处理,消除了因曲面数据噪声或几何离散化引起的姿态突变,降低了机器人末端执行器的抖动风险。进一步地,引入基于机器人运动学约束的可执行性校验与自适应调整机制,使得位姿规划过程能够主动识别并规避关节限位、奇异点及碰撞风险,在保证喷涂工艺质量的同时提升了机器人运动的平稳性与作业安全性。与此同时,对于来自于外部设备、系统或接口的工具位姿、关节目标或机器人轨迹,仍强制依据当前三维任务曲面、工具身份、局部几何特征及机器人运动学约束重新进行位姿验证与可执行性校验,确保外部输入的路径或位姿同样无法绕过曲面几何一致性约束与运动学安全门控,从而有效杜绝因上游数据与物理环境错配所导致的姿态突跳、碰撞风险及漆膜质量缺陷,提升了系统对外部数据源的容错能力与现场部署的可靠性。此外,通过自适应调整表面邻域尺寸与轨迹采样步长,兼顾了平缓区域的计算效率与高曲率区域的几何跟随精度;结合喷涂介质许可区间的连续运动控制与启停距离补偿,避免了频繁加减速造成的膜厚堆积,提升了整体喷涂作业的连贯性与涂层均匀性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122975673A_ABST
    Figure CN122975673A_ABST
Patent Text Reader

Abstract

The application discloses a curved surface spraying gun pose control method and system, comprising: acquiring a three-dimensional task curved surface and a three-dimensional spraying path; constructing a local space frame or equivalent local geometric constraint relationship for a track point to constrain a spray axis and a spray width regulation axis, a rotation angle around the spray axis or a virtual reference axis; generating a pose sequence in combination with a target spray distance; performing continuity processing on adjacent poses; checking the executability based on robot kinematics constraints and adjusting pose parameters or execution strategies; and outputting a continuous pose sequence and spraying control parameters. For external input tool poses, joint targets or robot trajectories, the system still re-verifies according to the current task curved surface, tool identity, local geometry and kinematics constraints, and direct release is prohibited when associated information is missing, conflicting or invalid; no executable instructions are released without version and continuity verification. The application can improve the pose accuracy and motion stability of complex curved surface spraying.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of robotic automated coating technology, specifically to a method and system for controlling the position and posture of a spray gun in curved surface spraying. Background Technology

[0002] In robotic curved surface spraying operations, the pose control of the spray gun directly determines the uniformity and surface quality of the paint film. Existing technologies typically employ control strategies that maintain the spray gun's normal perpendicular to the workpiece surface and preserve a constant spray distance, or adjust the nozzle angle solely based on the line direction in two-dimensional path planning. However, for complex three-dimensional curved surfaces with continuously changing curvature, such as car door arcs and fenders, relying solely on normal following or two-dimensional path guidance is insufficient to uniquely determine the spray gun's rotational attitude around the spray axis. This leads to problems such as spray pattern distortion, uneven overlap width, and paint film thickness fluctuations at surface transitions. Furthermore, pose sequences generated by simple geometric constraints often lack consideration for the robot's kinematic characteristics. Abrupt changes in path curvature or transitions across work surfaces can easily cause issues such as excessive joint speeds, sudden posture jumps, and even singularities, affecting the stability and continuity of the spraying process. Therefore, a spray gun pose control scheme that integrates the geometric features of three-dimensional curved surfaces with robot kinematic constraints is urgently needed. Summary of the Invention

[0003] The purpose of this invention is to provide a method and system for controlling the pose of a spray gun in curved surface spraying. This invention achieves precise construction and continuous control of the six-degree-of-freedom pose of the spray gun, improving the pose accuracy and motion stability of spraying complex curved surfaces.

[0004] The technical solution of this invention: a method for controlling the position and posture of a spray gun in curved surface spraying, comprising:

[0005] The system acquires the 3D task surface of the target workpiece and the 3D spraying path located on the 3D task surface. The 3D spraying path is generated by the spray gun pose control system or imported by external devices, systems, or interfaces in the form of coordinates, path, tool pose, joint target, or robot task. For external inputs, at least one of the following is associated: target or part identity, coordinate system or relative reference, task surface version, path version, tool identity, and input source. When the external input already contains tool pose or executable trajectory, its position is still projected or checked to the current 3D task surface, and pose constraints are re-verified or generated according to at least two of the following: current local surface normal, target spray distance, path tangent or spray width lateral direction, and tool coordinate transformation. When the associated information is missing, conflicting, or invalid, the external input is not directly published.

[0006] For multiple trajectory points of the three-dimensional spraying path, a local spatial frame or equivalent constraint relationship for the spray axis and the attitude degree of freedom around the spray axis is constructed based on local geometric features; the local spatial frame or constraint relationship includes the local surface normal, and at least one of the path tangent, the spray width lateral direction or the target boundary tangent.

[0007] Based on the local spatial frame or constraint relationship, constrain the jet axis and at least one of the following: the jet width specification axis, the rotation angle around the jet axis, or the virtual reference axis, and combine it with the target spray distance to determine the position of the tool center point, and generate the spray gun pose sequence;

[0008] By continuously solving, continuously parameterizing, online recursion, or continuously processing discrete poses, the poses of adjacent targets can satisfy at least two of the continuity conditions among position, attitude, spray distance, and attitude change rate, thus forming a continuous spray gun pose sequence or continuous pose control command.

[0009] The executability is verified based on the robot's kinematic constraints; if the verification fails, the pose parameters or execution strategy are adjusted, or the corresponding path segment is marked as invalid, pending confirmation, segmented, or pending replanning, and the issuance of executable painting instructions for the path segment is prohibited.

[0010] Output the continuous spray gun pose sequence or continuous pose control command and its associated spraying control parameters.

[0011] The above method, wherein the construction of the local surface normal, path tangent, and spray width lateral direction includes:

[0012] The local surface normal is determined based on the surface neighborhood surrounding the trajectory point;

[0013] The path difference direction of the three-dimensional spraying path at the trajectory point is projected onto the tangent plane of the local surface normal to obtain the path tangent.

[0014] The lateral direction of the spray pattern is determined based on the cross product of the local surface normal and the path tangent.

[0015] The aforementioned method, which constrains the jet axis and the jet width specification axis, the rotation angle around the jet axis, or the virtual reference axis based on the local spatial frame or constraint relationship, includes:

[0016] The jet axis is controlled to be parallel to the opposite direction of the local surface normal, or to form a process-defined tilt angle with the opposite direction of the local surface normal;

[0017] The control spray width axis is aligned with one of the following: the spray width lateral direction, the path tangent direction, or the target boundary tangent direction, according to a preset process rule; when the spray width is approximately circular or the deposition result is not sensitive to the rotation angle around the spray axis, the rotation angle is determined or limited by at least one of the following: a virtual continuous reference axis, the previous effective posture, boundary footprint constraints, or the robot kinematics optimization result.

[0018] The aforementioned method, wherein obtaining the spray gun pose sequence includes:

[0019] Unify the sign and direction of the local surface normals of adjacent trajectory points;

[0020] The spray gun rotation representation of adjacent trajectory points is subjected to hemispherical processing;

[0021] Apply continuity constraints to the rate of change of position and attitude of adjacent trajectory points to limit the rate of change of adjacent angular velocity, angular acceleration or jet distance.

[0022] The aforementioned method, based on robot kinematic constraints, performs executability verification, including:

[0023] Check the joint limits, singularities, and collision gaps corresponding to the continuous spray gun pose sequence;

[0024] In response to the inspection results not meeting the preset safety threshold, adjust the path direction of the three-dimensional spraying path, the selection of the spray width specification axis, the process setting tilt angle, or the trajectory sampling step size.

[0025] If the preset safety threshold is still not met after adjustment, the robot will output a command to adjust the position of the robot base or the docking position after stopping the spraying of the medium and replanning.

[0026] The aforementioned methods, which construct local spatial frames or local geometric constraints based on local geometric features, include:

[0027] Select the surface neighborhood around the trajectory point;

[0028] The size of the surface neighborhood and the trajectory sampling step size are adaptively adjusted based on the local curvature, fitting residual, or surface smoothness of the three-dimensional task surface.

[0029] The local surface normal is determined based on the adjusted surface neighborhood;

[0030] When the surface neighborhood crosses holes, right angles, curvature abrupt change regions, low confidence regions, or data missing regions, or when the fitting residual, normal dispersion, or depth integrity rate does not meet the preset conditions, the corresponding trajectory points are marked as invalid or pending confirmation, and an executable spray gun pose is not directly generated.

[0031] The aforementioned method further includes:

[0032] When the three-dimensional spraying path is divided into multiple permitted spraying medium intervals by the permitted spraying area, the robot is controlled to maintain continuous movement along the three-dimensional spraying path and generate a spraying medium start-stop sequence according to each permitted spraying medium interval.

[0033] Based on the current path speed, spray gun response time, and stable spray establishment time, distance compensation is applied to the gun opening and closing positions to ensure that the stable spray width penetrates the core part of each spray medium's permissible range.

[0034] A spray gun position control system for curved surface spraying includes:

[0035] The task surface and external path interface is configured to acquire the 3D task surface of the target workpiece and the 3D spraying path, tool pose, joint target or robot task generated by the spray gun pose control system or externally input, and to parse the target or part identity, coordinate system or relative reference, task surface version, path version, tool identity and input source.

[0036] The local geometric constraint module is configured to construct a local spatial frame based on the local geometric features of the three-dimensional task surface for multiple trajectory points on the three-dimensional spraying path, or to establish local geometric constraint relationships that can equivalently constrain the jet axis and the attitude degrees of freedom around the jet axis.

[0037] The pose constraint module is configured to constrain the spray gun's jet axis based on the local spatial frame or local geometric constraint relationship, and constrain at least one of the following: a specified spray width axis, a rotation angle around the jet axis, or a virtual reference axis used to maintain attitude continuity; and determine the tool center point position of each trajectory point in combination with the target spray distance to generate a spray gun pose sequence.

[0038] The attitude continuity module is configured to generate a continuous spray gun attitude sequence or equivalent continuous attitude control command by directly solving continuously, continuously parameterizing, online recursively solving, or continuously processing discrete spray gun attitude information.

[0039] The executability verification module is configured to perform executability verification on the continuous spray gun pose sequence or continuous pose control command based on robot kinematic constraints, and to perform at least one of the following actions when the verification fails: parameter adjustment, strategy adjustment, invalidation mark, pending confirmation, segmentation or replanning, and to prohibit the issuance of executable spraying commands for the corresponding path segment before the verification passes.

[0040] The output interface is configured to output the continuous spray gun pose sequence or continuous pose control command, as well as the associated spraying control parameters.

[0041] A control device includes a processor and a memory, wherein instructions in the memory, when executed by the processor, cause the control device to perform the aforementioned method.

[0042] A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, causes the processor to perform the aforementioned method.

[0043] Compared to existing technologies, this method constructs a local spatial frame based on the local geometric features of the 3D task surface, including local surface normals, path tangents, and spray width lateral directions. This establishes a six-DOF pose reference system that adapts to the surface morphology and path orientation. Compared to control methods relying solely on a single normal or two-dimensional path orientation, this effectively reduces spray width projection distortion and uneven overlap at surface transitions. Furthermore, by performing continuous smoothing on the poses of adjacent trajectory points, abrupt pose changes caused by surface data noise or geometric discretization are eliminated, reducing the risk of vibration in the robot's end effector. Moreover, an executability verification and adaptive adjustment mechanism based on robot kinematic constraints is introduced, enabling the pose planning process to proactively identify and avoid joint limitations, singularities, and collision risks. This improves the stability of robot motion and operational safety while ensuring the quality of the spraying process. Meanwhile, for tool poses, joint targets, or robot trajectories from external devices, systems, or interfaces, pose verification and executability checks are still forcibly performed again based on the current 3D task surface, tool identity, local geometric features, and robot kinematic constraints. This ensures that externally input paths or poses cannot bypass surface geometric consistency constraints and kinematic safety gating, effectively preventing posture jumps, collision risks, and paint film quality defects caused by mismatches between upstream data and the physical environment. This improves the system's fault tolerance to external data sources and the reliability of on-site deployment. In addition, by adaptively adjusting the surface neighborhood size and trajectory sampling step size, the computational efficiency in smooth areas and the geometrical following accuracy in high-curvature areas are balanced. Combined with continuous motion control and start / stop distance compensation within the permissible range of the spraying medium, film thickness accumulation caused by frequent acceleration and deceleration is avoided, improving the overall continuity and coating uniformity of the spraying operation. Attached Figure Description

[0044] Figure 1 This is a schematic diagram showing the relationship between the local marker of the curved surface spraying trajectory point and the spray gun posture in an embodiment of the present invention;

[0045] Figure 2 This is a flowchart of the continuous pose control method for curved surface spraying gun according to an embodiment of the present invention;

[0046] Figure 3 This is a schematic diagram comparing the neighborhood and step size of the smooth region in an embodiment of the present invention;

[0047] Figure 4 This is a schematic diagram comparing the neighborhood and step size of the high curvature region in an embodiment of the present invention. Detailed Implementation

[0048] The present invention will be further described below with reference to the accompanying drawings and embodiments, but this should not be construed as limiting the present invention.

[0049] Example 1: This example provides a spray gun pose control method for curved surface spraying. This method achieves precise control of the complex curved surface spraying process by constructing a three-dimensional local frame and combining it with kinematic constraint closed loops. In the spraying system of this invention, the robot can be selectively mounted on a fixed base or a replaceable carrier. When the robot is mounted on a replaceable carrier, the carrier remains braked and stopped during the spraying operation, only providing the robot arm with the confirmed coordinates of the fixed base; adjustments to the robot base position or the carrier docking position can only be made after the spraying medium has stopped and the replanning has been completed. During the spraying process, the moving speed of the nozzle at the end of the robot arm along the target surface and the target spray distance are used as executable parameters in the dynamic data table for real-time adjustment; the carrier itself does not participate in pose compensation during the spraying process. Specifically, the method includes the following steps.

[0050] Step 1: Obtain the 3D task surface of the target workpiece and the 3D spraying path located on the 3D task surface. The 3D spraying path is generated by the spray gun pose control system, or imported by external devices, systems, or interfaces in the form of coordinates, path, tool pose, joint target, or robot task. For external input, the system associates and records at least one of the following: target or component identity, coordinate system or relative reference, task surface version, path version, tool identity, and input source. When the external input already contains tool pose or executable trajectory, the system still projects or verifies its position to the current 3D task surface, and re-verifies or generates pose constraints according to at least two of the following: current local surface normal, target spray distance, path tangent or spray width lateral direction, and tool coordinate transformation. If the above-mentioned associated information is missing, conflicting, or invalid, the system does not directly publish the external input.

[0051] Specifically, the 3D task surface can be composed of point clouds acquired by a depth camera, triangular mesh models, parametric CAD surfaces, or combinations thereof. Its core function is to provide complete 3D geometric information of the surface to be sprayed, rather than being limited to a 2D image plane. The 3D spraying path is a spatial curve defined on the 3D task surface, describing the expected trajectory of the spray gun on the workpiece surface. The 3D task surface and 3D spraying path can originate from the operator's selection, drawing, or mask editing on multi-view images or task maps, resulting in a 3D task object with semantic, source, and version information formed through reverse indexing and 3D inverse mapping of displayed primitives. Alternatively, they can originate from machine vision segmentation, computer-aided design data, or external task data; their input sources do not alter the technical closed loop of generating the spray gun pose based on a local spatial frame in this invention. By acquiring real 3D geometric data and spatial paths, a data foundation is provided for subsequently establishing accurate pose constraints, avoiding the problem of poor surface adaptability caused by relying solely on 2D projection information.

[0052] For tool poses, joint targets, or robot trajectories directly provided by external offline programming systems or upstream devices, this invention does not consider their executable format as having completed pose verification. Instead, it re-verifies them based on the current 3D task surface, local geometry, target spray distance, spray direction, tool coordinate transformation, and robot kinematics. This prevents bypassing the surface pose continuity and executability gating by pre-generating trajectories on external devices.

[0053] Step 2: For multiple trajectory points on the 3D spraying path, construct a local spatial frame or equivalent constraint relationship for the spray axis and the attitude degrees of freedom around the spray axis based on local geometric features; the frame or constraint relationship includes the local surface normal, and at least one of the path tangent, the spray width lateral direction, or the target boundary tangent. Combined with... Figure 1To understand this, at each trajectory point, the system doesn't just calculate a single surface normal, but constructs a complete reference system (i.e., a local spatial frame) composed of three orthogonal or approximately orthogonal vectors. The local surface normal reflects the orientation of the surface at that point; the path tangent reflects the forward trend of the spray path at that point; and the spray pattern lateral direction is determined by the former two, representing the theoretical unfolding direction of the spray pattern on the surface. The reason for constructing such a three-dimensional local spatial frame is that in three-dimensional space, the surface normal alone can only determine that the spray gun axis is perpendicular to the surface, but cannot uniquely determine the rotation angle of the spray gun around its own axis. Especially in areas with continuously changing curvature, such as car door arcs and fenders, without the constraints of the path tangent and spray pattern lateral direction, the spray gun is prone to disordered rotation around its axis, leading to distortion of the spray pattern projection shape and uneven overlap width. By introducing the path tangent and spray pattern lateral direction, this embodiment integrates process requirements (such as spray pattern direction) with geometric features (such as surface orientation), ensuring that the spray gun posture at each trajectory point is unique and conforms to process expectations. It is understood that the above method of constraining the rotation angle around the jet axis using both path tangential and spray width lateral is only a specific example. In process scenarios where the target boundary tangential better reflects the boundary orientation and coating profile requirements, the target boundary tangential can also be chosen to replace the path tangential or spray width lateral as the constraint reference. When the spray width shape is approximately circular or insensitive to the rotation angle around the axis, it is not even necessary to explicitly specify the fixed alignment direction of the spray width lateral, but to use a virtual reference axis or continuity constraint to restrict the rotational degree of freedom around the jet axis. The "local geometric constraint relationship" referred to in this invention covers the above-mentioned explicit frame and the mathematical expression of various implicit constraint pose degrees of freedom. Any geometric constraint that can equivalently limit the direction of the jet axis and the pose degrees of freedom around that axis can be used as an alternative to the local spatial frame described in step 2.

[0054] Step 3: Based on the local spatial frame or constraint relationship, constrain at least one of the following: the jet axis, the spray width specification axis, the rotation angle around the jet axis, or the virtual reference axis. Combined with the target spray distance, determine the tool center point position to generate a spray gun pose sequence. Specifically, the jet axis is constrained to be parallel to the opposite direction of the local surface normal, or to form a specific tilt angle according to process requirements, to ensure that the paint impacts the surface at the optimal angle. At the same time, the spray width specification axis of the spray gun itself (e.g., the major axis of a fan-shaped spray width) is constrained to be aligned with the lateral direction of the spray width, the tangential direction of the path, or the tangential direction of the target boundary in the local spatial frame, thereby controlling the coverage shape of the paint mist on the curved surface. In particular, when the spray width shape is approximately circular, or the deposition result is not sensitive to the rotation angle around the jet axis, this embodiment does not require explicit constraint of the spray width specification axis to be aligned with a certain fixed vector. At this point, the rotation angle around the jet axis can be determined or restricted by at least one of the following: virtual continuous reference axis, previous effective posture, boundary footprint constraint, or robot kinematics optimization result, so as to ensure the continuity of posture between paths, while preserving the degree of freedom around the jet axis to meet the kinematics optimization requirements.

[0055] Based on this, according to the preset target spray distance, the spatial position of the spray gun tool center point (TCP) can be calculated by offsetting a corresponding distance outward from the trajectory point along the direction of the local surface normal. This step realizes the mapping from the abstract geometric frame to the specific robot tool pose. The generated pose sequence not only meets the coating quality requirements for spray distance and angle, but also ensures the coordination and consistency between the spray direction and the surface trend.

[0056] Step 4 involves continuously solving, parameterizing, recursively applying formulas, or processing the discrete poses to ensure that adjacent target poses satisfy at least two of the continuity conditions among position, attitude, spray distance, and attitude change rate, thus forming a continuous spray gun pose sequence or continuous pose control command. Because the 3D task surface may contain noise, discretization errors, or geometric abrupt changes, the original pose sequence calculated directly based on geometric features is often not smooth enough. Adjacent points may experience normal sign flipping, quaternion jumps, or excessive attitude angular velocities. Directly issuing such sequences to the robot would cause frequent acceleration / deceleration, jitter, or even triggering a protective shutdown at the end effector of the robotic arm. Therefore, this step eliminates non-physical abrupt changes in the pose sequence by unifying the normal sign, processing quaternions to the same hemisphere, and applying constraints on position and attitude change rates, ensuring continuity in both the time and spatial domains. It is understood that the above smoothing process is only one of the means to achieve continuity between adjacent poses. In other embodiments of the present invention, pose sequences can also be generated using methods such as direct continuous solution, continuous parameterization, and online recursion, without the need to first generate discrete poses and then smooth them. Regardless of the specific method used, adjacent target poses must satisfy at least two continuity conditions among position, orientation, spray distance, and rate of change of orientation to ensure the smoothness of robot motion and the consistency of coating quality. This smoothing process not only improves the smoothness of robot motion but also provides kinematic assurance for subsequent film thickness uniformity.

[0057] Step 5: Perform executability verification based on robot kinematic constraints. If the verification fails, adjust the pose parameters or execution strategy, or mark the corresponding path segment as invalid, pending confirmation, segmented, or to be replanned, and prohibit the issuance of executable spraying instructions for the path segment. A geometrically continuous and smooth pose sequence may not be physically safe for the robot to execute. For example, certain postures may cause robot joints to exceed limits, approach singular configurations, or collide with the surrounding environment. This step introduces a verification mechanism based on the robot's kinematic model to perform point-by-point or segment-by-segment safety checks on the continuous spray gun pose sequence. When a verification failure is detected, the system will not simply report an error and terminate, but will initiate an adaptive adjustment mechanism. For example, it can fine-tune the path direction, switch the alignment of the specified axis of the spray pattern, adjust the process tilt angle, or change the sampling step size to find an alternative pose that meets the process requirements and is within the robot's capabilities. If local adjustments are ineffective, further global strategies such as stopping the spraying of the medium and replanning the position of the base or carrier can be adopted. It is important to emphasize that the system must not issue executable painting instructions for the corresponding path segment to the robot controller until any adjustments or replanning are completed and re-verification passes. For path segments that still fail verification after adjustments, the system marks them as invalid, pending confirmation, segmented, or pending replanning, and transfers them to manual processing or replanning procedures, rather than forcibly executing them. This closed-loop design of "verification-adjustment" significantly improves the robustness and practicality of the technical solution in real industrial environments, effectively avoiding the risk of ignoring physical constraints by blindly pursuing geometric optimality.

[0058] Step 6: Output the continuous spray gun pose sequence and spraying control parameters. After the above geometric construction, continuous processing, and executability verification, the pose sequence, along with the corresponding spraying medium start / stop signals, flow rate settings, and movement speed control parameters, is output to the robot controller or relevant actuators. This ensures that the final spraying operation not only theoretically conforms to the surface geometry but is also physically safe, feasible, and stable, thereby achieving high-quality, high-efficiency automated surface spraying.

[0059] Preferably, the construction of the local surface normal, path tangent, and spray width lateral direction includes:

[0060] First, the local surface normal is determined based on the surface neighborhood surrounding the trajectory point. Combined with... Figure 3 and Figure 4As shown, the system does not calculate the normal solely based on the single-point coordinates of the trajectory point. Instead, it selects a surface neighborhood within a certain range around the point for fitting or statistical analysis. For example, principal component analysis (PCA), robust plane fitting, or surface partial derivative calculation can be used to extract the feature vector that best represents the orientation of the local area from multiple sampling points within the surface neighborhood as the local surface normal. This neighborhood-based estimation method can effectively smooth high-frequency noise in depth data and avoid high-frequency jitter in the spray gun attitude caused by single-point measurement errors, thus providing a robust geometric reference for subsequent pose generation.

[0061] Secondly, the path difference direction of the 3D spraying path at the trajectory point is projected onto the tangent plane of the local surface normal to obtain the path tangent. Specifically, although the 3D spraying path is theoretically located on the task surface, in actual discretization or data acquisition, the line connecting adjacent trajectory points (i.e., the path difference direction) often does not strictly fall within the theoretical tangent plane of the trajectory point. If this difference direction is directly normalized as the tangent, the generated frame will not meet the orthogonality requirement, thus causing cumulative deviation in the spray direction. Therefore, this embodiment orthogonally projects the path difference direction onto the tangent plane defined by the local surface normal, and then normalizes the projection result to obtain the path tangent that is strictly perpendicular to the normal. This projection operation is a key step in ensuring the orthogonality and geometric consistency of the local spatial frame, ensuring the accurate matching of the spray gun's forward direction with the surface shape.

[0062] Next, the lateral spray pattern is determined based on the cross product of the local surface normal and the path tangent. For example... Figure 1 As shown, the lateral spray pattern is determined by the cross product of the local surface normal and the path tangent, i.e., b = n × t. This vector is perpendicular to both the surface normal and the path direction, representing the theoretical unfolding direction of the spray pattern on the curved surface. The ntb frame constructed through this defined mathematical relationship provides a unique and stable reference coordinate system for the six-DOF pose of the spray gun, solving the problem that the rotational degree of freedom around the axis cannot be constrained by the normal alone.

[0063] It should be noted that "spray width lateral direction" is a mathematical vector calculated based on surface geometry and path orientation, while "spray width defined axis" is an inherent physical property of the spray gun tool itself (such as the major or minor axis of a fan-shaped nozzle). This invention achieves a precise transformation from process intent to physical execution by establishing an alignment mapping relationship between the two, rather than simply equating the two.

[0064] Preferably, the jet axis and the jet width specification axis, the rotation angle around the jet axis, or the virtual reference axis are constrained based on the local spatial frame or constraint relationship, including:

[0065] Control the jet axis to be parallel to the opposite direction of the local surface normal, or to form a process-defined tilt angle with the opposite direction of the local surface normal. For example... Figure 1 As shown, in conventional spraying operations, the jet axis is typically controlled to be parallel to the opposite direction of the local surface normal (i.e., -n) to ensure that the paint impacts the surface perpendicularly, achieving optimal deposition efficiency and film thickness uniformity. However, in certain specific process scenarios, such as to avoid overspray rebound, adapt to the leveling characteristics of high-viscosity paints, or handle special corner structures, the system can also control the jet axis to form a preset process-defined tilt angle relative to the -n direction. This tilt angle can be generated by rotating tangentially around the path or laterally around the spray pattern, as long as the tilt angle is within the process-permissible range and has passed feasibility verification.

[0066] Simultaneously, the spray pattern axis is aligned with one of the following according to preset process rules: the spray pattern lateral direction, the path tangent direction, or the target boundary tangent direction. When the spray pattern is approximately circular or the deposition result is insensitive to the rotation angle around the spray axis, the rotation angle is determined or restricted by at least one of the following: a virtual continuous reference axis, the previous effective posture, boundary footprint constraints, or robot kinematics optimization results. This ensures the continuity of posture between paths while preserving the degree of freedom around the spray axis to meet kinematic optimization requirements. This feature demonstrates the invention's broad adaptability to different spraying processes. For example, when spraying large-area planar or gently curved surfaces, the preset process rules typically specify that the spray pattern axis (such as the major axis of a fan-shaped spray pattern) is aligned with the spray pattern lateral direction. In this case, the spray pattern unfolding direction is perpendicular to the travel direction, achieving the maximum effective coverage width and uniform overlap effect. However, when performing edge tracing, gap repair, or cross-work surface transition spraying, to ensure the fit between the coating boundary and the workpiece contour, the preset process rules can be switched to align the spray pattern axis with the target boundary tangent direction or with the path tangent direction. Furthermore, the virtual continuous reference axis refers to a continuously changing virtual vector constructed along the spraying path. This vector does not need to be aligned with any physical axis of the spray gun; it only serves as a reference for the rotation angle around the spray axis. The system smoothly interpolates the direction of this virtual reference axis between adjacent trajectory points, ensuring that the rotation angle around the spray axis changes continuously with the path, thereby avoiding abrupt attitude changes. The previous valid attitude refers to the spray gun attitude that most recently passed the executability verification before the current trajectory point. The system uses the rotation angle around the axis of this attitude as the initial or reference value for the current point, and makes fine adjustments while satisfying process and kinematic constraints to ensure that the rotation angle change between adjacent points is minimized. The boundary footprint constraint refers to the reverse constraint of the spray gun's rotation angle around the spray axis based on the actual or expected coverage boundary of the spray pattern on the workpiece surface, so that the geometric projection of the spray pattern matches the target area (such as the boundary of the surface to be sprayed, the edge of the overlap area, or the outline of the no-spray area), ensuring the coating boundary accuracy. The robot kinematics optimization result refers to using the rotation angle around the jet axis as the optimization variable, with objective functions such as joint motion smoothness, distance from singularities, or minimum energy, to solve for the rotation angle around the axis that optimizes the overall motion performance of the robot, while satisfying the constraints of the jet axis direction and spray distance. The above four methods can be used individually or in combination; for example, a virtual continuous reference axis can be used to provide a baseline value, and then the robot kinematics optimization result can be used for local correction to balance attitude continuity and kinematic feasibility. It should be understood that regardless of how the physical installation angle of the spray gun changes, and regardless of whether the shape of the spray pattern is a flat ellipse, circle, or other form, as long as an alignment mapping relationship between the specified axis of the spray pattern and any vector in the local spatial frame is established through calibration, and the spray gun attitude is constrained accordingly, it falls within the technical solution of this invention.

[0067] Preferably, obtaining the spray gun pose sequence specifically includes the following steps.

[0068] First, the sign and direction of the local surface normals of adjacent trajectory points are unified. Specifically, since the 3D task surface is usually composed of discrete point clouds or meshes, in areas with drastic curvature changes or high data noise, the local surface normals calculated from adjacent trajectory points may have opposite signs (i.e., one points outward from the surface, and the other points inward). If the spray gun posture is directly generated based on such inconsistent normals, it will cause the spray gun to flip approximately 180 degrees between adjacent points. This not only exceeds the robot's dynamic response capability but also causes spraying interruption or paint film defects. Therefore, this embodiment calculates the inner product of adjacent normals or checks their consistency with the global reference direction to force the normal signs of adjacent trajectory points to be unified to face the spray gun side or the outside of the workpiece, eliminating the cause of posture flipping from the geometric source.

[0069] Secondly, the spray gun rotation representations of adjacent trajectory points are homogenized to the same hemisphere. Mathematically, unit quaternions q and -q represent the exact same spatial rotational attitude, but in numerical interpolation, they represent the two farthest points on a four-dimensional hypersphere. If the quaternion representations of adjacent trajectory points are located in different hemispheres, direct spherical linear interpolation (Slerp) will cause the interpolation path to bypass the "back side" of the hypersphere, resulting in unnecessary long-path rotations and angular velocity spikes. In this embodiment, before performing interpolation, the dot product of adjacent quaternions is checked. If the dot product is negative, one of the quaternions is inverted to ensure that both are located in the same hemisphere before smooth interpolation. This process ensures the shortest path transition of the spray gun attitude in the time domain, effectively avoiding motion jitter caused by the ambiguity of mathematical representation.

[0070] Furthermore, continuity constraints are applied to the rate of change of position and attitude of adjacent trajectory points to limit the rate of change of adjacent angular velocity, angular acceleration, or spray distance. Even after eliminating sign flips and quaternion jumps, the original pose sequence may still contain high-frequency components that exceed the performance limits of the robot joints. This embodiment smooths the pose sequence by setting upper limit thresholds for the Euclidean distance, rotation angle difference, and spray distance deviation between adjacent trajectory points, or by using constrained spline curve fitting, online filtering, or other methods. For example, when the angular acceleration of a certain path segment exceeds the allowable value of the robot's end effector, the system automatically reduces the feed speed of that segment or adds intermediate transition points to ensure the smoothness of the actual motion trajectory. This rate of change constraint not only protects the mechanical structure but also maintains the relative velocity stability of the spray gun relative to the workpiece surface, thereby ensuring a uniform distribution of paint film thickness.

[0071] After completing the above-mentioned continuous smoothing process, this embodiment further introduces an executability verification and adaptive adjustment mechanism based on robot kinematic constraints, forming a safety closed loop of "optimization first, verification then adjustment". Preferably, the process of performing executability verification on the continuous spray gun pose sequence based on robot kinematic constraints, and adaptively adjusting the pose parameters or execution strategy in response to failure of verification, specifically includes the following steps.

[0072] The first step is to check the joint limits, singularities, and collision clearances corresponding to the continuous spray gun pose sequence. Specifically, the system substitutes each smoothed pose into the robot's kinematic model for inverse kinematics calculation to verify whether the joint angles are within the safe operating range; simultaneously, it calculates the condition number or minimum singular value of the Jacobian matrix to assess whether the current position is close to a singular configuration (i.e., the robot has lost one or more degrees of freedom); in addition, it needs to combine the environment model and tool envelope to check whether the minimum distance between the spray gun, hose, and robotic arm body and the workpiece, fixture, or surrounding facilities meets the preset safety clearance requirements. This step ensures that the theoretically continuous trajectory is safe and executable in the physical world.

[0073] The second step involves adjusting the path direction of the 3D spraying path, the selection of the spray width specification axis, the process setting tilt angle, or the trajectory sampling step size in response to the inspection results not meeting the preset safety threshold. This is the first-level adaptive adjustment strategy in this embodiment, which belongs to local process parameter optimization. When the verification finds that the pose of a certain point is infeasible, the system prioritizes trying to fine-tune the local parameters without changing the overall task objective. For example, if it is detected that the spray gun is close to the joint limit at a certain point, it can try to switch the alignment method of the spray width specification axis from "aligning the spray width laterally" to "aligning the path tangentially", or fine-tune the spray axis angle within the tilt cone range allowed by the process, using the robot's redundant degrees of freedom to find a feasible solution; if it is detected that the local curvature is too large, causing the attitude change rate between sampling points to exceed the limit, it can adaptively reduce the trajectory sampling step size in that area, and distribute the attitude change amount of a single step by densifying the trajectory points. This adjustment strategy can preserve the integrity of the original process to the greatest extent and avoid the failure of the entire task due to local obstacles.

[0074] The third step, in response to the fact that the preset safety threshold is still not met after adjustment, outputs an instruction to adjust the robot base position or the vehicle docking position after stopping the spraying medium and replanning. This is the second-level adjustment strategy in this embodiment, which belongs to the global execution strategy change. When local parameter adjustment cannot solve the problem (e.g., the workpiece size exceeds the robot's maximum working radius, or there is a fixed obstacle that cannot be bypassed), the system determines that the task is not executable under the current configuration. At this time, in order to prevent forced operation from causing safety accidents, the system will immediately mark the area as unexecutable and trigger an instruction to stop spraying medium. Subsequently, the system prompts or automatically starts the replanning process, suggests or calculates new robot base coordinates or vehicle docking positions, and regenerates the pose sequence after the physical layout adjustment is completed. It is particularly important to emphasize that in the technical solution of this invention, the priority of safety constraints (such as collision detection and no-spray zone restrictions) is always higher than that of the smoothing algorithm. In other words, any smoothing process must not be at the expense of safety; when the smoothed trajectory intrudes into the no-spray zone or a collision risk occurs, the system must prioritize the execution of safety avoidance or shutdown logic, rather than continuing to pursue the smoothness of the trajectory.

[0075] To better understand the above mechanism, the following explanation uses a typical scenario of "accessibility recovery" as an example. When painting high-curvature deep cavity areas such as car wheel arches, the spray gun often needs to penetrate narrow spaces and maintain a specific tilt angle. Suppose that after smoothing, the system finds that the spray gun posture at a certain trajectory point on the top of the wheel arch causes the robot's 5th axis to approach a singularity, and the collision gap between the spray gun handle and the inner wall of the wheel arch is less than the safety threshold. At this time, the system first triggers the first-level adjustment: attempting to switch the spray width specification axis from the default lateral alignment to tangential alignment along the boundary, and rotating the process tilt angle 5 degrees around the path tangential. After re-verification, if the collision gap returns to normal and the singularity index drops below the safety line, the new pose is adopted to continue execution; if the adjustment solves the singularity problem but the collision risk still exists, the second-level adjustment is triggered: the system pauses the painting output, records the location of the fault point, and prompts the operator to move the carrier forward by 100 mm or adjust the height of the robot base, and replan the entry path to the area after the physical position changes. Through this hierarchical response mechanism, this embodiment effectively improves the success rate of operations and the robustness of the system under complex working conditions.

[0076] Preferably, constructing a local spatial frame or local geometric constraint relationship based on local geometric features includes: selecting a surface neighborhood around the trajectory point; adaptively adjusting the size of the surface neighborhood and the trajectory sampling step size according to the local curvature, fitting residual, or surface smoothness of the three-dimensional task surface; determining the local surface normal based on the adjusted surface neighborhood; and marking the corresponding trajectory point as invalid or pending confirmation when the surface neighborhood crosses a hole, right angle edge, curvature abrupt change region, low confidence region, or data missing region, or when the fitting residual, normal dispersion, or depth integrity rate does not meet the preset conditions.

[0077] Specifically, in complex curved surface spraying operations, the geometric features of the workpiece surface often exhibit significant spatial heterogeneity. Using a fixed-size surface neighborhood and a fixed trajectory sampling step size makes it difficult to simultaneously meet the noise suppression requirements of smooth areas and the geometric tracking accuracy of high-curvature areas. For example, while a larger surface neighborhood can effectively filter out measurement noise from the depth sensor through averaging effects, making the calculated normal more stable, in areas with drastic curvature changes, an excessively large neighborhood may span multiple geometric feature surfaces, causing the fitted normal to deviate from the true surface orientation, resulting in an "oversmoothing" phenomenon. Conversely, while a smaller surface neighborhood can accurately capture local geometric details, it is susceptible to single-point noise interference in flat areas, causing high-frequency jitter in the spray gun's posture. Therefore, this embodiment introduces an adaptive adjustment mechanism that dynamically optimizes the calculation parameters based on the local geometric state of the curved surface to obtain the optimal frame construction quality in different regions.

[0078] Combination Figure 3 and Figure 4 As shown, this adaptive adjustment mechanism employs differentiated processing strategies for different types of curved surface regions. In cases such as... Figure 3 In the flat region shown, the curvature of the 3D task surface is small and the surface undulations are gentle. The system automatically selects a larger surface neighborhood and uses a longer trajectory sampling step size. This configuration fully utilizes the good geometric consistency of the flat region, suppressing random noise in the depth data by increasing the statistical sample size, thereby obtaining robust, low-jitter local surface normals. At the same time, the longer sampling step size reduces the number of trajectory points while ensuring accuracy, improving computational efficiency and the coherence of robot motion. And in... Figure 4 As shown in the high curvature region, the curvature of the 3D task surface increases significantly. The system automatically reduces the size of the surface neighborhood and shortens the trajectory sampling step size. This configuration ensures that the data points used for normal fitting are strictly limited to local small patches, avoiding the smoothing of surface transition features due to an excessively large neighborhood. The denser sampling points can more precisely describe the rapid changes in surface morphology, enabling the generated spray gun pose sequence to closely fit the geometric trend of the high curvature surface and preventing attitude interpolation errors or spray distance fluctuations caused by sparse sampling.

[0079] The aforementioned adaptive adjustments are primarily based on one or more of the following: local curvature, fitting residuals, and surface smoothness. Local curvature is a direct indicator of the degree of surface curvature; generally, a larger curvature value indicates more drastic surface changes, requiring a corresponding reduction in the required surface neighborhood size and sampling step size. Fitting residuals reflect the degree of fit between the data points in the current neighborhood and the ideal geometric model (such as a plane or quadratic surface). When the fitting residuals exceed a preset threshold, it often indicates the presence of complex geometric structures, sharp edges, or abnormal noise in the region. In this case, the system can actively reduce the neighborhood range to eliminate interfering points or trigger resampling to obtain more accurate local information. Surface smoothness is a comprehensive evaluation indicator that can be used to quickly distinguish between flat, transitional, and complex regions, thereby guiding the hierarchical adjustment of parameters. It should be understood that these adjustment criteria can be used individually or in combination; for example, a weighted scoring function can be constructed to comprehensively consider curvature and residuals to determine the final neighborhood size.

[0080] To illustrate the adjustment logic more clearly, a specific implementation example is given below. Assume the system has a preset curvature threshold K. th and neighborhood radius benchmark value R base When a local curvature K at a certain trajectory point is detected to be less than K... th When the area is determined to be a flat region, the radius of the surface neighborhood is set to R. base The step size is set to 1.5 to 2 times the baseline step size, and the trajectory sampling step size is set to 1.5 times the baseline step size; when a local curvature K is detected to be greater than or equal to K th When a region is identified as having high curvature, the radius of its surface neighborhood is reduced to R. base The parameters can be adjusted by 0.5 to 0.8 times the baseline step size, and the trajectory sampling step size can be reduced to 0.5 times the baseline step size. Furthermore, multiple threshold levels can be set to achieve continuous or piecewise linear adjustment of the parameters. In practical applications, these parameters should be calibrated and optimized based on factors such as the accuracy of the 3D sensor used, the spray gun width, the coating process requirements, and the robot's dynamic performance. For example, for spray guns with wider spray widths, since their sensitivity to local minor geometric changes is relatively low, the neighborhood size of high-curvature regions can be appropriately increased to improve stability; while for high-precision repair spraying, it may be necessary to further reduce the neighborhood and step size to ensure detail reproduction.

[0081] This adaptive adjustment based on local geometric features can be performed as a preprocessing step in offline programming or dynamically executed in online real-time computation. Regardless of the execution timing, the adjusted surface neighborhood and sampling step size output will directly affect the subsequent local surface normal determination step, thus influencing the construction accuracy of the entire local spatial frame. Through this mechanism, the technical solution of this invention can effectively adapt to diverse spraying objects, ranging from large-area flat plates to complex free-form surfaces. While ensuring consistent spraying quality throughout the entire process, it achieves an optimal balance between computational resources and process effects, demonstrating the solution's strong robustness to different surface morphologies.

[0082] Preferably, when the three-dimensional spraying path is divided into multiple permissible spraying medium intervals by the permitted spraying area, the robot is controlled to maintain continuous movement along the three-dimensional spraying path and generate a spraying medium start-stop sequence according to each permissible spraying medium interval. Specifically, in actual spraying operations, the workpiece surface often includes areas that do not need to be sprayed or need to be masked, such as windows, lamp mounting positions, and sealing strip grooves. These areas divide the originally continuous spraying path into several effective permissible intervals. Existing technologies typically command the robot to decelerate, stop spraying, and wait to pass through a prohibited spraying area before accelerating to resume spraying. This frequent acceleration and deceleration not only reduces the production cycle time but also easily leads to uneven paint film thickness or accumulation at the start and stop points due to speed fluctuations. This embodiment adopts a control mode that decouples motion and medium, that is, the robot end effector always makes continuous and smooth movements along the three-dimensional spraying path at a preset process speed, without acceleration, deceleration, or pauses due to the opening and closing of the medium; at the same time, the system independently generates a set of spraying medium start-stop sequences according to the spatial distribution of the permissible intervals, precisely controlling the opening and closing timing of the spray gun valve or flow regulating device. This design allows the robot's dynamic performance to be independent of the painting process requirements, ensuring both smooth and efficient movement while achieving precise adaptation to discontinuous painting areas.

[0083] Building upon this, to ensure coating quality, this embodiment also introduces a distance compensation mechanism based on dynamic parameters. Preferably, distance compensation is applied to the gun-opening and gun-closing positions based on the current path speed, gun response time, and stable spray establishment time, ensuring a stable spray pattern penetrates the core of each permissible spray medium range. Specifically, the process from receiving the opening signal to forming a stable, uniform atomized fan is not instantaneous, but involves a physical lag. This lag includes the mechanical action delay of the solenoid or pneumatic valve, the pressure build-up time of the coating in the pipeline, and the flight and formation time of the atomized droplets, collectively referred to as the stable spray establishment time. Similarly, there is a response delay for medium cutoff when closing the gun. Simply using the geometric boundary of the permissible range as the start / stop trigger point inevitably leads to insufficient coating at the range entrance, overspray at the exit, or contamination of adjacent areas. Therefore, this embodiment dynamically calculates an advanced gun-opening distance and an advanced gun-closing distance based on the robot's instantaneous path speed when passing the boundary, combined with the pre-calibrated or real-time acquired gun response time and stable spray establishment time. For example, the spray gun's firing position is set upstream of the inlet of the permitted zone, ensuring that the atomization fan reaches a stable state when the spray gun moves to the inlet; the spray gun's closing position is set upstream of the outlet of the permitted zone, ensuring that residual paint mist is exhausted or reduced to an acceptable level when the spray gun reaches the outlet. This distance compensation ensures that the effective spraying section within each permitted zone is completely covered by a stable spray pattern, thereby guaranteeing uniform film thickness and clear boundaries.

[0084] It should be noted that when performing the aforementioned distance compensation, this invention adheres to the safety principle of prioritizing prohibited spraying areas. Specifically, although distance compensation aims to optimize the coating quality of the core area, the actual spraying range after compensation must never encroach upon prohibited spraying areas. When the calculated advance firing distance or advance firing distance may cause paint mist to cover prohibited spraying areas (such as unmasked glass or the surface of precision sensors), the system will forcibly reduce the compensation amount, or switch to other execution strategies such as slowing down or detouring around the surface within that specific range, to ensure that the safety of the prohibited spraying areas is not violated. In other words, the optimization of process quality must be based on not violating safety constraints; any smoothing or compensation algorithm must not cover the prohibited and permitted states set upstream.

[0085] To more intuitively understand the technical solution of this embodiment, the following explanation uses the example of spraying paint on the side of a car body through the window area. In this scenario, the window glass area is defined as a prohibited spraying area, and the sheet metal surfaces before and after it are two independent permitted spraying medium zones. When the robot travels along the three-dimensional spraying path on the side surface to the front of the window, the controller does not issue deceleration or stop commands; the robot maintains a constant process speed (e.g., 200 mm / s) and continuously glides across the window area. Based on the current speed and the characteristics of the spray gun (assuming a response time plus setup time of 50 milliseconds), the system calculates the time required to turn off the gun 10 mm in advance and to turn it on 10 mm in advance. Therefore, at a distance of 10 millimeters from the front edge of the window, the system sends a gun-off signal. By the time the spray gun reaches the front edge of the window, the paint mist has been completely cut off, preventing glass contamination. As the robot continues to pass the window at a constant speed, the spray gun remains off. When it reaches a distance of 10 millimeters from the rear edge of the window, the system sends a gun-on signal. By the time the spray gun reaches the rear edge of the window, the atomization fan has stabilized again, ensuring the integrity of the paint film on the rear sheet metal area. In this way, this embodiment effectively solves the problems of low efficiency and quality defects caused by frequent start-stop operations in traditional solutions, significantly improving the operational efficiency and yield of segmented spraying on complex curved surfaces.

[0086] Example 2: This example provides a spray gun posture control system for curved surface spraying. The system adopts a modular architecture design and is used to execute the curved surface spray gun posture control method in any of the aforementioned method embodiments. It should be understood that the system in this example is not limited to a specific physical hardware form or deployment location. Its constituent modules can be software functional units running on a processor, firmware logic embedded in a chip, or distributed computing nodes distributed in robot controllers, industrial control computers, and cloud servers, as long as the following data flow and control logic can be achieved between the modules.

[0087] The system includes a task surface and an external path interface, configured to acquire the 3D task surface of the target workpiece, as well as the 3D spraying path, tool pose, joint target, or robot task generated by the spray gun pose control system or externally input. It also parses the target or part identity, coordinate system or relative reference, task surface version, path version, tool identity, and input source. Specifically, the task surface interface serves as the system's data input portal, possessing compatibility with multi-source heterogeneous data. For example, this interface can directly read raw point cloud data acquired by a depth camera, pre-processed triangular mesh models, parametric CAD surfaces exported from industrial design software, or composite surface objects with validity markers transmitted from the upstream planning module. Simultaneously, this interface is also responsible for receiving the 3D spraying path defined on the surface, which can originate from manual teaching records, offline programming software generation, or automatic planning results based on visual recognition. Through this standardized interface design, the system decouples the core pose control algorithm from specific sensor models or path generation methods, ensuring the technical solution's broad adaptability to different hardware platforms and process sources.

[0088] The system also includes a local geometric constraint module, configured to construct a local spatial frame based on the local geometric features of the 3D task surface for multiple trajectory points on the 3D spraying path, or to establish local geometric constraint relationships that can equivalently constrain the jet axis and the degrees of freedom of attitude around the jet axis. The local spatial frame or local geometric constraint relationship includes at least the local surface normal and at least one of the path tangent, the spray width lateral direction, or the target boundary tangent. Specifically, this module is the core computing unit of the system's geometric perception, and its internal logic corresponds to the frame construction and adaptive adjustment process described in the aforementioned embodiments. In terms of data flow, this module receives geometric data from the task surface interface, dynamically selects the surface neighborhood for each trajectory point, calculates and outputs an orthogonal or approximately orthogonal NTB frame vector set, or outputs other parameterized expressions (such as rotation matrices, quaternions, or optimized constraint sets) that can equivalently constrain the jet axis direction and the degrees of freedom of attitude around the axis. Preferably, this module also integrates curvature analysis and step-size adaptive sub-units, which can adjust the size of the calculation window in real time according to the complexity of local geometric features, thereby improving the calculation efficiency and noise resistance in smooth areas while ensuring the following accuracy in high curvature areas. When the surface neighborhood crosses holes, right angles, curvature abrupt change areas, low confidence areas, or data missing areas, or when the fitting residual, normal dispersion, or depth integrity rate does not meet the preset conditions, the module marks the corresponding trajectory points as invalid or pending confirmation, and does not directly generate an executable spray gun pose.

[0089] The system also includes a pose constraint module, configured to constrain the spray gun's jet axis based on the local spatial frame or local geometric constraint relationship, and constrain at least one of the following: the spray width specification axis, the rotation angle around the jet axis, or a virtual reference axis used to maintain attitude continuity; and determine the tool center point position of each trajectory point in combination with the target spray distance to generate a spray gun pose sequence. Specifically, this module undertakes the mapping function from an abstract geometric reference system to a specific robot tool pose. It receives frame information or equivalent constraint relationships output by the local geometric constraint module, and constrains the jet axis to be parallel to the opposite direction of the normal or to form a specific tilt angle according to a preset process rule library. At the same time, it aligns the physical spray width specification axis of the spray gun to the spray width lateral direction, path tangent direction, or boundary tangent direction in the frame. Alternatively, for circular spray widths or scenarios where the rotation angle around the jet axis is not sensitive, it determines or restricts the rotation angle around the jet axis using at least one of the following: a virtual continuous reference axis, the previous effective pose, boundary footprint constraints, or robot kinematics optimization results. Based on this, and combined with the target spray distance determined by the current process parameters, the precise coordinates of the tool center point are calculated along the normal offset. The design of this module enables the process intent (such as fan direction and impact angle) to be accurately transmitted to the physical execution end through a mathematical frame, and when the spray gun tool is changed or the installation angle is changed, only the calibration mapping relationship needs to be updated without reconstructing the core algorithm.

[0090] The system also includes an attitude continuity module, configured to achieve continuity by directly solving, continuously parameterizing, online recursively solving, or continuously processing discrete spray gun pose information. This ensures that adjacent target poses satisfy at least two continuity conditions among position, attitude, spray distance, and attitude change rate, forming a continuous spray gun pose sequence or equivalent continuous pose control commands. Specifically, this module eliminates abrupt attitude changes caused by surface discretization or noise, ensuring the smoothness of robot motion. Its processing logic covers normal sign unification, quaternion and hemisphere selection, and constraint optimization of position and attitude change rate. For example, this module can impose limits on angular velocity and angular acceleration between adjacent poses, or generate the shortest path transition through a spherical interpolation algorithm, thereby avoiding jitter or unexpected flipping movements at the end of the robotic arm. Understandably, the smoothing process described above is only one method to achieve continuity between adjacent poses. This module can also employ direct continuous solution (such as continuous parameterization of the pose in spline curves or optimization variable space), model predictive control, or real-time servo calculations to directly generate poses in a continuous form, and then stream them according to the control cycle without needing to completely save the entire pose sequence. The continuous spray gun pose sequence output after processing by this module possesses excellent dynamic characteristics in both the time and spatial domains, laying a kinematic foundation for subsequent high-quality spraying.

[0091] The system also includes an executability verification module, configured to perform executability verification on the continuous spray gun pose sequence or continuous pose control commands based on robot kinematic constraints. If the verification fails, it performs at least one of the following actions: parameter adjustment, strategy adjustment, invalidation marking, pending confirmation, segmentation, or replanning. Before the verification passes, it prohibits the issuance of executable spraying commands for the corresponding path segment. Specifically, this module constitutes a closed-loop safety defense for the system. It substitutes the continuous pose sequence into the robot kinematic model, checking joint limits, singularity indices, and collision gaps point by point. When a potential risk is detected, the module adaptively adjusts according to a preset hierarchical response strategy: it prioritizes attempting fine-tuning of the path direction, switching the spray axis alignment method, or adjusting local parameters such as the process tilt angle; if local adjustments are ineffective, it triggers the cessation of spraying medium, marks the corresponding path segment as invalid, pending confirmation, segmented, or pending replanning, and prohibits the issuance of executable spraying commands for the corresponding path segment before the verification passes. It is particularly important to emphasize that the safety verification logic within this module has the highest priority. Any smoothing or optimization operations must not override the no-spray zone restrictions or collision avoidance instructions, thereby ensuring that the system remains in a safe and controllable state while pursuing process quality.

[0092] The system also includes an output interface configured to output continuous spray gun pose sequences or continuous pose control commands, along with associated spraying control parameters. Specifically, the output interface serves as the interaction terminal between the system and external actuators. It not only outputs a continuous spray gun pose sequence (including TCP position and attitude) verified through a complete processing chain, but also synchronously outputs associated process control parameters such as spraying medium start / stop signals, flow setpoints, and movement speed curves. This interface can use industrial Ethernet, fieldbus, or dedicated robot communication protocols to send data packets to the robot controller, spray gun driver, or production line main control system. Through this integrated output method, the system achieves coordinated distribution of motion control and process control, avoiding quality defects caused by data asynchrony between multiple systems.

[0093] Through the modular architecture described above, the system provided in this embodiment decomposes the complex problem of curved surface spraying pose control into independent but coupled functional units such as geometric perception, pose mapping, motion smoothing, and safety verification.

[0094] Example 3: This invention provides a control device, including a processor and a memory. When the instructions in the memory are executed by the processor, the control device performs the spray gun pose control method for curved surface spraying as described in any of the preceding method embodiments. Specifically, this control device is a physical entity that carries and runs the technical solution of this invention. The processor can be a general-purpose processor, such as a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. The memory can include volatile memory, such as random access memory (RAM); it can also include non-volatile memory, such as flash memory, hard disk, or solid-state drive. In actual industrial applications, the specific form of this control device is diverse. For example, it can be a robot controller integrated inside the painting robot body, directly responsible for real-time trajectory interpolation and servo drive; it can also be an industrial computer or edge computing node independently deployed next to the production line, used for offline programming, path planning and simulation verification, and sending the generated continuous spray gun pose sequence to the robot controller via industrial Ethernet; it can also be a vehicle-mounted computing unit installed on a mobile vehicle, completing local path replanning and verification during vehicle docking; or it can even be a server located in the cloud, providing centralized pose optimization services for multiple painting workstations.

[0095] As another embodiment, the present invention also provides a computer-readable storage medium storing a computer program thereon. When executed by a processor, the computer program causes the processor to perform the spray gun pose control method for curved surface spraying as described in any of the foregoing method embodiments. Specifically, the storage medium is a physical carrier that carries the software code of the technical solution of the present invention. For example, the storage medium may be a read-only memory (ROM), random access memory (RAM), disk, optical disk, USB flash drive, portable hard drive, or various semiconductor memory chips, etc. When the storage medium is inserted into or connected to the processor of the aforementioned control device, the computer program stored therein is loaded and executed, thereby enabling the processor to perform curved surface spraying spray gun pose control.

[0096] Example 4: This example provides a comprehensive application scenario for automotive body surface painting and cross-work surface transitions. It aims to integrate the dispersed adaptive neighborhood adjustment, local frame constraints, pose continuity processing, and media gating technologies from the aforementioned examples into a specific industrial workflow to verify the synergistic effect between these features and their adaptability to complex working conditions. In this example, the target workpiece is an automotive body, whose three-dimensional task surface includes a large, gently sloping door panel, a wheel arch transition area with drastic curvature changes, a window area with a painting restriction attribute, and cross-work surface joints composed of multiple sheet metal parts.

[0097] Specifically, when spraying on smooth areas such as car door panels, the system constructs a local spatial frame based on the local geometric features of the 3D task surface, including the local surface normal, path tangent, and spray width lateral direction. Because this area has low curvature and gentle surface undulations, the system adaptively adjusts the size of the surface neighborhood and the trajectory sampling step size according to the local curvature and surface smoothness, automatically selecting larger surface neighborhoods and using longer sampling step sizes. This configuration fully utilizes the good geometric consistency of smooth areas, effectively suppressing random noise in the depth data by increasing the statistical sample size, making the calculated local surface normal more robust. Simultaneously, based on preset process rules, the system controls the alignment of the spray width's specified axis with the spray width lateral direction, ensuring that the long axis of the fan-shaped spray width is perpendicular to the direction of travel, thereby obtaining the maximum effective coverage width. During this process, the robot maintains a uniform and continuous movement along the 3D spraying path, and with the stable local frame constraint, ensures the uniformity of paint film thickness and overlap consistency on large-area planes, avoiding zebra stripe defects caused by normal jitter.

[0098] When the spraying path enters the high-curvature transition zone such as the wheel arch, the curvature of the 3D task surface increases significantly. At this point, the system adaptively reduces the size of the surface neighborhood and shortens the trajectory sampling step size according to the increase in local curvature. This dynamic adjustment ensures that the data points used for normal fitting are strictly limited to local small patches, preventing the smoothing of geometric features at the surface transition due to an excessively large neighborhood. Simultaneously, the poses of adjacent trajectory points in the spray gun pose sequence are continuously smoothed. Through quaternion hemispherization and angular velocity constraints, the spray gun posture smoothly twists with the surface shape, eliminating posture jumps that may be caused by abrupt changes in curvature. Under this mechanism, the jet axis always accurately tracks the normal change of the wheel arch surface, and the spray width axis dynamically switches alignment according to the boundary direction, effectively ensuring the coating integrity of deep cavities and corner areas, and solving the over-spraying or under-spraying problems that easily occur in high-curvature areas with traditional fixed-parameter methods.

[0099] When crossing prohibited spraying areas such as vehicle windows, the three-dimensional spraying path is divided into multiple permitted spraying media intervals by the permitted spraying area. Unlike the obstacle-detection-stopping approach in traditional solutions, this embodiment controls the robot to maintain continuous movement along the three-dimensional spraying path without acceleration or deceleration due to media start-up and stop. The system generates an independent spraying media start-up and stop sequence based on each permitted spraying media interval, and performs distance compensation for the start and stop positions based on the current path speed, spray gun response time, and stable spray establishment time. For example, when approaching the front boundary of the vehicle window, the system calculates the early stop distance based on the current path speed, cuts off the paint valve before reaching the geometric boundary, and uses the time-of-flight difference to ensure that the paint mist has completely dissipated before contacting the glass; when crossing the rear boundary of the vehicle window, the system sends an early start signal so that the atomized fan reaches a stable state precisely when it reaches the spraying start point. This control mode, which decouples motion from media, avoids efficiency losses and film thickness accumulation caused by frequent start-up and stop, and ensures the safety of prohibited spraying areas and the coating quality at the edges of permitted areas through precise distance compensation.

[0100] Furthermore, when processing the cross-work surface seam between the fender and the door, the system reads pre-calibrated seam mapping data and identifies the geometric attributes of the front, core, and rear areas of the seam. When generating the spray gun pose across the seam, constraints of positional continuity (C0) and tangential continuity (G1) are applied to ensure that the tool center point path has no physical breaks and that the movement direction smoothly transitions at the seam. If abnormal curvature is detected at the seam or the robot approaches a singularity, the system performs an executability check based on robot kinematic constraints. In response to a failed check, it prioritizes adjusting the path direction or process setting angle. If the safety threshold is still not met, it triggers a deceleration strategy or adjusts the vehicle's docking position after stopping the spraying medium and replanning. This hierarchical adaptation mechanism ensures the continuity of cross-surface spraying, effectively eliminates paint film seams at the seams, and improves the overall vehicle appearance quality.

[0101] In one neighborhood discrimination implementation, a two-dimensional surface neighborhood is obtained along the path direction and the lateral direction of the spray width, centered on the trajectory point, and 15 mm can be used as the initial window size. If the depth variation within a continuous window gradually stabilizes as the window expands, the local curvature, surface normal, and fitting confidence are determined by combining the neighborhood point cloud or surface model; 15 mm is only an example value that can be adjusted according to the spray width, point spacing, and local curvature. If a depth jump, connectivity break, or normal clustering occurs within a window that exceeds the curvature range achievable by the workpiece, it is identified as an edge, hole, or right-angle turn, and the pose is not generated using a single fitted surface that crosses that point.

[0102] The local spatial frame can be stored as an explicit three-axis data structure, or implicitly represented by parameters, rotation matrices, quaternions, or optimization constraints that uniquely or constrainedly determine the jet axis, path tangent, and jet width lateral direction at each trajectory point. For jet widths that are nearly circular or whose rotation around the jet axis is approximately insensitive to the deposition results, the defined axis of the jet width can be a virtual continuous reference axis, or the degrees of freedom around the jet axis can be retained within the range of satisfying path continuity, boundary footprint, and robot kinematic constraints; the local frame and continuous pose control cannot be bypassed simply because the jet width lateral direction is not explicitly stored. It is understood that the above processing using an explicit local spatial frame with a fixed alignment method is only a specific example. In other embodiments of the present invention, the system can also select an "equivalent constraint relationship" to replace the explicit frame, or select the target boundary tangent to replace the path tangent or jet width lateral direction as the constraint reference, as long as the jet axis direction and the degrees of freedom of attitude around the axis can be equivalently defined, the same process effect can be achieved.

[0103] For each candidate pose, the system can also output geometric confidence, fitting residual, reachability margin, and collision gap. Low-confidence trajectory points can be addressed by narrowing the neighborhood, changing the sampling direction, rescanning, inserting non-sprayed transition sections, or transferring to manual verification, rather than extrapolating the executable pose from the other side of the hole or discontinuous surfaces. The method can be implemented by a centralized or distributed processor and a non-transitory computer-readable medium storing instructions.

[0104] When the coordinates of the vehicle carrying the vision acquisition unit or robot, the sampling pose, or the coordinate version of the 3D task surface becomes invalid, and after recovery or correction based on inherent image features and existing coordinate records, the spray gun pose sequence and unexecuted spraying permits corresponding to the old version remain invalid or pending verification. The system recalculates the local spatial frame and pose sequence on the new version of the 3D task surface, and re-executes joint limits, singularities, collision gaps, and spray distance checks before outputting robot execution commands.

[0105] For the power, control signals, data, compressed air, paint, or other media required by vehicles, robots, measuring units, or tools, the accompanying supply or wiring mechanism may employ suspended chutes or cable chains, curved track cable trolleys, passive single or multi-section rotating booms, safety zone reels with universal cable guides, electrostatic conductive three-dimensional energy chains, ground or sidewall protected channels, energy or media sources located on the vehicle, or combinations of two or more of these, and may be arranged in straight lines, L-shapes, U-shapes, arcs, or other operating routes. The mechanism should meet the requirements for bending radius, tension release, electrostatic discharge, grounding, fire protection, and mechanical protection according to the actual environment. Unless otherwise explicitly specified, the supply or wiring mechanism only undertakes the functions of media transmission, cable bearing, stress release, or safe accompanying, and is not a necessary reference for vehicle positioning, navigation, or turning. This invention does not necessarily limit it to any particular wiring structure.

[0106] In some implementations, the aforementioned pose control steps are executed by a robot controller, an industrial computer, or a combination thereof; the program instructions may be stored in a non-transitory computer-readable storage medium or provided as a computer program product. When the processor executes the program instructions, it converts the surface geometric constraints into continuous physical pose and spray medium start / stop control of the robotic arm end effector, and changes the robot path, posture, or carrier docking position based on the kinematics test results.

[0107] Furthermore, the local spatial frame does not need to be explicitly stored as an independent data object. The processor can write the local surface normal, path tangent, boundary tangent, spray footprint, spray distance, attitude change rate, and kinematic constraints into the same optimization objective or constraint set, and directly solve for the tool pose of each trajectory point; as long as the solution physically defines both the spray axis and the attitude degrees of freedom around the spray axis, and performs continuity and executability gating on adjacent poses, it is an equivalent implicit representation of the local spatial frame. For near-circular sprays, a virtual reference axis or a continuous optimal solution can be used to replace the major axis of the physical spray, avoiding loss of protection due to the lack of a clearly defined spray axis in the spray gun structure.

[0108] Continuous spray gun poses can be generated either by first generating discrete poses and then smoothing them, or directly generated in a continuous form from splines, optimization variables, state space, model predictive control, or real-time servo calculations, and then streamed according to the control cycle without saving the complete pose sequence. Safety handling of unexecutable path segments is not limited to continuing parameter adjustments; when joint limits, singularities, collision clearances, data validity, or attitude change rates do not meet the conditions, the media can be stopped, publishing frozen, marked invalid, confirmation requested, path splitting, or replanning can be implemented. Regardless of the calculation order and data carrier used, a closed loop must be maintained, including local geometric constraints, continuity conditions, kinematic executability checks, and prohibiting publishing if any checks fail.

[0109] Example 5: In a distributed implementation, the surface modeling node, external path generation node, pose continuity node, and robot control node are independent of each other. The transmitted data is associated with at least two of the following: task identifier, target or component identifier, surface version, coordinate reference, tool identity, path or pose version, and verification status. The tool pose, joint target, or executable trajectory output by the external path generation node must be re-verified by the surface modeling node based on the current 3D task surface, local geometric features, target spray distance, and robot kinematic constraints before being passed to the pose continuity node. Only after successful verification can the continuity processing and executability verification process begin. The robot control node only receives continuous pose sequences verified by the current surface and tool version. The above processing ensures that externally input trajectories or poses will not be issued as robot executable instructions until they have been re-verified and passed by the current surface, tool identity, and kinematic constraints. This reduces attitude jumps, spray distortion, collisions, and uneven film thickness caused by mismatches between the external trajectory and the current physical surface or tool coordinates, allowing the geometric calculation results to have a direct technical effect on the actual six-degree-of-freedom motion of the robot end effector.

[0110] This invention can also be implemented as a control device or robot system including a processor, memory, task surface interface, external path interface, tool identity interface, and robot control interface; it can also be implemented as a non-transitory computer-readable storage medium, a computer program product, or a distributed processing system. The program instructions cause the processor to perform external path association (including at least one of associated target identity, coordinate reference, surface version, path version, tool identity, and input source), forced re-verification of external input pose, local geometric constraints, pose continuity, motion calibration, and release gating, and actually change the robot arm joint motion, spray gun posture, spray distance, and spray medium start / stop.

[0111] The above processing reduces attitude jumps, spray distortion, collisions, and uneven film thickness caused by mismatch between the external trajectory and the current physical surface or tool coordinates, so that the geometric calculation results have a direct technical effect on the actual six-degree-of-freedom motion of the robot end effector.

[0112] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any person skilled in the art, within the technical scope disclosed in this invention, can easily conceive of corresponding variations, substitutions, or combinations based on the technical concepts disclosed in the foregoing embodiments, such as the local space frame construction logic, pose continuity smoothing mechanism, kinematic executability verification closed loop, and spraying medium start-stop compensation strategy. For example, adjusting the definition order of the frame vectors, changing the specific implementation form of the smoothing algorithm, modifying the triggering conditions of the adaptive parameters, or reorganizing the functional division of system modules, etc., all of these equivalent transformations should be covered within the scope of protection of this invention. Therefore, the scope of protection of this invention should be determined by the scope of the claims.

Claims

1. A method for controlling the position and posture of a spray gun in curved surface spraying, characterized in that, include: Obtain the three-dimensional task surface of the target workpiece and the three-dimensional spraying path located on the three-dimensional task surface; The 3D spraying path is generated by the spray gun pose control system, or imported by external devices, systems, or interfaces in the form of coordinates, path, tool pose, joint target, or robot task. For external input, at least one of the following is associated: target or component identity, coordinate system or relative reference, task surface version, path version, tool identity, and input source. When the external input already contains tool pose or executable trajectory, its position is still projected or checked to the current 3D task surface, and pose constraints are re-verified or generated according to at least two of the following: current local surface normal, target spray distance, path tangent or spray width lateral direction, and tool coordinate transformation. When the associated information is missing, conflicting, or invalid, the external input is not directly published. For multiple trajectory points of the three-dimensional spraying path, a local spatial frame or equivalent constraint relationship for the spray axis and the attitude degree of freedom around the spray axis is constructed based on local geometric features; the local spatial frame or constraint relationship includes the local surface normal, and at least one of the path tangent, the spray width lateral direction or the target boundary tangent. Based on the local spatial frame or constraint relationship, constrain the jet axis and at least one of the following: the jet width specification axis, the rotation angle around the jet axis, or the virtual reference axis, and combine it with the target spray distance to determine the position of the tool center point, and generate the spray gun pose sequence; By continuously solving, continuously parameterizing, online recursion, or continuously processing discrete poses, the poses of adjacent targets can satisfy at least two of the continuity conditions among position, attitude, spray distance, and attitude change rate, thus forming a continuous spray gun pose sequence or continuous pose control command. The executability is verified based on the robot's kinematic constraints; if the verification fails, the pose parameters or execution strategy are adjusted, or the corresponding path segment is marked as invalid, pending confirmation, segmented, or pending replanning, and the issuance of executable painting instructions for the path segment is prohibited. Output the continuous spray gun pose sequence or continuous pose control command and its associated spraying control parameters.

2. The method according to claim 1, characterized in that, The construction of the local surface normal, path tangent, and spray width lateral direction includes: The local surface normal is determined based on the surface neighborhood surrounding the trajectory point; The path difference direction of the three-dimensional spraying path at the trajectory point is projected onto the tangent plane of the local surface normal to obtain the path tangent. The lateral direction of the spray pattern is determined based on the cross product of the local surface normal and the path tangent.

3. The method according to claim 2, characterized in that, The jet axis is constrained based on the local spatial frame or constraint relationship, and at least one of the following: the jet width specification axis, the rotation angle around the jet axis, or the virtual reference axis, including: The jet axis is controlled to be parallel to the opposite direction of the local surface normal, or to form a process-defined tilt angle with the opposite direction of the local surface normal; The control spray width axis is aligned with one of the following: the spray width lateral direction, the path tangent direction, or the target boundary tangent direction, according to a preset process rule; when the spray width is approximately circular or the deposition result is not sensitive to the rotation angle around the spray axis, the rotation angle is determined or limited by at least one of the following: a virtual continuous reference axis, the previous effective posture, boundary footprint constraints, or the robot kinematics optimization result.

4. The method according to claim 1, characterized in that, The acquisition of the spray gun pose sequence includes: Unify the sign and direction of the local surface normals of adjacent trajectory points; The spray gun rotation representation of adjacent trajectory points is subjected to hemispherical processing; Apply continuity constraints to the rate of change of position and attitude of adjacent trajectory points to limit the rate of change of adjacent angular velocity, angular acceleration or jet distance.

5. The method according to claim 4, characterized in that, Execution verification based on robot kinematic constraints includes: Check the joint limits, singularities, and collision gaps corresponding to the continuous spray gun pose sequence; In response to the inspection results not meeting the preset safety threshold, adjust the path direction of the three-dimensional spraying path, the selection of the spray width specification axis, the process setting tilt angle, or the trajectory sampling step size. If the preset safety threshold is still not met after adjustment, the robot will output a command to adjust the position of the robot base or the docking position after stopping the spraying of the medium and replanning.

6. The method according to claim 1, characterized in that, Constructing local spatial frames or local geometric constraints based on local geometric features includes: Select the surface neighborhood around the trajectory point; The size of the surface neighborhood and the trajectory sampling step size are adaptively adjusted based on the local curvature, fitting residual, or surface smoothness of the three-dimensional task surface. The local surface normal is determined based on the adjusted surface neighborhood; When the surface neighborhood crosses a hole, right angle, curvature abrupt change region, low confidence region or data missing region, or when the fitting residual, normal dispersion or depth integrity rate does not meet the preset conditions, the corresponding trajectory point is marked as invalid or pending confirmation.

7. The method according to claim 1, characterized in that, The method further includes: When the three-dimensional spraying path is divided into multiple permitted spraying medium intervals by the permitted spraying area, the robot is controlled to maintain continuous movement along the three-dimensional spraying path and generate a spraying medium start-stop sequence according to each permitted spraying medium interval. Based on the current path speed, spray gun response time, and stable spray establishment time, distance compensation is applied to the gun opening and closing positions to ensure that the stable spray width penetrates the core part of each spray medium's permissible range.

8. A spray gun position and posture control system for curved surface spraying, characterized in that, include: The task surface and external path interface is configured to acquire the 3D task surface of the target workpiece and the 3D spraying path, tool pose, joint target or robot task generated by the spray gun pose control system or externally input, and to parse the target or part identity, coordinate system or relative reference, task surface version, path version, tool identity and input source. The local geometric constraint module is configured to construct a local spatial frame based on the local geometric features of the three-dimensional task surface for multiple trajectory points on the three-dimensional spraying path, or to establish local geometric constraint relationships that are equivalent to constrain the jet axis and the attitude degrees of freedom around the jet axis. The pose constraint module is configured to constrain the spray gun's jet axis based on the local spatial frame or local geometric constraint relationship, and constrain at least one of the following: a specified spray width axis, a rotation angle around the jet axis, or a virtual reference axis used to maintain attitude continuity; and determine the tool center point position of each trajectory point in combination with the target spray distance to generate a spray gun pose sequence. The attitude continuity module is configured to form a continuous spray gun attitude sequence or equivalent continuous attitude control command by continuously solving, continuously parameterizing, online recursively solving, or continuously processing discrete spray gun attitude information. The executability verification module is configured to perform executability verification on the continuous spray gun pose sequence or continuous pose control command based on robot kinematic constraints, and to perform at least one of the following actions when the verification fails: parameter adjustment, strategy adjustment, invalidation mark, pending confirmation, segmentation or replanning, and to prohibit the issuance of executable spraying commands for the corresponding path segment before the verification passes. The output interface is configured to output the continuous spray gun pose sequence or continuous pose control command, as well as the associated spraying control parameters.

9. A control device, characterized in that, It includes a processor and a memory, wherein instructions in the memory, when executed by the processor, cause the control device to perform the method of any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, It stores a computer program that, when executed by a processor, causes the processor to perform the method of any one of claims 1 to 7.