FPGA-based method and device for surface defect detection of surfaced workpiece

By proposing an FPGA-based method for detecting surface defects in weld overlay workpieces, and utilizing lock-in amplification, convolution filtering, and binarization processing, high-efficiency detection of surface defects in weld overlay workpieces is achieved, solving the problems of low detection efficiency and delay in existing technologies.

WO2026086298A1PCT designated stage Publication Date: 2026-04-30CHINA NUCLEAR POWER ENGINEERING COMPANY LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
CHINA NUCLEAR POWER ENGINEERING COMPANY LTD
Filing Date
2025-07-17
Publication Date
2026-04-30

AI Technical Summary

Technical Problem

In the existing technology, the surface defect detection device for weld overlay workpieces has low detection efficiency and detection delay, which cannot meet the requirements of efficient real-time detection.

Method used

An FPGA-based method for detecting surface defects in welded workpieces is proposed. By acquiring a magnetic induction intensity data matrix, lock-in amplification, convolution filtering, binarization, and defect judgment are performed, and the hardware computing power of the FPGA is used to realize defect detection.

Benefits of technology

It significantly improves defect detection efficiency, enables efficient detection of surface defects in weld overlay workpieces, and solves the problems of low detection efficiency and delay in existing technologies.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025109138_30042026_PF_FP_ABST
    Figure CN2025109138_30042026_PF_FP_ABST
Patent Text Reader

Abstract

Disclosed are an FPGA-based method and device for surface defect detection of a surfaced workpiece. The method comprises: acquiring a magnetic induction intensity data matrix (S10); performing lock-in amplification on the magnetic induction intensity data matrix to obtain an original feature data matrix (S20); performing convolution filtering processing on the original feature data matrix to obtain a smoothed feature data matrix (S30); performing binarization processing on the smoothed feature data matrix to obtain a binarized data matrix (S40); on the basis of the binarized data matrix, determining whether magnetic field distortion is present on the surface of a surfaced workpiece (S50); and when magnetic field distortion is present on the surface of the surfaced workpiece, determining whether the magnetic field distortion is caused by a surface defect of the workpiece, and outputting a detection report on the basis of the determination result (S60). Defect detection is realized by means of hardware, fully utilizing the strong computational capability of the FPGA, and significantly improving the defect detection efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

FPGA-based method and device for detecting surface defects in weld overlay workpieces Technical Field

[0001] This invention relates to the field of defect detection technology, and in particular to a method and apparatus for detecting surface defects in weld overlay workpieces based on FPGA. Background Technology

[0002] In nuclear power plants, many structural components require hard alloy welding for mechanical connections. However, during the welding process, various factors (such as temperature gradients and material inhomogeneity) can cause defects such as cracks and porosity on the surface of the welded workpiece. These defects can severely affect the performance and service life of the workpiece. Therefore, the detection of surface defects in welded workpieces has become an indispensable part of the process.

[0003] In related technologies, defect detection devices mainly include: 1. Defect detection devices with single array probes, which require repeated scanning of the surface of the welded workpiece to complete the detection work, resulting in very low detection efficiency; 2. Defect detection devices with multiple array probes, which have higher detection efficiency than single array probes, but are limited by the fact that the detection model is usually implemented in software, and the algorithm is complex, resulting in low detection efficiency. In addition, when processing multi-channel sensor data, defect identification often has a certain delay, causing data lag and failing to meet the requirements for efficient and real-time detection of welded workpieces. Summary of the Invention

[0004] The technical problem to be solved by the present invention is to provide a method and device for detecting surface defects of weld overlay workpieces based on FPGA.

[0005] The technical solution adopted by this invention to solve its technical problem is: constructing a method for detecting surface defects in weld overlay workpieces based on FPGA, comprising:

[0006] Obtain a magnetic induction intensity data matrix; wherein, the magnetic induction intensity data matrix includes magnetic induction intensity signals output by N AC electromagnetic field detection probes scanning the surface of the welded workpiece M times, where N and M are positive integers;

[0007] The magnetic induction intensity data matrix is ​​amplified by lock-in to obtain the original feature data matrix;

[0008] The original feature data matrix is ​​subjected to convolution filtering to obtain a smoothed feature data matrix;

[0009] The smoothed feature data matrix is ​​binarized to obtain a binarized data matrix;

[0010] Determine whether there is magnetic field distortion on the surface of the weld overlay workpiece based on the binarized data matrix;

[0011] When the magnetic field distortion exists on the surface of the weld overlay workpiece, it is determined whether the magnetic field distortion is caused by a defect on the workpiece surface, and an inspection report is output based on the determination result.

[0012] Preferably, the step of performing lock-in amplification on the magnetic induction intensity data matrix includes:

[0013] Obtain reference signal design parameters, wherein the reference signal design parameters include reference signal amplitude and reference signal angular frequency;

[0014] The first reference signal expression and the second reference signal expression are determined based on the reference signal design parameters.

[0015] For each magnetic induction intensity signal included in the magnetic induction intensity data matrix, the following steps are performed: The product of the magnetic induction intensity signal with the first reference signal expression and the second reference signal expression is calculated to obtain a first product expression and a second product expression; a cutoff frequency is set according to the excitation signal frequency of the AC electromagnetic field detection probe, and the harmonic components and random noise components in the first product expression and the second product expression are removed according to the cutoff frequency to obtain a first amplitude expression and a second amplitude expression; the useful signal amplitude of the magnetic induction intensity signal is calculated based on the first amplitude expression and the second amplitude expression.

[0016] The amplitudes of each useful signal constitute the original feature data matrix.

[0017] Preferably, the expression for the first reference signal is: ,in, Indicates the first reference signal. This represents the amplitude of the reference signal. This represents the angular frequency of the reference signal. Indicates time, Indicates time displacement;

[0018] The expression for the second reference signal is: ,in, Indicates the second reference signal;

[0019] The expression for the magnetic flux density signal is: ,in, This represents the magnetic induction intensity signal. This indicates the amplitude of the magnetic induction intensity signal. This represents the angular frequency of the magnetic flux density signal. Indicates the initial phase angle. This represents random noise.

[0020] Preferably, the angular frequency of the reference signal is equal to the frequency of the excitation signal;

[0021] The step of setting the cutoff frequency according to the excitation signal frequency of the AC electromagnetic field detection probe includes:

[0022] The cutoff frequency is set to a frequency greater than 1 and less than 2 times the frequency of the excitation signal.

[0023] Preferably, the step of performing convolution filtering on the original feature data matrix includes:

[0024] Based on the set convolution filtering operator, matrix filtering operations are performed on each of the useful signal amplitudes included in the original feature data to obtain multiple smooth feature data that correspond one-to-one with each of the useful signal amplitudes;

[0025] The smoothing feature data constitute the smoothing feature data matrix;

[0026] The defined convolutional filtering operator is expressed as follows: .

[0027] Preferably, the step of binarizing the smoothed feature data matrix includes:

[0028] The ratio of the maximum smooth feature data in the smooth feature data matrix to the preset maximum value is the mapping ratio;

[0029] Based on the mapping ratio, each smooth feature data is mapped to obtain multiple mapping values ​​corresponding to each smooth feature data.

[0030] For each of the mapping values, determine whether the mapping value is greater than a set threshold. If it is, assign the mapping value to the first set value; otherwise, assign the mapping value to the second set value.

[0031] Each assigned mapping value is recorded as binary data;

[0032] The binarized data constitute the binarized data matrix.

[0033] Preferably, the step of binarizing the smoothed feature data matrix further includes:

[0034] The binarized data are subjected to erosion and dilation processes to form the binarized data matrix.

[0035] Preferably, the step of determining whether magnetic field distortion exists based on the binarized data matrix includes:

[0036] Determine whether the binarized data matrix includes at least one binarized data with the first set value; if so, determine that there is magnetic field distortion.

[0037] Preferably, the step of determining whether the magnetic field distortion is caused by a surface defect in the workpiece includes:

[0038] The trained neural network module determines whether the magnetic field distortion is caused by defects on the workpiece surface.

[0039] Preferably, the step of outputting a test report based on the judgment result includes:

[0040] When the magnetic field distortion is caused by defects on the workpiece surface, the smooth feature data matrix is ​​mapped to a color space to obtain a color magnetic field image of the surface of the welded workpiece.

[0041] The coordinates of the magnetic field distortion region in the binary data matrix are determined as the superimposed coordinates of the preselection box;

[0042] The preselection box is superimposed on the superposition coordinates of the color magnetic field image, and the color magnetic field image after superimposing the preselection box is output.

[0043] Preferably, the step of mapping the smoothed feature data matrix to a color space includes:

[0044] According to a preset mapping function, each smooth feature data included in the smooth feature data matrix is ​​mapped to the red, green and blue channels in the color space to obtain the color magnetic field image;

[0045] The mapping functions include the red mapping function, the green mapping function, and the blue mapping function:

[0046] ;

[0047] ;

[0048] ;

[0049] in, This represents the red mapping function. This represents the green mapping function. Let x represent the blue mapping function, and let x represent the smoothed feature data.

[0050] The present invention also constructs a surface defect detection device for weld overlay workpieces, including an FPGA and N AC electromagnetic field detection probes;

[0051] Each of the AC electromagnetic field detection probes is used to scan the surface of the welded workpiece M times, and outputs a corresponding magnetic induction intensity signal after each scan; N and M are positive integers;

[0052] The FPGA includes a lock-in amplifier module, a convolution filter module, a binary morphological filter module, and a judgment module;

[0053] The lock-in amplifier module is used to amplify the magnetic induction intensity signal output by each of the AC electromagnetic field detection probes in a lock-in manner to output the original feature data matrix.

[0054] The convolutional filtering module is used to perform convolutional filtering on the original feature data matrix to output a smooth feature data matrix;

[0055] The binary morphological filtering module is used to binarize the smoothed feature data matrix to output a binary data matrix.

[0056] The judgment module is used to determine whether magnetic field distortion exists based on the binarized data matrix, and when magnetic field distortion exists, to determine whether the magnetic field distortion is caused by surface defects of the workpiece, so as to output a test report based on the judgment result.

[0057] Preferably, the judgment module includes a neural network module, a pseudo-color imaging module, and a pre-selection box processing module;

[0058] The neural network module is used to determine whether magnetic field distortion exists based on the binarized data matrix, and after determining that magnetic field distortion exists, to determine whether the magnetic field distortion is caused by defects on the workpiece surface.

[0059] The pseudo-color imaging module is used to map the smooth feature data matrix to a color space when the magnetic field distortion is caused by defects on the workpiece surface, so as to output a color magnetic field image of the surface of the welded workpiece.

[0060] The preselection box processing module is used to determine the coordinates of the magnetic field distortion region in the binary data matrix as the superposition coordinates of the preselection box, and when the magnetic field distortion exists in the binary data matrix, before the pseudo-color imaging module outputs the color magnetic field image, the preselection box is superimposed on the superposition coordinates of the color magnetic field image.

[0061] Preferably, the FPGA further includes a signal generation module for outputting excitation digital signals;

[0062] The surface defect detection device for weld overlay workpieces also includes a signal processing module, an interface module, an AD sampling module, a DA conversion module, and an excitation module;

[0063] The signal processing module is connected to each of the AC electromagnetic field detection probes to amplify and filter the magnetic induction intensity signal output by each of the AC electromagnetic field detection probes.

[0064] The interface module connects the signal processing module, the AD sampling module, the DA conversion module, and the excitation module to send the amplified and filtered magnetic induction intensity signal to the AD sampling module.

[0065] The AD sampling module is connected to the lock-in amplifier module to convert the magnetic induction intensity signal from the interface module into a digital signal and send the converted magnetic induction intensity signal to the lock-in amplifier module.

[0066] The DA conversion module and the signal generation module convert the excitation digital signal into an analog signal and output the converted excitation digital signal to the interface module.

[0067] The excitation module is used to generate an excitation signal that can excite each of the AC electromagnetic field detection probes to work, based on the excitation digital signal from the interface module.

[0068] Preferably, the surface defect detection device for weld overlay workpiece further includes a TMR magnetic sensor for detecting the angle between the detection direction of each of the AC electromagnetic field detection probes and the surface of the weld overlay workpiece.

[0069] The present invention has the following beneficial effects: it provides a method for detecting surface defects of welded workpieces based on FPGA. The method uses FPGA to sequentially perform phase-locked amplification, convolution filtering, binarization and defect judgment on the magnetic induction intensity data matrix, so as to realize defect detection in hardware. It makes full use of the advantages of strong computing power of FPGA and significantly improves the efficiency of defect detection. Attached Figure Description

[0070] The present invention will be further described below with reference to the accompanying drawings and embodiments. In the accompanying drawings:

[0071] Figure 1 is a flowchart of a method for detecting surface defects of weld overlay workpieces based on FPGA in some embodiments of the present invention;

[0072] Figure 2 is a schematic diagram showing defects on the surface of the weld overlay workpiece in some embodiments of the present invention;

[0073] Figure 3 is a grayscale image of the original feature data matrix obtained after phase-locked amplification of the magnetic induction intensity data matrix in the embodiment of Figure 2.

[0074] Figure 4 is a grayscale image of the smoothed feature data matrix obtained after performing convolution filtering on the original feature data matrix in the embodiment of Figure 3.

[0075] Figure 5 is a grayscale image of the binarized data matrix obtained after binarizing the smoothed feature data matrix in the embodiment of Figure 4.

[0076] Figure 6 is a circuit structure block diagram of a surface defect detection device for weld overlay workpieces in some embodiments of the present invention;

[0077] Figure 7 is a schematic diagram of a high-resolution detection array composed of various AC electromagnetic field detection probes in some embodiments of the present invention;

[0078] Figure 8 is a circuit block diagram of a lock-in amplifier in some embodiments of the present invention. Detailed Implementation

[0079] To provide a clearer understanding of the technical features, objectives, and effects of the present invention, specific embodiments of the present invention will now be described in detail with reference to the accompanying drawings.

[0080] It should be noted that the flowcharts shown in the accompanying drawings are merely illustrative and do not necessarily include all content and operations / steps, nor do they necessarily have to be performed in the described order. For example, some operations / steps can be broken down, while others can be combined or partially combined; therefore, the actual execution order may change depending on the specific circumstances.

[0081] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities can 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.

[0082] This invention provides a method for detecting surface defects in weld overlay workpieces based on FPGA, wherein the FPGA is applied to the surface defect detection device for weld overlay workpieces, enabling efficient detection of surface defects in weld overlay workpieces. As shown in Figure 1, the method for detecting surface defects in weld overlay workpieces may include steps S10, S20, S30, S40, S50, and S60.

[0083] Step S10 includes: acquiring a magnetic induction intensity data matrix; wherein, the magnetic induction intensity data matrix includes magnetic induction intensity signals output by N AC electromagnetic field detection probes scanning the surface of the welded workpiece M times, where N and M are positive integers. In this step, each AC electromagnetic field detection probe 104 outputs a magnetic induction intensity signal each time it scans the surface of the welded workpiece; that is, the magnetic induction intensity data matrix includes the magnetic induction intensity signals output by all AC electromagnetic field detection probes after multiple scans of the surface of the welded workpiece. It should be noted that the magnetic induction intensity signal is a voltage signal, and its voltage value can characterize the magnitude of the magnetic induction intensity detected by the AC electromagnetic field detection probe 104. Further, the AC electromagnetic field detection probes can be arranged in an array to form a high-resolution detection array, such as in a J*K configuration, where J*K equals N.

[0084] Step S20 includes: performing phase-locked amplification on the magnetic induction intensity data matrix to obtain the original feature data matrix. The purpose of this step is to perform phase-locked processing on the magnetic induction intensity data matrix according to a set frequency, filtering out components with frequencies other than the set frequency, thereby improving the signal-to-noise ratio. Please refer to Figures 2 and 3. Figure 2 is a schematic diagram of surface defects on the welded workpiece in some embodiments, where the circles in the diagram correspond to the locations of surface defects. Figure 3 is a grayscale image of the original feature data matrix obtained after phase-locked amplification of the magnetic induction intensity data matrix in the embodiment of Figure 2. Comparing Figures 2 and 3, it can be seen that after phase-locked amplification of the magnetic induction intensity data matrix, the surface defects can be initially revealed. However, many noise points still exist in the image in Figure 2, and the risk of incorrect defect location (i.e., defect coordinates) is relatively high.

[0085] In some embodiments, the step of performing phase-locked amplification on the magnetic induction intensity data matrix may include steps S201, S202, S203, and S204.

[0086] Step S201 includes: obtaining reference signal design parameters, wherein the reference signal design parameters include the reference signal amplitude and the reference signal angular frequency. Since the frequency of the useful signal in each magnetic induction intensity signal included in the magnetic induction intensity data matrix is ​​theoretically similar to the excitation signal frequency that excites the AC electromagnetic field detection probe, it is preferable to set the reference signal angular frequency to be equal to the excitation signal frequency. In addition, the angular frequency of the magnetic induction intensity signal can also be regarded as equal to the excitation signal frequency.

[0087] Step S202 includes: determining a first reference signal expression and a second reference signal expression based on the reference signal design parameters. In this step, the first reference signal expression can be expressed as: , Indicates the first reference signal. Indicates the amplitude of the reference signal. Indicates the angular frequency of the reference signal. Indicates time, This represents the time displacement. The expression for the second reference signal can be expressed as: , This indicates the second reference signal.

[0088] Step S203 includes: for each magnetic induction intensity signal included in the magnetic induction intensity data matrix, respectively: calculating the product of the magnetic induction intensity signal with the first reference signal expression and the second reference signal expression to obtain the first product expression and the second product expression; setting a cutoff frequency according to the excitation signal frequency of the AC electromagnetic field detection probe, so as to remove the harmonic components and random noise components in the first product expression and the second product expression according to the cutoff frequency to obtain the first amplitude expression and the second amplitude expression; calculating the useful signal amplitude of the magnetic induction intensity signal according to the first amplitude expression and the second amplitude expression;

[0089] In this step, the expression for the magnetic flux density signal can be: ,in, Indicates the magnetic flux density signal. The amplitude of the magnetic flux density signal is represented. The angular frequency representing the magnetic flux density signal. This represents random noise. Furthermore, the first product expression can be expressed as: , Represents the first product. Represents the harmonic component. This represents the random noise component. The second product expression can be expressed as: , Indicates the second product. This represents the harmonic component in the second product expression. This represents the random noise component. The expression for the magnitude of the useful signal can be: A = A represents the amplitude of the useful signal. Indicates the first value. This represents the first value.

[0090] In some embodiments, the cutoff frequency can be set to a frequency greater than 1 and less than 2 times the excitation signal frequency, if simultaneously set as follows: =1、 Accordingly, the step of removing the harmonic components and random noise components from the first and second product expressions based on the cutoff frequencies includes: removing signal components other than the cutoff frequencies from the first and second product expressions. Specifically, taking the first product expression as an example, the harmonic components in the first product expression can be expressed as: That is, the angular frequency of the harmonic component is The random noise component in the first product expression can be represented as: That is, the angular frequency of the random noise component is ,because ( (representing the excitation signal frequency), setting the cutoff frequency to a frequency greater than 1 and less than 2 times the excitation signal frequency is equivalent to setting the angular frequency in the first product expression to be no greater than... and not less than 2 (based on The signal is directly removed, that is, the harmonic components and random noise components in the first product expression are removed. The expression for the first amplitude obtained after removing the harmonic components and random noise components can be expressed as follows: Similarly, The expression for the second amplitude after removing the harmonic components and random noise components can be expressed as: .

[0091] Step S204 includes: using the amplitudes of each useful signal to form the original feature data matrix.

[0092] Step S30 includes performing convolution filtering on the original feature data matrix to obtain a smoothed feature data matrix. This step further filters out noise from the original feature data, making the original feature data matrix smoother, so as to extract the feature signals from the original feature data matrix. Please refer to Figures 3 and 4. Figure 4 is a grayscale image of the smoothed feature data matrix obtained after performing convolution filtering on the original feature data matrix in the embodiment of Figure 3. By comparing Figure 4 and Figure 3, it can be seen that after convolution filtering, most of the noise around the defect is filtered out, making the features of the defect area more prominent.

[0093] In some embodiments, the step of performing convolutional filtering on the original feature data matrix may include steps S301 and S302.

[0094] Step S301 includes: performing matrix filtering operations on each useful signal amplitude included in the original feature data based on a set convolution filtering operator, to obtain multiple smooth feature data corresponding one-to-one with each useful signal amplitude. The set convolution filtering operator can be expressed as: .

[0095] Step S302 includes: using each smoothing feature data to form the smoothing feature data matrix.

[0096] Step S40 includes: binarizing the smoothed feature data matrix to obtain a binarized data matrix. Please refer to Figure 5, which is a grayscale image of the binarized data matrix obtained after binarizing the smoothed feature data matrix in the embodiment of Figure 4. By comparing Figure 4 and Figure 5, it can be seen that after binarization, the binarized data matrix can very significantly display the defect area in the grayscale image.

[0097] In some embodiments, the step of binarizing the smooth feature data matrix may include steps S401, S402, S403, S404, and S405.

[0098] Step S401 includes: determining the ratio of the maximum smooth feature data in the smooth feature data matrix to the preset maximum value as the mapping ratio.

[0099] Step S402 includes: mapping each smooth feature data in the smooth feature data matrix based on the mapping ratio to obtain multiple mapping values ​​corresponding to each smooth feature data. In this step, assuming the maximum smooth feature data is A, and the preset maximum value is equal to B, then the mapping ratio is equal to A / B. Let the smooth feature data be C, then the mapping value after mapping each smooth feature data can be expressed as: D=C / (A / B)=C*B / A, where D represents the mapping value.

[0100] Furthermore, the preset maximum value can be equal to 255. Mapping the smooth feature data matrix based on the mapping ratio is equivalent to mapping the smooth feature data matrix to a lookup table with a depth of 256 according to a certain ratio, thereby obtaining multiple mapping values.

[0101] Step S403 includes: for each mapping value, determining whether the mapping value is greater than a set threshold; if so, assigning the mapping value a first set value; otherwise, assigning the mapping value a second set value. The first set value can be logic "1", and the second set value can be logic "0". The set threshold can be customized according to requirements. It should be noted that the sensitivity of defect detection is positively correlated with the size of the set threshold.

[0102] Step S404 includes: recording each assigned mapping value as binary data.

[0103] Step S405 includes: using each binarized data to form the binarized data matrix.

[0104] To eliminate noise that may be caused by the binarization threshold, in some embodiments, before step S405, the method may further include: performing erosion and dilation processing on each binarized data, and then using the processed binarized data to form the binarized data matrix. The erosion and dilation processing can be implemented using existing erosion and dilation algorithms.

[0105] Step S50 includes: determining whether there is magnetic field distortion on the surface of the weld overlay workpiece based on the binarized data matrix. Specifically, determining whether there is magnetic field distortion based on the binarized data matrix may include: determining whether the binarized data matrix includes at least one binarized data with a first value; when the binarized data matrix includes at least one binarized data with a first value, determining that there is magnetic field distortion on the surface of the weld overlay workpiece; when the binarized data matrix does not contain any binarized data with a first value, determining that there is no magnetic field distortion on the surface of the weld overlay workpiece.

[0106] Step S60 includes: when there is magnetic field distortion on the surface of the weld overlay workpiece, determining whether the magnetic field distortion is caused by a defect on the workpiece surface, and outputting a test report based on the determination result.

[0107] In some embodiments, the step of determining whether the magnetic field distortion is caused by a workpiece surface defect may include: determining whether the magnetic field distortion is caused by a workpiece surface defect using a trained neural network module. The training process of the neural network module may include: establishing a learning model based on a neural network algorithm; obtaining training samples (including multiple first samples of magnetic field distortion caused by workpiece surface defects and multiple second samples of magnetic field distortion not caused by workpiece surface defects), to train the learning model using the training samples, thereby obtaining a neural network module capable of determining whether the magnetic field distortion is caused by a workpiece surface defect. Of course, to improve the accuracy of the neural network module's determination, parameters such as hyperparameters of the neural network module can be adjusted as needed.

[0108] In some embodiments, the step of outputting a detection report based on the judgment result may include steps S601, S602, and S603.

[0109] Step S601 includes: when the magnetic field distortion is caused by defects on the surface of the workpiece, mapping the smooth feature data matrix to the color space to obtain a color magnetic field image of the surface of the welded workpiece.

[0110] In some embodiments, the step of mapping the smooth feature data matrix to a color space may include: mapping each smooth feature data included in the smooth feature data matrix to the red, green and blue channels in the color space according to a preset mapping function, so as to obtain a color magnetic field image.

[0111] The mapping function can include a red mapping function, a green mapping function, and a blue mapping function, and are represented as follows:

[0112] ;

[0113] ;

[0114] ;

[0115] in, Represents the red mapping function, Represents the green mapping function, Let represent the blue mapping function, and x represent the smoothed feature data.

[0116] Step S602 includes: determining the coordinates of the magnetic field distortion region in the binary data matrix as the superimposed coordinates of the preselection box.

[0117] It should be noted that after sequentially performing phase-locked amplification, convolution filtering, and binarization on the magnetic flux density data, the multiple binarized data included in the binary data matrix still have a one-to-one correspondence with the multiple magnetic flux density signals. Moreover, since the magnetic field distortion is determined by judging whether there is binary data in the binary data matrix, it can be understood that in this embodiment, the magnetic flux density signals corresponding to all the binarized data with the first set value can be recorded as distortion signals. Furthermore, the detection coordinates of the array composed of each AC electromagnetic field detection probe can be pre-entered, that is, the coordinates of the area detected by each AC electromagnetic field detection probe are known. Since each magnetic flux density signal corresponds one-to-one with each AC electromagnetic field detection probe, the detection area coordinates of the AC electromagnetic field detection probe corresponding to each distortion signal can be determined as the superimposed coordinates of the preselection box.

[0118] Step S603 includes: superimposing a preselection box on the superposition coordinates of the color magnetic field image, and outputting the color magnetic field image after superimposing the preselection box. Understandably, the purpose of the preselection box is to make the distorted magnetic field more prominently displayed on the color magnetic field image, facilitating workers to locate the actual position of surface defects on the welded workpiece based on the preselection box.

[0119] It should be noted that FPGA, or Field Programmable Gate Array, can achieve parallel computing in hardware, boasting strong computing power. Compared to dedicated chips, deploying neural networks in hardware offers higher operating efficiency than a software environment. This invention also integrates various data matrix processing algorithms (including magnetic induction intensity data matrix, original feature data matrix, smoothed feature data matrix, and binarized data matrix) into a unified package. A single FPGA computing module implements functions such as phase-locked amplification, convolutional filtering, neural network discrimination, and coordinate frame selection, offering advantages in hardware operating efficiency and significantly improving defect detection efficiency. Furthermore, FPGAs offer advantages such as small hardware size and provide the hardware foundation for real-time imaging in this invention. Simultaneously, the AC electromagnetic field detection probes in this invention form a high-density, high-resolution sensor array, enabling the surface defect detection device for welded workpieces to acquire defect images with a single scan, solving the problem of low efficiency in the repetitive scanning process of previous single-array probes.

[0120] Understandably, the technical solution of the present invention uses an FPGA to sequentially perform phase-locked amplification, convolution filtering, binarization, and defect detection on the magnetic induction intensity data matrix, thereby realizing defect detection in hardware. This fully utilizes the advantages of the strong computing power of the FPGA and significantly improves the efficiency of defect detection.

[0121] As shown in Figure 6, the present invention also provides a surface defect detection device for weld overlay workpieces, which may include an FPGA and N AC electromagnetic field detection probes 104.

[0122] Each AC electromagnetic field detection probe 104 scans the surface of the welded workpiece M times and outputs a corresponding magnetic induction intensity signal after each scan. N and M are positive integers, where N can be 32. Accordingly, 32 AC electromagnetic field detection probes 104 can form a 2*16 high-resolution detection array as shown in Figure 7.

[0123] As shown in Figure 6, the FPGA includes a lock-in amplifier module 402, a convolution filter module 403, a binary morphological filter module 405, and a judgment module 410.

[0124] The lock-in amplifier module 402 is used to amplify the magnetic induction intensity signals output by each AC electromagnetic field detection probe 104 in a lock-in manner to output the original feature data matrix. The lock-in amplifier module 402 can be a 32-channel orthogonal vector digital lock-in amplifier. The specific structure of the lock-in amplifier can be seen in Figure 8, and will not be described further here.

[0125] It should be noted that the specific process of phase-locked amplification can be referred to steps S201 to S204 provided in the embodiments of the present invention, and will not be repeated here.

[0126] The convolutional filtering module 403 is used to perform convolutional filtering on the original feature data matrix to output a smooth feature data matrix. It should be noted that the specific process of convolutional filtering can be found in steps S301 and S302 provided in the embodiments of this invention, and will not be repeated here.

[0127] The binary morphological filtering module 405 is used to binarize the smoothed feature data matrix to output a binary data matrix. It should be noted that the specific process of binarization can be found in steps S401 to S405 provided in the embodiments of this invention, and will not be repeated here.

[0128] The judgment module 410 is used to determine whether magnetic field distortion exists based on the binary data matrix, and if magnetic field distortion exists, to determine whether the magnetic field distortion is caused by surface defects of the workpiece, so as to output a test report based on the judgment result.

[0129] In some embodiments, as shown in FIG6, the judgment module 410 includes a neural network module 407, a pseudo-color imaging module 404, and a pre-selection box processing module 406.

[0130] The neural network module 407 is used to determine whether magnetic field distortion exists based on the binarized data matrix, and after determining that magnetic field distortion exists, to determine whether the magnetic field distortion is caused by surface defects on the workpiece. Specifically, the neural network module 407 is a pre-trained neural network module capable of determining whether magnetic field distortion is caused by surface defects on the workpiece.

[0131] The pseudo-color imaging module 404 is used to map a smoothed feature data matrix to a color space when magnetic field distortion is caused by defects on the workpiece surface, so as to output a colored magnetic field image of the surface of the welded workpiece. It should be noted that the specific steps for mapping the smoothed feature data matrix to the color space can be referred to the embodiment provided above, and will not be repeated here.

[0132] The preselection box processing module 406 is used to determine the coordinates of the magnetic field distortion region in the binary data matrix as the superposition coordinates of the preselection box. When there is magnetic field distortion in the binary data matrix, the preselection box is superimposed on the superposition coordinates of the color magnetic field image before the pseudo-color imaging module 404 outputs the color magnetic field image. It should be noted that the specific steps for determining the superposition coordinates of the preselection box can be referred to the embodiment provided above, and will not be repeated here.

[0133] In some embodiments, as shown in FIG6, the FPGA may further include a signal generation module 401 for outputting a digital excitation signal. Specifically, the digital excitation signal may be a PWM signal with a certain frequency and / or a certain duty cycle, and the frequency or duty cycle of the PWM signal may control the frequency and / or amplitude of the excitation signal.

[0134] Accordingly, as shown in Figure 6, the surface defect detection device for weld overlay workpieces may also include a signal processing module 102, an interface module 106, an AD sampling module 20, a DA conversion module 30, and an excitation module 103.

[0135] The signal processing module 102 is connected to each AC electromagnetic field detection probe 104 to amplify and filter the magnetic induction intensity signal output by each AC electromagnetic field detection probe 104. Specifically, the signal processing module 102 can use existing amplification and filtering circuits. Its function is to filter and amplify the magnetic induction intensity signal output by each AC electromagnetic field detection probe 104, and send the filtered and amplified signal to the AD sampling module 20 via the interface module 106.

[0136] Interface module 106 connects signal processing module 102, AD sampling module 20, DA conversion module 30, and excitation module 103 to send the amplified and filtered magnetic induction intensity signal to AD sampling module 20. Specifically, interface module 106 can be an existing Remo connector, and its function is to realize the electrical connection between signal processing module 102, AD sampling module 20, DA conversion module 30, and excitation module 103.

[0137] The AD sampling module 20 is connected to the lock-in amplifier module 402 to convert the magnetic field strength signal from the interface module 106 into a digital signal and send the converted magnetic field strength signal to the lock-in amplifier module 402. Specifically, since the FPGA cannot easily recognize analog signals directly, the AD sampling module 20 can be an existing AD sampling circuit that can convert the magnetic field strength signal from the interface module 106 from an analog signal into a digital signal for FPGA recognition.

[0138] The DA conversion module 30 and the signal generation module 401 convert the excitation digital signal into an analog signal and output the converted excitation digital signal to the interface module 106. Specifically, since it is inconvenient for the FPGA to directly output analog signals, the DA conversion module 30 can be an existing DA conversion circuit that can convert the excitation digital signal from the signal generation module 401 from a digital signal into an analog signal so that the excitation module 103 can recognize it.

[0139] The excitation module 103 is used to generate an excitation signal that can excite each AC electromagnetic field detection probe 104 to work based on the excitation digital signal from the interface module 106. Specifically, the excitation module 103 can be an existing sine wave generator circuit, which can generate an excitation signal with a set frequency and amplitude based on the excitation digital signal.

[0140] In some embodiments, as shown in FIG6, the surface defect detection device for weld overlay workpieces may further include a TMR magnetic sensor 1041 for detecting the angle between the detection direction of each AC electromagnetic field detection probe 104 and the surface of the weld overlay workpiece. As shown in FIG7, the TMR magnetic sensor 1041 may be disposed on the detection array composed of each AC electromagnetic field detection probe 104. The TMR magnetic sensor 1041 is connected to the FPGA through the interface module 106 to generate a TMR signal characterizing the magnitude of the angle based on the angle between the detection array and the surface of the weld overlay workpiece. Accordingly, the FPGA may further include a probe direction sensing module, which is used to determine whether the detection direction of each AC electromagnetic field detection probe 104 (i.e., the detection array) is perpendicular to the surface of the weld overlay workpiece based on the TMR signal. When the detection direction of each AC electromagnetic field detection probe 104 is not perpendicular to the surface of the weld overlay workpiece, the module outputs a prompt signal to prompt the user to adjust the direction of each AC electromagnetic field detection probe 104 to ensure that the magnetic field direction emitted by the AC electromagnetic field detection probe 104 is perpendicular to the surface of the weld overlay workpiece, which helps to improve detection accuracy.

[0141] In some embodiments, as shown in FIG6, the surface defect detection device for weld overlay workpiece may further include a housing 10 for housing the signal processing module 102, the interface module 106, the excitation module 103, the TMR magnetic sensor 1041, and each AC electromagnetic field detection probe 104.

[0142] In some embodiments, the surface defect detection device for weld overlay workpieces may further include a display screen 50 for displaying a detection report, the display screen 50 being connected to an FPGA.

[0143] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to the method section.

[0144] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.

[0145] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.

[0146] It is understood that the above embodiments only illustrate preferred embodiments of the present invention, and their descriptions are relatively specific and detailed, but they should not be construed as limiting the scope of the present invention. It should be noted that those skilled in the art can freely combine the above technical features without departing from the concept of the present invention, and can also make several modifications and improvements, all of which fall within the protection scope of the present invention. Therefore, all equivalent transformations and modifications made with respect to the scope of the claims of the present invention should fall within the scope of the claims of the present invention.

Claims

1. A method for detecting surface defects in weld overlay workpieces based on FPGA, characterized in that, include: Obtain a magnetic induction intensity data matrix; wherein, the magnetic induction intensity data matrix includes magnetic induction intensity signals output by N AC electromagnetic field detection probes scanning the surface of the welded workpiece M times, where N and M are positive integers; The magnetic induction intensity data matrix is ​​amplified by lock-in to obtain the original feature data matrix; The original feature data matrix is ​​subjected to convolution filtering to obtain a smoothed feature data matrix; The smoothed feature data matrix is ​​binarized to obtain a binarized data matrix; Determine whether there is magnetic field distortion on the surface of the weld overlay workpiece based on the binarized data matrix; When the magnetic field distortion exists on the surface of the weld overlay workpiece, it is determined whether the magnetic field distortion is caused by a defect on the workpiece surface, and an inspection report is output based on the determination result.

2. The FPGA-based method for detecting surface defects in weld overlay workpieces according to claim 1, characterized in that, The step of performing lock-in amplification on the magnetic induction intensity data matrix includes: Obtain reference signal design parameters, wherein the reference signal design parameters include reference signal amplitude and reference signal angular frequency; The first reference signal expression and the second reference signal expression are determined based on the reference signal design parameters. For each magnetic induction intensity signal included in the magnetic induction intensity data matrix, the following steps are performed: The product of the magnetic induction intensity signal with the first reference signal expression and the second reference signal expression is calculated to obtain a first product expression and a second product expression; a cutoff frequency is set according to the excitation signal frequency of the AC electromagnetic field detection probe, and the harmonic components and random noise components in the first product expression and the second product expression are removed according to the cutoff frequency to obtain a first amplitude expression and a second amplitude expression; the useful signal amplitude of the magnetic induction intensity signal is calculated based on the first amplitude expression and the second amplitude expression. The amplitudes of each useful signal constitute the original feature data matrix.

3. The FPGA-based method for detecting surface defects in weld overlay workpieces according to claim 2, characterized in that, The expression for the first reference signal is: ,in, Indicates the first reference signal. This represents the amplitude of the reference signal. This represents the angular frequency of the reference signal. Indicates time, Indicates time displacement; The expression for the second reference signal is: ,in, Indicates the second reference signal; The expression for the magnetic flux density signal is: ,in, This represents the magnetic induction intensity signal. This indicates the amplitude of the magnetic induction intensity signal. This represents the angular frequency of the magnetic flux density signal. Indicates the initial phase angle. This represents random noise.

4. The FPGA-based method for detecting surface defects in weld overlay workpieces according to claim 3, characterized in that, The angular frequency of the reference signal is equal to the frequency of the excitation signal; The step of setting the cutoff frequency according to the excitation signal frequency of the AC electromagnetic field detection probe includes: The cutoff frequency is set to a frequency greater than 1 and less than 2 times the frequency of the excitation signal.

5. The FPGA-based method for detecting surface defects in weld overlay workpieces according to claim 2, characterized in that, The step of performing convolution filtering on the original feature data matrix includes: Based on the set convolution filtering operator, matrix filtering operations are performed on each of the useful signal amplitudes included in the original feature data to obtain multiple smooth feature data that correspond one-to-one with each of the useful signal amplitudes; The smoothing feature data constitute the smoothing feature data matrix; The defined convolutional filtering operator is expressed as follows: 。 6. The FPGA-based method for detecting surface defects in weld overlay workpieces according to claim 5, characterized in that, The step of binarizing the smoothed feature data matrix includes: The ratio of the maximum smooth feature data in the smooth feature data matrix to the preset maximum value is the mapping ratio; Based on the mapping ratio, each smooth feature data is mapped to obtain multiple mapping values ​​corresponding to each smooth feature data. For each of the mapping values, determine whether the mapping value is greater than a set threshold. If it is, assign the mapping value to the first set value; otherwise, assign the mapping value to the second set value. Each assigned mapping value is recorded as binary data; The binarized data constitute the binarized data matrix.

7. The FPGA-based method for detecting surface defects in weld overlay workpieces according to claim 6, characterized in that, The step of binarizing the smoothed feature data matrix further includes: The binarized data are subjected to erosion and dilation processes to form the binarized data matrix.

8. The FPGA-based method for detecting surface defects in weld overlay workpieces according to claim 7, characterized in that, The step of determining whether magnetic field distortion exists based on the binarized data matrix includes: Determine whether the binarized data matrix includes at least one binarized data with the first set value; if so, determine that there is magnetic field distortion.

9. The FPGA-based method for detecting surface defects in weld overlay workpieces according to claim 1, characterized in that, The step of determining whether the magnetic field distortion is caused by surface defects of the workpiece includes: The trained neural network module determines whether the magnetic field distortion is caused by defects on the workpiece surface.

10. The FPGA-based method for detecting surface defects in weld overlay workpieces according to any one of claims 1 to 9, characterized in that, The step of outputting a test report based on the judgment result includes: When the magnetic field distortion is caused by defects on the workpiece surface, the smooth feature data matrix is ​​mapped to a color space to obtain a color magnetic field image of the surface of the welded workpiece. The coordinates of the magnetic field distortion region in the binary data matrix are determined as the superimposed coordinates of the preselection box; The preselection box is superimposed on the superposition coordinates of the color magnetic field image, and the color magnetic field image after superimposing the preselection box is output.

11. The FPGA-based method for detecting surface defects in weld overlay workpieces according to claim 10, characterized in that, The step of mapping the smoothed feature data matrix to a color space includes: According to a preset mapping function, each smooth feature data included in the smooth feature data matrix is ​​mapped to the red, green and blue channels in the color space to obtain the color magnetic field image; The mapping functions include the red mapping function, the green mapping function, and the blue mapping function: ; ; ; in, This represents the red mapping function. This represents the green mapping function. Let x represent the blue mapping function, and let x represent the smoothed feature data.

12. A device for detecting surface defects in weld overlay workpieces, characterized in that, Includes an FPGA and N AC electromagnetic field detection probes (104). Each of the AC electromagnetic field detection probes (104) is used to scan the surface of the weldment workpiece M times, and outputs the corresponding magnetic induction intensity signal after each scan; N and M are positive integers; The FPGA includes a lock-in amplifier module (402), a convolution filter module (403), a binary morphological filter module (405), and a judgment module (410). The lock-in amplifier module (402) is used to perform lock-in amplification on the magnetic induction intensity signal output by each of the AC electromagnetic field detection probes (104) to output the original feature data matrix; The convolutional filtering module (403) is used to perform convolutional filtering on the original feature data matrix to output a smooth feature data matrix; The binary morphological filtering module (405) is used to binarize the smoothed feature data matrix to output a binary data matrix; The judgment module (410) is used to determine whether there is magnetic field distortion based on the binary data matrix, and when there is magnetic field distortion, to determine whether the magnetic field distortion is caused by a surface defect of the workpiece, so as to output a test report based on the judgment result.

13. The surface defect detection device for weld overlay workpieces according to claim 12, characterized in that, The judgment module (410) includes a neural network module (407), a pseudo-color imaging module (404), and a pre-selection box processing module (406). The neural network module (407) is used to determine whether there is magnetic field distortion based on the binarized data matrix, and after determining that there is magnetic field distortion, to determine whether the magnetic field distortion is caused by defects on the workpiece surface. The pseudo-color imaging module (404) is used to map the smooth feature data matrix to a color space when the magnetic field distortion is caused by defects on the surface of the workpiece, so as to output a color magnetic field image of the surface of the welded workpiece. The preselection box processing module (406) is used to determine the coordinates of the magnetic field distortion region in the binary data matrix as the superposition coordinates of the preselection box, and when the magnetic field distortion exists in the binary data matrix, before the pseudo-color imaging module (404) outputs the color magnetic field image, the preselection box is superimposed on the superposition coordinates of the color magnetic field image.

14. The surface defect detection device for weld overlay workpieces according to claim 12 or 13, characterized in that, The FPGA also includes a signal generation module (401) for outputting excitation digital signals. The surface defect detection device for the weld overlay workpiece also includes a signal processing module (102), an interface module (106), an AD sampling module (20), a DA conversion module (30), and an excitation module (103). The signal processing module (102) is connected to each of the AC electromagnetic field detection probes (104) to amplify and filter the magnetic induction intensity signal output by each of the AC electromagnetic field detection probes (104). The interface module (106) connects the signal processing module (102), the AD sampling module (20), the DA conversion module (30), and the excitation module (103) to send the amplified and filtered magnetic induction intensity signal to the AD sampling module (20). The AD sampling module (20) is connected to the lock-in amplifier module (402) to convert the magnetic induction intensity signal from the interface module (106) into a digital signal and send the converted magnetic induction intensity signal to the lock-in amplifier module (402). The DA conversion module (30) and the signal generation module (401) convert the excitation digital signal into an analog signal and output the converted excitation digital signal to the interface module (106). The excitation module (103) is used to generate an excitation signal that can excite each of the AC electromagnetic field detection probes (104) to work, based on the excitation digital signal from the interface module (106).

15. The surface defect detection device for weld overlay workpieces according to claim 12 or 13, characterized in that, It also includes a TMR magnetic sensor (1041) for detecting the angle between the detection direction of each of the AC electromagnetic field detection probes (104) and the surface of the weld overlay workpiece.