Error compensation method of analog-to-digital converter, digital device and controller
By acquiring the sampled value of the reference digital quantity in real time, calculating the linear error, and compensating for it, the problem of output deviation caused by error in analog-to-digital converters in high-precision control applications is solved. This achieves long-term stable high-precision sampling and real-time calibration, making it suitable for scenarios with high real-time requirements.
Patent Information
- Application Number
- CN202511668723.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-14
- Publication Date
- 2026-02-27
AI Technical Summary
Existing analog-to-digital converters (ADCs) deviate from ideal characteristics in high-precision control applications due to bias and gain errors. These errors result in significant individual variations, increasing the complexity of control system design and debugging. Furthermore, existing calibration methods cannot dynamically correct for environmental changes, leading to a long-term decline in accuracy.
By acquiring sampled values of multiple reference digital quantities in real time, calculating and compensating for linearity errors, correcting gain and bias errors, offsetting external circuit errors and temperature drift, and employing a real-time calibration method to avoid the influence of abnormal signals, the real-time requirements are met.
It achieves long-term stable high-precision sampling, avoids the computational burden and hardware overhead of multiple iterative calibrations, ensures the correctness and reliability of the calibration process, and is suitable for scenarios with high real-time requirements.
Smart Images

Figure CN121585170A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of signal processing technology, specifically to an error compensation method, digital device, and controller for an analog-to-digital converter. Background Technology
[0002] In modern control systems, the core controller typically employs digital devices such as microcontroller units (MCUs), programmable logic devices (PLDs), or field-programmable gate arrays (FPGAs). These digital devices can only process discrete digital signals and cannot directly process continuously changing physical quantities. Therefore, in order to implement control algorithms within digital devices, an analog-to-digital converter (ADC) is needed to convert analog signals into digital signals.
[0003] However, in some high-precision control applications, the inherent bias and gain errors of ADCs often cause their output digital signals to deviate from their ideal characteristics, resulting in the control system's control accuracy failing to meet performance requirements. Furthermore, due to various uncertainties in the manufacturing process, the bias and gain errors of different ADC devices often vary, causing multiple ADCs to exhibit different accuracy performances under the same conditions. This individual variation further increases the complexity of control system design and debugging.
[0004] Therefore, improving the accuracy of ADC analog-to-digital conversion is an urgent problem to be solved. Summary of the Invention
[0005] This application provides an error compensation method, digital device, and controller for an analog-to-digital converter (ADC) to effectively improve the accuracy of the ADC analog-to-digital conversion process.
[0006] Firstly, this application provides an error compensation method for an analog-to-digital converter, the method comprising: Obtain the digital quantity to be compensated and two reference digital quantities. The digital quantity to be compensated is obtained by converting the analog signal into a digital signal using an analog-to-digital converter, and the reference digital quantities are obtained by converting the reference signal into a digital signal using an analog-to-digital converter. If the reference digital quantity is within a preset valid range, the linear error is obtained based on multiple sampled values of each reference digital quantity. The linear error is used to compensate the digital quantity to be compensated in order to obtain the compensated digital quantity.
[0007] In some embodiments of this application, the two reference digital quantities include a first reference quantity and a second reference quantity, the preset effective range includes a first range and a second range, and the sampled value includes a first sampled value and a second sampled value; When the reference digital quantity is within a preset valid range, the linear error is obtained based on multiple sampled values of each reference digital quantity, including: Given that the first reference value is within a first range and the second reference value is within a second range, a linear error is obtained based on multiple first sampled values of the first reference value and multiple second sampled values of the second reference value.
[0008] In some embodiments of this application, linearity error includes gain error and bias error; Based on multiple first sampled values of a first reference value and multiple second sampled values of a second reference value, the linear error is obtained, including: The mean of multiple first sampled values and multiple second sampled values is calculated respectively to obtain the first mean and the second mean. The actual gain is obtained based on the first mean, the second mean, the first reference value, and the second reference value; The actual bias is obtained based on the first mean, the first reference value, and the actual gain; or, the actual bias is obtained based on the second mean, the second reference value, and the actual gain. The gain error and the bias error are calculated based on the actual gain and ideal gain, and the actual bias and ideal bias, respectively.
[0009] In some embodiments of this application, the actual gain is obtained based on a first mean, a second mean, a first reference value, and a second reference value, including: Obtain the first difference between the first mean and the second mean, and the second difference between the first reference value and the second reference value; The actual gain is obtained by the ratio between the first difference and the second difference.
[0010] In some embodiments of this application, compensation is performed on the digital quantity to be compensated based on the linearity error to obtain the compensated digital quantity, including: Obtain the third difference between the digital quantity to be compensated and the actual bias; The compensated digital value is obtained based on the ratio between the third difference and the actual gain.
[0011] In some embodiments of this application, the reference signal includes a first reference voltage corresponding to a first reference quantity and a second reference voltage corresponding to a second reference quantity, wherein the first reference voltage and the second reference voltage come from the same voltage source.
[0012] Secondly, this application also provides a digital device, which includes: The digital quantity acquisition module is used to acquire the digital quantity to be compensated and two reference digital quantities. The digital quantity to be compensated is obtained by converting the analog signal into a digital signal through an analog-to-digital converter, and the reference digital quantities are obtained by converting the reference signal into a digital signal through an analog-to-digital converter. The error acquisition module is used to obtain the linearity error based on multiple sampled values of each reference digital quantity, provided that the reference digital quantity is within a preset valid range. The compensation module is used to compensate the digital quantity to be compensated based on the linearity error, so as to obtain the compensated digital quantity.
[0013] Thirdly, this application also provides a controller, the controller comprising: Analog signal acquisition device, used to acquire analog signals and two reference signals in real time; Analog-to-digital converters are used to convert analog signals into digital quantities to be compensated, and to convert reference signals into reference digital quantities; and Such as the digital devices provided in the second aspect.
[0014] In some embodiments of this application, the controller further includes a multiplexer: A multiplexer is used to select one of an analog signal and two reference signals as the target signal; An analog-to-digital converter performs analog-to-digital conversion on the target signal.
[0015] In some embodiments of this application, the controller further includes a signal conditioning device for preprocessing the target signal; the analog-to-digital converter performs analog-to-digital conversion on the preprocessed signal.
[0016] Fourthly, embodiments of this application also provide an aircraft that includes the aforementioned controller.
[0017] Through one or more embodiments of the above embodiments in this application, at least the following technical effects can be achieved: In the error compensation method, digital device, and controller for analog-to-digital converters (ADCs) provided in this application, one method involves multiple sampled values of each reference digital quantity. These sampled values are the result of real-time acquisition of a reference signal converted by the ADC, rather than fixedly stored reference quantities. This real-time acquisition method allows the reference digital quantity to change synchronously with external factors such as ambient temperature, supply voltage, or device aging (reflecting the influence of these factors on the ADC), thus achieving long-term stable high-precision sampling. Verifying the validity of the reference digital quantity through its effective range avoids its use for calibration when the reference signal itself is abnormal or drifting, ensuring the correctness and long-term reliability of the calibration process. Calculating the linear error based on the sampled values of multiple reference digital quantities not only corrects the actual gain and bias within the ADC but also, to a certain extent, offsets external influences such as peripheral circuit errors, temperature drift errors, and nonlinear errors, resulting in a more comprehensive compensation effect. Simultaneously, it avoids the high computational load and hardware overhead associated with multiple iterations or multi-point calibrations, meeting real-time requirements. Attached Figure Description
[0018] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0019] Figure 1 This is a schematic diagram of the ADC error; Figure 2 This application provides a flowchart illustrating an error compensation method for an analog-to-digital converter. Figure 3 This is a schematic diagram of the structure of the digital device provided in the embodiments of this application; Figure 4 This is a schematic diagram of the controller provided in an embodiment of this application; Figure 5 This is a global comparison diagram between the ADC sampled values and the input analog quantities provided in the embodiments of this application; Figure 6 This is a partial comparison diagram between the ADC sampled value and the input analog quantity provided in the embodiments of this application; Figure 7 This is an error comparison diagram provided in the embodiments of this application.
[0020] Explanation of reference numerals in the attached figures: 1. Controller; 10. Analog signal acquisition device; 101. Analog input module; 102. Reference generation module; 20. Multiplexer; 30. Digital device; 301. Digital signal acquisition module; 302. Error acquisition module; 303. Compensation module; 40. Signal conditioning device; 50. Analog-to-digital converter. Detailed Implementation
[0021] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0022] The terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Therefore, features defined as "first" or "second" may explicitly or implicitly include one or more features. In the description of this application, "multiple" means two or more, unless otherwise explicitly specified.
[0023] "A and / or B" includes the following three combinations: A only, B only, and a combination of A and B.
[0024] The use of "applies to" or "configured to" in this application implies open and inclusive language, which does not preclude applicability to or configuration to devices performing additional tasks or steps. Furthermore, the use of "based on" implies openness and inclusivity, because processes, steps, calculations, or other actions "based on" one or more conditions or values may in practice be based on additional conditions or values beyond those conditions.
[0025] In this application, the term "exemplary" is used to mean "used as an example, illustration, or description." Any embodiment described as "exemplary" in this application is not necessarily to be construed as being more preferred or advantageous than other embodiments. The following description is provided to enable any person skilled in the art to make and use this application. Details are set forth in the following description for purposes of explanation. It should be understood that those skilled in the art will recognize that this application can be made without using these specific details. In other instances, well-known structures and processes are not described in detail to avoid obscuring the description of this application with unnecessary detail. Therefore, this application is not intended to be limited to the embodiments shown, but is consistent with the broadest scope of the principles and features disclosed in this application.
[0026] An ADC (Analog-to-Digital Converter) is used to convert analog signals into digital signals. Ideally, if the input analog signal is 0, the output digital signal after ADC conversion will also be 0. Furthermore, a strict linear relationship should be maintained between the input and output signals across the entire input range; that is, at any input point, if the analog input increases by the same magnitude, the ADC output should increase by the same value (count). Taking an ADC with a resolution of LSB (Least Significant Bit) as an example, for a 16-bit ADC with an input range of [-5V, +5V], its resolution is LSB = .like Figure 1 As shown by the blue stepped line, ideally, the ADC output value increases by 1 for every LSB increase in the input voltage.
[0027] However, due to factors such as manufacturing process and device characteristics, ADCs usually have certain errors when they leave the factory, mainly including the following two categories: (1) Bias error: such as Figure 1 As shown by the red step line in the diagram, when the input is zero, the ADC output is not zero, but rather has a certain offset, for example, the output is 2 counts.
[0028] (2) Gain error: such as Figure 1 The slope of the red step line in the image deviates from the ideal slope of the black dashed line by 1 count / LSB; for example, its slope is approximately 1.192 count / LSB.
[0029] Currently, to address the gain and bias errors of an ADC, two known input voltages are acquired, and the actual gain and bias parameters of the ADC are calculated based on these. The sampling results are then compensated to obtain higher-precision sampled values. However, this technology has the following problems: First, the relevant calibration methods generally rely on fixed conditions. For example, some schemes require calibration to be completed on the production line, and the compensation coefficients are permanently stored in non-volatile memory. Although this method can guarantee a certain level of accuracy at the time of manufacture, it cannot dynamically correct for changes in ambient temperature, power supply voltage, or device aging during subsequent use of the equipment, resulting in a decrease in sampling accuracy over time.
[0030] Secondly, most of these methods rely on a reference voltage to generate calibration points, such as using VREF or its fractions. However, if the reference voltage itself has a deviation or drift, the entire calibration process will fail, resulting in distorted compensation results and compromising long-term reliability.
[0031] Furthermore, the relevant technologies do not comprehensively consider the sources of error. Most methods only correct for the gain and bias errors within the ADC, while lacking effective compensation for factors such as external circuit errors, temperature drift, and nonlinearity errors.
[0032] Furthermore, the relevant methods lack universality in calibration. Some solutions require dedicated circuits or signal sources, such as using DACs and ADCs to construct feedback loops, which increases system complexity and hardware costs to some extent, making them unsuitable for low-cost, general-purpose applications.
[0033] Finally, the proposed solutions have shortcomings in calibration efficiency. For example, iterative methods require multiple parameter adjustments to converge, or multi-point calibration methods require additional sampling and computation, resulting in high time consumption and hardware overhead, which is not conducive to applications in scenarios with high real-time requirements.
[0034] Therefore, this application provides an error compensation method for an analog-to-digital converter, a digital device 30, and a controller 1. The error compensation method for an analog-to-digital converter, the digital device 30, and the controller 1 provided in this application are described in detail below with reference to the accompanying drawings.
[0035] like Figure 2 As shown in the figure, this application provides an error compensation method for an analog-to-digital converter, which includes the following steps: S201, obtain the digital quantity to be compensated and two reference digital quantities. The digital quantity to be compensated is obtained by converting the analog signal into an analog-to-digital converter 50, and the reference digital quantities are obtained by converting the reference signal into an analog-to-digital converter 50.
[0036] The reference signal can be a reference voltage, a reference current, or an output signal from an internal reference source. If the reference signal is a reference voltage, both reference voltages are obtained from the same voltage source in real time to ensure the consistency of electrical characteristics among multiple reference voltages.
[0037] S202, when the reference digital quantity is within a preset valid range, obtain the linear error based on multiple sampled values of each reference digital quantity.
[0038] The effective range refers to the allowable deviation interval of the theoretical digital quantity after the ideal conversion of the reference signal. Its value is determined based on the nominal value of the reference signal and the accuracy requirements of the control system. For example, if the reference voltage is 2.5V, the ADC's reference voltage input range is -5V to 5V, and the resolution is 16 bits (theoretical conversion value is 2...). 15 =32768), then the effective range can be set to 32768±1% (i.e., 32440~33096), corresponding to a reference voltage deviation of 2.5V±1%.
[0039] By validating the reference digital quantity, outliers caused by faults in the reference signal itself (such as reference voltage source drift or voltage divider circuit damage) are eliminated, ensuring that subsequent error calculations are based on a reliable reference signal and avoiding the introduction of systematic biases into the calibration process.
[0040] Each reference digital value corresponds to multiple sampled values. The same reference signal is sampled N times consecutively (N≥2), and each sampled value is the quantization result of the reference signal by the ADC within one conversion cycle, while keeping the reference signal stable during the sampling process.
[0041] In this step, a linear equation is fitted to the actual conversion characteristics of the ADC based on the mean of multiple sampled values. The gain error and bias error are obtained based on this linear equation, and the gain error and bias error constitute the linear error.
[0042] S203, compensate for the digital quantity to be compensated based on the linearity error to obtain the compensated digital quantity.
[0043] In the error compensation method for an analog-to-digital converter provided in this application embodiment, the multiple sampled values of each reference digital quantity are the results of the real-time acquired reference signal converted by the analog-to-digital converter 50, rather than fixedly stored reference quantities. Through this real-time acquisition method, the reference digital quantity can change synchronously with changes in external factors such as ambient temperature, supply voltage, or device aging, thereby achieving long-term stable high-precision sampling. Verifying the validity of the reference digital quantity through its effective range avoids its use for calibration when the reference signal itself is abnormal or drifts, thus ensuring the correctness and long-term reliability of the calibration process. Calculating the linear error based on the sampled values of multiple reference digital quantities not only corrects the gain and bias errors within the analog-to-digital converter 50, but also, to a certain extent, offsets external influences such as peripheral circuit errors, temperature drift errors, and nonlinear errors, thereby obtaining a more comprehensive compensation effect. Simultaneously, it avoids the high computational load and hardware overhead caused by multiple iterations or multi-point calibrations, meeting real-time requirements.
[0044] In some embodiments of this application, the two reference digital quantities include a first reference quantity and a second reference quantity. Correspondingly, the reference signals include a first reference signal and a second reference signal. The first reference quantity is obtained by converting the first reference signal through an analog-to-digital converter 50, and the second reference quantity is obtained by converting the second reference signal through an analog-to-digital converter 50. The first reference signal is preferably a low-amplitude reference signal within the ADC input range; the second reference quantity is a digital quantity obtained by converting the second reference signal through the ADC. The second reference signal is preferably a high-amplitude reference signal within the ADC input range, and the amplitude difference between the first and second reference signals must cover at least half of the ADC's input range to ensure the accuracy of subsequent linear fitting. In some examples, both the first and second reference signals are reference voltages, and both reference voltages originate from the same voltage source, resulting in good consistency between the first and second reference voltages. For example, if the input range of the reference voltage is 0-5V, the first and second reference voltages can be 5% and 95% of the maximum value of the input range, respectively, i.e., 0.25V and 4.75V. In other examples, they can also be 10% and 90%, 15% and 85%, etc., of the maximum value of the input range.
[0045] The preset valid range includes a first range and a second range. The first range is the preset valid interval of the first reference value, and its value is determined based on the nominal value of the first reference signal and the quantization characteristics of the ADC. Taking an ADC input range of 0~5V and a resolution of 16 bits as an example, if the first reference signal is 1.25V, its theoretical conversion value is... Then the first range can be set as ±1% corresponds to an analog signal deviation of 1.25V ± 1%. This deviation range must be greater than the inherent noise fluctuation of the ADC (e.g., ±5LSB) to avoid normal noise causing the reference signal to be misjudged as invalid. The second range is the preset valid interval of the second reference signal. Similarly, if the second reference signal is 3.75V, its theoretical conversion value is... Then the second range can be set as ±1%, corresponding to an analog quantity deviation of 3.75V±1%.
[0046] The sampled values include a first sampled value and a second sampled value. The first sampled value is obtained as follows: the first reference signal is sampled N times consecutively (N≥2), and each first sampled value is the quantization result of the first reference signal by the ADC within one complete conversion cycle. Similarly, the second reference signal is sampled N times consecutively to obtain N second sampled values. The sampling process of the first and second sampled values must keep the ADC's operating parameters (such as sampling clock, gain level, and filter coefficients) consistent to avoid additional errors introduced by parameter fluctuations.
[0047] When the reference digital quantity is within a preset valid range, the linear error is obtained based on multiple sampled values of each reference digital quantity, including: Given that the first reference value is within a first range and the second reference value is within a second range, a linear error is obtained based on multiple first sampled values of the first reference value and multiple second sampled values of the second reference value.
[0048] In other words, when multiple first sampled values are all within a first range and multiple second sampled values are all within a second range, the linear error is calculated based on the multiple first sampled values and the multiple second sampled values.
[0049] It is understandable that, for the first and second sampled values collected within the same sampling period, if one or both of the first and second sampled values are not within their respective valid ranges, then neither the first nor the second sampled value of that sampling period will participate in the subsequent linear error calculation.
[0050] The error compensation method for analog-to-digital converters provided in this application determines the validity of a first reference quantity and a second reference quantity, and performs linear error calculation based on multiple first sampled values of the first reference quantity and multiple second sampled values of the second reference quantity only when both satisfy the validity conditions. This avoids deviations caused by abnormal reference quantities, ensures the validity of sampled values, and improves the accuracy of linear error calculation.
[0051] In some embodiments of this application, linearity error includes gain error and bias error.
[0052] Based on multiple first sampled values of a first reference value and multiple second sampled values of a second reference value, the linear error is obtained, including: The mean values of multiple first sampled values and multiple second sampled values are calculated respectively to obtain the first mean and the second mean.
[0053] The actual gain is obtained based on the first mean, the second mean, the first reference value, and the second reference value. That is, the first difference between the first and second means, and the second difference between the first and second reference values are obtained; the actual gain is obtained based on the ratio between the first difference and the second difference.
[0054] The actual bias is obtained based on the first mean, the first reference value, and the actual gain; or, the actual bias is obtained based on the second mean, the second reference value, and the actual gain.
[0055] The gain error and the bias error are calculated based on the actual gain and ideal gain, and the actual bias and ideal bias, respectively.
[0056] The following illustration uses a reference voltage as an example: The first reference value Vref1 and the second reference value Vref2 are sampled N times respectively to obtain Vref1D[1], Vref1D[2], ..., Vref1D[N] and Vref2D[1], Vref2D[2], ..., Vref2D[N]. The first mean Vref1Dmean = (Vref1D[1]+Vref1D[2]+...+Vref1D[N]) / N, and the second mean Vref2Dmean = (Vref2D[1]+Vref2D[2]+...+Vref2D[N]) / N.
[0057] The first reference value Vref1Ideal = round(Vref1 / LSB), and the second reference value Vref2Ideal = round(Vref2 / LSB). Vref1Ideal and Vref2Ideal are the representations of Vref1 and Vref2 in the digital device 30 after considering quantization errors. Between LSB and Vref1, and Vref2Ideal There are slight differences between LSB and Vref2, not exceeding 1 / 2 LSB, where LSB is an ADC parameter.
[0058] The first difference = Vref2Dmean - Vref1Dmean, the second difference = Vref2Ideal - Vref1Ideal, k = (Vref2Dmean - Vref1Dmean) / (Vref2Ideal - Vref1Ideal). b = Vref1Dmean - k Vref1Ideal, or b = Vref2Dmean - k Vref2Ideal.
[0059] In some embodiments of this application, the digital quantity VinD to be compensated is compensated based on the linearity error to obtain the compensated digital quantity VinD. 补偿后 ,include: Obtain the third difference between the digital quantity to be compensated and the actual bias. That is, the third difference = VinD - b.
[0060] The compensated digital value VinD is obtained based on the ratio of the third difference to the actual gain. 补偿后 In other words, VinD 补偿后 = round((VinD - b) / k). In the above formula, VinD 补偿后 VinD is the compensated and calibrated value, in LSB.补偿后 Rounding is necessary because the estimated value of Vin in digital device 30 must be an integer multiple of LSB. VinD 补偿后 In reality, Vin / LSB is an estimate of the calibration algorithm; the two are close, but not necessarily exactly equal. Here, Vin is the analog input, and Vin / LSB is the representation of the analog quantity Vin in the digital device 30.
[0061] like Figure 3 As shown in the figure, this application embodiment also provides a digital device 30, which includes a digital quantity acquisition module 301, an error acquisition module 302, and a compensation module 303.
[0062] The digital quantity acquisition module 301 is used to acquire the digital quantity to be compensated and two reference digital quantities. The digital quantity to be compensated is obtained by converting the analog signal into an analog-to-digital converter 50, and the reference digital quantities are obtained by converting the reference signal into an analog-to-digital converter 50.
[0063] The error acquisition module 302 is used to obtain the linear error based on multiple sampled values of each reference digital quantity, provided that the reference digital quantity is within a preset valid range.
[0064] The compensation module 303 is used to compensate the digital quantity to be compensated based on the linearity error, so as to obtain the compensated digital quantity.
[0065] In some embodiments of this application, the two reference digital quantities include a first reference quantity and a second reference quantity, the preset effective range includes a first range and a second range, and the sampled value includes a first sampled value and a second sampled value.
[0066] The error acquisition module 302 is specifically used for: Given that the first reference value is within a first range and the second reference value is within a second range, a linear error is obtained based on multiple first sampled values of the first reference value and multiple second sampled values of the second reference value.
[0067] In some embodiments of this application, the linearity error includes the actual gain and the actual bias.
[0068] The error acquisition module 302 specifically includes a first calculation unit, a second calculation unit, and a third calculation unit.
[0069] The first calculation unit is used to calculate the mean of multiple first sampled values and multiple second sampled values respectively, and obtain the first mean and the second mean accordingly; The second calculation unit is used to obtain the actual gain based on the first mean, the second mean, the first reference value, and the second reference value; The third calculation unit is used to obtain the actual bias based on the first mean, the first reference value, and the actual gain; or, based on the second mean, the second reference value, and the actual gain.
[0070] In some embodiments of this application, the second computing unit is specifically used for: Obtain the first difference between the first mean and the second mean, and the second difference between the first reference value and the second reference value; The actual gain is obtained by the ratio between the first difference and the second difference.
[0071] In some embodiments of this application, the compensation module 303 is specifically used for: Obtain the third difference between the digital quantity to be compensated and the actual bias; The compensated digital value is obtained based on the ratio between the third difference and the actual gain.
[0072] In some embodiments of this application, the reference signal includes a first reference voltage corresponding to a first reference quantity and a second reference voltage corresponding to a second reference quantity, wherein the first reference voltage and the second reference voltage come from the same voltage source.
[0073] This application embodiment also provides a controller 1, which includes an analog signal acquisition device 10, an analog-to-digital converter 50, and a digital device 30 connected in sequence.
[0074] Analog signal acquisition device 10 is used to acquire analog signals and two reference signals in real time.
[0075] The analog-to-digital converter 50 is used to convert analog signals into digital quantities to be compensated and to convert reference signals into reference digital quantities.
[0076] The digital device 30 is the digital device 30 provided in any of the above embodiments.
[0077] In some embodiments of this application, the controller 1 further includes a multiplexer 20, one end of which is connected to the analog signal acquisition device 10 and the other end of which is connected to the analog-to-digital converter 50.
[0078] Multiplexer 20 is used to select one of the analog signal and two reference signals as the target signal. Analog-to-digital converter 50 performs analog-to-digital conversion on the target signal.
[0079] That is, the multiplexer 20, controlled by the digital device 30, selects one of the analog signal and two reference signals to enter the subsequent ADC. It can be understood that the analog signal acquisition device 10 includes an analog input module 101 and a reference generation module 102. The analog input module 101 is used to input the analog signal Vin, and the reference generation module 102 is used to generate a first reference voltage Vref1 and a second reference voltage Vref2, both of which originate from the same voltage source.
[0080] In some embodiments of this application, the controller 1 further includes a signal conditioning device 40, one end of which is connected to the multiplexer 20 and the other end to the analog-to-digital converter 50. The signal conditioning device 40 is used to preprocess the target signal; the analog-to-digital converter 50 performs analog-to-digital conversion on the preprocessed signal. Schematically, the signal conditioning device 40 performs preprocessing on the target signal output from the multiplexer 20, including voltage range matching, filtering and noise reduction, and signal amplitude adjustment, so that the preprocessed target signal meets the ADC input requirements while suppressing noise interference, providing the ADC with a high signal-to-noise ratio and high stability input signal.
[0081] like Figure 4 As shown in the figure, this application embodiment also provides a controller 1, which includes an analog signal acquisition device 10, a multiplexer 20, a signal conditioning device 40, an analog-to-digital converter 50, and a digital device 30 connected in sequence. The analog signal acquisition device 10 includes an analog input module 101 and a reference generation module 102, and the digital device 30 includes a digital signal acquisition module 301, an error acquisition module 302, and a compensation module 303.
[0082] The analog input module 101 is used to input the analog signal Vin, and the reference generation module 102 is used to generate the first reference voltage Vref1 and the second reference voltage Vref2.
[0083] The multiplexer 20 is used to select one of the analog signal and two reference signals as the target signal.
[0084] The signal conditioning unit 40 is used to preprocess the target signal. The analog-to-digital converter 50 performs analog-to-digital conversion on the preprocessed signal to obtain the corresponding digital quantity.
[0085] The digital quantity acquisition module 301 is used to acquire the digital quantity to be compensated, as well as the first reference voltage Vref1D and the second reference voltage Vref2D. Vref1D is obtained by converting Vref1 through an ADC, and Vref2D is obtained by converting Vref2 through an ADC.
[0086] The error acquisition module 302 is used to obtain the linear error based on multiple sampled values of each reference digital quantity when the reference digital quantity is within a preset valid range. It can be understood that the error acquisition module 302 also performs validity judgment on the first reference voltage Vref1D and the second reference voltage Vref2D, and when both the first reference voltage Vref1D and the second reference voltage Vref2D are valid, it calculates the actual gain and actual bias based on the N sampled values Vref1D[1], Vref1D[2], ..., Vref1D[N] of Vref1D and the N sampled values Vref2D[1], Vref2D[2], ..., Vref2D[N] of Vref2D.
[0087] In some examples, the error acquisition module 302 specifically includes a first calculation unit, a second calculation unit, a third calculation unit, and an error calculation unit.
[0088] The first calculation unit is used to calculate the mean of multiple first sampled values and multiple second sampled values respectively, and obtain the first mean and the second mean respectively.
[0089] The second calculation unit is used to obtain the actual gain based on the first mean, the second mean, the first reference value, and the second reference value.
[0090] The third calculation unit is used to obtain the actual bias based on the first mean, the first reference value, and the actual gain; or, based on the second mean, the second reference value, and the actual gain.
[0091] The error calculation unit is used to calculate the gain error and the bias error based on the actual gain and ideal gain, and the actual bias and ideal bias, respectively.
[0092] The compensation module 303 is used to compensate the digital quantity to be compensated based on the linearity error, so as to obtain the compensated digital quantity.
[0093] The following assumes the ADC gain is tan(45.5°), and the actual bias is 2 LSB, where LSB = The simulated input is Vin = 3. sin(2 π t), where t is a time series from 0 to 1 second with 0.01-second intervals. According to the error compensation method for the analog-to-digital converter provided in the embodiments of this application, the actual gain and actual bias kCal, bCal of the ADC can be estimated, as shown in Table 1, and compared with the true k, b.
[0094] Table 1 Comparison of Error Results
[0095] As shown in Table 1, the estimated values are close to the actual values. The error compensation method for the analog-to-digital converter provided in this application embodiment achieves accurate estimation of the ADC gain, but the estimation error of the bias is slightly larger.
[0096] like Figure 5 and Figure 6 As shown, the calibrated digital value of the ADC is closer to the true value both with and without error compensation.
[0097] like Figure 7 As shown, comparing the errors of the sampled values relative to the true values with and without ADC calibration, the sampling error was greatly reduced after calibration.
[0098] Based on any of the above embodiments, another embodiment of this application provides an electronic device, which may include: a processor, a communications interface, a memory, and a communication bus, wherein the processor, the communications interface, and the memory communicate with each other through the communication bus. The processor can call logical instructions in the memory to execute the error compensation method of the analog-to-digital converter described above.
[0099] Furthermore, when the logical instructions in the aforementioned memory can be implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0100] On the other hand, embodiments of this application also provide a storage medium storing a plurality of instructions adapted for loading by a processor to execute the error compensation method for the analog-to-digital converter as provided in the above embodiments.
[0101] On the other hand, embodiments of this application also provide a computer program product, including a computer program that, when executed by a processor, implements the above-described error compensation method for an analog-to-digital converter.
[0102] On the other hand, this application also provides an aircraft that includes the controller 1 described above.
[0103] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0104] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., including several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods of various embodiments or some parts of embodiments.
[0105] The above provides a detailed description of an error compensation method for an analog-to-digital converter, a digital device 30, and a controller 1 provided in the embodiments of this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. An error compensation method for an analog-to-digital converter, characterized in that, The method includes: The digital quantity to be compensated and two reference digital quantities are obtained. The digital quantity to be compensated is obtained by converting an analog signal into a digital signal using an analog-to-digital converter, and the reference digital quantities are obtained by converting a reference signal into a digital signal using the analog-to-digital converter. When the reference digital quantity is within a preset valid range, a linear error is obtained based on multiple sampled values of each reference digital quantity. The digital quantity to be compensated is compensated based on the linearity error to obtain the compensated digital quantity.
2. The error compensation method for an analog-to-digital converter according to claim 1, characterized in that, The two reference digital quantities include a first reference quantity and a second reference quantity, the preset effective range includes a first range and a second range, and the sampled value includes a first sampled value and a second sampled value; The step of obtaining a linear error based on multiple sampled values of each reference digital quantity, assuming the reference digital quantity is within a preset valid range, includes: When the first reference value is within the first range and the second reference value is within the second range, the linearity error is obtained based on a plurality of first sampled values of the first reference value and a plurality of second sampled values of the second reference value.
3. The error compensation method for an analog-to-digital converter according to claim 2, characterized in that, The linearity error includes gain error and bias error; The linearity error is obtained based on a plurality of first sampled values of the first reference value and a plurality of second sampled values of the second reference value, including: The mean of the multiple first sampled values and the multiple second sampled values is calculated respectively to obtain the first mean and the second mean. The actual gain is obtained based on the first mean, the second mean, the first reference value, and the second reference value; The actual bias is obtained based on the first mean, the first reference value, and the actual gain; or, the actual bias is obtained based on the second mean, the second reference value, and the actual gain. The gain error and the bias error are calculated based on the actual gain and ideal gain, and the actual bias and ideal bias, respectively.
4. The error compensation method for an analog-to-digital converter according to claim 3, characterized in that, The step of obtaining the actual gain based on the first mean, the second mean, the first reference value, and the second reference value includes: Obtain the first difference between the first mean and the second mean, and the second difference between the first reference value and the second reference value; The actual gain is obtained based on the ratio between the first difference and the second difference.
5. The error compensation method for an analog-to-digital converter according to claim 3, characterized in that, The step of compensating the digital quantity to be compensated based on the linearity error to obtain the compensated digital quantity includes: Obtain the third difference between the digital quantity to be compensated and the actual bias; The compensated digital value is obtained based on the ratio between the third difference and the actual gain.
6. The error compensation method for an analog-to-digital converter according to any one of claims 2 to 5, characterized in that, The reference signal includes a first reference voltage corresponding to the first reference quantity and a second reference voltage corresponding to the second reference quantity, wherein the first reference voltage and the second reference voltage come from the same voltage source.
7. A digital device, characterized in that, The digital device includes: The digital quantity acquisition module is used to acquire the digital quantity to be compensated and two reference digital quantities. The digital quantity to be compensated is obtained by converting an analog signal into a digital signal through an analog-to-digital converter, and the reference digital quantities are obtained by converting a reference signal into a digital signal through the analog-to-digital converter. An error acquisition module is used to obtain a linear error based on multiple sampled values of each of the reference digital quantities, provided that the reference digital quantity is within a preset valid range. The compensation module is used to compensate the digital quantity to be compensated based on the linearity error to obtain the compensated digital quantity.
8. A controller, characterized in that, The controller includes: Analog signal acquisition device, used to acquire analog signals and two reference signals in real time; An analog-to-digital converter is used to convert the analog signal into a digital quantity to be compensated and the reference signal into a reference digital quantity; and The digital device as described in claim 7.
9. The controller according to claim 8, characterized in that, The controller also includes a multiplexer: The multiplexer is used to select one of the analog signal and the two reference signals as the target signal; The analog-to-digital converter performs analog-to-digital conversion on the target signal.
10. The controller according to claim 9, characterized in that, The controller further includes a signal conditioning device for preprocessing the target signal; the analog-to-digital converter performs analog-to-digital conversion on the preprocessed signal.