Offset voltage correction method and system for operational amplifier in current detection circuit

文档序号:286904 发布日期:2021-11-23 浏览:8次 中文

阅读说明:本技术 一种电流检测电路中运算放大器失调电压校正方法及系统 (Offset voltage correction method and system for operational amplifier in current detection circuit ) 是由 赵旭林 黎进云 曾湘文 于 2020-05-18 设计创作,主要内容包括:本发明提供一种电流检测电路中运算放大器失调电压校正方法,应用于至少包含有运算放大器、模数转换器和微处理器的电流检测电路中,其包括步骤:步骤S10,向电流检测电路注入一恒定电流,获得其中检流电阻两端经运算放大器放大以及模数转换后的标定电压,并将标定电压与参考电压值进行比较,获是标定失调电压值;步骤S11,将待测电流输入电流检测电路,获得检流电阻两端经运算放大器放大以及模数转换后的检测电压值;步骤S12,将检测电压值通过标定失调电压值进行修正,获得修正电压值,以根据检流电阻值获得待测电流值。本发明还公开了一种相应的系统。实施本发明,可以有效解决电流检测电路中运算放大器的失调电压问题,无需复杂的硬件校正电路,其精度高,且能够节约硬件成本。(The invention provides a method for correcting offset voltage of an operational amplifier in a current detection circuit, which is applied to the current detection circuit at least comprising the operational amplifier, an analog-to-digital converter and a microprocessor, and comprises the following steps: step S10, injecting a constant current into the current detection circuit, obtaining a calibration voltage after the two ends of the current detection resistor are amplified by the operational amplifier and are subjected to analog-to-digital conversion, and comparing the calibration voltage with a reference voltage value to obtain a calibration offset voltage value; step S11, inputting the current to be detected into the current detection circuit, and obtaining the detection voltage value after the amplification and the analog-to-digital conversion of the two ends of the current detection resistor; and step S12, correcting the detected voltage value through the calibration offset voltage value to obtain a corrected voltage value, so as to obtain a current value to be detected according to the current detection resistance value. The invention also discloses a corresponding system. The implementation of the invention can effectively solve the offset voltage problem of the operational amplifier in the current detection circuit, does not need a complex hardware correction circuit, has high precision and can save the hardware cost.)

1. A method for correcting offset voltage of an operational amplifier in a current detection circuit is applied to the current detection circuit at least comprising the operational amplifier, an analog-to-digital converter and a microprocessor, and is characterized by comprising the following steps:

step S10, injecting a constant current into the current detection circuit to obtain a calibration voltage amplified by an operational amplifier and subjected to analog-to-digital conversion at two ends of a current detection resistor in the current detection circuit, comparing the calibration voltage with a reference voltage value calculated by theory, and taking the difference value of the two as a calibration offset voltage value;

step S11, inputting the current to be detected into the current detection circuit, and obtaining the detection voltage value after the amplification and the analog-to-digital conversion of the two ends of the current detection resistor;

and step S12, correcting the detection voltage value through the calibration offset voltage value to obtain a corrected voltage value, so as to obtain a current value to be detected according to the current detection resistance value.

2. The method according to claim 1, wherein the step S10 includes at least the following steps:

step S100, outputting a constant current by adopting current injection equipment, and injecting the constant current into two ends of the current detection resistor;

step S102, the microprocessor obtains a calibration voltage after the amplification and the analog-to-digital conversion of two ends of the current detecting resistor;

step S103, the microprocessor calculates and obtains a calibration offset voltage value by adopting the following formula:

Verr=Vt-Vref

wherein, Verr is a calibration offset voltage value, Vt is a calibration voltage, and Vref is a reference voltage value calculated by theory;

and step S104, storing the calibrated offset voltage value into a register.

3. The method of claim 2 wherein said constant current value is 1/2 of said current sense current range with a current accuracy error of less than 0.001A.

4. A method as claimed in claim 3, characterized in that a plurality of calibration voltages obtained over a plurality of calibration measurements are averaged as a final calibration voltage value.

5. The method according to any one of claims 2 to 4, wherein the step S12 further comprises:

step S120, calculating and obtaining a correction voltage value by adopting the following formula:

Vs=Vc-Verr

wherein, Verr is a calibration offset voltage value, Vc is a detection voltage value, and Vs is a correction voltage value;

and step S112, dividing the corrected voltage value by the current detection resistance value to obtain a current value to be measured.

6. An offset voltage calibration system for an operational amplifier in a current detection circuit, the system being applied to a current detection circuit comprising at least an operational amplifier, an analog-to-digital converter and a microprocessor, the system comprising:

a calibration offset voltage value obtaining unit, configured to obtain a calibration voltage obtained by amplifying and performing analog-to-digital conversion on two ends of a current detection resistor in a current detection circuit through an operational amplifier after injecting a constant current into the current detection circuit, compare the calibration voltage with a reference voltage value calculated by theory, and use a difference between the two calibration voltage values as a calibration offset voltage value;

the detection voltage value obtaining unit is used for obtaining the detection voltage value of two ends of the current detection resistor after the current to be detected is input into the current detection circuit and amplified by the operational amplifier and subjected to analog-to-digital conversion;

and the correction unit is used for correcting the detection voltage value through the calibration offset voltage value to obtain a corrected voltage value so as to obtain a current value to be detected according to the current detection resistance value.

7. The method of claim 6, wherein the calibrated offset voltage value obtaining unit comprises at least:

the calibration voltage obtaining unit is used for obtaining calibration voltage after amplifying and analog-to-digital converting two ends of the current detection resistor by the microprocessor after a constant current is output by adopting a current injection device and injected into the two ends of the current detection resistor;

the calibration offset voltage value calculating unit is used for calculating and obtaining a calibration offset voltage value by adopting the following formula:

Verr=Vt-Vref

wherein, Verr is a calibration offset voltage value, Vt is a calibration voltage, and Vref is a reference voltage value calculated by theory;

and the storage unit is used for storing the calibrated offset voltage value into a register.

8. The system of claim 7 wherein said constant current value is 1/2 times the current sense current range with a current accuracy error of less than 0.001A.

9. The system of claim 8, wherein the calibration voltage obtaining unit is connected with at least:

and the averaging unit is used for averaging a plurality of calibration voltages obtained through a plurality of calibration measurements to obtain a final calibration voltage value.

10. The system of any one of claims 7 to 9, wherein the correction unit further comprises:

a correction voltage value calculation unit, for calculating and obtaining the correction voltage value by adopting the following formula:

Vs=Vc-Verr

wherein, Verr is a calibration offset voltage value, Vc is a detection voltage value, and Vs is a correction voltage value;

and the current value to be detected obtaining unit is used for obtaining the current value to be detected by dividing the correction voltage value by the current detection resistance value.

Technical Field

The invention relates to the technical field of current detection, in particular to a method and a system for correcting offset voltage of an operational amplifier in a current detection circuit.

Background

In the conventional current detection circuit, as shown in fig. 1, a small-resistance precision resistor R1 is connected in series to a current loop to be measured, and a current signal is converted into a voltage signal through the resistor. Because the amplitude of the voltage is usually very small, an amplifying circuit is needed to amplify the signal, then the signal is input to an analog-to-digital converter for acquisition and conversion into a digital signal, and finally a Microprocessor (MCU) processes and judges the signal. Among them, the operational amplifier is a key device of the amplifying circuit.

Fig. 2 is an equivalent diagram of the operational amplifier when the offset voltage is input in fig. 1; in general, for an ideal operational amplifier, when the two input terminals are grounded, the output dc voltage should be zero, but actually not zero. Due to the asymmetry of the two transistor parameters and the load of the integrated operational amplifier input, when the input signal is zero, the output is not zero, a small differential voltage must be applied to the input end to force the output to reach 0, and the voltage is called as input offset voltage Vos. The input offset voltage can be seen as a voltage source Vos, in series with the inverting input of the operational amplifier.

At present, a hardware circuit correction method is used for correcting offset voltage, and the most commonly used method includes 3 methods, one is a method of adjusting the offset voltage by adopting a zero calibration pin, the other is a method of externally injecting small offset voltage, and the third is a method of integrating a compensation circuit in an operational amplifier.

Fig. 3 is a schematic diagram of a circuit for zeroing an operational amplifier according to the prior art; i.e. the offset voltage is adjusted by using the zero calibration pin. Many of these single-pass op-amps have pins for optional offset zero calibration. To use this function, the two pins should be connected through a potentiometer and the cursor moved through a resistor to one of the power supplies, as shown in the figure. The output of the operational amplifier is made zero by adjusting the sliding end of the potentiometer. Care must be taken during zeroing to avoid the sliding end of the zeroing potentiometer colliding with the positive power source end or the grounding point end, which would otherwise damage the operational amplifier.

The method of injecting the small offset voltage through the outside is to inject the small offset voltage into the in-phase end or the anti-phase end of the operational amplifier, but the sliding rheostat needs to be adjusted to realize zero adjustment, the operation process is complicated, repeated adjustment is needed, and the difficulty and the cost of mass production are increased.

The method of integrating the compensation circuit inside the operational amplifier has good effect, but the cost is high, and the high-performance operational amplifier cannot be generally used for cost-sensitive applications.

Disclosure of Invention

The present invention provides a method and a system for correcting offset voltage of an operational amplifier in a current detection circuit. The offset voltage problem of the operational amplifier in the current detection circuit can be effectively solved, a complex hardware correction circuit is not needed, the precision is high, and the hardware cost can be saved.

As an aspect of the present invention, a method for correcting offset voltage of an operational amplifier in a current detection circuit is provided, which is applied to a current detection circuit at least comprising an operational amplifier, an analog-to-digital converter and a microprocessor, and comprises the following steps:

step S10, injecting a constant current into the current detection circuit to obtain a calibration voltage amplified by an operational amplifier and subjected to analog-to-digital conversion at two ends of a current detection resistor in the current detection circuit, comparing the calibration voltage with a reference voltage value calculated by theory, and taking the difference value of the two as a calibration offset voltage value;

step S11, inputting the current to be detected into the current detection circuit, and obtaining the detection voltage value after the amplification and the analog-to-digital conversion of the two ends of the current detection resistor;

and step S12, correcting the detection voltage value through the calibration offset voltage value to obtain a corrected voltage value, so as to obtain a current value to be detected according to the current detection resistance value.

Wherein the step S10 at least includes the following steps:

step S100, outputting a constant current by adopting current injection equipment, and injecting the constant current into two ends of the current detection resistor;

step S102, the microprocessor obtains a calibration voltage after the amplification and the analog-to-digital conversion of two ends of the current detecting resistor;

step S103, the microprocessor calculates and obtains a calibration offset voltage value by adopting the following formula:

Verr=Vt-Vref

wherein, Verr is a calibration offset voltage value, Vt is a calibration voltage, and Vref is a reference voltage value calculated by theory;

and step S104, storing the calibrated offset voltage value into a register.

The constant current value is 1/2 of the current detection current range, and the current precision error is less than 0.001A.

And averaging a plurality of calibration voltages obtained through a plurality of times of calibration measurement to obtain a final calibration voltage value.

Wherein the step S12 further includes:

step S120, calculating and obtaining a correction voltage value by adopting the following formula:

Vs=Vc-Verr

wherein, Verr is a calibration offset voltage value, Vc is a detection voltage value, and Vs is a correction voltage value;

and step S112, dividing the corrected voltage value by the current detection resistance value to obtain a current value to be measured.

As another aspect of the present invention, there is also provided an offset voltage correction system for an operational amplifier in a current detection circuit, applied to a current detection circuit at least including an operational amplifier, an analog-to-digital converter and a microprocessor, the system including:

a calibration offset voltage value obtaining unit, configured to obtain a calibration voltage obtained by amplifying and performing analog-to-digital conversion on two ends of a current detection resistor in a current detection circuit through an operational amplifier after injecting a constant current into the current detection circuit, compare the calibration voltage with a reference voltage value calculated by theory, and use a difference between the two calibration voltage values as a calibration offset voltage value;

the detection voltage value obtaining unit is used for obtaining the detection voltage value of two ends of the current detection resistor after the current to be detected is input into the current detection circuit and amplified by the operational amplifier and subjected to analog-to-digital conversion;

and the correction unit is used for correcting the detection voltage value through the calibration offset voltage value to obtain a corrected voltage value so as to obtain a current value to be detected according to the current detection resistance value.

Wherein, the calibration offset voltage value obtaining unit at least comprises:

the calibration voltage obtaining unit is used for obtaining calibration voltage after amplifying and analog-to-digital converting two ends of the current detection resistor by the microprocessor after a constant current is output by adopting a current injection device and injected into the two ends of the current detection resistor;

the calibration offset voltage value calculating unit is used for calculating and obtaining a calibration offset voltage value by adopting the following formula:

Verr=Vt-Vref

wherein, Verr is a calibration offset voltage value, Vt is a calibration voltage, and Vref is a reference voltage value calculated by theory;

and the storage unit is used for storing the calibrated offset voltage value into a register.

The constant current value is 1/2 of the current detection current range, and the current precision error is less than 0.001A.

Wherein, the calibration voltage obtaining unit is at least connected with:

and the averaging unit is used for averaging a plurality of calibration voltages obtained through a plurality of calibration measurements to obtain a final calibration voltage value.

Wherein the correction unit further comprises:

a correction voltage value calculation unit, for calculating and obtaining the correction voltage value by adopting the following formula:

Vs=Vc-Verr

wherein, Verr is a calibration offset voltage value, Vc is a detection voltage value, and Vs is a correction voltage value;

and the current value to be detected obtaining unit is used for obtaining the current value to be detected by dividing the correction voltage value by the current detection resistance value.

The embodiment of the invention has the following beneficial effects:

the invention provides a method and a system for correcting offset voltage of an operational amplifier in a current detection circuit, which are characterized in that a constant current is injected into the current detection circuit in advance to obtain a calibration voltage after the amplification and analog-to-digital conversion of two ends of a current detection resistor through the operational amplifier, so that a calibration offset voltage value is obtained; and then inputting the current to be detected into the current detection circuit, correcting the detected voltage value through the calibration offset voltage value to obtain a corrected voltage value, and finally obtaining the current value to be detected. The invention can effectively solve the offset voltage problem of the operational amplifier in the current detection circuit, does not need a complex hardware correction circuit, can save the hardware cost and can obtain enough precision.

Drawings

In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is within the scope of the present invention for those skilled in the art to obtain other drawings based on the drawings without inventive exercise.

Fig. 1 is a schematic circuit diagram of a conventional current detection circuit;

FIG. 2 is an equivalent diagram of the operational amplifier of FIG. 1 when an offset voltage is inputted;

FIG. 3 is a schematic diagram of a prior art circuit for zeroing an operational amplifier;

FIG. 4 is a schematic diagram of a main flow chart of an embodiment of a method for correcting an offset voltage of an operational amplifier in a current detection circuit according to the present invention;

FIG. 5 is a schematic diagram of the circuit of FIG. 4 for measuring the calibrated offset voltage value;

FIG. 6 is a detailed flowchart of step S10 in FIG. 4;

fig. 7 is a schematic structural diagram of an offset voltage correction system of an operational amplifier in a current detection circuit according to the present invention;

FIG. 8 is a schematic diagram of a structure of the offset voltage calibration obtaining unit shown in FIG. 7;

fig. 9 is a schematic structural diagram of the correction unit in fig. 7.

Detailed Description

In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention will be described in further detail with reference to the accompanying drawings.

Fig. 4 is a schematic main flow chart illustrating an embodiment of a method for correcting an offset voltage of an operational amplifier in a current detection circuit according to the present invention; fig. 5 and 6 are also combined. The method provided by the invention is applied to a current detection circuit at least comprising an operational amplifier, an analog-to-digital converter and a microprocessor, and comprises the following steps:

step S10, injecting a constant current into the current detection circuit to obtain a calibration voltage amplified by an operational amplifier and subjected to analog-to-digital conversion at two ends of a current detection resistor in the current detection circuit, comparing the calibration voltage with a reference voltage value calculated by theory, and taking the difference value of the two as a calibration offset voltage value; it will be appreciated that the reference voltage value can be determined by theoretical calculation methods, since it is difficult to find an ideal zero offset voltage operational amplifier in practice.

Specifically, please refer to fig. 5. The step S10 more specifically includes the steps of:

step S100, outputting a constant current It by adopting a current injection device, and injecting the constant current It into two ends of the current detection resistor R1; the current injection device can also be a current source, or can be a voltage source and an adjustable resistor, and a constant current is output by automatically or manually adjusting parameters of the current injection device. In some specific examples, the constant current value is 1/2 of the current detection current range, and the current precision error is less than 0.001A;

step S102, the microprocessor obtains a calibration voltage after the amplification and the analog-to-digital conversion of two ends of the current detecting resistor;

step S103, the microprocessor calculates and obtains a calibration offset voltage value by adopting the following formula:

Verr=Vt-Vref

wherein, Verr is a calibration offset voltage value, Vt is a calibration voltage, and Vref is a reference voltage value calculated by theory;

and step S104, storing the calibrated offset voltage value into a register.

More specifically, in some embodiments, a plurality of calibration voltages obtained through a plurality of (e.g., 3 or more) calibration measurements are averaged to obtain a final calibration voltage value.

Step S11, inputting the current to be detected into the current detection circuit, and obtaining the detection voltage value after the amplification and the analog-to-digital conversion of the two ends of the current detection resistor; specifically, a current to be measured is input to two ends of the detection resistor R1;

and step S12, correcting the detection voltage value through the calibration offset voltage value to obtain a corrected voltage value, so as to obtain a current value to be detected according to the current detection resistance value.

Specifically, the step S12 further includes:

step S120, calculating and obtaining a correction voltage value by adopting the following formula:

Vs=Vc-Verr

wherein, Verr is a calibration offset voltage value, Vc is a detection voltage value, and Vs is a correction voltage value;

and step S112, dividing the corrected voltage value by the current detection resistance value to obtain a current value to be measured.

As shown in fig. 7, a schematic structural diagram of an offset voltage correction system of an operational amplifier in a current detection circuit according to the present invention is shown in fig. 8 and fig. 9, in this embodiment, the system 1 is applied to a current detection circuit at least including an operational amplifier, an analog-to-digital converter, and a microprocessor, and the system 1 specifically includes:

a calibration offset voltage value obtaining unit 11, configured to obtain a calibration voltage obtained by amplifying and performing analog-to-digital conversion on two ends of a current detection resistor in a current detection circuit through an operational amplifier after injecting a constant current into the current detection circuit, compare the calibration voltage with a reference voltage value calculated by theory, and use a difference between the two calibration voltage values as a calibration offset voltage value;

a detection voltage value obtaining unit 12, configured to obtain a detection voltage value obtained by amplifying and performing analog-to-digital conversion on two ends of the current detection resistor after inputting the current to be detected into the current detection circuit;

and the correcting unit 13 is configured to correct the detection voltage value through the calibration offset voltage value to obtain a corrected voltage value, so as to obtain a current value to be detected according to the current detection resistance value.

In a practical example, the calibrated offset voltage value obtaining unit 11 at least includes:

a calibration voltage obtaining unit 111, configured to output a constant current by using a current injection device, and after injecting the constant current into two ends of the current detection resistor, obtain, by the microprocessor, a calibration voltage obtained by amplifying and performing analog-to-digital conversion on the two ends of the current detection resistor; the constant current value is 1/2 of the current detection current range, and the current precision error is less than 0.001A;

a calibration offset voltage value calculating unit 112, configured to calculate and obtain a calibration offset voltage value by using the following formula:

Verr=Vt-Vref

wherein, Verr is a calibration offset voltage value, Vt is a calibration voltage, and Vref is a reference voltage value calculated by theory;

and the storage unit 113 is used for storing the calibrated offset voltage value into a register.

The calibration voltage obtaining unit 111 is at least connected to an averaging unit 114, and is configured to average a plurality of calibration voltages obtained through a plurality of calibration measurements to obtain a final calibration voltage value.

In a specific example, the modification unit 13 further includes:

a correction voltage value calculating unit 131, configured to calculate and obtain a correction voltage value by using the following formula:

Vs=Vc-Verr

wherein, Verr is a calibration offset voltage value, Vc is a detection voltage value, and Vs is a correction voltage value;

a current value to be measured obtaining unit 132, configured to obtain a current value to be measured by dividing the corrected voltage value by the current detection resistance value.

For more details, reference may be made to the foregoing description of fig. 4 to 6, which is not repeated herein.

The embodiment of the invention has the following beneficial effects:

the invention provides a method and a system for correcting offset voltage of an operational amplifier in a current detection circuit, which are characterized in that a constant current is injected into the current detection circuit in advance to obtain a calibration voltage after the amplification and analog-to-digital conversion of two ends of a current detection resistor through the operational amplifier, so that a calibration offset voltage value is obtained; and then inputting the current to be detected into the current detection circuit, correcting the detected voltage value through the calibration offset voltage value to obtain a corrected voltage value, and finally obtaining the current value to be detected. The invention can effectively solve the offset voltage problem of the operational amplifier in the current detection circuit, does not need a complex hardware correction circuit, can save the hardware cost and can obtain enough precision.

As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, apparatus, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.

The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.

While the invention has been described in connection with what is presently considered to be the most practical and preferred embodiment, it is to be understood that the invention is not to be limited to the disclosed embodiment, but on the contrary, is intended to cover various modifications and equivalent arrangements included within the spirit and scope of the appended claims.

13页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:单电阻电流采样方法及其装置

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!