Error calibration method and device for screw locking machine
By acquiring screw hole images and performing deep learning detection and traditional grayscale center detection, the error is calculated and calibrated, solving the problem of decreased accuracy caused by mechanical fatigue in automatic screw fastening machines, and improving the accuracy and reliability of the fastening machine.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-12
- Publication Date
- 2026-03-27
AI Technical Summary
After prolonged operation, automatic screw fastening machines experience a decrease in fastening accuracy due to mechanical fatigue, which affects assembly quality and production efficiency.
By acquiring screw hole images, deep learning neural networks are used to detect hole areas, calculate pixel area, inner diameter, and center position, determine and calibrate height error and hole position deviation, and combine traditional grayscale center detection methods for sub-pixel level positioning to achieve error calibration.
It improves the precision and reliability of screw fastening machines, reduces the risk of fastening failure due to mechanical fatigue, and enhances production efficiency and system stability.
Smart Images

Figure CN119681617B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the field of automation, and in particular, to a method and device for error calibration of a screw locking machine. BACKGROUND
[0002] In the production line of a notebook computer, the running efficiency and precision of an automatic screw locking machine directly affect the assembly quality of the whole machine. However, after a long time of running, the locking machine is inevitably subject to mechanical fatigue, resulting in a gradual decrease in locking precision. Such a decrease in precision can directly cause locking failure, thereby affecting the smooth progress of the entire assembly process. SUMMARY
[0003] The present disclosure provides a method and device for error calibration of a screw locking machine to at least solve the above technical problems existing in the prior art.
[0004] According to a first aspect of the present disclosure, a method for error calibration of a screw locking machine is provided, the method comprising:
[0005] obtaining a screw hole site image;
[0006] inputting the screw hole site image into a pre-constructed hole detection model to obtain a hole region of the screw hole site;
[0007] calculating a pixel area, a hole inner diameter of the hole region, and determining a hole center position;
[0008] calculating a height error of the screw locking machine based on the pixel area and the hole inner diameter of the hole region, and calculating a hole site deviation of the screw locking machine based on the hole center position;
[0009] judging whether to perform error calibration based on the height error and the hole site deviation, and performing height error calibration and hole site error calibration when it is judged to perform error calibration.
[0010] In an implementable manner, the screw hole site image is obtained by using a camera; the camera is fixed at the end of a mechanical arm of the screw locking machine; wherein the end of the mechanical arm is also fixed with a light source for improving the brightness of the screw hole site.
[0011] In an implementable manner, the hole region of the screw hole site is obtained by:
[0012] cutting the screw hole site image to obtain a cut hole site region;
[0013] performing binaryzation processing on the cut hole site region to obtain the hole region.
[0014] In an embodiment, before calculating the hole position deviation of the screw locking machine based on the hole center position, the method further comprises: obtaining initial pixel area data, initial hole inner diameter data, and initial hole center coordinate data collected by the screw locking machine; and calculating the height error of the screw locking machine based on the pixel area of the hole region and the hole inner diameter, and calculating the hole position deviation of the screw locking machine based on the hole center position comprises:
[0015] calculating a first difference value by calculating a difference between the pixel area of the hole region and the initial pixel area data, and calculating a second difference value by calculating a difference between the hole inner diameter of the hole region and the initial hole inner diameter data; and taking the first difference value and the second difference value as the height error of the screw locking machine;
[0016] calculating a third difference value by calculating a difference between the hole center position and the initial hole center coordinate data, and taking the third difference value as the hole position deviation of the screw locking machine.
[0017] In an embodiment, the method further comprises:
[0018] comparing the first difference value and the second difference value with a first error threshold value, respectively; when the first difference value and the second difference value are both greater than the first error threshold value, it is determined that the height error needs to be calibrated; otherwise, the height error does not need to be calibrated;
[0019] comparing the third difference value with a second error threshold value; when the third difference value is greater than the second error threshold value, it is determined that the hole position deviation needs to be calibrated; otherwise, the hole position deviation does not need to be calibrated.
[0020] In an embodiment, the method further comprises:
[0021] determining a deviation direction of the end height of the mechanical arm of the screw locking machine according to the first difference value and the second difference value;
[0022] setting a first step value according to the second difference value;
[0023] adjusting a mechanical arm parameter based on the first step value, calculating an adjusted second difference value, and continuing to adjust the mechanical arm parameter according to the step value based on the second difference value, until the deviation direction of the second difference value changes, and outputting a new second difference value; the mechanical arm parameter is used to represent the end height of the mechanical arm;
[0024] if the new second difference value is less than the second error threshold value, the height calibration is completed;
[0025] Otherwise, a second step value is set according to a new second difference value; wherein the second step value is smaller than the first step value;
[0026] The mechanical arm parameter is adjusted based on the second step value, and when an adjusted second difference value is smaller than a second error threshold value, a step value offset is determined; the step value offset is a difference value between the first step value and the second step value;
[0027] The step value offset is converted into an offset value in the mechanical arm coordinate by using a pre-obtained conversion matrix; the offset value in the mechanical arm coordinate is a height error compensation value.
[0028] In an implementable manner, the calibration of the hole position deviation comprises:
[0029] The third difference value is clustered to obtain a cluster center point; and the cluster center point is taken as a compensation value;
[0030] The compensation value is converted into a compensation value in the mechanical arm coordinate by using a pre-obtained conversion matrix;
[0031] The mechanical arm parameter is adjusted according to the compensation value in the mechanical arm coordinate, and a new hole position deviation value is obtained according to the adjusted mechanical arm parameter;
[0032] If the new hole position deviation value is higher than the second error threshold value, the calibration of the hole position deviation is re-performed; and if the new hole position deviation value is lower than the second error threshold value, the calibration of the hole position deviation is completed.
[0033] In an implementable manner, the calibration of the hole position deviation comprises:
[0034] If the new hole position deviation value is higher than the second error threshold value, and a difference between the new hole position deviation value and a last hole position deviation value is smaller than a difference threshold value, the calibration of the hole position deviation is ended.
[0035] In an implementable manner, after the hole region of the screw hole position is obtained, the method further comprises:
[0036] The hole region is subjected to super-resolution processing based on a bilinear difference method.
[0037] According to a second aspect of the present disclosure, an error calibration device of a screw locking machine is provided, and the device comprises:
[0038] An acquisition module is configured to acquire a screw hole position image;
[0039] A detection module is configured to input the screw hole position image into a pre-constructed hole detection model to obtain a hole region of a screw hole position;
[0040] The first calculation module is configured to calculate a pixel area of the hole region, a hole inner diameter, and determine a hole center position;
[0041] The second calculation module is configured to calculate a height error of the screw locking machine based on the pixel area and the hole inner diameter of the hole region, and calculate a hole position deviation of the screw locking machine based on the hole center position.
[0042] The calibration module is configured to determine whether to perform error calibration based on the height error and the hole position error, and perform height error calibration and hole position error calibration when it is determined to perform error calibration.
[0043] According to a third aspect of the present disclosure, an electronic device is provided, comprising:
[0044] at least one processor; and
[0045] a memory connected with the at least one processor; wherein
[0046] The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method of the present disclosure.
[0047] According to a fourth aspect of the present disclosure, a non-transitory computer readable storage medium storing computer instructions is provided, the computer instructions being used to enable the computer to perform the method of the present disclosure.
[0048] The error calibration method and device of the screw locking machine of the present disclosure can analyze the images collected in each locking process to determine whether the locking machine is accurately aligned with the hole position, confirm whether the height is normal, identify and record possible errors in time, calibrate the height error when there is an error, and calibrate the hole position deviation after the height error is corrected. The locking failure caused by mechanical fatigue is effectively reduced, and the precision and reliability of the locking machine are improved.
[0049] It should be understood that the content described in this part is not intended to identify key or important features of the embodiments of the present disclosure, nor is it used to limit the scope of the present disclosure. Other features of the present disclosure will become apparent through the following description. BRIEF DESCRIPTION OF DRAWINGS
[0050] The above and other objects, features and advantages of the exemplary embodiments of the present disclosure will be more apparent from the following detailed description taken in conjunction with the accompanying drawings, in which:
[0051] In the drawings, the same or corresponding reference numerals indicate the same or corresponding parts.
[0052] Figure 1 This illustration shows the implementation flow of the error calibration method for the screw fastening machine according to an embodiment of the present disclosure. Figure 1 ;
[0053] Figure 2 This illustration shows the implementation flow of the error calibration method for the screw fastening machine according to an embodiment of the present disclosure. Figure 2 ;
[0054] Figure 3 A schematic diagram of the ROI region of the screw hole detected according to an embodiment of this disclosure is shown;
[0055] Figure 4 A schematic diagram of the screw hole center position according to an embodiment of the present disclosure is shown;
[0056] Figure 5 A schematic diagram illustrating the implementation process of height deviation calibration according to an embodiment of this disclosure is shown;
[0057] Figure 6 A schematic diagram illustrating the implementation process of hole position deviation calibration according to an embodiment of this disclosure is shown;
[0058] Figure 7 A schematic diagram of the error calibration device for a screw fastening machine according to an embodiment of the present disclosure is shown;
[0059] Figure 8 A schematic diagram of the composition structure of an electronic device according to an embodiment of the present disclosure is shown. Detailed Implementation
[0060] To make the objectives, features, and advantages of this disclosure more apparent and understandable, the technical solutions in the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this disclosure, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of this disclosure without creative effort are within the scope of protection of this disclosure.
[0061] In existing technologies, images are acquired using cameras on a robotic arm, and the relative position of the part to be assembled and the robot is obtained using vision. The pose difference between the robot and the target pose is calculated using the acquired pose information, thereby achieving pose error compensation and improving the adaptability and grasping positioning accuracy of the operating system. However, this calibration method is only applicable to workpiece grasping tasks of the robotic arm and is not suitable for screw fastening tasks. Furthermore, this method relies on the vision system to extract feature plane pose information, a process that involves the accuracy of image processing and feature matching algorithms. If the feature extraction algorithm is not robust enough, it may lead to inaccurate estimation of the grasping posture, resulting in pose error compensation failure.
[0062] In addition, the machine vision unit and the quality detection unit are fixedly installed on the screw locking unit, the machine vision unit is used to complete the identification, classification and spatial pose acquisition of the workpiece surface multi-specification threaded hole, the data interaction between the machine vision unit and the host control unit is completed based on the communication unit, the automatic tool changing and the automatic picking and locking of the multi-specification screw are realized through the cooperation of the motion control unit and the screw locking unit, and the locking quality detection of the locked screw is realized by using the quality detection unit. However, the image processing and data transmission need to be performed in real time, the complex data processing may cause the processing period to be lengthened, thereby affecting the production efficiency. Moreover, the height detection is performed by using the laser displacement sensor, and the accuracy and stability of the sensor are highly dependent. Under the long-term working condition, if the sensor fails or deviates, the unqualified product may not be detected, thereby affecting the quality of the final product.
[0063] The application provides an error calibration method of a screw locking machine. The application first acquires a screw hole position image, then determines a hole region in the image, calculates the pixel area of the hole region, the inner diameter of the hole, and determines the center position of the hole, so as to calculate the height error of the screw locking machine according to the pixel area of the hole region and the inner diameter of the hole, calculate the hole position deviation of the screw locking machine based on the center position of the hole, judge whether to perform error calibration based on the height error and the hole position error, and perform height error calibration and hole position error calibration when it is judged to perform error calibration. The scheme provided by the application detects the approximate position of the screw hole, and combines the gray center detection method in the traditional algorithm to position the hole center coordinate at the sub-pixel level. The accuracy and reliability of the locking machine can be improved, and the risk of locking failure caused by mechanical fatigue can be effectively reduced.
[0064] The application provides an error calibration method of a screw locking machine and a device thereof.
[0065] As shown in Figure 1 The application provides an error calibration method of a screw locking machine. The method comprises:
[0066] S101, acquiring a screw hole position image;
[0067] It can be understood that the technical scheme provided by the application can be started from two aspects, one is to detect mechanical error, and the other is to reduce error. Therefore, it can be divided into a detection mode and a calibration mode. The mechanical error is detected through the detection mode, and then the calibration mode is entered for calibration according to the mechanical error to reduce the error.
[0068] Firstly, in the detection mode, as shown in Figure 2As shown, before each locking process, that is, before each screw locking machine locking is needed, the screw hole position image is first acquired through the camera. Among them, the camera is arranged on the locking machine at the end of the mechanical arm, and the screw hole position image is collected when the mechanical arm moves above the screw hole position. The screw hole position image collected in this application can be a color image or a gray image, which is not limited in this application.
[0069] S102, input the screw hole position image into the pre-constructed hole detection model to obtain the hole region of the screw hole position;
[0070] It can be understood that the hole detection model provided in this application can be a hole detection model trained by using existing training methods, or a hole detection model trained by using future training methods. After inputting the screw hole position image into the hole detection model, the hole region of the screw hole position can be obtained. The hole detection model in the embodiment of the application adopts a deep learning neural network.
[0071] S103, calculate the pixel area of the hole region, the hole inner diameter, and determine the hole center position;
[0072] After determining the hole region, the pixel area of the hole region is calculated, the Hough Circle method is used to find the hole circle, and the inner diameter is calculated, and the gray center of gravity method is used to calculate the hole center position coordinates.
[0073] S104, calculate the height error of the screw locking machine based on the pixel area and the hole inner diameter of the hole region, and calculate the hole position deviation of the screw locking machine based on the hole center position;
[0074] It should be noted that the height error of the screw locking machine can be calculated by the pixel area and the hole inner diameter of the hole region, and the hole position deviation of the screw locking machine can be calculated by the hole center position.
[0075] S105, based on the height error and the hole position error, judge whether to perform error calibration, and perform height error calibration and hole position error calibration when it is judged to perform error calibration.
[0076] According to the comparison result of the height error and the hole position error and the corresponding error threshold, it is judged whether error calibration is needed. If it is judged that error calibration is needed, height error calibration and hole position error calibration are performed in turn. It should be noted that in the embodiment of the application, if an error occurs, the height error needs to be calibrated first, and then the hole position deviation is calibrated.
[0077] The error calibration method of the screw locking machine provided in the application analyzes the image collected in each locking process to determine whether the locking machine is accurately aligned with the hole position and to confirm whether the height is normal. Through monitoring of the real-time image, possible errors can be identified and recorded in time. In the calibration mode, the locking function is repeatedly performed by using the standard hole position mold to obtain the data of the hole position. First, height calibration is performed, the degree of height deviation of the mechanical arm is determined by identifying the diameter and area of the hole position in the image, and the corresponding error is recorded. After the correction of the height error is completed, calibration of the hole position deviation is performed. By detecting the position of the screw hole center point in the image, the pixel distance from the initial position is calculated, and finally the correction of the mechanical arm parameters is realized. Both calibration modes are repeated to correct and measure errors, and the calibration process is ended when the error reaches a convergent state within a set number of cycles.
[0078] The application can analyze the image collected in each locking process to determine whether the locking machine is accurately aligned with the hole position and to confirm whether the height is normal, identify and record possible errors in time, and calibrate the height error first when there is an error, and then calibrate the hole position deviation after the correction of the height error is completed. The locking failure caused by mechanical fatigue is effectively reduced, and the precision and reliability of the locking machine are improved.
[0079] In some embodiments, a camera is used to obtain the screw hole position image; the camera is fixed at the end of the mechanical arm of the screw locking machine; wherein the end of the mechanical arm is also fixed with a light source for improving the brightness of the screw hole position.
[0080] It can be understood that in the application, the camera is installed at the end of the mechanical arm of the locking machine, and the locking machine is also provided with a light source for irradiating the screw hole position, so that the hole position image collected by the camera is clearer.
[0081] In some embodiments, the hole region of the screw hole position comprises:
[0082] The screw hole position image is cut to obtain a cut hole position region;
[0083] The cut hole position region is subjected to binaryzation processing to obtain a hole region.
[0084] Specifically, as shown in Figure 3 In the application, a pre-trained hole detection model is loaded to obtain the ROI (Region of Interest) region of the screw hole position, the ROI region is cut, and then an appropriate binaryzation threshold is selected to perform image binaryzation processing on the cut hole position region, as shown in Figure 4The hole region is distinguished, and the pixel area of the hole region is calculated. The Hough Circle method is used to find the circle of the hole and calculate the inner diameter of the hole. The gray gravity center method is used to calculate the center position of the hole.
[0085] In some embodiments, the method further comprises: Figure 2 As shown in the figure, after obtaining the hole region of the screw hole position, the method further comprises:
[0086] The hole region is subjected to super-resolution processing based on the bilinear difference method.
[0087] It can be understood that the ROI region is subjected to super-resolution processing based on the bilinear difference method, and the resolution is improved to 8 times of the original resolution, so that the hole region is better distinguished, and the pixel area, the inner diameter of the hole, and the center position of the hole are more accurate.
[0088] In some embodiments, before calculating the hole position deviation of the screw locking machine based on the center position of the hole, the method further comprises: obtaining initial pixel area data, initial hole inner diameter data, and initial hole center coordinate data collected by the screw locking machine;
[0089] The height error of the screw locking machine is calculated based on the pixel area and the inner diameter of the hole region, and the hole position deviation of the screw locking machine is calculated based on the center position of the hole, which comprises:
[0090] The difference between the pixel area of the hole region and the initial pixel area data is calculated to obtain a first difference value, and the difference between the inner diameter of the hole region and the initial hole inner diameter data is calculated to obtain a second difference value. The first difference value and the second difference value are taken as the height error of the screw locking machine;
[0091] The difference between the center position of the hole and the initial hole center coordinate data is calculated to obtain a third difference value, and the third difference value is taken as the hole position deviation of the screw locking machine.
[0092] Specifically, in the present application, the conversion matrix T of the camera coordinates to the robot coordinates obtained in the installation and deployment process is first determined. During stable operation, the hole center point coordinates (x0, y0) in the captured image, the hole pixel inner diameter size L0, and the hole pixel area S0 are obtained. Then, the pixel area S of the current hole region, the hole inner diameter L, and the hole center position (x, y) are obtained. The error is calculated in the following manner,
[0093] Hole area error E s =(S-S0);
[0094] Hole inner diameter error E L =(L-L0);
[0095] hole center deviation error E xy = (x - x0, y - y0)
[0096] The hole area error is the first error, the hole inner diameter error is the second error, and the hole center deviation error is the third error.
[0097] In some embodiments, the determining whether to perform error calibration based on the height error and the hole position error comprises:
[0098] comparing the first difference value and the second difference value with a first error threshold value, and determining that the height error needs to be calibrated when the first difference value and the second difference value are both greater than the first error threshold value; otherwise, the height error does not need to be calibrated;
[0099] comparing the third difference value with a second error threshold value, and determining that the hole position deviation needs to be calibrated when the third difference value is greater than the second error threshold value; otherwise, the hole position deviation does not need to be calibrated.
[0100] Specifically, the first error threshold value for determining the height error and the second error threshold value for determining the hole position deviation are set in advance according to actual needs in the present application. If the hole area error is greater than the first error threshold value and the hole inner diameter error is greater than the first error threshold value, that is, if E S > 0 and E L > 0, it indicates that the end of the mechanical arm is too high; if the hole area error is less than the first error threshold value and the hole inner diameter error is less than the first error threshold value, that is, if E S < 0 and E L < 0, it indicates that the end of the mechanical arm is too low. In the present application, the hole center deviation error is compared with the second error threshold value, and the hole position deviation needs to be calibrated when the third difference value is greater than the second error threshold value.
[0101] In some embodiments, the calibration of the height error comprises:
[0102] determining the deviation direction of the height of the end of the mechanical arm of the screw locking machine according to the first difference value and the second difference value;
[0103] setting a first step value according to the second difference value;
[0104] adjusting the mechanical arm parameters based on the first step value, calculating an adjusted second difference value, and continuing to adjust the mechanical arm parameters according to the step value based on the second difference value, until the deviation direction of the second difference value changes, and outputting a new second difference value; the mechanical arm parameters are used to represent the height of the end of the mechanical arm.
[0105] If the new second difference value is less than the second error threshold value, the height calibration is completed.
[0106] Otherwise, a second step value is set based on the new second difference; wherein the second step value is less than the first step value;
[0107] The robot arm parameters are adjusted based on the second step value until the adjusted second difference is less than the second error threshold, at which point the step value offset is determined; the step value offset is the difference between the first step value and the second step value.
[0108] The step value offset is converted into an offset value in the robot arm coordinate system using a pre-acquired transformation matrix; the offset value in the robot arm coordinate system is the height error compensation value.
[0109] Specifically, such as Figure 5 As shown, based on the area and inner diameter errors, it can be determined whether the height of the robotic arm's end effector is too high or too low: If E S >0 and E L If the value is >0, the end is too low; otherwise, it is too high.
[0110] Then, based on the magnitude of the deviation, set a step value K1, typically 1.
[0111] Modify the robotic arm parameters, increase the hovering height coordinate by K1, and repeat the height error detection process to obtain the new E. L1 ;
[0112] Repeat the previous step, increasing the height coordinate by K1 each time, until E... L1 The sign changes;
[0113] Set a smaller step value
[0114] Modify the robotic arm parameters, increase the hovering height coordinate by K2, and repeat the height error detection process to obtain the new E. L2 ;
[0115] Repeat the previous step until the result converges or E. L2 Below the threshold;
[0116] At this point, the set height coordinate offset △K is obtained. Using the pre-acquired transformation matrix T, the corresponding offset value under the robot arm coordinates is obtained, which is the error height error compensation value.
[0117] In some embodiments, the calibration of the hole position deviation includes:
[0118] Cluster the third difference to obtain cluster centers; use the cluster centers as compensation values.
[0119] convert the compensation value into a compensation value in the mechanical arm coordinates by using a pre-obtained conversion matrix;
[0120] adjust the mechanical arm parameters according to the compensation value in the mechanical arm coordinates, and obtain a new hole position deviation value according to the adjusted mechanical arm parameters;
[0121] If the new hole position deviation value is higher than the second error threshold, re-perform the hole position deviation calibration; if the new hole position deviation value is lower than the second error threshold, the hole position deviation calibration is completed.
[0122] In some embodiments, the calibration of the hole position deviation comprises:
[0123] If the new hole position deviation value is higher than the second error threshold, and the difference between the new hole position deviation value and the last hole position deviation value is less than a difference threshold, the hole position deviation calibration is completed.
[0124] Specifically, as shown in Figure 6 , a simulation locking mold is used to repeatedly perform the locking process N times (N>30), and a group of corresponding hole images are obtained;
[0125] A pre-trained hole detection model is loaded to obtain the ROI region of the screw hole position, and image cropping is completed;
[0126] The ROI region is subjected to super-resolution based on the bilinear difference method, and its resolution is improved to 8 times the original resolution;
[0127] The gray center method is used to calculate the hole center sub-pixel coordinates (x n ,y n ), and the deviation value E n =(x n -x0,y n -y0) of this group of data and the initial hole coordinates is calculated, respectively.
[0128] E n is clustered, and after excluding abnormal points, the cluster center point xy △ =(x △ ,y △ ) is obtained, which is the temporary compensation value.
[0129] According to the obtained compensation value, a conversion matrix T is used to obtain the corresponding compensation value in the mechanical arm coordinates, the locking machine mechanical arm coordinate parameters are modified, and a hole position deviation detection is performed once.
[0130] At this time, there are three cases for processing:
[0131] The deviation is higher than the threshold: the above steps are re-executed.
[0132] Deviation is lower than the set threshold: hole position deviation calibration is completed;
[0133] Deviation is higher than the threshold, and the difference between the deviation and the last time the deviation detection is not large: hole position deviation calibration is completed, and the manufacturer's calibration process is considered to be re-performed.
[0134] The present application has good compensation effect for random errors caused by fatigue through the cyclic calibration and error determination process, ensures the accuracy of the system during operation, thereby reducing the locking failure in production and improving the overall production efficiency.
[0135] The error calibration method of the screw locking machine provided by the present application can detect and record errors in time through real-time image analysis of each locking process, accurately judge the alignment of the locking machine, enhance the self-adaptation and feedback capability of the system, and can give early warning before a large number of locking failures. Moreover, the technical scheme of the present application introduces deep learning technology combined with traditional gray center detection method, improves the sub-pixel level positioning accuracy of the hole center coordinates, and has more advantages in the robustness of feature extraction than the old scheme. In addition, the present application calibrates the height and hole offset, accurately identifies and corrects errors caused by mechanical fatigue and long-term operation, and optimizes the parameters of the mechanical arm. The present application detects and calibrates errors based on a vision system, reduces the dependence on external devices such as laser sensors, improves the stability and adaptability of the system, and avoids the risk of false detection caused by sensor failure.
[0136] As shown in Figure 7 , the present application provides an error calibration device for a screw locking machine, which comprises:
[0137] The acquisition module 701 is configured to acquire a screw hole image.
[0138] The detection module 702 is configured to input the screw hole image into a pre-constructed hole detection model to obtain a hole region of the screw hole.
[0139] The first calculation module 703 is configured to calculate the pixel area of the hole region, the hole inner diameter, and determine the hole center position.
[0140] The second calculation module 704 is configured to calculate the height error of the screw locking machine based on the pixel area and the hole inner diameter of the hole region, and calculate the hole position deviation of the screw locking machine based on the hole center position.
[0141] The calibration module 705 is configured to determine whether to perform error calibration based on the height error and the hole position error, and perform height error calibration and hole position error calibration when it is determined to perform error calibration.
[0142] The error calibration device of the screw locking machine provided in the application obtains a screw hole position image through an acquisition module 701; a detection module 702 inputs the screw hole position image into a pre-constructed hole detection model to obtain a hole region of the screw hole position; a first calculation module 703 calculates a pixel area of the hole region, a hole inner diameter, and a hole center position; a second calculation module 704 calculates a height error of the screw locking machine based on the pixel area and the hole inner diameter of the hole region, and calculates a hole position deviation of the screw locking machine based on the hole center position; and a calibration module 705 judges whether to perform error calibration based on the height error and the hole position error, and performs height error calibration and hole position error calibration when it is judged to perform error calibration.
[0143] It should be noted that the error calibration device of the screw locking machine in the embodiments of the application has similar principles to the error calibration method of the screw locking machine described above, and therefore the implementation process and principles and beneficial effects of the error calibration device of the screw locking machine can be seen from the description of the implementation process and principles and beneficial effects of the method described above, and the repeated parts will not be described again.
[0144] The embodiments of the application provide an electronic device, comprising:
[0145] at least one processor; and
[0146] a memory in communication connection with the at least one processor; wherein
[0147] The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the method described in any of the embodiments.
[0148] The embodiments of the application provide a non-transient computer readable storage medium storing computer instructions, characterized in that the computer instructions are used to enable a computer to execute the method described in any of the embodiments.
[0149] According to the embodiments of the present disclosure, the present disclosure further provides an electronic device and a readable storage medium.
[0150] Figure 8A schematic block diagram of an example electronic device 800 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0151] like Figure 8 As shown, device 800 includes a computing unit 801, which can perform various appropriate actions and processes based on a computer program stored in read-only memory (ROM) 802 or a computer program loaded from storage unit 808 into random access memory (RAM) 803. RAM 803 may also store various programs and data required for the operation of device 800. The computing unit 801, ROM 802, and RAM 803 are interconnected via bus 804. Input / output (I / O) interface 805 is also connected to bus 804.
[0152] Multiple components in device 800 are connected to I / O interface 805, including: input unit 806, such as keyboard, mouse, etc.; output unit 807, such as various types of monitors, speakers, etc.; storage unit 808, such as disk, optical disk, etc.; and communication unit 809, such as network card, modem, wireless transceiver, etc. Communication unit 809 allows device 800 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0153] The computing unit 801 can be various general and / or special purpose processing components with processing and computing capabilities. Some examples of the computing unit 801 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various specialized artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 801 performs various methods and processes described above, such as the error calibration method of a screwdriver. For example, in some embodiments, the error calibration method of a screwdriver can be implemented as a computer software program tangibly embodied in a machine-readable medium, such as the storage unit 808. In some embodiments, part or all of the computer program can be loaded and / or installed onto the device 800 via the ROM 802 and / or the communication unit 809. When the computer program is loaded onto the RAM 803 and executed by the computing unit 801, one or more steps of the error calibration method of a screwdriver described above can be performed. Alternatively, in other embodiments, the computing unit 801 can be configured to perform the error calibration method of a screwdriver by any other suitable means, such as by means of firmware.
[0154] Various implementations of the systems and techniques described above can be realized in digital electronic circuitry, integrated circuitry, a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on a chip (SOC), a complex programmable logic device (CPLD), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include implementation in one or more computer programs that are executable and / or interpretable on a programmable system including at least one programmable processor, which can be special or general purpose, coupled to receive data and instructions from, and to transmit data and instructions to, a storage system, at least one input device, and at least one output device.
[0155] Program code for carrying out methods of the present disclosure can be written in any combination of one or more programming languages. The program code can be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the program code, when executed by the processor or controller, produces a means for implementing the functions / acts specified in the flowcharts and / or block diagrams. The program code can be executed entirely on a machine, partially on a machine, partially on a machine as a stand-alone software package, partially on a machine and partially on a remote machine or entirely on a remote machine or server.
[0156] In the context of this disclosure, a machine-readable medium can be a tangible medium that contains or stores a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include but is not limited to an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of the machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0157] To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the computer. Other kinds of devices can be used to provide for interaction with a user as well; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form, including acoustic, speech, or tactile input.
[0158] The systems and techniques described here can be implemented in a computing system that includes a back end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front end component (e.g., a user computer having a graphical user interface or a Web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back end, middleware, or front end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network (LAN), a wide area network (WAN), and the Internet.
[0159] The computer system can include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, a server of a distributed system, or a server combined with a blockchain.
[0160] It should be understood that the various forms of flow shown above can be used to reorder, add, or delete steps. For example, the steps described in the present disclosure can be performed in parallel, in series, or in a different order, as long as the desired results of the technical solutions of the present disclosure can be achieved, which are not limited herein.
[0161] In addition, the terms "first", "second", are only for descriptive purposes and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the technical features indicated. Therefore, the features defined with "first", "second" can explicitly or implicitly include at least one of the features. In the description of the present disclosure, the meaning of "multiple" is two or more, unless otherwise specifically limited.
[0162] The above is only a specific embodiment of the present disclosure, but the protection scope of the present disclosure is not limited thereto, and any person skilled in the art can easily think of changes or replacements within the technical scope disclosed by the present disclosure, which should be covered within the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be subject to the protection scope of the claims.
Claims
1. A method of error calibration of a screwdriver, characterized by, The method comprises: acquiring a screw hole position image; inputting the screw hole position image into a pre-constructed hole detection model to obtain a hole region of the screw hole position; calculating a pixel area, a hole inner diameter of the hole region, and determining a hole center position; calculating a height error of the screw locking machine based on the pixel area and the hole inner diameter of the hole region, and calculating a hole position deviation of the screw locking machine based on the hole center position; before calculating the hole position deviation of the screw locking machine based on the hole center position, further comprising: acquiring initial data of the pixel area, initial data of the hole inner diameter, and initial data of the hole center coordinates collected by the screw locking machine; the calculating of the height error of the screw locking machine based on the pixel area and the hole inner diameter of the hole region, and the calculating of the hole position deviation of the screw locking machine based on the hole center position, comprises: calculating the difference between the pixel area of the hole region and the initial data of the pixel area to obtain a first difference value, and calculating the difference between the hole inner diameter of the hole region and the initial data of the hole inner diameter to obtain a second difference value; taking the first difference value and the second difference value as the height error of the screw locking machine; calculating the difference between the hole center position and the initial data of the hole center coordinates to obtain a third difference value, and taking the third difference value as the hole position deviation of the screw locking machine; judging whether to perform error calibration based on the height error and the hole position error, and performing height error calibration and hole position error calibration when it is judged to perform error calibration; the judging whether to perform error calibration based on the height error and the hole position error, comprises: comparing the first difference value and the second difference value with a first error threshold value respectively, when the first difference value and the second difference value are both greater than the first error threshold value, it is determined that the height error needs to be calibrated; otherwise, the height error does not need to be calibrated; comparing the third difference value with a second error threshold value, when the third difference value is greater than the second error threshold value, it is determined that the hole position deviation needs to be calibrated, otherwise, the hole position deviation does not need to be calibrated; the calibration of the height error, comprises: determining the deviation direction of the end height of the mechanical arm of the screw locking machine according to the first difference value and the second difference value; setting a first step value according to the second difference value; adjusting the mechanical arm parameters based on the first step value, and calculating an adjusted second difference value, and continuing to adjust the mechanical arm parameters based on the step value according to the second difference value, until the deviation direction of the second difference value changes, outputting a new second difference value; the mechanical arm parameters are used to represent the end height of the mechanical arm; if the new second difference value is less than the second error threshold value, the height calibration is completed; otherwise, setting a second step value according to the new second difference value; wherein the second step value is less than the first step value; adjusting the mechanical arm parameters based on the second step value, until the adjusted second difference value is less than the second error threshold value, determining a step value offset; the step value offset is the difference between the first step value and the second step value. The step value offset is converted into an offset value in the mechanical arm coordinates by using a pre-obtained conversion matrix; the offset value in the mechanical arm coordinates is the height error compensation value.
2. The error calibration method of the screw locking machine according to claim 1, wherein, An image of the screw hole position is obtained by using a camera; the camera is fixed at the end of the mechanical arm of the screw locking machine; wherein the end of the mechanical arm is also fixed with a light source for improving the brightness of the screw hole position.
3. The error calibration method of a screw locking machine according to claim 1, wherein The hole region of the screw hole position is obtained by: The screw hole position image is cut to obtain a cut hole position region; The cut hole position region is binarized to obtain a hole region.
4. The error calibration method of a screw locking machine according to claim 1, wherein The hole position deviation is calibrated by: The third difference value is clustered to obtain a cluster center point; the cluster center point is used as a compensation value; The compensation value is converted into a compensation value in the mechanical arm coordinates by using a pre-obtained conversion matrix; The mechanical arm parameters are adjusted according to the compensation value in the mechanical arm coordinates, and a new hole position deviation value is obtained according to the adjusted mechanical arm parameters; If the new hole position deviation value is higher than the second error threshold, the hole position deviation calibration is performed again; if the new hole position deviation value is lower than the second error threshold, the hole position deviation calibration is completed.
5. The error calibration method of a screw locking machine according to claim 4, wherein The hole position deviation is calibrated by: If the new hole position deviation value is higher than the second error threshold, and the difference between the new hole position deviation value and the last hole position deviation value is less than a difference threshold, the hole position deviation calibration is completed.
6. The error calibration method of a screw locking machine according to claim 3, wherein After the hole region of the screw hole position is obtained, the hole region is further subjected to super-resolution processing based on a bilinear difference method. The device comprises:
7. An error calibration device of a screw locking machine for performing the error calibration method of the screw locking machine according to any one of claims 1 to 6, characterized by, An acquisition module is configured to acquire an image of a screw hole position; A detection module is configured to input the image of the screw hole position into a pre-constructed hole detection model to obtain a hole region of the screw hole position; A first calculation module is configured to calculate a pixel area, a hole inner diameter of the hole region, and determine a hole center position; A second calculation module is configured to calculate a height error of the screw locking machine based on the pixel area and the hole inner diameter of the hole region, and calculate a hole position deviation of the screw locking machine based on the hole center position; A calibration module is configured to determine whether to perform error calibration based on the height error and the hole position error, and perform height error calibration and hole position error calibration when it is determined to perform error calibration.
Citation Information
Patent Citations
Locking positioning method, screw locking method, locking positioning device and screw machine
CN114619233A
Crankshaft end face flange plate thread detection device and method based on multi-view vision
CN115564718A