Electronic component insertion method and device based on machine vision

By using machine vision technology to determine the offset of electronic components and perform correction position calculations, the problem of low insertion accuracy of special-shaped electronic components is solved, and fast and accurate automated insertion is achieved.

CN119110508BActive Publication Date: 2025-09-30GREE ELECTRIC APPLIANCE INC OF ZHUHAI
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411318763.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-20
Publication Date
2025-09-30
Estimated Expiration
2044-09-20

AI Technical Summary

Technical Problem

In the prior art, the insertion accuracy of special-shaped electronic components is low, and it is difficult to adapt to individual differences, resulting in low efficiency of manual insertion and difficulty in achieving fast and accurate insertion by automated equipment.

Method used

Adopting the insertion method based on machine vision, the pin camera and hole position camera collect images, determine the offset between the current positioning and the standard positioning, perform correction position calculation and compensation, realize pin secondary positioning and hole position follow-up positioning, and ensure the accurate insertion of electronic components.

Benefits of technology

It improves the insertion accuracy and reliability of special-shaped electronic components, realizes fast and accurate automatic insertion, and reduces manual intervention and errors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119110508B_ABST
    Figure CN119110508B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and device for inserting electronic components based on machine vision. The method includes: determining a first position offset between the current positioning position of the electronic component and the standard positioning position; after determining the first correction position of the robot according to the first position offset, controlling the robot to grab the electronic component and move it to the first correction position; after determining the second robot position according to the first correction position and the second position offset, determining a third position offset between the current insertion position of the insertion object and the standard insertion position; after obtaining the second correction position of the robot according to the third position offset and the second robot position, controlling the robot to grab the electronic component and move it to the second correction position to insert the electronic component into the insertion object. The present invention solves the technical problem in the related art that the method of inserting electronic components is easily affected by the individual differences of electrical components, resulting in low insertion accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of automated production technology, and in particular to a method and device for inserting electronic components based on machine vision. Background Art

[0002] With the rapid development of electronic products, the demand for the insertion of various electronic components is also increasing. However, most of the current automated insertion equipment can only insert some standard electronic components, and the insertion of special-shaped electronic components basically relies on manual labor.

[0003] However, traditional manual insertion has problems such as long operation time, high labor intensity, and high error rate.

[0004] In addition, some manufacturers have introduced special-shaped insertion machines, but due to the low consistency of incoming special-shaped electronic components and large errors in pin spacing, it is difficult for special-shaped insertion machines to achieve fast and accurate insertion operations.

[0005] To address the above-mentioned problems, no effective solutions have been proposed so far. Summary of the Invention

[0006] The embodiments of the present invention provide a method and device for inserting electronic components based on machine vision, so as to at least solve the technical problem in the related art that the insertion method of electronic components is easily affected by the individual differences of electrical components and has low insertion accuracy.

[0007] According to one aspect of an embodiment of the present invention, a method for inserting electronic components based on machine vision is provided, comprising: determining a first position offset between a current positioning position of an electronic component and a standard positioning position, wherein the current positioning position is the current position of the electronic component, the standard positioning position is the position of a teaching point of a first robot position, the first robot position is the position of the robot when the clarity of the pin image of the electronic component taken by a pin camera reaches a clarity threshold, and the robot is used to perform an insertion operation on the electronic component; after determining a first correction position of the robot according to the first position offset, controlling the robot to grab the electronic component and move it to The first correction position; after determining the second robot position according to the first correction position and the second position offset, determining the third position offset between the current insertion position of the insertion object and the standard insertion position according to the second robot position, wherein the second position offset is the offset between the standard positioning position and the standard insertion position, and the standard insertion position is the position of the robot when the electronic component is inserted into the insertion object; after obtaining the second correction position of the robot according to the third position offset and the second robot position, controlling the robot to grab the electronic component and move it to the second correction position to insert the electronic component into the insertion object.

[0008] Optionally, determining a first position offset between the current positioning position of the electronic component and the standard positioning position includes: when determining that the robot grabs the electronic component and moves to the first robot position, triggering the pin camera to capture the pin image of the electronic component; determining the first position offset between the current positioning position of the electronic component and the standard positioning position based on the pin image.

[0009] Optionally, determining the first position offset between the current positioning position and the standard positioning position of the electronic component based on the pin image includes: determining the center position one of the pin of the electronic component based on the pin image; determining the first position offset between the current positioning position and the standard positioning position based on the deviation between the center position one and the center position two, wherein the center position two is the center position of the pin of the electronic component determined based on the standard pin image, and the standard pin image is the pin image of the electronic component captured by the pin image when the robot grabs the electronic component and moves it to the standard positioning position.

[0010] Optionally, determining the first corrected position of the robot according to the first position offset includes: using the first position offset to perform reverse compensation on the standard positioning position to obtain the first corrected position.

[0011] Optionally, the third position offset between the current insertion position and the standard insertion position of the insertion object is determined according to the second robot position, including: after determining that the robot grabs the electronic component and moves to the second robot position, triggering the hole position camera to capture the hole position image of the insertion object; determining the third position offset between the current insertion position and the standard insertion position according to the deviation between the center position three and the center position four of the hole position image, wherein the center position four is the center position of the insertion hole of the insertion object determined based on the standard hole position image, and the standard hole position image is the hole position image of the insertion object captured by the hole position camera when the insertion object is in the standard insertion position.

[0012] Optionally, obtaining the second corrected position of the robot according to the third position offset and the second robot position includes: performing forward compensation on the second robot position using the third position offset to obtain the second corrected position.

[0013] Optionally, controlling the robot to grab the electronic component and move it to the second correction position to insert the electronic component into the insertion object includes: after determining that the robot grabs the electronic component and moves it to the second correction position, controlling the robot to grab the electronic component and move it at the same moving speed as the insertion object to insert the electronic component into the insertion object.

[0014] According to another aspect of an embodiment of the present invention, there is also provided an electronic component insertion device based on machine vision, comprising: a first determination module, used to determine a first position offset between a current positioning position of an electronic component and a standard positioning position, wherein the current positioning position is the current position of the electronic component, the standard positioning position is the position of a teaching point of a first robot position, the first robot position is the position of the robot when the clarity of the pin image of the electronic component taken by a pin camera reaches a clarity threshold, and the robot is used to perform an insertion operation on the electronic component; a first control module, used to control the robot to grab the electronic component and move after determining the first correction position of the robot according to the first position offset. to the first correction position; a second determination module, for determining a third position offset between the current insertion position of the insertion object and the standard insertion position according to the second robot position after determining the second robot position according to the first correction position and the second position offset, wherein the second position offset is the offset between the standard positioning position and the standard insertion position, and the standard insertion position is the position of the robot when the electronic component is inserted into the insertion object; a second control module, for controlling the robot to grab the electronic component and move it to the second correction position after obtaining the second correction position of the robot according to the third position offset and the second robot position, so as to insert the electronic component into the insertion object.

[0015] Optionally, the first determination module includes: a first triggering unit, used to trigger the pin camera to capture the pin image of the electronic component when it is determined that the robot grabs the electronic component and moves to the first robot position; a first determination unit, used to determine the first position offset between the current positioning position of the electronic component and the standard positioning position based on the pin image.

[0016] Optionally, the first determination unit includes: a first determination subunit, used to determine the center position one of the pin of the electronic component based on the pin image; a second determination subunit, used to determine the first position offset between the current positioning position and the standard positioning position based on the deviation between the center position one and the center position two, wherein the center position two is the center position of the pin of the electronic component determined based on the standard pin image, and the standard pin image is the pin image of the electronic component captured by the pin image when the robot grabs the electronic component and moves it to the standard positioning position.

[0017] Optionally, the first control module includes: a reverse compensation unit, configured to perform reverse compensation on the standard positioning position using the first position offset to obtain the first corrected position.

[0018] Optionally, the second determination module includes: a second triggering unit, used to trigger the hole position camera to collect the hole position image of the insertion object after determining that the robot grabs the electronic component and moves to the second robot position; a second determination unit, used to determine the third position offset between the current insertion position and the standard insertion position based on the deviation between the center position three and the center position four of the hole position image, wherein the center position four is the center position of the insertion hole of the insertion object determined based on the standard hole position image, and the standard hole position image is the hole position image of the insertion object collected by the hole position camera when the insertion object is in the standard insertion position.

[0019] Optionally, the second control module includes: a forward compensation unit, configured to perform forward compensation on the second robot position using the third position offset to obtain the second corrected position.

[0020] Optionally, the second control module includes: a control unit for controlling the robot to grab the electronic component and move it to the second correction position at the same moving speed as the insertion object, so as to insert the electronic component into the insertion object.

[0021] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is further provided, wherein the computer-readable storage medium includes a stored program, wherein the program executes any one of the above-mentioned electronic component insertion methods based on machine vision.

[0022] According to another aspect of an embodiment of the present invention, a processor is further provided, wherein the processor is configured to run a program, wherein when the program is run, the program executes any one of the above-mentioned methods for assembling electronic components based on machine vision.

[0023] According to another aspect of an embodiment of the present invention, a computer program product is provided, comprising computer instructions, which, when executed by a processor, execute any one of the above-mentioned methods for electronic component assembly based on machine vision.

[0024] In an embodiment of the present invention, a first position offset between a current positioning position and a standard positioning position of an electronic component is determined, wherein the current positioning position is the current position of the electronic component, the standard positioning position is the position of a teaching point of a first robot position, the first robot position is the position of the robot when the clarity of an image of a pin of the electronic component taken by a pin camera reaches a clarity threshold, and the robot is used to perform an insertion operation on the electronic component; after determining a first correction position of the robot according to the first position offset, the robot is controlled to grab the electronic component and move it to the first correction position; after determining a second robot position according to the first correction position and the second position offset, a third position offset between the current insertion position of the insertion object and the standard insertion position is determined according to the second robot position, wherein the second position offset is the offset between the standard positioning position and the standard insertion position, and the standard insertion position is the position of the robot when the electronic component is inserted into the insertion object; after obtaining the second correction position of the robot according to the third position offset and the second robot position, the robot is controlled to grab the electronic component and move it to the second correction position to insert the electronic component into the insertion object. Through the technical solution provided by the present invention, the purpose of confirming the robot teaching point through teaching matching and establishing the insertion matching template is achieved. At the same time, the pin secondary positioning method is used for adjustment, thereby achieving the technical effect of accurate and rapid positioning and insertion of electronic components, improving the accuracy and reliability of insertion, and thus solving the technical problem that the method of inserting electronic components in related technologies is easily affected by the individual differences of electrical components and has low insertion accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:

[0026] Figure 1 This is a hardware structure block diagram of a mobile terminal for an electronic component insertion method based on machine vision according to an embodiment of the present invention;

[0027] Figure 2 is a flow chart of a method for inserting electronic components based on machine vision according to an embodiment of the present invention;

[0028] Figure 3 is a flow chart of an optional method for electronic component insertion based on machine vision according to an embodiment of the present invention;

[0029] Figure 4 Schematic diagram of the principle of secondary positioning of pins and follow-up positioning of holes according to an embodiment of the present invention;

[0030] Figure 5is a schematic diagram of a teaching matching principle according to an embodiment of the present invention;

[0031] Figure 6 4 is a schematic diagram of an electronic component insertion device based on machine vision according to an embodiment of the present invention. DETAILED DESCRIPTION

[0032] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of the present invention.

[0033] It should be noted that the terms "first", "second", etc. in the description and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0034] As described in the background, the conventional methods for inserting electronic components are susceptible to low insertion accuracy due to individual differences among electrical components. To address these shortcomings, embodiments of the present invention provide a machine vision-based electronic component insertion method and apparatus, a computer-readable storage medium, a processor, and a computer program product.

[0035] The technical solutions in the embodiments of the present invention will be described clearly and completely below with reference to the accompanying drawings in the embodiments of the present invention.

[0036] The method embodiments provided in the embodiments of the present invention can be executed in a mobile terminal, a computer terminal or a similar computing device. Taking running on a mobile terminal as an example, Figure 1 This is a hardware structure diagram of a mobile terminal of an electronic component insertion method based on machine vision according to an embodiment of the present invention. Figure 1 As shown, the mobile terminal may include one or more ( Figure 1Only one is shown) a processor 102 (the processor 102 may include but is not limited to a microprocessor MCU or a programmable logic device FPGA and other processing devices) and a memory 104 for storing data, wherein the mobile terminal may also include a transmission device 106 and an input and output device 108 for communication functions. It will be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the mobile terminal. Figure 1 More or fewer components than shown, or with Figure 1 Different configurations shown.

[0037] The memory 104 can be used to store computer programs, such as software programs and modules for application software, such as the computer program corresponding to the machine vision-based electronic component assembly method in the embodiments of the present invention. The processor 102 executes the computer programs stored in the memory 104 to execute various functional applications and data processing, thereby implementing the aforementioned method. The memory 104 may include high-speed random access memory (RAM) and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories may be connected to the mobile terminal via a network. Examples of such networks include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof. The transmission device 106 is used to receive or transmit data via a network. Specific examples of such networks may include a wireless network provided by the mobile terminal's telecommunications provider. In one example, the transmission device 106 includes a network interface controller (NIC), which can be connected to other network devices via a base station to enable communication with the Internet. In one example, the transmission device 106 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0038] According to an embodiment of the present invention, a method embodiment of an electronic component insertion method based on machine vision is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0039] Figure 2 FIG. 1 is a flow chart of a method for inserting electronic components based on machine vision according to an embodiment of the present invention. Figure 2 As shown, the method includes the following steps:

[0040] Step S202, determining a first position offset between a current positioning position of the electronic component and a standard positioning position, wherein the current positioning position is the current position of the electronic component, the standard positioning position is the position of the teaching point of the first robot position, the first robot position is the position of the robot when the clarity of the pin image of the electronic component taken by the pin camera reaches a clarity threshold, and the robot is used to perform insertion operations on the electronic component.

[0041] In this embodiment, the position offset (i.e., the first position offset) Ty=Wy'-Wy between the current positioning position Wy' of the electronic component and the standard positioning position Wy is calculated, which can correct the offset between the current position of the electronic component and the standard positioning position to ensure that the robot can accurately insert the electronic component into the target position when performing the insertion operation.

[0042] Step S204 : After determining the first correction position of the robot according to the first position offset, controlling the robot to grab the electronic component and move to the first correction position.

[0043] Figure 3 FIG. 1 is a flow chart of an optional method for inserting electronic components based on machine vision according to an embodiment of the present invention, as shown in FIG. Figure 3 As shown, after calculating the robot's correction position (i.e., the first correction position) W2'=W2-Ty based on the position offset Ty, the robot is controlled to grab the electronic component and move it to the robot position W2'. At this time, the electronic component returns to the standard positioning position Wy, which can ensure that the robot can accurately move to the first correction position when grabbing the electronic component, avoiding deviations or errors in the grabbing process.

[0044] Step S206, after determining the second robot position based on the first correction position and the second position offset, determine the third position offset between the current insertion position of the insertion object and the standard insertion position based on the second robot position, wherein the second position offset is the offset between the standard positioning position and the standard insertion position, and the standard insertion position is the position of the robot when the electronic component is inserted into the insertion object.

[0045] Figure 4 Schematic diagram of the principle of secondary positioning of pins and follow-up positioning of holes according to an embodiment of the present invention. Figure 4 As shown, after the second robot position W1'=W2'-T is calculated based on the first correction position W2' and the second position offset T, the position offset (i.e., the third position offset) Tp=Wp'-Wp of the current insertion position Wp' of the PCB and the standard insertion position Wp is calculated, which can help the robot achieve more accurate insertion operations, so that the robot can be fine-tuned according to the third position offset to ensure that the insertion object can be accurately inserted into the target position.

[0046] Step S208 , after obtaining a second correction position of the robot according to the third position offset and the second robot position, controlling the robot to grab the electronic component and move it to the second correction position to insert the electronic component into the insertion object.

[0047] In this embodiment, after calculating the robot's corrected position (i.e., the second corrected position) W'=W1'+Tp based on the third position offset Tp and the second robot position W1', the robot is controlled to grab the electronic component and move it to the robot position W'. At this time, the electronic component moves again along with the movement of the PCB board, and ensures that it can be accurately inserted into the PCB (i.e., the insertion object). By adjusting the robot's corrected position, the error can be reduced, and the robot can accurately grab and insert the electronic component, ensuring that the component is accurately inserted into the target position.

[0048] As can be seen from the above, in an embodiment of the present invention, a first position offset between the current positioning position of the electronic component and the standard positioning position is determined, wherein the current positioning position is the current position of the electronic component, the standard positioning position is the position of the teaching point of the first robot position, the first robot position is the position of the robot when the clarity of the pin image of the electronic component taken by the pin camera reaches the clarity threshold, and the robot is used to perform insertion operations on the electronic component; after determining the first correction position of the robot according to the first position offset, the robot is controlled to grab the electronic component and move it to the first correction position; after determining the second robot position according to the first correction position and the second position offset, the insertion operation is determined according to the second robot position. The third position offset between the current insertion position of the object and the standard insertion position, wherein the second position offset is the offset between the standard positioning position and the standard insertion position, and the standard insertion position is the position of the robot when the electronic component is inserted into the insertion object; after obtaining the second correction position of the robot according to the third position offset and the second robot position, the robot is controlled to grab the electronic component and move it to the second correction position to insert the electronic component into the insertion object, thereby achieving the purpose of confirming the robot teaching point through teaching matching and establishing the insertion matching template. At the same time, the pin secondary positioning method is used for adjustment, thereby achieving the technical effect of accurate and rapid positioning and insertion of electronic components, and improving the accuracy and reliability of insertion.

[0049] The technical solution provided by the embodiment of the present invention solves the technical problem in the related art that the insertion method of electronic components is easily affected by the individual differences of electrical components and has low insertion accuracy.

[0050] According to the above embodiment of the present invention, determining the first position offset between the current positioning position of the electronic component and the standard positioning position includes: when determining that the robot grasps the electronic component and moves to the first robot position, triggering the pin camera to capture the pin image of the electronic component; determining the first position offset between the current positioning position of the electronic component and the standard positioning position based on the pin image.

[0051] In this embodiment, when it is determined that the robot grabs the electronic component and moves it to the robot position W2 (i.e., the first robot position), the pin camera can be triggered to take pictures to capture the pin image of the electronic component, and the position offset between the current positioning position Wy' of the electronic component and the standard positioning position Wy (i.e., the first position offset) Ty = Wy'-Wy is calculated. By comparing the difference between the actual position and the standard position, the robot can be helped to make precise adjustments to ensure that the electronic component is accurately grabbed and moved to the target position.

[0052] It should be noted that during offline debugging, the robot position W2 is set to the position where the robot grabs the electronic components, which is a fixed teaching point. However, in the actual production process, due to differences in the placement of materials, the robot's gripping positions when grabbing the same type of electronic components will be different, resulting in deviations in the position of the electronic components when moving to the same W2 (fixed teaching point), and they are no longer in the standard positioning position.

[0053] like Figure 3 As shown, the specific method of the above-mentioned offline debugging is: 1) the robot grabs the electronic component and moves it to the standard insertion position Wp of the PCB board, and teaches the current robot position W1; 2) the robot grabs the electronic component and moves it to the standard positioning position Wy of the electronic component, and teaches the current robot position W2; 3) the offset T = W2-W1 between the two robot positions is recorded; 4) the hole position camera and the pin camera are triggered to take pictures, and the matching template 1 of the standard insertion position Wp of the PCB board and the matching template 2 of the standard positioning position Wy of the electronic component are established by vision.

[0054] It should be noted that point teaching is a function of the robot teach pendant. After moving to a position, the "Teach" button on the teach pendant can be used to record the current robot coordinate value. While observing with the eyes, the robot can be moved so that the grasped electronic components can be accurately inserted into the holes of the PCB board, and the current robot position W1 is recorded.

[0055] In addition, it should be noted that the above-mentioned standard insertion position Wp and standard positioning position Wy are defined after image processing. During the teaching phase, they correspond to the robot positions W1 and W2. Starting from the teaching point W1, the robot is moved to the pin camera to make the pin image of the electronic component clearest, and the current robot position W2 is recorded.

[0056] Figure 5 Schematic diagram of the teaching matching principle according to an embodiment of the present invention. Figure 5 As shown, the pin camera is fixed on a bracket on the outside side of the conveyor belt. The camera shoots from bottom to top to capture the position information of the pins of electronic components. The electronic components are captured by the robot and brought into the shooting range of the pin camera. After the pin camera is triggered to take pictures, the pictures of the pins of the electronic components in the teaching stage are obtained. Using image processing technology, the center position of the pins of the electronic components (such as four pins) is extracted and recorded as the standard positioning position Wy, and this position is used as the matching template 2.

[0057] In the above embodiment of the present invention, the first position offset between the current positioning position and the standard positioning position of the electronic component is determined according to the pin image, including: determining the center position one of the pin of the electronic component according to the pin image; determining the first position offset between the current positioning position and the standard positioning position according to the deviation between the center position one and the center position two, wherein the center position two is the center position of the pin of the electronic component determined based on the standard pin image, and the standard pin image is the pin image of the electronic component captured by the pin image when the robot grasps the electronic component and moves it to the standard positioning position.

[0058] In this embodiment, the matching template 2 can be used to calculate the position offset Ty = Wy'-Wy between the current positioning position Wy' of the electronic component and the standard positioning position Wy. By measuring and comparing the center position of the pin of the electronic component, the deviation between the current positioning position and the standard positioning position can be determined, which can ensure that the electronic component is correctly grasped and placed to avoid damage or incorrect connection.

[0059] like Figure 4 As shown, during the online production implementation stage, the robot grabs the electronic component and moves to the teaching point W2. After the pin camera takes a picture, the template matching technology is used to search for an area similar to the matching template 2 to quickly extract the center position of the electronic component pins (such as four pins), that is, the current positioning position Wy', and then compare the current positioning position Wy' with the standard positioning position Wy (difference).

[0060] According to the above embodiment of the present invention, determining the first correction position of the robot according to the first position offset includes: using the first position offset to perform reverse compensation on the standard positioning position to obtain the first correction position.

[0061] In this embodiment, the position offset Ty can be used for reverse compensation to calculate the robot's corrected position (i.e., the first corrected position) W2'=W2-Ty. By performing reverse compensation on the standard positioning position, the first corrected position can be obtained, that is, the offset is added back to the standard positioning position, making the position more accurate and precise.

[0062] It should be noted that the above-mentioned reverse compensation, that is, the negative offset, is that the current point of the robot is W2, and the offset is made in the negative direction of the robot coordinate to obtain the corrected position.

[0063] According to the above embodiment of the present invention, the third position offset between the current insertion position and the standard insertion position of the insertion object is determined according to the second robot position, including: after determining that the robot grabs the electronic component and moves to the second robot position, triggering the hole position camera to capture the hole position image of the insertion object; determining the third position offset between the current insertion position and the standard insertion position according to the deviation between the center position three and the center position four of the hole position image, wherein the center position four is the center position of the insertion hole of the insertion object determined based on the standard hole position image, and the standard hole position image is the hole position image of the insertion object captured by the hole position camera when the insertion object is in the standard insertion position.

[0064] In this embodiment, the position offset (i.e., the second position offset) T=W2-W1 recorded during teaching matching can be used to guide the robot to grab the electronic component and move it to the robot position (i.e., the second robot position) W1'=W2'-T, and trigger the hole position camera to take pictures to collect the hole position image of the insertion object. Using the matching template 1, the position offset (i.e., the third position offset) Tp=Wp'-Wp between the current insertion position Wp' of the PCB and the standard insertion position Wp is calculated, which can help the robot to accurately position itself during the insertion process and ensure that the insertion object can be accurately inserted into the target hole.

[0065] like Figure 5 As shown, the hole position camera is fixed above the conveyor belt. The camera shoots from top to bottom to capture the position information of the PCB board's insertion holes. When the PCB board passes through the conveyor belt and is conveyed to the shooting range of the hole position camera, the hole position camera takes a picture to obtain a picture of the PCB board in the teaching stage. Using image processing technology, the center position of the PCB board's insertion holes (such as four holes) is extracted and recorded as the standard insertion position Wp, and this position is used as the matching template 1.

[0066] like Figure 4As shown in the figure, during the online production implementation phase, the robot grabs an electronic component and moves to W1'. After the hole position camera takes a picture, it uses template matching technology to search for areas similar to matching template 1 to quickly extract the center position of the PCB board insertion holes (for example, four holes), that is, the current insertion position Wp'. This position Wp' is then compared with the standard insertion position Wp (difference).

[0067] According to the above embodiment of the present invention, obtaining the second corrected position of the robot according to the third position offset and the second robot position includes: performing positive compensation on the second robot position using the third position offset to obtain the second corrected position.

[0068] In this embodiment, the position offset Tp can be used for positive compensation to calculate the robot's corrected position (i.e., the second corrected position) W'=W1'+Tp, which can help the second robot correct its position during movement, ensure that it is in the correct target position, and reduce the deviations and errors that may occur during the movement of the robot.

[0069] It should be noted that the above-mentioned positive compensation, that is, the positive offset, is to offset the current point W1' of the robot in the positive direction of the robot coordinate to obtain the corrected position.

[0070] According to the above embodiment of the present invention, controlling the robot to grasp the electronic component and move it to the second correction position to insert the electronic component into the insertion object includes: after determining that the robot grasps the electronic component and moves it to the second correction position, controlling the robot to grasp the electronic component and move it at the same moving speed as the insertion object to insert the electronic component into the insertion object.

[0071] In this embodiment, after the robot grabs the electronic components and moves to the robot position W' (i.e., the second correction position), the robot can be controlled to grab the electronic components and change accordingly with the change of the PCB board position to ensure that it can be accurately inserted into the PCB, and to ensure that the robot maintains a stable speed and posture when inserting electronic components, thereby reducing errors and damage risks during the insertion process.

[0072] Through the technical solutions provided by the above embodiments of the present invention, the following improvements are made to address the problems of slow insertion speed and poor precision caused by individual differences in electronic components: 1) The relationship between the teaching point and the matching template is established, and adjustments are made based on the initial teaching point according to the differences between the current electronic components, PCB boards and their corresponding insertion templates, thereby achieving accurate and rapid positioning and insertion of electronic components; 2) The pin secondary positioning method adopted effectively reduces the requirement for high consistency of incoming electronic components, which can make the incoming electronic components more flexible.

[0073] From the above, it can be seen that in an embodiment of the present invention, a method for positioning and inserting electronic components based on machine vision is proposed, which includes three steps: teaching matching, pin secondary positioning, and hole position following positioning. The specific steps are as follows: 1) Teaching matching, first, the robot grabs the electronic component and moves it to the standard insertion position Wp of the PCB board, and teaches the current robot position W1, then, the robot grabs the electronic component and moves it to the standard positioning position Wy of the electronic component, and teaches the current robot position W2, then, records the offset T=W2-W1 of the two robot positions before and after, finally, triggers the hole position camera and the pin camera to take pictures, and uses vision to establish a matching template 1 of the standard insertion position Wp of the PCB board and a matching template 2 of the standard positioning position Wy of the electronic component; 2) Pin secondary positioning, first, the robot grabs the electronic component and moves it to the robot position W2, and triggers the pin camera to take pictures, then uses the matching template 2 to calculate the current positioning position Wy' of the electronic component and the standard positioning The position offset of position Wy is Ty=Wy'-Wy. Then, the position offset Ty is used for reverse compensation to calculate the robot's corrected position W2'=W2-Ty. Finally, the robot grabs the electronic component and moves it to the robot position W2'. At this time, the electronic component returns to the standard positioning position Wy; 3) Hole position following positioning. First, the position offset T=W2-W1 recorded in the teaching matching step is used to guide the robot to grab the electronic component and move it to the robot position W1'=W2'-T, and trigger the hole position camera to take a picture. Then, the matching template 1 is used to calculate the position offset Tp=Wp'-Wp between the current insertion position Wp' of the PCB and the standard insertion position Wp. Then, the position offset Tp is used for forward compensation to calculate the robot's corrected position W'=W1'+Tp. Finally, the robot grabs the electronic component and moves it to the robot position W'. At this time, the electronic component can change with the change of the PCB board position and ensure that it can be accurately inserted into the PCB.

[0074] Among them, teaching matching is implemented for offline debugging, and pin secondary positioning and hole position following positioning are implemented for online production.

[0075] That is, the above-mentioned technical solution provided by the embodiment of the present invention comprehensively considers multiple factors. First, in the offline debugging stage, the robot teaching point confirmation and the establishment of the insertion matching template are completed through teaching matching. Then, in the actual production stage, the differences between the current electronic components, PCB boards and their corresponding insertion templates are used to perform two positioning adjustments based on the initial teaching point, so that the robot can finally complete the positioning and insertion of electronic components accurately and quickly. This method is simple to operate and can improve the insertion speed and accuracy while being compatible with the inconsistent incoming materials of special-shaped electronic components.

[0076] It should be noted that for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that this application is not limited by the order of the actions described, because according to this application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by this application.

[0077] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus the necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods of each embodiment of the present application.

[0078] According to an embodiment of the present invention, there is also provided a machine vision-based electronic component insertion device for implementing the above-mentioned machine vision-based electronic component insertion method. Figure 6 FIG. 1 is a schematic diagram of an electronic component insertion device based on machine vision according to an embodiment of the present invention. Figure 6 As shown, the device includes: a first determination module 601, a first control module 603, a second determination module 605 and a second control module 607. The electronic component insertion device based on machine vision is described below.

[0079] The first determination module 601 is used to determine a first position offset between a current positioning position of an electronic component and a standard positioning position, wherein the current positioning position is the current position of the electronic component, the standard positioning position is the position of the teaching point of the first robot position, the first robot position is the position of the robot when the clarity of the pin image of the electronic component taken by the pin camera reaches a clarity threshold, and the robot is used to perform insertion operations on the electronic component.

[0080] The first control module 603 is configured to control the robot to grab the electronic component and move it to the first correction position after determining the first correction position of the robot according to the first position offset.

[0081] The second determination module 605 is used to determine a third position offset between the current insertion position of the insertion object and the standard insertion position according to the second robot position after determining the second robot position according to the first correction position and the second position offset, wherein the second position offset is the offset between the standard positioning position and the standard insertion position, and the standard insertion position is the position of the robot when the electronic component is inserted into the insertion object.

[0082] The second control module 607 is configured to control the robot to grab the electronic component and move it to the second correction position after obtaining the second correction position of the robot according to the third position offset and the second robot position, so as to insert the electronic component into the insertion object.

[0083] It should be noted here that the above-mentioned first determination module 601, first control module 603, second determination module 605 and second control module 607 correspond to steps S202 to S208 in the above-mentioned embodiment. The four modules and the corresponding steps implement the same instances and application scenarios, but are not limited to the contents disclosed in the above-mentioned embodiment.

[0084] From the above, it can be seen that in the scheme recorded in the above embodiment of the present invention, the first determination module can be used to first determine the first position offset between the current positioning position of the electronic component and the standard positioning position, wherein the current positioning position is the current position of the electronic component, the standard positioning position is the position of the teaching point of the first robot position, and the first robot position is the position of the robot when the clarity of the pin image of the electronic component taken by the pin camera reaches the clarity threshold, and the robot is used to perform insertion operations on the electronic component; then the first control module can be used to control the robot to grab the electronic component and move it to the first correction position after determining the first correction position of the robot according to the first position offset; then the second determination module can be used to determine the second robot position according to the first correction position and the second position offset. Then, a third position offset between the current insertion position of the insertion object and the standard insertion position is determined according to the second robot position, wherein the second position offset is the offset between the standard positioning position and the standard insertion position, and the standard insertion position is the position of the robot when the electronic component is inserted into the insertion object; finally, after obtaining the second correction position of the robot according to the third position offset and the second robot position, the second control module can be used to control the robot to grab the electronic component and move it to the second correction position to insert the electronic component into the insertion object, thereby achieving the purpose of confirming the robot teaching point through teaching matching and establishing the insertion matching template. At the same time, the pin secondary positioning method is used for adjustment, thereby achieving the technical effect of accurate and rapid positioning and insertion of electronic components, and improving the accuracy and reliability of insertion.

[0085] The technical solution provided by the embodiment of the present invention solves the technical problem in the related art that the insertion method of electronic components is easily affected by the individual differences of electrical components and has low insertion accuracy.

[0086] In an optional embodiment, the first determination module includes: a first trigger unit, used to trigger the pin camera to capture the pin image of the electronic component when it is determined that the robot grabs the electronic component and moves to the first robot position; a first determination unit, used to determine the first position offset between the current positioning position of the electronic component and the standard positioning position based on the pin image.

[0087] In an optional embodiment, the first determination unit includes: a first determination subunit, used to determine the center position one of the pin of the electronic component based on the pin image; a second determination subunit, used to determine the first position offset between the current positioning position and the standard positioning position based on the deviation between the center position one and the center position two, wherein the center position two is the center position of the pin of the electronic component determined based on the standard pin image, and the standard pin image is the pin image of the electronic component captured through the pin image when the robot grasps the electronic component and moves it to the standard positioning position.

[0088] In an optional embodiment, the first control module includes: a reverse compensation unit, configured to perform reverse compensation on the standard positioning position using the first position offset to obtain a first corrected position.

[0089] In an optional embodiment, the second determination module includes: a second triggering unit, used to trigger the hole position camera to collect the hole position image of the insertion object after determining that the robot grabs the electronic component and moves to the second robot position; a second determination unit, used to determine the third position offset between the current insertion position and the standard insertion position based on the deviation between the center position three and the center position four of the hole position image, wherein the center position four is the center position of the insertion hole of the insertion object determined based on the standard hole position image, and the standard hole position image is the hole position image of the insertion object collected by the hole position camera when the insertion object is in the standard insertion position.

[0090] In an optional embodiment, the second control module includes: a forward compensation unit, configured to perform forward compensation on the second robot position using the third position offset to obtain a second corrected position.

[0091] In an optional embodiment, the second control module includes: a control unit for controlling the robot to move the electronic component at the same speed as the insertion object after determining that the robot grabs the electronic component and moves to the second correction position, so as to insert the electronic component into the insertion object.

[0092] According to another aspect of an embodiment of the present invention, a processor is further provided, and the processor is used to run a program, wherein when the program is run, any one of the above-mentioned electronic component insertion methods based on machine vision is executed.

[0093] According to another aspect of an embodiment of the present invention, a computer program product is provided, comprising computer instructions. When the computer instructions are executed by a processor, any one of the above-mentioned methods for assembling electronic components based on machine vision is executed.

[0094] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is provided. The computer-readable storage medium includes a stored program, wherein the program executes any one of the above-mentioned electronic component insertion methods based on machine vision.

[0095] Optionally, in this embodiment, the computer-readable storage medium may be located in any one of the computer terminals in a computer terminal group in a computer network, or in any one of the communication devices in a communication device group.

[0096] Optionally, in this embodiment, the computer-readable storage medium is configured to store program codes for executing the following steps: determining a first position offset between a current positioning position of an electronic component and a standard positioning position, wherein the current positioning position is the current position of the electronic component, the standard positioning position is the position of a teaching point of a first robot position, the first robot position is the position of the robot when the clarity of the pin image of the electronic component taken by the pin camera reaches a clarity threshold, and the robot is used to perform an insertion operation on the electronic component; after determining a first correction position of the robot according to the first position offset, controlling the robot to grasp The electronic component is moved to a first correction position; after determining the second robot position based on the first correction position and the second position offset, a third position offset between the current insertion position of the insertion object and the standard insertion position is determined based on the second robot position, wherein the second position offset is the offset between the standard positioning position and the standard insertion position, and the standard insertion position is the position of the robot when the electronic component is inserted into the insertion object; after obtaining the second correction position of the robot based on the third position offset and the second robot position, the robot is controlled to grab the electronic component and move it to the second correction position to insert the electronic component into the insertion object.

[0097] Optionally, in this embodiment, the computer-readable storage medium is configured to store program code for executing the following steps: when determining that the robot grasps the electronic component and moves to the first robot position, triggering the pin camera to capture the pin image of the electronic component; determining the first position offset between the current positioning position of the electronic component and the standard positioning position based on the pin image.

[0098] Optionally, in this embodiment, the computer-readable storage medium is configured to store program code for performing the following steps: determining the center position one of the pin of the electronic component based on the pin image; determining a first position offset between the current positioning position and the standard positioning position based on the deviation between the center position one and the center position two, wherein the center position two is the center position of the pin of the electronic component determined based on the standard pin image, and the standard pin image is the pin image of the electronic component captured by the pin image when the robot grasps the electronic component and moves it to the standard positioning position.

[0099] Optionally, in this embodiment, the computer-readable storage medium is configured to store program codes for executing the following steps: reversely compensating the standard positioning position using the first position offset to obtain a first corrected position.

[0100] Optionally, in this embodiment, the computer-readable storage medium is configured to store program codes for executing the following steps: after determining that the robot grasps the electronic component and moves to the second robot position, triggering the hole position camera to capture the hole position image of the insertion object; determining the third position offset between the current insertion position and the standard insertion position according to the deviation between the center position three and the center position four of the hole position image, wherein the center position four is the center position of the insertion hole of the insertion object determined based on the standard hole position image, and the standard hole position image is the hole position image of the insertion object captured by the hole position camera when the insertion object is in the standard insertion position.

[0101] Optionally, in this embodiment, the computer-readable storage medium is configured to store program code for executing the following steps: performing forward compensation on the second robot position using the third position offset to obtain a second corrected position.

[0102] Optionally, in this embodiment, the computer-readable storage medium is configured to store program code for executing the following steps: after determining that the robot grabs the electronic component and moves to the second correction position, controlling the robot to grab the electronic component and move at the same moving speed as the insertion object to insert the electronic component into the insertion object.

[0103] The serial numbers of the above embodiments of the present invention are for description only and do not represent the advantages or disadvantages of the embodiments.

[0104] In the above embodiments of the present invention, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0105] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only exemplary. For example, the division of the units can be a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0106] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0107] In addition, the functional units in the various embodiments of the present invention may be integrated into a single processing unit, each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[0108] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk, etc. Various media that can store program codes.

[0109] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as within the scope of protection of the present invention.

Claims

1. A method for inserting electronic components based on machine vision, characterized in that: include: Determining a first position offset between a current positioning position of an electronic component and a standard positioning position, wherein the current positioning position is the current position of the electronic component, the standard positioning position is the position of a teaching point of a first robot position, the first robot position is the position of the robot when the clarity of an image of a pin of the electronic component captured by a pin camera reaches a clarity threshold, and the robot is used to perform an insertion operation on the electronic component; After determining a first correction position of the robot according to the first position offset, controlling the robot to grab the electronic component and move it to the first correction position; After determining the second robot position according to the first corrected position and the second position offset, determining a third position offset between the current insertion position of the insertion object and a standard insertion position according to the second robot position, wherein the second position offset is the offset between the standard positioning position and the standard insertion position, and the standard insertion position is the position of the robot when the electronic component is inserted into the insertion object; After obtaining the second correction position of the robot according to the third position offset and the second robot position, the robot is controlled to grab the electronic component and move to the second correction position to insert the electronic component into the insertion object.

2. The electronic component insertion method based on machine vision according to claim 1, characterized in that: Determining a first position offset between a current positioning position of an electronic component and a standard positioning position includes: When it is determined that the robot grabs the electronic component and moves to the first robot position, triggering the pin camera to capture the pin image of the electronic component; The first position offset between the current positioning position of the electronic component and the standard positioning position is determined according to the pin image.

3. The electronic component insertion method based on machine vision according to claim 2, characterized in that: Determining the first position offset between the current positioning position of the electronic component and the standard positioning position according to the pin image includes: Determine the center position of the pin of the electronic component according to the pin image; The first position offset between the current positioning position and the standard positioning position is determined based on the deviation between the center position one and the center position two, wherein the center position two is the center position of the pin of the electronic component determined based on the standard pin image, and the standard pin image is the pin image of the electronic component captured by the pin image when the robot grabs the electronic component and moves it to the standard positioning position.

4. The electronic component insertion method based on machine vision according to claim 1, characterized in that: Determining a first corrected position of the robot according to the first position offset includes: The first position offset is used to perform reverse compensation on the standard positioning position to obtain the first corrected position.

5. The electronic component insertion method based on machine vision according to claim 1, characterized in that: Determining a third position offset between a current insertion position of the insertion object and a standard insertion position according to the second robot position includes: After determining that the robot grabs the electronic component and moves to the position of the second robot, triggering a hole position camera to capture a hole position image of the insertion object; The third position offset between the current insertion position and the standard insertion position is determined based on the deviation between the center position three and the center position four of the hole position image, wherein the center position four is the center position of the insertion hole of the insertion object determined based on the standard hole position image, and the standard hole position image is the hole position image of the insertion object captured by the hole position camera when the insertion object is in the standard insertion position.

6. The electronic component insertion method based on machine vision according to claim 1, characterized in that: Obtaining a second corrected position of the robot according to the third position offset and the second robot position, comprising: The second robot position is positively compensated using the third position offset to obtain the second corrected position.

7. The electronic component insertion method based on machine vision according to claim 1, characterized in that: Controlling the robot to grab the electronic component and move it to the second correction position to insert the electronic component into the insertion object includes: After determining that the robot grabs the electronic component and moves to the second correction position, the robot is controlled to grab the electronic component and move at the same moving speed as the insertion object, so as to insert the electronic component into the insertion object.

8. An electronic component insertion device based on machine vision, characterized in that: include: a first determination module, configured to determine a first position offset between a current positioning position of an electronic component and a standard positioning position, wherein the current positioning position is the current position of the electronic component, the standard positioning position is the position of a teaching point of a first robot position, the first robot position is the position of the robot when the clarity of an image of a pin of the electronic component taken by a pin camera reaches a clarity threshold, and the robot is configured to perform an insertion operation on the electronic component; a first control module, configured to control the robot to grab the electronic component and move it to the first correction position after determining the first correction position of the robot according to the first position offset; a second determining module, configured to determine, after determining a second robot position according to the first corrected position and the second position offset, a third position offset between a current insertion position of the insertion object and a standard insertion position according to the second robot position, wherein the second position offset is an offset between the standard positioning position and the standard insertion position, and the standard insertion position is a position of the robot when the electronic component is inserted into the insertion object; The second control module is used to control the robot to grab the electronic component and move it to the second correction position after obtaining the second correction position of the robot according to the third position offset and the second robot position, so as to insert the electronic component into the insertion object.

9. A computer-readable storage medium, characterized in that The computer-readable storage medium includes a stored program, wherein the program executes the electronic component insertion method based on machine vision according to any one of claims 1 to 7.

10. A computer program product comprising computer instructions, characterized in that When the computer instructions are executed by the processor, the electronic component insertion method based on machine vision according to any one of claims 1 to 7 is executed.