Electronic component plug-in mounting method and device based on machine vision
Through the machine vision-based plug-in method, the pin and hole cameras are used for secondary positioning, which solves the problem of low insertion accuracy of special-shaped electronic components, and achieves a fast and accurate plug-in effect.
Patent Information
- Application Number
- CN202411318763.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-20
- Publication Date
- 2024-12-10
- Estimated Expiration
- 2044-09-20
AI Technical Summary
Existing automated plug-in and installation equipment is difficult to efficiently plug and install special-shaped electronic components, resulting in low plug-in accuracy and poor efficiency, and it is difficult to achieve rapid and precise plug-in and installation by special-shaped plug-in and installation.
Using a machine vision-based plug-in method, by determining the position offset between the electronic components and the plug-in object, secondary positioning is used to adjust the robot position to achieve accurate plug-in by using the pin camera and the hole camera.
It improves the insertion accuracy and efficiency of electronic components, can quickly and accurately complete the insertion and installation of special-shaped electronic components, and reduces the requirements for consistency of incoming materials.
Smart Images

Figure CN119110508A_ABST
Abstract
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 can basically only rely 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 solution has been proposed yet. Summary of the invention
[0006] The embodiment of the present invention provides a method and device for inserting electronic components based on machine vision, so as to at least solve the technical problem that the method of inserting electronic components in the related art 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, there is provided a method for inserting electronic components based on machine vision, 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 a 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 a current positioning position of an electronic component and a 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; and 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 according to the pin image includes: 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 grabs the electronic component and moves it to the standard positioning position.
[0010] Optionally, determining the first correction position of the robot according to the first position offset includes: using the first position offset to reversely compensate the standard positioning position to obtain the first correction position.
[0011] Optionally, determining a third position offset between the current insertion position and the standard insertion position of the insertion object according to the second robot position includes: after determining that the robot grabs the electronic component and moves to the second robot position, triggering a hole position camera to capture a hole position image of the insertion object; determining the third position offset between the current insertion position and the standard insertion position according to a deviation between a center position three and a 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 hole position.
[0012] Optionally, 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.
[0013] Optionally, controlling the robot to grab the electronic component and move it to the second correction position so as 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 so as 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, used to determine the 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, 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.
[0015] Optionally, the first determination module includes: a first trigger unit, used to trigger the pin camera to collect 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 according to the pin image; a second determination subunit, used to determine 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 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 trigger unit, used to trigger a hole position camera to collect a 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 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 collected by the hole position camera when the insertion object is at 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 at the same moving speed as the insertion object after determining that the robot grabs the electronic component and moves it to the second correction position, 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 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.
[0023] According to another aspect of an embodiment of the present invention, a computer program product is provided, comprising computer instructions, wherein when the computer instructions are executed by a processor, any one of the above-mentioned electronic component insertion methods based on machine vision is executed.
[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 a 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, 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 a second position offset, a third position offset between a current insertion position of the insertion object and a 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 a 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 further solving the technical problem of low insertion accuracy caused by individual differences of electrical components in the method of inserting electronic components in related technologies. 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 It is a hardware structure block diagram of a mobile terminal of 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 an electronic component insertion method based on machine vision according to an embodiment of the present invention;
[0028] Figure 3 is a flow chart of an optional electronic component insertion method based on machine vision according to an embodiment of the present invention;
[0029] Figure 4 It is a 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 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 scheme of the present invention, the technical scheme 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 described embodiments 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 creative work should fall within the scope of protection of the present invention.
[0033] It should be noted that the terms "first", "second", etc. in the specification 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 data 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 that are 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 introduced in the background technology, the method of inserting electronic components in the related art is susceptible to low insertion accuracy caused by individual differences of electrical components. In view of the above defects, in the embodiments of the present invention, a method and device for inserting electronic components based on machine vision, a computer readable storage medium, a processor and a computer program product are provided.
[0035] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with 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 FIG. 1 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 in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, wherein the mobile terminal may also include a transmission device 106 and an input / output device 108 for communication functions. It can 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 as shown, or with Figure 1 Different configurations are shown.
[0037] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the method for inserting electronic components based on machine vision in the embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, the above method is implemented. The memory 104 may include a high-speed random access memory, and may also include a 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 a memory remotely arranged relative to the processor 102, and these remote memories can be connected to the mobile terminal via a network. Examples of the above-mentioned network include but are not limited to the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof. The transmission device 106 is used to receive or send data via a network. The above-mentioned specific examples of the network may include a wireless network provided by a communication provider of the mobile terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate 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 is a flow chart of a method for inserting electronic components based on machine vision according to an embodiment of the present invention, such as Figure 2 As shown, the method comprises the following steps:
[0040] Step S202, 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 a pin image of an electronic component taken by a pin camera reaches a clarity threshold, and the robot is used to perform insertion operations on electronic components.
[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 is a flow chart of an optional method for electronic component insertion based on machine vision according to an embodiment of the present invention, such as Figure 3 As shown, after calculating the robot's correction position (i.e., the first correction position) W2'=W2-Ty according to the position offset Ty, the robot is controlled to grab the electronic components and move to the robot position W2'. At this time, the electronic components return to the standard positioning position Wy, which can ensure that the robot can accurately move to the first correction position when grabbing the electronic components, avoiding deviations or errors in the grabbing process.
[0044] Step S206, after determining the second robot position according to 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 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.
[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 to 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 correction position (i.e., the second correction position) W'=W1'+Tp according to the third position offset Tp and the second robot position W1', the robot can be controlled to grab the electronic components and move them to the robot position W'. At this time, the electronic components move again with the movement of the PCB board and ensure that they can be accurately inserted into the PCB (i.e., the insertion object). By adjusting the robot's correction position, the error can be reduced, and the robot can realize accurate grasping and insertion of electronic components, ensuring that the components are 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 a current positioning position of an electronic component and a 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 a teaching point of a first robot position, the first robot position is the position of the robot when the clarity of a pin image of an electronic component taken by a pin camera reaches a clarity threshold, and the robot is used to perform insertion operations on electronic components; 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, 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, and at the same time, adopting the pin secondary positioning method for adjustment, thereby achieving the technical effect of accurate and fast 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 a first position offset between a current positioning position of an electronic component and a standard positioning position includes: when determining that a robot grasps an electronic component and moves to a first robot position, triggering a pin camera to capture a pin image of the electronic component; and determining a 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 position W2 at which the robot grabs electronic components is set to W2, which is a fixed teaching point. However, in the actual production process, due to differences in the placement of materials, the robot will have different gripping positions when grabbing the same type of electronic components, 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 of the robot position before and after 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, and correspond to the robot positions W1 and W2 during the teaching stage. Starting from the position of 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 is a schematic diagram of the teaching matching principle according to an embodiment of the present invention, such as Figure 5 As shown, the pin camera is fixed on a bracket on one side outside 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 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. The image processing technology is used to extract the center position of the pins of the electronic components (such as four pins), which is 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, a first position offset between a current positioning position and a standard positioning position of an electronic component is determined based on a pin image, including: determining a center position one of a 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 a 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 an image of the pin of the electronic component captured by the pin image when a robot grabs 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, thereby ensuring 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 components 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 the current positioning position Wy' is compared 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 reversely compensate 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.
[0062] It should be noted that the above-mentioned reverse compensation, that is, the negative offset, the current point of the robot is W2, and it is offset in the negative direction of the robot coordinates 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 collect 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 collected by the hole position camera when the insertion object is in the standard hole 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 components and move them 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 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, and the camera shoots from top to bottom to capture the position information of the PCB board 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 pictures to obtain the picture of the PCB board in the teaching stage. By using image processing technology, the center position of the PCB board 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 online production implementation stage, the robot grabs the electronic components and moves to W1'. After the hole position camera takes a picture, the template matching technology is used to search for areas similar to the matching template 1 to quickly extract the center position of the PCB board insertion holes (such as four holes), that is, the current insertion position Wp'. Then the position Wp' is 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 possible deviations and errors that may occur during the robot's movement.
[0069] It should be noted that the above-mentioned positive compensation, that is, the positive offset, is that the current point W1' of the robot is offset in the positive direction of the robot coordinates to obtain the corrected position.
[0070] According to the above-mentioned embodiment of the present invention, controlling the robot to grasp the electronic component and move it to the second correction position so as 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 so as 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 along with the position of the PCB board to ensure that they can be accurately inserted into the PCB. This can 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 solution provided by the above-mentioned 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, so as to achieve accurate and fast 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] As can be seen from the above, in an embodiment of the present invention, a method for positioning and inserting electronic components based on machine vision is proposed. The method 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, the offset T=W2-W1 of the robot position before and after is recorded. Finally, 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; 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, the matching template 2 is used to calculate the current positioning position Wy' of the electronic component and the standard positioning The position offset Ty 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 components and moves them to the robot position W2'. At this time, the electronic components return 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 components and move them to the robot position W1'=W2'-T, and trigger the hole position camera to take pictures. 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 components and moves them to the robot position W'. At this time, the electronic components can change with the change of the position of the PCB board and ensure that they 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 technical solution provided by the embodiment of the present invention comprehensively considers various factors. First, in the offline debugging stage, the confirmation of the robot teaching point 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 accurately and quickly complete the positioning and insertion of the electronic components. 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 the present application is not limited by the described order of actions, because according to the present 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 the present 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 a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an 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 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 is a schematic diagram of an electronic component insertion device based on machine vision according to an embodiment of the present invention, such as 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 a teaching point of a first robot position, the first robot position is the position of the robot when the clarity of a pin image of the electronic component taken by a pin camera reaches a clarity threshold, and the robot is used to perform insertion operations on electronic components.
[0080] The first control module 603 is 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.
[0081] The second determination module 605 is used to determine the 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 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.
[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 embodiments, and the four modules are the same as the instances and application scenarios implemented by the corresponding steps, but are not limited to the contents disclosed in the above-mentioned embodiments.
[0084] As can be seen from the above, in the scheme recorded in the above-mentioned 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, 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 components; 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, and at the same time, adopting the pin secondary positioning method for adjustment, thereby achieving the technical effect of accurate and fast 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 collect 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 according to the pin image; a second determination subunit, used to determine 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 through the pin image when the robot grabs 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, which is used to reversely compensate the standard positioning position using the first position offset to obtain the first corrected position.
[0089] In an optional embodiment, the second determination module includes: a second trigger unit, which is 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, which is used to determine 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 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, which is used 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 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.
[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, including computer instructions, which, when executed by a processor, execute any one of the above-mentioned electronic component insertion methods based on machine vision.
[0094] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is further provided, the computer-readable storage medium comprising 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 a 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 grasp The electronic component is moved to a first correction position; after determining the second robot position according to the first correction position and the second position offset, the 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.
[0097] Optionally, in this embodiment, the computer-readable storage medium is configured to store program codes for executing the following steps: when it is determined 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 codes for executing the following steps: determining a center position one of the pins 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 a deviation between the center position one and the center position two, wherein the center position two is the center position of the pins of the electronic component determined based on the standard pin image, and the standard pin image is an image of the pins of the electronic component captured by the pin image when the robot grabs 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 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 a 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 positive 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, control 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 only for description 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 emphasis. 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 schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. For example, 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 separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on 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, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of 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, in essence, 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, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server or a 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 and other 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 principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A method for inserting electronic components based on machine vision, characterized in that: include: 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 a 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 corrected 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 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, so as to insert the electronic component into the insertion object.
2. The method for electronic component insertion 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 collect 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 method for electronic component insertion 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 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 grabs the electronic component and moves it to the standard positioning position.
4. The method for electronic component insertion 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 method for electronic component insertion 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 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 hole position.
6. The method for electronic component insertion 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 method for electronic component insertion 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 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 a teaching point of a first robot position, the first robot position is the position of the robot when the clarity of a 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, 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 determination module, configured to determine a third position offset between a current insertion position of the insertion object and a standard insertion position according to the second robot position after determining the second robot position according to the first corrected position and the second position offset, 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 as described in 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 described in any one of claims 1 to 7 is performed.
Citation Information
Patent Citations
Plug-in mounting method and device based on visual processing, computer equipment and storage medium
CN117114958A
Method and apparatus for correcting mark position of program in electronic component mounter
JP2002185199A
Method of recognizing position of electronic component, and electronic component mounter
JP2007235019A
Parts mounting device and method
US20060048380A1
