Robotic assembly method and system for toilet seat bolt fastening

CN122807879APending Publication Date: 2026-09-25CHAOZHOU JINQITAI TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

[0005]本发明提供了用于马桶座圈螺栓紧固的机械手装配方法及系统,用于本发明解决马桶座圈装配时因放置偏差导致双螺栓难以精准对准、无法同步紧固至一致扭矩的问题

Benefits of technology

[0018]本发明的技术方案首先通过机械手放置座圈后触发视觉相机俯视拍照,经高斯滤波、灰度化、自适应阈值二值化、Canny边缘检测和最小二乘圆拟合,提取左右螺孔中心坐标,实现了螺孔位置的自动精确获取,消除放置偏差和基体公差带来的不确定性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122807879A_ABST
    Figure CN122807879A_ABST
Patent Text Reader

Abstract

The application provides a mechanical hand assembly method and system for toilet seat bolt fastening, and belongs to the field of intelligent manufacturing equipment, and comprises the following steps: after placing the toilet seat on the ceramic base body through the mechanical hand, triggering the visual camera to collect the overhead image of the toilet seat, obtaining the original seat image containing the left screw hole and the right screw hole, and extracting the left screw hole center coordinate and the right screw hole center coordinate; performing rigid body pose solving to determine the translation compensation and the rotation compensation; driving the mechanical hand to perform the composite compensation movement of translation and rotation, so that the left sleeve and the right sleeve of the double-shaft electric tightening gun are respectively aligned with the left screw hole and the right screw hole; driving the double-shaft electric tightening gun to simultaneously perform the bolt screwing and torque fastening on the left screw hole and the right screw hole, and stopping until the left bolt and the right bolt both reach the preset target torque. The application solves the problems that the double bolts are difficult to accurately align and cannot be synchronously fastened to the consistent torque due to the placement deviation during the assembly of the toilet seat.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of intelligent manufacturing equipment, specifically to a robotic assembly method and system for tightening toilet seat bolts. Background Technology

[0002] As a key component of both smart and regular toilets, the secure and consistent installation of the toilet seat directly affects the product's sealing performance and user experience. Currently, on bathroom product production lines, toilet seats are typically fixed to mounting holes in the ceramic substrate using two bolts.

[0003] In existing technologies, the assembly process mainly relies on manual labor or semi-automatic equipment. The manual method involves the operator manually aligning the bolt holes of the seat ring with the pre-embedded nuts in the base material, and then using power tools to tighten the bolts sequentially or simultaneously. This method is not only labor-intensive, but the tightening quality is also affected by the worker's skill level, often resulting in inconsistent torque, stripped bolts, or seat ring misalignment. Some semi-automatic equipment uses a preset fixed trajectory for alignment, but due to dimensional tolerances in the sintering of the ceramic substrate and random positional deviations in the seat ring during placement, the fixed motion trajectory cannot adaptively compensate for each assembly deviation, leading to misalignment between the bolt holes and the tightening tool sleeve, causing hard contact damage or assembly failure.

[0004] In summary, how to eliminate random positional deviations when placing toilet seats and ensure precise alignment and torque consistency of the double bolts is a problem that urgently needs to be solved in this field. Summary of the Invention

[0005] This invention provides a robotic assembly method and system for tightening toilet seat bolts, which solves the problem that during toilet seat assembly, placement deviations make it difficult to accurately align the two bolts and tighten them to a consistent torque.

[0006] In view of the above problems, the present invention provides a robotic assembly method and system for tightening toilet seat bolts.

[0007] In a first aspect, the present invention provides a robotic assembly method for tightening toilet seat bolts, comprising:

[0008] After the toilet seat is placed on the ceramic substrate by the robotic arm, the vision camera is triggered to capture a top view image of the toilet seat, obtain the original seat image containing the left and right screw holes, and extract the center coordinates of the left and right screw holes from the original seat image.

[0009] Based on the coordinates of the center of the left screw hole and the center of the right screw hole, the rigid body pose is calculated to determine the translational compensation and rotational compensation of the toilet seat.

[0010] The translational compensation and rotational compensation are output to the robot controller to drive the robot to perform a composite compensation motion of translation and rotation, so that the left sleeve and right sleeve of the dual-axis electric tightening gun are aligned with the left screw hole and the right screw hole, respectively.

[0011] After the left sleeve and the right sleeve are aligned with the left screw hole and the right screw hole respectively, the dual-axis electric tightening gun is driven to simultaneously screw in the bolts and tighten the torque on the left and right screw holes until both the left and right bolts reach the preset target torque, thus completing the bolt fastening assembly of the toilet seat.

[0012] Secondly, the present invention provides a robotic assembly system for tightening toilet seat bolts, comprising:

[0013] The visual acquisition and feature extraction module is used to trigger a visual camera to acquire a top-view image of the toilet seat after the toilet seat is placed on the ceramic substrate by a robotic arm, obtain the original seat image containing the left screw hole and the right screw hole, and extract the center coordinates of the left screw hole and the center coordinates of the right screw hole in the original seat image.

[0014] The pose calculation and compensation generation module is used to perform rigid body pose calculation based on the center coordinates of the left screw hole and the center coordinates of the right screw hole, and to determine the translation compensation and rotation compensation of the toilet seat.

[0015] The composite compensation alignment module is used to output the translational compensation amount and rotational compensation amount to the robot controller, drive the robot to perform a composite compensation motion of translation and rotation, so that the left sleeve and right sleeve of the dual-axis electric tightening gun are aligned with the left screw hole and the right screw hole respectively.

[0016] The dual-axis synchronous fastening module is used to drive the dual-axis electric tightening gun to simultaneously screw in and tighten the bolts in the left and right screw holes after the left and right sleeves are aligned with the left and right screw holes respectively, until both the left and right bolts reach the preset target torque and then stop, thus completing the bolt fastening assembly of the toilet seat ring.

[0017] One or more technical solutions provided in this invention have at least the following technical effects or advantages:

[0018] The technical solution of this invention first triggers a vision camera to take a picture from above after the robot arm places the seat ring. After Gaussian filtering, grayscale conversion, adaptive threshold binarization, Canny edge detection and least squares circle fitting, the center coordinates of the left and right screw holes are extracted, realizing the automatic and accurate acquisition of the screw hole position and eliminating the uncertainty caused by placement deviation and substrate tolerance.

[0019] Furthermore, anomalies are first identified by spacing verification, then the translation compensation is obtained by comparing the midpoint of the screw hole connection with the standard midpoint, and the rotation compensation is obtained by comparing the direction angle of the connection with the standard direction angle. Finally, noise is suppressed by removing abnormal samples through sliding window Mahalanobis distance and time-attenuated weighted mean filtering, and the visual position is transformed into stable pose compensation parameters.

[0020] Furthermore, rotational compensation is performed with the midpoint of the line connecting the screw holes as the center, and translational compensation is performed along the horizontal and vertical directions, so that the left and right sleeves of the tightening gun are aligned with the left and right screw holes respectively, eliminating planar position and angular deviations, and providing a misaligned alignment basis for synchronous tightening.

[0021] Finally, the dual-axis electric tightening gun simultaneously screws in the left and right bolts while monitoring the torque in real time. It stops once both sides reach the preset target torque, completing the tightening assembly. This ensures consistent torque on both bolts, avoiding misalignment and uneven torque.

[0022] In summary, the technical solution of this invention combines visual guidance positioning, rigid body posture compensation, and dual-axis synchronous tightening to achieve fully automated assembly of the toilet seat from placement to bolt tightening. This effectively solves the problem that placement deviations during toilet seat assembly can lead to inaccurate alignment of the two bolts and the inability to tighten them to a consistent torque. Attached Figure Description

[0023] Figure 1 This is a flowchart illustrating the robotic assembly method for tightening toilet seat bolts provided by the present invention.

[0024] Figure 2 This is a logical diagram illustrating the rigid body pose calculation in the robotic arm assembly method for tightening toilet seat bolts provided by the present invention.

[0025] Figure 3 This is a schematic diagram of the robotic arm assembly system for tightening toilet seat bolts provided by the present invention.

[0026] In the attached diagram, the labels representing each component are as follows:

[0027] Visual acquisition and feature extraction module 11, pose calculation and compensation amount generation module 12, composite compensation alignment module 13, and dual-axis synchronous fastening module 14. Detailed Implementation

[0028] This invention provides a robotic assembly method and system for tightening toilet seat bolts, which solves the problem that during toilet seat assembly, placement deviations make it difficult to accurately align the two bolts and tighten them to a consistent torque.

[0029] It should be noted that the terms "comprising" and "having" are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or server that includes a series of steps or units is not necessarily limited to those steps or units that are explicitly listed, but may include other steps or modules that are not explicitly listed or that are inherent to these processes, methods, products, or devices.

[0030] Example 1, as Figure 1 As shown, the present invention provides a robotic assembly method for tightening toilet seat bolts, the method comprising:

[0031] S100: After the toilet seat is placed on the ceramic substrate by the robotic arm, the vision camera is triggered to acquire a top-view image of the toilet seat, obtain the original seat image containing the left screw hole and the right screw hole, and extract the center coordinates of the left screw hole and the center coordinates of the right screw hole from the original seat image.

[0032] In this step, after the robotic arm places the toilet seat on the ceramic substrate, it triggers a vision camera to acquire a top-down image. From the acquired original seat image, it identifies and extracts the center coordinates of the left and right screw holes, providing reference data for subsequent rigid body pose calculation.

[0033] In this step, the toilet seat is first placed on the ceramic substrate using a robotic arm. Then, a vision camera is triggered to capture a top-down image of the toilet seat, obtaining the original seat image including the left and right screw holes. The acquired original seat image is preprocessed using a Gaussian filter to remove random noise from the image. Finally, the filtered image is converted to grayscale to obtain a grayscale seat image.

[0034] The vision camera is an industrial camera that has undergone intrinsic parameter calibration and hand-eye calibration. It is usually fixedly installed above the assembly station, with its optical axis perpendicular to the mounting plane of the ceramic substrate. The vision camera is used to trigger a top-down image after the robot arm places the seat ring. Its intrinsic parameter matrix is ​​known and the distortion coefficients have been corrected. Each pixel in the acquired image can be mapped to the actual physical coordinates in the robot arm's base coordinate system through calibration parameters, thus providing a spatial reference for subsequent screw hole center positioning and rigid body pose calculation.

[0035] For example, suppose that during an assembly process on a production line, a vision camera captures a raw image of the seat ring with a resolution of 2048×1536 pixels. The image contains fine noise caused by dust and uneven lighting in the workshop. A 3×3 Gaussian convolution kernel is used to smooth the image, effectively suppressing the noise. The filtered color image is then converted into a single-channel grayscale image for easier subsequent segmentation processing.

[0036] In this step, the center coordinates of the left and right screw holes in the original screw ring image are extracted, including:

[0037] The original seat ring image is preprocessed using a Gaussian filtering method to remove random noise from the original seat ring image, and the filtered image is then converted to grayscale to obtain a grayscale seat ring image.

[0038] The grayscale seat image is binarized using an adaptive threshold segmentation method. Pixels with grayscale values ​​lower than the adaptive threshold are marked as screw hole region pixels, and pixels with grayscale values ​​not lower than the adaptive threshold are marked as background region pixels, thus obtaining a binarized seat image.

[0039] The Canny edge detection algorithm is used to extract the edges of the screw hole region pixels in the binarized screw ring image to obtain the set of left screw hole edge pixels and the set of right screw hole edge pixels;

[0040] The least squares circle fitting method is used to fit the set of edge pixels of the left screw hole and the set of edge pixels of the right screw hole to a circle. The center coordinates of the fitted circle of the left screw hole are used as the center coordinates of the left screw hole, and the center coordinates of the fitted circle of the right screw hole are used as the center coordinates of the right screw hole.

[0041] Specifically, the grayscale seat ring image is first binarized using an adaptive thresholding method. Since the ceramic substrate surface is a white reflective material and the inside of the screw hole is a dark shadow area, the adaptive thresholding algorithm dynamically calculates the segmentation threshold based on the grayscale distribution of the local neighborhood of the image. Pixels with grayscale values ​​lower than the adaptive threshold are marked as screw hole region pixels, and pixels with grayscale values ​​not lower than the adaptive threshold are marked as background region pixels, thus obtaining the binarized seat ring image.

[0042] The adaptive thresholding algorithm dynamically calculates the segmentation threshold based on the grayscale distribution of the local neighborhood of the image as follows: Iterate through each pixel of the grayscale image, take a neighborhood window of a preset size centered on the pixel, calculate the average grayscale value within the window, and subtract a preset constant offset from the average grayscale value as the segmentation threshold for that pixel; if the grayscale value of the pixel is lower than the segmentation threshold, it is marked as a pixel in the screw hole region, otherwise it is marked as a pixel in the background region, thereby achieving accurate separation of screw holes from the background under conditions of uneven illumination or background grayscale differences.

[0043] Preferably, the preset constant offset is a constant value pre-set in the adaptive threshold segmentation method. It is used to subtract from the mean gray value of the neighborhood when calculating the segmentation threshold, so as to adjust the sensitivity of the threshold relative to the local background. The preset constant offset is determined through offline testing during the vision system debugging phase. During testing, images are acquired by placing a standard toilet seat sample on a ceramic substrate, and the segmentation process is run under different offsets. The optimal offset is determined by ensuring that the screw hole edge is intact without breakage or excessive expansion. Once determined, it is fixed in the vision processing program and is not changed in real time.

[0044] For example, offline testing showed that the screw hole contour was extracted most completely when the offset was set to 10, so the preset constant offset was fixed at 10. If the offset is set to 5, the segmentation threshold becomes 108-5=103, which is too high and may cause some darker screw hole edge pixels to be misjudged as background, resulting in screw hole contour shrinkage. If the offset is set to 20, the segmentation threshold becomes 108-20=88, which is too low and may misjudge some background pixels that are dark due to oil stains or shadows as screw holes, resulting in screw hole contour expansion.

[0045] For example, a pixel on the edge of the left screw hole region is located at the boundary between the screw hole and the background. Its neighborhood window contains both dark pixels of the screw hole region (grayscale value approximately 45) and bright pixels of the background region (grayscale value approximately 210). The average grayscale value of the pixels within the window is calculated to be 108. With a preset constant offset of 10, the segmentation threshold for this pixel is 108 - 10 = 98. The current pixel's grayscale value is 43. Since 43 < 98, it is marked as part of the screw hole region, and its binarization value is assigned to 1, representing the screw hole region. If the neighborhood window falls entirely within the bright background, the average grayscale value is approximately 210, and the segmentation threshold is 200. The grayscale value of background pixels in this region is 210 > 200, so it is marked as part of the background region, and its binarization value is assigned to 0, representing the background region. Finally, a binarized ring image is generated with a screw hole region pixel value of 1 and a background region pixel value of 0, thus achieving adaptive and accurate segmentation at the screw hole edge.

[0046] Next, the Canny edge detection algorithm is used to extract the edges of the screw hole region pixels in the binarized screw ring image. By calculating the image gradient magnitude and direction, and after non-maximum suppression and double threshold filtering, the set of left screw hole edge pixels and the set of right screw hole edge pixels are obtained.

[0047] For example, in the above binarized image, the left screw hole corresponds to a black circular area. The Canny algorithm extracts a continuous chain of edge pixels along the boundary between this area and the white background, obtaining a total of 382 edge pixels to form the edge pixel set of the left screw hole; similarly, 374 edge pixels are extracted from the right screw hole area to form the edge pixel set of the right screw hole.

[0048] Finally, the least squares circle fitting method is used to fit the set of edge pixels of the left screw hole and the set of edge pixels of the right screw hole to a circle. By minimizing the sum of the squares of the distances from the edge points to the fitted circle, the center coordinates and radius of the fitted circle of the left screw hole are solved to obtain the center coordinates of the left screw hole; the center coordinates of the right screw hole are obtained in the same way.

[0049] For example, by performing least-squares circle fitting on the 382 edge pixels of the left screw hole, the center pixel coordinates of the fitted circle are obtained as (850, 642), which correspond to actual physical coordinates (42.5mm, 32.1mm) after camera calibration transformation. Similarly, by fitting the 374 edge pixels of the right screw hole, the center coordinates are obtained as (1450, 638), which are transformed to physical coordinates of (72.5mm, 31.9mm). These two coordinate values ​​are the input data for subsequent rigid body pose calculation.

[0050] It should be noted that the above values ​​are for illustrative purposes only and do not constitute a limitation on the present invention.

[0051] In summary, this step involves using a robotic arm to place the seat ring and triggering a vision camera to capture a top-down view image. The center coordinates of the left and right screw holes are extracted from the original seat ring image, enabling the automatic and accurate acquisition of the actual spatial positions of the two screw holes after the seat ring is placed. This eliminates the positional uncertainty caused by random deviations in seat ring placement and dimensional tolerances of the ceramic substrate, providing accurate and reliable reference data for subsequent rigid body pose calculations.

[0052] S200: Based on the center coordinates of the left and right screw holes, perform rigid body pose calculation to determine the translational and rotational compensation amounts of the toilet seat.

[0053] like Figure 2 As shown, after obtaining the center coordinates of the left and right screw holes, this step uses the line connecting the two coordinate points and their geometric center as the calculation basis, compares it with the preset standard reference position, and calculates the translational compensation and rotational compensation of the toilet seat relative to the standard position through rigid body pose calculation.

[0054] In this step, after extracting the center coordinates of the left and right screw holes and before performing rigid body pose calculation, a spacing verification step is also included:

[0055] Calculate the measured distance between the center coordinates of the left screw hole and the center coordinates of the right screw hole, compare the measured distance with the standard wheelbase corresponding to the pre-stored toilet seat model, and calculate the absolute difference between the measured distance and the standard wheelbase.

[0056] If the absolute difference exceeds the preset error threshold, the image recognition is determined to be abnormal, triggering the vision camera to re-acquire the top view image of the toilet seat and re-extract the center coordinates of the left screw hole and the center coordinates of the right screw hole.

[0057] If the absolute difference does not exceed the preset error threshold, the image recognition result is determined to pass the verification, and the process proceeds to the rigid body pose calculation step.

[0058] Specifically, after extracting the center coordinates of the left and right screw holes and before performing rigid body pose calculation, the measured distance between the two screw holes is calculated based on their pixel coordinates. Let the center coordinates of the left screw hole be (x1, y1) and the center coordinates of the right screw hole be (x2, y2), then the measured distance = .

[0059] For example, if the center coordinates of the left screw hole are extracted as (42.5mm, 32.1mm) and the center coordinates of the right screw hole are (72.5mm, 31.9mm), and the difference between them in the X direction is 30.0mm and the difference in the Y direction is -0.2mm, then the measured spacing = =30.001mm.

[0060] Next, the measured distance is compared with the pre-stored standard wheelbase corresponding to the toilet seat model, and the absolute difference between the two is calculated. The pre-stored standard wheelbase corresponding to the toilet seat model refers to the design center distance between the left and right screw holes determined in the CAD drawing or first piece calibration of that toilet seat model, and is pre-entered into the vision processing system.

[0061] For example, the standard wheelbase of the current toilet seat model is 30.0mm. Comparing the measured distance of 30.001mm with the standard wheelbase of 30.0mm, the absolute difference is |30.001-30.0|=0.001mm.

[0062] Finally, the absolute difference is compared with a preset error threshold to make a verification judgment. If the absolute difference exceeds the preset error threshold, the image recognition is determined to be abnormal, triggering the vision camera to re-acquire a top-down image of the toilet seat and re-extract the center coordinates of the left and right screw holes; if the absolute difference does not exceed the preset error threshold, the image recognition result is determined to pass the verification, and the rigid body pose calculation step is entered.

[0063] The preset error threshold is determined through offline calibration during the system debugging phase: multiple sets of known qualified toilet seat samples are used to repeatedly acquire images and extract the center of the screw hole, and the maximum value of the deviation between the measured distance and the standard wheelbase is counted. 1.2 to 1.5 times the maximum value is taken as the preset error threshold, which is then fixed into the program and directly called during verification.

[0064] For example, the diameter of the screw hole in this model of toilet seat is 8.0mm, the bolt diameter is 6.0mm, and the maximum allowable offset on one side is 1.0mm. Offline testing showed that the maximum spacing deviation of qualified samples was 0.3mm. Taking a 1.5 times margin, the preset error threshold was set to 0.45mm.

[0065] For example, the preset error threshold is set to 0.45mm. If the absolute difference of 0.001mm < 0.45mm, which does not exceed the preset error threshold, the image recognition result is determined to pass the verification, and the process proceeds to the rigid body pose calculation step.

[0066] In another possible embodiment, if the extraction deviation of the right screw hole edge is caused by a sudden change in illumination, and the center coordinates of the right screw hole are mistakenly extracted as (73.8mm, 31.9mm), then the measured distance = 31.3mm, and the absolute difference = |31.3-30.0| = 1.3mm > 0.45mm, which exceeds the preset error threshold. Therefore, the image recognition is determined to be abnormal, the vision system discards the result, triggers the vision camera to re-acquire the top view image, and performs the extraction of the center coordinates of the left and right screw holes again.

[0067] In this step, rigid body pose calculation is performed based on the center coordinates of the left and right screw holes to determine the translational and rotational compensation amounts of the toilet seat, including:

[0068] Calculate the midpoint coordinates of the line connecting the center coordinates of the left screw hole and the center coordinates of the right screw hole. Calculate the difference between the midpoint coordinates and the pre-stored standard midpoint coordinates of the line connecting the left and right sleeves of the dual-axis electric tightening gun to obtain the horizontal and vertical deviations. Use the horizontal and vertical deviations as the translation compensation amount of the toilet seat.

[0069] Calculate the direction angle of the line connecting the center coordinates of the left screw hole and the center coordinates of the right screw hole. Calculate the difference between the direction angle and the standard direction angle of the line connecting the left and right sleeves of the pre-stored dual-axis electric tightening gun to obtain the angle deviation. Use the angle deviation as the rotation compensation amount of the toilet seat.

[0070] Maintain a sliding window with a preset capacity. The sliding window is used to store the historical calculation results of the same model of toilet seat in the most recent several calculations. The historical calculation results include historical translation compensation and historical rotation compensation.

[0071] Calculate the deviation between the translation compensation amount and the average historical translation compensation amount within the sliding window, and the deviation between the rotation compensation amount and the average historical rotation compensation amount within the sliding window, to obtain the translation compensation amount deviation and the rotation compensation amount deviation;

[0072] If either the translation compensation deviation or the rotation compensation deviation exceeds a preset deviation threshold, it is determined that the current calculation result contains noise, and the current calculation result is output in place of the historical average translation compensation and historical average rotation compensation within the sliding window.

[0073] If neither the translation compensation deviation nor the rotation compensation deviation exceeds a preset deviation threshold, then the translation compensation amount and the rotation compensation amount are used as the output result, and the current solution result is included in the sliding window, updating the historical solution results in the sliding window.

[0074] In this step, the midpoint coordinates of the line connecting the center coordinates of the left screw hole and the center coordinates of the right screw hole are first calculated. The difference between the midpoint coordinates and the standard midpoint coordinates of the line connecting the left and right sleeves of the dual-axis electric tightening gun are calculated to obtain the horizontal deviation Δx and the vertical deviation Δy. Δx and Δy are used as the translation compensation amount of the toilet seat.

[0075] The pre-stored standard midpoint coordinates of the line connecting the left and right sleeves of the dual-axis electric tightening gun refer to reference position data that is pre-determined and stored in the controller during the system calibration phase through teaching. Specifically, it is the geometric center coordinate of the line connecting the left and right sleeve axes of the dual-axis electric tightening gun in the robot's base coordinate system, representing the position of the midpoint of the line connecting the two sleeves when the tightening gun is ideally aligned. When the toilet seat is placed on the ceramic substrate without any positional deviation, the midpoint of the line connecting the left and right screw holes should coincide with these standard midpoint coordinates.

[0076] Specifically, the standard midpoint coordinates are determined during the equipment debugging phase in the following way: the standard toilet seat sample is precisely placed on the ceramic substrate at the theoretical installation position. The teaching robot moves the dual-axis electric tightening gun to the position where the left sleeve and the right sleeve are completely aligned with the left screw hole and the right screw hole, respectively. The coordinates of the left sleeve axis and the right sleeve axis are recorded at this time, the midpoint between the two is calculated, and the midpoint coordinates are stored in the controller as the standard midpoint coordinates for subsequent comparison during rigid body pose calculations.

[0077] For example, during the calibration phase, after the teaching robot aligns the tightening gun with the standard sample, the coordinates of the left sleeve axis are (27.0mm, 32.0mm) and the coordinates of the right sleeve axis are (87.0mm, 32.0mm). Then the coordinates of the standard midpoint are ((27.0+87.0) / 2, (32.0+32.0) / 2) = (57.0mm, 32.0mm). These standard midpoint coordinates are then fixed in the controller. When assembling each seat ring, the translation compensation is calculated based on these coordinates.

[0078] For example, let the center coordinates of the left screw hole be (42.5mm, 32.1mm) and the center coordinates of the right screw hole be (72.5mm, 31.9mm), then the midpoint coordinates are (57.5mm, 32.0mm). The pre-stored standard midpoint coordinates are (57.0mm, 32.0mm), so the horizontal deviation Δx = 57.5 - 57.0 = 0.5mm, the vertical deviation Δy = 32.0 - 32.0 = 0.0mm, and the translation compensation is (0.5mm, 0.0mm).

[0079] Next, the direction angle of the line connecting the center coordinates of the left screw hole and the center coordinates of the right screw hole is calculated. The difference between the direction angle and the standard direction angle of the line connecting the left and right sleeves of the pre-stored dual-axis electric tightening gun is calculated to obtain the angle deviation Δθ, and Δθ is used as the rotation compensation amount of the toilet seat.

[0080] Here, the angle of the line connecting the left and right sleeve axes of the dual-axis electric tightening gun is shown in the robot's coordinate system. It represents the orientation of the line connecting the two sleeves when the tightening gun is ideally aligned. When the toilet seat is placed on the ceramic substrate without any rotational deviation, the angle of the line connecting the left and right screw holes should be consistent with this standard angle.

[0081] Specifically, the standard orientation angle is determined synchronously with the standard midpoint coordinates during the equipment debugging phase: the standard toilet seat sample is precisely placed on the ceramic substrate at the theoretical installation position, and the teaching robot moves the dual-axis electric tightening gun to the posture where the left sleeve and the right sleeve are completely aligned with the left screw hole and the right screw hole, respectively. The coordinates of the left sleeve axis and the right sleeve axis are recorded at this time, the orientation angle of the line connecting the two points is calculated, and this orientation angle is stored in the controller as the standard orientation angle for subsequent comparison during rigid body pose calculation.

[0082] For example, the coordinates of the left sleeve axis are (27.0mm, 32.0mm), and the coordinates of the right sleeve axis are (87.0mm, 32.0mm). The line connecting the two points is along the positive X-axis in the robot's base coordinate system. The standard direction angle is arctan[(32.0-32.0) / (87.0-27.0)]=arctan(0 / 60.0)=0°. This standard direction angle is fixed in the controller. When assembling each seat ring, the rotation compensation is calculated based on this angle.

[0083] For example, in the above scenario, the direction angle of the line connecting the center of the left screw hole (42.5mm, 32.1mm) and the center of the right screw hole (72.5mm, 31.9mm) is arctan[(31.9-32.1) / (72.5-42.5)] = arctan(-0.2 / 30.0) ≈ -0.38°. The pre-stored standard direction angle is 0°, so the angle deviation Δθ = -0.38° - 0° = -0.38°, and the rotation compensation is -0.38°.

[0084] Secondly, a preset capacity sliding window is maintained to store the historical calculation results of the same model of toilet seats from the most recent batches. These historical calculation results include historical translational compensation and historical rotational compensation. The sliding window employs a first-in, first-out (FIFO) strategy. The window capacity is set according to the following rules: based on the average continuous production quantity of the same model of toilet seats in a single batch, 1 / 10 to 1 / 5 of that quantity is taken as the window capacity, with a minimum of 3 and a maximum of 20. Once the window capacity is determined, it is permanently stored in the controller parameter table and is not changed in real time during production.

[0085] For example, if a certain model of toilet seat has a single batch production quantity of approximately 200 units, and the window capacity is calculated at 1 / 10 (20 units), this already reaches the upper limit, so the final window capacity is set to 20. If another model has a single batch production quantity of 25 units, and the window capacity is calculated at 1 / 5 (5 units), this is within a reasonable range, so the window capacity is set to 5. If a certain model only has a few units produced sporadically (5 units), and the calculated window capacity is less than 3, then the minimum value of 3 is taken to ensure that the sliding window has basic filtering functionality.

[0086] For example, if the current model has a single batch production quantity of 25 units, then the sliding window capacity is preset to 5 times. The current window stores the historical translation compensation amounts of the same model toilet seat for the most recent 5 times, which are (0.3mm, 0.0mm), (0.4mm, 0.0mm), (0.5mm, 0.0mm), (0.4mm, 0.0mm), and (0.4mm, 0.0mm), respectively. The historical rotation compensation amounts are -0.2°, -0.3°, -0.3°, -0.2°, and -0.3°, respectively.

[0087] Furthermore, the deviations between the current translation compensation amount and the average historical translation compensation amount within the sliding window, as well as the deviations between the current rotation compensation amount and the average historical rotation compensation amount within the sliding window, are calculated to obtain the translation compensation amount deviation and the rotation compensation amount deviation.

[0088] This step, before calculating the time-weighted mean, also includes an outlier removal step:

[0089] Based on all historical solution results within the sliding window, calculate the covariance matrix of historical translation compensation and historical rotation compensation.

[0090] For each historical solution result within the sliding window, the historical translation compensation and historical rotation compensation in the historical solution result are constructed into a two-dimensional feature vector. Using the covariance matrix as the metric, the Mahalanobis distance between the two-dimensional feature vector and the mean vector of all historical solution results within the sliding window is calculated.

[0091] Historical solutions with a Mahalanobis distance exceeding a preset removal threshold are marked as abnormal samples and removed from the sliding window. Based on the remaining historical solutions after removing abnormal samples, the time-series weighted average is recalculated according to the exponential decay weight allocation method.

[0092] Specifically, firstly, based on all historical solutions within the sliding window, the covariance matrix of historical translation compensation and historical rotation compensation is calculated to measure the dispersion and correlation of data distribution between the two dimensions of translation and rotation. Assuming there are n historical records within the window, each record containing a translation compensation Δx and a rotation compensation Δθ, the variances of the translation compensation and rotation compensation, as well as their covariance, are calculated to construct a 2×2 covariance matrix.

[0093] For example, there are 5 historical solutions within the sliding window. The translation compensation amounts, taken in the X direction, are 0.3mm, 0.4mm, 0.5mm, 0.4mm, and 0.4mm respectively, and the rotation compensation amounts are -0.2°, -0.3°, -0.3°, -0.2°, and -0.3° respectively. The mean translation compensation amount is 0.4mm, and the mean rotation compensation amount is -0.26°. The translation variance is ((0.3-0.4)²+(0.4-0.4)²+(0.5-0.4)²+(0.4-0.4)²+(0.4-0.4)²) / 4=0.005, and the rotation variance is ((-0.2+0.26)²+(-0.3 ...6)²+(-0.3+0.26)²+(-0.3+0.26)²+(-0.26)²+(-0.3+0.26)²+(-0.26)²+(-0.3+0.26)²+(-0.26)²+(-0.3+0.26)²+(-0.26)²+(-0.3+0.2 6)²) / 4=0.003, covariance=((0.3-0.4)×(-0.2+0.26)+(0.4-0.4)×(-0.3+0.26)+(0.5-0.4)×(-0.3+0.26)+(0.4-0.4)×(-0.2+0.26)+(0.4-0.4)×(-0.3+0.26)) / 4=-0.001. Covariance matrix=[[0.005, -0.001],[-0.001, 0.003]].

[0094] Secondly, for each historical solution within the sliding window, its historical translation compensation and historical rotation compensation are constructed as a two-dimensional feature vector. Using the aforementioned covariance matrix as a metric, the Mahalanobis distance between this two-dimensional feature vector and the mean vector of all historical solutions within the window is calculated. The Mahalanobis distance is normalized using the inverse of the covariance matrix, eliminating the influence of differences in dimensions and scales between the translation and rotation dimensions, and enabling more accurate identification of outliers in multidimensional space. The mean vector of all historical solutions within the window is a reference center obtained by taking a simple arithmetic mean of all historical records within the window before removing outliers. It is used only to measure the degree of deviation of each record from the overall sample to determine whether it is an anomaly.

[0095] For example, the mean vector of the 5 records within the window is (0.4mm, -0.26°). Taking the first record (0.3mm, -0.2°) as an example, the feature vector is constructed as (0.3, -0.2), and the difference vector is calculated as (0.3-0.4, (-0.2)-(-0.26)=(-0.1, 0.06). The inverse of the covariance matrix is ​​[[1 / 0.005, 1 / 0.003], which, after covariance correction, is approximately [[214.29, 71.43], [71.43, 357.14]]. Therefore, the Mahalanobis distance is approximately 1.604. Similarly, the Mahalanobis distances of the remaining four records are calculated, assuming the results are 0.82, 1.25, 0.76, and 0.91 respectively.

[0096] Next, the Mahalanobis distance of each historical record is compared with the preset removal threshold. Historical solutions with Mahalanobis distances exceeding the preset removal threshold are marked as abnormal samples and removed from the sliding window.

[0097] Since Mahalanobis distance approximates a chi-square distribution when the data follows a multivariate normal distribution, and the degrees of freedom are equal to the dimension of the feature vector, the critical value of a chi-square distribution with 2 degrees of freedom at a selected confidence level is used as the benchmark. The confidence level is typically set to 95% or 99%, corresponding to critical values ​​of approximately 5.99 and 9.21, respectively. If the production line has high requirements for anomaly sensitivity, a critical value corresponding to a 95% confidence level is used; if it is desired to reduce false rejections and retain more historical samples, a critical value corresponding to a 99% confidence level is used.

[0098] For example, during the debugging phase, analysis showed that the translational and rotational compensation amounts of the same model seat ring on the production line under normal assembly conditions approximately follow a bivariate normal distribution. With a 95% confidence level selected, the corresponding chi-square distribution critical value is 5.99, so the preset rejection threshold is approximately set to 6.0. A historical record within the window has a Mahalanobis distance of 3.82, which is less than 6.0, and is therefore considered a normal sample and retained; another record has a Mahalanobis distance of 7.25, which is greater than 6.0, and is therefore considered an abnormal sample and removed from the sliding window.

[0099] Finally, based on the remaining historical calculation results after removing outlier samples, the time-weighted average of the historical translation compensation and historical rotation compensation is recalculated according to the exponential decay weight allocation method, and used as the benchmark for subsequent verification and correction.

[0100] For example, the preset rejection threshold is set to 6.0. The Mahalanobis distances of the above 5 records are 1.604, 0.82, 1.25, 0.76, and 0.91, respectively, none of which exceed 6.0, so no samples need to be rejected. If there is a sixth record (1.3mm, -1.2°) in the window, its Mahalanobis distance is calculated to be 19.19, which exceeds 6.0. Then, this record is marked as an abnormal sample and removed from the sliding window. After rejection, the time-weighted mean of the remaining 5 normal records is recalculated as the benchmark for subsequent verification.

[0101] In this step, the mean of the historical solutions within the sliding window is a time-decayed weighted mean, and the calculation steps of the time-decayed weighted mean include:

[0102] The historical solution results within the sliding window are assigned decay weights in chronological order. Specifically, the decay weight is calculated for each historical solution result using a preset decay coefficient as the base and the time interval between the historical solution result and the current solution time as the exponent. The smaller the time interval, the larger the exponent decay weight, and the larger the time interval, the smaller the exponent decay weight.

[0103] The historical translation compensation and historical rotation compensation within the sliding window are weighted and summed according to the exponential decay weights, and the weighted sum is divided by the sum of all exponential decay weights to obtain the time-series weighted average of the historical translation compensation and the time-series weighted average of the historical rotation compensation. These are used as the average of the historical solutions within the sliding window and are used for the verification and correction of the current solution.

[0104] Specifically, the historical solutions within the sliding window are first assigned decay weights in chronological order. Using a preset decay coefficient as the base and the time interval between the historical solution and the current solution as the exponent, the exponential decay weight for each historical solution is calculated. The shorter the time interval (i.e., the closer the historical solution is to the current moment), the greater the weight assigned; conversely, the longer the time interval (i.e., the more distant the historical solution), the smaller the weight assigned. For ease of exponent calculation, 30 seconds is defined as one beat within the sliding window.

[0105] The preset attenuation coefficient determines the rate at which the influence of historical data decays over time: the closer the coefficient is to 0, the faster the weight of distant historical data decays, and the stronger the dominant role of recent data; the closer the coefficient is to 1, the more uniform the weight of each historical data point becomes, and the weaker the attenuation effect. A value between 0.7 and 0.9 can be preferentially selected based on the production cycle time and the frequency of fluctuations in the dimensions of the incoming material. If the consistency of the incoming material dimensions is good and environmental interference is minimal, a larger value should be selected to fully utilize historical data to smooth out noise; if there are large fluctuations in the dimensions between batches of incoming materials or frequent changes in operating conditions, a smaller value should be selected to allow the window mean to respond more quickly to recent real changes.

[0106] For example, suppose the sliding window capacity is 5 iterations, and the preset decay coefficient is 0.8. The 5 historical solutions within the window are arranged chronologically from most recent to oldest, with time intervals from the current solution being 1, 2, 3, 4, and 5 cycles respectively. The exponential decay weights corresponding to each record are: w1=0.8¹=0.8, w2=0.8²=0.64, w3=0.8³=0.512, w4=0.8 4 =0.4096, w5=0.8 5 =0.32768. The weight of the most recent record (0.8) is much greater than the weight of the oldest record (0.32768), reflecting the design intention that closer data contributes more.

[0107] Next, the historical translation compensation and historical rotation compensation within the sliding window are weighted and summed according to the exponential decay weights. The weighted sum is then divided by the sum of all exponential decay weights to obtain the time-series weighted average of the historical translation compensation and the time-series weighted average of the historical rotation compensation. This is used as the average of the historical solutions within the sliding window.

[0108] For example, within a sliding window, there are 5 historical translation compensation values, taken in the X direction from most recent to furthest in time as 0.4mm, 0.5mm, 0.3mm, 0.4mm, and 0.4mm. The weighted sum is: 0.4×0.8 + 0.5×0.64 + 0.3×0.512 + 0.4×0.4096 + 0.4×0.32768 = 0.32 + 0.32 + 0.1536 + 0.16384 + 0.13107 = 1.08851. The weighted sum of the weights is: 0.8 + 0.64 + 0.512 + 0.4096 + 0.32768 = 2.68928. Therefore, the time-series weighted average of the historical translation compensation values ​​is approximately 1.08851 / 2.68928 ≈ 0.405mm. The historical rotation compensation is calculated similarly. If the five records are -0.3°, -0.2°, -0.3°, -0.2°, and -0.3° respectively, the weighted sum is: -0.3×0.8 + (-0.2)×0.64 + (-0.3)×0.512 + (-0.2)×0.4096 + (-0.3)×0.32768 = -0.24 - 0.128 - 0.1536 - 0.08192 - 0.09830 = -0.70182. The time-series weighted average is: -0.70182 / 2.68928 ≈ -0.261°.

[0109] Furthermore, the aforementioned time-series decay weighted average is used as the average of historical solution results within the sliding window, and is used to verify and correct the current solution result, that is, to compare the deviation with the current translation compensation amount and rotation compensation amount respectively.

[0110] For example, the current translation compensation is 0.5 mm, and the deviation from the historical time series weighted average of 0.405 mm is |0.5 - 0.405| = 0.095 mm; the rotation compensation is -0.38°, and the deviation from the historical time series weighted average of -0.261° is |-0.38 - (-0.261)| = 0.119°.

[0111] Finally, if either the translation compensation deviation or the rotation compensation deviation exceeds the preset deviation threshold, the current solution result is determined to be noisy, and the current solution result is replaced by the historical average translation compensation and historical average rotation compensation within the sliding window; if neither deviation exceeds the preset deviation threshold, the current translation compensation and rotation compensation are used as the output result, and the current solution result is included in the sliding window to update the historical solution results.

[0112] The preset deviation threshold refers to the upper limit of the allowable deviation used in the sliding window filtering judgment step to determine whether there is noise in the current solution result. It includes two independent parameters: translation deviation threshold and rotation deviation threshold, which are determined and fixed in the controller during the debugging phase. The absolute value of the difference between the current translation compensation amount and the average of the historical translation compensation amounts is compared with the translation deviation threshold, and the absolute value of the difference between the current rotation compensation amount and the average of the historical rotation compensation amounts is compared with the rotation deviation threshold. If either one exceeds the limit, the current solution result is determined to be abnormal.

[0113] Specifically, the rules for setting the above two thresholds are as follows: During continuous operation of the production line, collect historical calculation results for no less than 100 times under normal assembly conditions of the same model of toilet seat. Statistically analyze the deviation distribution of the translational compensation and rotational compensation amounts relative to their respective historical averages. Take three times the standard deviation of each deviation distribution as the benchmark value for the corresponding preset deviation threshold, and multiply this by a margin coefficient of 1.0 to 1.5. If the production line has a low tolerance for abnormal fluctuations, the margin coefficient should be smaller; if it is desired to reduce false triggering, the margin coefficient should be larger.

[0114] For example, based on statistical analysis of 100 normal assembly data collected from the production line, the standard deviation of the translational compensation deviation is 0.08 mm. Taking three times the standard deviation as 0.24 mm and a margin coefficient of 1.25, the translational deviation threshold is 0.24 × 1.25 = 0.3 mm. The standard deviation of the rotational compensation deviation is 0.12°. Taking three times the standard deviation as 0.36° and a margin coefficient of 1.4, the rotational deviation threshold is approximately 0.36 × 1.4 ≈ 0.5°. The final preset deviation thresholds are: translational deviation 0.3 mm and rotational deviation 0.5°. If the calculated translational compensation deviation exceeds 0.3 mm or the rotational compensation deviation exceeds 0.5°, it is considered noise, and the historical average is used instead of the output.

[0115] For example, let the preset deviation thresholds be: translation deviation threshold of 0.3mm and rotation deviation threshold of 0.5°. If the current translation compensation deviation is 0.1mm < 0.3mm and the rotation compensation deviation is 0.12° < 0.5°, and both are within limits, the current calculation result is deemed valid. The translation compensation amount (0.5mm, 0.0mm) and rotation compensation amount -0.38° are output, and this result is included in the sliding window.

[0116] In another possible embodiment, assuming that the current translation compensation amount is (1.2mm, 0.0mm) due to visual interference, and the translation compensation deviation = |1.2-0.4| = 0.8mm, which exceeds the 0.3mm threshold, then it is determined that the current solution result contains noise, the current result is discarded, and the output is replaced with the historical average translation compensation amount of 0.4mm and the historical average rotation compensation amount of -0.26°, and the sliding window is not updated.

[0117] It should be noted that the above values ​​are for illustrative purposes only and do not constitute a limitation on the present invention.

[0118] In summary, this step transforms the visually extracted screw hole position information into precise pose compensation parameters that can be executed by the robot arm, while effectively suppressing calculation anomalies caused by single visual noise or accidental interference, ensuring the stability and reliability of the compensation amount.

[0119] S300: Output the translation compensation amount and rotation compensation amount to the robot controller to drive the robot to perform a composite compensation motion of translation and rotation, so that the left sleeve and right sleeve of the dual-axis electric tightening gun are aligned with the left screw hole and the right screw hole respectively.

[0120] This step sends the translational and rotational compensation values ​​output by the rigid body pose calculation module to the robot controller. The controller then drives the robot to perform translational and rotational movements simultaneously in the plane, adjusting the end posture of the dual-axis electric tightening gun so that the center of the left sleeve coincides with the center of the left screw hole, and the center of the right sleeve coincides with the center of the right screw hole, thus completing the precise alignment of the two sleeves and the two screw holes.

[0121] In this step, driving the robotic arm to perform a combined translational and rotational compensation motion includes: using the midpoint of the line connecting the center coordinates of the left screw hole and the center coordinates of the right screw hole as the rotation center, driving the robotic arm to rotate around the rotation center by the angle corresponding to the rotation compensation amount, thereby completing the rotation compensation action.

[0122] After completing the rotation compensation action, the robot arm is driven to move along the direction corresponding to the horizontal deviation by the distance corresponding to the horizontal deviation, and along the direction corresponding to the vertical deviation by the distance corresponding to the vertical deviation, thereby completing the translation compensation action.

[0123] Specifically, the midpoint of the line connecting the center coordinates of the left screw hole and the center coordinates of the right screw hole is used as the rotation center. The robot is driven to rotate around this rotation center by the angle corresponding to the rotation compensation amount, thereby completing the rotation compensation action.

[0124] For example, if the center coordinates of the left screw hole are (42.5mm, 32.1mm) and the center coordinates of the right screw hole are (72.5mm, 31.9mm), then the midpoint coordinates are (57.5mm, 32.0mm). The rotation compensation Δθ = -0.38°. The robot controller uses (57.5mm, 32.0mm) as the rotation center and drives the end effector to rotate -0.38° around this point. After the rotation is completed, the direction of the line connecting the two sleeves of the dual-axis electric tightening gun coincides with the direction of the line connecting the screw holes.

[0125] Furthermore, after completing the rotation compensation action, the robot arm is driven to move a distance |Δx| along the direction corresponding to the horizontal deviation Δx, and then move a distance |Δy| along the direction corresponding to the vertical deviation Δy, to complete the translation compensation action, so that the left sleeve is aligned with the left screw hole and the right sleeve is aligned with the right screw hole respectively.

[0126] For example, the translational compensation is Δx = 0.5mm and Δy = 0.0mm. After rotational compensation, the robot's drive end effector translates 0.5mm along the positive X-axis, without needing to move vertically. After the translation, the center of the left sleeve coincides with the center of the left screw hole (42.5mm, 32.1mm), and the center of the right sleeve coincides with the center of the right screw hole (72.5mm, 31.9mm). The two sleeves are perfectly aligned with the two screw holes, and the compound compensation motion is complete.

[0127] It should be noted that the above values ​​are for illustrative purposes only and do not constitute a limitation on the present invention.

[0128] In summary, this step eliminates planar position and angular deviations caused by the placement of the seat ring, providing a misaligned alignment basis for the subsequent synchronous screwing in of the two bolts, and avoiding bolt stripping or damage to the bolt holes caused by alignment deviations.

[0129] S400: After the left sleeve and the right sleeve are aligned with the left screw hole and the right screw hole respectively, the dual-axis electric tightening gun is driven to simultaneously screw in the bolts and tighten the torque on the left screw hole and the right screw hole until both the left bolt and the right bolt reach the preset target torque and then stop, thus completing the bolt fastening assembly of the toilet seat ring.

[0130] In this step, after aligning the left and right sleeves with the left and right threaded holes respectively, the two output shafts of the dual-axis electric tightening gun are driven to rotate synchronously. The left sleeve drives the left bolt to screw into the left threaded hole, and the right sleeve drives the right bolt to screw into the right threaded hole. Both bolts are fed along the axis of the threaded holes at the same time.

[0131] For example, after alignment, the robot controller sends a start command to the dual-axis electric tightening gun. The left and right sleeves rotate synchronously at the same speed, and the left and right bolts begin to be screwed into the left and right threaded holes, respectively. During the bolt screwing process, the two sleeves move down synchronously along the axial direction as the bolts are fed.

[0132] Furthermore, during the bolt tightening process, the dual-axis electric tightening gun monitors the tightening torque of the left and right bolts in real time, and both torque values ​​increase synchronously with the increase in bolt tightening depth. When the tightening torque of both the left and right bolts reaches the preset target torque, the dual-axis electric tightening gun immediately stops rotating and outputting power.

[0133] The preset target torque refers to the tightening torque value required to tighten the left and right bolts with the dual-axis electric tightening gun. It is a preset parameter that is determined during the debugging stage based on the specifications of the toilet seat bolts, the material of the ceramic substrate embedded nut, and the torque requirements, and is then fixed into the tightening gun controller.

[0134] Specifically, the setting rule for the preset target torque is as follows: consult the standard tightening torque table based on the bolt specifications to obtain the recommended torque range, and take 85% to 95% of this range as the preset target torque. For brittle materials such as ceramic matrices, a conservative value is used to avoid matrix cracking; for metal embedded parts, the upper limit of the standard range can be used to obtain higher connection rigidity. The preset target torque is calibrated and confirmed by a torque calibrator during the commissioning phase and then fixed into the program.

[0135] For example, the toilet seat uses M6 stainless steel bolts with a brass nut embedded in the ceramic substrate. Referring to the standard tightening torque table, the recommended torque range for an M6 bolt and brass nut is 20 N·m to 28 N·m. Considering the brittleness of the ceramic substrate, we take 90% of the recommended range, i.e., the preset target torque = 20 + (28 - 20) × 0.9 = 27.2 N·m, which is rounded down to 27 N·m.

[0136] For example, suppose the preset target torque is set to 27 N·m. During the tightening process, the torque of the left bolt increases from 0 to 18 N·m, 22 N·m, and 27 N·m, while the torque of the right bolt simultaneously increases from 0 to 17 N·m, 21 N·m, and 27 N·m. When the torque on both sides reaches 27 N·m, the dual-axis electric tightening gun automatically cuts off power and stops rotating, and both the left and right bolts are tightened to the preset target torque.

[0137] Finally, after both the left and right bolts reach the preset target torque, the robotic arm drives the dual-axis electric tightening gun to lift and reset, completing the bolt fastening assembly of the toilet seat.

[0138] For example, once both bolts have reached 27 N·m, the robotic arm lifts the dual-axis electric tightening gun upwards, detaches it from the bolt head, returns to the standby position, the vision system resets, and waits for the next toilet seat to be placed before triggering a new round of assembly process.

[0139] It should be noted that the above values ​​are for illustrative purposes only and do not constitute a limitation on the present invention.

[0140] In summary, this invention combines visual guidance positioning, rigid body posture compensation, and dual-axis synchronous tightening to achieve fully automated assembly of toilet seat rings from placement to bolt tightening. It solves the problem of precise alignment and torque consistency of the two bolts caused by placement deviations, thereby improving assembly quality and production line efficiency.

[0141] Example 2, as Figure 3 As shown, the present invention provides a robotic assembly system for tightening toilet seat bolts, the system comprising:

[0142] The visual acquisition and feature extraction module 11 is used to trigger a visual camera to acquire a top-view image of the toilet seat after the toilet seat is placed on the ceramic substrate by a robotic arm, to obtain an original seat image containing the left and right screw holes, and to extract the center coordinates of the left and right screw holes in the original seat image.

[0143] The extraction of the center coordinates of the left and right screw holes from the original screw ring image includes:

[0144] The original seat ring image is preprocessed using a Gaussian filtering method to remove random noise from the original seat ring image, and the filtered image is then converted to grayscale to obtain a grayscale seat ring image.

[0145] The grayscale seat image is binarized using an adaptive threshold segmentation method. Pixels with grayscale values ​​lower than the adaptive threshold are marked as screw hole region pixels, and pixels with grayscale values ​​not lower than the adaptive threshold are marked as background region pixels, thus obtaining a binarized seat image.

[0146] The Canny edge detection algorithm is used to extract the edges of the screw hole region pixels in the binarized screw ring image to obtain the set of left screw hole edge pixels and the set of right screw hole edge pixels;

[0147] The least squares circle fitting method is used to fit the set of edge pixels of the left screw hole and the set of edge pixels of the right screw hole to a circle. The center coordinates of the fitted circle of the left screw hole are used as the center coordinates of the left screw hole, and the center coordinates of the fitted circle of the right screw hole are used as the center coordinates of the right screw hole.

[0148] The pose calculation and compensation generation module 12 is used to perform rigid body pose calculation based on the center coordinates of the left screw hole and the center coordinates of the right screw hole, and to determine the translation compensation and rotation compensation of the toilet seat.

[0149] The process includes a spacing verification step after extracting the center coordinates of the left and right screw holes and before performing rigid body pose calculation.

[0150] Calculate the measured distance between the center coordinates of the left screw hole and the center coordinates of the right screw hole, compare the measured distance with the standard wheelbase corresponding to the pre-stored toilet seat model, and calculate the absolute difference between the measured distance and the standard wheelbase.

[0151] If the absolute difference exceeds the preset error threshold, the image recognition is determined to be abnormal, triggering the vision camera to re-acquire the top view image of the toilet seat and re-extract the center coordinates of the left screw hole and the center coordinates of the right screw hole.

[0152] If the absolute difference does not exceed the preset error threshold, the image recognition result is determined to pass the verification, and the process proceeds to the rigid body pose calculation step.

[0153] Specifically, the rigid body pose calculation is performed based on the center coordinates of the left and right screw holes to determine the translational and rotational compensation amounts of the toilet seat, including:

[0154] Calculate the midpoint coordinates of the line connecting the center coordinates of the left screw hole and the center coordinates of the right screw hole. Calculate the difference between the midpoint coordinates and the pre-stored standard midpoint coordinates of the line connecting the left and right sleeves of the dual-axis electric tightening gun to obtain the horizontal and vertical deviations. Use the horizontal and vertical deviations as the translation compensation amount of the toilet seat.

[0155] Calculate the direction angle of the line connecting the center coordinates of the left screw hole and the center coordinates of the right screw hole. Calculate the difference between the direction angle and the standard direction angle of the line connecting the left and right sleeves of the pre-stored dual-axis electric tightening gun to obtain the angle deviation. Use the angle deviation as the rotation compensation amount of the toilet seat.

[0156] Maintain a sliding window with a preset capacity. The sliding window is used to store the historical calculation results of the same model of toilet seat in the most recent several calculations. The historical calculation results include historical translation compensation and historical rotation compensation.

[0157] Calculate the deviation between the translation compensation amount and the average historical translation compensation amount within the sliding window, and the deviation between the rotation compensation amount and the average historical rotation compensation amount within the sliding window, to obtain the translation compensation amount deviation and the rotation compensation amount deviation;

[0158] If either the translation compensation deviation or the rotation compensation deviation exceeds a preset deviation threshold, it is determined that the current calculation result contains noise, and the current calculation result is output in place of the historical average translation compensation and historical average rotation compensation within the sliding window.

[0159] If neither the translation compensation deviation nor the rotation compensation deviation exceeds a preset deviation threshold, then the translation compensation amount and the rotation compensation amount are used as the output result, and the current solution result is included in the sliding window, updating the historical solution results in the sliding window.

[0160] The mean of the historical solutions within the sliding window is a time-decayed weighted mean, and the calculation steps of the time-decayed weighted mean include:

[0161] The historical solution results within the sliding window are assigned decay weights in chronological order. Specifically, the decay weight is calculated for each historical solution result using a preset decay coefficient as the base and the time interval between the historical solution result and the current solution time as the exponent. The smaller the time interval, the larger the exponent decay weight, and the larger the time interval, the smaller the exponent decay weight.

[0162] The historical translation compensation and historical rotation compensation within the sliding window are weighted and summed according to the exponential decay weights, and the weighted sum is divided by the sum of all exponential decay weights to obtain the time-series weighted average of the historical translation compensation and the time-series weighted average of the historical rotation compensation. These are used as the average of the historical solutions within the sliding window and are used for the verification and correction of the current solution.

[0163] Before calculating the time-weighted mean, an outlier removal step is also included:

[0164] Based on all historical solution results within the sliding window, calculate the covariance matrix of historical translation compensation and historical rotation compensation.

[0165] For each historical solution result within the sliding window, the historical translation compensation and historical rotation compensation in the historical solution result are constructed into a two-dimensional feature vector. Using the covariance matrix as the metric, the Mahalanobis distance between the two-dimensional feature vector and the mean vector of all historical solution results within the sliding window is calculated.

[0166] Historical solutions with a Mahalanobis distance exceeding a preset removal threshold are marked as abnormal samples and removed from the sliding window. Based on the remaining historical solutions after removing abnormal samples, the time-series weighted average is recalculated according to the exponential decay weight allocation method.

[0167] The composite compensation alignment module 13 is used to output the translational compensation amount and rotational compensation amount to the robot controller, drive the robot to perform a composite compensation motion of translation and rotation, so that the left sleeve and right sleeve of the dual-axis electric tightening gun are aligned with the left screw hole and the right screw hole respectively.

[0168] The process of driving the robotic arm to perform a combined translational and rotational compensation motion includes: using the midpoint of the line connecting the center coordinates of the left screw hole and the center coordinates of the right screw hole as the rotation center, driving the robotic arm to rotate around the rotation center by an angle corresponding to the rotation compensation amount, thereby completing the rotation compensation action.

[0169] After completing the rotation compensation action, the robot arm is driven to move along the direction corresponding to the horizontal deviation by the distance corresponding to the horizontal deviation, and along the direction corresponding to the vertical deviation by the distance corresponding to the vertical deviation, thereby completing the translation compensation action.

[0170] The composite compensation motion employs a hierarchical execution strategy, which includes:

[0171] First-level compensation: Drive the robotic arm to perform first-level translational compensation and first-level rotational compensation according to a preset execution ratio, and pause after execution. The preset execution ratio is a value greater than 70% and less than 90%. The first-level translational compensation is the product of the translational compensation and the preset execution ratio, and the first-level rotational compensation is the product of the rotational compensation and the preset execution ratio.

[0172] The vision camera is triggered to acquire an intermediate image of the toilet seat. The center coordinates of the left screw hole and the center coordinates of the right screw hole are re-extracted from the intermediate image, and the rigid body pose is re-calculated to obtain the residual translation compensation and residual rotation compensation.

[0173] Second-level compensation: Drive the robotic arm to perform the residual translation compensation and the residual rotation compensation to complete the final alignment.

[0174] The dual-axis synchronous fastening module 14 is used to drive the dual-axis electric tightening gun to simultaneously screw in the bolts and tighten the torque on the left and right bolts after the left sleeve and right sleeve are aligned with the left and right bolt holes respectively, until the left and right bolts reach the preset target torque and then stop, thus completing the bolt fastening assembly of the toilet seat ring.

[0175] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

[0176] This specification and accompanying drawings are merely illustrative examples of the invention and are intended to cover any and all modifications, variations, combinations, or equivalents within the scope of the invention. Clearly, those skilled in the art can make various alterations and modifications to the invention without departing from its scope. Therefore, if such modifications and modifications fall within the scope of the invention and its equivalents, the invention is intended to include these modifications and modifications.

Claims

1. A robotic assembly method for tightening toilet seat bolts, characterized in that, The method includes: After the toilet seat is placed on the ceramic substrate by the robotic arm, the vision camera is triggered to capture a top view image of the toilet seat, obtain the original seat image containing the left and right screw holes, and extract the center coordinates of the left and right screw holes from the original seat image. Based on the center coordinates of the left and right screw holes, the rigid body pose is calculated to determine the translational and rotational compensation amounts of the toilet seat. The translational compensation and rotational compensation are output to the robot controller to drive the robot to perform a composite compensation motion of translation and rotation, so that the left sleeve and right sleeve of the dual-axis electric tightening gun are aligned with the left screw hole and the right screw hole, respectively. After the left sleeve and the right sleeve are aligned with the left screw hole and the right screw hole respectively, the dual-axis electric tightening gun is driven to simultaneously screw in the bolts and tighten the torque on the left and right screw holes until both the left and right bolts reach the preset target torque, thus completing the bolt fastening assembly of the toilet seat.

2. The robotic assembly method for tightening toilet seat bolts according to claim 1, characterized in that, Extracting the center coordinates of the left and right screw holes from the original screw ring image includes: The original seat ring image is preprocessed using a Gaussian filtering method to remove random noise from the original seat ring image, and the filtered image is then converted to grayscale to obtain a grayscale seat ring image. The grayscale seat image is binarized using an adaptive threshold segmentation method. Pixels with grayscale values ​​lower than the adaptive threshold are marked as screw hole region pixels, and pixels with grayscale values ​​not lower than the adaptive threshold are marked as background region pixels, thus obtaining a binarized seat image. The Canny edge detection algorithm is used to extract the edges of the screw hole region pixels in the binarized screw ring image to obtain the set of left screw hole edge pixels and the set of right screw hole edge pixels; The least squares circle fitting method is used to fit the set of edge pixels of the left screw hole and the set of edge pixels of the right screw hole to a circle. The center coordinates of the fitted circle of the left screw hole are used as the center coordinates of the left screw hole, and the center coordinates of the fitted circle of the right screw hole are used as the center coordinates of the right screw hole.

3. The robotic assembly method for tightening toilet seat bolts according to claim 1, characterized in that, After extracting the center coordinates of the left and right screw holes and before performing rigid body pose calculation, a spacing verification step is also included: Calculate the measured distance between the center coordinates of the left screw hole and the center coordinates of the right screw hole, compare the measured distance with the standard wheelbase corresponding to the pre-stored toilet seat model, and calculate the absolute difference between the measured distance and the standard wheelbase. If the absolute difference exceeds the preset error threshold, the image recognition is determined to be abnormal, triggering the vision camera to re-acquire the top view image of the toilet seat and re-extract the center coordinates of the left screw hole and the center coordinates of the right screw hole. If the absolute difference does not exceed the preset error threshold, the image recognition result is determined to pass the verification, and the process proceeds to the rigid body pose calculation step.

4. The robotic assembly method for tightening toilet seat bolts according to claim 1, characterized in that, Based on the center coordinates of the left and right screw holes, rigid body pose calculation is performed to determine the translational and rotational compensation amounts of the toilet seat, including: Calculate the midpoint coordinates of the line connecting the center coordinates of the left screw hole and the center coordinates of the right screw hole. Calculate the difference between the midpoint coordinates and the pre-stored standard midpoint coordinates of the line connecting the left and right sleeves of the dual-axis electric tightening gun to obtain the horizontal and vertical deviations. Use the horizontal and vertical deviations as the translation compensation amount of the toilet seat. Calculate the direction angle of the line connecting the center coordinates of the left screw hole and the center coordinates of the right screw hole. Calculate the difference between the direction angle and the standard direction angle of the line connecting the left and right sleeves of the pre-stored dual-axis electric tightening gun to obtain the angle deviation. Use the angle deviation as the rotation compensation amount of the toilet seat. Maintain a sliding window with a preset capacity. The sliding window is used to store the historical calculation results of the same model of toilet seat in the most recent several calculations. The historical calculation results include historical translation compensation and historical rotation compensation. Calculate the deviation between the translation compensation amount and the average historical translation compensation amount within the sliding window, and the deviation between the rotation compensation amount and the average historical rotation compensation amount within the sliding window, to obtain the translation compensation amount deviation and the rotation compensation amount deviation; If either the translation compensation deviation or the rotation compensation deviation exceeds a preset deviation threshold, it is determined that the current calculation result contains noise, and the current calculation result is output in place of the historical average translation compensation and historical average rotation compensation within the sliding window. If neither the translation compensation deviation nor the rotation compensation deviation exceeds a preset deviation threshold, then the translation compensation amount and the rotation compensation amount are used as the output result, and the current solution result is included in the sliding window, updating the historical solution results in the sliding window.

5. The robotic assembly method for tightening toilet seat bolts according to claim 4, characterized in that, The mean of the historical solutions within the sliding window is a time-decayed weighted mean, and the calculation steps of the time-decayed weighted mean include: The historical solution results within the sliding window are assigned decay weights in chronological order. Specifically, the decay weight is calculated for each historical solution result using a preset decay coefficient as the base and the time interval between the historical solution result and the current solution time as the exponent. The smaller the time interval, the larger the exponent decay weight, and the larger the time interval, the smaller the exponent decay weight. The historical translation compensation and historical rotation compensation within the sliding window are weighted and summed according to the exponential decay weights, and the weighted sum is divided by the sum of all exponential decay weights to obtain the time-series weighted average of the historical translation compensation and the time-series weighted average of the historical rotation compensation. These are used as the average of the historical solutions within the sliding window and are used for the verification and correction of the current solution.

6. The robotic assembly method for tightening toilet seat bolts according to claim 5, characterized in that, Before calculating the time-weighted mean, an outlier removal step is also included: Based on all historical solution results within the sliding window, calculate the covariance matrix of historical translation compensation and historical rotation compensation. For each historical solution result within the sliding window, the historical translation compensation and historical rotation compensation in the historical solution result are constructed into a two-dimensional feature vector. Using the covariance matrix as the metric, the Mahalanobis distance between the two-dimensional feature vector and the mean vector of all historical solution results within the sliding window is calculated. Historical solutions with a Mahalanobis distance exceeding a preset removal threshold are marked as abnormal samples and removed from the sliding window. Based on the remaining historical solutions after removing abnormal samples, the time-series weighted average is recalculated according to the exponential decay weight allocation method.

7. The robotic assembly method for tightening toilet seat bolts according to claim 4, characterized in that, Driving the robotic arm to perform a combined translational and rotational compensation motion includes: using the midpoint of the line connecting the center coordinates of the left screw hole and the center coordinates of the right screw hole as the rotation center, driving the robotic arm to rotate around the rotation center by an angle corresponding to the rotation compensation amount, thereby completing the rotation compensation action.

8. The robotic assembly method for tightening toilet seat bolts according to claim 7, characterized in that, After completing the rotation compensation action, the robot arm is driven to move along the direction corresponding to the horizontal deviation by the distance corresponding to the horizontal deviation, and along the direction corresponding to the vertical deviation by the distance corresponding to the vertical deviation, thereby completing the translation compensation action.

9. The robotic assembly method for tightening toilet seat bolts according to claim 8, characterized in that, The composite compensation motion employs a hierarchical execution strategy, which includes: First-level compensation: Drive the robotic arm to perform first-level translational compensation and first-level rotational compensation according to a preset execution ratio, and pause after execution. The preset execution ratio is a value greater than 70% and less than 90%. The first-level translational compensation is the product of the translational compensation and the preset execution ratio, and the first-level rotational compensation is the product of the rotational compensation and the preset execution ratio. The vision camera is triggered to acquire an intermediate image of the toilet seat. The center coordinates of the left screw hole and the center coordinates of the right screw hole are re-extracted from the intermediate image, and the rigid body pose is re-calculated to obtain the residual translation compensation and residual rotation compensation. Second-level compensation: Drive the robotic arm to perform the residual translation compensation and the residual rotation compensation to complete the final alignment.

10. A robotic assembly system for tightening toilet seat bolts, characterized in that, A robotic arm assembly method for tightening toilet seat bolts as described in any one of claims 1 to 9, the system comprising: The visual acquisition and feature extraction module is used to trigger a visual camera to acquire a top-view image of the toilet seat after the toilet seat is placed on the ceramic substrate by a robotic arm, obtain the original seat image containing the left screw hole and the right screw hole, and extract the center coordinates of the left screw hole and the center coordinates of the right screw hole in the original seat image. The pose calculation and compensation generation module is used to perform rigid body pose calculation based on the center coordinates of the left screw hole and the center coordinates of the right screw hole, and to determine the translation compensation and rotation compensation of the toilet seat. The composite compensation alignment module is used to output the translational compensation amount and rotational compensation amount to the robot controller, drive the robot to perform a composite compensation motion of translation and rotation, so that the left sleeve and right sleeve of the dual-axis electric tightening gun are aligned with the left screw hole and the right screw hole respectively. The dual-axis synchronous fastening module is used to drive the dual-axis electric tightening gun to simultaneously screw in and tighten the bolts in the left and right screw holes after the left and right sleeves are aligned with the left and right screw holes respectively, until both the left and right bolts reach the preset target torque and then stop, thus completing the bolt fastening assembly of the toilet seat ring.