Data acquisition card calibration method based on nonlinear calibration
Through the nonlinear calibration method, the INL model of hardware is calculated and imported using software, the problem of poor calibration methods of existing data acquisition cards is solved, and the high-speed, automated calibration and significant improvement of data acquisition cards are achieved.
Patent Information
- Application Number
- CN202510123587.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-25
- Publication Date
- 2025-05-23
Smart Images

Figure CN120034192A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of data acquisition cards, and in particular relates to a data acquisition card calibration method based on nonlinear calibration. Background Art
[0002] With the rapid innovation of measurement technology in modern science and technology, data acquisition cards, as important analog-to-digital conversion modules, have higher and higher requirements for their indicators. The multi-stage amplifier circuit, anti-aliasing filter circuit and ADC sampling circuit in the analog channel of the data acquisition card accumulate nonlinear errors in data acquisition, which seriously affects the spurious-free dynamic range, signal-to-noise ratio, signal-to-noise ratio and other indicators of the collected signal.
[0003] In order to meet market demand, data acquisition cards not only need to convert analog signals into digital signals, but also generally need to add multi-channel, variable resolution or variable sampling rate functions. Due to temperature changes, complex circuit interference and inter-channel influence, there is an error between the data collected by the data acquisition card and the real data. In actual application, the data acquisition card generally needs to be calibrated.
[0004] The existing calibration methods of data acquisition cards include: application of hardware calibration device, AD self-calibration and low-pass filtering; the first two have little effect on improving the signal frequency domain index, and low-pass filtering is only suitable for processing signals with special bandwidths and is not universal. The technical problems existing in the calibration methods of data acquisition cards include:
[0005] (1) The existing technology is poor in reducing noise and improving signal indicators, and there is no significant improvement in spurious free dynamic range, signal-to-noise ratio and signal-to-noise ratio;
[0006] (2) Some existing technologies can only process signals with specific bandwidths and are not universal.
[0007] (3) Some existing technologies cannot be applied to high-speed acquisition (such as 200MSa / s sampling rate), and the operation is complicated, time-consuming and labor-intensive. Summary of the invention
[0008] In view of the above technical problems, the present invention provides a data acquisition card calibration method based on nonlinear calibration. The method is an efficient integral nonlinear calibration method that does not require additional analog hardware or accurate input signal feeding, and also takes into account the high speed of data acquisition, the automation and convenience of calibration.
[0009] The present invention is achieved through the following technical solutions:
[0010] A data acquisition card calibration method based on nonlinear calibration, the method comprising:
[0011] (1) Collecting model data: using software to automatically collect model data from a data acquisition card; the collected model data is stored in the form of code values;
[0012] (2) Calculating the INL model: Perform code value statistics on the model data of one cycle collected in step (1), remove the code values that exceed the range, and accumulate and count the remaining code values;
[0013] An ideal code value curve is calculated according to a standard sinusoidal signal, and an INL value is calculated according to the relationship between the ideal code value and the real code value to obtain an original INL data model;
[0014] (3) Importing the INL model into the hardware: The original INL data model is imported into the hardware. After the import, when the data acquisition card performs acquisition again, the acquired signal is converted into a code value after being converted by the circuit and ADC. The converted code value is calculated with the original INL data model in FPJA to obtain a calibration signal, and the calibration signal is used as the output of the data acquisition card;
[0015] (4) comparing the signals; if the calibration signal meets the requirements, proceed to step (5); if the calibration signal does not meet the requirements, return to step (1);
[0016] (5) Writing the INL data model to the hardware: When the calibration signal meets the requirements, the corresponding INL data model is written to the hardware of the data acquisition card for calibration of the data collected by the data acquisition card.
[0017] Further, in step (1), the software includes a sampling module;
[0018] The sampling module collects a fixed amount of data, and the amount of collected data satisfies: N>2 n , where N is the number of sampling points and n is the resolution of the data acquisition card; the signal collected by the sampling module satisfies coherent sampling, that is:
[0019] Fs / N = Ft / M;
[0020] Where Fs is the sampling frequency, N is the number of sampling points, Ft is the frequency of the sampled signal, M is the number of cycles sampled by the sampled signal, M must be an odd number or a prime number, and M and N are prime to each other;
[0021] The voltage amplitude of the sampled signal exceeds the voltage range of the sampling module, causing the signal code value collected by the sampling module to appear as 0 and full-scale code value.
[0022] Furthermore, in step (2), the ideal code value curve calculation formula is:
[0023]
[0024] Among them, Fs is the sampling frequency, Ft is the sampled signal frequency, N max The code value is 2 n -1 points, N min is the number of points with code value 0, t is the horizontal axis coordinate of the code value, and n is the number of bits of resolution of the data acquisition card.
[0025] Furthermore, in step (2), the INL value is calculated according to the relationship between the ideal code value and the real code value to obtain the original INL data model, which specifically includes:
[0026] In the cumulative comparison diagram of ideal code values and true code values, for a certain point i on the true code value curve, draw a straight line passing through point i and parallel to the x-axis. The intersection of the straight line and the ideal code value curve is the position point of point i on the ideal code value curve, and the difference between the two code value points is the INL value of point i. Calculate the INL values corresponding to all points on the true code value curve, and obtain the original INL data model.
[0027] Furthermore, in step (3), the converted code value is calculated in FPJA with the original INL data model to obtain a calibration signal, which specifically includes:
[0028] Data(j)=DataIn(j)+INL(DataIn(j));
[0029] Wherein, j is the jth point of the collected signal, DataIn(j) is the code value of the jth point of the collected signal, INL(DataIn(j)) is the INL value corresponding to the code value of the jth point, and Data(j) is the calibration value output at the jth point;
[0030] Calculate all the collected signal points, and calculate the calibration values corresponding to all the collected signal points as the calibration signal output of the data acquisition card.
[0031] Furthermore, step (4) specifically includes: completing a signal acquisition with a data acquisition card, saving the pre-calibration signal and the post-calibration signal respectively, calculating the SFDR of the two groups of signals, the pre-calibration signal and the post-calibration signal; if the reduction value of the SFDR after the signal calibration is greater than 20, the calibration signal meets the requirements, and the process proceeds to step (5); if the reduction value of the SFDR after the signal calibration is less than or equal to 20, the calibration signal does not meet the requirements, and the process returns to step (1).
[0032] Furthermore, in step (5), before writing the INL data model into the hardware of the data acquisition card, the INL data model is processed, the data of the entire INL data model is divided into several groups, a polynomial fitting is performed on the numerical points of each group, the fitting parameters of each group constitute a new INL data model, and the new INL data model is written into the hardware Flash of the data acquisition card through software.
[0033] Furthermore, the method further comprises step (6) testing the application, which specifically comprises:
[0034] After step (5), a new INL data model exists in the data acquisition card processed. When the data acquisition card is used, the software automatically reads the new INL data model in the hardware from the hardware Flash when the computer is turned on, and writes it into the hardware FPJA fixed area. When the data acquisition card collects data, FPJA passes the collected data to the software after data compensation through the new INL data model, and the software then displays or stores the read data.
[0035] Furthermore, the method is used to reduce the amount of harmonics in a signal. After using the data acquisition card, the spurious-free dynamic range is >93dB, the signal-to-noise ratio is >89dB, and the signal-to-noise ratio is greater than 91dB.
[0036] Beneficial technical effects of the present invention:
[0037] The data acquisition card calibration method based on nonlinear calibration proposed by the present invention greatly reduces the signal interference of the data acquisition card. The scheme does not require additional analog hardware, does not require sending accurate input signals, and also takes into account the high speed of data acquisition and the convenience of calibration. The data acquisition card is characterized by software, and the calibration parameters are calculated by integral nonlinearity. The calibration parameters are loaded into the hardware, and can be quickly extracted and loaded when used. The hardware obtains the calibration parameters and completes the calibration.
[0038] The method provided by the present invention can greatly reduce the amount of harmonics in the signal. In the frequency domain indicators of the signal, the spurious-free dynamic range can be improved by 20-30dB, the signal-to-noise ratio can be improved by 25dB, and the signal-to-noise ratio can be improved by 10dB. Since the calibration is completed in hardware, the sampling rate is not affected, thereby achieving the accuracy and efficiency of the data acquisition card calibration. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 This is a flow chart of a data acquisition card calibration method based on nonlinear calibration in an embodiment of the present invention;
[0040] Figure 2 Schematic diagram of model data of a data acquisition card in an embodiment of the present invention;
[0041] Figure 3 Schematic diagram of integral nonlinearity INL value in an embodiment of the present invention;
[0042] Figure 4 A true code value curve and an ideal code value curve in an embodiment of the present invention;
[0043] Figure 5 It is the INL diagram in the embodiment of the present invention;
[0044] Figure 6 is a signal calibration comparison diagram after calibration in an embodiment of the present invention; Figure 7 This is the frequency domain comparison diagram of the test signal after calibration. DETAILED DESCRIPTION
[0045] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0046] On the contrary, the present invention covers any substitution, modification, equivalent method and scheme made on the essence and scope of the present invention as defined by the claims. Further, in order to make the public have a better understanding of the present invention, some specific details are described in detail in the detailed description of the present invention below. Those skilled in the art can fully understand the present invention without the description of these details.
[0047] The present invention provides an embodiment of a data acquisition card calibration method based on nonlinear calibration, which uses software to extract characteristics of a data acquisition card, uses integral nonlinearity to calculate calibration parameters, and loads the calibration parameters into hardware. When used, the calibration parameters can be quickly extracted and loaded, and the hardware obtains the calibration parameters and completes the calibration. The calibration process is as follows: Figure 1 As shown; the method comprises:
[0048] (1) Collecting model data: using software to automatically collect model data from a data acquisition card; the collected model data is stored in the form of code values; specifically, the model data refers to a set of sinusoidal waveform data that can reflect the waveform characteristics of the data acquisition card, which is essentially a set of signal waveforms;
[0049] (2) Calculating the INL model: The collected model data is theoretically a standard sinusoidal signal. Since the collected signal must cover all code values, a portion of the signal must exceed the code value range. Code value statistics are performed on the model data of one cycle collected in step (1), and code values that exceed the range are removed, and the remaining code values are accumulated and counted.
[0050] An ideal code value curve is calculated according to a standard sinusoidal signal, and an INL value is calculated according to the relationship between the ideal code value and the real code value to obtain an original INL data model;
[0051] Among them, integral nonlinearity (INL) is one of the static performance parameters of the analog-to-digital converter, which indicates the degree to which the actual conversion curve deviates from the ideal conversion curve. Integral nonlinearity indicates the error value of the point where the error between the analog value and the true value corresponding to all numerical points of the data acquisition card is the largest, that is, the distance where the output value deviates from the linearity the most. INL is the mathematical integral of the DNL (differential nonlinearity) error. DNL represents the difference between the code step size and the theoretical step size. INL represents the cumulative effect of all code nonlinear errors. That is, when the code value is 100, DNL is the deviation of a code value with a step size of 1, and INL is the accumulated sum of these 100 DNLs (such as Figure 3 Specifically, from the perspective of the entire data collection, each input voltage code step difference is accumulated and compared with the ideal value to produce a total difference, and the total difference is the INL value.
[0052] (3) Importing the INL model into the hardware: The original INL data model is imported into the hardware. After the import, when the data acquisition card performs acquisition again, the acquired signal is converted into a code value after being converted by the circuit and ADC. The converted code value is calculated with the original INL data model in FPJA to obtain a calibration signal, and the calibration signal is used as the output of the data acquisition card; Figure 6 This is a signal calibration comparison diagram after the time domain signal has been calibrated;
[0053] (4) comparing the signals; if the calibration signal meets the requirements, proceed to step (5); if the calibration signal does not meet the requirements, return to step (1);
[0054] (5) Writing the INL data model to the hardware: When the calibration value meets the requirements, the corresponding INL data model is written into the hardware of the data acquisition card for calibration of the data collected by the data acquisition card.
[0055] In this embodiment, the signal collected by the data acquisition card is a 24KHz signal; Figure 7 This is the frequency domain comparison diagram of the test signal after calibration. The red signal is before calibration and the green signal is after calibration. Figure 7 In the test, we can see that the harmonics of the signal are significantly reduced, and in the software test, we can also see that the signal indicators are significantly improved.
[0056] In step (1) of this embodiment, the software includes a sampling module. Before collecting model data, the sampling rate, voltage range, impedance and coupling mode of the sampling module are configured;
[0057] The sampling module collects a fixed amount of data, and the amount of collected data satisfies: N>2 n, where N is the number of sampling points and n is the resolution of the data acquisition card; it can be seen that the amount of collected data is related to the resolution of the module, which is to ensure that each code value can be sampled at least one point.
[0058] The signal collected by the sampling module satisfies coherent sampling, that is:
[0059] Fs / N = Ft / M;
[0060] Where Fs is the sampling frequency, N is the number of sampling points, Ft is the frequency of the sampled signal, M is the number of cycles sampled by the sampled signal, M must be an odd number or a prime number, and M and N are prime to each other;
[0061] The voltage amplitude / power of the sampled signal exceeds the voltage range of the sampling module, so that the signal code value collected by the sampling module appears 0 and full-scale code value to cover all code values, so that each code value has at least one sampling point.
[0062] The data collected by the sampling module is stored in the form of code values; the code values are processed during INL model calculation; the collected model data is as follows Figure 2 shown.
[0063] In step (2) of this embodiment, the ideal code value curve calculation formula is:
[0064]
[0065] Among them, Fs is the sampling frequency, Ft is the sampled signal frequency, N max The code value is 2 n -1 points, N min is the number of points with a code value of 0, t is the horizontal axis coordinate of the code value, and n is the number of bits of resolution of the data acquisition card (the data acquisition card in this embodiment is 18 bits).
[0066] The real code value curve and the ideal code value curve are as follows Figure 4 As shown, according to the relationship between the ideal code value and the real code value, the INL value can be calculated to obtain the original INL data model; Figure 5 Shown is an INL plot.
[0067] In step (2), the INL value is calculated based on the relationship between the ideal code value and the actual code value to obtain the original INL data model, which specifically includes:
[0068] In the cumulative comparison diagram of ideal code values and true code values, for a certain point i on the true code value curve, draw a straight line passing through point i and parallel to the x-axis. The intersection of the straight line and the ideal code value curve is the position point of point i on the ideal code value curve, and the difference between the two code value points is the INL value of point i. Calculate the INL values corresponding to all points on the true code value curve, and obtain the original INL data model.
[0069] Specifically, the calculation formula of the INL value corresponding to point i is: INL(i)=Minx-I;
[0070] Among them, Minx = find(IR == min(IR)), IR = abs(IR(i)); Minx is the code value point of point i on the ideal code value curve, I is the ideal code value curve, R is the real code value curve, R(i) is the vertical axis value of the i-th point of the real code value curve, IR is the interpolation curve between the ideal code value curve and the i-th point of the real code value curve, INL(i) is the INL value of point i; the INL values of all points are calculated according to the calculation formula.
[0071] In step (3), the converted code value is calculated in FPJA with the original INL data model to obtain a calibration signal, which specifically includes:
[0072] Data(j)=DataIn(j)+INL(DataIn(j));
[0073] Wherein, j is the jth point of the collected signal, DataIn(j) is the code value of the jth point of the collected signal, INL(DataIn(j)) is the INL value corresponding to the code value of the jth point, and Data(j) is the calibration value output at the jth point;
[0074] Calculate all the collected signal points, and calculate the calibration values corresponding to all the collected signal points as the calibration signal output of the data acquisition card.
[0075] Step (4) specifically includes: completing a signal acquisition with a data acquisition card, saving the pre-calibration signal and the post-calibration signal respectively, calculating the SFDR (spurious free dynamic range) of the two groups of signals, the pre-calibration signal and the post-calibration signal; if the reduction value of the SFDR after the signal calibration is greater than 20, the calibration signal meets the requirements and enters step (5); if the reduction value of the SFDR after the signal calibration is less than or equal to 20, the calibration signal does not meet the requirements and returns to step (1).
[0076] Specifically, the calculation formula of the SFDR reduction value DIFSFDR after signal calibration is: DIFSFDR=SFDR(DataIn)-SFDR(Data);
[0077] Where SFDR(DataIn) is the SFDR value of the signal before calibration, SFDR(Data) is the SFDR value of the signal after calibration, and DIFSFDR is the reduction in SFDR after signal calibration.
[0078] If DIFSFDR>20, the calibration signal meets the requirements and goes to step (5); if DIFSFDR≤20, the calibration signal does not meet the requirements and goes to step (1).
[0079] In step (5) of this embodiment, before writing the INL data model into the hardware of the data acquisition card, the INL data model is processed, the data of the entire INL data model is divided into several groups, a polynomial fitting is performed on the numerical points of each group, the fitting parameters of each group constitute a new INL data model, and the new INL data model is written into the hardware Flash of the data acquisition card through software.
[0080] Among them, the original INL model data is that each code value corresponds to an error compensation value, so an 18-bit data acquisition card requires 262144 compensation values. The acquisition card has four channels, each channel requires a set of INL model data, and a total of 1048576 compensation values are required. If all these data are written to the hardware, the Flash storage and the memory of FPJA do not meet the requirements. In order to solve the storage problem without reducing the calibration effect, the present invention adopts a piecewise fitting method to divide the data of the entire INL data model into several groups, and perform polynomial fitting on the numerical points of each group. The fitting parameters of each group constitute a new INL data model, and the new INL data model is written into the hardware Flash of the data acquisition card through software.
[0081] The method described in this embodiment further includes step (6) testing the application, which specifically includes:
[0082] After step (5), a new INL data model exists in the data acquisition card processed. When the data acquisition card is used, the software automatically reads the new INL data model in the hardware from the hardware Flash when the card is turned on, and writes it into the fixed area of the hardware FPJA. When the data acquisition card acquires data, FPJA passes the acquired data to the software after data compensation through the new INL data model, and the software then displays or stores the read data. Therefore, during each acquisition process, the data calibration and compensation process is processed in the hardware FPJA to achieve a very fast processing speed, especially in the high-speed acquisition process, without affecting the acquisition rate.
[0083] The method provided by the present invention is used to reduce the harmonic content in the signal. After using the data acquisition card, the spurious-free dynamic range is greater than 93dB, the signal-to-noise ratio is greater than 89dB, and the signal-to-noise ratio is greater than 91dB. Compared with conventional data acquisition cards, the spurious-free dynamic range can be increased by 20-30dB, the signal-to-noise ratio can be increased by 25dB, and the signal-to-noise ratio can be increased by 10dB.
[0084] The method provided by the present invention can greatly improve the frequency domain indicators of the data acquisition card. The method adopts a unique calibration algorithm, which greatly reduces signal harmonics and improves signal indicators. A method combining software and hardware is adopted to place the calibration algorithm model calculation and verification process in the software to achieve automatic calibration, thereby improving the accuracy, convenience and flexibility of the calibration process. The calibration process after signal acquisition is executed in the hardware, saving calibration time and avoiding affecting the sampling rate.
[0085] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A data acquisition card calibration method based on nonlinear calibration, characterized in that: The method comprises: (1) Collecting model data: using software to automatically collect model data from a data acquisition card; the collected model data is stored in the form of code values; (2) Calculating the INL model: Perform code value statistics on the model data of one cycle collected in step (1), remove the code values that exceed the range, and accumulate and count the remaining code values; An ideal code value curve is calculated according to a standard sinusoidal signal, and an INL value is calculated according to the relationship between the ideal code value and the real code value to obtain an original INL data model; (3) Importing the INL model into the hardware: The original INL data model is imported into the hardware. After the import, when the data acquisition card performs acquisition again, the acquired signal is converted into a code value after being converted by the circuit and ADC. The converted code value is calculated with the original INL data model in FPJA to obtain a calibration signal, and the calibration signal is used as the output of the data acquisition card; (4) comparing the signals; if the calibration signal meets the requirements, proceed to step (5); if the calibration signal does not meet the requirements, return to step (1); (5) Writing the INL data model to the hardware: When the calibration signal meets the requirements, the corresponding INL data model is written to the hardware of the data acquisition card for calibration of the data collected by the data acquisition card.
2. The data acquisition card calibration method based on nonlinear calibration according to claim 1, characterized in that: In step (1), the software includes a sampling module; The sampling module collects a fixed amount of data, and the amount of collected data satisfies: N>2 n , where N is the number of sampling points and n is the resolution of the data acquisition card; the signal collected by the sampling module satisfies coherent sampling, that is: Fs / N = Ft / M; Where Fs is the sampling frequency, N is the number of sampling points, Ft is the frequency of the sampled signal, M is the number of cycles sampled by the sampled signal, M must be an odd number or a prime number, and M and N are prime to each other; The voltage amplitude of the sampled signal exceeds the voltage range of the sampling module, causing the signal code value collected by the sampling module to appear as 0 and full-scale code value.
3. The data acquisition card calibration method based on nonlinear calibration according to claim 1, characterized in that: In step (2), the ideal code value curve calculation formula is: Among them, Fs is the sampling frequency, Ft is the sampled signal frequency, N max The code value is 2 n -1 points, N min is the number of points with code value 0, t is the horizontal axis coordinate of the code value, and n is the number of bits of resolution of the data acquisition card.
4. The data acquisition card calibration method based on nonlinear calibration according to claim 1, characterized in that: In step (2), the INL value is calculated based on the relationship between the ideal code value and the actual code value to obtain the original INL data model, which specifically includes: In the cumulative comparison diagram of ideal code values and true code values, for a certain point i on the true code value curve, draw a straight line passing through point i and parallel to the x-axis. The intersection of the straight line and the ideal code value curve is the position point of point i on the ideal code value curve, and the difference between the two code value points is the INL value of point i. Calculate the INL values corresponding to all points on the true code value curve, and obtain the original INL data model.
5. The data acquisition card calibration method based on nonlinear calibration according to claim 1, characterized in that: In step (3), the converted code value is calculated in FPJA with the original INL data model to obtain a calibration signal, which specifically includes: Data(j)=DataIn(j)+INL(DataIn(j)); Wherein, j is the jth point of the collected signal, DataIn(j) is the code value of the jth point of the collected signal, INL(DataIn(j)) is the INL value corresponding to the code value of the jth point, and Data(j) is the calibration value output at the jth point; Calculate all the collected signal points, and calculate the calibration values corresponding to all the collected signal points as the calibration signal output of the data acquisition card.
6. The data acquisition card calibration method based on nonlinear calibration according to claim 1, characterized in that: Step (4) specifically includes: completing a signal acquisition with a data acquisition card, saving the pre-calibration signal and the post-calibration signal respectively, calculating the SFDR of the two groups of signals, the pre-calibration signal and the post-calibration signal; if the reduction value of the SFDR after the signal calibration is greater than 20, the calibration signal meets the requirements, and proceeds to step (5); if the reduction value of the SFDR after the signal calibration is less than or equal to 20, the calibration signal does not meet the requirements, and returns to step (1).
7. The data acquisition card calibration method based on nonlinear calibration according to claim 1, characterized in that: In step (5), before writing the INL data model into the hardware of the data acquisition card, the INL data model is processed, the data of the entire INL data model is divided into several groups, a polynomial fitting is performed on the numerical points of each group, the fitting parameters of each group constitute a new INL data model, and the new INL data model is written into the hardware Flash of the data acquisition card through software.
8. The data acquisition card calibration method based on nonlinear calibration according to claim 7, characterized in that: The method further comprises step (6) testing the application, which specifically comprises: After step (5), a new INL data model exists in the data acquisition card processed. When the data acquisition card is used, the software automatically reads the new INL data model in the hardware from the hardware Flash when the computer is turned on, and writes it into the hardware FPJA fixed area. When the data acquisition card collects data, FPJA passes the collected data to the software after data compensation through the new INL data model, and the software then displays or stores the read data.
9. The data acquisition card calibration method based on nonlinear calibration according to claim 1, characterized in that: The method is used to reduce the harmonic content in the signal. After using the data acquisition card, the spurious-free dynamic range is greater than 93dB, the signal-to-noise ratio is greater than 89dB, and the signal-to-noise ratio is greater than 91dB.