Disclosure of Invention
The main object of the present application is to provide a current detection circuit and an electronic device, which aim to improve the sampling precision of the current detection circuit.
In a first aspect, the present application provides a current detection circuit, the current detection circuit is used for detecting the electric current between a first end to be detected and a second end to be detected, the current detection circuit includes sampling circuit, filter circuit, compensation circuit and operational amplifier circuit, wherein:
the sampling circuit is connected between the first end to be tested and the second end to be tested;
the first end of the filter circuit is connected with the first end of the sampling circuit, and the second end of the filter circuit is connected with the second end of the sampling circuit through the compensation circuit;
the operational amplification circuit is connected with the output end of the filter circuit and is used for sampling the current flowing through the sampling circuit through the filter circuit, amplifying the sampled current and outputting the amplified current to the target circuit;
the compensation circuit is used for compensating current errors existing when the operational amplification circuit samples the current flowing through the sampling circuit through the filter circuit.
In an embodiment, the compensation circuit comprises a compensation resistor connected between the second end of the sampling circuit and the second end of the filter circuit.
In an embodiment, the sampling circuit includes a sampling resistor, and a resistance difference between the compensation resistor and the sampling resistor is less than or equal to a preset resistance difference.
In one embodiment, the filter circuit includes a first resistor and a first capacitor; the resistance value of the compensation resistor is the sum of the resistance values of the sampling resistor and the first resistor;
the first end of the first resistor is used as the first end of the filter circuit, the second end of the first resistor is connected with the first end of the first capacitor, and the second end of the first capacitor is used as the second end of the filter circuit;
the first end and the second end of the first capacitor serve as output ends of the filter circuit.
In an embodiment, the filter circuit includes a first resistor, a first capacitor, and a second resistor, where a resistance value of the first resistor is equal to a resistance value of the second resistor, and a resistance value of the sampling resistor is equal to a resistance value of the compensation resistor;
the first end of the first resistor is used as the first end of the filter circuit, the second end of the first resistor is connected with the first end of the first capacitor, the second end of the first capacitor is connected with the first end of the second resistor, and the second end of the second resistor is used as the second end of the filter circuit;
the first end and the second end of the first capacitor serve as output ends of the filter circuit.
In an embodiment, the operational amplifier circuit comprises an isolation amplifier or an integrated operational amplifier.
In an embodiment, the current detection circuit further comprises a voltage division circuit; the voltage dividing circuit comprises a plurality of voltage dividing resistors connected in series, and the voltage dividing circuit is connected between the first end to be tested and the second end to be tested after being connected with the sampling circuit in series.
In an embodiment, the current detection circuit further includes an amplifying circuit, and the amplifying circuit is connected to the operational amplifying circuit, and is configured to convert an output voltage of the operational amplifying circuit into a preset voltage and output the preset voltage.
In a second aspect, an embodiment of the present application further provides an electronic device, including a current detection circuit according to any one of the embodiments, where the current detection circuit is configured to detect a current between a first to-be-detected terminal and a second to-be-detected terminal.
In one embodiment, the electronic device further comprises a battery pack and a charge-discharge circuit;
the charging and discharging circuit is connected with the battery pack and is used for controlling the charging or discharging of the battery pack;
the sampling circuit of the current detection circuit is connected in series with the charge-discharge circuit.
The current detection circuit is used for detecting current between a first end to be detected and a second end to be detected, and comprises a sampling circuit, a filter circuit, a compensation circuit and an operational amplifier circuit, wherein the sampling circuit is connected between the first end to be detected and the second end to be detected; the first end of the filter circuit is connected with the first end of the sampling circuit, and the second end of the filter circuit is connected with the second end of the sampling circuit through the compensation circuit; the operational amplification circuit is connected with the output end of the filter circuit and is used for sampling the current flowing through the sampling circuit through the filter circuit and outputting the amplified sampled current to the target circuit; the compensation circuit is used for compensating current errors existing when the operational amplification circuit samples the current flowing through the sampling circuit through the filter circuit. According to the current sampling circuit, the compensation circuit can compensate current errors existing when the current is sampled to the sampling circuit, so that the bias current output by the operational amplification circuit is prevented from interfering with a sampling result, and the sampling precision of the current detection circuit can be greatly improved.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are some, but not all, of the embodiments of the present application. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present disclosure.
Some embodiments of the present application are described in detail below with reference to the accompanying drawings. The following embodiments and features of the embodiments may be combined with each other without conflict.
In the related art, a current between both ends of a power supply loop is detected by a current detection circuit as shown in fig. 1. However, in the test process, it is found that the sampling accuracy of the current detection circuit shown in fig. 1 is poor, and after analysis, it is known that the operational amplifier circuit generates a bias current, and the bias current flows through the filter circuit and is applied to the sampling circuit, so that the sampling current flowing through the sampling circuit includes not only the supply current in the supply loop but also the bias current generated by the operational amplifier circuit, and further an error exists in the sampling result. If the bias current is large, the error will also increase.
Referring to fig. 2, fig. 2 is a schematic circuit diagram of an implementation of a current detection circuit according to an embodiment of the present application.
As shown in fig. 2, the current detection circuit 100 is configured to detect a current between a first to-be-detected terminal bus+ and a second to-be-detected terminal BUS-, and the current detection circuit 100 includes a sampling circuit 110, a filtering circuit 120, a compensating circuit 130, and an operational amplifying circuit 140.
The sampling circuit 110 is connected between the first terminal to be tested bus+ and the second terminal to be tested BUS-. The first end of the filter circuit 120 is connected to the first end of the sampling circuit 110, and the second end of the filter circuit 120 is connected to the second end of the sampling circuit 110 through the compensation circuit 130. The operational amplifier circuit 140 is connected to an output terminal of the filter circuit 120, and is configured to sample the current flowing through the sampling circuit 110 by the filter circuit 120, amplify the sampled current, and output the amplified current to the target circuit 200.
It should be noted that, the first to-be-detected terminal bus+ and the second to-be-detected terminal BUS-may be two ends of a power supply loop of the electronic device, and the sampling circuit 110 is disposed between the first to-be-detected terminal bus+ and the second to-be-detected terminal BUS-, so as to collect current between the first to-be-detected terminal bus+ and the second to-be-detected terminal BUS-. The filtering circuit 120 is configured to filter the sampling current output by the sampling circuit 110, so that the sampling current is more stable.
The operational amplifier circuit 140 includes, for example, an isolation amplifier or an integrated operational amplifier. The operational amplifier circuit 140 generates a bias current, and the bias current flows through the filter circuit 120 and is applied to the sampling circuit 110, so that an error exists in the sampling current flowing through the sampling circuit 110. The compensation circuit 130 is used for compensating a current error existing when the operational amplification circuit 140 samples the current flowing through the sampling circuit 110 through the filtering circuit 120. The operational amplifier circuit 140 can amplify the sample current flowing through the filter circuit 120, the amplification factor can be set according to the actual situation, and the amplified sample current can be output to the target circuit 200.
The target circuit 200 may be, for example, a control circuit, such that the control circuit may perform a corresponding process based on the received sample current, such as adjusting the current across the supply loop based on the received sample current. The target circuit 200 may also be other circuits in an electronic device, which is not specifically limited in this embodiment.
It should be noted that, in the embodiment of the present application, by adding the compensation circuit 130 between the filter circuit 120 and the sampling circuit 110, the compensation circuit 130 compensates the current error existing when the operational amplifier circuit 140 samples through the filter circuit 120, so that the bias current output by the operational amplifier circuit 140 can be prevented from interfering with the sampling result, and the sampling precision of the current detection circuit 100 can be greatly improved.
In some embodiments, the operational amplifier circuit 140 is configured to sample the current flowing through the sampling circuit 110 by the filter circuit 120, calculate a sampling voltage according to the sampling current and a sampling resistor in the sampling circuit 110, amplify the sampling voltage, and output the amplified sampling voltage to the target circuit 200. It is to be understood that the operational amplifier circuit 140 may also output the sampling voltage calculated according to the sampling current to the target circuit 200, which is not particularly limited in this embodiment.
In one embodiment, as shown in fig. 3, the current detection circuit 100 further includes a voltage division circuit 150. The voltage dividing circuit 150 includes a plurality of voltage dividing resistors connected in series, and the voltage dividing circuit 150 is connected in series with the sampling circuit 110 and then connected between the first to-be-tested terminal bus+ and the second to-be-tested terminal BUS-.
It should be noted that, the voltage dividing circuit 150 formed by a plurality of voltage dividing resistors can divide the voltage applied to the sampling circuit 110, so as to limit the current between the first to-be-tested terminal bus+ and the second to-be-tested terminal BUS-, and prevent the sampling circuit 110 connected in series from being burned out due to excessive current. The number of the voltage dividing resistors can be set according to the requirement, and the resistors with smaller resistance values can be adopted for the voltage dividing resistors, so that the circuit cost is saved.
As illustrated in fig. 4 and 5, the voltage dividing circuit 150 includes a voltage dividing resistor R1, a voltage dividing resistor R2, and a voltage dividing resistor R3 connected in series. The voltage division circuit 150 is connected in series with the sampling circuit 110, and the voltage division circuit 150 and the sampling circuit 110 are connected between the first to-be-tested terminal bus+ and the second to-be-tested terminal BUS-.
It is to be understood that the voltage dividing circuit 150 may be connected in series to the first end of the sampling circuit 110, or may be connected in series to the second end of the sampling circuit 110, or the voltage dividing circuit 150 may be split into two sub-circuits, and the split sub-circuits are respectively connected to the first end and the second end of the sampling circuit 110, which is not limited in this embodiment.
In one embodiment, the compensation circuit 130 includes a compensation resistor connected between the second terminal of the sampling circuit 110 and the second terminal of the filtering circuit 120. The compensation resistor may be composed of one or more resistors, and the compensation resistor can be used to compensate for a current error that exists when the operational amplifier circuit 140 samples the current flowing through the sampling circuit 110 through the filter circuit 120. It is understood that the compensation circuit 130 may further include other devices besides compensation resistors, which are not specifically limited in this embodiment.
As shown in fig. 4 and 5, the compensation circuit 130 includes a compensation resistor Rb, and when the operational amplifier circuit 140 samples the current flowing through the sampling circuit 110 through the filtering circuit 120, a bias current is provided to the first end of the sampling circuit 110, so that the embodiment of the present application adds the compensation resistor Rb to the second end of the sampling circuit 110, so as to compensate the current error caused by the bias current.
In an embodiment, the sampling circuit 110 includes a sampling resistor connected between the first to-be-detected terminal bus+ and the second to-be-detected terminal BUS-, and a resistance difference between the compensation resistor and the sampling resistor is less than or equal to a preset resistance difference. It is understood that the sampling resistor may be comprised of one or more resistors. To ensure accuracy of sampling, the preset resistance difference may be set to 0 or a resistance parameter close to 0, e.g., the preset resistance difference may be set to 1 ohm.
As shown in fig. 4 and 5, the sampling circuit 110 includes a sampling resistor R4, where the sampling resistor R4 is configured to collect currents flowing through both ends of the first to-be-detected terminal bus+ and the second to-be-detected terminal BUS-, and form a voltage drop across its own resistor, where the voltage drop is equal to the passing current multiplied by the resistance of the sampling resistor R4. After analysis, when the resistance difference between the compensation resistor Rb and the sampling resistor R4 is equal, the current error caused by the bias current is minimum.
In the following description taking fig. 5 as an example, when the compensation resistor Rb is not added, the voltage sampling value V1 of the operational amplifier circuit 140 is:wherein V is bus+ V is the voltage at the first to-be-detected terminal BUS + bus- For the voltage at the second terminal to be measured BUS-, I 2 The bias current applied to the sampling resistor R4 by the filter circuit 120 is applied to the operational amplifier circuit 140. After adding the compensation resistor Rb, the voltage sampling value V2 is:wherein V is bus+ V is the voltage at the first to-be-detected terminal BUS + bus- For the voltage at the second terminal to be measured BUS-, I 2 Bias current I applied to sampling resistor R4 by filter circuit 120 for operational amplifier circuit 140 4 The compensation current applied to the sampling resistor R4 through the compensation resistor Rb is supplied to the operational amplifier circuit 140.
It can be seen that when the bias current I 2 And compensation current I 4 Compensation resistor when appropriateTherefore, the sampling accuracy error is minimal when taking Rb≡R4.
In one embodiment, as shown in fig. 4, the filter circuit 120 includes a first resistor R6 and a first capacitor C1. The first end of the first resistor R6 is used as the first end of the filter circuit 120, the second end of the first resistor R6 is connected with the first end of the first capacitor C1, and the second end of the first capacitor C1 is used as the second end of the filter circuit 120; the first terminal and the second terminal of the first capacitor C1 serve as output terminals of the filter circuit 120.
The resistance of the compensation resistor Rb is the sum of the resistances of the sampling resistor R4 and the first resistor R6. As shown in fig. 4, the offset current applied to the sampling resistor R4 by the operational amplifier circuit 140 through the filter circuit 120 flows through the first resistor R6 and the sampling resistor R4, so that the resistance of the compensation resistor Rb may be set to be the sum of the resistances of the sampling resistor R4 and the first resistor R6, that is, the resistance of the compensation resistor is rb=r4+r6, so that the current error caused by the offset current is minimized.
In one embodiment, as shown in fig. 5, the filter circuit 120 includes a first resistor R6, a first capacitor C1, and a second resistor R7. The first end of the first resistor R6 is used as the first end of the filter circuit 120, the second end of the first resistor R6 is connected with the first end of the first capacitor C1, the second end of the first capacitor C1 is connected with the first end of the second resistor R7, and the second end of the second resistor R7 is used as the second end of the filter circuit 120; the first terminal and the second terminal of the first capacitor C1 serve as output terminals of the filter circuit 120.
The resistance of the first resistor R6 is equal to the resistance of the second resistor R7, and the resistance of the sampling resistor R4 is equal to the resistance of the compensation resistor Rb. As shown in fig. 5, the operational amplifier circuit 140 uses differential sampling, and thus the resistance values of the first resistor R6 and the second resistor R7 are identical. The operational amplifier circuit 140 applies the bias current to the sampling resistor R4 through the filter circuit 120 to flow through the sampling resistor R4 and the first resistor R6, so that the resistance of the compensation resistor Rb can be set to be the sampling resistor R4, so that the compensation current flows through the compensation resistor Rb and the second resistor R7, and if the resistance of the compensation resistor Rb is equal to the resistance of the sampling resistor R4, that is, the sum of the resistance of the first resistor R6 and the resistance of the sampling resistor R4 is equal to the sum of the resistance of the second resistor R7 and the resistance of the compensation resistor Rb, the current error caused by the bias current is minimized.
In an embodiment, since the first resistor R6 and the second resistor R7 are used only for filtering, the resistance value thereof is particularly small with respect to the sampling resistor R4. For example, the sampling resistor R4 is a resistor of 10kΩ, and the first resistor R6 and the second resistor R7 may be resistors of 10Ω, so that the voltage drop of the bias current on the first resistor R6 is small, and the first resistor R6 may be omitted, and at this time, the second resistor R7 may be deleted, and only the compensation resistor Rb may be used.
In one embodiment, as shown in fig. 4 and 5, the operational amplifier circuit 140 includes an isolation amplifier U1, and the isolation amplifier U1 includes a positive input terminal INP and a negative input terminal INN. The positive input terminal INP of the isolation amplifier U1 is connected to the first terminal of the first capacitor C1, and the negative input terminal INN of the isolation amplifier U1 passes through the second terminal of the first capacitor C1. The isolation amplifier U1 further includes a positive output terminal OUTP and a negative output terminal OUTN for connecting to a target circuit, such as the positive output terminal OUTP for outputting the voltage signal bus_v+s and the negative output terminal OUTN for outputting the voltage signal bus_v-S.
The isolation amplifier U1 is configured to amplify the sampling current output by the filter circuit 120 in an isolated manner, so that different power supplies are used on the primary side and the secondary side of the isolation amplifier U1 (the 5v_p power supply connected to VDD1 and the 5V power supply connected to VDD2 are mutually isolated power supplies), and isolated grounds (e.g. GND1 and GND 2) are also used on the two sides.
In one embodiment, as shown in fig. 6, the current detection circuit 100 further includes an amplifying circuit 160, where the amplifying circuit 160 is connected to the operational amplifying circuit 140, and is configured to convert an output voltage of the operational amplifying circuit 140 into a preset voltage and output the preset voltage to the target circuit 200. The preset voltage can be flexibly set according to practical situations, for example, the preset voltage is the working voltage of the functional module in the electronic equipment. The amplifying circuit 160 includes, but is not limited to, a common-emitter amplifying circuit, a common-collector amplifying circuit, and a common-base amplifying circuit. The output voltage of the operational amplifier circuit 140 is converted by the amplifying circuit 160 to obtain a preset voltage, so that accurate adjustment of the output voltage of the operational amplifier circuit 140 is realized, and the preset voltage can supply power to the target circuit 200.
The current detection circuit 100 of the above embodiment is configured to detect a current between the first to-be-detected terminal bus+ and the second to-be-detected terminal BUS-, where the current detection circuit 100 includes a sampling circuit 110, a filtering circuit 120, a compensating circuit 130, and an operational amplifying circuit 140, and the sampling circuit 110 is connected between the first to-be-detected terminal bus+ and the second to-be-detected terminal BUS-; the first end of the filter circuit 120 is connected with the first end of the sampling circuit 110, and the second end of the filter circuit 120 is connected with the second end of the sampling circuit 110 through the compensation circuit 130; the operational amplifier circuit 140 is connected to the output end of the filter circuit 120, and is configured to sample the current flowing through the sampling circuit 110 by the filter circuit 120, amplify the sampled current, and output the amplified current to the target circuit 200; the compensation circuit 130 is used for compensating a current error existing when the operational amplification circuit 140 samples the current flowing through the sampling circuit 110 through the filtering circuit 120. The compensation circuit 130 can compensate the current error existing when the current is sampled by the sampling circuit 110, so that the bias current output by the operational amplifier circuit 140 is prevented from interfering with the sampling result, and the sampling precision of the current detection circuit 100 can be greatly improved.
Referring to fig. 7, fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
As shown in fig. 7, the electronic device 300 includes: the current detection circuit 310, the current detection circuit 310 is configured to detect a current between the first terminal to be detected and the second terminal to be detected. The current detection circuit 310 may be the current detection circuit 100 described in the above embodiment.
In one embodiment, as shown in fig. 8, the electronic device 300 further includes a battery pack 320 and a charge-discharge circuit 330; the charge/discharge circuit 330 is connected to the battery pack 320, and the charge/discharge circuit 330 is used for controlling the charge or discharge of the battery pack 320; the sampling circuit of the current detection circuit 310 is connected in series in the charge-discharge circuit 330.
For example, the charge-discharge circuit 330 includes a first terminal to be tested and a second terminal to be tested, and the sampling circuit of the current detection circuit 310 is connected in series between the first terminal to be tested and the second terminal to be tested. The battery pack 320 may include one or more electrical energy storage units, such as one or more batteries. The plurality of batteries may be connected in series-parallel to form the battery pack 320.
The electronic device 300 of the above embodiment includes the battery module 310 and the current detection circuit 320, where the current detection circuit 320 includes the sampling circuit 110, the filter circuit 120, the compensation circuit 130, and the operational amplifier circuit 140 described in the above embodiment. The compensation circuit 130 can compensate the current error existing when the current is sampled by the sampling circuit, so that the bias current output by the operational amplification circuit 140 is prevented from interfering with the sampling result, the sampling precision of the current detection circuit 100 can be greatly improved, the accuracy of charging or discharging the battery pack 320 can be improved, and the stability of the electronic device 300 is greatly improved.
In the description of the present application, it should be noted that, unless explicitly stated and limited otherwise, the terms "mounted," "connected," and "connected" are to be construed broadly, and may be, for example, fixedly connected, detachably connected, or integrally connected. Either mechanically or electrically. Can be directly connected or indirectly connected through an intermediate medium, and can be communicated with the inside of two elements or the interaction relationship of the two elements. The specific meaning of the terms in this application will be understood by those of ordinary skill in the art as the case may be.
In this application, unless expressly stated or limited otherwise, a first feature "above" or "below" a second feature may include both the first and second features being in direct contact, and may also include the first and second features not being in direct contact but being in contact with each other by way of additional features therebetween. Moreover, a first feature being "above," "over" and "on" a second feature includes the first feature being directly above and obliquely above the second feature, or simply indicating that the first feature is higher in level than the second feature. The first feature being "under", "below" and "beneath" the second feature includes the first feature being directly under and obliquely below the second feature, or simply means that the first feature is less level than the second feature.
The above disclosure provides many different embodiments or examples for implementing different structures of the present application. The components and arrangements of specific examples are described above in order to simplify the disclosure of this application. Of course, they are merely examples and are not intended to limit the present application. Furthermore, the present application may repeat reference numerals and/or letters in the various examples, which are for the purpose of brevity and clarity, and which do not in themselves indicate the relationship between the various embodiments and/or arrangements discussed. In addition, the present application provides examples of various specific processes and materials, but one of ordinary skill in the art may recognize the application of other processes and/or the use of other materials.
In the description of the present specification, reference to the terms "one embodiment," "some embodiments," "illustrative embodiments," "examples," "specific examples," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the present application. In this specification, schematic representations of the above terms do not necessarily refer to the same embodiments or examples. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
The above embodiments are only preferred embodiments of the present application, and the scope of the present application is not limited thereto, but any insubstantial changes and substitutions made by those skilled in the art on the basis of the present application are intended to be within the scope of the present application.