Stack welding workpiece surface defect detection method and device based on FPGA

Through the FPGA-based surface defect detection method of surfacing workpieces, using phase-locked amplification, convolutional filtering and binary processing, the problem of inefficiency of existing defect detection devices is solved, and efficient and real-time defect detection is achieved.

CN119574690AActive Publication Date: 2025-03-07CHINA NUCLEAR POWER ENGINEERING COMPANY LTD +1

Patent Information

Application Number
CN202411600782.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-08
Publication Date
2025-03-07
Estimated Expiration
2044-11-08

AI Technical Summary

Technical Problem

The existing defect detection devices are inefficient in surface defect detection of surfacing workpieces, especially the multi-array probe devices have delays when processing multi-channel sensor data, which cannot meet the requirements of efficient real-time detection.

Method used

The surface defect detection method of surfacing workpieces based on FPGA is adopted, and phase locked amplification, convolutional filtering, and binary processing are performed by obtaining the magnetic induction intensity data matrix. The neural network is used to determine whether the magnetic field distortion is caused by the surface defect of the workpiece, and the detection report is output.

Benefits of technology

The efficiency of defect detection is significantly improved, the computing power of FPGA is fully utilized, real-time detection is realized, and the problem of inefficiency in the existing technology is solved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119574690A_ABST
    Figure CN119574690A_ABST
Patent Text Reader

Abstract

The invention relates to an FPGA (Field Programmable Gate Array)-based surfacing workpiece surface defect detection method and device. The method comprises the following steps: acquiring a magnetic induction intensity data matrix; performing phase-locked amplification on the magnetic induction intensity data matrix to obtain an original feature data matrix; performing convolution filtering processing on the original feature data matrix to obtain a smooth feature data matrix; performing binarization processing on the smooth feature data matrix to obtain a binarized data matrix; whether magnetic field distortion exists on the surface of the surfacing workpiece or not is determined according to the binary data matrix; and when the magnetic field distortion exists on the surface of the surfacing workpiece, judging whether the magnetic field distortion is caused by surface defects of the workpiece or not, and outputting a detection report according to a judgment result. Defect detection is realized by utilizing hardware, the advantage of high operational capability of the FPGA is fully utilized, and the efficiency of defect detection is remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of defect detection, and in particular to a method and device for detecting surface defects of a cladding workpiece based on FPGA. Background Art

[0002] In nuclear power plants, many structural parts need to be welded with carbide to achieve mechanical connection. However, during the welding process, various factors (such as temperature gradient, uneven materials, etc.) may cause defects such as cracks and pores on the surface of the welded workpiece, which will seriously affect the performance and service life of the workpiece. Therefore, the detection of surface defects of welded workpieces has become an indispensable part.

[0003] In the related technology, defect detection devices mainly include: 1. Defect detection devices with single array probes, which need to repeatedly scan the surface of the welded workpiece to complete the detection work, and the detection efficiency is very low; 2. Defect detection devices with multi-array probes. Although the detection efficiency is higher than that of the single array probe, it is limited by the fact that the detection model is usually implemented by software and the algorithm is complex, resulting in low detection efficiency. When processing multi-channel sensor data, defect identification often has a certain delay, resulting in detection data jamming, and cannot meet the efficient and real-time detection needs 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 a cladding workpiece based on FPGA.

[0005] The technical solution adopted by the present invention to solve the technical problem is: constructing a method for detecting surface defects of a cladding workpiece based on FPGA, comprising:

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

[0007] Performing phase-locked amplification on the magnetic induction intensity data matrix to obtain an original characteristic data matrix;

[0008] Performing convolution filtering on the original feature data matrix to obtain a smoothed feature data matrix;

[0009] Binarizing the smoothed feature data matrix to obtain a binary data matrix;

[0010] Determining whether there is magnetic field distortion on the surface of the cladding workpiece according to the binary data matrix;

[0011] When the magnetic field distortion exists on the surface of the surfacing workpiece, it is determined whether the magnetic field distortion is caused by a surface defect of the workpiece, and a detection report is output according to the determination result.

[0012] Preferably, the step of performing phase-locked amplification on the magnetic induction intensity data matrix comprises:

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

[0014] Determine a first reference signal expression and a second reference signal expression based on the reference signal design parameters;

[0015] For each magnetic induction intensity signal included in the magnetic induction intensity data matrix, the following operations are performed: the product of the magnetic induction intensity signal and 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, so as to remove the frequency multiplication component and the random noise component in the first product expression and the second product expression 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 according to the first amplitude expression and the second amplitude expression;

[0016] The useful signal amplitudes constitute the original characteristic data matrix.

[0017] Preferably, the first reference signal expression is: r1(t)=V r sin(ω r t+τ), where r1(t) represents the first reference signal, V r represents the reference signal amplitude, ω r represents the reference signal angular frequency, t represents time, and τ represents time displacement;

[0018] The second reference signal expression is: r2(t)=V r cos(ω r t+τ), wherein r2(t) represents the second reference signal;

[0019] The expression of the magnetic induction intensity signal is: X(t)=Asin(ωt+φ)+N(t), where X(t) represents the magnetic induction intensity signal, A represents the amplitude of the magnetic induction intensity signal, ω represents the angular frequency of the magnetic induction intensity signal, φ represents the initial phase angle, and N(t) represents random noise.

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

[0021] The step of setting the cut-off frequency according to the excitation signal frequency of the AC electromagnetic field detection probe comprises:

[0022] The cut-off frequency is set to a frequency greater than 1 times 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 comprises:

[0024] Based on the set convolution filter operator, each useful signal amplitude included in the original feature data is subjected to matrix filtering operation to obtain a plurality of smooth feature data corresponding to each useful signal amplitude;

[0025] Each of the smooth feature data constitutes the smooth feature data matrix;

[0026] Wherein, the set convolution filter operator is expressed as:

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

[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] Performing mapping processing on each of the smooth feature data based on the mapping ratio to obtain a plurality of mapping values ​​corresponding to each of the smooth feature data;

[0030] For each of the mapping values, respectively: determining whether the mapping value is greater than a set threshold, if so, assigning the mapping value to a first set value, if not, assigning the mapping value to a second set value;

[0031] Record each assigned mapping value as binary data;

[0032] Each of the binary data constitutes the binary data matrix.

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

[0034] The binary data are eroded and expanded to form the binary data matrix through the processed binary data.

[0035] Preferably, the step of determining whether there is magnetic field distortion according to the binary data matrix comprises:

[0036] It is determined whether the binary data matrix includes at least one binary data with a first setting value, and if so, it is determined that magnetic field distortion exists.

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

[0038] The trained neural network module is used to determine whether the magnetic field distortion is caused by surface defects of the workpiece.

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

[0040] When the magnetic field distortion is caused by a workpiece surface defect, the smooth feature data matrix is ​​mapped to a color space to obtain a color magnetic field image of the surface of the surfacing workpiece;

[0041] Determine the coordinates of the magnetic field distortion area in the binary data matrix as the superimposed coordinates of the pre-selected box;

[0042] The pre-selection frame is superimposed on the superimposed coordinates of the color magnetic field image, and the color magnetic field image after the pre-selection frame is superimposed is output.

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

[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 respectively to obtain the color magnetic field image;

[0045] The mapping function includes a red mapping function, a green mapping function and a blue mapping function:

[0046]

[0047] Among them, f R represents the red mapping function, f G represents the green mapping function, f B represents the blue mapping function, and x represents smoothed feature data.

[0048] The present invention also constructs a device for detecting surface defects of a cladding workpiece, including an FPGA and N AC electromagnetic field detection probes;

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

[0050] The FPGA includes a phase-locked amplifier module, a convolution filter module, a binary morphological filter module and a judgment module;

[0051] The phase-locked amplification module is used to perform phase-locked amplification on the magnetic induction intensity signal output by each of the AC electromagnetic field detection probes to output an original characteristic data matrix;

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

[0053] The binary morphological filtering module is used to perform a binarization process on the smooth feature data matrix to output a binary data matrix;

[0054] The judgment module is used to determine whether there is magnetic field distortion according to the binary data matrix, and to determine whether the magnetic field distortion is caused by a surface defect of the workpiece when the magnetic field distortion exists, so as to output a detection report according to the judgment result.

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

[0056] The neural network module is used to determine whether there is magnetic field distortion according to the binary data matrix, and after determining that there is magnetic field distortion, determine whether the magnetic field distortion is caused by a surface defect of the workpiece;

[0057] 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 a workpiece surface defect, so as to output a color magnetic field image of the surface of the surfacing workpiece;

[0058] The pre-selection box processing module is used to determine the coordinates of the magnetic field distortion area in the binary data matrix as the superimposed coordinates of the pre-selection 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, superimpose the pre-selection box on the superimposed coordinates of the color magnetic field image.

[0059] Preferably, the FPGA further comprises a signal generating module for outputting an excitation digital signal;

[0060] The device for detecting surface defects of surfacing workpieces further comprises a signal processing module, an interface module, an AD sampling module, a DA conversion module and an excitation module;

[0061] 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;

[0062] The interface module is connected to the signal processing module, the AD sampling module, the DA conversion module and the excitation module to send the magnetic induction intensity signal after amplification and filtering to the AD sampling module;

[0063] The AD sampling module is connected to the phase-locked 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 phase-locked amplifier module;

[0064] The DA conversion module and the signal generation module are used to convert the excitation digital signal into an analog signal, and output the converted excitation digital signal to the interface module;

[0065] The excitation module is used to generate an excitation signal capable of stimulating each of the AC electromagnetic field detection probes to work according to the excitation digital signal from the interface module.

[0066] Preferably, the device for detecting surface defects of a surfacing workpiece further comprises a TMR magnetic sensor for detecting an angle between a detection direction of each of the AC electromagnetic field detection probes and the surface of the surfacing workpiece.

[0067] The implementation of the present invention has the following beneficial effects: providing a method for detecting surface defects of cladding workpieces based on FPGA, using FPGA to sequentially implement phase-locked amplification, convolution filtering, binarization and defect judgment on the magnetic induction intensity data matrix, thereby realizing defect detection by hardware, making full use of the advantages of FPGA's strong computing power, and significantly improving the efficiency of defect detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0068] The present invention will be further described below with reference to the accompanying drawings and embodiments, in which:

[0069] Figure 1 is a program flow chart of a method for detecting surface defects of a cladding workpiece based on FPGA in some embodiments of the present invention;

[0070] Figure 2 is a schematic diagram of defects on the surface of a cladding workpiece in some embodiments of the present invention;

[0071] Figure 3 Yes Figure 2 A grayscale image of the original characteristic data matrix obtained after phase-locked amplification of the magnetic induction intensity data matrix in the embodiment;

[0072] Figure 4 Yes Figure 3 A grayscale image of a smoothed feature data matrix obtained after the original feature data matrix in the embodiment is subjected to convolution filtering;

[0073] Figure 5 Yes Figure 4 A grayscale image of a binary data matrix obtained after the smoothed feature data matrix in the embodiment is binarized;

[0074] Figure 6is a circuit structure block diagram of a device for detecting surface defects of a cladding workpiece in some embodiments of the present invention;

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

[0076] Figure 8 1 is a circuit structure block diagram of a lock-in amplifier in some embodiments of the present invention. DETAILED DESCRIPTION

[0077] In order to have a clearer understanding of the technical features, purposes and effects of the present invention, specific embodiments of the present invention are now described in detail with reference to the accompanying drawings.

[0078] It should be noted that the flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor do they have to be executed in the order described. For example, some operations / steps can be decomposed, while some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.

[0079] 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 may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.

[0080] The present invention provides a method for detecting surface defects of a cladding workpiece based on FPGA, wherein the FPGA is applied to a cladding workpiece surface defect detection device, and can efficiently realize the detection of surface defects of the cladding workpiece. Figure 1 As shown, the method for detecting surface defects of a surfacing workpiece may include step S10, step S20, step S30, step S40, step S50 and step S60.

[0081] Step S10 includes: obtaining 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 cladding workpiece M times, and N and M are positive integers. In the step, each AC electromagnetic field detection probe 104 outputs a magnetic induction intensity signal each time it scans the surface of the cladding workpiece, that is, the magnetic induction intensity data matrix includes the magnetic induction intensity signals output by all AC electromagnetic field detection probes after scanning the surface of the cladding workpiece multiple times. It should be noted that the magnetic induction intensity signal is a voltage signal, which can characterize the magnitude of the magnetic induction intensity detected by the AC electromagnetic field detection probe 104 based on the magnitude of its voltage value. Furthermore, each AC electromagnetic field detection probe can be arranged in the form of an array to form a high-resolution detection array, such as arranged in the form of J*K, wherein J*K is equal to N.

[0082] Step S20 includes: performing phase-locked amplification on the magnetic induction intensity data matrix to obtain the original characteristic data matrix. The purpose of this step is to perform phase-locked processing on the magnetic induction intensity data matrix according to the set frequency, and to filter out the components of the magnetic induction intensity data matrix that are not of the set frequency, thereby improving the signal-to-noise ratio. Figure 2 and Figure 3 , Figure 2 Schematic diagram of defects on the surface of a cladding workpiece in some embodiments, wherein the position of the circle in the diagram corresponds to the position of the surface defect. Figure 3 Yes Figure 2 Grayscale image of the original characteristic data matrix obtained after phase-locked amplification of the magnetic induction intensity data matrix in the embodiment. Figure 2 and Figure 3 It can be seen that after the phase-locked amplification of the magnetic induction intensity data matrix, the surface defects can be initially detected. Figure 2 There are still many noise points on the screen, and the risk of misidentification of the defect position (i.e., defect coordinates) is high.

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

[0084] Step S201 includes: obtaining reference signal design parameters, wherein the reference signal design parameters include reference signal amplitude and 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 frequency of the excitation signal that excites the AC electromagnetic field detection probe to work, it is preferred to set the reference signal angular frequency to be equal to the frequency of the excitation signal. In addition, the angular frequency of the magnetic induction intensity signal can also be regarded as equal to the frequency of the excitation signal.

[0085] Step S202 includes: determining a first reference signal expression and a second reference signal expression based on the reference signal design parameter. In the step, the first reference signal expression can be expressed as: r1(t)=V r sin(ω r t+τ), r1(t) represents the first reference signal, V r represents the reference signal amplitude, ω r represents the reference signal angular frequency, t represents time, and τ represents time displacement. The second reference signal expression can be expressed as: r2(t)=V r cos(ω r t+τ), r2(t) represents the second reference signal.

[0086] Step S203 includes: performing the following operations on each magnetic induction intensity signal included in the magnetic induction intensity data matrix: calculating the product of the magnetic induction intensity signal with the first reference signal expression and the second reference signal expression, respectively, to obtain a first product expression and a 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 frequency-multiplied components and random noise components in the first product expression and the second product expression according to the cutoff frequency, to obtain a first amplitude expression and a 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;

[0087] In this step, the magnetic induction intensity signal expression can be: Wherein, X(t) represents the magnetic induction intensity signal, A represents the amplitude of the magnetic induction intensity signal, ω represents the angular frequency of the magnetic induction intensity signal, and N(t) represents random noise. Further, the first product expression can be expressed as: μ1 represents the first product, Indicates the frequency-doubled component, V r N(t)sin(ω r t+τ) represents the random noise component. The second product expression can be expressed as: μ2 represents the second product, represents the frequency-doubled component in the second product expression, V r N(t)cos(ω r t+τ) represents the random noise component. The expression of the useful signal amplitude can be: A represents the useful signal amplitude, μ out1 represents the first amplitude, μ out2 Indicates the first amplitude.

[0088] In some embodiments, the cutoff frequency can be set to a frequency greater than 1 times and less than 2 times the excitation signal frequency. r =1,ω=ω r . Accordingly, the step of removing the frequency-doubled components and random noise components in the first product expression and the second product expression according to the cutoff frequency includes: removing the signal components other than the cutoff frequency in the first product expression and the second product expression. Specifically, taking the first product expression as an example, the frequency-doubled components in the first product expression can be expressed as: That is, the angular frequency of the double frequency component is 2ω, and the random noise component in the first product expression can be expressed as V r N(t)cos(ωt+τ), that is, the angular frequency of the random noise component is ω, because ω=2πf (f represents the excitation signal frequency), setting the cutoff frequency to a frequency greater than 1 times and less than 2 times the excitation signal frequency is equivalent to directly removing the signal with an angular frequency not greater than ω and not less than 2ω (based on ω=2πf) in the first product expression, that is, removing the double frequency component and random noise component in the first product expression, then μ1 removes the double frequency component and random noise component to obtain the first amplitude expression can be expressed as: Similarly, the second amplitude expression obtained by removing the frequency-doubled component and the random noise component from μ2 can be expressed as:

[0089] Step S204 includes: using each useful signal amplitude to form the original characteristic data matrix.

[0090] Step S30 includes: performing convolution filtering on the original feature data matrix to obtain a smooth feature data matrix. The purpose of this step is to further filter out the noise in the original feature data, make the original feature data matrix smoother, and extract the feature signal in the original feature data matrix. Figure 3 and Figure 4 , Figure 4 Yes Figure 3 The grayscale image of the smoothed feature data matrix obtained after the original feature data matrix in the embodiment is subjected to convolution filtering is compared with Figure 4 and Figure 3 It can be seen that after the convolution filter processing, most of the noise points around the defect will be filtered out, making the features of the defect area more eye-catching.

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

[0092] Step S301 includes: performing matrix filtering operations on each useful signal amplitude included in the original feature data based on a set convolution filter operator to obtain a plurality of smooth feature data corresponding to each useful signal amplitude. The set convolution filter operator can be expressed as:

[0093] Step S302 includes: using each smooth feature data to form the smooth feature data matrix.

[0094] Step S40 includes: binarizing the smoothed feature data matrix to obtain a binary data matrix. Figure 5 , Figure 5 Yes Figure 4 The grayscale image of the binary data matrix obtained after the smooth feature data matrix in the embodiment is binarized is compared with Figure 4 and Figure 5 It can be seen that after the binarization process, the binary data matrix can very significantly display the defect area in the grayscale image.

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

[0096] 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.

[0097] Step S402 includes: mapping each smooth feature data included in the smooth feature data matrix based on the mapping ratio to obtain a plurality of mapping values ​​corresponding to each smooth feature data. In this step, assuming that 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, assuming that the smooth feature data is 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.

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

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

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

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

[0102] In order to eliminate the noise points that may be caused by the binarization threshold, in some embodiments, before step S405, the process may further include: performing corrosion and expansion processing on each binarized data, and then forming the binarized data matrix through the processed binarized data. The corrosion and expansion processing may be implemented using existing corrosion and expansion algorithms.

[0103] Step S50 includes: determining whether there is magnetic field distortion on the surface of the surfacing workpiece according to the binary data matrix. Specifically, determining whether there is magnetic field distortion on the surface of the surfacing workpiece according to the binary data matrix may include: judging whether the binary data matrix includes at least one binary data with a first setting value, when the binary data matrix includes at least one binary data with a first setting value, judging that there is magnetic field distortion on the surface of the surfacing workpiece, and when there is no binary data with the first setting value in the binary data matrix, judging that there is no magnetic field distortion on the surface of the surfacing workpiece.

[0104] Step S60 includes: when magnetic field distortion exists on the surface of the surfacing workpiece, determining whether the magnetic field distortion is caused by a surface defect of the workpiece, and outputting a detection report according to the determination result.

[0105] In some embodiments, the step of determining whether the magnetic field distortion is caused by a surface defect of the workpiece may include: determining whether the magnetic field distortion is caused by a surface defect of the workpiece through 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 a plurality of first samples of magnetic field distortion caused by surface defects of the workpiece and a plurality of second samples of magnetic field distortion not caused by surface defects of the workpiece), so as to train the learning model through the training samples, so as to obtain a neural network module capable of determining whether the magnetic field distortion is caused by surface defects of the workpiece. Of course, in order to improve the judgment accuracy of the neural network module, the hyperparameters and other parameters of the neural network module may also be adjusted according to demand.

[0106] In some embodiments, the step of outputting a test report according to the judgment result may include step S601, step S602 and step S603.

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

[0108] In some embodiments, the step of mapping the smooth feature data matrix to the 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 to obtain a color magnetic field image.

[0109] The mapping function may include a red mapping function, a green mapping function and a blue mapping function, which are respectively expressed as:

[0110]

[0111] Among them, f R represents the red mapping function, f G represents the green mapping function, f B represents the blue mapping function, and x represents the smooth feature data.

[0112] Step S602 includes: determining the coordinates of the magnetic field distortion area in the binary data matrix as the superimposed coordinates of the pre-selected box.

[0113] It should be noted that after the magnetic induction intensity data is subjected to phase-locked amplification, convolution filtering and binarization in sequence, there is still a one-to-one correspondence between the multiple binary data included in the binary data matrix and the multiple magnetic induction intensity signals, and since the magnetic field distortion judgment is determined by judging whether there is binary data in the binary data matrix, it can be understood that in this embodiment, the magnetic induction intensity signals corresponding to all the binary data with the first setting value can actually be recorded as distortion signals, and the detection coordinates of the array composed of each AC electromagnetic field detection probe can be entered in advance, that is, the coordinates of the area detected by each AC electromagnetic field detection probe are known, and because each magnetic induction intensity signal corresponds to each AC electromagnetic field detection probe one-to-one, 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 pre-selected box.

[0114] Step S603 includes: superimposing a preselection box on the superimposed coordinates of the color magnetic field image, and outputting the color magnetic field image after superimposing the preselection box. It can be understood that the role of the preselection box is to make the distorted magnetic field more prominently displayed on the color magnetic field image, so that the staff can find the actual position of the defect on the surface of the surfacing workpiece based on the preselection box.

[0115] It should be noted that FPGA is a field programmable gate array. FPGA can rely on hardware to achieve parallel computing and has the advantage of strong computing power. Compared with dedicated chips, the use of hardware to deploy neural networks has higher operating efficiency than software environments. The present invention combines various data matrix (including magnetic induction intensity data matrix, original feature data matrix, smooth feature data matrix, binary data matrix) processing algorithms for unified packaging, and realizes phase-locked amplification, convolution filtering, neural network discrimination, coordinate frame selection and other functions through an FPGA calculation module. It has the advantage of hardware operating efficiency and can significantly improve the efficiency of defect detection. FPGA also has the advantages of reducing the size of hardware, and FPGA can also provide a hardware basis for real-time imaging in the present invention. At the same time, the AC electromagnetic field detection probes in the present invention form a sensor array with high density and high resolution, so that the surface defect detection device of the surfacing workpiece can realize the acquisition of defect images through one scan, which solves the problem of low efficiency in the repeated scanning process of a single array probe in the past.

[0116] It can be understood that the technical solution of the present invention uses FPGA to implement phase-locked amplification, convolution filtering, binarization and defect judgment on the magnetic induction intensity data matrix in sequence, so as to realize defect detection by hardware, fully utilize the advantages of FPGA's strong computing power, and significantly improve the efficiency of defect detection.

[0117] like Figure 6 As shown, the present invention further provides a device for detecting surface defects of a cladding workpiece, which may include an FPGA and N AC electromagnetic field detection probes 104 .

[0118] Each AC electromagnetic field detection probe 104 is used to scan the surface of the cladding workpiece M times, and output 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 be formed as follows: Figure 7 The 2*16 high-resolution detection array shown.

[0119] like Figure 6 As shown, the FPGA includes a phase-locked amplifier module 402 , a convolution filter module 403 , a binary morphological filter module 405 and a judgment module 410 .

[0120] The phase-locked amplifier module 402 is used to perform phase-locked amplification on the magnetic induction intensity signals output by each AC electromagnetic field detection probe 104 to output the original characteristic data matrix. The phase-locked amplifier module 402 can be a 32-way orthogonal vector digital phase-locked amplifier. The specific structure of the phase-locked amplifier can be referred to Figure 8 , I will not go into details here.

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

[0122] The convolution filter module 403 is used to perform convolution filter processing on the original feature data matrix to output a smooth feature data matrix. It should be noted that the specific process of the convolution filter processing can refer to step S301 and step S302 provided in the embodiment of the present invention, and will not be repeated here.

[0123] The binary morphological filtering module 405 is used to perform binarization processing on the smooth feature data matrix to output a binary data matrix. It should be noted that the specific process of the binarization processing can refer to step S401 to step S405 provided in the embodiment of the present invention, and will not be repeated here.

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

[0125] In some embodiments, Figure 6 As shown, the judgment module 410 includes a neural network module 407 , a pseudo-color imaging module 404 and a pre-selection box processing module 406 .

[0126] The neural network module 407 is used to determine whether there is magnetic field distortion according to the binary data matrix, and to determine whether the magnetic field distortion is caused by a surface defect of the workpiece after determining that there is magnetic field distortion. The neural network module 407 is a pre-trained neural network module that can determine whether the magnetic field distortion is caused by a surface defect of the workpiece.

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

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

[0129] In some embodiments, Figure 6As shown, the FPGA may further include a signal generating module 401 for outputting an excitation digital signal. Specifically, the excitation digital 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.

[0130] Accordingly, if Figure 6 As shown, the device for detecting surface defects of a surfacing workpiece may further 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 .

[0131] 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 be an existing amplifying and filtering circuit, which is used 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.

[0132] 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 magnetic induction intensity signal after amplification and filtering to the AD sampling module 20. Specifically, the interface module 106 can be an existing Lemo connector, which is used to realize the electrical connection between the signal processing module 102, the AD sampling module 20, the DA conversion module 30 and the excitation module 103.

[0133] The AD sampling module 20 is connected to the phase-locked 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 phase-locked amplifier module 402. Specifically, since it is inconvenient for FPGA to directly identify analog signals, accordingly, the AD sampling module 20 can be an existing AD sampling circuit, which can convert the magnetic induction intensity signal from the interface module 106 from an analog signal to a digital signal for FPGA recognition.

[0134] The DA conversion module 30 and the signal generation module 401 are used to 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 FPGA to directly output analog signals, the DA conversion module 30 can be an existing DA conversion circuit, which can convert the excitation digital signal from the signal generation module 401 from a digital signal to an analog signal so that the excitation module 103 can recognize it.

[0135] The excitation module 103 is used to generate an excitation signal capable of stimulating each AC electromagnetic field detection probe 104 to work according to the excitation digital signal from the interface module 106. Specifically, the excitation module 103 can be an existing sine wave generating circuit, which can generate an excitation signal of set frequency and amplitude according to the excitation digital signal.

[0136] In some embodiments, Figure 6 As shown, the device for detecting surface defects of a cladding workpiece may also 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 cladding workpiece. Figure 7 As shown, the TMR magnetic sensor 1041 can be arranged on the detection array composed of each AC electromagnetic field detection probe 104, and the TMR magnetic sensor 1041 is connected to the FPGA through the interface module 106 to generate a TMR signal representing the angle according to the angle between the detection array and the surface of the surfacing workpiece. Correspondingly, the FPGA can also 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 surfacing workpiece according to the TMR signal, and when the detection direction of each AC electromagnetic field detection probe 104 is not perpendicular to the surface of the surfacing workpiece, output a prompt signal to prompt the user to adjust the direction of each AC electromagnetic field detection probe 104 to ensure that the direction of the magnetic field emitted by the AC electromagnetic field detection probe 104 is perpendicular to the surface of the surfacing workpiece, which helps to improve the detection accuracy.

[0137] In some embodiments, Figure 6 As shown, the device for detecting surface defects of a cladding workpiece may further include a housing 10 for accommodating a signal processing module 102 , an interface module 106 , an excitation module 103 , a TMR magnetic sensor 1041 and each AC electromagnetic field detection probe 104 .

[0138] In some embodiments, the device for detecting surface defects of a surfacing workpiece may further include a display screen 50 for displaying a detection report, and the display screen 50 is connected to the FPGA.

[0139] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.

[0140] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0141] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0142] It can be understood that the above embodiments only express the preferred implementation modes of the present invention, and the description thereof is relatively specific and detailed, but it cannot be understood as limiting the patent scope of the present invention. It should be pointed out that, for ordinary technicians in this field, without departing from the concept of the present invention, the above technical features can be freely combined, and several deformations and improvements can be made, which all belong to the protection scope of the present invention. Therefore, all equivalent changes and modifications made to the scope of the claims of the present invention should belong to the scope covered by the claims of the present invention.

Claims

1. A method for detecting surface defects of cladding workpieces based on FPGA, characterized in that: include: Acquire a magnetic induction intensity data matrix; wherein the magnetic induction intensity data matrix includes magnetic induction intensity signals output by N alternating current electromagnetic field detection probes scanning the surface of the cladding workpiece M times, where N and M are positive integers; Performing phase-locked amplification on the magnetic induction intensity data matrix to obtain an original characteristic data matrix; Performing convolution filtering on the original feature data matrix to obtain a smoothed feature data matrix; Binarizing the smoothed feature data matrix to obtain a binary data matrix; Determining whether there is magnetic field distortion on the surface of the cladding workpiece according to the binary data matrix; When the magnetic field distortion exists on the surface of the surfacing workpiece, it is determined whether the magnetic field distortion is caused by a surface defect of the workpiece, and a detection report is output according to the determination result.

2. The method for detecting surface defects of cladding workpieces based on FPGA according to claim 1, characterized in that: The step of performing phase-locked amplification on the magnetic induction intensity data matrix comprises: Acquire reference signal design parameters, wherein the reference signal design parameters include reference signal amplitude and reference signal angular frequency; Determine a first reference signal expression and a second reference signal expression based on the reference signal design parameters; For each magnetic induction intensity signal included in the magnetic induction intensity data matrix, the following operations are performed: the product of the magnetic induction intensity signal and 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, so as to remove the frequency multiplication component and the random noise component in the first product expression and the second product expression 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 according to the first amplitude expression and the second amplitude expression; The useful signal amplitudes constitute the original characteristic data matrix.

3. The method for detecting surface defects of cladding workpieces based on FPGA according to claim 2, characterized in that: The first reference signal expression is: r1(t)=V r sin(ω r t+τ), where r1(t) represents the first reference signal, V r represents the reference signal amplitude, ω r represents the reference signal angular frequency, t represents time, and τ represents time displacement; The second reference signal expression is: r2(t)=V r cos(ω r t+τ), wherein r2(t) represents the second reference signal; The expression of magnetic induction intensity signal is: Wherein, X(t) represents the magnetic induction intensity signal, A represents the amplitude of the magnetic induction intensity signal, ω represents the angular frequency of the magnetic induction intensity signal, represents the initial phase angle, and N(t) represents random noise.

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

5. The method for detecting surface defects of cladding workpieces based on FPGA according to claim 2, characterized in that: The step of performing convolution filtering on the original feature data matrix comprises: Based on the set convolution filter operator, each useful signal amplitude included in the original feature data is subjected to matrix filtering operation to obtain a plurality of smooth feature data corresponding to each useful signal amplitude; Each of the smooth feature data constitutes the smooth feature data matrix; Wherein, the set convolution filter operator is expressed as:

6. The method for detecting surface defects of cladding workpieces based on FPGA according to claim 5, characterized in that: The step of binarizing the smooth feature data matrix comprises: The ratio of the maximum smooth feature data in the smooth feature data matrix to the preset maximum value is the mapping ratio; Performing mapping processing on each of the smooth feature data based on the mapping ratio to obtain a plurality of mapping values ​​corresponding to each of the smooth feature data; For each of the mapping values, respectively: determining whether the mapping value is greater than a set threshold, if so, assigning the mapping value to a first set value, if not, assigning the mapping value to a second set value; Record each assigned mapping value as binary data; Each of the binary data constitutes the binary data matrix.

7. The method for detecting surface defects of cladding workpieces based on FPGA according to claim 6, characterized in that: The step of binarizing the smooth feature data matrix further includes: The binary data are eroded and expanded to form the binary data matrix through the processed binary data.

8. The method for detecting surface defects of cladding workpieces based on FPGA according to claim 7, characterized in that: The step of determining whether there is magnetic field distortion according to the binary data matrix comprises: It is determined whether the binary data matrix includes at least one binary data with a first setting value, and if so, it is determined that magnetic field distortion exists.

9. The method for detecting surface defects of cladding workpieces based on FPGA according to claim 1, characterized in that: The step of determining whether the magnetic field distortion is caused by a surface defect of the workpiece comprises: It is determined by the trained neural network module whether the magnetic field distortion is caused by surface defects of the workpiece.

10. The method for detecting surface defects of a cladding workpiece based on FPGA according to any one of claims 1 to 9, characterized in that: The step of outputting a test report according to the judgment result comprises: When the magnetic field distortion is caused by a workpiece surface defect, the smooth feature data matrix is ​​mapped to a color space to obtain a color magnetic field image of the surface of the surfacing workpiece; Determine the coordinates of the magnetic field distortion area in the binary data matrix as the superimposed coordinates of the pre-selected box; The pre-selection frame is superimposed on the superimposed coordinates of the color magnetic field image, and the color magnetic field image after the pre-selection frame is superimposed is output.

11. The method for detecting surface defects of cladding workpieces based on FPGA according to claim 10, characterized in that: The step of mapping the smooth feature data matrix to a color space comprises: 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 respectively to obtain the color magnetic field image; The mapping function includes a red mapping function, a green mapping function and a blue mapping function: Among them, f R represents the red mapping function, f G represents the green mapping function, f B represents the blue mapping function, and x represents smoothed feature data.

12. A device for detecting surface defects of a cladding workpiece, characterized in that: It 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 cladding workpiece M times, and output a corresponding magnetic induction intensity signal after each scan; N and M are positive integers; The FPGA comprises a phase-locked amplification module (402), a convolution filtering module (403), a binary morphological filtering module (405) and a judgment module (410); The phase-locked amplification module (402) is used to perform phase-locked amplification on the magnetic induction intensity signal output by each of the AC electromagnetic field detection probes (104) to output an original characteristic data matrix; The convolution filtering module (403) is used to perform convolution filtering on the original feature data matrix to output a smoothed feature data matrix; The binary morphological filtering module (405) is used to perform a binary process on the smooth 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 to determine whether the magnetic field distortion is caused by a surface defect of the workpiece when the magnetic field distortion exists, so as to output a detection report based on the judgment result to determine whether the magnetic field distortion is caused by a surface defect of the workpiece, and to output a detection report based on the judgment result.

13. The device for detecting surface defects of a cladding workpiece 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 frame processing module (406); The neural network module (407) is used to determine whether magnetic field distortion exists according to the binary data matrix, and after determining that the magnetic field distortion exists, determine whether the magnetic field distortion is caused by a surface defect of the workpiece; The pseudo-color imaging module (404) is used to map the smooth feature data matrix into a color space to output a color magnetic field image of the surface of the surfacing workpiece when the magnetic field distortion is caused by a workpiece surface defect; The pre-selection box processing module (406) is used to determine the coordinates of the magnetic field distortion area in the binary data matrix as the superimposed coordinates of the pre-selection 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, superimpose the pre-selection box on the superimposed coordinates of the color magnetic field image.

14. The device for detecting surface defects of a cladding workpiece according to claim 12 or 13, characterized in that: The FPGA also includes a signal generating module (401) for outputting an excitation digital signal; The device for detecting surface defects of a cladding workpiece further comprises 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) is connected to the signal processing module (102), the AD sampling module (20), the DA conversion module (30) and the excitation module (103) to send the magnetic induction intensity signal after amplification and filtering to the AD sampling module (20); The AD sampling module (20) is connected to the phase-locked 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 phase-locked amplifier module (402); The DA conversion module (30) and the signal generation module (401) are used to 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 capable of stimulating each of the AC electromagnetic field detection probes (104) to operate according to the excitation digital signal from the interface module (106).

15. The device for detecting surface defects of a cladding workpiece 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 AC electromagnetic field detection probe (104) and the surface of the surfacing workpiece.

Citation Information

Patent Citations

  • ACFM different-angle crack detection system based on rotating magnetic field

    CN103196989A

  • Real-time high-precision ACFM (alternating current field measurement) crack state monitoring system

    CN104007171A

  • Corrosion defects Visual imaging and evaluating method based on alternating current electromagnetic fields

    CN110243923A

  • TMR multi-array deep defect weak magnetic detection device

    CN113203792A

  • Alternating current electromagnetic field detection defect contour inversion method based on FPGA

    CN114926425A

Cited By

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

    WO2026086298A1