Integral error compensation method based on Kalman filtering and integral circuit thereof
By using a Kalman filter-based integration error compensation method, combined with analog and digital circuits, and dynamically adjusting the error compensation, the high-precision problem of traditional integrators under long integration times is solved, thus achieving high-precision requirements in electromagnetic measurement applications.
Patent Information
- Application Number
- CN202510993795.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-18
- Publication Date
- 2025-11-07
AI Technical Summary
Traditional integrators struggle to meet high-precision requirements over long integration times, primarily because the drift error caused by the non-ideal characteristics of operational amplifier input offset voltage, input offset current, and integrating resistors and capacitors cannot be adjusted in real time. Furthermore, fixed drift compensation methods cannot adapt to time-varying factors such as device temperature drift and aging, easily leading to overcompensation/undercompensation and nonlinear error compensation problems.
An integral error compensation method based on Kalman filtering is adopted. The output voltage at the current moment is predicted by calculating the state value of Kalman filtering, the fusion weight of the predicted value and the observed value is dynamically adjusted to generate the optimal estimation result, and the predicted value of the next prediction cycle is iteratively updated. Real-time error compensation is achieved by combining analog circuits and digital circuits.
It achieves real-time compensation for the integrator, effectively removing linear and nonlinear drift errors, enabling the integrator to meet high precision requirements over long integration times, and performs particularly well in electromagnetic measurement applications.
Smart Images

Figure CN120911490A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of integrator, in particular to an integral error compensation method based on Kalman filter and an integral circuit thereof. BACKGROUND
[0002] In analog circuit systems, integrator is the core circuit to realize time-domain integral operation, and its output signal is linearly mapped with the time-domain integral of input signal. However, due to the input offset voltage and input offset current of operational amplifier, as well as the non-ideal characteristics of integral resistor and integral capacitor, the integral process will produce drift error containing linear and nonlinear components. This error accumulates over time, making it difficult for traditional integrators to meet high-precision requirements in long-integration-time application scenarios such as electromagnetic measurement.
[0003] At present, fixed drift compensation methods are commonly used to suppress errors, but still have the following defects: 1. Unable to adjust in real time: The compensation amount is based on a static model preset, and cannot dynamically respond to time-varying factors such as device temperature drift and aging.
[0004] 2. Overcompensation / undercompensation risk: Fixed compensation coefficients are difficult to adapt to nonlinear error components, which can easily lead to inaccurate compensation.
[0005] 3. Ignoring nonlinear error: The existing Chinese patent CN107070453A discloses a segmented linear real-time integral error compensation method and its integral circuit, which divides the integral interval and compensates segmentally. Although it alleviates the overshoot problem of single compensation, it does not solve the compensation problem of nonlinear error.
[0006] Therefore, it is urgent to develop an integral error compensation method that can effectively compensate the drift error containing linear and nonlinear components generated by the non-ideal characteristics of analog devices in integrators in real time. SUMMARY
[0007] According to a first aspect of the present application, in order to solve the above technical problems, an integral error compensation method based on Kalman filter is provided, comprising the following steps: Based on the error model of the integral module and the historical output voltage, the state value of the Kalman filter is calculated, and the predicted value of the current output voltage is predicted; According to the preset condition, the fusion weight of the predicted value and the observation value of the current output voltage is dynamically adjusted to generate the optimal estimation result of the current output voltage after error compensation; Based on the optimal estimation result, the predicted value of the next prediction period is iteratively updated.
[0008] Further, the error model satisfies the expression:
[0009] wherein, is the input offset voltage of the operational amplifier; is the input offset current of the operational amplifier; is the integration resistance in the analog integration circuit; is the integration capacitance in the analog integration circuit; is the integration time.
[0010] Further, the fusion weight is dynamically adjusted by a Kalman gain, wherein the Kalman gain satisfies an expression:
[0011] wherein, is the Kalman gain at the moment; is the state observation matrix; is the transpose of the state observation matrix; is the observation noise covariance; is the covariance matrix at the moment, and satisfies a formula wherein, is the state transition matrix; is the updated covariance matrix at the moment; is the transpose of the state transition matrix; is the process excitation noise covariance.
[0012] In a second aspect of the present application, an integration circuit applying the method is provided, comprising: an integration module comprising an instrumentation amplifier, a first analog integration circuit, and a second analog integration circuit, wherein the instrumentation amplifier differentially amplifies two integration outputs; an error compensation module comprising an ADC module, an FPGA module, and a DAC module connected in sequence, wherein the FPGA module is configured to perform prediction, update, and iteration operations of Kalman filtering.
[0013] Further: an input end of the first analog integration circuit is connected to an input signal; an input end of the second analog integration circuit is grounded; input ends of the instrumentation amplifier are respectively connected to output ends of the first analog integration circuit and the second analog integration circuit, and an output of the instrumentation amplifier is a differential signal of the first analog integration circuit and the second analog integration circuit.
[0014] Further, the FPGA module comprises: A PLL unit is configured to divide an external reference clock signal into a plurality of clock signals in time synchronization; An ADC driving unit is configured to generate an ADC control signal to drive the ADC module to work; An error compensation unit is configured to embed an integral error compensation method based on Kalman filtering, perform the integral error compensation method on an input signal of the ADC module, and output a result of the compensation to the DAC module; A DAC driving unit is configured to generate a DAC control signal to drive the DAC module to work.
[0015] Further, the error compensation unit updates a predicted value of a state representation at the moment by a state equation, which satisfies an expression:
[0016] In the expression, x(k) represents the predicted value of the state representation at the moment k, A represents a state transition matrix, B represents an input control matrix, u(k) represents a control variable at the moment k, and x(k|k-1) represents a predicted value of an updated state representation at the moment k.
[0017] Compared with the prior art, the embodiment of the present application has the following beneficial effects: Different from a method of compensating for a fixed drift by using a general integrator, the integrator circuit provided by the present application combines an analog circuit and a digital circuit, the integrator function is completed by an analog integrator, the digital circuit analyzes an output of the analog integrator to obtain error data in an integral result, and removes the error data by using an integral error compensation method based on Kalman filtering. The integral linear error and the integral nonlinear error of the integrator are compensated for in real time, so that the integrator system can work for a long time, and the high-precision requirement under the long-integration-time condition in some specific electromagnetic measurement application scenarios is met. BRIEF DESCRIPTION OF DRAWINGS
[0018] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings needed to be used in the embodiment description. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can also be obtained by those skilled in the art without any creative effort on the basis of these drawings.
[0019] Figure 1 is a flow chart disclosed by the present application; Figure 2 is a flow chart disclosed by the embodiment of the present application, and shows the connection relationship of each module; Figure 3 The circuit schematic diagram disclosed by the embodiment of the present application; Figure 4 The FPGA module composition diagram disclosed by the embodiment of the present application.
[0020] In the figure: 10, first analog integration circuit; 20, second analog integration circuit; 30, instrument amplifier. DETAILED DESCRIPTION
[0021] In order for those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor fall within the scope of protection of the present application.
[0022] The present application aims to provide an integral error compensation method based on Kalman filtering and an integral circuit thereof. By applying Kalman filtering to integral error compensation, the drift error containing linear and nonlinear components generated by the non-ideal characteristics of analog devices in the integrator is effectively compensated in real time.
[0023] Kalman filtering is a recursive estimation algorithm based on a state space model. Its core function is to achieve optimal state estimation in a dynamic system by processing observation data containing noise.
[0024] The integral error compensation method based on Kalman filtering is described in detail below.
[0025] Please refer to Figure 1 , mainly including the following steps: S1, prediction stage: based on the error model of the integral module and the historical output voltage, the state value of Kalman filtering is calculated, and the predicted value of the output voltage at the current time is predicted.
[0026] In the prediction stage of Kalman filtering, the state representation of the output voltage of the integral module is constructed, the process model is constructed based on the related error model of the state representation, and the predicted value of the state representation of the output voltage of the integral module at the current time is obtained based on the process model. The state representation is the state parameter that needs to be estimated in the process of Kalman filtering. The process model is a model for estimating the predicted value at the current time based on the predicted value updated at the last time.
[0027] Among them, the error model includes an analog integrator error model, and the analog integrator error model satisfies the expression:
[0028] In the formula, is the input offset voltage of the operational amplifier, and the unit is V; is the input offset current of the operational amplifier, and the unit is A; is the integral resistance in the analog integral circuit, and the unit is Ω; is the integral capacitance in the analog integral circuit, and the unit is F; is the integral time, and the unit is s.
[0029] S2, a weight fusion stage: according to a preset condition, dynamically adjusting the fusion weight of the predicted value and the observation value of the output voltage at the current moment, and generating the optimal estimation result of the output voltage error compensation at the current moment.
[0030] Wherein, the fusion weight is dynamically adjusted by Kalman gain. The Kalman gain satisfies the expression:
[0031] In the formula, is the Kalman gain at the moment; is the state observation matrix; is the transpose of the state observation matrix; is the observation noise covariance; is the state transition matrix; is the covariance matrix at the moment, and satisfies the formula Wherein, is the state transition matrix; is the updated covariance matrix at the moment; is the transpose of the state transition matrix; is the process excitation noise covariance. S3, an update stage: based on the optimal estimation result, iteratively updating the predicted value of the next prediction period.
[0032] The predicted value of the prediction stage of the next time is updated, so that the whole process can be iterated, and the prediction value is continuously corrected, and the trust degree of the predicted value and the observation value is adjusted.
[0033] In the present application, the predicted value and the observation value represented by the state at the current moment can be selectively fused according to the preset condition, so as to update the predicted value represented by the state, so as to obtain the output voltage of the integral module at the current moment. Wherein, the observation value is a value obtained according to the actual state measurement of the integrator.
[0034] Specifically, the Kalman filtering equation is obtained by the following formula: Prediction stage:
[0035]
[0036]
[0037] Update phase:
[0038]
[0039]
[0040] in, for The predicted value representing the state at a given time; This is the state transition matrix; for The predicted value of the updated state representation at time step; For input control matrix; for Control variables at any given time.
[0041] for Time-varying covariance matrix; for The updated covariance matrix at time step; This is the transpose of the state transition matrix; Let be the process excitation noise covariance.
[0042] for Kalman gain at time step; This is the state observation matrix; This is the transpose of the state observation matrix; To observe the noise covariance.
[0043] for The predicted value of the state representation after the time-update; for The state representation of the observed value at time.
[0044] for The updated covariance matrix at time step.
[0045] In the prediction phase, a state representation of the output voltage of the integrator module is constructed. Based on the state representation-related error model, a process model is constructed, and the predicted value of the state representation of the output voltage of the integrator module at the current moment is obtained based on the process model.
[0046] In the updating stage, according to preset conditions, the prediction value and the observation value of the state representation of the output voltage of the integral module at the current time are selectively fused to update the prediction value of the state representation of the integrator output voltage, so as to obtain the integral module output voltage at the current time.
[0047] The above method is described below in combination with a specific integral circuit.
[0048] Referring to Figures 2-4 The integral circuit is composed of two main modules, namely an integral module and an error compensation module. The integral module includes an instrument amplifier 30, a first analog integral circuit 10 and a second analog integral circuit 20, and the instrument amplifier 30 differentially amplifies two integral outputs.
[0049] In a further scheme of the embodiment, the resistances and capacitances of the first analog integral circuit 10 and the second analog integral circuit 20 are different, resulting in different integral constants of the integral units. The input end of the first analog integral circuit 10 is connected to an input signal; the input end of the second analog integral circuit 20 is always connected to ground. The input end of the instrument amplifier 30 is connected to the output ends of the first analog integral circuit 10 and the second analog integral circuit 20, and the output of the instrument amplifier 30 is a differential signal of the first analog integral circuit 10 and the second analog integral circuit 20, that is, the final output of the integral module.
[0050] In a further scheme of the embodiment, the error compensation module includes an ADC module, an FPGA module and a DAC module connected in sequence, wherein the FPGA module is configured to perform prediction, updating and iteration operations of Kalman filtering. The input end of the ADC module is connected to the output end of the integral module for analog-to-digital conversion and output to the FPGA module; compensation of the integrator drift error is completed in the FPGA module; and then the digital signal is converted into an analog signal by the DAC module to obtain the final signal.
[0051] The FPGA module includes four functional units, namely a PLL unit, an ADC driving unit, an error compensation unit and a DAC driving unit.
[0052] The PLL unit is used to divide the external reference clock signal into multiple time sequence synchronized clock signals. Specifically, the PLL unit is used to receive a 25MHz reference clock signal output by an external crystal oscillator, and after frequency synthesis and phase synchronization processing, multiple clock signals meeting the time sequence requirements of each unit of the module are generated to provide the required clock signals for each functional unit.
[0053] The ADC driving unit is used to generate an ADC control signal to drive the ADC module to work.
[0054] The error compensation unit embeds an integral error compensation method based on Kalman filtering, performs the integral error compensation method on the input signal of the ADC module, and outputs the result of the compensation to the DAC module. Specifically, the error compensation unit updates the predicted value of the state representation at the moment by a state equation, which satisfies the expression:
[0055] In the formula, is the predicted value of the state representation at the moment; is a state transition matrix; is the updated predicted value of the state representation at the moment; is an input control matrix; is the control variable at the moment. The DAC driving unit is used to generate a DAC control signal to drive the DAC module to work.
[0056] In summary, the ADC driving unit is used to generate an ADC control signal to drive the work of the ADC module; the ADC module converts an analog signal into a digital signal and sends it to the FPGA module through a parallel interface; the error compensation unit in the FPGA module performs error compensation based on the error compensation algorithm of Kalman filtering; the DAC driving unit is used to generate a DAC control signal to drive the work of the DAC module; the DAC module receives the digital signal output by the FPGA module and converts it into an analog signal for final output.
[0057] The skilled person further explains that the integral module, the ADC module, and the DAC module are relatively common concepts in the field of signal processing; at the same time, the analog integral circuit is a basic electronic circuit, so the specific structure of the integral module, the ADC module, the DAC module, and the analog integral circuit is not described in detail in the present application.
[0058] Unlike the general integrator which uses a fixed drift compensation method, the integral circuit provided by the present application uses a combination of analog and digital circuits, wherein the integral function is completed by an analog integrator, and the digital circuit analyzes the output of the analog integrator to find error data in the integral result, and removes it through an integral error compensation method based on Kalman filtering. Real-time compensation of the integral linear error and nonlinear error of the integrator is achieved, which enables the integrator system to work for a long integration time and meets the high-precision requirements in certain specific electromagnetic measurement application scenarios under long integration time.
[0059] Unlike the general integrator which uses a fixed drift compensation method, the integral circuit provided by the present application uses a combination of analog and digital circuits, wherein the integral function is completed by an analog integrator, and the digital circuit analyzes the output of the analog integrator to find error data in the integral result, and removes it through an integral error compensation method based on Kalman filtering. Real-time compensation of the integral linear error and nonlinear error of the integrator is achieved, which enables the integrator system to work for a long integration time and meets the high-precision requirements in certain specific electromagnetic measurement application scenarios under long integration time.
[0060] While embodiments of the application have been shown and described, it is to be understood that the embodiments described are merely exemplary of the principles and application of the present application. Numerous modifications and adaptions can be effected without departing from the spirit and scope of the present application, which is not limited to the exact construction and arrangement described. It is intended, therefore, to cover all modifications and adaptions that fall within the scope of the claims and their equivalents.
Claims
1. A Kalman filter based integral error compensation method, characterized in that, The method comprises the following steps: Based on the error model and the historical output voltage of the integral module, the state value of Kalman filtering is calculated, and the predicted value of the output voltage at the current time is predicted; According to the preset condition, the fusion weight of the predicted value and the observed value of the output voltage at the current time is dynamically adjusted to generate the optimal estimation result of the output voltage error compensation at the current time; Based on the optimal estimation result, the predicted value of the next prediction period is iteratively updated.
2. The Kalman filter based integral error compensation method of claim 1, wherein, The error model satisfies the expression: wherein Vos is the input offset voltage of the operational amplifier; Ios is the input offset current of the operational amplifier; Rint is the integration resistance in the analog integration circuit; Cint is the integration capacitance in the analog integration circuit; Tint is the integration time.
3. The Kalman filter based integral error compensation method of claim 1, wherein, The fusion weight is dynamically adjusted by Kalman gain, wherein the Kalman gain satisfies the expression: wherein is the Kalman gain at time k; is the state observation matrix; is the transpose of the state observation matrix; is the observation noise covariance; is is the covariance matrix at time k, and satisfies the formula wherein is the state transition matrix; is is the updated covariance matrix at time k; is the transpose of the state transition matrix; is the process excitation noise covariance.
4. An integrating circuit applying the method of any one of claims 1 to 3, characterized in that It comprises: The integral module comprises an instrument amplifier, a first analog integral circuit and a second analog integral circuit, and the instrument amplifier differentially amplifies two-way integral output; The error compensation module comprises an ADC module, an FPGA module and a DAC module connected in sequence, wherein the FPGA module is configured to perform prediction, update and iteration operations of Kalman filtering.
5. The integral circuit of claim 4, wherein: The input end of the first analog integral circuit is connected to the input signal; The input end of the second analog integral circuit is grounded; The input ends of the instrument amplifier are respectively connected to the output ends of the first analog integral circuit and the second analog integral circuit, and the output of the instrument amplifier is the differential signal of the first analog integral circuit and the second analog integral circuit.
6. The integrating circuit of claim 4, wherein, The FPGA module comprises: The PLL unit is used to divide the external reference clock signal into multiple time sequence synchronized clock signals; The ADC driving unit is used to generate an ADC control signal to drive the ADC module to work; The error compensation unit embeds the integral error compensation method based on Kalman filtering, executes the integral error compensation method on the input signal of the ADC module, and outputs the compensation result to the DAC module; The DAC driving unit is used to generate a DAC control signal to drive the DAC module to work.
7. The integrating circuit of claim 4 or 6, wherein, The error compensation unit updates the predicted value through the state equation, which satisfies the expression: wherein is a prediction of the state representation at time is a state transition matrix; is an updated prediction of the state representation at time is an input control matrix; is is a control variable at time
Citation Information
Patent Citations
Piecewise linear real-time integral error compensation method and integral circuit thereof
CN107070453A