Brushless motor driver board PCBA fitting control method and system

By using closed-loop control involving visual positioning, coordinate transformation, and path optimization, the problems of insufficient positioning accuracy and low efficiency in the PCBA bonding process of brushless motor drive boards are solved, achieving an efficient and stable dispensing process.

CN121985489APending Publication Date: 2026-05-05DEXIN INTELLIGENT CONTROL (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
DEXIN INTELLIGENT CONTROL (SHENZHEN) CO LTD
Filing Date
2026-02-03
Publication Date
2026-05-05

AI Technical Summary

Technical Problem

The existing brushless motor drive board PCBA bonding process suffers from problems such as insufficient positioning accuracy, disconnection between pixel coordinates and execution coordinates, and travel redundancy leading to limited efficiency, especially when multiple products are arranged in disorder, making efficient dispensing impossible.

Method used

Images are acquired using an industrial camera with top-down vision. Candidate dispensing regions are extracted through channel decomposition, morphological operations, and connected component analysis. Edges are obtained by combining template convolution and Hilditch thinning. Center coordinates and pose angles are calculated. Coordinate transformation is established using EyetoHand calibration. The dispensing sequence is optimized using a simulated annealing algorithm, and dispensing quality is ensured through closed-loop correction.

Benefits of technology

It improves the positioning accuracy and efficiency of dispensing, reduces the probability of manual parameter adjustment, achieves efficient dispensing for disordered products, and ensures cycle consistency and yield.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121985489A_ABST
    Figure CN121985489A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of PCBA lamination, in particular to a brushless motor driver board PCBA lamination control method and system, and the method comprises the steps: enabling an industrial camera to overlook and collect a tray image, and obtaining a binary image through channel decomposition, median filtering and threshold segmentation; candidate areas are screened out through morphology and connected domains, Sobel edge convolution edge taking is carried out, and a single-pixel contour is obtained through Hilditch refinement rules; rotating the boundary to obtain a minimum enclosing rectangle, calculating a center coordinate point and an attitude angle, and completing pixel-actual area conversion and length-width ratio / area threshold screening according to a scale; establishing conversion from an image to a working coordinate based on Eye-to-Hand, and generating a linear dispensing track and speed of a reserved edge; the sequence of multiple regions is optimized through traveling salesman and simulated annealing; and X / Y linkage, Z-axis up-and-down and constant glue spitting are achieved, and glue dispensing is completed point by point without returning to zero. The problems that the efficiency is limited due to the fact that existing dispensing is insufficient in positioning precision, pixel coordinates and execution coordinates are disjointed, and stroke redundancy is caused can be solved, and the problem that dispensing in the prior art cannot adapt to disordered products can be solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of dispensing control technology, and in particular to a method and system for bonding control of a brushless motor drive board (PCBA). Background Technology

[0002] In the manufacturing process of brushless motor (BLDC) drive control products, the drive board PCBA typically integrates power devices, sampling / control circuits, and connectors, characterized by high device density, high thermal / electrical stress, and stringent requirements for insulation and sealing consistency. To meet process requirements such as heat dissipation, vibration reduction, sealing, and moisture protection, bonding processes are often required for the drive board PCBA during production. This includes applying adhesive / thermal conductive adhesive to designated areas before bonding it to structural components (such as heat sinks, cover plates, and insulating gaskets), or performing linear / regional dispensing before encapsulation to form a stable bonding and sealing interface. The bonding quality directly affects the adhesive strength, heat conduction path, sealing reliability, and appearance consistency of the drive board, thus impacting the long-term stable operation of the brushless motor system.

[0003] In existing PCBA bonding processes, common methods include manual dispensing followed by bonding, or using semi-automatic / automatic dispensing equipment with fixture positioning before bonding. These approaches generally suffer from the following problems: First, they are highly dependent on the consistency of tooling and fixture placement, typically requiring PCBAs to be arranged in a fixed position and orientation within a tray. Any translational or rotational deviations caused by incoming materials or placement, or the random placement of multiple PCBAs on the same tray, can easily lead to a mismatch between the dispensing trajectory and the actual bonding area, resulting in defects such as uneven glue application, insufficient glue, excessive glue, or glue overflow. Second, while some equipment incorporates machine vision for positioning, traditional methods based on threshold segmentation, template matching, and geometric features are sensitive to light reflection, background color differences, and workpiece surface texture, often requiring frequent manual parameter adjustments to maintain stable recognition results. Furthermore, most solutions only output pixel coordinates or local offsets, lacking precise mapping and unified calibration with the motion platform's working coordinates. This leads to accumulated errors between the visual positioning results and the dispensing execution coordinates, affecting bonding consistency and yield. Third, in the scenario of processing multiple pallets on the same pallet, existing technologies often return point by point or return to zero in a fixed order, lacking global optimization of multi-area trajectories, resulting in travel redundancy, limited cycle time, and difficulty in improving efficiency. Summary of the Invention

[0004] In view of the above technical problems, the present invention provides a brushless motor drive board PCBA bonding control method and system to solve the problems of insufficient positioning accuracy, disconnection between pixel coordinates and execution coordinates, and efficiency limitation caused by stroke redundancy in the existing dispensing technology, as well as the problem that the existing dispensing technology cannot adapt to disordered products.

[0005] Other features and advantages of this disclosure will become apparent from the following detailed description, or may be learned in part by practice of this disclosure.

[0006] According to one aspect of the present invention, a method for bonding and controlling a brushless motor drive board PCBA is proposed, the method comprising steps S1-S8: S1: Image acquisition. The image is captured by an industrial camera from a top-down perspective, showing a tray carrying multiple PCBAs. S2: Perform channel decomposition on the image to obtain a binary image; S3: Perform morphological opening and closing operations and connected component analysis on the binary image to remove non-target regions and obtain several candidate dispensing regions; S4: For each candidate dispensing region, a template is used to perform convolution in the horizontal and vertical directions to obtain an approximate gradient, and the edge is extracted according to the gradient magnitude threshold; pixels on the outer layer of the edge are iteratively deleted according to the Hilditch thinning rule without destroying the connectivity, to obtain a continuous contour with a single pixel width for each candidate dispensing region. S5: Calculate the rectangular area of ​​each candidate dispensing region and select the smallest area as the minimum bounding rectangle. Calculate the center coordinates and attitude angles from the four vertices of the minimum bounding rectangle. By proportionally converting the actual area of ​​the reference scale area to the pixel area, the actual area represented by each pixel is obtained, thus obtaining the dispensing region area. Abnormal areas are removed according to the preset aspect ratio and area threshold to obtain the true dispensing region of each candidate dispensing region. S6: Based on Eye to Hand calibration uses corresponding data from multiple sets of pixel coordinates and mechanical coordinates to obtain the intrinsic and extrinsic parameters and distortion model of the industrial camera, and establishes the transformation relationship from image coordinates to the platform working coordinate system; the center coordinate point and the attitude angle are converted into the actual pose of the dispensing needle. S7: For a single real dispensing area, a linear dispensing trajectory from the starting point to the ending point is generated based on its geometric dimensions and boundary margins, and the dispensing time is limited to determine the dispensing speed; for multiple dispensing areas, a traveling salesman model is established with the origin, each of the central coordinate points, and the closed loop of the origin as the target, and a simulated annealing algorithm is used to generate new solutions by exchanging neighboring operators according to the adjacent order, starting from a random dispensing sequence, accepting solutions with higher costs with a probability that decreases as the temperature decreases, and iterating according to the temperature decay coefficient until the termination condition is met, thereby obtaining an optimized dispensing sequence; S8: The obtained linear dispensing trajectory, dispensing speed, and dispensing sequence are sent to the motion controller to control the X / Y axis linkage, the Z axis up and down, and drive the dispensing needle to perform dispensing with a constant dispensing volume; after completing one dispensing, the needle does not return to zero, but moves directly to the next dispensing location according to the dispensing sequence until all dispensing is completed.

[0007] Furthermore, the channel decomposition of the image in step S2 specifically includes: The red channel was used as the grayscale input to increase the contrast between the dispensing area and the background, thus obtaining a grayscale image. Median filtering was used to remove impulse noise from the grayscale image; The binary image is obtained by calculating the occurrence probability of each gray level, the weights and means of the two types of pixels on the global gray-level histogram of the gray-level image, and selecting the threshold that maximizes the square of the difference between the two types of means in the weighted sense.

[0008] Furthermore, step S5 specifically includes: The minimum bounding rectangle is calculated using the boundary rotation method. During the calculation, the region is rotated to the horizontal according to the direction angle of each line segment of the boundary relative to the X-axis. The vertices and area of ​​the bounding rectangle under each rotation are recorded, and the one with the smallest area is selected as the minimum bounding rectangle. The center coordinates and the attitude angle are obtained from the four vertices of the minimum bounding rectangle; Using a reference scale area with a known actual area and its pixel area as a benchmark, the actual area of ​​each pixel is calculated according to the area ratio, and then the area of ​​the dispensing area is obtained by counting pixels. The actual dispensing area is retained based on the criteria that the aspect ratio is within a preset range and the pixel area is within a preset window.

[0009] Furthermore, step S6 specifically uses the pixel coordinates of multiple calibration points and their corresponding mechanical coordinates, combined with the intrinsic and extrinsic parameters of the industrial camera and the distortion model, to obtain the homogeneous transformation matrix from the image coordinates to the platform working coordinate system through least squares solution, and then performs linear interpolation correction on the transformed coordinates to obtain the transformation relationship.

[0010] Furthermore, the generation of the linear dispensing trajectory in step S7 specifically includes: For the actual dispensing area of ​​the predetermined size, a longitudinal margin and a transverse margin are set along the long side; Set the dispensing width to be equal to the inner diameter of the dispensing needle; Limit the time for each dispensing cycle to determine the dispensing speed accordingly; The starting point and ending point are obtained by geometric calculation of the center coordinate point, attitude angle and margin in the working coordinate system, and the needle movement trajectory is generated by linear interpolation to obtain the linear dispensing trajectory.

[0011] Furthermore, the simulated annealing algorithm includes: Set the initial temperature and coefficient for exponential decay; Set the number of iterations for each temperature; The neighborhood operator uses either the exchange of two points in sequence or the reconnection of broken links; The probability of accepting a worse solution decreases as the temperature decreases until the temperature drops to a termination threshold or the objective function changes less than a preset amount within a continuous temperature range, at which point the dispensing sequence is output.

[0012] Furthermore, the method also includes performing quality inspection and closed-loop correction after dispensing is completed: An image of the dispensing area is captured by an industrial camera. The length and width of the actual dispensing area are measured along the long and short sides of the minimum bounding rectangle, and it is determined whether they are within the preset tolerance. If the error exceeds the tolerance, adjust the binarization threshold, edge threshold, or dispensing speed and update the path and trajectory of subsequent batches.

[0013] Furthermore, the quality inspection and closed-loop correction also include: After the industrial camera captures the image after the dispensing is completed, the detection model based on CenterNet-MobileNetV2 is called to automatically locate the clipping range of each actual dispensing area, and clipping and normalizing it according to a fixed size to obtain the detection image; The cropped detection image is fed into a convolutional neural network classifier, which sequentially performs convolution, pooling, discarding, and fully connected layers, and outputs the classification result and its classification confidence. The classification result includes one of low glue, good, and high glue. Set the classification threshold to maximize the harmonic mean of precision and recall. When the classification result is insufficient glue or excessive glue, at least one of the dispensing parameters is adjusted according to a predetermined priority. The dispensing parameters include dispensing time, dispensing speed, and dispensing volume. The adjusted dispensing parameters are then applied to subsequent workpieces during the execution of steps S7 and S8 in the method.

[0014] Furthermore, the quality inspection and closed-loop correction are based on interpretable machine vision to locate and quantify the classification results, and drive parameter correction accordingly, specifically including: The feature map of the last convolutional layer of the convolutional neural network classifier is obtained, and the feature maps are averaged in the spatial dimension to obtain weights. The feature maps are weighted and summed to suppress negative contributions, resulting in a heatmap of the same size as the input image. This heatmap is then superimposed on the input image to highlight the pixel regions that play a major role in the classification result. A reference image is obtained, and the activation difference between the detected image and the reference image is calculated by backtracking from the output layer to the input layer of the convolutional neural network classifier, thereby assigning a positive / negative contribution score to each pixel for the current determination, and obtaining a contribution map; Align the heatmap and the contribution map with the attitude angle of the minimum bounding rectangle, integrate the pixel contribution along the glue line direction near the two vertical sides of the minimum bounding rectangle, and obtain the contribution integral difference between the left and right sides as the non-uniformity index; when the non-uniformity index exceeds the threshold, correct one or more of the starting position of the linear dispensing trajectory, the margin, and the dispensing speed in step S7 according to the rules, and perform dispensing in step S8 with the corrected linear dispensing trajectory.

[0015] According to a second aspect of this disclosure, a brushless motor drive board PCBA bonding control system is provided, the system comprising: The acquisition module is used to acquire images, which are obtained by an industrial camera from a top-down perspective of the tray carrying multiple PCBAs. The preprocessing module is used to perform channel decomposition on the image to obtain a binary image; The candidate region extraction module is used to perform morphological opening and closing operations and connected component analysis on the binary image to remove non-target regions and obtain several candidate dispensing regions. The edge extraction module is used to perform convolution in the horizontal and vertical directions on each candidate dispensing region using a template to obtain an approximate gradient, and extract the edge according to the gradient magnitude threshold; iteratively delete pixels on the outer layer of the edge without destroying connectivity according to the Hilditch thinning rule to obtain a continuous contour with a single pixel width for each candidate dispensing region. The pose and geometric parameter calculation module is used to calculate the rectangular area of ​​each candidate dispensing region and select the smallest area as the minimum bounding rectangle. The center coordinate point and pose angle are calculated from the four vertices of the minimum bounding rectangle. By proportionally converting the actual area of ​​the reference scale area to the pixel area, the actual area represented by each pixel is obtained, thereby obtaining the dispensing region area. Abnormal areas are removed according to the preset aspect ratio and area threshold to obtain the true dispensing region of each candidate dispensing region. Coordinate transformation module, used for Eye-based coordinate transformation to Hand calibration uses corresponding data from multiple sets of pixel coordinates and mechanical coordinates to obtain the intrinsic and extrinsic parameters and distortion model of the industrial camera, and establishes the transformation relationship from image coordinates to the platform working coordinate system; the center coordinate point and the attitude angle are converted into the actual pose of the dispensing needle. The path planning module is used to generate a linear dispensing trajectory from the starting point to the ending point for a single real dispensing area based on its geometric dimensions and boundary margins, and to limit the dispensing time to determine the dispensing speed. For multiple dispensing areas, a traveling salesman model is established with the origin, each of the central coordinate points, and the closed loop of the origin as the target. The simulated annealing algorithm is used to generate new solutions by exchanging neighboring operators according to the adjacent order, starting from a random dispensing sequence. Solutions with higher costs are accepted with a probability that decreases as the temperature decreases, and the process is iterated according to the temperature decay coefficient until the termination condition is met, thereby obtaining an optimized dispensing sequence. The control execution module is used to send the obtained linear dispensing trajectory, dispensing speed and dispensing sequence to the motion controller, control the X / Y axis linkage, the Z axis up and down and drive the dispensing needle to perform dispensing with a constant dispensing volume; after completing one dispensing, it does not return to zero, but moves directly to the next dispensing according to the dispensing sequence until all dispensing is completed.

[0016] The technical solution disclosed herein has the following beneficial effects: By establishing a closed loop of visual positioning, coordinate transformation, path optimization, and stable execution, the efficiency of dispensing is greatly improved, and the probability of manual parameter readjustment is reduced. Through grayscale conversion, median filtering, binarization, edge computing, and Hilditch refinement, combined with the minimum bounding rectangle, the center, pose, and area of ​​the dispensing area are stably extracted, providing reliable pose for subsequent planning. Subsequently, eye-to-hand calibration is used to convert pixel coordinates into the actual working coordinates of the dispensing needle, avoiding the direct use of pixel coordinates for motion control, which would lead to an inoptimal path. Under multi-point conditions, path optimization methods such as simulated annealing are introduced, which significantly reduces the total dispensing path and running time. The integrated control structure of each dispensing device ensures cycle time and consistency, and makes it applicable to products with disordered arrangement. Attached Figure Description

[0017] Figure 1 This is a flowchart of a brushless motor drive board PCBA bonding control method in an embodiment of this specification; Figure 2 This is a structural block diagram of a brushless motor drive board PCBA bonding control system according to an embodiment of this specification. Detailed Implementation

[0018] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided to make this disclosure more comprehensive and complete, and to fully convey the concept of the example embodiments to those skilled in the art. The described features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a full understanding of embodiments of this disclosure. However, those skilled in the art will recognize that the technical solutions of this disclosure can be practiced with one or more of the specific details omitted, or other methods, components, apparatus, steps, etc., can be employed. In other instances, well-known technical solutions are not shown or described in detail to avoid obscuring various aspects of this disclosure.

[0019] Furthermore, the accompanying drawings are merely illustrative of this disclosure. The same reference numerals in the drawings denote the same or similar parts, and therefore repeated descriptions of them will be omitted. Some block diagrams shown in the drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities may be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.

[0020] This invention provides a method for controlling the bonding of a brushless motor driver board (PCBA). (Refer to...) Figure 1 The diagram shown is a flowchart illustrating a brushless motor drive board (PCBA) bonding control method according to an embodiment of the present invention. This method can be applied to electronic devices such as personal computers, servers, controllers, and host computers. The method can be executed by a device, which can be implemented by software and / or hardware. Specifically, the method may include the following steps S101-S108: In step S101, an image is acquired, which is a tray carrying multiple PCBAs captured by an industrial camera from a top-down perspective.

[0021] The imaging system uses an industrial camera, lens, and light source fixed on a vision support to perform top-down imaging of a tray carrying multiple PCBAs. To ensure that a single image covers the effective area of ​​the tray, the tray is placed within the camera's field of view. The camera's installation position and working distance are fixed according to the machine's process cycle, allowing the camera to obtain a raw image containing multiple PCBAs from a top-down perspective. The placement, spacing, and order of the PCBAs can be irregular.

[0022] In step S102, the image is decomposed into channels to obtain a binary image. Specifically, the channel decomposition of the image includes: using the red channel as the grayscale input to increase the contrast between the glue-dispensing area and the background to obtain a grayscale image; using median filtering to remove impulse noise from the grayscale image; and calculating the occurrence probability of each grayscale level, the weights and means of the two types of pixels on the global grayscale histogram of the grayscale image, and selecting the threshold that maximizes the square of the difference between the two types of means under the weighted meaning as the segmentation threshold to obtain the binary image.

[0023] In this process, the RGB image acquired in step S101 is first decomposed into channels by the host computer and then processed as a single channel. The industrial camera is a 2D camera combined with a coaxial / ring light to form a top-down imaging component. After channel decomposition, the contrast between the three color channels and the background is evaluated first. In actual scenarios, the grayscale difference between the R component and the dispensing area is more obvious, which can better distinguish the dispensing area from the tray / substrate background. Therefore, the R component is selected as the subsequent grayscale input image. If it is necessary to obtain grayscale from RGB in a linear weighted manner, the single-component grayscale linear transformation formula can also be used: G(i,j)=WR×R(i,j)+WG×G(i,j)+WB×B(i,j), where WR, WG, and WB are weights and WR+WG+WB=1. However, in this step, directly taking the R component can enhance the contrast and simplify the calculation process. The above channel decomposition and R component selection are based on the following: In practice, after the image is decomposed into RGB three channels, it can be seen by comparison that the R channel has a large contrast with the background. Subsequent processing using the R channel as the grayscale image is more conducive to identifying the glue dotting area; the general formula of grayscale linear transformation is as described above and satisfies the constraint that the weight sum is 1.

[0024] After obtaining the grayscale image, the host computer performs denoising to reduce impulse noise introduced by the sensor / transmission while preserving edge details as much as possible. Comparison with common filtering methods reveals that: mean filtering, while effective in noise reduction, can lead to edge blurring due to suppression of high-frequency components; Gaussian filtering is complex and prone to generating greater low-frequency blur; median filtering is more effective at suppressing salt-and-pepper / impulse noise and offers better edge preservation. Based on these comparisons, using median filtering with a suitable kernel size (e.g., 3×3) can smooth noise while maintaining clarity, resulting in a bright and clear grayscale image and providing stable input for global threshold segmentation.

[0025] To separate the adhesive-dispensing area from the background, the host computer calculates the occurrence probability of each gray level, the weights and means of the two classes of pixels on the global gray-level histogram of the grayscale image, and selects the threshold T that maximizes the inter-class variance as the segmentation threshold, thus obtaining a binary image. Let the image have L gray levels, and the number of pixels with gray level i be... The total number of pixels is The probability of each gray level is: Pixels are divided into two categories based on a threshold T: The weights (pixel proportions) of the two classes. The average gray level of the two classes is The average gray level of the entire image is , and have Based on this, the inter-class variance is obtained. .exist Search within the range Take the maximum value T, and use this T to perform threshold segmentation on the grayscale image. The foreground (dispensing area) and background are binarized and distinguished, and a binary image is output.

[0026] In step S103, morphological opening and closing operations and connected component analysis are performed on the binary graph to remove non-target regions and obtain several candidate dispensing regions.

[0027] The process involves taking a binary image as input, performing morphological opening-closing operations to suppress noise and repair small breaks, followed by connected component analysis to eliminate non-target regions, retaining only regions that meet basic size and connectivity requirements as candidate dispensing regions. Morphological operations are used to clean and enhance the target region at the structural level after binarization, ensuring stable extraction of subsequent geometric and pose information. Specifically, morphological opening operations are prioritized to remove small, isolated foreground noise spots, fine burrs, or bright spots caused by illumination reflections, preventing them from being misclassified as independent targets during connected component labeling. Closing operations are then performed to fill in tiny holes and gaps within the candidate regions, ensuring the continuity of region boundaries and making the candidate regions more topologically complete. In the implementation, the scale and shape of the structural elements are used as adjustable parameters (e.g., square or cross-shaped structural elements of the same order of magnitude as the typical width of the adhesive line). Convolutional neighborhood operations are performed on the binary image in an opening-closing order, thereby preserving the main outline of the true dispensing region and suppressing background residue to the maximum extent without introducing significant boundary drift.

[0028] After morphological processing, connected component analysis is performed on the binary image. Adjacent sets of foreground pixels are marked as independent regions, and basic attributes such as pixel count (pixel measure of area), centroid, and bounding box are calculated for each region. In the specific implementation, the region metric function provided by the image processing platform can be directly called to count the number of pixels in each connected region, which is used as input for subsequent filtering and geometric calculations. Based on these metrics, a minimum pixel count threshold and rules for removing excessively large regions are set to exclude obviously inconsistent noise clumps and background remnants in the entire tray, retaining only regions above the lower limit and with complete connectivity as candidate dispensing regions.

[0029] In step S104, for each candidate dispensing region, a template is used to perform convolution in the horizontal and vertical directions to obtain an approximate gradient, and the edge is extracted according to the gradient magnitude threshold. The pixels on the outer layer of the edge are iteratively deleted according to the Hilditch thinning rule without destroying the connectivity, so as to obtain a continuous contour with a single pixel width for each candidate dispensing region.

[0030] Specifically, for each candidate dotting region, two sets of 3×3 convolution templates are used within that region to perform convolution operations on the grayscale image along the horizontal and vertical directions, respectively, to obtain approximate brightness differences in the horizontal and vertical directions. This type of convolution belongs to gradient-based first-order differential detection. First, the image is weighted and summed in two directions using 3×3 templates, and then the edge response is calculated based on this sum. Let the image function be... In pixels At this point, the gradient vector, gradient magnitude, and direction angle can be normalized as follows: ; ; ; and Using 3×3 templates in the horizontal and vertical directions respectively The response obtained from convolution is used as and The discrete approximation.

[0031] In practice, the host computer slides a 3×3 convolution template from top to bottom and from left to right across the entire candidate area, performs discrete convolution on the pixels covered by the template and updates the response value of the center pixel. Then, the maximum gradient in the horizontal and vertical responses is taken as the edge intensity of the pixel. By experimenting, a suitable threshold is selected, and pixels with intensity not lower than the threshold are marked as edge pixels, thus obtaining the preliminary edge image.

[0032] To obtain a clear skeleton suitable for subsequent geometric analysis, Hilditch thinning is performed on the edge map after thresholding. This thinning operator determines pixel by pixel whether it is a boundary point or a point necessary to maintain connectivity; if it is determined to be a boundary point, it is deleted. In practice, the process iterates repeatedly from top left to bottom right, stripping away only the outermost pixels of the edges in each iteration, until only a smooth line remains in the middle after multiple layers of outer skin have been stripped away, resulting in a single-pixel-width and connected contour. This effectively removes redundant edge information and the thick line effect of coarse edges, making the lines smoother and the contour information clearer, facilitating subsequent geometric calculations based solely on this single-pixel contour.

[0033] In step S105, the rectangular area of ​​each candidate dispensing region is calculated and the smallest area is selected as the minimum bounding rectangle. The center coordinates and attitude angles are calculated from the four vertices of the minimum bounding rectangle. The actual area represented by each pixel is obtained by proportionally converting the actual area of ​​the reference scale area to the pixel area, thereby obtaining the dispensing region area. Abnormal areas are removed according to the preset aspect ratio and area threshold to obtain the true dispensing region of each candidate dispensing region.

[0034] In this process, when dispensing multiple materials simultaneously, different PCBA materials are located in different positions on the tray. Furthermore, during the initial visual inspection or placement process, the materials may be randomly positioned, requiring boundary rotation correction. This necessitates calculating the minimum bounding rectangle using a boundary rotation method. The calculation involves rotating the region horizontally according to the direction angle of each boundary line segment relative to the X-axis, recording the vertices and area of ​​the bounding rectangle after each rotation, and selecting the smallest area as the minimum bounding rectangle. The center coordinates and orientation angles are then calculated from the four vertices of the minimum bounding rectangle. Using a reference scale area with a known actual area and its pixel area as a benchmark, the actual area of ​​each pixel is calculated proportionally, and the dispensing area is obtained by pixel counting. The true dispensing area is retained based on the aspect ratio falling within a preset range and the pixel area falling within a preset window.

[0035] Specifically, the process begins by taking the boundary polyline of the candidate region as input and evaluating the rotation of each boundary line segment relative to the X-axis: for adjacent vertices on the boundary... First, calculate the rotation angle of the line segment. Then press the boundary points. Rotate clockwise around the origin until the coordinate system is parallel to the X-axis to obtain the rotated coordinates. The rotational coordinate transformation of its discrete points is written as: ; And record the four vertices, area, and rotation angle of the circumscribed rectangle in this pose. When using When rotating back to the initial coordinate system, the corresponding inverse transformation is: ; This ensures consistency in finding the rectangle and returning to the original position. For all boundary line segments... Repeat the above process. If the area of ​​the bounding rectangle obtained in a certain rotation is less than the current minimum value, update the record with the area of ​​that rotation, the coordinates of the four vertices, and the rotation angle. Continue until all candidate angles have been traversed. Keep the group with the smallest area as the minimum bounding rectangle of the candidate region, and connect its four vertices in sequence to display it on the image as the approximate geometric shape of the region. At the same time, use the corresponding rotation angle as the attitude angle of the region for subsequent use.

[0036] After obtaining the minimum bounding rectangle, the host computer directly calculates the center coordinates and attitude angles using the four vertices of this rectangle. Let the four vertices of the minimum bounding rectangle be: Then the center coordinate point This can be obtained by averaging the diagonal points: , ; The set of rotation angles that minimizes the area of ​​the circumscribed rectangle is taken as the attitude angle of the candidate region, which is used to describe the orientation of the dispensing area in the image coordinate system.

[0037] Then, the pixel-to-actual-area ratio is calculated using the reference scale area. Let the actual area of ​​the reference scale be... Its number of pixels in the image is The number of pixels in a certain candidate region is The actual area represented by a single pixel is Based on this, the actual area of ​​the candidate region is calculated as follows: ; To eliminate non-target and abnormal areas, rule-based filtering can be applied to each candidate region based on geometric priors: First, the longer and shorter sides of the smallest bounding rectangle are used as approximations of the region's length and width, and the aspect ratio is calculated and compared with a preset range; simultaneously, the pixel area is compared to see if it falls within an empirical window. Taking a set of thresholds calibrated by microscopic measurements as an example, when the aspect ratio is within a predetermined range and the pixel area is within a specified range, it is judged as a genuine dispensing region; otherwise, it is discarded.

[0038] In step S106, based on Eye to Hand calibration uses corresponding data of multiple sets of pixel coordinates and mechanical coordinates to obtain the intrinsic and extrinsic parameters and distortion model of the industrial camera, and establishes the transformation relationship from image coordinates to platform working coordinate system; the center coordinate point and the attitude angle are converted into the actual pose of the dispensing needle.

[0039] Step S106 specifically uses the pixel coordinates of multiple calibration points and their corresponding mechanical coordinates, combined with the intrinsic and extrinsic parameters of the industrial camera and the distortion model, to obtain the homogeneous transformation matrix from the image coordinates to the platform working coordinate system through least squares solution, and then performs linear interpolation correction on the transformed coordinates to obtain the transformation relationship.

[0040] The process involves using eye-to-hand calibration to establish a quantitative correspondence between industrial camera image coordinates and the platform's working coordinate system. Specifically, this involves: first, collecting multiple sets of sample points with a one-to-one correspondence, each sample point containing both the pixel coordinates of the target in the image and the mechanical coordinates of the dispensing needle in the working coordinate system; then, combining these pixel-to-mechanical samples with pre-defined camera parameters (including intrinsic, extrinsic, and distortion parameters), and performing a coordinate transformation process to convert pixel coordinates to actual dispensing coordinates. Since the coordinates in the image are pixel coordinates, they cannot be directly used for dispensing path planning and must be calibrated and converted to actual dispensing coordinates. After completing the calibration, the obtained center coordinates and attitude angles are mapped to the platform's working coordinate system to form the actual pose of the dispensing needle. The purpose of eye-to-hand calibration is to determine the relationship between the camera coordinate system and the machine coordinate system, thereby converting the results of image acquisition and recognition into pose quantities that can be directly driven in the end effector coordinate system. Combined with the real-time display of the center point X / Y pixel coordinates and angle information on the host computer interface, the converted pose is directly used for the compilation and distribution of path planning and motion control.

[0041] In step S107, for a single real dispensing area, a linear dispensing trajectory from the starting point to the ending point is generated based on its geometric dimensions and boundary margins, and the dispensing time is limited to determine the dispensing speed. For multiple dispensing areas, a traveling salesman model is established with the origin, each of the central coordinate points, and the closed loop of the origin as the target. A simulated annealing algorithm is used to generate new solutions by exchanging neighboring operators according to the adjacent order, starting from a random dispensing sequence. Solutions with higher costs are accepted with a probability that decreases as the temperature decreases, and the process is iterated according to the temperature decay coefficient until the termination condition is met, thereby obtaining an optimized dispensing sequence.

[0042] Specifically, the generation of the linear dispensing trajectory in step S107 includes: setting a longitudinal margin and a transverse margin in the long side direction for the actual dispensing area of ​​a predetermined size; setting the dispensing width to be equal to the inner diameter of the dispensing needle; limiting the dispensing time per dispensing cycle to determine the dispensing speed accordingly; and obtaining the starting point and ending point geometrically in the working coordinate system by calculating the center coordinate point, attitude angle, and margin, and generating the needle motion trajectory through linear interpolation to obtain the linear dispensing trajectory.

[0043] As an explanation, for a single actual dispensing area, firstly, based on the geometric dimensions of the actual dispensing area (the long and short sides of the minimum bounding rectangle) and its attitude angle, the start and end points of the linear dispensing trajectory are determined in the working coordinate system according to a predetermined boundary margin rule: Using the four vertices of the minimum bounding rectangle and their attitude angles as known, geometric calculations are used to shrink the longitudinal margin along the long side and the lateral margin along the short side from the boundary, obtaining the X / Y coordinates of the two endpoints. In actual implementation, using these two endpoints as constraints, linear interpolation is used to generate the needle's motion trajectory, thus forming a linear dispensing trajectory from the start to the end point. For example, for a 5mm × 4mm PCBA, an example of boundary shrinkage is: 0.25 mm is reserved on the top and bottom sides (resulting in an effective length W1 = 4.5 mm), and 0.2 mm is reserved on the left and right sides (resulting in an effective width W2 = 3.6 mm); the dispensing width is set to be consistent with the needle's inner diameter (e.g., φ1 = 2.5 mm), forming a single linear dispensing. To meet production frequency constraints, the dispensing time t is limited. Without changing the constant dispensing volume, the linear velocity is calculated by inversely calculating the linear velocity from the path length and time. The formula for calculating the velocity during single-segment straight-line dispensing is: v1 = (L... 0.5) / t, where L is the long side of the device (mm); based on this, the center coordinate point and attitude angle are mapped to the working coordinate system, and then the linear interpolation trajectory and speed parameters can be issued to realize single-area dispensing.

[0044] As a supplement, the simulated annealing algorithm includes: setting an initial temperature and coefficients for exponential decay; setting the number of iterations at each temperature; using a neighborhood operator to swap two points or reconnect broken chains; accepting worse solutions with a decreasing probability as the temperature decreases until the temperature drops to a termination threshold or the objective function changes less than a preset amount within a continuous temperature range, and then outputting the dispensing sequence.

[0045] When multiple real dispensing areas exist, the closed loop from the origin to each center coordinate point and back to the origin is used as the objective, modeled as a Traveling Salesman Model (TSM) to minimize the total path. The improved execution order is to start from the origin and proceed to each objective point sequentially. After each dispensing operation, the system does not return to zero but directly moves to the next objective until the last dispensing operation is completed, at which point it returns to the origin. This strategy significantly shortens the total travel distance and improves efficiency. To globally optimize this order, a simulated annealing algorithm is used. An initial dispensing sequence is randomly generated within the path planning domain, and the objective function f(S) is calculated. At each temperature, a new solution is generated using neighborhood operators (such as adjacent swapping, chain reconnection, etc.). If the cost of the new solution decreases, it is accepted; if the cost increases, it is accepted with probability P(T) according to the Metropolis criterion. The temperature is iteratively decreased according to the decay coefficient until a termination condition is met, such as the temperature dropping to a threshold or the objective function changing less than a preset amount within a continuous temperature range. Finally, the optimized dispensing sequence is output. The formal description used for balancing direction and consumption includes: set up Let j be the set of path nodes, and the total requirement for direction j is... The directional requirements at the S positions are To compare paths in different directions, define The optimization function with the sum of squared deviations as the objective is: And supplemented by , , , Equal constraints, where, where For the set of node counts, Weight / Demand Assign a variable to the position.

[0046] In step S108, the obtained linear dispensing trajectory, dispensing speed, and dispensing sequence are sent to the motion controller to control the X / Y axis linkage, the Z axis up and down, and drive the dispensing needle to perform dispensing with a constant dispensing volume; after completing one dispensing, the needle does not return to zero, but moves directly to the next dispensing according to the dispensing sequence until all dispensing is completed.

[0047] The linear dispensing trajectory (a linear interpolation segment consisting of a start and end point), dispensing speed, and optimized dispensing sequence are all sent to the motion controller for compilation and execution. The controller can be configured as a PC host computer + motion control card. The motion control card is uniformly connected to servo drives, servo motors, I / O control modules, and sensors. The host computer outputs corresponding control signals based on sensor feedback, thus forming an execution link between trajectory and speed commands, the control card, and servo / pneumatic components. Field parameters such as dispensing valves, X / Y / Z three-axis limit switches, light source controllers, emergency stops, and indicators / buzzers are all connected through the digital input / output ports of the control card, facilitating coordinated control of motion and dispensing within the same platform.

[0048] During execution, the X and Y axes work together to complete planar motion, while the Z axis drives the dispensing needle up and down, achieving dispensing along a predetermined linear interpolation trajectory. The platform's three-axis mechanical structure supports linear interpolation, enabling smooth acceleration, deceleration, and trajectory following without altering the dispensing settings. The dispensing valve operates at a constant dispensing rate (approximately 1 mL per second), matching the process setting where the dispensing width equals the needle's inner diameter, thus maintaining stable glue line width and flow rate. Once dispensing in a single area is complete, the control system moves the X / Y / Z axes directly to the starting position of the next dispensing location according to the optimized sequence, continuing until dispensing in all areas is finished. Finally, it returns to the origin and is conveyed to the next process.

[0049] In this step, the dispensing needle starts from the origin, reaches the first target, and then proceeds directly to the second, third, and subsequent targets, without returning to zero after each dispensing operation. It returns to the origin in one go after completing all targets. This strategy of planning first, then issuing, and not returning to zero during execution makes the trajectory clearer and significantly shortens the total travel distance, thereby improving efficiency. The optimized path sequence is uniformly issued from the host computer to the motion controller, which then compiles and generates a continuous queue of motion segments and executes them sequentially on the axis system.

[0050] In one embodiment, the method further includes performing quality inspection and closed-loop correction after dispensing: an industrial camera is used to capture an image after dispensing, the length and width of the actual dispensing area are measured along the long and short sides of the minimum bounding rectangle, and it is determined whether they are within the preset tolerance; if they are out of tolerance, the binarization threshold, edge threshold, or dispensing speed is adjusted and the path and trajectory of subsequent batches are updated.

[0051] After dispensing, an industrial camera performs a second overhead view of the dispensed workpiece at the same vision station. The host computer reads the four vertices and attitude angles of the minimum bounding rectangle saved in step S105, aligning the detection coordinate system with the geometric principal axis of the dispensing area. Under this aligned coordinate system, the length and width of the actual dispensing area are measured along the long and short sides of the minimum bounding rectangle, respectively. In actual operation, the host computer sequentially performs length and width tests on a single workpiece on the quality inspection interface, displaying the measurement results in millimeters / micrometers. When any measurement value exceeds the preset tolerance, the host computer triggers a closed-loop correction strategy for updating the path and trajectory of subsequent batches.

[0052] Quality inspection and closed-loop correction specifically include: Firstly, regarding the segmentability and edge detectability of the image, priority is given to adjusting the binarization threshold and edge threshold. The threshold selection itself is determined based on multiple experiments. The host computer can fine-tune the threshold range according to the direction of detection deviation (e.g., narrower width corresponding to missing edges), so that the segmentation and edge extraction results of the next batch are closer to the actual glue line contour. Secondly, regarding the actual forming size on the process side, the host computer adjusts the dispensing speed parameters according to a predetermined priority. Under a constant glue dispensing volume setting, the linear speed is coupled with the actual glue line width. When the detected width is too large or too small, the dispensing speed can be appropriately reduced or increased to correct the glue line width without changing the path geometry. After the parameters are updated, they are sent to the controller along with the predetermined path and trajectory for subsequent batch execution.

[0053] In another implementation, the quality inspection and closed-loop correction further include: After the industrial camera captures the image after dispensing, a detection model based on CenterNet-MobileNetV2 is used to automatically locate the clipping range of each actual dispensing area, and clips and normalizes it to obtain a detection image. The clipped detection image is then fed into a convolutional neural network classifier, which sequentially performs convolution, pooling, discarding, and fully connected layers, outputting the classification result and its classification confidence. The classification result includes one of: low glue, good, or high glue. The classification threshold is set to maximize the harmonic mean of precision and recall. When the classification result is low glue or high glue, at least one of the dispensing parameters is adjusted according to a predetermined priority. The dispensing parameters include dispensing time, dispensing speed, and dispensing volume. The adjusted dispensing parameters are then applied to subsequent workpieces in the execution of steps S7 and S8 of the method.

[0054] After dispensing is completed, the host computer uses an industrial camera at the same vision station to re-capture a top-down view image. Using the four vertices of the minimum bounding rectangle saved in step S105 and the attitude angle as references, the detection coordinate system is axially aligned. Then, a target localization process based on CenterNet-MobileNetV2 is initiated: the detection model is used to quickly and accurately locate each actual dispensing area in the entire image, and the output bounding box is directly used as the initial value for the clipping window. In execution, the host computer clips and normalizes the located area according to a fixed size.

[0055] For each cropped and normalized detection image, the host computer feeds it into a convolutional neural network classifier for three-class classification: low glue content, good quality, and high glue content. The classifier uses four convolutional layers, pooling layers, dropout order blocks, two fully connected layers, ReLU activation, and a three-node SoftMax output layer to provide the probabilities of the three classes. The input resolution is 250×250 after cropping. The first convolutional kernel is 3×3 with a stride of 1×1, followed by 2×2 max pooling and a dropout rate of 0.2. To ensure that the online threshold has interpretable statistical significance, the host computer selects the threshold that maximizes the harmonic mean of precision and recall as the classification threshold. After obtaining the classification result and confidence level through online inference, the host computer implements closed-loop correction according to predetermined priorities: when it is judged as "insufficient glue" or "excessive glue", the binarization threshold or edge threshold is finely adjusted on the image side to improve the fit of the segmentation and edge extraction; on the process side, at least one of the three parameters of dispensing time, dispensing speed, and dispensing amount is selected for parameter correction with limited amplitude, and the updated parameters are used for trajectory generation in step S7 and execution in step S8 of subsequent batches (keeping the path geometry unchanged and compensating for the forming width of the linear speed / dispensing amount), thereby realizing a closed loop of detection, judgment, parameter update and re-execution.

[0056] In another embodiment, as a supplement, the quality detection and loop closure correction are based on interpretable machine vision to locate and quantify the classification results, and drive parameter correction accordingly. Specifically, this includes: obtaining the feature map of the last convolutional layer of the convolutional neural network classifier; averaging each feature map in the spatial dimension to obtain weights; weighting and summing the feature maps with the weights and suppressing negative contributions to obtain a heatmap of the same size as the input image; overlaying this heatmap onto the input image to highlight the pixel regions that play a major role in the classification results; obtaining a reference image; and calculating the classification results back along the output layer to the input layer of the convolutional neural network classifier. The activation difference between the detected image and the reference image is used to assign a positive / negative contribution score to each pixel for the current determination, thus obtaining a contribution map. The heat map and the contribution map are aligned according to the attitude angle of the minimum bounding rectangle. The pixel contribution is integrated along the glue line direction near the two vertical sides of the minimum bounding rectangle to obtain the contribution integral difference between the left and right sides as a non-uniformity index. When the non-uniformity index exceeds a threshold, one or more of the starting position, margin, and dispensing speed of the linear dispensing trajectory in step S7 are corrected in a rule order, and dispensing is performed in step S8 with the corrected linear dispensing trajectory.

[0057] In this implementation, after dispensing, an industrial camera acquires the inspection image at the same workstation. The host computer first calls the interpretable visualization module to locate and quantify the classification result of the convolutional neural network. One implementation uses Grad-CAM: it reads the feature map of the last convolutional layer of the classifier, performs a global average of each feature map in the spatial dimension to obtain the channel weights, and then performs a weighted summation of the feature maps using the above weights, suppressing negative contributions to obtain a heatmap of the same size as the input. This heatmap is then superimposed on the inspection image to visually highlight the pixel areas that play a major role in determining insufficient / good / excessive glue, facilitating rapid location-level explanation and evidence in online scenarios. The above process can be displayed in the host computer interface as a pseudo-color overlay, combined with the saved minimum bounding rectangle vertices and pose angle information, to ensure that the interpretation result is consistent with the geometric principal axis of the inspected area for quantification of subsequent indicators.

[0058] Another implementation involves the host computer selecting several background samples from the training samples to approximate the expected output of the classifier under background conditions. The detection image to be interpreted is paired with each background sample and input into the classification network. Following the layer-by-layer backtracking rule of DeepLIFT / Deep SHAP, the activation differences relative to the reference image are propagated from the output layer to the input layer. The differences are distributed to the input pixels to obtain pixel-level contribution scores. The scores of the same pixel on all background samples are aggregated (averaged / integrated) to form the contribution value of that pixel and mapped to a contribution map, which is then superimposed on the detection image for visualization.

[0059] After generating the heatmap and contribution map, the host computer aligns the two types of images according to the attitude angle of the minimum bounding rectangle, and sets an integration band along the glue line direction near the two vertical sides of the minimum bounding rectangle. The contribution of pixels within the band is integrated in a directional manner to obtain the contribution integration values ​​on the left and right sides. The difference between the two is used as the non-uniformity index. When the index exceeds the preset threshold, the closed-loop correction is triggered in a rule sequence: first, the starting position and margin of the linear glue dispensing trajectory in step S7 are finely adjusted, then the glue dispensing speed is adjusted, and if necessary, the glue dispensing time or glue output is slightly corrected. The updated parameters are used to regenerate the trajectory in subsequent batches by step S7 and are executed in step S8, forming a closed loop of detection, interpretation, quantification, correction and re-execution.

[0060] Based on the same line of thought, such as Figure 2 The diagram shown is a structural block diagram of a brushless motor drive board PCBA bonding control system provided in an embodiment of the present invention. The system includes: The acquisition module 201 is used to acquire images, which are obtained by an industrial camera from a top-down perspective of a tray carrying multiple PCBAs. Preprocessing module 202 is used to perform channel decomposition on the image to obtain a binary image; The candidate region extraction module 203 is used to perform morphological opening and closing operations and connected component analysis on the binary image to remove non-target regions and obtain several candidate dispensing regions. The edge extraction module 204 is used to perform convolution in the horizontal and vertical directions using a template for each candidate dispensing region to obtain an approximate gradient, and extract the edge according to the gradient magnitude threshold; iteratively delete pixels on the outer layer of the edge without destroying connectivity according to the Hilditch thinning rule to obtain a continuous contour with a single pixel width for each candidate dispensing region. The pose and geometric parameter calculation module 205 is used to calculate the rectangular area of ​​each candidate dispensing region and select the smallest area as the minimum bounding rectangle. The center coordinate point and pose angle are calculated from the four vertices of the minimum bounding rectangle. By proportionally converting the actual area of ​​the reference scale area to the pixel area, the actual area represented by each pixel is obtained, thereby obtaining the dispensing region area. Abnormal areas are removed according to the preset aspect ratio and area threshold to obtain the true dispensing region of each candidate dispensing region. Coordinate transformation module 206, used for Eye-based transformation to Hand calibration uses corresponding data from multiple sets of pixel coordinates and mechanical coordinates to obtain the intrinsic and extrinsic parameters and distortion model of the industrial camera, and establishes the transformation relationship from image coordinates to the platform working coordinate system; the center coordinate point and the attitude angle are converted into the actual pose of the dispensing needle. The path planning module 207 is used to generate a linear dispensing trajectory from the starting point to the ending point based on the geometric dimensions and boundary margins of a single real dispensing area, and to limit the dispensing time to determine the dispensing speed; for multiple dispensing areas, a traveling salesman model is established with the origin, each of the central coordinate points, and the closed loop of the origin as the target, and a simulated annealing algorithm is used to generate new solutions by exchanging neighboring operators according to the adjacent order, starting from a random dispensing sequence, accepting solutions with higher costs with a probability that decreases with decreasing temperature, and iterating according to the temperature decay coefficient until the termination condition is met, thereby obtaining an optimized dispensing sequence; The control execution module 208 is used to send the obtained linear dispensing trajectory, dispensing speed and dispensing sequence to the motion controller, control the X / Y axis linkage, the Z axis up and down and drive the dispensing needle to perform dispensing with a constant dispensing volume; after completing one dispensing, it does not return to zero, but moves directly to the next dispensing according to the dispensing sequence until all dispensing is completed.

[0061] The specific details of the above system have been described in detail in the method section of the implementation plan. For any undisclosed details, please refer to the implementation plan of the method section, and therefore will not be repeated here.

[0062] This system significantly improves dispensing efficiency and reduces the probability of manual parameter readjustment by establishing a closed loop of visual positioning, coordinate transformation, path optimization, and stable execution. Through grayscale conversion, median filtering, binarization, edge computing, and Hilditch refinement, combined with minimum bounding rectangle extraction, the center, pose, and area of ​​the dispensing region are stably extracted, providing reliable pose for subsequent planning. Eye-to-hand calibration is then used to convert pixel coordinates into the actual working coordinates of the dispensing needle, avoiding the direct use of pixel coordinates for motion control and preventing suboptimal paths. Furthermore, under multi-point conditions, simulated annealing and other path optimization methods are introduced, significantly reducing the total dispensing path and running time. The integrated control structure of each dispensing device ensures cycle time and consistency, and enables its application to products with disordered arrangement.

[0063] The accompanying drawings are merely illustrative of the processes included in the methods according to exemplary embodiments of this disclosure and are not intended to be limiting. It is readily understood that the processes shown in the drawings do not indicate or limit the temporal order of these processes. Furthermore, it is readily understood that these processes may be executed synchronously or asynchronously, for example, in multiple modules.

[0064] It should be noted that although several modules or units of the system have been mentioned in the detailed description above, this division is not mandatory. In fact, according to exemplary embodiments of this disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.

[0065] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and embodiments are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the claims.

[0066] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.

Claims

1. A method for controlling the bonding of a brushless motor drive board (PCBA), characterized in that, The method includes steps S1-S8: S1: Image acquisition. The image is captured by an industrial camera from a top-down perspective, showing a tray carrying multiple PCBAs. S2: Perform channel decomposition on the image to obtain a binary image; S3: Perform morphological opening and closing operations and connected component analysis on the binary image to remove non-target regions and obtain several candidate dispensing regions; S4: For each candidate dispensing region, the template is convolved in the horizontal and vertical directions to obtain a gradient approximation, and the edge is extracted based on the gradient magnitude threshold. The pixels on the outer edge are iteratively removed according to the Hilditch thinning rule without destroying connectivity, resulting in a continuous contour with a single pixel width for each candidate dispensing region. S5: Calculate the rectangular area of ​​each candidate dispensing region and select the smallest area as the minimum bounding rectangle. Calculate the center coordinates and attitude angles from the four vertices of the minimum bounding rectangle. By proportionally converting the actual area of ​​the reference scale area to the pixel area, the actual area represented by each pixel is obtained, thus obtaining the dispensing region area. Abnormal areas are removed according to the preset aspect ratio and area threshold to obtain the true dispensing region of each candidate dispensing region. S6: Based on Eye to Hand calibration uses corresponding data from multiple sets of pixel coordinates and mechanical coordinates to obtain the intrinsic and extrinsic parameters and distortion model of the industrial camera, and establishes the transformation relationship from image coordinates to the platform working coordinate system; the center coordinate point and the attitude angle are converted into the actual pose of the dispensing needle. S7: For a single real dispensing area, a linear dispensing trajectory from the starting point to the ending point is generated based on its geometric dimensions and boundary margins, and the dispensing time is limited to determine the dispensing speed; for multiple dispensing areas, a traveling salesman model is established with the origin, each of the central coordinate points, and the closed loop of the origin as the target, and a simulated annealing algorithm is used to generate new solutions by exchanging neighboring operators according to the adjacent order, starting from a random dispensing sequence, accepting solutions with higher costs with a probability that decreases as the temperature decreases, and iterating according to the temperature decay coefficient until the termination condition is met, thereby obtaining an optimized dispensing sequence; S8: The obtained linear dispensing trajectory, dispensing speed, and dispensing sequence are sent to the motion controller to control the X / Y axis linkage, the Z axis up and down, and drive the dispensing needle to perform dispensing with a constant dispensing volume; after completing one dispensing, the needle does not return to zero, but moves directly to the next dispensing location according to the dispensing sequence until all dispensing is completed.

2. The brushless motor drive board PCBA bonding control method according to claim 1, characterized in that, In step S2, the channel decomposition of the image specifically includes: The red channel was used as the grayscale input to increase the contrast between the dispensing area and the background, thus obtaining a grayscale image. Median filtering was used to remove impulse noise from the grayscale image; The binary image is obtained by calculating the occurrence probability of each gray level, the weights and means of the two types of pixels on the global gray-level histogram of the gray-level image, and selecting the threshold that maximizes the square of the difference between the two types of means in the weighted sense.

3. The brushless motor drive board PCBA bonding control method according to claim 1, characterized in that, Step S5 specifically includes: The minimum bounding rectangle is calculated using the boundary rotation method. During the calculation, the region is rotated to the horizontal according to the direction angle of each line segment of the boundary relative to the X-axis. The vertices and area of ​​the bounding rectangle under each rotation are recorded, and the one with the smallest area is selected as the minimum bounding rectangle. The center coordinates and the attitude angle are obtained from the four vertices of the minimum bounding rectangle; Using a reference scale area with a known actual area and its pixel area as a benchmark, the actual area of ​​each pixel is calculated according to the area ratio, and then the area of ​​the dispensing area is obtained by counting pixels. The actual dispensing area is retained based on the criteria that the aspect ratio is within a preset range and the pixel area is within a preset window.

4. The brushless motor drive board PCBA bonding control method according to claim 1, characterized in that, Step S6 specifically uses the pixel coordinates of multiple calibration points and their corresponding mechanical coordinates, combined with the intrinsic and extrinsic parameters of the industrial camera and the distortion model, to obtain the homogeneous transformation matrix from the image coordinates to the platform working coordinate system through least squares solution, and then performs linear interpolation correction on the transformed coordinates to obtain the transformation relationship.

5. The brushless motor drive board PCBA bonding control method according to claim 1, characterized in that, The generation of the linear dispensing trajectory in step S7 specifically includes: For the actual dispensing area of ​​the predetermined size, a longitudinal margin and a transverse margin are set along the long side; Set the dispensing width to be equal to the inner diameter of the dispensing needle; Limit the time for each dispensing cycle to determine the dispensing speed accordingly; The starting point and ending point are obtained by geometric calculation of the center coordinate point, attitude angle and margin in the working coordinate system, and the needle movement trajectory is generated by linear interpolation to obtain the linear dispensing trajectory.

6. The brushless motor drive board PCBA bonding control method according to claim 1, characterized in that, The simulated annealing algorithm includes: Set the initial temperature and coefficient for exponential decay; Set the number of iterations for each temperature; The neighborhood operator uses either the exchange of two points in sequence or the reconnection of broken links; The probability of accepting a worse solution decreases as the temperature decreases until the temperature drops to a termination threshold or the objective function changes less than a preset amount within a continuous temperature range, at which point the dispensing sequence is output.

7. The brushless motor drive board PCBA bonding control method according to claim 1, characterized in that, The method also includes performing quality inspection and closed-loop correction after dispensing: An image of the dispensing area is captured by an industrial camera. The length and width of the actual dispensing area are measured along the long and short sides of the minimum bounding rectangle, and it is determined whether they are within the preset tolerance. If the error exceeds the tolerance, adjust the binarization threshold, edge threshold, or dispensing speed and update the path and trajectory of subsequent batches.

8. The brushless motor drive board PCBA bonding control method according to claim 7, characterized in that, The quality inspection and closed-loop correction also include: After the industrial camera captures the image after the dispensing is completed, the detection model based on CenterNet-MobileNetV2 is called to automatically locate the clipping range of each actual dispensing area, and clipping and normalizing it according to a fixed size to obtain the detection image; The cropped detection image is fed into a convolutional neural network classifier, which sequentially performs convolution, pooling, discarding, and fully connected layers, and outputs the classification result and its classification confidence. The classification result includes one of low glue, good, and high glue. Set the classification threshold to maximize the harmonic mean of precision and recall. When the classification result is insufficient glue or excessive glue, at least one of the dispensing parameters is adjusted according to a predetermined priority. The dispensing parameters include dispensing time, dispensing speed, and dispensing volume. The adjusted dispensing parameters are then applied to subsequent workpieces during the execution of steps S7 and S8 in the method.

9. The brushless motor drive board PCBA bonding control method according to claim 8, characterized in that, The quality inspection and closed-loop correction are based on interpretable machine vision to locate and quantify the classification results, and drive parameter correction accordingly, specifically including: The feature map of the last convolutional layer of the convolutional neural network classifier is obtained, and the feature maps are averaged in the spatial dimension to obtain weights. The feature maps are weighted and summed to suppress negative contributions, resulting in a heatmap of the same size as the input image. This heatmap is then superimposed on the input image to highlight the pixel regions that play a major role in the classification result. A reference image is obtained, and the activation difference between the detected image and the reference image is calculated by backtracking from the output layer to the input layer of the convolutional neural network classifier, thereby assigning a positive / negative contribution score to each pixel for the current determination, and obtaining a contribution map; Align the heatmap and the contribution map with the attitude angle of the minimum bounding rectangle, integrate the pixel contribution along the glue line direction near the two vertical sides of the minimum bounding rectangle, and obtain the contribution integral difference between the left and right sides as the non-uniformity index; when the non-uniformity index exceeds the threshold, correct one or more of the starting position of the linear dispensing trajectory, the margin, and the dispensing speed in step S7 according to the rules, and perform dispensing in step S8 with the corrected linear dispensing trajectory.

10. A brushless motor drive board (PCBA) bonding control system, the system comprising: The acquisition module is used to acquire images, which are obtained by an industrial camera from a top-down perspective of the tray carrying multiple PCBAs. The preprocessing module is used to perform channel decomposition on the image to obtain a binary image; The candidate region extraction module is used to perform morphological opening and closing operations and connected component analysis on the binary image to remove non-target regions and obtain several candidate dispensing regions. The edge extraction module is used to perform convolution of a template in the horizontal and vertical directions on each candidate dispensing region to obtain a gradient approximation, and extract the edge based on the gradient magnitude threshold. The pixels on the outer edge are iteratively removed according to the Hilditch thinning rule without destroying connectivity, resulting in a continuous contour with a single pixel width for each candidate dispensing region. The pose and geometric parameter calculation module is used to calculate the rectangular area of ​​each candidate dispensing region and select the smallest area as the minimum bounding rectangle. The center coordinate point and pose angle are calculated from the four vertices of the minimum bounding rectangle. By proportionally converting the actual area of ​​the reference scale area to the pixel area, the actual area represented by each pixel is obtained, thereby obtaining the dispensing region area. Abnormal areas are removed according to the preset aspect ratio and area threshold to obtain the true dispensing region of each candidate dispensing region. Coordinate transformation module, used for Eye-based coordinate transformation to Hand calibration uses corresponding data from multiple sets of pixel coordinates and mechanical coordinates to obtain the intrinsic and extrinsic parameters and distortion model of the industrial camera, and establishes the transformation relationship from image coordinates to the platform working coordinate system; the center coordinate point and the attitude angle are converted into the actual pose of the dispensing needle. The path planning module is used to generate a linear dispensing trajectory from the starting point to the ending point for a single real dispensing area based on its geometric dimensions and boundary margins, and to limit the dispensing time to determine the dispensing speed. For multiple dispensing areas, a traveling salesman model is established with the origin, each of the central coordinate points, and the closed loop of the origin as the target. The simulated annealing algorithm is used to generate new solutions by exchanging neighboring operators according to the adjacent order, starting from a random dispensing sequence. Solutions with higher costs are accepted with a probability that decreases as the temperature decreases, and the process is iterated according to the temperature decay coefficient until the termination condition is met, thereby obtaining an optimized dispensing sequence. The control execution module is used to send the obtained linear dispensing trajectory, dispensing speed and dispensing sequence to the motion controller, control the X / Y axis linkage, the Z axis up and down and drive the dispensing needle to perform dispensing with a constant dispensing volume; after completing one dispensing, it does not return to zero, but moves directly to the next dispensing according to the dispensing sequence until all dispensing is completed.