A method for automatically checking the current of a magnetic particle flaw detector
Through a microcontroller, the current data of the magnetic powder flaw detector is automatically read and corrected, and the multi-point matching verification is achieved, which solves the problem of large calibration errors of current instruments in the existing technology, and improves the calibration accuracy and automation level.
Patent Information
- Application Number
- CN202210199745.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-02
- Publication Date
- 2025-03-18
- Estimated Expiration
- 2042-03-02
AI Technical Summary
The existing magnetic powder flaw detector current instrument calibration method requires complex manual calculations, with large errors and cannot automatically perform multi-point matching calibration, resulting in low calibration accuracy.
A single chip computer is used to automatically read the current data and correct the built-in ammeter coefficient through a standard instrument to achieve multi-point matching verification. Specific steps include automatically reading current data, correcting coefficients, and converting data by calculating the start/output formula of longitudinal and circumferential magnetization currents.
Through the automated verification process, the difficulty of manual operations is reduced, the accuracy of ammeter display is improved, the calculation error is reduced, and the interface complexity with control and display is simplified.
Smart Images

Figure CN114660345B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of measurement and control technology, and in particular to an automatic current calibration method for a magnetic particle flaw detector. Background Art
[0002] Magnetic particle flaw detector is an effective means to detect whether there are cracks in the workpiece. In the design process of the flaw detector, the accuracy of the magnetizing current is the most important. In order to detect the accuracy of the current, the most commonly used method in the industry is to use a standard instrument with recognized accuracy to calibrate the built-in current display instrument of the flaw detector.
[0003] The current meter calibration of ordinary magnetic particle flaw detectors is manual calibration. When the current meter data is inconsistent with the standard meter display, it is usually calculated through complex formulas and the calibration is performed by changing the proportional parameters. If the calibration is required after the environment changes, the proportional coefficient of the system is usually changed. This method will cause a consequence. When the calibration is performed based on large current data, the error when displaying small current is relatively large. If the calibration is performed based on small current data, the error when displaying large current is relatively large. In addition, the circumferential magnetization current and longitudinal magnetization current curves of the magnetic particle flaw detector have different principles, and the existing measurement method has a large measurement error. Therefore, an automatic current calibration method for a magnetic particle flaw detector is urgently needed to solve the above problems. Summary of the invention
[0004] The present invention provides a current automatic calibration method for a magnetic particle flaw detector which can automatically read current data and perform multi-point matching for calibration, so as to solve the problems existing in the above-mentioned prior art.
[0005] To achieve the above object, the present invention provides the following technical solution: a method for automatically checking the current of a magnetic particle flaw detector, comprising the following steps:
[0006] S1, the single chip microcomputer automatically reads and saves the current data of the built-in ammeter of the flaw detector, and reads the current reading of the corresponding standard instrument through the serial port;
[0007] S2. Correct the built-in ammeter coefficient kk through standard instruments;
[0008] S3. Convert the data of the built-in ammeter into data consistent with the standard ammeter according to the corrected ammeter coefficient, including:
[0009] Calculation formula for the longitudinal magnetizing current input / output: y = x / kk;
[0010] The formula for calculating the circumferential magnetizing current start-up / output is divided into two stages, and a threshold value is preset. When the current is less than the threshold value: y=x / kk; when the current is greater than the threshold value: y=x / kk+b.
[0011] Preferably, in step S1, a number of fixed magnetizing currents are set in the single chip microcomputer, and when the single chip microcomputer sends a request data signal, the single chip microcomputer receives the current data through an interruption and saves it.
[0012] Preferably, in step S2, the coefficient is corrected by trying the 12000+m value method, specifically: first read the standard ammeter value and the built-in ammeter output during magnetization, and then adjust the size of m until the built-in ammeter output is the same as the standard ammeter value, where kk=12000+m.
[0013] Preferably, in step S3, when the current is greater than the delimiting value, a two-point method is used to obtain y=x / kk+b.
[0014] Preferably, in step S4, the demarcation value is 700A, wherein the two points in the two-point method are 700A and 1000A.
[0015] Preferably, in step S4, when kk is a floating point number with a decimal point, y=n×x / n×kk+n×b, n is a non-zero number, and n×kk and n×b are both integers.
[0016] Compared with the prior art, the present invention has the following beneficial effects: in the present invention, the current data of the standard instrument is automatically read by the single chip microcomputer, and the current query command is sent in a timely manner, so as to ensure that the recorded standard instrument data is synchronized with the current data of the built-in ammeter sampled by the single chip microcomputer, thus eliminating the need for manual complex calculations and reducing the difficulty of verification;
[0017] Among them, in the present invention, multi-point matching is used for verification, that is, the longitudinal magnetizing current and the circumferential magnetizing current are distinguished, and when calculating the circumferential magnetizing current, a boundary value is set to calculate the data of the circumferential magnetizing current when it is greater than and less than the boundary value, respectively, thereby improving the accuracy of the built-in ammeter display after verification. In addition, by optimizing the floating-point operation of the decimal point to the operation of integer data, the workload is reduced and the complexity of the interface with the control and display is simplified, thereby further ensuring the accuracy of the verification and reducing the calculation error. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The accompanying drawings are used to provide further understanding of the present invention and constitute a part of the specification. They are used to explain the present invention together with the embodiments of the present invention and do not constitute a limitation of the present invention.
[0019] In the attached picture:
[0020] Figure 1 It is a relationship diagram between the built-in ammeter of the magnetizing current of the flaw detector of the present invention and the standard instrument. DETAILED DESCRIPTION
[0021] The preferred embodiments of the present invention are described below in conjunction with the accompanying drawings. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present invention, and are not used to limit the present invention.
[0022] Embodiment: A method for automatically checking the current of a magnetic particle flaw detector comprises the following steps:
[0023] S1, the single chip microcomputer automatically reads and saves the current data of the built-in ammeter of the flaw detector, and reads the current reading of the corresponding standard instrument through the serial port;
[0024] Among them, the current reading of the standard instrument is read through the serial port, and the read data is sent to the single-chip microcomputer for calculation; the single-chip microcomputer sets a fixed magnetizing current, for example, the magnetizing current is set to 700A, the single-chip microcomputer sends a request data signal through the serial port, the single-chip microcomputer receives the current data through an interruption, and saves it. At the same time, the single-chip microcomputer reads the original current data of the built-in ammeter and saves it, delays for 3 seconds, and sets the magnetizing current to 1000A again. The single-chip microcomputer continues to read the data of the standard instrument and the built-in ammeter;
[0025] S2. Correct the built-in ammeter coefficient kk by using a standard instrument. Since the magnetization operation needs to be turned on during the correction process and in order to reduce the setting time, a micro-adjustment method of 12000+m value is adopted, wherein kk=12000+m, where m can be positive or negative. During magnetization, record the standard instrument value and the built-in ammeter output, and adjust the size of m according to the output until the built-in ammeter output is the same as the standard instrument output, and record the size and positive and negative of m;
[0026] S3. According to the corrected ammeter coefficient, convert the data of the built-in ammeter into data consistent with the standard ammeter. Figure 1 , which includes:
[0027] According to the mutual inductor coefficient and CS5460 conversion formula, calculate the longitudinal magnetizing current start-up / output formula. This formula is generally a straight line equation crossing the zero point. Remember the proportional coefficient KK; the value of K is generally around 10000-14000, and the formula is: y=x / kk;
[0028] The formula for calculating the circumferential magnetizing current start-up / output is divided into two stages, and a threshold value is preset. In this embodiment, the threshold value is 700A.
[0029] The formula in the range of 0-700A can be used to set the longitudinal magnetization current meter, y = x / kk;
[0030] In the range of 700-1000A, the two-point method is used to find the linear equation. The display of y at the standard ammeter and the built-in ammeter at two positions of 700A and 1000A is used to obtain the formula of y=kx+b. For the convenience of calculation, it is changed to y=x / kk+b (the value of k is between 10000-15000).
[0031] In the above calculation, x is divided by kk to change multiplication into division. The floating point operation is avoided through a division, thus ensuring the accuracy of the verification. In addition, when kk is a floating point number with a decimal point, y=n*x / n*kk, n is a non-zero number, and n*kk is an integer. For example, when kk=6092.7, b=-942.5, if y=x / 6093-943 is used in the operation, the data error is large. For example, the built-in ammeter reaches 1000A, while the standard instrument is 982, and the current display differs by more than 20 amperes. Select n=10. At this time, y=10x / 60927-943, further improving the accuracy of the verification.
[0032] The specific verification is as follows:
[0033] The first magnetization sends out the control signal of the flaw detector magnetization, delays for 4 seconds, reads the original current data tmp_x1 of the built-in ammeter, delays for 6 seconds, performs the second magnetization, sends out the control signal of the flaw detector magnetization (magnetization current size is set by another program), delays, and reads the original current data tmp_x2 of the built-in ammeter. data_jz and data_jz_y2 are the two synchronous standard instrument current data read from the interruption;
[0034] The calibration process for the circumferential current range of 0 to 700A and the full range of longitudinal current is as follows:
[0035] According to the data tmp_x1 and data_jz, the formula data_jz=tmp_x1 / (13000+zx_k) is used to continuously loop and test the value of zx_k until the formula is established.
[0036] The calibration process for the circumferential current range of 700 to 1500A is as follows:
[0037] Based on the data tmp_x1, tmp_x2, data_jz and data_jz_y2, c1, c2 and c3 are calculated using the formula y=k(xb).
[0038] Finally, the calculated parameters are saved in the EEPROM AT24C01 memory.
[0039] if (zx_jy_first == 0)
[0040] {
[0041] flag_end=0; / / flag bit
[0042] GPIOG->BSRR=(intI_Rec_zx&0xffff)|((~intI_Rec_zx)<<16); GPIOC->BSRR=(0x9922&0xff)|((~0x9922&0xff)<<16); / / Control magnetizing current
[0043] delay_ms(1000); delay_ms(1000); delay_ms(1000);
[0044] delay_ms(1000); / / delay 4 seconds
[0045] CS5460A_Read(CS5460_PORT_1,0x16,readData); / / Read the value of the built-in ammeter
[0046] tmpCurrent = (readData[0]<<16)|readData[1]<<8|(readData[2]); / / Data conversion
[0047] tmp_x1 = tmpCurrent; / / Read the first current raw data
[0048] if (zx_jy_first == 1) {
[0049] flag_end = 0;
[0050] GPIOG->BSRR=(intI_Rec_zx&0xffff)|((~intI_Rec_zx)<<16);GP IOC->BSRR=(0x9923&0xff)|((~0x9923&0xff)<<16); delay_ms(1000); delay_ms(1000); delay_ms(1000); delay_ms(1000);
[0051] CS5460A_Read(CS5460_PORT_1,0x16,readData); / / 2
[0052] tmpCurrent=(readData[0]<<16)|readData[1]<<8|(readData[2]);
[0053] tmp_x2 = tmpCurrent; / / Read the second current raw data
[0054] GPIOG->BSRR=(intI_Rec_zx&0xffff)|((~intI_Rec_zx)<<16); GPIOC->BSRR=(0x9923&0xff)|((~0x9923&0xff)<<16);}
[0055] if(flag_data_zx&&tmp_x1>1000){
[0056] / / The first formula calculation
[0057] zx_k=0; zx_xs=tmp_x1 / 13000;
[0058] if(data_jz<(zx_xs)){
[0059] while(data_jz <zx_xs){
[0060] zx_k++;
[0061] zx_xs=tmp_x1 / (13000+zx_k);
[0062] zx_flag_k=0;}
[0063] }
[0064] else if(data_jz>(zx_xs)){
[0065] while(data_jz>zx_xs){
[0066] zx_k++;
[0067] if(zx_k<13000)zx_xs=tmp_x1 / (13000-zx_k);}
[0068] zx_flag_k=1;}
[0069] if(zx_flag_k==0)intI_zx=tmp_x1 / (13000+zx_k);
[0070] else
[0071] intI_zx=tmp_x1 / (13000-zx_k);
[0072] / / Thinking Assume that the parameters of the built-in ammeter and the standard instrument are y=kx+b instead of y=kx
[0073] / / y=k(xb) y1=kx1-kb y2=kx2-kb y2-y1=kx2-kx1
[0074] / / k=(y2-y1) / x2-x1 b=x1-y1 / k
[0075] / / kk=1 / kb=x1-y1*kk b needs to be positive or negative
[0076] / / Let c1=kk c2=b c3=0 / 1
[0077] c1 = tmp_x1 / data_jz;
[0078] if(tmp_x2>(data_jz_y2*c1)){
[0079] c2=tmp_x2-(data_jz_y2*c1); c3=0;}
[0080] else{
[0081] c2=tmp_x2-(data_jz_y2*c1); c3=1;}
[0082] / / The second formula calculation
[0083] data1[0] = zx_k / 256;
[0084] data1[1] = zx_k%256;
[0085] data1[2] = zx_flag_k;
[0086] AT24C01write(0,data1,3);
[0087] data1[0] = c1 / 256;
[0088] data1[1] = c1%256;
[0089] data1[2]=c2>>12;
[0090] data1[3]=(0x00ff0000&c2)>>8;
[0091] data1[4]=(0x0000ff00&c2)>>4;
[0092] data1[5] = 0x000000ff&c2;
[0093] data1[6]=c3;
[0094] AT24C01write(7,data1,5);
[0095] flag_xz0 = 0;
[0096] flag_end = 0;}
[0097] if (flag_data_zx == 0)
[0098] {
[0099] if (zx_jy_first == 0) {
[0100] flag_xz0 = 0;
[0101] flag_end = 0;
[0102] GPIO_Write(GPIOC,0x9999);
[0103] delay_ms(1000); delay_ms(1000); delay_ms(1000); / / Delay for 6 seconds before the second magnetization
[0104] delay_ms(1000); delay_ms(1000); delay_ms(1000);}
[0105] else{
[0106] flag_xz0 = 0;
[0107] flag_end = 0;
[0108] GPIO_Write(GPIOC,0x9999);
[0109] GPIO_Write(GPIOD,0x9999);
[0110] zx_jy_first = 0;}
[0111] }
[0112] }
[0113] MCU power-on initialization
[0114] The algorithm principle is: read out the parameters of the EEPROM AT24C01 memory.
[0115] AT24C01read(10,data1,7);
[0116] c1=data1[0]*256+data1[1];
[0117] c2=data1[2]*65536+data1[3]*4048+data1[4]*256+data1[5];
[0118] c3 = data1[6];
[0119] AT24C01read(0,data1,3);
[0120] temp_I=data1[0]*256+data1[1];
[0121] zx_flag_k = data1[2];
[0122] if(temp_I!=0)zx_k=temp_I;
[0123] AT24C01read(4,data1,3);
[0124] temp_I=data1[0]*256+data1[1];
[0125] zox_flag_k = data1[2];
[0126] if(temp_I!=0)zox_k=temp_I;
[0127] The microcontroller runs the main program:
[0128] Algorithm principle: According to the stored coefficients, the data of the built-in ammeter is converted into data consistent with the standard ammeter. The verification of the circumferential magnetizing current includes two stages. If the original current parameter is greater than a certain set value, the formula y=k(xb) calculated by the two-point method is used, where c1, c2, and c3 are parameters. Otherwise, the formula with a certain proportional coefficient (y=kx) is used like the longitudinal magnetizing current, where k is a fixed value and zox_k offset.
[0129] CS5460A_Read(CS5460_PORT_2,0x16,readData); / / 1
[0130] tmpCurrent=((((readData[0]<<16)|readData[1]<<8|(readData a[2]))));
[0131] if(zox_flag_k==0)intI=tmpCurrent / (10099+zox_k);
[0132] else
[0133] intI=tmpCurrent / (10099-zox_k);
[0134] CS5460A_Read(CS5460_PORT_1,0x16,readData); / / 2
[0135] tmpCurrent=((((readData[0]<<16)|readData[1]<<8|(readData a[2]))));
[0136] if(zx_flag_k==0)intI_zx=tmpCurrent / (13000+zx_k);
[0137] else
[0138] intI_zx=tmpCurrent / (13000-zx_k);
[0139] if(tmpCurrent>10120302){
[0140] if(c3 == 0)
[0141] intI_zx=(tmpCurrent-c2) / c1;
[0142] else
[0143] intI_zx=(tmpCurrent+c2) / c1;}
[0144] Finally, it should be noted that the above description is only a preferred example of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art can still modify the technical solutions described in the aforementioned embodiments or replace some of the technical features therein by equivalents. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for automatically checking the current of a magnetic particle flaw detector, characterized in that: The steps include: S1, the single chip microcomputer automatically reads and saves the current data of the built-in ammeter of the flaw detector, and reads the current reading of the corresponding standard instrument through the serial port; S2. Correct the built-in ammeter coefficient kk through standard instruments; The coefficient is corrected by trying the 12000+m value method, specifically: first read the standard ammeter value and the built-in ammeter output during magnetization, and then adjust the size of m until the built-in ammeter output is the same as the standard ammeter value, where kk=12000+m; S3. Convert the data of the built-in ammeter into data consistent with the standard ammeter according to the corrected ammeter coefficient, including: Calculation formula for the longitudinal magnetizing current input / output: y = x / kk; The formula for calculating the circumferential magnetizing current start-up / output is divided into two stages, and a threshold value is preset. When the current is less than the threshold value: y=x / kk; when the current is greater than the threshold value: y=x / kk+b.
2. The method for automatic current calibration of a magnetic particle flaw detector according to claim 1, characterized in that: In step S1, a number of fixed magnetizing currents are set in the single chip microcomputer. When the single chip microcomputer sends a request data signal, the single chip microcomputer receives the current data through an interruption and saves it.
3. The method for automatic current calibration of a magnetic particle flaw detector according to claim 1, characterized in that: In step S3, when the current is greater than the delimiting value, the two-point method is used to obtain y=x / kk+b.
4. The method for automatic current calibration of a magnetic particle flaw detector according to claim 3 is characterized in that: In step S3, the demarcation value is 700A, wherein the two points in the two-point method are 700A and 1000A.
5. The method for automatic current calibration of a magnetic particle flaw detector according to claim 1, characterized in that: In step S3, when kk is a floating point number with a decimal point, y=n×x / n×kk+n×b, n is a non-zero number, and n×kk and n×b are both integers.
Citation Information
Patent Citations
Method and circuit for controlling a step-up converter in a circuit for correcting a power factor
CN102474184A
Circuit and system for checking data among multi-core single-chip microcomputers of magnetic particle flaw detector
CN113064402A