Assembly alignment method and assembly equipment
By taking images of the assembly from different angles and performing reverse compensation during the assembly process of pen terminal products, the problem of alignment errors caused by small assembly gaps is solved and high-precision assembly effects are achieved.
Patent Information
- Application Number
- CN202411110512.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-14
- Publication Date
- 2024-10-25
- Estimated Expiration
- 2044-08-14
AI Technical Summary
During the assembly process of pen terminal products, due to the small assembly gap between the pen barrel part and the mating part, it is difficult to meet high-precision alignment requirements, and it is difficult to effectively reduce alignment errors with existing technology.
By taking images of the assembly in the alignment state from different angles, the angle difference and direction distance difference are determined, and reverse compensation is performed based on these differences. This is repeated multiple times to improve the alignment accuracy. Using the controller in the assembly equipment, The camera and alignment adjustment mechanism perform this method.
It effectively reduces alignment errors, improves assembly accuracy, and meets high-precision assembly requirements.
Smart Images

Figure CN118644528B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of automation equipment, and in particular to an assembly alignment method and assembly equipment. Background Art
[0002] The structure of a pen terminal product includes a pen shaft and a mating part (such as a motor) installed at the end of the pen shaft. When assembling pen terminal products, related technologies require manual alignment through display magnification or a one-dimensional camera to ensure quality control. However, the assembly gap between the two assembly parts (the pen shaft and the mating part) is small, and there is still an alignment error, which makes it difficult to meet the assembly accuracy requirements. Summary of the invention
[0003] The present invention aims to solve at least one of the technical problems existing in the prior art. To this end, the present invention provides an assembly alignment method and an assembly device, which can reduce alignment errors and improve assembly accuracy.
[0004] On the one hand, an embodiment of the present invention provides an assembly alignment method, comprising:
[0005] A first photographing step: photographing a first image, wherein the first image is a side view image of the first assembly part and the second assembly part in an aligned state;
[0006] A first compensation step: based on the first image, determining and performing reverse compensation on the first assembly part and the second assembly part according to a first angle difference and a first direction distance difference, wherein the first angle difference is used to characterize an alignment error between the first assembly part and the second assembly part in a first angle direction, and the first direction distance difference is used to characterize an alignment error between the first assembly part and the second assembly part in a first straight line direction;
[0007] Repeating the first photographing step and the first compensating step multiple times until the number of repetitions exceeds a first preset value;
[0008] A second photographing step: photographing a second image, wherein the second image is a top view image of the first assembly part and the second assembly part in an aligned state;
[0009] A second compensation step: based on the second image, determining and reversely compensating the first assembly and the second assembly according to a second angle difference, a second direction distance difference, a third angle difference and a third direction distance difference, wherein the second angle difference is used to characterize an alignment error between the first assembly and the second assembly in a second angle direction, the second direction distance difference is used to characterize an alignment error between the first assembly and the second assembly in a second straight line direction, the third angle difference is used to characterize an alignment error between the first assembly and the second assembly in a third angle direction, and the third direction distance difference is used to characterize an alignment error between the first assembly and the second assembly in a third straight line direction;
[0010] The second shooting step and the second compensation step are repeated multiple times until the number of repetitions exceeds a second preset value.
[0011] According to some embodiments of the present invention, determining based on the first image and performing reverse compensation on the first assembly and the second assembly according to the first angle difference and the first direction distance difference includes:
[0012] Based on the first image, determine and perform reverse compensation on the first assembly and the second assembly according to a first angle difference;
[0013] Based on the first image, the first assembly and the second assembly are determined and reversely compensated according to a first direction distance difference.
[0014] According to some embodiments of the present invention, determining based on the first image and performing reverse compensation on the first assembly and the second assembly according to the first angle difference includes:
[0015] Determine a first edge line and a second edge line based on the first image, wherein the first edge line is a first side edge line of the first assembly part, and the second edge line is a first side edge line of the second assembly part;
[0016] determining the first angle difference according to the angle between the first sideline and the second sideline;
[0017] According to the first angle difference, reverse compensation is performed on the first assembly part and the second assembly part.
[0018] According to some embodiments of the present invention, determining based on the first image and performing reverse compensation on the first assembly and the second assembly according to the first direction distance difference includes:
[0019] Based on the first image, determining a third edge line, where the third edge line is an edge line of the second assembly part close to one end of the first assembly part;
[0020] Determine a first intersection point and a second intersection point according to the first sideline, the second sideline and the third sideline, wherein the first intersection point is the intersection point between the first sideline and the third sideline, and the second intersection point is the intersection point between the second sideline and the third sideline;
[0021] Determine the first direction distance difference according to the distance between the first intersection point and the second intersection point;
[0022] According to the first direction distance difference, reverse compensation is performed on the first assembly part and the second assembly part.
[0023] According to some embodiments of the present invention, determining based on the second image and performing reverse compensation on the first assembly and the second assembly according to the second angle difference, the second direction distance difference, the third angle difference and the third direction distance difference includes:
[0024] Based on the second image, determining a second angle difference and a third angle difference;
[0025] performing reverse compensation on the first assembly part and the second assembly part according to the second angle difference and the third angle difference;
[0026] Based on the second image, determining a second direction distance difference and a third direction distance difference;
[0027] Reverse compensation is performed on the first assembly and the second assembly according to the second direction distance difference and the third direction distance difference.
[0028] According to some embodiments of the present invention, determining the second angle difference and the third angle difference based on the second image includes:
[0029] Based on the second image, determining a fourth sideline, a fifth sideline, a sixth sideline and a seventh sideline, wherein the fourth sideline and the fifth sideline are two opposite sidelines of the first assembly, and the sixth sideline and the seventh sideline are two opposite sidelines of the second assembly;
[0030] Determine a first center line according to the fourth side line and the fifth side line, and determine a second center line according to the sixth side line and the seventh side line;
[0031] The second angle difference is determined according to the included angle between the first center line and the second center line.
[0032] According to some embodiments of the present invention, determining the second direction distance difference and the third direction distance difference based on the second image includes:
[0033] Based on the second image, determining an eighth edge line, where the eighth edge line is an edge line of the second assembly part close to one end of the first assembly part;
[0034] Determine a third intersection and a fourth intersection according to the first center line, the second center line and the eighth sideline, wherein the third intersection is the intersection between the first center line and the eighth sideline, and the fourth intersection is the intersection between the second center line and the eighth sideline;
[0035] The second direction distance difference is determined according to the distance between the third intersection point and the fourth intersection point.
[0036] According to some embodiments of the present invention, determining the second angle difference and the third angle difference based on the second image includes:
[0037] Based on the second image, determining a third center line and a fourth center line, the third center line being the center line of the marking feature on the first assembly, and the fourth center line being the center line of the marking feature on the second assembly;
[0038] The third angular difference is determined according to a distance between the third center line and the fourth center line.
[0039] According to some embodiments of the present invention, determining the second direction distance difference and the third direction distance difference based on the second image includes:
[0040] The third direction distance difference is determined on the second image based on a caliper tool.
[0041] On the other hand, an embodiment of the present invention provides an assembly device, including a controller and a first camera, a second camera and an alignment adjustment mechanism electrically connected to the controller, wherein the controller is used to execute the above-mentioned assembly alignment method.
[0042] The embodiments of the present invention have at least the following beneficial effects:
[0043] By taking images of the first assembly and the second assembly in the alignment state from different angles, the corresponding angle difference and directional distance difference are determined based on the images, and reverse compensation is performed based on the angle difference and directional distance difference. This is repeated multiple times to recheck the compensation, which is beneficial to reducing alignment errors and improving assembly accuracy.
[0044] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] The above and / or additional aspects and advantages of the present invention will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which:
[0046] Figure 1 It is a structural schematic diagram of an assembly device according to an embodiment of the present invention;
[0047] Figure 2 A flowchart of the steps of the assembly alignment method according to an embodiment of the present invention;
[0048] Figure 3 is a schematic diagram of a first image according to an embodiment of the present invention;
[0049] Figure 4 is one of the schematic diagrams of the second image according to the embodiment of the present invention;
[0050] Figure 5 This is a second schematic diagram of the second image according to an embodiment of the present invention.
[0051] Reference numerals:
[0052] A first assembly part 10 , a second assembly part 20 , a first camera 100 , a second camera 200 , an alignment adjustment mechanism 300 , a first placement position 301 , and a second placement position 302 . DETAILED DESCRIPTION
[0053] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and cannot be understood as limiting the present invention.
[0054] In the description of the present invention, it should be understood that descriptions involving orientations, such as up, down, front, back, left, right, etc., and orientations or positional relationships indicated are based on the orientations or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be understood as a limitation on the present invention.
[0055] In the description of the present invention, "several" means one or more, "multiple" means more than two, greater than, less than, and exceeding are understood as not including the number itself, and "above", "below", and "within" are understood as including the number itself. If there is a description of "first", "second", etc., it is only used for the purpose of distinguishing technical features, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features or implicitly indicating the order of the indicated technical features.
[0056] In the description of the present invention, unless otherwise clearly defined, words such as “setting”, “installation” and “connection” should be understood in a broad sense, and technicians in the relevant technical field can reasonably determine the specific meanings of the above words in the present invention in combination with the specific content of the technical solution.
[0057] Pen terminal products, such as capacitive pens, include a pen shaft (i.e., the first assembly part 10 hereinafter) and a matching part (such as a motor, i.e., the second assembly part 20 hereinafter). The matching part needs to be assembled at the end of the pen shaft, but because the connection position between the pen shaft and the matching part has a special-shaped structure, manual alignment is required during the assembly process through display magnification or a one-dimensional camera to ensure the assembly quality. However, the assembly gap between the pen shaft and the matching part is small, and the assembly accuracy requirement is high (e.g., ±0.02mm). Even if alignment is performed by means of magnification or a one-dimensional camera, there is still an alignment error, and it is difficult to meet the assembly accuracy requirement. To this end, the present embodiment provides an assembly alignment method that can reduce the alignment error and improve the assembly accuracy.
[0058] Prior to this, the hardware environment (assembly equipment) of this assembly alignment method needs to be explained:
[0059] Please refer to Figure 1 , an assembly device, comprising a controller and a first camera 100, a second camera 200 and an alignment adjustment mechanism 300 electrically connected to the controller, wherein the controller is used to perform the following assembly alignment method. The alignment adjustment mechanism 300 is provided with a first placement position 301 and a second placement position 302 arranged adjacently, wherein the first placement position 301 is used to place one of the first assembly part 10 and the second assembly part 20, and the second placement position 302 is used to place the other of the second assembly part 20, so that the to-be-assembled parts of the first assembly part 10 and the second assembly part 20 are arranged facing each other, at which time the first assembly part 10 and the second assembly part 20 enter an alignment state, the first camera 100 is arranged horizontally (it can be understood that the axis of the first camera 100 extends in the horizontal plane), the second camera 200 is arranged longitudinally (it can be understood that the axis of the second camera 200 extends in the longitudinal plane), and the field of view of the first camera 100 and the second camera 200 both cover at least the to-be-assembled parts of the first assembly part 10 and the second assembly part 20. In some application examples, the alignment adjustment mechanism 300 adopts a six-axis adjustment mechanism, which can realize the adjustment of at least one of the first assembly 10 and the second assembly 20 in different dimensions (such as X, Y, Z, U, V, W). For ease of understanding, a rectangular coordinate system is established in a three-dimensional space, and the X-axis, Y-axis and Z-axis are used to indicate three different directions. The angle of rotation around the X-axis is the V angle, the angle of rotation around the Y-axis is the U angle, and the angle of rotation around the Z-axis is the W angle.
[0060] Please refer to Figure 2This embodiment discloses an assembly alignment method, including steps S100 to S600. It should be noted that the steps in this embodiment are numbered only for the convenience of review and understanding. The contents of each step are described in detail below:
[0061] First photographing step: S100, photographing a first image, the first image being a side view image of the first assembly part 10 and the second assembly part 20 in an aligned state;
[0062] For example, please refer to Figure 1 , the first assembly 10 is placed in the first placement position 301, and the second assembly 20 is placed in the second placement position 302, wherein the placement method can be manual placement or can be placed by an automated structure such as a manipulator or a clamp. In some application examples, after the placement is completed, the ends to be assembled of the first assembly 10 and the second assembly 20 are arranged facing each other, and the first assembly 10 and the second assembly 20 enter the alignment state. In other application examples, after the placement is completed, under the drive of the alignment adjustment mechanism 300, the first assembly 10 and the second assembly 20 are close to each other or pre-aligned (i.e., preliminary positioning is performed under the control of a preset program), thereby entering the alignment state. At this time, the first image is captured by the first camera 100. Since the first camera 100 is arranged horizontally and is located on one side of the first assembly 10 and the second assembly 20, the first image captured is a side view image and the first image at least includes the parts to be assembled of the first assembly 10 and the second assembly 20.
[0063] First compensation step: S200, based on the first image, determining and performing reverse compensation on the first assembly 10 and the second assembly 20 according to a first angle difference and a first direction distance difference, wherein the first angle difference is used to characterize an alignment error between the first assembly 10 and the second assembly 20 in a first angle direction, and the first direction distance difference is used to characterize an alignment error between the first assembly 10 and the second assembly 20 in a first straight line direction;
[0064] For example, since the first image is a side view image, based on the image analysis technology, it can be determined whether there is deflection (i.e., whether there is an angle difference) or misalignment (i.e., whether there is a direction distance difference) between the first assembly 10 and the second assembly 20. Figure 3 , taking the first camera 100 arranged on the Y axis as an example, when the first assembly 10 and the second assembly 20 are deflected, it can be understood that one of the first assembly 10 and the second assembly 20 is used as a reference datum, and the other of the first assembly 10 and the second assembly 20 rotates around the reference datum by a certain angle (such as Figure 3As shown by the mark R1 in the figure), it can also be understood that the first assembly 10 and the second assembly 20 are rotated around the Y axis by a certain angle. Therefore, the deflection angle between the first assembly 10 and the second assembly 20 is an angle of U. If the first camera 100 is arranged on the X-axis, the deflection angle between the first assembly 10 and the second assembly 20 is an angle of V. When the first assembly 10 and the second assembly 20 are misaligned, what is presented in the first image is the distance difference in the Z direction (such as the distance between point K1 and point K2), that is, the first direction distance difference is the Z direction distance difference. It should be noted that in actual applications, the deflection angle or directional distance difference between the first assembly 10 and the second assembly 20 is relatively small. In order to facilitate illustration and understanding of this embodiment, the deflection angle and directional distance difference shown in the figure are displayed in a more obvious manner.
[0065] S300, repeating the first shooting step and the first compensation step multiple times until the number of repetitions exceeds a first preset value;
[0066] Exemplarily, in the related art, the technology based on image alignment usually adopts a single recognition method to achieve alignment. However, the alignment adjustment mechanism 300 used to drive the first assembly 10 and the second assembly 20 itself has a certain repeatability error. For example, when the deflection angle is 1°, theoretically, the first assembly 10 and the second assembly 20 can be reversely compensated by 1° to achieve the perfect alignment of the first assembly 10 and the second assembly 20. But in fact, the alignment adjustment mechanism 300 uses a motor or a cylinder as a power source, and the motor or the cylinder itself has an inevitable repeatability error. In the reverse compensation process, there may be situations such as a compensation angle of 1.05° or 0.95 degrees. This situation can meet the production requirements for assembly products with low precision requirements, but cannot meet the assembly requirements of assembly products with high precision requirements. For this reason, it is necessary to improve the alignment accuracy by repeating the first shooting step and the first compensation step multiple times. For example, in order to take into account both efficiency and alignment accuracy, the first preset value is set to 5 times, that is, when the number of repetitions is ≤5, the first shooting step and the first compensation step are repeated. It should be noted that, in actual applications, the angle difference or directional distance difference between the first assembly 10 and the second assembly 20 may be a composite deviation in multiple directions. Based on the first image, this embodiment first compensates (corrects) the first angle difference and the first directional distance difference between the first assembly 10 and the second assembly 20 to make the deviation of the first assembly 10 and the second assembly 20 meet the requirements in the side-view orientation, and then compensates from different orientations according to the second image below, thereby decomposing the composite deviation into deviations in different orientations for independent compensation, which helps to reduce the difficulty of compensation and improve the efficiency and reliability of alignment.
[0067] Second photographing step: S400, photographing a second image, where the second image is a top view image of the first assembly part 10 and the second assembly part 20 in an aligned state;
[0068] For example, please refer to Figure 1 , since the second camera 200 is arranged in a longitudinal direction, the second image captured by the second camera 200 is a top view image, and the second image at least includes the to-be-assembled parts of the first assembly 10 and the second assembly 20. It is worth mentioning that in some application examples, before capturing the second image, the first assembly 10 and the second assembly 20 are aligned and corrected from a side view through steps S100 to S300, and at this time, the first assembly 10 and the second assembly 20 are in an aligned state; while in other application examples, step S400 can be used as a starting step, and at this time, the way in which the first assembly 10 and the second assembly 20 enter the aligned state can refer to the above description of step S100, which will not be repeated here.
[0069] Second compensation step: S500, based on the second image, determine and perform reverse compensation on the first assembly 10 and the second assembly 20 according to the second angle difference, the second direction distance difference, the third angle difference and the third direction distance difference, the second angle difference is used to characterize the alignment error of the first assembly 10 and the second assembly 20 in the second angle direction, the second direction distance difference is used to characterize the alignment error of the first assembly 10 and the second assembly 20 in the second straight line direction, the third angle difference is used to characterize the alignment error of the first assembly 10 and the second assembly 20 in the third angle direction, and the third direction distance difference is used to characterize the alignment error of the first assembly 10 and the second assembly 20 in the third straight line direction;
[0070] Exemplarily, the identification and reverse compensation method of the angle difference and the direction distance difference based on the second image is the same as the principle based on the first image above, wherein, please refer to Figure 4 The second angle difference is the deflection angle of the first assembly 10 and the second assembly 20 in the top view image (eg Figure 4 The second direction distance difference is the distance difference in the Y direction (as shown in the mark R2 in the figure), which is the W angle difference; the second direction distance difference is the distance difference in the Y direction (as shown in the figure Figure 4 The distance between the midpoint K3 and the point K4); the third angle difference is the V angle difference, and the third direction distance difference is the distance difference in the X direction. Based on the image analysis technology, the second image is recognized, and the second angle difference, the second direction distance difference, the third angle difference and the third direction distance difference can be determined respectively, and reverse compensation can be performed respectively, so that the alignment error of the first assembly 10 and the second assembly 20 can be compensated from different directions to reduce the alignment error. In order to meet the high-precision alignment requirements, it is necessary to repeat the second shooting step and the second compensation step multiple times. Among them, the second preset value below is set to 5 times.
[0071] S600, repeating the second shooting step and the second compensation step multiple times until the number of repetitions exceeds a second preset value.
[0072] By taking images of the first assembly 10 and the second assembly 20 in the alignment state from different angles, the corresponding angle difference and directional distance difference are determined according to the images, and reverse compensation is performed based on the angle difference and directional distance difference. This is repeated multiple times to recheck the compensation, which is beneficial to reduce alignment errors and improve assembly accuracy.
[0073] Step S200, based on the first image, determining and performing reverse compensation on the first assembly 10 and the second assembly 20 according to the first angle difference and the first direction distance difference, comprises:
[0074] S210, based on the first image, determining and performing reverse compensation on the first assembly 10 and the second assembly 20 according to the first angle difference;
[0075] S220 , based on the first image, determine and perform reverse compensation on the first assembly 10 and the second assembly 20 according to the first direction distance difference.
[0076] Exemplarily, as described above, the first angle difference and the first direction distance difference can be determined based on the first image. In order to improve the efficiency and reliability of the alignment error compensation, the present embodiment first compensates for the angle difference, and then compensates for the direction distance difference. In practical applications, it has been observed that in the reverse compensation process of the angle difference, for the same reverse compensation angle difference, when the rotation centers of the first assembly 10 and the second assembly 20 are different, the alignment assembly parts of the first assembly 10 and the second assembly 20 may have different degrees of distance difference in the first direction. In mass production, since it is difficult to ensure that the positions of the first assembly 10 and the second assembly 20 are 100% the same each time during the placement process, that is, the rotation centers of the reverse compensation are the same, the present embodiment first determines and reversely compensates according to the first angle difference, and then determines and reversely compensates according to the first direction distance difference. It is worth noting that the first angle difference and the first directional distance difference are both based on the same first image. Although after the reverse compensation of the first angle difference, a new directional distance difference is introduced in the reverse compensation process of the first angle difference, resulting in the reverse compensation of the first directional distance difference failing to achieve the expected effect, after repeated compensation in step S300, the directional distance difference introduced in the reverse compensation process of the first angle difference can be processed together. In this way, the first angle difference is first determined and compensated, and then the first directional distance difference is determined and compensated, so that the first directional distance difference can become stable and controllable, which is conducive to improving the reliability of alignment. It is worth mentioning that in most cases, the compensation of the first angle difference can basically meet the alignment accuracy requirements after 2 to 3 repetitions, and setting the number of repetitions to 5 times can also be compatible with some exceptions, thereby improving the redundancy of accurate alignment.
[0077] Step S210, based on the first image, determining and performing reverse compensation on the first assembly 10 and the second assembly 20 according to the first angle difference, comprises:
[0078] S211, determining a first sideline and a second sideline based on the first image, the first sideline being a first side line of the first assembly 10, and the second sideline being a first side line of the second assembly 20;
[0079] S212, determining a first angle difference according to an angle between the first sideline and the second sideline;
[0080] S213 . Perform reverse compensation on the first assembly part 10 and the second assembly part 20 according to the first angle difference.
[0081] For example, edge detection technology is a common technology in image processing. After preprocessing the original image such as binarization and noise reduction, the edge of the object in the image is captured. For ease of use, the related technology designs edge detection into a functional integrated module, such as an integrated module in the visual control library. By calling the module, the first image can be recognized to identify the specified edge features, such as the first edge (such as Figure 3 As shown by L1 in the middle), the second sideline (as shown Figure 3 L2 in the middle) and the third sideline (as Figure 3 It is worth mentioning that please refer to Figure 1 , the first assembly 10 and the second assembly 20 are placed in the first placement position 301 and the second placement position 302 respectively, therefore, in the side view image, the second side (the side in contact with the placement position) of the first assembly 10 and the second assembly 20 is blocked, which is not conducive to the recognition of the edge line. Therefore, in this embodiment, by performing unilateral edge line recognition on the first assembly 10 and the second assembly 20, and using the recognized first edge line and the second edge line as the axis representatives of the first assembly 10 and the second assembly 20, the angle between the first edge line and the second edge line is determined as the first angle difference, and then reverse compensation is performed.
[0082] Step S220, based on the first image, determining and performing reverse compensation on the first assembly 10 and the second assembly 20 according to the first direction distance difference, comprising:
[0083] S221, determining a third sideline based on the first image, where the third sideline is a sideline of the second assembly part 20 close to one end of the first assembly part 10;
[0084] S222, determining a first intersection point and a second intersection point according to the first sideline, the second sideline and the third sideline, wherein the first intersection point is an intersection point between the first sideline and the third sideline, and the second intersection point is an intersection point between the second sideline and the third sideline;
[0085] S223, determining a first direction distance difference according to the distance between the first intersection point and the second intersection point;
[0086] S224 , performing reverse compensation on the first assembly 10 and the second assembly 20 according to the first direction distance difference.
[0087] For example, in theory, when the first sideline and the second sideline are parallel to each other (i.e., there is no first angle difference), the distance between the first sideline and the second sideline is the first direction distance difference, but in reality, the angle difference will cause the first sideline and the second sideline to be non-parallel, and the first sideline and the second sideline obtained based on the image recognition technology are not ideal straight lines. In order to determine the distance between the first sideline and the second sideline, a suitable reference datum needs to be determined. As mentioned above, the angle difference causes the first sideline and the second sideline to be non-parallel, and as the sidelines extend, the distance between the first sideline and the second sideline may be magnified, so it is not suitable to use the edge or coordinate axis of the first image as a reference datum. After analysis, it is found that in the alignment state, there is a small gap between the first assembly part 10 and the second assembly part 20. The small gap can be used to identify the third sideline at the end of the second assembly part 20 close to the first assembly part 10. With the third sideline as a reference, the first sideline and the second sideline are respectively extended to intersect with the third sideline, and the first intersection and the second intersection can be formed on the third sideline. The distance between the first intersection and the second intersection is determined as the first direction distance difference, and the misalignment distance of the first assembly part 10 and the second assembly part 20 in the first direction (Z direction) can be reasonably determined, and reverse compensation can be performed accordingly. It is worth explaining again that due to the possible angular deflection between the first assembly part 10 and the second assembly part 20, the third sideline may not be parallel to the Z axis, resulting in the first direction distance difference determined by the first intersection and the second intersection being not the actual distance difference, but after repeated compensation, the third sideline can be made parallel or almost parallel (the angle difference is within an acceptable range) to the Z axis, so that the first direction distance difference determined by the first intersection and the second intersection is equal to or almost equal to the actual distance difference.
[0088] Step S500, based on the second image, determining and performing reverse compensation on the first assembly 10 and the second assembly 20 according to the second angle difference, the second direction distance difference, the third angle difference and the third direction distance difference, including:
[0089] S510, determining a second angle difference and a third angle difference based on the second image;
[0090] S520, performing reverse compensation on the first assembly part 10 and the second assembly part 20 according to the second angle difference and the third angle difference;
[0091] S530, determining a second direction distance difference and a third direction distance difference based on the second image;
[0092] S540 , performing reverse compensation on the first assembly 10 and the second assembly 20 according to the distance difference in the second direction and the distance difference in the third direction.
[0093] Illustratively, similar to the compensation principle of the first angle difference and the first direction distance difference, this embodiment first performs reverse compensation on the first assembly 10 and the second assembly 20 according to the second angle difference and the third angle difference, thereby correcting the angular deflection between the first assembly 10 and the second assembly 20, and then correcting the distance deviation between the second direction and the third direction, which is beneficial to improving the efficiency and accuracy of alignment.
[0094] Step S510, determining a second angle difference and a third angle difference based on the second image, includes:
[0095] S511, based on the second image, determining a fourth sideline, a fifth sideline, a sixth sideline and a seventh sideline, wherein the fourth sideline and the fifth sideline are two opposite sidelines of the first assembly 10, and the sixth sideline and the seventh sideline are two opposite sidelines of the second assembly 20;
[0096] S512, determining a first center line according to the fourth sideline and the fifth sideline, and determining a second center line according to the sixth sideline and the seventh sideline;
[0097] S513: Determine a second angle difference according to the angle between the first center line and the second center line.
[0098] For example, as described above, the edge line obtained based on the image recognition technology is not an ideal straight line. Therefore, the angle difference determined by using the different side edge lines of the first assembly part 10 and the second assembly part 20 may be different. For example, using the fourth edge line (such as Figure 4 L4) and the sixth sideline (as shown in Figure 4 The angle difference obtained by using the fifth side line (as shown in the mark L6) is determined Figure 4 L5) and the seventh sideline (as shown in Figure 4 In order to improve the accuracy of the angle difference, the error caused by the single-side line is reduced by synthesizing the center line by the two side lines, and then using the center line to determine the angle difference, thereby improving the accuracy of the angle difference. For example, the first center line is determined according to the fourth side line and the fifth side line, and the second center line is determined according to the sixth side line and the seventh side line, and the angle between the first center line and the second center line is determined as the second angle difference.
[0099] Step S540, determining the second direction distance difference and the third direction distance difference based on the second image, includes:
[0100] S541, determining an eighth edge line based on the second image, where the eighth edge line is an edge line of the second assembly part 20 close to one end of the first assembly part 10;
[0101] S542, determining a third intersection point and a fourth intersection point according to the first center line, the second center line, and the eighth sideline, where the third intersection point is the intersection point between the first center line and the eighth sideline, and the fourth intersection point is the intersection point between the second center line and the eighth sideline;
[0102] S543: Determine a second direction distance difference according to the distance between the third intersection point and the fourth intersection point.
[0103] Exemplarily, the eighth side line (such as Figure 4 The function of the first center line (as shown by L8 in the figure) is similar to that of the third side line, and the first center line (as shown by L8 in the figure) is similar to that of the third side line. Figure 4 The second center line (as shown in the mark C1) Figure 4 The first center line and the second center line are respectively extended to intersect with the eighth side line, thereby forming a third intersection point and a fourth intersection point on the eighth side line, and the distance between the third intersection point and the fourth intersection point is determined as the second direction distance difference.
[0104] Step S510, determining a second angle difference and a third angle difference based on the second image, includes:
[0105] S514, based on the second image, determining a third center line and a fourth center line, the third center line being the center line of the marking feature on the first assembly 10, and the fourth center line being the center line of the marking feature on the second assembly 20;
[0106] S515. Determine a third angle difference according to the distance between the third center line and the fourth center line.
[0107] Exemplarily, the inherent features of the first assembly part 10 and the second assembly part 20 are selected as the marking features. For example, the first assembly part 10 is provided with a U-shaped groove, and the second assembly part 20 is provided with a rectangular groove. The U-shaped groove and the rectangular groove are selected as the marking features respectively, and the two relative side lines of the U-shaped groove can be determined, and then the third center line (such as Figure 5 Similarly, the fourth center line can be determined based on the two opposite sides of the rectangular groove (as shown in the mark C3). Figure 5 As shown by the mark C4 in the figure), the distance between the third center line and the fourth center line can be determined. For example, the fifth intersection point and the sixth intersection point can be determined based on the third center line, the fourth center line and the eighth side line; the distance between the third center line and the fourth center line can be determined based on the distance between the fifth intersection point and the sixth intersection point (as shown in the figure). Figure 5In an ideal state, the axes of the first assembly 10 and the second assembly 20 are parallel to the X axis. After the second angle difference is compensated, it can be considered that the angle difference between the first assembly 10 and the second assembly 20 is only the third angle difference. The radius size of the first assembly 10 and the second assembly 20 is known. In practical applications, the angle difference between the first assembly 10 and the second assembly 20 is very small. The distance between the third center line and the fourth center line can be approximated as the arc distance of the first assembly 10 and the second assembly 20 deflected around the axis. In this way, the third angle difference can be determined according to the distance between the third center line and the fourth center line and the radius size of the second assembly 20.
[0108] Step S540, determining the second direction distance difference and the third direction distance difference based on the second image, includes:
[0109] S544: Determine a distance difference in a third direction on the second image based on a caliper tool.
[0110] Exemplarily, the caliper tool is an integrated module in the image processing technology. As described above, there is a small gap between the first assembly 10 and the second assembly 20. The small gap appears as a white gap in the second image. The caliper tool can identify the white gap and determine the width of the white gap (e.g., Figure 5 As shown by mark D2 in the figure), the distance difference between the first assembly part 10 and the second assembly part 20, that is, the distance difference in the third direction, can be quickly identified.
[0111] The embodiments of the present invention are described in detail above with reference to the accompanying drawings, but the present invention is not limited to the above embodiments, and various changes can be made within the knowledge scope of ordinary technicians in the relevant technical field without departing from the purpose of the present invention.
Claims
1. An assembly alignment method, characterized in that: include: A first photographing step: photographing a first image, wherein the first image is a side view image of the first assembly part and the second assembly part in an aligned state; First compensation step: Determine a first edge line and a second edge line based on the first image, wherein the first edge line is a first side edge line of the first assembly part, and the second edge line is a first side edge line of the second assembly part; Determine a first angle difference according to an angle between the first sideline and the second sideline, wherein the first angle difference is used to characterize an alignment error between the first assembly part and the second assembly part in a first angle direction; According to the first angle difference, reverse compensation is performed on the first assembly part and the second assembly part; Based on the first image, determining a third edge line, where the third edge line is an edge line of the second assembly part close to one end of the first assembly part; Determine a first intersection point and a second intersection point according to the first sideline, the second sideline and the third sideline, wherein the first intersection point is the intersection point between the first sideline and the third sideline, and the second intersection point is the intersection point between the second sideline and the third sideline; Determine a first direction distance difference according to the distance between the first intersection point and the second intersection point, wherein the first direction distance difference is used to characterize the alignment error between the first assembly part and the second assembly part in the first straight line direction; According to the first direction distance difference, reverse compensation is performed on the first assembly and the second assembly; Repeating the first photographing step and the first compensating step multiple times until the number of repetitions exceeds a first preset value; A second photographing step: photographing a second image, wherein the second image is a top view image of the first assembly part and the second assembly part in an aligned state; Second compensation step: Based on the second image, determining a fourth sideline, a fifth sideline, a sixth sideline and a seventh sideline, wherein the fourth sideline and the fifth sideline are two opposite sidelines of the first assembly, and the sixth sideline and the seventh sideline are two opposite sidelines of the second assembly; Determine a first center line according to the fourth side line and the fifth side line, and determine a second center line according to the sixth side line and the seventh side line; Determine a second angle difference according to the angle between the first center line and the second center line, wherein the second angle difference is used to characterize an alignment error between the first assembly part and the second assembly part in a second angle direction; According to the second angle difference, reverse compensation is performed on the first assembly part and the second assembly part; Based on the second image, determining an eighth edge line, where the eighth edge line is an edge line of the second assembly part close to one end of the first assembly part; Determine a third intersection and a fourth intersection according to the first center line, the second center line and the eighth sideline, wherein the third intersection is the intersection between the first center line and the eighth sideline, and the fourth intersection is the intersection between the second center line and the eighth sideline; Determine a distance difference in a second direction according to a distance between the third intersection point and the fourth intersection point, wherein the distance difference in the second direction is used to characterize an alignment error between the first assembly part and the second assembly part in a second straight line direction; According to the distance difference in the second direction, reverse compensation is performed on the first assembly and the second assembly; Based on the second image, determining a third center line and a fourth center line, the third center line being the center line of the marking feature on the first assembly, and the fourth center line being the center line of the marking feature on the second assembly; Determining a fifth intersection point and a sixth intersection point according to the third center line, the fourth center line and the eighth side line; Determining the distance between the third center line and the fourth center line according to the distance between the fifth intersection point and the sixth intersection point; Approximating the distance between the third center line and the fourth center line as the arc distance of the first assembly part and the second assembly part deflected around the axis, so as to determine a third angle difference according to the distance between the third center line and the fourth center line and the radius size of the second assembly part, wherein the third angle difference is used to characterize the alignment error between the first assembly part and the second assembly part in a third angle direction; According to the third angle difference, reverse compensation is performed on the first assembly part and the second assembly part; Based on the second image, determining a distance difference in a third direction, wherein the distance difference in the third direction is used to characterize an alignment error between the first assembly part and the second assembly part in a third straight line direction, that is, a small gap D2 between the first assembly part and the second assembly part; According to the distance difference in the third direction, reverse compensation is performed on the first assembly and the second assembly; The second shooting step and the second compensation step are repeated multiple times until the number of repetitions exceeds a second preset value.
2. The assembly alignment method according to claim 1, characterized in that: The determining the distance difference in the third direction based on the second image includes: The caliper tool based on image processing technology determines the distance difference in the third direction on the second image.
3. An assembly device, characterized in that: It comprises a controller and a first camera, a second camera and an alignment adjustment mechanism electrically connected to the controller, wherein the controller is used to execute the assembly alignment method as described in any one of claims 1 or 2.
