Dispensing device and method based on machine vision positioning
By introducing machine vision positioning technology into the dispensing device, dynamically adjusting the dispensing path, the problem of insufficient dispensing accuracy caused by part position deviation is solved, and higher production efficiency and product quality are achieved.
Patent Information
- Application Number
- CN202510348196.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-24
- Publication Date
- 2025-06-06
AI Technical Summary
The existing dispensing devices have insufficient dispensing accuracy due to deviations in parts, which affects product quality and production efficiency.
Using machine vision-based positioning technology, deep learning algorithms and vision systems are used to measure, identify and position the profile of industrial parts, dynamically adjust the dispensing path, and reduce manual intervention.
Improve the flexibility and accuracy of dispensing operations, reduce dispensing errors, and improve production efficiency and product quality.
Smart Images

Figure CN120094800A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of glue dispensing machines, and in particular to a glue dispensing device and method based on machine vision positioning. Background Art
[0002] The dispensing machine is used to precisely control the fluid and drip or apply it on the surface or inside of the product. It is widely used in various product process flows, such as accurately applying glue, paint or other liquid substances to specific locations, and supports the production of dotting, drawing lines, circular or arc patterns. However, the gantry dispensing machines widely used in the industry currently mainly rely on PLC to pre-plan the dispensing path, and this control method has certain limitations. In view of the screw hole deviation problem of industrial parts, the actual positions of parts in the same batch are uneven, resulting in the actual dispensing trajectory often not matching the preset path, which in turn causes the phenomenon of missing coating during the actual dispensing process. In addition, this deviation may also cause the dispensing head to collide with the part, thereby damaging the dispensing head. These problems not only affect the quality and production efficiency of the product, but may also lead to an increase in production costs. In view of this, the existing dispensing method has certain limitations, and the intelligent positioning technology based on machine vision is introduced to improve the dispensing efficiency and accuracy and optimize the production process.
[0003] In view of this, a dispensing device and method based on machine vision positioning is proposed to help solve the above problems. Summary of the invention
[0004] Technical problem to be solved: In the prior art, the traditional dispensing device often has insufficient dispensing accuracy due to part position deviation, which in turn affects product quality and production efficiency. In order to overcome this shortcoming, the present invention provides a dispensing device and method based on machine vision positioning. The invention introduces a deep learning algorithm and combines it with a visual system to achieve measurement, recognition and positioning of the contour of industrial parts, and dynamically adjusts the dispensing path without the need for manual preset paths, thereby improving the flexibility of the dispensing operation and reducing dispensing errors.
[0005] In order to achieve the above object, the present invention adopts the following technical solutions:
[0006] A glue dispensing device based on machine vision includes a gantry glue dispensing machine body, an image acquisition module and a control system. The gantry glue dispensing machine body includes a frame and a glue cylinder. A base is provided at the bottom of the frame, a Y-axis slide is provided above the base, a placement plate is provided above the slider of the Y-axis slide, an X-axis slide is provided above the frame, and a material delivery glue valve is provided on one side of the frame. A connecting plate A is fixedly installed on one side of the slider of the X-axis slide, a Z-axis slide is fixedly installed on one side of the connecting plate A, a connecting plate B is fixedly installed on one side of the slider of the Z-axis slide, a fixed plate A and a fixed plate B are provided on one side of the connecting plate B, the glue cylinder is inlaid and installed between the fixed plate A and the fixed plate B, and a glue dispensing head is fixedly installed on the bottom of the glue cylinder, an image acquisition fixed plate is fixedly installed on the outer wall of one side of the fixed plate A, a material delivery rubber hose is provided between the material delivery glue valve and the glue cylinder, and an image acquisition placement area with hollow square holes is provided in the middle of the image acquisition fixed plate.
[0007] Preferably, the image acquisition module is composed of an industrial camera, which is used to acquire images of the parts to be glued; the image acquisition module is installed in the image acquisition placement area, which is set in the hollow square hole of the image acquisition fixing plate. The image acquisition fixing plate is longer and wider than the fixing plate A, which is used to prevent the light source from reflecting on the metal surface during the glue dispensing operation and reduce the impact of the reflection on the image acquisition. The image acquisition placement plate is connected to the fixing plate A, and the fixing plate A is used to fix the position of the glue cylinder and moves synchronously with the movement of the Z-axis slider, thereby ensuring that the spatial position between the image acquisition module and the glue dispensing head is relatively fixed.
[0008] Preferably, the control system is composed of a host computer, an STM32 single-chip microcomputer, an X-axis driver, a Y-axis driver and a Z-axis driver. X, Y, and Z-axis drivers are devices for controlling the motion of corresponding axial slides (X, Y, and Z-axis slides), and these drivers are responsible for receiving control signals from the STM32 single-chip microcomputer, and accurately adjusting the motion of each axial motor according to these signals. The host computer sends control instructions to the driver of each axis through the STM32 single-chip microcomputer, and the driver accurately controls the motion of the corresponding axial slide according to these instructions, thereby realizing the coordinated operation of the entire control system.
[0009] A dispensing method based on machine vision mainly uses an image processing module to process the collected image data. It includes the following steps:
[0010] Step 1: Perform global acquisition at a height of h1, use the image processing module to process the globally acquired image, obtain the center coordinates of the m parts to be dispensed on the current placement board, and sort the center coordinates in the X-axis direction (or Y-axis direction);
[0011] Step 2: Move the center of the camera's field of view to the center coordinates of the i-th part (where i = 0, i < m, i++), so that the current i-th part is located at the center of the camera's field of view. Move the Z-axis to the height h2 and then perform local acquisition. Use the image processing module to process the locally acquired image. Obtain the contour of this part, and equally spaced points are taken on the contour. The equally spaced contour coordinates are used as the dispensing coordinates;
[0012] Step 3: The image processing module processes the dispensing coordinates to establish the starting point of the current dispensing path to be dispensed. Judge the distance between the obtained dispensing coordinates and the dispensing head, select the point with the closest distance as the starting point of the current dispensing operation, and transmit the dispensing coordinates to the control system in sequence. After the dispensing head moves to the starting point of the contour coordinates, move the Z-axis to the height h3, and then start dispensing;
[0013] After the dispensing of the current part is completed, it rises to the height h2. Then move the camera's field of view to the center coordinates of the next part, and repeat the above Steps 2 and 3. When the dispensing operation is completed for the last part (i.e., the m-th part), the Z-axis will rise to the height h1 after the dispensing of this part is completed.
[0014] The above steps involve three heights, namely: the global acquisition height h1; the local acquisition height h2; the actual dispensing operation height h3. The global acquisition is only performed once and is processed by the image processing module at one time; while the local acquisition will be performed multiple times, and each time after the acquisition, it is immediately processed by the image processing module, specifically based on the m value obtained by the image processing module; in addition, by ensuring that the heights h1 and h2 of the two acquisitions are both higher than h3, the risk of accidental collision between the dispensing head and the part during the acquisition movement of the dispenser is reduced, thereby protecting the dispensing head and reducing the possibility of equipment damage.
[0015] The image processing module will process the image acquired globally, and use the target detection algorithm to obtain the number of parts to be dispensed on the placement board and the center coordinates of the parts to be dispensed during the processing (where i = 0, i < m, i++). And sort the X-axis direction (or Y-axis direction) of the center coordinates of the parts to be dispensed in terms of size, and use this as the order of local acquisition of the parts to be dispensed;
[0016] The image processing module uses the locally collected image to obtain the dispensing coordinates in step 2: the image processing module processes the locally collected image, and uses the semantic segmentation algorithm to process it in the process. Semantic segmentation can classify each pixel in the image according to its semantic category, realize pixel-level semantic understanding, and then segment the background area and the workpiece area in the image, and generate a corresponding semantic map. Through semantic segmentation, the image content is simplified into two areas. Since the semantic map only contains the background area and the workpiece area, there is a clear boundary between the two, forming a high-contrast edge. Then, the edge extraction and contour extraction methods are used to obtain the contour information of the part to be dispensed, including contour coordinates and the number of contours. At the same time, in order to select the workpiece contour with the least distortion in the image, the center of mass of each contour will be calculated, and the distance from the center of mass of each contour to the center of the image will be calculated. The contour closest to the center of the image is the contour with the least distortion, and finally the dispensing coordinates are evenly selected. The specific implementation steps are as follows:
[0017] Step 2.1: Use the moments function in the OpenCV library to calculate the moments of the contours and extract the zero-order moment of each contour and first moment i represents the contour index value.
[0018] Step 2.2: Use the following formula to calculate the centroid coordinates of each contour
[0019]
[0020] Step 2.3: Calculate the distance d from the centroid of each contour to the center of the image i .
[0021]
[0022] Among them, (X c , Y c ) represents the optical axis center coordinates of the image.
[0023] Step 2.4: Find the minimum contour closest , let f(x) function be used to extract the xth contour.
[0024]
[0025] As shown above, the contour with the smallest distortion is selected. In order to optimize the dispensing route, the contour point closest to the dispensing head will be used as the starting point of dispensing.
[0026] Technical effects and advantages of this application:
[0027] 1. Aiming at the visual positioning problem caused by the diversity of workpiece morphology and spatial distribution characteristics, such as the influence of factors such as the shape, size, and position of the workpiece, the present invention proposes a dispensing method based on machine vision. Due to the single global acquisition, the workpiece far away from the image acquisition module will have a large distortion in the image, which will produce a significant position detection error. To this end, this system adopts a composite acquisition scheme of "global acquisition positioning + local acquisition calibration". Specifically: first, global acquisition is performed through a wide-angle field of view to complete the preliminary identification of the workpiece array, and the geometric center coordinates of each workpiece are solved based on the digital image processing algorithm; then the high-precision motion platform is driven to move the visual module to each target coordinate for local acquisition in turn. During local acquisition, the workpiece body is located as close as possible to the center area of the optical axis of the image acquisition device to ensure that the distortion of the workpiece in the image is minimized, the error generated is also minimized, and the height of the two acquisitions is ensured to be higher than the height of the part, so as to reduce the dispensing head and the part from accidentally colliding during the acquisition process of the dispensing machine to damage the dispensing head. Through this composite acquisition scheme, the inherent defects of the traditional single-field acquisition system are effectively solved.
[0028] 2. The present invention achieves efficient identification and precise positioning of workpieces by integrating advanced target detection algorithms and semantic segmentation algorithms. This innovative technology not only eliminates the tedious process of operators manually adjusting the working path of the dispensing machine according to the specific position and shape of the parts to be dispensed in traditional dispensing operations, but also greatly reduces the workload of operators through automation. At the same time, the high-precision positioning based on the target detection algorithm and the precise analysis of the shape and area of the workpiece by the semantic segmentation algorithm significantly improve the efficiency and quality of the dispensing operation, and further enhance the flexibility and versatility of the dispensing system. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] Figure 1 It is an overall schematic diagram of the glue dispensing device of the present invention;
[0030] Figure 2 This is a schematic diagram of the interior of the slide of the present invention (taking the X-axis slide as an example)
[0031] Figure 3 It is a schematic diagram of the control system structure of the present invention;
[0032] Figure 4 It is a schematic diagram of the height change of the Z axis of the dispensing device of the present invention;
[0033] Figure 5 It is a flow chart of the dispensing operation of the present invention.
[0034] In the figure: 1. Base; 2. Y-axis slide; 3. Placement plate; 4. Dispensing head; 5. Fixing plate B; 6. Image acquisition fixing plate; 7. Fixing plate A; 8. Glue cylinder; 9. Feeding glue valve; 10. Z-axis slide; 11. X-axis slide; 12. Frame; 13. Connecting plate A; 14. Connecting plate B; DETAILED DESCRIPTION
[0035] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. 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 making creative work are within the scope of protection of the present invention.
[0036] This embodiment takes a dispensing device and method based on machine vision positioning as an example and combines the accompanying drawings to further illustrate the technical solution of the present invention.
[0037] On the one hand, if Figures 1 to 3 The embodiment of the present invention shown in the figure discloses a dispensing device based on machine vision, including a gantry-type dispensing machine body, an image acquisition module and a control system. The gantry-type dispensing machine body includes a frame and a glue cylinder. A base is arranged at the bottom of the frame, a Y-axis slide is arranged above the base, a placement plate is arranged above the slider of the Y-axis slide, an X-axis slide is arranged above the frame, a material delivery glue valve is arranged on one side of the frame, a connecting plate A is fixedly installed on one side of the slider of the X-axis slide, a Z-axis slide is fixedly installed on one side of the connecting plate A, a connecting plate B is fixedly installed on one side of the slider of the Z-axis slide, a fixed plate A and a fixed plate B are arranged on one side of the connecting plate B, the glue cylinder is inlaid and installed between the fixed plate A and the fixed plate B, and a dispensing head is fixedly installed on the bottom of the glue cylinder, an image acquisition fixed plate is fixedly installed on the outer wall of one side of the fixed plate A, a material delivery rubber hose is arranged between the material delivery glue valve and the glue cylinder, and an image acquisition placement area with a hollow square hole is arranged in the middle of the image acquisition fixed plate.
[0038] The image acquisition module is composed of an industrial camera and is used to acquire images of the parts to be dispensed. The image acquisition module is installed in the image acquisition placement area, which is located in the hollow square hole of the image acquisition fixing plate. The image acquisition fixing plate is longer and wider than the fixing plate A, and is used to prevent the light source from reflecting on the metal surface during the dispensing operation and reduce the impact of the reflection on the image acquisition. The image acquisition placement plate is connected to the fixing plate A, and the fixing plate A is used to fix the position of the glue cylinder and moves synchronously with the movement of the Z-axis slider, thereby ensuring that the spatial position between the image acquisition module and the dispensing head is relatively fixed.
[0039] The control system consists of a host computer, an STM32 single-chip microcomputer, an X-axis driver, a Y-axis driver, and a Z-axis driver. The X, Y, and Z-axis drivers are devices used to control the movement of the corresponding axial slides (X, Y, and Z-axis slides). These drivers are responsible for receiving control signals from the STM32 single-chip microcomputer and precisely adjusting the movement of their respective axial motors according to these signals. The host computer sends control instructions to each axial driver through the STM32 single-chip microcomputer, and the driver then precisely controls the movement of the corresponding axial slide according to these instructions, thus realizing the coordinated operation of the entire control system.
[0040] On the other hand, as Figure 4 and Figure 5 shown, the embodiment of the present invention discloses a positioning method based on machine vision. In this embodiment, images are mainly collected globally and locally, and are respectively handed over to the target detection model and the semantic segmentation model for processing, and finally the dispensing coordinates are output to complete the dispensing task. Before starting the dispensing operation, two preliminary preparation tasks need to be completed: constructing the target detection and semantic segmentation models, and camera calibration.
[0041] First, to achieve efficient recognition and positioning of workpieces, it is necessary to construct a target detection model and a semantic segmentation model. Use the image acquisition module to collect images of the parts to be dispensed, and construct the corresponding target detection data set and semantic segmentation data set, including the training set and the test set, to ensure the generalization ability and accuracy of the model. Then, train the semantic segmentation model and the target detection model respectively, and finally integrate the trained models into the image processing module to ensure that data images can be processed in real time and accurately during the actual dispensing process.
[0042] Second, to ensure the accuracy of the image acquisition module, camera calibration is required. Place the calibration board on the placement board, ensure that the plane of the calibration board is parallel to the dispensing platform, and the feature points on the calibration board are clearly visible. After calibration, remove the calibration board from the placement board, and place the parts to be dispensed on the placement board to ensure that they can be captured by the image acquisition module.
[0043] The specific implementation steps are as follows:
[0044] Step 1: Collect global images. After the dispenser starts, the image acquisition module starts to collect global images at height h1. After the image acquisition is completed, the image data will be transmitted to the image processing module, and the image processing module is used to process the globally collected images to obtain the center coordinates of m parts to be dispensed on the current placement board. According to the output results of the algorithm and (where i = 0, i < m, i++), the center coordinates It can be calculated by the following formula. After calculating the center coordinates of the parts with glue dots on the placement board, sort these center coordinates in the x-axis direction (or y-axis direction) for the planning of the glue dispensing path.
[0045]
[0046] Step 2: Acquire local images. Based on the global acquisition, the image acquisition module will successively move to the center coordinates of the i-th part (where i = 0, i < m, i++), making the current i-th part located at the center of the camera's field of view. Subsequently, the Z-axis moves to the height h2 for local image acquisition. After the local image acquisition, the image data will be transmitted to the image processing module and processed by the semantic segmentation model therein to segment the background area and the workpiece area, generating a semantic map; the contour information of the part is obtained through edge extraction and contour extraction methods. Then, according to the method of the closest distance to the image center, the contour with the least distortion is selected, and finally, points are evenly sampled to obtain the glue dispensing coordinates. The specific implementation steps are as follows:
[0047] Step 2.1: Use the moments function in the OpenCV library to calculate the moments of the contour and extract the zero-order moment of each contour and the first-order moment i represents the contour index value.
[0048] Step 2.2: Calculate the centroid coordinates of each contour using the following formula
[0049]
[0050] Step 2.3: Calculate the distance d from the centroid of each contour to the image center i .
[0051]
[0052] where (X c , Y c ) represents the optical axis center coordinates of the image.
[0053] Step 2.4: Find the minimum contour contour closest , and the function f(x) can extract the x-th contour.
[0054]
[0055] Step 3: Establish the starting point of the dispensing path of the current part. After obtaining the dispensing coordinates of the current part, in order to plan the optimal dispensing route, the system will select the contour point closest to the dispensing head as the starting point of dispensing. The determined dispensing coordinates are transmitted to the control system of the dispensing machine, and the dispensing head moves to the starting point of the contour coordinates based on the coordinate information transmitted to the single-chip microcomputer. After reaching the starting point, the Z axis will move to the preset actual dispensing height h3, and then prepare to start the dispensing task of the i-th part to be dispensed. After waiting for the dispensing of the current part to be completed, the image acquisition module will move to the height of h2, that is, the dispensing head will also be raised to a safe position at the same time to avoid accidental collision between the dispensing head and the part when the field of view of the image processing module moves to the center of the next part.
[0056] Step 4: Repeat steps 2 and 3 until all dispensing tasks are completed and the Z axis returns to the starting height h1.
[0057] The embodiments described above are only descriptions of the preferred embodiments of the present invention and are not intended to limit the scope of the present invention. Without departing from the design spirit of the present invention, various modifications and improvements made to the technical solutions of the present invention by ordinary technicians in this field should all fall within the protection scope determined by the claims of the present invention.
Claims
1. A dispensing device based on machine vision positioning, characterized in that: It includes a gantry dispensing machine main body, an image acquisition module and a control system. The gantry dispensing machine main body includes a frame (12) and a glue cylinder (8). A base (1) is provided at the bottom of the frame (12). Above the base (1), a Y-axis slide (2) is provided. Above the slider of the Y-axis slide (2), a placement plate (3) is provided. Above the frame (12), an X-axis slide (11) is provided. And on one side of the frame (12), a feeding glue valve (9) is provided. On one side of the slider of the X-axis slide (11), a connecting plate A (13) is fixedly installed. On one side of the connecting plate A (13), a Z-axis slide (10) is fixedly installed. On one side of the slider of the Z-axis slide (10), a connecting plate B (14) is fixed. On one side of the connecting plate B (14), a fixing plate A (7) and a fixing plate B (5) are provided. The glue cylinder (8) is embedded and installed between the fixing plate A (7) and the fixing plate B (5). And at the bottom of the glue cylinder (8), a dispensing head (4) is fixedly installed. On the outer wall of one side of the fixing plate A (7), an image acquisition fixing plate (6) is fixedly installed. A feeding glue pipe is provided between the feeding glue valve (9) and the glue cylinder (8). In the middle of the image acquisition fixing plate (6), an image acquisition placement area with a hollow square hole is provided.
2. The dispensing device based on machine vision positioning according to claim 1, characterized in that: The image acquisition module consists of an industrial camera and is used to acquire images of the parts to be dispensed.
3. The dispensing device based on machine vision positioning according to claim 1 is characterized in that: The control system consists of a host computer, an STM32 single-chip microcomputer, an X-axis driver, a Y-axis driver and a Z-axis driver; the X, Y, and Z-axis drivers are drive motors used to control the corresponding X-axis slide (11), Y-axis slide (2) and Z-axis slide (10).
4. A dispensing method based on machine vision positioning, using the dispensing device as described in claims 1 to 3, characterized in that: The method includes an image processing module that integrates the object detection algorithm and semantic segmentation algorithm in machine learning and is used to process the acquired image data to obtain dispensing coordinates. It is characterized in that it is specifically divided into the following three steps: Step 1: Perform global acquisition at height h1. Use the image processing module to process the globally acquired image to obtain the center coordinates of m parts to be dispensed on the current placement plate, and sort the center coordinates in the X-axis direction (or Y-axis direction); Step 2: Move the center of the camera's field of view to the center coordinates of the i-th part (where i = 0, i < m, i++). After the Z-axis moves to height h2, perform local acquisition. Use the image processing module to process the locally acquired image. Obtain the contour of this part and equally spaced points on the contour as the dispensing coordinates; Step 3: The image processing module processes the dispensing coordinates and establishes the starting point of the current dispensing path. Judge the distance between the obtained dispensing coordinates and the dispensing head, select the point with the closest distance as the starting point of the current dispensing operation, and transmit the coordinates to the control system in sequence. After the dispensing head moves to the starting point of the contour coordinates, the Z-axis moves to height h3, and then dispensing starts; After the dispensing of the current part is completed, the Z axis rises to the height h2, and then the camera field of view moves to the center coordinates of the next part, and the above steps 2 and 3 are repeated. When the dispensing operation is completed to the last part (that is, the mth part), the Z axis will rise to the starting height h1 after the dispensing operation of this part is completed.
5. The dispensing method based on machine vision positioning according to claim 4 is characterized in that: The three steps involve three different heights: global acquisition height h1; local acquisition height h2; actual dispensing operation height h3. In addition, by ensuring that the heights h1 and h2 of the two acquisitions are both higher than h3, the risk of the dispensing head accidentally colliding with the parts during the acquisition and movement of the dispensing machine is reduced, thereby protecting the dispensing head and reducing the possibility of equipment damage.
6. The dispensing method based on machine vision positioning according to claim 4 is characterized in that: The global acquisition is performed only once and is processed once by the image processing module.
7. The dispensing method based on machine vision positioning according to claim 4 is characterized in that: The local acquisition is performed multiple times, and the image module processes the local acquisition immediately after each acquisition, specifically based on the m value obtained by the image processing module.
8. The dispensing method based on machine vision positioning according to claim 4 is characterized in that: The image processing module processes the globally acquired image, uses the target detection algorithm to obtain the number of parts to be glued on the placement board and the center coordinates of the parts to be glued, and sorts the center coordinates of the parts to be glued in the X-axis direction (or Y-axis direction) to determine the order of local acquisition.
9. The dispensing method based on machine vision positioning according to claim 4 is characterized in that: In step 2, the image processing module processes the image using a semantic segmentation algorithm during the local acquisition process, segments the background area and the workpiece area, and generates a semantic map; obtains the contour information of the part, including contour coordinates and the number of contours, through edge extraction and contour extraction methods; calculates the distance from the centroid of each contour to the center of the image, selects the contour closest to it as the contour with the least distortion, and evenly selects the dispensing coordinates. The specific implementation steps are as follows: Step 2.1: Use the moments function in the OpenCV library to calculate the moments of the contours and extract the zero-order moment of each contour. and first moment i represents the contour index value. Step 2.2: Use the following formula to calculate the centroid coordinates of each contour Step 2.3: Calculate the distance d from the centroid of each contour to the image center i . Among them, (X c , Y c ) represents the center coordinates of the image. Step 2.4: Find the minimum contour closest , let f(x) function be used to extract the xth contour.
10. The dispensing method based on machine vision positioning according to claim 4, characterized in that: There is no need to prescribe a uniform dispensing path for the same batch of parts to be dispensed.