Scan posture planning method and system for narrow-space robot visual detection of welds

CN122807885APending Publication Date: 2026-09-25WUHAN UNIV OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611004571.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-07
Publication Date
2026-09-25

AI Technical Summary

Technical Problem

然而,针对复杂空间网格焊缝的扫描姿态规划,现有技术仍存在显著瓶颈,严重制约焊接自动化水平提升:

Benefits of technology

[0018]本发明产生的有益效果是:通过构建仿真三维模型,基于提取的焊缝特征点集拟合焊缝轴线,实现了扫描路径的精准基准定位;自主求解出无碰撞的第一姿态区间和仅包含目标焊缝特征的无干扰第二姿态区间,系统性排除了非焊缝特征的成像干扰;通过对上述两个姿态区间取交集选取最优目标姿态,并经坐标转换生成各路径点的扫描位姿,确保了扫描过程同时满足无碰撞与高纯净度视场的双重要求;最后采用位置插值结合姿态插值的方法对扫描位姿进行平滑处理,生成连续无碰撞的扫描路径,避免了姿态突变引发的关节冲击与轨迹偏差。本发明提升了狭窄空间内复杂焊缝扫描规划的自动化程度、数据精度与系统鲁棒性,适配多品种、小批量的柔性化焊接生产需求。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122807885A_ABST
    Figure CN122807885A_ABST
Patent Text Reader

Abstract

The application discloses a scanning posture planning method and system for robot visual detection of a weld joint in a narrow space, and the method comprises the following steps: constructing a simulation three-dimensional model; extracting a weld joint feature point set from a model of a workpiece to be welded, fitting a weld joint axis, defining a visual sensor coordinate system and a field of view parameter; solving a first posture interval; solving a second posture interval so that only target weld joint features are contained in the field of view; taking an intersection of the first posture interval and the second posture interval, and selecting a target posture therefrom; establishing an end effector coordinate system at a weld joint path point, and obtaining a scanning posture corresponding to each weld joint path point through coordinate conversion; and adopting a position interpolation combined with a posture interpolation method to perform smoothing processing on all scanning postures, and generating a continuous and collision-free scanning path. The application can realize visual scanning posture teaching-free autonomous planning of a weld joint in a narrow space, and improves planning efficiency and detection accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of intelligent robotic welding technology, and in particular to a scanning posture planning method and system for visual inspection of weld seams in confined spaces. Background Technology

[0002] With the deep integration of robotics and visual perception technologies, robotic vision welding systems are widely used in welding complex components in aerospace, shipbuilding, and automotive equipment industries. The "eye-in-hand" configuration has become the mainstream due to its advantages of flexible observation and strong adaptability. However, existing technologies still face significant bottlenecks in planning the scanning posture for complex spatial mesh welds, severely hindering the improvement of welding automation levels. Highly dependent on human experience and lacking adaptive capabilities: Current mainstream methods mostly adopt a combination of offline programming and on-site teaching. Operators need to manually adjust the robot's posture to ensure that the sensor covers the target weld area, which requires a high level of experience. When facing complex curved surfaces or welds with multiple spatial curves, manual adjustment is difficult to guarantee the optimal scanning posture, requiring repeated trial and error and consuming a lot of time. Moreover, on-site teaching can only reproduce the posture of the teaching point and cannot adaptively adjust according to the actual clamping deviation of the workpiece or the fluctuation of the weld position, making it difficult to meet the requirements of high-precision welding.

[0003] Lacking a systematic consideration of field of view purity, imaging quality is not guaranteed: Existing attitude planning methods only focus on whether the sensor observes the weld seam, without systematically constraining interference from non-weld seam features within the field of view. The field of view of the vision sensor is easily mixed with irrelevant structures such as workpiece edges, holes, and bosses, leading to misidentification or feature extraction deviations in the image processing stage, which directly affects the accuracy and integrity of the weld seam point cloud.

[0004] Insufficient path smoothness processing limits motion performance: Spatial fillet welds are composed of multiple curve segments. Existing methods plan each segment of the trajectory independently without considering the attitude continuity constraints at the intersection points, which can easily lead to abrupt changes in attitude angles, triggering joint impact loads and reducing the robot's motion stability and trajectory tracking accuracy.

[0005] In addition, although existing publicly available technologies can achieve adaptive adjustment of welding posture for some complex welds, they are only geared towards the welding execution stage. They do not construct field constraints and interference-free imaging rules for visual scanning, nor do they achieve active collision-free posture solving in narrow spaces, and their scanning applicability is still insufficient.

[0006] In summary, existing welding torch scanning posture planning methods cannot achieve fully autonomous posture solving and still rely on manual teaching. Especially in spatial fillet weld operations with front-facing vision sensors, due to the complex weld space orientation, narrow working space, and strict imaging constraints of the sensor on working distance / incident angle, existing algorithms cannot automatically complete global search and optimization that balances field of view purity and collision-free operation. Operators still need to avoid interference and collisions by repeatedly teaching, manually adjusting posture, and setting manual obstacle avoidance points. This results in low debugging efficiency and poor consistency, which greatly limits the intelligent application of robots in welding tasks involving multiple varieties and small batches of complex spatial structures. Summary of the Invention

[0007] The main objective of this invention is to provide a scanning posture planning method and system for visual inspection of weld seams in narrow spaces using robots. Under the premise of balancing collision-free operation and a clean field of view, this method enables autonomous planning of the visual scanning posture of weld seams in narrow spaces without the need for teaching, thereby improving planning efficiency and inspection accuracy.

[0008] The technical solution adopted in this invention is: a scanning posture planning method for visual inspection of weld seams in narrow spaces by robots, characterized in that it includes: A simulated 3D model is constructed, which includes a robot, an end effector, and a workpiece to be welded. The end effector is equipped with a vision sensor. Extract the weld feature point set from the model of the workpiece to be welded, fit the weld axis based on the weld feature point set, and define the visual sensor coordinate system and field parameters. Based on the preset imaging constraints, the end effector is rotated and swept along the weld axis. Collision detection is performed by a simplified envelope model to solve the first attitude interval. Based on the field of view parameters, a visual sensor field of view geometric model is constructed. The field of view range is adjusted with weld feature points as a reference to solve the second attitude interval that contains only the target weld feature within the field of view. The intersection of the first attitude interval and the second attitude interval is taken, and the target attitude is selected from it; based on the target attitude, the coordinate system of the end effector at the weld path point is established, and the scanning pose corresponding to each weld path point is obtained through coordinate transformation; By employing a method that combines position interpolation with pose interpolation, all scan poses are smoothed to generate a continuous, collision-free scan path.

[0009] According to the above technical solution, the preset imaging constraints include optical plane vertical constraints, working distance constraints, and field of view constraints.

[0010] According to the above technical solution, the visual sensor field of view geometry model is a quadrangular cone model. The quadrangular cone has the lens optical center as the vertex and the physical field of view rectangular surface as the base. By iteratively adjusting the horizontal field of view range of the cone, the second attitude interval that makes the cone contain only the target weld features and no other interfering features is solved.

[0011] According to the above technical solution, the intersection of the first attitude interval and the second attitude interval is taken, and the target attitude is selected from it. Specifically, the intermediate value of the intersection of the first attitude interval and the second attitude interval is selected as the target attitude.

[0012] According to the above technical solution, obtaining the scanning pose corresponding to each weld path point through coordinate transformation specifically includes: determining the unit vector of each axis of the end effector coordinate system based on the target pose, projecting the unit vector to the robot base coordinate system to obtain a rotation matrix, and transforming the end effector pose to the robot base coordinate system based on the rotation matrix to obtain the scanning pose.

[0013] According to the above technical solution, the position interpolation adopts fifth-order polynomial interpolation, and the attitude interpolation adopts quaternion spherical linear interpolation.

[0014] According to the above technical solution, the normalized time rate of change of the fifth-order polynomial interpolation is used as the sole driving parameter of the quaternion spherical linear interpolation.

[0015] According to the above technical solution, for multiple spatial welds of the workpiece to be welded, only the feature point set of a local segment with a preset length in the midpoint region of each weld is extracted for scanning planning; by collecting the weld contour point cloud of the local segment, the complete weld trajectory is obtained through straight line fitting and intersection calculation.

[0016] According to the above technical solution, the field of view parameters include the horizontal field of view angle, the vertical field of view angle, and the optimal working distance, wherein the optimal working distance is the straight-line distance from the optical center of the lens to the weld feature point.

[0017] Another aspect of the present invention provides a scanning posture planning system for visual inspection of weld seams in confined spaces by a robot, comprising: The simulation environment construction module is used to build a simulation 3D model containing a robot, an end effector, and a workpiece to be welded, wherein the end effector is equipped with a vision sensor; The feature extraction and definition module is used to extract the weld feature point set from the model of the workpiece to be welded, fit the weld axis based on the weld feature point set, and define the visual sensor coordinate system and field parameters. The collision-free attitude solving module is used to control the end effector to rotate and sweep along the weld axis based on preset imaging constraints, and to perform collision detection through a simplified envelope model to solve the first attitude interval. The interference-free field of view solving module is used to construct a visual sensor field of view geometric model based on the field of view parameters, adjust the field of view range with weld feature points as a reference, and solve for the second attitude interval that makes the field of view contain only the target weld feature. The attitude determination module is used to find the intersection of the first attitude interval and the second attitude interval, and select the target attitude from it. The pose conversion module is used to establish the end effector coordinate system at the weld path point based on the target pose, and obtain the scanning pose corresponding to each weld path point through coordinate conversion; The path generation module is used to smooth all scan poses by combining position interpolation with attitude interpolation, generating a continuous, collision-free scan path.

[0018] The beneficial effects of this invention are as follows: By constructing a simulated 3D model and fitting the weld axis based on the extracted weld feature point set, precise benchmark positioning of the scanning path is achieved; a collision-free first attitude interval and an interference-free second attitude interval containing only the target weld features are autonomously solved, systematically eliminating imaging interference from non-weld features; by selecting the optimal target attitude by taking the intersection of the above two attitude intervals and generating the scanning pose of each path point through coordinate transformation, the scanning process is ensured to simultaneously meet the dual requirements of collision-free and high-purity field of view; finally, a method combining position interpolation and attitude interpolation is used to smooth the scanning pose, generating a continuous collision-free scanning path, avoiding joint impact and trajectory deviation caused by abrupt attitude changes. This invention improves the automation, data accuracy, and system robustness of complex weld scanning planning in narrow spaces, adapting to the flexible welding production needs of multiple varieties and small batches.

[0019] Furthermore, by selecting the median value of the intersection of the first and second attitude intervals as the target attitude, the risk of approaching the interval boundary is avoided, the probability of scanning failure due to minor perturbations is reduced, and the engineering applicability of the method is enhanced.

[0020] Furthermore, by determining the unit vectors of each axis of the end coordinate system, projecting them onto the base coordinate system to obtain the rotation matrix, and transforming the pose, the accuracy and repeatability of the pose calculation are ensured, and trajectory deviations caused by coordinate transformation errors are avoided.

[0021] Furthermore, fifth-order polynomial position interpolation and quaternion spherical linear attitude interpolation are adopted, and the time change rate of position interpolation is used as the only driving parameter for attitude interpolation. This improves the smoothness of robot motion and trajectory tracking accuracy, and avoids joint impact and trajectory deviation.

[0022] Furthermore, for multiple spatial welds, only a local segment feature point set of a preset length in the midpoint region of each weld is extracted, which greatly reduces the scanning path length and data acquisition volume, and significantly improves planning efficiency while ensuring the accuracy of the complete weld trajectory.

[0023] Of course, any product implementing this invention does not necessarily need to achieve all of the advantages described above at the same time. Attached Figure Description

[0024] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0025] Figure 1 This is a flowchart of the scanning posture planning method for robot visual inspection of weld seams in narrow spaces according to an embodiment of the present invention; Figure 2 This is a schematic diagram of the workpiece to be welded according to an embodiment of the present invention; Figure 3 This is a schematic diagram of a partial weld section scan according to an embodiment of the present invention; Figure 4 This is a schematic diagram of the first attitude range solution according to an embodiment of the present invention; Figure 5 This is a geometric model diagram of the four-sided frustum of the vision sensor according to an embodiment of the present invention; Figure 6 This is a schematic diagram of the second attitude interval solution according to an embodiment of the present invention; Figure 7 This is a diagram showing the relationship between the end effector coordinate system and the robot base coordinate system in an embodiment of the present invention. Figure 8 This is a schematic diagram of the smooth transition of the scanning path according to an embodiment of the present invention; Figure 9 This is a simulation result diagram of the robot's end effector trajectory according to an embodiment of the present invention; Figure 10 This is a flowchart of another robot visual inspection weld seam scanning posture planning method in a narrow space according to an embodiment of the present invention. Detailed Implementation

[0026] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.

[0027] It should be noted that the illustrations provided in the embodiments of the present invention are only schematic representations of the basic concept of the present invention. Therefore, the drawings only show the components related to the present invention and are not drawn according to the number, shape and size of the components in actual implementation. In actual implementation, the form, quantity and proportion of each component can be arbitrarily changed, and the layout of the components may also be more complex.

[0028] In this invention, it should also be noted that the terms "center," "upper," "lower," "left," "right," "vertical," "horizontal," "inner," and "outer," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are used only for the convenience of describing this application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this application. Furthermore, the terms "first" and "second" are used only for descriptive and distinguishing purposes and should not be construed as indicating or implying relative importance.

[0029] Example 1 This embodiment provides a scanning posture planning method for robot visual inspection of weld seams in confined spaces, the process of which is as follows: Figure 1 As shown, by combining the three-dimensional geometric features and optical imaging constraints of the workpiece, welding torch, and front-facing vision sensor, the system automatically performs a global search and optimization that meets the requirements of an interference-free field of view, sensor imaging, and collision-free obstacle avoidance, thus achieving precise planning of the scanning posture. The steps include: S1. Construct a simulated 3D model including the robot, the end effector, and the workpiece to be welded. The end effector is equipped with a vision sensor. Specifically, a line laser sensor is used to obtain the weld contour.

[0030] Furthermore, the simulation 3D model also includes a workbench.

[0031] S2. Extract the weld feature point set from the model of the workpiece to be welded, fit the weld axis based on the weld feature point set, and define the visual sensor coordinate system and field parameters. Specifically, for the four welds at the bottom of the rectangular workpiece, an efficient scanning strategy is adopted. Only a certain length of local segment is scanned in the midpoint region of each weld, and the weld contour point cloud of this segment is acquired. Subsequently, the positions of the four corner points are obtained through line fitting and intersection calculation, thereby significantly reducing the scanning path length and data acquisition volume. Based on the above weld feature point set, the weld axis is fitted, and the visual sensor coordinate system and its field of view parameters are defined. These field of view parameters specifically include the horizontal field of view angle, the vertical field of view angle, and the optimal working distance, which specifically refers to the straight-line distance from the camera's optical center to the weld feature point.

[0032] S3. Based on the preset imaging constraints, the end effector is rotated and swept along the weld axis. Collision detection is performed by simplifying the envelope model to solve the first attitude interval. Based on the field of view parameters, a visual sensor field of view geometry model is constructed. The field of view range is adjusted with the weld feature points as the reference to solve the second attitude interval that contains only the target weld features in the field of view.

[0033] Specifically, the attitude of the end effector is solved based on preset imaging constraints. These preset imaging constraints mainly include a light plane perpendicularity constraint and a working distance constraint. Specifically, the sensor's light plane must be perpendicular to the weld direction to ensure the laser line completely covers the weld cross-section, and the weld point must be located at the sensor's optimal working distance. Under these constraints, the end effector is rotated and swept along the previously fitted weld axis. To reduce the geometric complexity of collision detection, the entire welding torch actuator, including the front sensor, is geometrically simplified. A rectangular envelope is used to approximate the main body of the welding torch, the sensor is simplified to a regular rectangular block, and the welding torch neck and connecting structure are simplified to cylinders. Through this simplified combined envelope model, the spatial interference between the envelope and the workpiece, fixture, and other environmental models under the scanning attitude is solved one by one in the simulation environment, thereby obtaining the first attitude interval that satisfies the collision-free condition.

[0034] Simultaneously, a field-of-view geometric model of the vision sensor is constructed based on the aforementioned field-of-view parameters. This model is specifically a four-sided frustum model, with the lens optical center as the vertex and the physical field-of-view rectangular surface as the base, accurately describing the sensor's effective imaging range in space. Intersection calculations are performed between this frustum and the model of the workpiece being welded, extracting the local geometric region of the workpiece falling within the frustum. Based on this, using weld feature points as a reference, the field of view is gradually adjusted along the horizontal direction of the frustum. By iteratively calculating the spatial positional relationship between the frustum and interfering features, the critical position where the frustum contains only the target weld feature and no non-weld interference features is determined, thus defining the second attitude interval of the interference-free field of view.

[0035] S4. Take the intersection of the first attitude interval and the second attitude interval, and select the target attitude from it; based on the target attitude, establish the end effector coordinate system at the weld path point, and obtain the scanning pose corresponding to each weld path point through coordinate transformation.

[0036] Subsequently, the intersection of the first attitude interval and the second attitude interval obtained above is taken. In order to ensure that there is sufficient safety margin during the scanning process and to avoid the attitude being at the extreme boundary, the median value of this intersection interval is selected as the final target yaw angle of the end effector, i.e., the target attitude.

[0037] Based on the selected target pose, an end effector coordinate system is established at the weld path points. First, the unit vectors of each axis of the welding torch coordinate system are determined. The z-axis unit vector is collinear with the center of the sensor camera's optical axis, pointing from the selected weld feature point to the center of the optical axis. The y-axis unit vector is obtained by normalizing the cross product of the forward vector and the z-axis unit vector. The x-axis unit vector is determined by the right-hand rule. Projecting the unit vectors of each axis onto the robot's base coordinate system yields the rotation matrix. Based on this rotation matrix, the end effector's pose at the path points is transformed to the robot's base coordinate system, thus obtaining the specific scanning pose corresponding to each weld path point.

[0038] S5. Using a combination of position interpolation and attitude interpolation, all scan poses are smoothed to generate a continuous, collision-free scan path.

[0039] Specifically, position interpolation employs fifth-order polynomial interpolation to avoid rigid and flexible impacts during robot movement; attitude interpolation uses quaternion spherical linear interpolation to prevent abrupt changes in the welding torch's attitude adjustment. In particular, the normalized time rate of change of the fifth-order polynomial position interpolation is used as the sole driving parameter for the quaternion spherical linear interpolation, achieving strong mathematical coupling and smooth coordination between position and attitude. This improved interpolation method enables a continuous and smooth transition between the four scanning attitude points, generating the final scanning path.

[0040] It should be noted that when the sensor completes its current scan or is in a non-operating state, the welding torch actuator will first raise the entire welding torch to a preset safe height to ensure that the welding torch and sensor are completely removed from the physical interference zone of the workpiece. After the height is raised and a safe state is confirmed, the system then performs the posture transition between adjacent path points based on a smoothing algorithm. This mechanism effectively avoids the risk of intermediate pose collisions caused by discrete point interpolation during the transition phase, ensuring the robot's safety throughout the entire movement process.

[0041] This embodiment also provides a scanning posture planning system for robot visual inspection of weld seams in narrow spaces, including: The simulation environment construction module is used to build a simulation 3D model including a robot, an end effector, a workpiece to be welded, and a worktable. The end effector is equipped with a vision sensor. The feature extraction and definition module is used to extract the weld feature point set from the model of the workpiece to be welded, fit the weld axis based on the weld feature point set, and define the visual sensor coordinate system and field parameters. The collision-free attitude solving module is used to control the end effector to rotate and sweep along the weld axis based on preset imaging constraints, and to perform collision detection through a simplified envelope model to solve the first attitude interval. The interference-free field of view solving module is used to construct a visual sensor field of view geometric model based on the field of view parameters, adjust the field of view range with weld feature points as a reference, and solve for the second attitude interval that makes the field of view contain only the target weld feature. The attitude determination module is used to find the intersection of the first attitude interval and the second attitude interval, and select the target attitude from it. The pose conversion module is used to establish the end effector coordinate system at the weld path point based on the target pose, and obtain the scanning pose corresponding to each weld path point through coordinate conversion; The path generation module is used to smooth all scan poses by combining position interpolation with attitude interpolation, generating a continuous, collision-free scan path.

[0042] Example 2 Based on Example 1, this invention proposes a specific application of a scanning posture planning method for visual inspection of weld seams in narrow spaces using robots. The process is as follows: Figure 10 As shown, it is mainly divided into the following stages: Based on a high-precision 3D model of the workpiece and welding torch (including a front-view sensor), a simulation environment is constructed, defining the sensor coordinate system and its field-of-view geometric parameters (including the horizontal field of view angle). Vertical field of view (Optimal working distance d), and extract the weld feature point set from the workpiece model. This serves as the input reference for attitude planning. For the four weld seams at the bottom of the rectangular workpiece, to significantly reduce the scanning path length and data acquisition volume, an efficient scanning strategy is adopted: only a certain length of local segment (approximately 5cm in this embodiment) is scanned in the midpoint region of each weld seam, and the weld seam contour point cloud of this segment is acquired. Subsequently, the positions of the four corner points are obtained through line fitting and intersection point calculation, such as... Figure 3 As shown.

[0043] Centered on the weld seam, constraints such as optical plane perpendicularity, working distance, and field of view are introduced to generate candidate scanning poses. Simultaneously, a dual-interval solution is achieved through model simplification and field-of-view geometric constraints: the welding torch actuator is simplified into a combined model of a rectangular envelope and a cylinder, which is rotated and swept along the weld seam axis while detecting spatial interference to solve for the collision-free pose region; based on the camera's quadrangular frustum geometric model, the physical field-of-view rectangular surface of the sensor at the working distance d is calculated, and the left and right limit boundaries of the interference-free field of view region are determined by solving the spatial positional relationship between the frustum and interference features. The intersection of the collision-free pose region and the interference-free field of view region yields the final welding torch yaw angle. The welding torch coordinate system is transformed to the robot base coordinate system using a rotation matrix to obtain the scanning pose at each weld path point.

[0044] All the scanning poses that meet the constraints are connected in the order of the weld seam direction. A smooth and collision-free scanning path is generated by combining fifth-order polynomial position interpolation with quaternion spherical linear interpolation (Slerp).

[0045] Specifically, it includes the following steps: (1) Construct a three-dimensional model of a robot welding test platform consisting of a robot, a welding torch, a spatial fillet weld workpiece, and a workbench.

[0046] (2) Extract the set of weld feature points from the workpiece model Define the sensor coordinate system and its field-of-view geometry parameters, including the horizontal field of view angle. Vertical field of view Optimal working distance d (distance from the optical center of the camera to the feature point of the weld).

[0047] Furthermore, to ensure the accuracy of the weld contour acquired by the line laser sensor, the following imaging constraints must be met: vertical light plane constraint, the sensor's light plane should be perpendicular to the weld direction to ensure that the laser line can completely cover the weld cross section; working distance constraint, the weld point should be located at the sensor's optimal working distance, i.e., the distance from the sensor's optical center to the target point: d (specifically determined according to the working conditions); field of view constraint, the weld point should be located within the sensor's field of view, i.e., the target point is within the field of view.

[0048] Based on the above three imaging constraints, the spatial orientation of the welding torch can be uniquely determined; only its yaw angle needs to be specified. .

[0049] (3) Construct a simplified envelope model of the welding torch assembly. Under the dual constraints of the vertical constraint of the light plane and the working distance (d) constraint, control the welding torch to rotate and sweep along the weld axis. Through the discrete collision detection method, select the whole-domain interference-free attitude space interval that meets the sensor imaging accuracy requirements. ,like Figure 4 .

[0050] Furthermore, to ensure the accuracy of the weld contour acquired by the line laser sensor, the sensor's optical plane should be perpendicular to the weld direction, and the weld point should be located at the sensor's optimal working distance.

[0051] Based on the dual constraints of the perpendicularity of the light plane and the focal length, the welding torch is rotated and swept around the straight line of the weld seam to solve for two critical scanning postures that do not collide with the workpiece, thereby obtaining the collision-free posture region.

[0052] To reduce the geometric complexity of collision detection and improve computational efficiency, the welding torch actuator is geometrically simplified: a rectangular envelope is used to approximate the main body of the welding torch, the sensor is simplified to a regular rectangular block, and the neck and connecting structure of the welding torch are simplified to cylinders. This combined envelope model significantly reduces computational overhead while ensuring the conservatism and safety of collision detection.

[0053] The simplified welding torch model is placed in the scanning scene inside the workpiece and rotated along the weld axis. The spatial interference between the envelope and the workpiece, fixture and other environment is detected one by one under each posture. In this way, the welding torch posture region that meets the collision-free condition is solved, providing an reachable posture space for subsequent path planning.

[0054] Specifically, by simplifying the entire welding torch (including the pre-sensor) into a combination of a rectangular block and a cylinder, the collision-free region during its scanning inside the workpiece is determined. Then, a mathematical model is constructed to solve for the two extreme collision points between the workpiece and the welding torch. The specific solution process is as follows:

[0055]

[0056] so

[0057]

[0058] in, For the workpiece width, For the workpiece height, Where is the radius of the welding torch. As a safety threshold, It is an auxiliary angle.

[0059] (4) Construct a four-sided cone model of the camera and gradually adjust the field of view along the horizontal direction. Use the weld features as a reference to eliminate interference features and solve the critical field of view position that only contains the target weld.

[0060] Based on the sensor imaging principle, a quadrangular cone geometric model of the camera is constructed, with the lens optical center as the vertex and the rectangular surface of the physical field of view as the base. Figure 5 As shown, the frustum is composed of four edges connecting the optical center to the four corner points of the field of view rectangle, accurately describing the effective imaging range of the sensor in space.

[0061] The workpiece model to be welded is placed within the viewing cone for intersection calculations to extract the local geometric region of the workpiece falling within the viewing cone. Using the weld feature points as a reference, the field of view is gradually adjusted along the left boundary of the viewing cone in the horizontal direction. By iteratively calculating the spatial relationship between the viewing cone and interfering features, the critical position where the viewing cone contains only the target weld feature and no non-weld interference features is determined, thus defining the limit boundary of the interference-free field of view. ,like Figure 6 .

[0062] Calculate the FOV rectangular plane dimensions of the camera at the working distance d:

[0063]

[0064] in, Width of the field of view plane The height of the field of view plane. For horizontal field of view, For vertical field of view, It is the straight-line distance from the optical center of the sensor (lens optical center) to the target point (usually the root point of the weld).

[0065] The camera's quadrangular field of view is obtained based on the rectangular FOV plane and the lens optical center. The scan-free field of view region is then solved based on the field of view and the model of the workpiece to be welded.

[0066] First, solve for the left limit of the undisturbed field of view: like Then the formula for calculating the left-limit deflection angle is:

[0067]

[0068] like If no interfering features enter the camera's field of view from the left side, then the left limit deflection angle is set to 0, meaning that the camera's optical axis coincides with the left arm surface of the workpiece.

[0069] Calculate the right limit of the undisturbed field of view: Calculate whether the field of view will interfere with the workpiece being welded: like Then the formula for calculating the right limit deflection angle is:

[0070]

[0071] like Therefore, no interfering features will ever enter the camera's field of view from the right side. For ease of calculation, the left limiting yaw angle is taken as... .

[0072] (5) Based on the obtained welding torch non-collision posture range during scanning [ The obtained field of view without camera interference during scanning [ Taking the intersection, we obtain the attitude range where the welding torch will neither collide nor have other edge features enter the camera's field of view. The midpoint of this range is taken as the final yaw angle of the welding torch. .

[0073] (6) Transform the welding torch posture into coordinates in the robot's base coordinate system using a rotation matrix, and establish a reference coordinate system at the weld path point pi, such as... Figure 7 Once the reference coordinate system and the robot base coordinate system are determined, the rotation matrix can be solved, and the collision-free spatial attitude of the welding torch at the weld path point pi can be determined based on the rotation matrix. The specific steps for determining the welding torch coordinate system are as follows: ① Determination of the z-axis The unit vector of the z-axis of the welding torch coordinate system is collinear with the center of the optical axis of the sensor camera, pointing from the selected weld feature point to the center of the optical axis, as detailed below:

[0074] ② Determining the y-axis The unit vector of the y-axis in the welding torch coordinate system is its forward vector. The result of normalizing the cross product with the z-axis unit vector, i.e.

[0075] ③ Determining the x-axis The unit vector of the x-axis in the welding torch coordinate system can be determined by the right-hand rule, i.e.

[0076] After obtaining the unit vectors of each axis of the welding torch coordinate system at point pi, they can be projected onto the robot's base coordinate system. The rotation matrix R of the welding torch coordinate system at point pi relative to the robot base coordinate system can be obtained as follows:

[0077]

[0078] The scanning posture of the robot welding torch under the base coordinate system can be obtained by using the rotation matrix.

[0079] For scanning the four-way weld seam at the bottom of the mesh workpiece, the normalized time change rate of the fifth-order polynomial position interpolation is directly coupled as the sole driving parameter of the attitude quaternion spherical linear interpolation. Through parameter synchronization constraints, strong coupling and smooth coordination between displacement and attitude at the mathematical level are achieved.

[0080] In the above steps, the welding torch scanning pose (including position coordinates and attitude rotation matrix) at each weld path point has been obtained, satisfying collision-free constraints and interference-free field of view. To avoid joint impact and trajectory deviation caused by abrupt attitude changes, a fifth-order polynomial position interpolation method is used to prevent rigid and flexible impacts during robot movement; simultaneously, a quaternion spherical linear interpolation (Slerp) method is combined to prevent abrupt attitude changes during attitude adjustment of the welding torch. A trajectory smoothing method combining these two methods achieves a continuous and smooth transition between the four scanning attitude points. The specific scanning process is as follows: Figure 8 The specific implementation steps are as follows: Based on the motion time period of position interpolation, establish a globally normalized time parameter:

[0081] Where: t is the actual motion time; T is the total motion time of position interpolation between adjacent pose points; τ is the coupling synchronization normalization time (0 corresponds to the interpolation start point, 1 corresponds to the interpolation end point). By using a unique normalized time axis, position interpolation and attitude interpolation are forced to start, transition, and terminate synchronously, thus eliminating the smoothing failure problem caused by attitude lag / lead from the time dimension.

[0082] The coupling interpolation parameter synchronization constraint directly uses the normalized time rate of change of the fifth-order polynomial position interpolation as the sole time-driving parameter for attitude quaternion spherical linear interpolation (SLERP), achieving strong coupling at the mathematical level. Position interpolation time-driven term (determined by a fifth-degree polynomial):

[0083] The boundary constraints of its motion trajectory are shown in Table 1:

[0084] Table 1 Boundary Constraints for the Fifth-Order Polynomial Motion Trajectory In the formula, Γ(τ) is the normalized positional motion progress, which satisfies Γ(0)=0, Γ(1)=1, and the velocity and acceleration are continuous.

[0085] Convert the attitude rotation matrix R into a unit quaternion for attitude interpolation:

[0086] Q(τ) is the smooth attitude quaternion after coupling constraints; Let θ be the starting and ending attitude quaternions; θ be the shortest spherical angular distance between the two attitude quaternions; and Γ(τ) be the synchronization time progress from position smoothing.

[0087] Taking the Fao FR5 robot as an example, a kinematic model of the robot is established using the Denavit-Hartenberg method. MATLAB is then used to visualize and simulate the mathematical model, and to plan its trajectory, obtaining its end-effector trajectory curve. The simulation results can be used to verify whether the robot's trajectory is smooth when planned using this method. Figure 9 .

[0088] In summary, this invention provides a scanning posture planning method and system for visual inspection of weld seams in narrow spaces using robots. It can achieve autonomous planning of visual scanning posture of weld seams in narrow spaces without teaching, while taking into account both collision-free and interference-free field of view, thereby improving planning efficiency and inspection accuracy.

[0089] It should be noted that, depending on the implementation needs, the various steps / components described in this application can be broken down into more steps / components, or two or more steps / components or parts of the operation of steps / components can be combined into new steps / components to achieve the purpose of this invention.

[0090] The order of the steps in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.

[0091] It should be understood that those skilled in the art can make improvements or modifications based on the above description, and all such improvements and modifications should fall within the protection scope of the appended claims.

Claims

1. A scanning posture planning method for robot visual inspection of weld seams in narrow spaces, characterized in that, include: A simulated 3D model is constructed, which includes a robot, an end effector, and a workpiece to be welded. The end effector is equipped with a vision sensor. Extract the weld feature point set from the model of the workpiece to be welded, fit the weld axis based on the weld feature point set, and define the visual sensor coordinate system and field parameters. Based on the preset imaging constraints, the end effector is rotated and swept along the weld axis. Collision detection is performed by a simplified envelope model to solve the first attitude interval. Based on the field of view parameters, a visual sensor field of view geometric model is constructed. The field of view range is adjusted with weld feature points as a reference to solve the second attitude interval that contains only the target weld feature within the field of view. The intersection of the first attitude interval and the second attitude interval is taken, and the target attitude is selected from it; based on the target attitude, the coordinate system of the end effector at the weld path point is established, and the scanning pose corresponding to each weld path point is obtained through coordinate transformation; By employing a method that combines position interpolation with pose interpolation, all scan poses are smoothed to generate a continuous, collision-free scan path.

2. The scanning posture planning method for robot visual inspection of weld seams in narrow spaces according to claim 1, characterized in that, The preset imaging constraints include optical plane vertical constraints, working distance constraints, and field of view constraints.

3. The scanning posture planning method for robot visual inspection of weld seams in narrow spaces according to claim 1, characterized in that, The visual sensor's field-of-view geometry model is a quadrangular cone model. The quadrangular cone has the lens optical center as its vertex and the physical field-of-view rectangular surface as its base. By iteratively adjusting the horizontal field-of-view range of the cone, a second attitude interval is solved so that the cone contains only the target weld features and no other interfering features.

4. The scanning posture planning method for robot visual inspection of weld seams in narrow spaces according to claim 1, characterized in that, Taking the intersection of the first attitude interval and the second attitude interval, and selecting the target attitude from it, specifically includes: selecting the median value of the intersection of the first attitude interval and the second attitude interval as the target attitude.

5. The scanning posture planning method for robot visual inspection of weld seams in narrow spaces according to claim 1, characterized in that, The step of obtaining the scanning pose corresponding to each weld path point through coordinate transformation specifically includes: determining the unit vector of each axis of the end effector coordinate system based on the target pose, projecting the unit vector to the robot base coordinate system to obtain a rotation matrix, and transforming the end effector pose to the robot base coordinate system based on the rotation matrix to obtain the scanning pose.

6. The scanning posture planning method for robot visual inspection of weld seams in narrow spaces according to claim 1, characterized in that, The position interpolation uses fifth-order polynomial interpolation, and the attitude interpolation uses quaternion spherical linear interpolation.

7. The scanning posture planning method for robot visual inspection of weld seams in narrow spaces according to claim 6, characterized in that, The normalized time rate of change of the fifth-order polynomial interpolation is used as the sole driving parameter for the quaternion spherical linear interpolation.

8. The scanning posture planning method for robot visual inspection of weld seams in narrow spaces according to claim 1, characterized in that, For multiple spatial welds on a workpiece to be welded, only a set of feature points of a local segment with a preset length in the midpoint region of each weld is extracted for scanning planning; by collecting the weld contour point cloud of the local segment, the complete weld trajectory is obtained through straight line fitting and intersection calculation.

9. The scanning posture planning method for robot visual inspection of weld seams in narrow spaces according to claim 1, characterized in that, The field of view parameters include the horizontal field of view angle, the vertical field of view angle, and the optimal working distance, wherein the optimal working distance is the straight-line distance from the optical center of the lens to the weld feature point.

10. A scanning posture planning system for visual inspection of weld seams in narrow spaces by robots, characterized in that, include: The simulation environment construction module is used to build a simulation 3D model containing a robot, an end effector, and a workpiece to be welded, wherein the end effector is equipped with a vision sensor; The feature extraction and definition module is used to extract the weld feature point set from the model of the workpiece to be welded, fit the weld axis based on the weld feature point set, and define the visual sensor coordinate system and field parameters. The collision-free attitude solving module is used to control the end effector to rotate and sweep along the weld axis based on preset imaging constraints, and to perform collision detection through a simplified envelope model to solve the first attitude interval. The interference-free field of view solving module is used to construct a visual sensor field of view geometric model based on the field of view parameters, adjust the field of view range with weld feature points as a reference, and solve for the second attitude interval that makes the field of view contain only the target weld feature. The attitude determination module is used to find the intersection of the first attitude interval and the second attitude interval, and select the target attitude from it. The pose conversion module is used to establish the end effector coordinate system at the weld path point based on the target pose, and obtain the scanning pose corresponding to each weld path point through coordinate conversion; The path generation module is used to smooth all scan poses by combining position interpolation with attitude interpolation, generating a continuous, collision-free scan path.