Welding control method and system for PCB
By calculating the status information and preliminary effective coefficients during the X-ray detection process, the image effectiveness is ensured, and the problems of misjudgment and cost waste in welding quality detection are solved, and the accuracy and efficiency of welding quality detection are achieved.
Patent Information
- Application Number
- CN202510532037.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-25
- Publication Date
- 2025-05-30
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In the welding quality detection, the effectiveness of X-ray imaging images cannot be effectively identified, resulting in the problem of abnormality in welding normal or abnormality in mistakenly considered normal, and the analysis of invalid imaging images is wasteful and time is delayed.
By obtaining the status information of the X-ray penetrating the PCB board and receiving the reflected signal through the detector, the preliminary effective coefficient of the target image is calculated, and the state of the image is analyzed based on the coefficient, and then welding defect analysis and secondary welding control are performed after ensuring the image is effective.
Ensure the accuracy of welding quality inspection results, avoid misjudgment, reduce cost waste and welding time, and improve the reliability of welding quality.
Smart Images

Figure CN120065879A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of analysis and control technology, and particularly to a welding control method and system for a PCB. Background Art
[0002] In modern electronic manufacturing, the PCB is an important basic component, and its welding quality directly affects the stability and service life of the circuit; therefore, after the welding process is completed, comprehensive inspection must be carried out to ensure the quality of the welding points; and secondary welding control is performed on the PCB board with welding problems to ensure the welding quality of the PCB board; common welding problems include poor soldering and uneven solder filling, etc., which can lead to poor electrical connection and even damage the entire circuit. Traditional detection methods, such as visual inspection and electrical testing, although able to detect some obvious defects, have limited effectiveness for welding problems hidden inside the substrate or invisible to the naked eye; therefore, X-ray detection technology is used to detect the welding quality of the PCB board, and with the penetrability of X-rays, a more accurate and comprehensive welding quality assessment is carried out; When detecting the welding quality of the PCB board by X-ray, the specific steps are to send X-rays to the PCB board by X-ray detection, the rays pass through the PCB board and irradiate its internal structure, and the reflected signals after the rays penetrate the PCB board are received by the detector. These signals contain the structural information of the welding points; the reflected ray signals are converted into digital images and processed by a computer system to generate detailed internal welding imaging images; technicians or automated analysis systems perform detailed analysis on the imaging images to identify whether there are welding defects in the PCB board welding; if so, control the PCB board for secondary welding until the welding is qualified; ensure the high-quality production of the PCB board and reduce product failures caused by welding defects; However, in the above process, it is often directly assumed that the internal image of the PCB board welding generated by X-rays is valid, and the analysis of whether there are problems with the PCB board welding is directly carried out, which will lead to incorrect analysis results, possibly resulting in normal welding being misjudged as abnormal welding or abnormal welding being misjudged as normal welding. In addition, analyzing invalid imaging images will also waste costs and even delay the welding time of the PCB board. Summary of the Invention
[0003] The object of the present invention is to solve the above-mentioned problems and provide a welding control method and system for a PCB.
[0004] In the first aspect of the implementation of the present invention, a welding control method for a PCB is first proposed. The method includes: Send X-rays to penetrate the PCB board and receive the reflected signals through a detector, and obtain the internal image of the PCB board welding according to the reflected signals as the target image; Obtain the status information during the process of X-ray penetrating the PCB board and receiving the reflected signal by the detector, which is used to evaluate whether there are problems in the process of X-ray penetrating the PCB board and receiving the reflected signal by the detector, and calculate the preliminary effective coefficient of the target image according to the status information; Analyze whether the first state of the target image is preliminarily effective according to the preliminary effective coefficient of the target image. When the first state of the target image is preliminarily effective, analyze the target image to judge whether the second state of the target image is finally effective; If the second state of the target image is finally effective, analyze the target image to identify whether there are welding defects in the PCB board welding. If so, perform secondary welding control on the PCB board.
[0005] Optionally, the status information during the process of X-ray penetrating the PCB board and receiving the reflected signal by the detector includes the attenuation anomaly coefficient of the X-ray and the gain drift coefficient of the detector, and the preliminary effective coefficient of the target image is calculated according to the attenuation anomaly coefficient and the gain drift coefficient of the detector.
[0006] Optionally, the calculation steps of the attenuation anomaly coefficient are as follows: During the process of X-ray penetrating the PCB board and receiving the reflected signal by the detector, the signal intensity at each time point is collected in real time, and the signal intensity at each time point is marked as , represents the total number of collected signal intensities; Calculate the first-order difference of the signal intensity to evaluate the degree of signal change over time. The calculation formula is: , where represents the signal intensity change amount between time and the previous moment ; Calculate the second-order difference of the signal intensity. The second-order difference is the difference of the second-order difference sequence, which is used to quantify the acceleration of signal change and reflects the change of signal change rate. The calculation formula is: , where represents the acceleration of signal change; Calculate the attenuation coefficient at each moment. The calculation formula is: , where is the second-order difference at time ; is the first-order difference at time ; Calculate the attenuation anomaly coefficient during the process of X-ray penetrating the PCB board and receiving the reflected signal by the detector. The calculation formula is: , where is the attenuation anomaly coefficient, and are the start and end times of the attenuation analysis, respectively.
[0007] Optionally, the calculation steps of the gain drift coefficient of the detector are as follows: During the process that X-rays penetrate the PCB board and the reflected signals are received by the detector, the gain values of the detector at each time point are collected in real time. The gain values are divided into multiple windows according to the time series, and each window contains a fixed number of gain value points; For the gain values within each window, calculate the gain mean value, and calculate the absolute difference between the gain mean value of each time window and the gain mean value of the previous time window, and use the absolute difference of the gain mean value as the gain drift index of the current time window; and the gain drift index of the first time window is directly defaulted to the gain mean value of this time window; Obtain a gain drift index sequence based on the time order according to the gain drift index of each time window, and compare each gain drift index with a preset gain drift index threshold. If in the gain drift index sequence, at least S consecutive gain drift indexes are not less than the preset gain drift index threshold, then calculate the mean value of the gain drift indexes corresponding to the gain drift indexes that are not less than the preset gain drift index threshold, and obtain the gain drift coefficient of the detector; the calculation formula is: , where is the gain drift coefficient of the detector, represents the th gain drift index, represents the total number of consecutive gain drift indexes corresponding to the gain drift indexes that are not less than the preset gain drift index threshold; S represents the preset minimum number of consecutive gain drift indexes.
[0008] Optionally, the steps for calculating the preliminary effective coefficient of the target image according to the attenuation anomaly coefficient and the gain drift coefficient of the detector are as follows: Normalize the attenuation anomaly coefficient and the gain drift coefficient so that they are both within [0, 1]. Calculate the preliminary effective coefficient of the target image according to the normalized attenuation anomaly coefficient and gain drift coefficient. The calculation formula is: ; where is the preliminary effective coefficient, and are the normalized attenuation anomaly coefficient and gain drift coefficient, respectively, are respectively and preset proportional values of and both are greater than 0.
[0009] Optionally, the steps for analyzing whether the first state of the target image is preliminarily valid based on the preliminary validity coefficient of the target image are as follows: Compare the preliminary validity coefficient of the target image with the preset preliminary validity coefficient threshold. If the preliminary validity coefficient is not less than the preset preliminary validity coefficient threshold, the first state of the target image is preliminarily valid; If the preliminary validity coefficient is less than the preset preliminary validity coefficient threshold, the first state of the target image is preliminarily invalid. At this time, a warning signal is issued, and the target image is acquired again until the first state of the target image is preliminarily valid.
[0010] Optionally, the steps for analyzing the target image to determine whether the second state of the target image is finally valid are as follows: Apply the Laplacian operator to the target image to obtain the second derivative image of the image; calculate the variance of the second derivative image as the sharpness of the target image; Grayscale the target image, calculate the standard deviation of the grayscale, and use the standard deviation as the contrast of the target image; Calculate the peak signal-to-noise ratio of the target image and use the peak signal-to-noise ratio as the noise value of the target image; Compare the sharpness, contrast, and noise value of the target image with the corresponding preset standard ranges respectively. If the sharpness, contrast, and noise value are all within the corresponding preset standard ranges, the second state of the target image is finally valid; If any one of the sharpness, contrast, and noise value is not within the corresponding preset standard range, the second state of the target image is finally invalid, and the target image is acquired again until the second state of the target image is finally valid.
[0011] Optionally, when the first state of the target image is preliminarily valid and the second state of the target image is finally invalid and the target image needs to be acquired again, determine the energy range and exposure time of the X-ray when acquiring the image next time according to the sharpness, contrast, and noise value of the target image. The specific steps are as follows: Calculate the differences between the sharpness, contrast, and noise value of the target image and the corresponding preset standard ranges respectively to obtain the sharpness deviation value, contrast deviation value, and noise value deviation value; Use the sharpness deviation value, contrast deviation value, and noise value deviation value as the input items of the fuzzy logic, and divide them into different fuzzy sets respectively; Use the energy range and exposure time adjustment amount of the X-ray when acquiring the image next time as the output items of the fuzzy logic, and divide them into different fuzzy sets; Formulate fuzzy rules to describe the influence of the sharpness deviation value, contrast deviation value, and noise value deviation value on the energy range adjustment amount and exposure time adjustment amount of the X-ray when acquiring the image next time; Perform fuzzy reasoning according to fuzzy rules, adjust the energy range adjustment amount and exposure time adjustment amount of the X-ray when acquiring the next image, and determine the energy range and exposure time of the X-ray when acquiring the next image based on the energy range adjustment amount and exposure time adjustment amount of the X-ray when acquiring the next image and the current X-ray energy range and exposure time.
[0012] In the second aspect of the implementation of the present invention, a soldering control system for a PCB is proposed. The system includes: Image acquisition module: Send X-rays to penetrate the PCB board and receive the reflected signal through a detector, and obtain an image of the inside of the PCB board soldering based on the reflected signal as the target image. Preliminary evaluation module: Obtain the status information during the process of X-rays penetrating the PCB board and receiving the reflected signal through the detector, used to evaluate whether there are problems in the process of X-rays penetrating the PCB board and receiving the reflected signal through the detector, and calculate the preliminary effective coefficient of the target image according to the status information. Re-evaluation module: Analyze whether the first state of the target image is preliminarily effective according to the preliminary effective coefficient of the target image. When the first state of the target image is preliminarily effective, analyze the target image to determine whether the second state of the target image is finally effective. Analysis and control module: If the second state of the target image is finally effective, analyze the target image to identify whether there are soldering defects in the PCB board soldering. If so, perform secondary soldering control on the PCB board.
[0013] Advantages of the present invention: The present invention proposes a soldering control method and system for a PCB, which can analyze whether the image of the inside of the PCB board soldering generated by X-rays is effective, and analyze the image of the inside of the effective PCB board soldering to determine whether there are problems in the PCB board soldering, ensuring the correctness of the analysis results, and preventing the phenomenon of misjudging normal soldering as abnormal soldering or misjudging abnormal soldering as normal soldering, ensuring that the effective imaging images can be analyzed, reducing waste of costs, and reducing the soldering time of the PCB board. Description of the drawings
[0014] The following further describes the present invention with reference to the drawings.
[0015] Figure 1 It is a flowchart of a soldering control method for a PCB; Figure 2 It is a framework diagram of a soldering control system for a PCB. Specific implementation manners
[0016] The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0017] An embodiment of the present invention provides a welding control method for a PCB. Refer to Figure 1 , Figure 1 which is a flowchart of a welding control method for a PCB provided by an embodiment of the present invention. The method includes the following steps: Send X-rays to penetrate the PCB board and receive the reflected signal through a detector, and obtain an image inside the PCB board welding based on the reflected signal as the target image; Obtain the status information during the process of X-rays penetrating the PCB board and receiving the reflected signal through the detector, which is used to evaluate whether there are problems in the process of X-rays penetrating the PCB board and receiving the reflected signal through the detector, and calculate the preliminary effective coefficient of the target image according to the status information; Analyze whether the first state of the target image is preliminarily effective according to the preliminary effective coefficient of the target image. When the first state of the target image is preliminarily effective, analyze the target image to determine whether the second state of the target image is finally effective; If the second state of the target image is finally effective, analyze the target image to identify whether there are welding defects in the PCB board welding. If so, perform secondary welding control on the PCB board.
[0018] Based on the welding control method for a PCB provided by the embodiment of the present invention, it can analyze whether the image inside the PCB board welding generated by X-rays is effective, and analyze the effective image inside the PCB board welding to determine whether there are problems with the PCB board welding, ensuring the correctness of the analysis results, and preventing the phenomenon of misjudging normal welding as abnormal welding or misjudging abnormal welding as normal welding. It ensures that the effective imaging image can be analyzed, reducing the waste of costs and reducing the welding time of the PCB board.
[0019] In one embodiment, obtain the status information during the process of X-rays penetrating the PCB board and receiving the reflected signal through the detector, which is used to evaluate whether there are problems in the process of X-rays penetrating the PCB board and receiving the reflected signal through the detector, and calculate the preliminary effective coefficient of the target image according to the status information; Among them, the status information during the process of X-rays penetrating the PCB board and receiving the reflected signal through the detector includes the attenuation anomaly coefficient of the X-rays and the gain drift coefficient of the detector.
[0020] Among them, the definition of the attenuation anomaly coefficient is as follows: The attenuation anomaly coefficient reflects the attenuation degree of the signal intensity when X-rays penetrate the PCB board; different materials, components, and solder joints in the PCB board will have different effects on the attenuation of X-rays; if the attenuation degree is large, it may indicate that the X-ray beam is deviated or there is an anomaly in the detection area; Function: The attenuation anomaly coefficient can be used to evaluate whether the propagation process of X-rays is normal, so as to evaluate whether there are problems in the process of X-rays penetrating the PCB board and receiving the reflected signal through the detector; if the attenuation anomaly coefficient is too large, it can reflect problems such as equipment problems, X-ray source anomalies, and non-uniformity of the PCB board, thus affecting the imaging quality; according to the value of this coefficient, it can be determined whether the image is valid for further analysis.
[0021] Among them, the calculation steps of the attenuation anomaly coefficient are as follows: During the process of X-rays penetrating the PCB board and receiving the reflected signal through the detector, the signal intensity at each time point is collected in real time, and the signal intensity at each time point is marked as , indicating the total number of signal intensities collected; Calculate the first-order difference of the signal intensity to evaluate the degree of signal change over time. The calculation formula is: where, represents the change in signal intensity between time and the previous moment , reflecting the rate of signal change over time; Calculate the second-order difference of the signal intensity. The second-order difference is the difference of the second-order difference sequence, which is used to quantify the acceleration of signal change and reflects the change of the signal change rate. The calculation formula is: where, represents the acceleration of signal change (or the change of attenuation rate); Calculate the attenuation coefficient at each moment to reflect the acceleration in the signal attenuation process. By analyzing the second-order difference of the signal, the speed or acceleration of signal attenuation can be quantified. The calculation formula is: where, is the second-order difference at time , which measures the acceleration of signal change (i.e., the change of attenuation rate); and is the first-order difference at time , representing the instantaneous intensity of the signal during the attenuation process; the larger the attenuation coefficient, the faster the signal attenuates, which may imply an anomaly in the signal attenuation process; Calculate the attenuation anomaly coefficient during the process of X-rays penetrating the PCB board and receiving the reflected signal through the detector. The calculation formula is: where, is the attenuation anomaly coefficient, and are the start and end times of the attenuation analysis, respectively.
[0022] It should be noted that during the process of X-ray penetrating the PCB board and receiving the reflected signal through the detector, the signal intensity data can be collected in real time by the detector in the X-ray imaging system (such as a scintillator detector or a semiconductor detector); during X-ray imaging, when X-rays penetrate an object (such as a PCB board), the detector generates corresponding signal intensities according to the penetration amount and intensity of the X-rays. These signal intensity values reflect the attenuation of X-rays inside the object and are usually presented in the form of digital signals, representing the relative intensity when the X-rays reach the detector; specifically, the signal intensity refers to the remaining radiation amount received by the detector after the X-rays pass through a certain thickness of material at each time point, usually output in the form of a count rate or a voltage signal.
[0023] It should be noted that by calculating the attenuation anomaly coefficient in the above manner, the signal attenuation during the X-ray penetration of the PCB board can be more accurately quantified; compared with other calculation methods, this method can dynamically track the change rate and acceleration of the signal intensity through first-order and second-order differences, thus more sensitively capturing the subtle anomalies during the attenuation process. If only relying on simple average attenuation or overall attenuation trend, it may not be possible to identify sudden changes or abnormal changes within a short period, which is crucial for judging potential problems with the X-ray source, detector, or PCB board; using differential analysis can identify abnormal attenuation behaviors in advance, helping to detect equipment failures, material defects, or soldering problems in a timely manner, thereby improving the imaging quality and the reliability of detection.
[0024] In one embodiment, the status information during the process of X-ray penetrating the PCB board and receiving the reflected signal through the detector further includes the gain drift coefficient of the detector, where: The gain drift index of the detector refers to the degree of drift of the detector caused by temperature changes, power fluctuations, or other environmental factors when receiving X-ray signals. Gain drift affects the signal reception ability and thus affects the quality of the finally generated image.
[0025] Function: The existence of gain drift may cause contrast distortion or detail loss in the image, especially important in the detection of low-signal areas or subtle soldering defects. The gain drift index reflects whether the device is in a stable working state. If the gain exceeds a certain threshold, it indicates that the detector may not be able to provide accurate reflected signals, thus affecting the imaging quality; based on the value of this coefficient, it can be determined whether the image is valid for further analysis.
[0026] Among them, the calculation steps of the gain drift coefficient of the detector are as follows: During the process that X-rays penetrate the PCB board and the reflected signals are received by the detector, the gain value of the detector at each time point is collected in real time. The gain values are divided into multiple windows according to the time series, and each window contains a fixed number of gain value points; for example, each window consists of 100 to 1000 gain value points. Each window represents the gain state of the X-rays during this time period; For the gain values within each window, calculate the average gain, and calculate the absolute difference between the average gain of each time window and the average gain of the previous time window, and use the absolute difference of the average gain as the gain drift index of the current time window; and the gain drift index of the first time window is directly defaulted to the average gain of this time window; the gain drift index reflects the difference between the signal of the current window and the signal of the previous window, so as to evaluate the degree of gain drift; Obtain a sequence of gain drift indices based on the time order according to the gain drift index of each time window, and compare each gain drift index with a preset gain drift index threshold. If in the gain drift index sequence, at least S consecutive gain drift indices are not less than the preset gain drift index threshold, then calculate the average value of the gain drift indices corresponding to the gain drift indices that are not less than the preset gain drift index threshold, and obtain the gain drift coefficient of the detector; the calculation formula is: , where is the gain drift coefficient of the detector, represents the th gain drift index, represents the total number of consecutive gain drift indices corresponding to the gain drift indices that are not less than the preset gain drift index threshold; S represents the preset minimum number of consecutive gain drift indices.
[0027] It should be noted that during the process that X-rays penetrate the PCB board and the reflected signals are received by the detector, the gain value of the detector is the response ability of the detector to the received X-ray signal at a specific time point, and it is calculated by measuring the ratio between the intensity of the signal received by the detector and the intensity of a predetermined standard signal; in addition, the preset gain drift index threshold, the predetermined standard signal, and the preset minimum number of consecutive gain drift indices are set by professionals according to the actual situation, and no specific limitations are made.
[0028] It should be noted that generally during the process of the detector receiving X-ray signals, the optimal sampling rate of the detector is approximately 1000 times per second. Generally, during the calculation of the gain drift index, each time window preferably contains 100 to 1000 gain value points, and the corresponding optimal time range is between 0.1 s and 1 s. Setting the number of gain points in each time window between 100 and 1000 can not only capture the gain drift changes during the X-ray signal reception process of the detector but also avoid being overly sensitive due to too high a sampling frequency, thereby reducing the false fluctuations caused by instantaneous noise and interference. If the number of gain points in the window is too small (such as less than 100), it may not fully reflect the change trend of the gain, resulting in the gain drift index being overly sensitive to small changes and being easily affected by noise; while if the number of gain points in the window is too large (such as more than 1000), it may lead to the calculation process being too smooth and masking some key subtle changes. Therefore, setting the window size with 100 to 1000 gain points can find the best balance between accuracy and stability, making the evaluation of gain drift more reasonable and effective.
[0029] It should be noted that calculating the gain drift coefficient of the detector by the above method has significant advantages. First, the method of dividing time windows can effectively reduce the influence of instantaneous fluctuations on the calculation results, making the evaluation of gain drift smoother and more stable. By calculating the gain mean value of each window and the difference from the previous window, abnormal gain drift can be detected in a timely manner, especially small changes that may affect the imaging quality can be captured. Second, the method of comparing the gain drift index with a preset threshold can accurately determine whether the gain exceeds the normal range, and at the same time, setting the condition of the minimum number of consecutive gain drift indices further filters out accidental fluctuations to ensure the reliability of the judgment. In addition, the preset threshold and window size can be adjusted according to the characteristics of different detectors, making this method highly flexible and adaptable. Overall, this method can provide accurate, stable and highly adaptable gain drift monitoring, ensure the stable performance of the detector, avoid damage to the imaging quality, and can detect potential equipment problems in a timely manner, having high practical application value.
[0030] In one embodiment, calculating the preliminary effective coefficient of the target image according to the status information, the calculation steps are as follows: Normalize the attenuation anomaly coefficient and the gain drift coefficient so that they are both within [0, 1], and calculate the preliminary effective coefficient of the target image according to the normalized attenuation anomaly coefficient and gain drift coefficient. The calculation formula is: ; In the formula, is the preliminary effective coefficient, and They are the attenuation anomaly coefficient and the gain drift coefficient after normalization respectively, They are respectively and the preset proportional values of and both are greater than 0; It should be noted that is set by professionals according to the actual situation. Generally, the sum of is 1. For example,
[0031] In one embodiment, the first state of the target image is analyzed to be initially valid according to the initial valid coefficient of the target image. When the first state of the target image is initially valid, the target image is analyzed to determine whether the second state of the target image is finally valid; Among them, the step of analyzing whether the first state of the target image is initially valid according to the initial valid coefficient of the target image is: Compare the initial valid coefficient of the target image with the preset initial valid coefficient threshold. If the initial valid coefficient is not less than the preset initial valid coefficient threshold, the first state of the target image is initially valid; If the initial valid coefficient is less than the preset initial valid coefficient threshold, the first state of the target image is initially invalid. At this time, a warning signal is sent, and the target image is acquired again until the first state of the target image is initially valid.
[0032] It should be noted that the preset initial valid coefficient threshold is set by professionals according to the actual situation, and specific limitations and elaborations are not made.
[0033] In one implementation manner, the step of analyzing whether the first state of the target image is initially valid according to the initial valid coefficient of the target image is an important link in the image analysis process, which determines whether the image has the basis for continued analysis. If the initial valid coefficient of the target image is higher than or equal to the preset initial valid coefficient threshold, it means that the quality of the image has met the predetermined standard and can provide effective information. In this case, the first state of the target image is judged to be initially valid, and subsequent image analysis can be continued to further evaluate the soldering situation of the PCB board, detect whether there are soldering defects, bubbles and other problems, and finally ensure the quality and reliability of the soldering.
[0034] However, if the preliminary validity coefficient of the target image is lower than the set threshold, it means that the quality of the image does not meet the expected standard, and there may be problems such as signal attenuation, equipment error, gain drift, etc., resulting in the image being unable to accurately reflect the soldering situation inside the PCB board; at this time, the system will mark the first state of the target image as preliminarily invalid; to ensure the reliability and accuracy of subsequent analysis, the system will immediately trigger a warning signal to remind the operator or system administrator that the current image is unavailable, and the image may be distorted due to factors such as equipment failure, signal interference, or detector gain drift; the system will recommend equipment inspection and repair to eliminate potential problems and re - acquire the image after the equipment status returns to normal. It is necessary to re - obtain the image; the core purpose of this process is to avoid misjudgment and wrong decisions caused by sub - standard image quality, ensure that all subsequent analyses are based on reliable image data, and avoid unnecessary errors and wastes.
[0035] Therefore, once it is found that the preliminary validity coefficient of the image does not meet the standard, the system will require re - acquisition of the image until the preliminary validity coefficient of the target image reaches the preset threshold, ensuring that subsequent analysis can be based on high - quality and reliable images. In the whole process, the preset threshold of the preliminary validity coefficient plays a crucial role. It determines whether subsequent analysis can start and also guarantees the efficiency and accuracy of the whole process. This step is not only a screening of image quality but also the first checkpoint in the whole soldering quality detection process, ensuring the accuracy and reliability of subsequent system judgments.
[0036] In one embodiment, when the first state of the target image is preliminarily valid, analyze the target image to determine whether the second state of the target image is finally valid; Among them, the steps of analyzing the target image to determine whether the second state of the target image is finally valid are as follows: Apply the Laplacian operator to the target image to obtain the second - order derivative image of the image; calculate the variance of the second - order derivative image as the clarity of the target image; Grayscale the target image, calculate the standard deviation of the grayscale, and use the standard deviation as the contrast of the target image; Calculate the peak signal - to - noise ratio of the target image and use the peak signal - to - noise ratio as the noise value of the target image; Compare the clarity, contrast, and noise value of the target image with the corresponding preset standard ranges respectively. If the clarity, contrast, and noise value are all within the corresponding preset standard ranges, the second state of the target image is finally valid; If any one of the clarity, contrast, and noise value is not within the corresponding preset standard range, the second state of the target image is finally invalid, and the target image needs to be re - obtained until the second state of the target image is finally valid.
[0037] It should be noted that the preset standard ranges corresponding to clarity, contrast, and noise value are set by professionals according to the actual situation, and no specific limitations and elaborations are made.
[0038] It should be noted that in image quality assessment, clarity, contrast, and noise value are not the larger the better, because their optimal values are limited, and exceeding a certain range may cause the image quality to deteriorate instead. Excessive clarity may cause the details in the image to be too sharp, resulting in artifacts or noise, affecting the extraction of real information; excessive contrast may cause the difference between the brightness and darkness of the image to be too obvious, resulting in loss of details and information distortion; excessive noise value will introduce unnecessary interference and affect the readability of the image. Maintaining clarity, contrast, and noise value within a certain range can ensure that the image is both clear and rich in details, and will not lose important information due to excessive enhancement. For the analysis of PCB soldering conditions, the clarity and contrast of the image need to be within an appropriate range to accurately capture the details of the solder joints, while avoiding the interference of noise, so that welding defects (such as poor soldering, missed soldering, short circuit, etc.) can be clearly identified and analyzed.
[0039] In one implementation manner, after obtaining the clarity, contrast, and noise value, they are compared with the preset standard ranges. If the clarity, contrast, and noise value of the target image are all within the corresponding preset standard ranges, the second state of the target image is determined to be finally valid, indicating that the image quality meets the requirements and subsequent processing or analysis can be continued.
[0040] However, if any one of the clarity, contrast, or noise value does not reach the preset standard range, it means that the quality of the target image does not meet the requirements, and the second state is determined to be finally invalid. In this case, the system will re-acquire the target image and re-execute the above analysis process until the clarity, contrast, and noise value of the target image meet the preset standards, ensuring that the quality of the target image meets the standards, and finally confirming that its second state is finally valid.
[0041] In one embodiment, when the first state of the target image is initially valid and the second state of the target image is finally invalid and the target image needs to be re-acquired, the energy range and exposure time of the X-ray when acquiring the image next time are determined according to the clarity, contrast, and noise value of the target image. The specific steps are as follows: Calculate the differences between the clarity, contrast, and noise value of the target image and the corresponding preset standard ranges respectively to obtain the clarity deviation value, contrast deviation value, and noise value deviation value; Use the clarity deviation value, contrast deviation value, and noise value deviation value as the input items of fuzzy logic, and divide them into different fuzzy sets respectively; Take the energy range of the X-ray and the exposure time adjustment amount when acquiring the next image as the output items of fuzzy logic, and divide them into different fuzzy sets; Formulate fuzzy rules to describe the influence of the sharpness deviation value, contrast deviation value, and noise value deviation value on the energy range adjustment amount and exposure time adjustment amount of the X-ray when acquiring the next image; Perform fuzzy inference according to the fuzzy rules to adjust the energy range adjustment amount and exposure time adjustment amount of the X-ray when acquiring the next image, and determine the energy range and exposure time of the X-ray when acquiring the next image according to the energy range adjustment amount and exposure time adjustment amount of the X-ray when acquiring the next image and the current energy range and exposure time of the X-ray.
[0042] It should be noted that a series of fuzzy rules are designed to determine how to adjust the X-ray energy and exposure time based on the sharpness, contrast, and noise value of the first image through fuzzy inference. The following is an example: Step 1: Calculate the image quality deviation First, calculate the deviation values between the quality parameters (such as sharpness, contrast, and noise value) of the target image and the preset standard range; Step 2: Fuzzify the deviation values Fuzzify them into different fuzzy sets. Each deviation value is divided into different fuzzy categories according to its magnitude and direction (for example, "negative", "zero", "positive").
[0043] Negative: Indicates that this index is lower than the standard and needs to be adjusted upwards.
[0044] Zero: Indicates that this index is close to the standard and no adjustment is required.
[0045] Positive: Indicates that this index is higher than the standard and needs to be adjusted downwards.
[0046] Example: Sharpness deviation value: Negative: The sharpness is lower than the standard, and the exposure or energy needs to be increased.
[0047] Zero: The sharpness is close to the standard, and no adjustment is required.
[0048] Positive: The sharpness is higher than the standard, and the exposure or energy needs to be decreased.
[0049] Contrast deviation value: Negative: The contrast is lower than the standard, and the exposure or energy needs to be increased.
[0050] Zero: The contrast is close to the standard, and no adjustment is required.
[0051] Positive: The contrast is higher than the standard, and the exposure or energy needs to be decreased.
[0052] Noise deviation value: Negative: The noise is below the standard, and it is necessary to increase the exposure or energy.
[0053] Zero: The noise is close to the standard, and no adjustment is required.
[0054] Positive: The noise is above the standard, and it is necessary to reduce the exposure or energy.
[0055] Step 3: Define the fuzzy sets: Define the output variables, that is, the fuzzy sets of the adjustment amounts of the X-ray energy range and the exposure time. For example: In the fuzzy inference system, the output variables - the adjustment amounts of the X-ray energy range and the exposure time - can be defined as the following fuzzy sets: Adjustment amount of X-ray energy range: Negative: It means that it is necessary to increase the X-ray energy range.
[0056] Zero: It means that the X-ray energy range is close to the standard and no adjustment is required.
[0057] Positive: It means that it is necessary to reduce the X-ray energy range.
[0058] Adjustment amount of exposure time: Negative: It means that it is necessary to increase the exposure time.
[0059] Zero: It means that the exposure time is close to the standard and no adjustment is required.
[0060] Positive: It means that it is necessary to reduce the exposure time.
[0061] Step 4: Formulate the fuzzy rules Based on the influence of the sharpness deviation value, the contrast deviation value, and the noise deviation value on the adjustment amounts of the X-ray energy range and the exposure time, formulate the fuzzy rules. The rules usually adopt the "if-then" format: For example: Rule 1: If the sharpness deviation value is negative, the contrast deviation value is negative, and the noise deviation value is negative, then the X-ray energy range is adjusted to positive (reduce the energy), and the exposure time is adjusted to positive (reduce the exposure).
[0062] Rule 2: If the sharpness deviation value is negative, the contrast deviation value is negative, and the noise deviation value is zero, then the X-ray energy range is adjusted to negative (increase the energy), and the exposure time is adjusted to zero (no adjustment is required).
[0063] Rule 3: If the sharpness deviation value is zero, the contrast deviation value is positive, and the noise deviation value is negative, then the X-ray energy range is adjusted to negative (increase the energy), and the exposure time is adjusted to negative (increase the exposure).
[0064] Rule 4: If the clarity deviation value is positive, the contrast deviation value is negative, and the noise deviation value is negative, then the X-ray energy range is adjusted negatively (increase the energy), and the exposure time is adjusted to zero (no adjustment of exposure is required).
[0065] Step 5: Fuzzy inference Using a fuzzy inference method (such as the Mamdani inference method or the Tsukamoto inference method), based on the input deviation values, derive the adjustment amounts of the X-ray energy range and the exposure time.
[0066] Fuzzy inference process: Based on the input deviation values (clarity, contrast, noise values), determine which fuzzy sets they belong to.
[0067] Use the defined fuzzy rules for inference and calculate the output of each rule.
[0068] Synthesize the outputs of all rules to obtain the fuzzy outputs of the X-ray energy range adjustment and the exposure time.
[0069] Defuzzification: Use a defuzzification method (such as the centroid method or the maximum membership degree method) to convert the fuzzy output into specific adjustment values to obtain the adjustment amounts of the X-ray energy range and the exposure time; for example, assume the fuzzy sets of the output variables are as follows: Negative: indicates that the energy range needs to be increased, with a fuzzy value of -5; Zero: indicates that no adjustment is required, with a fuzzy value of 0; Positive: indicates that the energy range needs to be decreased, with a fuzzy value of 5; Based on the fuzzy rules and the input values, the system calculates the membership degree of each fuzzy category (i.e., the "degree" to which the output belongs to a certain category). The membership degree is usually represented by and its value is between [0,1], indicating the degree to which the output belongs to the fuzzy set.
[0070] For example, assume the following membership degrees are obtained after fuzzy inference: Membership degree of the negative class: = 0.8; Membership degree of the zero class: = 0.3; Membership degree of the positive class = 0.6: In the centroid method, according to each fuzzy output value and its corresponding membership degree, calculate the "centroid" of the entire fuzzy output, that is, find the average value of the entire fuzzy set. Defuzzification by the centroid method is to obtain the specific adjustment amount by calculating the "centroid" of the fuzzy output value.
[0071] By multiplying the output value of each fuzzy category by its membership degree, summing the results, and finally dividing by the sum of all membership degrees, a specific numerical value is obtained, which represents the adjustment amount of the system parameters. Assuming the adjustment amount of the X-ray energy range is -0.59, then the X-ray energy range needs to be increased by approximately 0.59 units based on the current value; similarly, assuming the adjustment amount of the exposure time is 0.31, then the exposure time needs to be decreased by approximately 0.31 units based on the current value. The centroid method helps to convert the result of fuzzy reasoning into an actual operable adjustment value, which can then be applied to the actual control system.
[0072] Step 6: Adjust the X-ray parameters According to the result of fuzzy reasoning, adjust the X-ray energy range and exposure time to meet the preset standards, so as to improve the image quality when acquiring images next time.
[0073] Through this process, the system can automatically adjust the X-ray parameters according to the image quality deviation, thereby improving the imaging quality and ensuring more accurate detection results.
[0074] In one embodiment, if the second state of the target image is finally valid, analyze and identify whether there are welding defects in the PCB board welding for the target image. If so, the steps for secondary welding control of the PCB board are as follows: If the second state of the target image is determined to be finally valid, next perform a detailed analysis of the target image, and use image processing and machine learning algorithms to identify whether there are welding defects in the welding area on the PCB board. By detecting features such as the shape, size, color, and surface flatness of the solder joints, judge whether there are defects such as solder bridging, cold soldering, and over-welding. If a defect is detected, the system will issue an instruction through a preset secondary welding control strategy to start an automated welding device or manual intervention for welding repair. During the secondary welding process, the control system will adjust parameters such as welding temperature, welding time, and solder volume to ensure that the welding quality meets the standard requirements, and further confirm the repair effect through real-time image feedback to ensure that the welding defects are effectively corrected.
[0075] Based on the same inventive concept, the embodiments of the present invention also provide a welding control system for a PCB. Refer to Figure 2 , Figure 2 is a framework diagram of a welding control system for a PCB provided by an embodiment of the present invention. The system includes: Image acquisition module: Send X-rays through the PCB board and receive the reflected signal through a detector, and obtain an image of the inside of the PCB board welding based on the reflected signal as the target image; Initial evaluation module: Obtain the status information during the process of X-ray penetrating the PCB board and receiving the reflected signal through the detector, which is used to evaluate whether there are problems in the process of X-ray penetrating the PCB board and receiving the reflected signal through the detector, and calculate the preliminary effective coefficient of the target image according to the status information; Re-evaluation module: Analyze whether the first state of the target image is preliminarily effective according to the preliminary effective coefficient of the target image. When the first state of the target image is preliminarily effective, analyze the target image to determine whether the second state of the target image is finally effective; Analysis and control module: If the second state of the target image is finally effective, analyze the target image to identify whether there are welding defects in the PCB board welding. If so, perform secondary welding control on the PCB board.
[0076] Based on the welding control system for PCB provided by the embodiment of the present invention, it can analyze whether the image inside the PCB board welding generated by X-ray is valid, and analyze the image inside the valid PCB board welding to determine whether there are problems in the PCB board welding, ensuring the correctness of the analysis result, and preventing the phenomenon of misjudging normal welding as abnormal welding or misjudging abnormal welding as normal welding. It ensures that the valid imaging image can be analyzed, reducing the waste of costs and the welding time of the PCB board.
[0077] The above has described in detail an embodiment of the present invention, but the content described is only the preferred embodiment of the present invention and cannot be artificially used to limit the scope of implementation of the present invention. All equivalent changes and improvements made according to the scope of the application of the present invention should still fall within the scope covered by the patent of the present invention.
Claims
1. A welding control method for PCB, characterized in that: The following steps are involved: Send X-rays to penetrate the PCB board and receive the reflected signal through the detector, and obtain the image of the inside of the PCB board welding according to the reflected signal as the target image; Acquire the status information of the process in which the X-ray penetrates the PCB board and receives the reflected signal through the detector, so as to evaluate whether there is any problem in the process in which the X-ray penetrates the PCB board and receives the reflected signal through the detector, and calculate the preliminary effective coefficient of the target image according to the status information; Analyzing whether the first state of the target image is preliminarily valid according to the preliminarily valid coefficient of the target image, and when the first state of the target image is preliminarily valid, analyzing the target image to determine whether the second state of the target image is finally valid; If the second state of the target image is finally valid, the target image is analyzed to identify whether there are welding defects in the PCB board welding. If so, the PCB board is subjected to secondary welding control.
2. A welding control method for PCB according to claim 1, characterized in that: The state information of the X-ray penetrating the PCB board and receiving the reflected signal through the detector includes the attenuation anomaly coefficient of the X-ray and the gain drift coefficient of the detector, and the preliminary effective coefficient of the target image is calculated according to the attenuation anomaly coefficient and the gain drift coefficient of the detector.
3. A welding control method for PCB according to claim 2, characterized in that: The calculation steps of the attenuation anomaly coefficient are: The signal strength at each time point is collected in real time during the process of X-ray penetrating the PCB board and receiving the reflected signal through the detector, and the signal strength at each time point is marked as , Indicates the total number of collected signal strengths; Calculate the first-order difference of the signal strength to evaluate the degree of signal change over time. The calculation formula is: , where Indicates at time With the previous moment The signal strength change between Calculate the second-order difference of the signal strength. The second-order difference is the difference of the second-order difference sequence. It is used to quantify the acceleration of the signal change and reflects the change in the signal change rate. The calculation formula is: , where Indicates the acceleration of the signal change; Calculate the attenuation coefficient at each moment , the calculation formula is: , where It is at the moment The second-order difference of It is at the moment The first difference of Calculate the attenuation anomaly coefficient when X-rays penetrate the PCB and receive the reflected signal through the detector. The calculation formula is: , where is the attenuation anomaly coefficient, and are the start and end time of the decay analysis, respectively.
4. A welding control method for PCB according to claim 2, characterized in that: The calculation steps of the gain drift coefficient of the detector are: When the X-ray penetrates the PCB board and receives the reflected signal through the detector, the gain value of the detector at each time point is collected in real time, and the gain value is divided into multiple windows according to the time series, and each window contains a fixed number of gain value points; For the gain value in each window, the gain mean is calculated, and the absolute difference between the gain mean of each time window and the previous time window is calculated, and the absolute difference between the gain mean is used as the gain drift index of the current time window; and the gain drift index of the first time window is directly defaulted to the gain mean of the time window; A gain drift index sequence based on time sequence is obtained according to the gain drift index of each time window, and each gain drift index is compared with a preset gain drift index threshold. If at least S consecutive gain drift indexes in the gain drift index sequence are not less than the preset gain drift index threshold, the mean of the gain drift indexes corresponding to the preset gain drift index threshold is calculated to obtain the gain drift coefficient of the detector. The calculation formula is: , where is the gain drift coefficient of the detector, Indicates A gain drift exponent, It indicates that the total number of consecutive gain drift indices corresponding to the gain drift index being not less than the preset gain drift index threshold value; S indicates the preset minimum number of consecutive gain drift indices.
5. A welding control method for PCB according to claim 2, characterized in that: The steps for calculating the preliminary effective coefficients of the target image based on the attenuation anomaly coefficient and the gain drift coefficient of the detector are: The attenuation anomaly coefficient and the gain drift coefficient are normalized so that they are both between [0,1]. The initial effective coefficient of the target image is calculated based on the normalized attenuation anomaly coefficient and gain drift coefficient. The calculation formula is: ; In the formula, is the preliminary effective coefficient, and are the attenuation anomaly coefficient and gain drift coefficient after normalization, They are and The preset ratio value of Both are greater than 0.
6. A welding control method for PCB according to claim 1, characterized in that: The steps of analyzing whether the first state of the target image is preliminarily valid according to the preliminarily valid coefficient of the target image are as follows: Comparing the preliminary effective coefficient of the target image with a preset preliminary effective coefficient threshold, if the preliminary effective coefficient is not less than the preset preliminary effective coefficient threshold, the first state of the target image is preliminary effective; If the preliminary effective coefficient is less than the preset preliminary effective coefficient threshold, the first state of the target image is preliminary invalid. At this time, a warning signal is issued and the target image is reacquired until the first state of the target image is preliminary valid.
7. A welding control method for PCB according to claim 1, characterized in that: The steps of analyzing the target image to determine whether the second state of the target image is finally valid are: Apply the Laplacian operator to the target image to obtain the second-order derivative image of the image; calculate the variance of the second-order derivative image as the clarity of the target image; Grayscale the target image, calculate the standard deviation of the grayscale, and use the standard deviation as the contrast of the target image; Calculate the peak signal-to-noise ratio of the target image, and use the peak signal-to-noise ratio as the noise value of the target image; The clarity, contrast and noise values of the target image are compared with the corresponding preset standard ranges respectively. If the clarity, contrast and noise values are all within the corresponding preset standard ranges, the second state of the target image is finally valid; If any one of the clarity, contrast and noise values is not within the corresponding preset standard range, the second state of the target image is finally invalid, and the target image is reacquired until the second state of the target image is finally valid.
8. A welding control method for PCB according to claim 1, characterized in that: When the first state of the target image is initially valid and the second state of the target image is finally invalid, and the target image needs to be reacquired, the energy range and exposure time of the X-ray when the image is acquired next time are determined according to the clarity, contrast and noise value of the target image. The specific steps are as follows: Calculate the difference between the definition, contrast and noise value of the target image and the corresponding preset standard range respectively, and obtain the definition deviation value, contrast deviation value and noise value deviation value; The clarity deviation value, contrast deviation value and noise deviation value are used as input items of fuzzy logic and are divided into different fuzzy sets respectively; The energy range of X-rays and the exposure time adjustment amount when acquiring the next image are used as the output items of fuzzy logic and divided into different fuzzy sets; Formulate fuzzy rules to describe the influence of the clarity deviation value, contrast deviation value and noise deviation value on the energy range adjustment amount and exposure time adjustment amount of the X-ray when acquiring the image next time; Fuzzy reasoning is performed according to fuzzy rules to adjust the energy range adjustment amount and exposure time adjustment amount of the X-ray when the image is acquired next time, and the energy range and exposure time of the X-ray when the image is acquired next time are determined according to the energy range adjustment amount and exposure time adjustment amount of the X-ray when the image is acquired next time and the current X-ray energy range and exposure time.
9. A welding control system for PCB, used to implement a welding control method for PCB as described in any one of claims 1 to 8, characterized in that: The system comprises: Image acquisition module: sends X-rays to penetrate the PCB board and receives the reflected signal through the detector, and obtains the image of the inside of the PCB board welding according to the reflected signal as the target image; Preliminary evaluation module: obtains the status information of the process in which the X-ray penetrates the PCB board and receives the reflected signal through the detector, which is used to evaluate whether there is any problem in the process in which the X-ray penetrates the PCB board and receives the reflected signal through the detector, and calculates the preliminary effective coefficient of the target image according to the status information; A second evaluation module: analyzing whether the first state of the target image is preliminarily valid according to the preliminarily valid coefficient of the target image, and when the first state of the target image is preliminarily valid, analyzing the target image to determine whether the second state of the target image is finally valid; Analysis and control module: If the second state of the target image is finally valid, the target image is analyzed to identify whether there are welding defects in the PCB board welding. If so, the PCB board is subjected to secondary welding control.