FLUXGATE CURRENT SENSOR AND CURRENT MEASUREMENT METHOD

Abstract

The invention belongs to the technical field of current detection, in particular to a fluxgate current sensor and a current measurement method, wherein the fluxgate current sensor comprises a magnetic probe and an excitation and detection circuit, and the magnetic probe comprises an excitation iron core and an excitation coil, the excitation coil is connected to the excitation and detection circuit, the excitation and detection circuit is used to output alternating excitation voltages to the excitation coil, and the excitation coil is excited to generate alternating excitation currents and cause the excitation iron core to reach saturation alternately; the excitation and detection circuit is further configured to convert the excitation currents flowing through the excitation coil, into equivalent differences of two currents, so as to calculate average values of the excitation currents flowing through the excitation coil via differential equivalent currents, thereby calculating to-be-measured primary currents by the average values of the excitation currents. Technical solutions of the present invention can eliminate zero drift of the fluxgate current sensor, thereby improving small current identification and measurement accuracy thereof.

Claims

1. A fluxgate current sensor, comprising a magnetic probe and an excitation and detection circuit, wherein the magnetic probe comprises an excitation iron core and an excitation coil, the excitation coil is connected to the excitation and detection circuit; the excitation and detection circuit is used to output alternating excitation voltages v.sub.e to the excitation coil, and the excitation coil is excited to generate alternating excitation currents i.sub.e and cause the excitation iron core to reach saturation alternately; and the excitation and detection circuit is further configured to convert the excitation currents i.sub.e flowing through the excitation coil into equivalent differences of two currents, i.sub.e1 and i.sub.e2, so as to calculate average values of the excitation currents flowing through the excitation coil via differential equivalent currents i.sub.e1i.sub.e2, thereby calculating to-be-measured primary currents I.sub.d by the average values of the excitation currents, and the differential equivalent currents i.sub.e1i.sub.e2 are configured to eliminate zero drift of the fluxgate current sensor.

2. The fluxgate current sensor according to claim 1, wherein the excitation iron core comprises an annular closed and saturable soft magnetic core of high magnetic permeability, the excitation iron core is used to carry magnetic flux generated by the to-be-measured primary currents I.sub.d and magnetic flux generated by the excitation currents flowing through the excitation coil, the excitation coil is wound on the excitation iron core, and the excitation coil is used to carry the alternating excitation voltages and the alternating excitation currents constructed by the excitation and detection circuit.

3. The fluxgate current sensor according to claim 1, wherein the excitation and detection circuit comprises a DC voltage source Vdc, an H-bridge circuit and differential measuring resistors, and the differential measuring resistors comprise a Re1 and a Re2; the DC voltage source Vdc supplies power for the H-bridge circuit, the H-bridge circuit comprises four switching devices, the switching devices include MOS tubes, and inside the MOS tubes are provided freewheeling diodes; and an upper bridge arm of the H-bridge circuit comprises PNP-type MOS tubes, Q1 and Q2, an lower bridge arm of the H-bridge comprises NPN-type MOS tubes Q3 and Q4, an output terminal of the Q4 in the lower bridge arm is connected to a positive end of the differential measuring resistor Re1, an output terminal of the Q3 in the lower bridge arm is connected to a positive end of the Re2, and negative ends of both the Re1 and the Re2 are connected to a potential reference point of the fluxgate current sensor.

4. The fluxgate current sensor according to claim 3, wherein the alternating excitation voltages v.sub.e are output from the excitation and detection circuit to the excitation coil, and a construction method of the alternating excitation voltages v.sub.e is as follows: controlling the four switching devices in the H-bridge circuit to be turned on in pairs alternately, when the switching devices Q1 and Q4 are turned on, the switching devices Q2 and Q3 are turned off, and when the switching devices Q1 and Q4 are turned off, the switching devices Q2 and Q3 are turned on, thereby constructing excitation voltages v.sub.e alternating between positive and negative values at both ends of the excitation coil to excite the excitation coil.

5. The fluxgate current sensor according to claim 3, wherein a method for controlling the four switching devices in the H-bridge circuit to be turned on alternately in pairs is as follows: through magnetic performance parameters and dimensions of the excitation iron core calculated, a current I.sub.m threshold for fully saturating the excitation iron core is obtained, and the current threshold I.sub.m meets following conditions when the fluxgate current sensor is designed: I m > .Math. "\[LeftBracketingBar]" I d / N e .Math. "\[RightBracketingBar]" , wherein I.sub.d refers to a to-be-measured primary current, and N.sub.e refers to number of turns of the excitation coil Le; and when a positive current value flowing through the Re1 reaches the current threshold I.sub.m, the switching devices Q1 and Q4 are turned off, the switching devices Q2 and Q3 are turned on, and when a positive current value flowing through the Re2 reaches the current threshold I.sub.m, the switching devices Q2 and Q3 are turned off, and the switching devices Q1 and Q4 are turned on, so as to alternately control the four switching devices in the H-bridge circuit to be turned on in pairs alternatively through a peak value of the positive currents flowing through the Re1 and the Re2.

6. The fluxgate current sensor according to claim 1 wherein the differential equivalent currents i.sub.e1i.sub.e2 are constructed as follows: the four switching devices in the H-bridge circuit are turned on in pairs alternatively, and when a switching device on the upper bridge arm of the H-bridge circuit and a switching device on the lower bridge arm of the H-bridge circuit are turned on simultaneously, the excitation currents i.sub.e flowing through the excitation coil flow through the Re1 and the Re2 to form current loops; and when the switching devices Q1 and Q4 are turned on, the excitation currents i.sub.e flow through the Re1, and at this time, the excitation currents i.sub.e are defined to flow in a same direction as a current direction in the Re1, and when the switching devices Q2 and Q3 are turned on, the excitation currents i.sub.e are defined to flow in an opposite direction to a current direction in the Re2, so the excitation currents i.sub.e is equal to the differential equivalent currents i.sub.e1i.sub.e2, i.e., i.sub.e=i.sub.e1i.sub.e2.

7. The fluxgate current sensor according to claim 1 further comprising an operational amplifier, an ADC analog-to-digital converter, and a microprocessor MCU, wherein in a process of obtaining the average values of the excitation currents i.sub.av through the differential equivalent current i.sub.e1i.sub.e2, the operational amplifier makes gain adjustment, so as to output generated digital signals, the ADC analog-to-digital converter is configured for sampling, and microprocessor MCU executes operation.

8. A current measurement method applied to the fluxgate current sensor according to claim 1, comprising following steps of: S1designing a fluxgate current sensor, wherein the fluxgate current sensor comprises a magnetic probe and an excitation and detection circuit, the magnetic probe comprises an excitation iron core and an excitation coil, the excitation coil is wound on the excitation iron core, and the excitation coil is connected to the excitation and detection circuit; S2controlling the excitation and detection circuit to output alternating excitation voltages to both ends of the excitation coil, so that alternating excitation currents are excited to flow in the excitation coil and cause the excitation iron core to reach saturation alternately; S3conducting difference calculation between currents i.sub.e1 and i.sub.e2 flowing through the Re1 and the Re2, i.e., i.sub.e1i.sub.e2, to obtain current values equivalent to the excitation currents i.sub.e; S4calculating average values i.sub.av of the excitation currents on the excitation coil; and S5calculating the to-be-measured primary direct currents I.sub.d.

9. An electronic device comprising a memory and a processor, wherein the processor is used to implement the steps of the current measurement method according to claim 8 when a computer management program stored in the memory is executed.

10. A computer-readable storage medium, comprising a computer management program stored thereon, wherein when the computer management program is executed by a processor, the steps of the current measurement method according to claim 8 are realized.

Description

BRIEF DESCRIPTION OF THE DRAWINGS

[0033] FIG. 1 shows composition structure of a fluxgate current sensor of the present invention;

[0034] FIG. 2 is a circuit diagram of an excitation and detection circuit of the fluxgate current sensor of the present invention;

[0035] FIG. 3 shows magnetization curve of an excitation iron core Te of the present invention;

[0036] FIG. 4 shows excitation voltage and excitation current waveforms of the present invention;

[0037] FIG. 5 shows current waveforms flowing on a differential measuring resistor Re1 in one cycle of the present invention;

[0038] FIG. 6 shows current waveforms flowing on a differential measuring resistor Ret in one cycle of the present invention;

[0039] FIG. 7 shows error test results of the fluxgate current sensor of the present invention;

[0040] FIG. 8 is a schematic diagram of a hardware structure of a possible electronic device provided by the present invention; and

[0041] FIG. 9 is a schematic diagram of a hardware structure of a possible computer-readable storage medium provided by the present invention.

[0042] The markups in the present invention are indicated as follows: [0043] 100: fluxgate based automotive current sensor; [0044] 1: magnetic probe; [0045] 2: excitation and detection circuit; [0046] I.sub.d: to-be-measured primary direct current; [0047] Vdc: DC voltage source; [0048] Re1: differential measuring resistor 1; [0049] Re2: differential measuring resistor 2; [0050] v.sub.e: excitation voltage; [0051] i.sub.e: excitation current; Le: excitation coil; [0052] Te: excitation iron core; [0053] I.sub.m: maximum excitation current threshold; [0054] N.sub.e: number of turns of the excitation coil Le; [0055] Q1Q4: four switching devices of H-bridge circuit; [0056] i.sub.e1: current flowing through differential measuring resistor 1; [0057] i.sub.e2: current flowing through differential measuring resistor 2; [0058] i.sub.av: average value of the excitation current; and [0059] I.sub.e: constant value of excitation current converted from zero drift.

Specific Embodiments

[0060] The specific embodiments of the present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. The following embodiments are used to illustrate the present invention, but are not intended to limit protection scope of the present invention.

[0061] The present invention discloses a fluxgate current sensor, comprising a magnetic probe and an excitation and detection circuit, wherein the magnetic probe comprises an excitation iron core and an excitation coil, the excitation coil is connected to the excitation and detection circuit; the excitation and detection circuit is used to output alternating excitation voltages v.sub.e to the excitation coil, and the excitation coil is excited to generate alternating excitation currents i.sub.e and cause the excitation iron core to reach saturation alternately; the excitation and detection circuit is further configured to convert the excitation currents i.sub.e flowing through the excitation coil, into equivalent differences of two currents, i.sub.e1 and i.sub.e2, so as to calculate average values of the excitation currents flowing through the excitation coil via differential equivalent currents i.sub.e1i.sub.e2, thereby calculating to-be-measured primary currents I.sub.d by the average values of the excitation currents, and the differential equivalent currents i.sub.e1i.sub.e2 are configured to eliminate zero drift of the fluxgate current sensor. Average values of the excitation currents are measured to achieve indirect measurement of to-be-measured primary currents, and the differential equivalent currents i.sub.e1i.sub.e2 are used to calculate average values of the excitation currents so as to eliminate errors caused by zero drift, thereby eliminating errors caused by zero drift to the fluxgate current sensor when to-be-measured primary currents are measured, and improving current measurement accuracy.

[0062] Specifically, as shown in FIG. 1, the present invention discloses a fluxgate-based automotive-grade current sensor 100 (i.e., a fluxgate current sensor), the fluxgate current sensor is used for measuring to-be-measured primary currents I.sub.d, comprising a magnetic probe 1 and an excitation and detection circuit 2, wherein the magnetic probe 1 comprises an excitation iron core and an excitation coil, the excitation coil is used to carry alternating excitation voltages and alternating excitation currents constructed by the excitation and detection circuit, the magnetic probe is connected to the excitation and detection circuit; the excitation and detection circuit comprises a DC voltage source Vdc, an H-bridge circuit and differential measuring resistors, and the differential measuring resistors comprise a Re1 and a Re2; the excitation and detection circuit is used to output alternating excitation voltages v.sub.e to the excitation coil, and the excitation coil is excited to generate alternating excitation currents i.sub.e and cause the excitation iron core to reach saturation alternately; further, the excitation and detection circuit is configured to convert the excitation currents i.sub.e flowing through the excitation coil, into equivalent differences of two currents, i.sub.e1 and i.sub.e2, wherein i.sub.e1 refers to currents flowing through the differential measuring resistor Re1, and i.sub.e2 refers to currents flowing through differential measuring resistor Re2, so as to calculate average values of the excitation currents flowing through the excitation coil via differential equivalent currents i.sub.e1i.sub.e2, thereby calculating to-be-measured primary currents I.sub.d by the average values of the excitation currents, and the differential equivalent currents i.sub.e1i.sub.e2 are configured to eliminate zero drift of the fluxgate current sensor. [0063] four switching devices in the H-bridge circuit are controlled to be turned on in pairs alternately, when the switching devices Q1 and Q4 are turned on, the switching devices Q2 and Q3 are turned off; and when the switching devices Q1 and Q4 are turned off, the switching devices Q2 and Q3 are turned on, thereby constructing excitation voltages v.sub.e alternating between positive and negative values at both ends of the excitation coil to excite the excitation coil

[0064] Preferably, a method for controlling the four switching devices in the H-bridge circuit to be turned on alternately in pairs is as follows: [0065] through magnetic performance parameters and dimensions of the excitation iron core calculated, a current threshold I.sub.m for fully saturating the excitation iron core is obtained, wherein the current threshold I.sub.m meets following conditions when the fluxgate current sensor is designed:

[00002] I m > .Math. "\[LeftBracketingBar]" I d / N e .Math. "\[RightBracketingBar]" ,

wherein I.sub.d refers to a to-be-measured primary current, and N.sub.e refers to number of turns of the excitation coil Le; and when a positive current value flowing through the Re1 reaches the current threshold I.sub.m, the switching devices Q1 and Q4 are turned off, the switching devices Q2 and Q3 are turned on, and when a positive current value flowing through the Re2 reaches the current threshold I.sub.m, the switching devices Q2 and Q3 are turned off, and the switching devices Q1 and Q4 are turned on, so as to alternately control the four switching devices in the H-bridge circuit to be turned on in pairs alternatively through a peak value of the positive currents flowing through the Re1 and the Re2.

[0066] The excitation and detection circuit is configured to convert the excitation currents i.sub.e flowing through the excitation coil, into equivalent differences of two currents, i.sub.e1 and i.sub.e2, the differential equivalent currents i.sub.e1i.sub.e2 are constructed as follows: [0067] the four switching devices in the H-bridge circuit are turned on in pairs, and when a switching device on the upper bridge arm of the H-bridge circuit, which means that a switching device on the lower bridge arm of the H-bridge circuit has to be turned on simultaneously, therefore, there is no situation where two switching devices of the upper bridge arm of the H-bridge circuit or two switching devices of the lower bridge arm of the H-bridge are turned on at the same time; to form current loops means that the excitation currents i.sub.e flowing through the excitation coil have to flow through differential measuring resistors Re1 and Re2, and at any time, the excitation currents i.sub.e only flow through a unique differential measuring resistor Re1 or Re2; when the switching devices Q1 and Q4 are turned on, the excitation currents i.sub.e flow through the Re1, and at this time, the excitation currents i.sub.e are defined to flow in a same direction as a current direction in the Re1, and when the switching devices Q2 and Q3 are turned on, the excitation currents i.sub.e flow through the Re2, the excitation currents i.sub.e flow in an opposite direction to a current direction in the Re2, so the excitation currents i.sub.e are equal to the differential equivalent currents i.sub.e1i.sub.e2, i.e., i.sub.e=i.sub.e1i.sub.e2.

[0068] When the H-bridge circuit works, excitation voltages and excitation currents in the excitation iron core change as follows. In order to simplify calculation, the derivation process ignores conduction voltage drops of MOS tubes and the freewheeling diodes in the switching devices of the H-bridge circuit.

[0069] In a circuit as shown in FIGS. 14, when a to-be-measured primary direct current I.sub.d is zero, magnetization curve of an excitation iron core Te of the fluxgate current sensor, an excitation voltage v.sub.e and an excitation currents i.sub.e change as shown in FIGS. 34.

[0070] As shown in FIG. 3, the magnetization curve of the nonlinear excitation iron core Te is in a form of a three-fold line, L and l respectively represent self-inductance coefficients when the excitation iron core Te works in a linear zone and s saturated zone, .sub.S.sup.+ and .sub.S.sup. respectively represent flux linkage coefficients when the excitation core Te just reaches positive saturation and negative saturation, I.sub.S.sup.+ and I.sub.S.sup. respectively represent positive and negative saturation currents of excitation core Te, I.sub.m.sup.+ and I.sub.m.sup. respectively represent positive and negative maximum excitation currents of excitation core Te, and V.sub.H.sup.+ and V.sub.H.sup. represent positive and negative peak values of excitation voltage ve, respectively. Excitation voltage v.sub.e excites nonlinear excitation iron core Te to generate excitation current i.sub.e. When it Is assumed that the circuit parameters are set reasonably, I.sub.m.sup.+=I.sub.m.sup.=I.sub.m, I.sub.S.sup.+=I.sub.S.sup.=I.sub.S V.sub.H.sup.+=V.sub.H.sup.=V.sub.H, and I.sub.m>I.sub.S, so as to ensure that the excitation iron core Te are fully saturated.

[0071] As shown in FIG. 4, the H-bridge circuit works in accordance with following four phases: [0072] Phases 1: it is assumed that MOS tubes in the switching devices Q1 and Q4 are turned on when the fluxgate current sensor is powered on, the excitation iron core Te works in a linear zone A, the excitation voltage at both ends of the excitation coil v.sub.e=V.sub.H.sup.+, and the excitation current in the excitation coil i.sub.e=0; after power-on, the excitation current i.sub.e increases gradually from zero to positive, and the excitation in the nonlinear excitation iron core Te increases gradually, when a positive excitation current increases to i.sub.e=I.sub.S.sup.+, the excitation iron core Te reaches positive saturation; thereafter, the excitation iron core Te works from the linear zone A into a forward saturation zone B, a self-inductance coefficient of an excitation winding W.sub.1 changes from L to l, excitation impedance decreases, and the excitation current increases rapidly until i.sub.e=I.sub.m.sup.+. [0073] Phases 2: at this time, the switching devices Q1 and Q4 are turned off, and since a current in the excitation coil cannot be changed rapidly, positive current thereof flows through the freewheeling diodes in the switching devices Q2 and Q3, and this process can also be regarded as the switching devices Q2 and Q3 are turned on, with a same effect. At this time, the excitation voltage at both ends of the excitation coil is v.sub.e=V.sub.H.sup., the excitation iron core Te works from the forward saturation zone B into forward continuous flow zones C and D, and the positive excitation current i.sub.e continues to decrease until i.sub.e=0, and a diode forward continuous flow process ends. [0074] Phases 3: at this time, the MOS tubes in the switching devices Q2 and Q3 are switchedon, the excitation voltages at both ends of the excitation coil is v.sub.e=V.sub.H.sup., the excitation iron core Te works from the continuous flow zone D into a negative linear zone E and a negative saturated zone F, and a negative excitation current i.sub.e increases until i.sub.e=I.sub.m.sup.. [0075] Phases 4: at this time, switching devices Q2 and Q3 are turned off, and since the current in the excitation coil cannot be changed rapidly, negative current thereof flows through the freewheeling diodes in switching devices Q1 and Q4, and this process can also be regarded as switching devices Q1 and Q4 are turned on because both effect are same. At this time, the excitation voltage is v.sub.e=V.sub.H.sup.+, the excitation iron core Te works from the negative saturation zone F into negative continuous flow zones G and H, and the negative excitation current i.sub.e continues to decrease until i.sub.e=0. At this time, the MOS tubes in the switching device Q1 and Q4 are switched on, and the excitation iron core Te re-enters the linear zone A to work, the excitation iron core Te repeatedly works in zones A to F according to the above working state, and the process from the first phases to the fourth phases is repeated.

[0076] The fluxgate current sensor further comprises an operational amplifier, or an ADC analog-to-digital converter, and a microprocessor MCU, which are connected to the excitation and detection circuit, the operational amplifier, or the ADC analog-to-digital converter, and the microprocessor MCU comprises values for calculating the differential equivalent current i.sub.e1i.sub.e2 and average values of the excitation currents, in a process of obtaining the average values of the excitation currents .sub.av through the differential equivalent currents i.sub.e1i.sub.e2, and the operational amplifier makes gain adjustment, so as to output generated digital signals, the ADC analog-to-digital converter and microprocessor MCU is configured for sampling, and executing operation.

[0077] The differential equivalent currents i.sub.e1i.sub.e2 are configured to eliminate zero drift of the fluxgate current sensor. The zero point drift is caused by an inherent output zero point of the operational amplifier and ADC analog-to-digital converter every time when the fluxgate current sensor is powered on, and the inherent output zero point changes randomly within a certain range, which becomes nonlinear errors of the current sensor.

[0078] A method that the fluxgate current sensor measure to-be-measured primary direct currents I.sub.d, namely a current measurement method, comprising following steps of: [0079] S1designing a fluxgate current sensor, wherein the fluxgate current sensor comprises a magnetic probe and an excitation and detection circuit, the magnetic probe comprises an excitation iron core and an excitation coil, the excitation coil is wound on the excitation iron core, and the excitation coil is connected to the excitation and detection circuit; [0080] S2controlling the excitation and detection circuit to output alternating excitation voltages to both ends of the excitation coil, so that alternating excitation currents are excited to flow in the excitation coil and cause the excitation iron core to reach saturation alternately; [0081] S3conducting difference calculation between currents i.sub.e1 and i.sub.e2 flowing through differential measuring resistors Re1 and Re2, i.e., i.sub.e1i.sub.e2, to obtain current values equivalent to the excitation currents i.sub.e; [0082] S4calculating average values of the excitation current on the excitation coil i.sub.av; and [0083] S5calculating to-be-measured primary DC currents I.sub.d.

[0084] The average excitation currents in the present invention are obtained for the purpose of using average current models of fluxgate technology. The average current models refer to the approximate linear relationship between average excitation currents of the fluxgate current sensor and to-be-measured primary direct currents. Indirect measurement of to-be-measured primary direct currents can be realized by measuring average excitation currents. The basic principle of the average current models has been discussed in many literatures and will not be elaborated in the present invention.

[0085] In the present invention, the differential equivalent currents i.sub.e1-i.sub.e2 are configured to eliminate zero drift of the fluxgate current sensor which has following principles: [0086] 1. Influence of zero drift when average excitation currents are directly calculated by excitation currents i.sub.e

[0087] When the to-be-measured primary direct current I.sub.d is zero, the waveform of the excitation currents 1 of the excitation coil is as shown in FIG. 4, a working period T of excitation currents can be divided into a positive half-cycle TP and a negative half-cycle TN. When it is assumed that the excitation currents i.sub.e at a positive half-cycle TP are positive currents i.sub.ep, and the excitation currents i.sub.e at a negative half-cycle TN are the negative currents i.sub.en, then i.sub.e=i.sub.ep+i.sub.en. In an ideal state, the waveform of excitation currents i.sub.e has a shape at the positive half-cycle is symmetrical to a shape at the negative half-cycle, so average values i.sub.av or of excitation currents i.sub.e in one period are zero.

[0088] However, the operational amplifier and the ADC analog-to-digital converter used in the signal gain adjustment and sampling process will output a varying inherent zero point each time when power is on or external environment changes. When it is assumed that the zero drift generated by output inherent zero point of the operational amplifier and ADC analog-to-digital converter is converted into a excitation current of the excitation coil current equal to a constant I.sub.e, then it can be understood as that each sampled value of each excitation current i.sub.e is equal to each actual value thereof plus the constant I.sub.e, which is equivalent to the curve of the excitation currents in FIG. 4 being translated upward by a distance of the constant I.sub.e.

[0089] Therefore, when the zero drift makes actual values of to-be-measured primary direct currents zero, average values i.sub.av of excitation currents are not equal to zero, namely, i.sub.av=I.sub.e, and calculated values I.sub.dd of to-be-measured primary direct currents I.sub.d are also not equal to zero. So the fluxgate current sensor generates a zero drift error, whose values change each time when power is on and distribute randomly within a certain error range, which cannot be calibrated.

[0090] It is assumed that a rated range of the fluxgate current sensor is 500 A, as a rule of thumb, errors caused by the above zero drift are about 1/10000 of the rated range of the fluxgate current sensor, namely 50 mA. Therefore, when the fluxgate current sensor adopts the method of obtaining the average excitation currents through the excitation currents i.sub.e, the fluxgate current sensor will not be able to measure small currents less than 50 mA, thus affecting identification and measurement accuracy of small currents of the fluxgate current sensor. [0091] 2. Influence of zero drift when average excitation currents are calculated by differential equivalent currents i.sub.e1i.sub.e2

[0092] The four switching devices in the H-bridge circuit of the present invention are turned on alternately in pairs, and one switching device on the upper bridge arm of the H-bridge circuit has to be turned on at the same time as one switching device on the lower bridge arm of the H-bridge circuit. Therefore, there is no case that the two switching devices of the upper bridge arm of H-bridge circuit or the two switching devices of the lower bridge arm of H-bridge circuit are switched on at the same time, the excitation currents i.sub.e flowing through the excitation coil have to flow through the differential measuring resistors Re1 and Re2 to form current loops, and at any time, the excitation currents i.sub.e only flow through the only differential measuring resistor Re1 or Re2. When the switching devices Q1 and Q4 are switched on, the excitation currents i.sub.e flow through the differential measuring resistor Re1, and a direction of excitation currents a i.sub.e are defined to be the same as a direction of currents in the differential measuring resistor Re1. When the switching devices Q2 and Q3 are switched on, the excitation currents i.sub.e flow through the differential measuring resistor Re2, and a direction of the excitation currents is opposite to a direction of currents in the differential measuring resistor Re2. Therefore, the excitation currents i.sub.e are equal to differential equivalent currents i.sub.e1i.sub.e2, namely i.sub.e=i.sub.e1i.sub.e2 The excitation currents i.sub.e flowing through the excitation coil are equivalent to difference values between two currents i.sub.e1 and i.sub.e2 via the differential measuring resistors, Re1 and Re2.

[0093] FIG. 5 and FIG. 6 show current waveforms flowing through the differential measuring resistors Re1 and Re2 in one cycle, respectively, and by comparing the excitation current waveform shown in FIG. 4, it can be seen that positive excitation currents i.sub.ep are converted into positive currents i.sub.ep1 in Re1 and negative currents i.sub.ep2 in Re2 through the differential measuring resistors, and negative excitation currents i.sub.en are converted into positive currents i.sub.en2 in Re2 and negative currents i.sub.en1 in Re1 through the differential measuring resistors, then following equations are derived:


i.sub.ep=i.sub.ep1i.sub.ep2(1),


i.sub.en=i.sub.en1i.sub.en2(2), and


i.sub.e=i.sub.ep+i.sub.en=i.sub.ep1+i.sub.en1+i.sub.ep2i.sub.en2=(i.sub.ep1+i.sub.en1)(i.sub.ep2+i.sub.en2)=i.sub.e1i.sub.e2(3), wherein

[0094] i.sub.ep1 and i.sub.en1 are currents flowing through the differential measuring resistor Re1, while i.sub.ep2 and i.sub.en2 are currents flowing through the differential measuring resistors Re2. As can be seen from equation (3), the excitation currents i.sub.e of the excitation coil are equal to differences between currents i.sub.e1i.sub.e2 flowing through the differential measuring resistors Re1 and Re2.

[0095] As can be known from the above description, the present invention uses the differential measuring resistors Re1 and Re2 to convert the positive excitation currents i.sub.ep into the positive currents i.sub.ep1 and the negative currents i.sub.ep2, and the negative excitation currents i.sub.en into positive currents i.sub.en2 and negative currents i.sub.en1, which provides necessary conditions for eliminating zero drift of the fluxgate current sensor by calculating average excitation currents through the differential equivalent currents.

[0096] When the to-be-measured primary direct currents I.sub.d are zero, it is assumed that the zero drift generated by output inherent zero point of the operational amplifier and ADC analog-to-digital converter is converted into a excitation current of the excitation coil equal to a constant I.sub.e, which is equivalent to that current curves of current i.sub.e1 and i.sub.e2 in the differential measuring resistors Re1 and Re2 in FIG. 5 and FIG. 6 are translated upward by a distance of the constant I.sub.e.

[0097] However, as positive excitation currents i.sub.ep are converted into positive currents i.sub.ep1 and negative currents i.sub.ep2, when it is assumed that sampling points on both positive currents i.sub.ep1 and negative currents i.sub.ep2 in obtaining a positive average excitation currents i.sub.avp in a cycle are constants N, then sampling values on positive) currents i.sub.ep1 are from i.sub.ep11 to i.sub.ep1N, sampling values of negative currents i.sub.ep2 are from i.sub.ep21 to i.sub.ep2N, and following equation (4) can be obtained:

[00003] i avp = [ ( i ep 11 + I e ) + ( i ep 12 + I e ) + .Math. ( i ep 1 N + I e ) ] 2 N - [ ( i ep 21 + I e ) + ( i ep 22 + I e ) + .Math. ( i ep 2 N + I e ) ] 2 N = ( i ep 11 + i ep 12 + .Math. i ep 1 N ) - ( i ep 21 + i ep 22 + .Math. i ep 2 N ) 2 N . ( 4 )

[0098] As can be seen from equation (4), when a positive average excitation current i.sub.avp in a cycle is calculated, constants I.sub.e in both the positive currents i.sub.ep1 and the negative currents i.sub.ep2 offset with each other in the process of calculating difference values, excitation current errors I.sub.e caused by the zero drift do not affect calculation of the positive average excitation current i.sub.avp, and there is no zero drift error.

[0099] Similarly, negative excitation currents i.sub.en are converted into positive currents i.sub.en2 and negative currents i.sub.en1, when it is assumed that sampling points on both positive currents i.sub.en2 and negative currents i.sub.en1 in calculating a negative average excitation current i.sub.avn in a cycle are constants N, and sampling values of negative currents i.sub.en1 are from i.sub.en11 to i.sub.en1N, and sampling values of the positive currents i.sub.en2 are i.sub.en21 to i.sub.en2N then equation (5) can be obtained as follows:

[00004] i avn = [ ( i en 11 + I e ) + ( i en 12 + I e ) + .Math. ( i en 1 N + I e ) ] 2 N - [ ( i en 21 + I e ) + ( i en 22 + I e ) + .Math. ( i en 2 N + I e ) ] 2 N = ( i en 11 + i en 12 + .Math. i en 1 N ) - ( i en 21 + i en 22 + .Math. i en 2 N ) 2 N , ( 5 )

[0100] As can be seen from equation (5), when a negative excitation average current i.sub.avn in a cycle is calculated, constants I.sub.e in the positive currents i.sub.en2 and the negative currents i.sub.en1 offset with each other in the process of calculating difference values, so excitation current errors I.sub.e brought by the zero drift does not affect calculation of the negative average excitation current i.sub.avp and there is no zero drift error.

[0101] Though equation (4) and equation (5), the positive average excitation current i.sub.avp and negative average excitation current i.sub.avn in one cycle are obtained, and an average excitation current i.sub.av, in one cycle is obtained, i.e., i.sub.av=i.sub.avp+i.sub.avn.

[0102] Further, according to the average excitation current i.sub.av, a calculated value I.sub.dd of a to-be-measured primary direct current I.sub.d can be obtained, namely I.sub.dd=i.sub.avN.sub.e, wherein N.sub.e is number of turns of the excitation coil Le.

[0103] When a to-be-measured primary direct current is zero, in an ideal state, a positive average excitation current i.sub.avp and a negative average excitation current i.sub.avn are equal in numerical value but opposite in direction. Therefore, an average value i.sub.av of excitation currents i.sub.e in one cycle is equal to zero, and a calculated value I.sub.dd of the to-be-measured primary direct current I.sub.d is also equal to 0.

[0104] From the above derivation, it can be seen that errors caused by zero drift can be eliminated by calculating average excitation currents through differential equivalent currents i.sub.e1i.sub.e2, and then errors caused by zero drift to the to-be-measured primary direct currents of the fluxgate current sensor can be eliminated.

[0105] The rated range of the fluxgate current sensor in the present invention is 500 A, and according to actual test results, after calculating average excitation currents through differential equivalent currents i.sub.e1i.sub.e2, the fluxgate current sensor developed by the present invention is able to detect small currents of 5 mA, has a current resolution of 2 mA, and achieves improved resolution and detection accuracy of small currents, compared with those adopting the method of directly calculating average excitation currents by excitation currents i.sub.e. In addition, the technical solutions of the present invention can be applied to leakage current sensors, so as to detect micro-currents which have current levels around 1 mA. Leakage current sensor developed by the present invention can detect a micro-current of 1 mA, and the small current recognition degree and measurement accuracy of the leakage current sensor are improved through the technical solutions of the present invention.

[0106] FIG. 7 shows error test results of the fluxgate current sensor developed according to technical solutions of the present invention, wherein currents measured has a range: 500 AI.sub.d+500 A, temperatures measured range from 40 to 85, errors refer to relative errors, expressed in percentage, and maximum permissible errors are and test results show that full temperature range and full measurement range meet requirements, and errors basically fall within 0.2%.

[0107] Please refer to FIG. 8 which is a schematic diagram of a hardware structure of an electronic device provided by an embodiment of the present invention. As shown in FIG. 8, an embodiment of the present invention provides an electronic device comprising a memory 1310, a processor 1320, and a computer program 1311 stored on the memory 1310 and running on the processor 1320, and the processor 1320 executes the computer program 1311 to implement following steps: [0108] S2controlling the excitation and detection circuit to output alternating excitation voltages to both ends of the excitation coil, so that alternating excitation currents are excited to flow in the excitation coil and cause the excitation iron core to reach saturation alternately; [0109] S3conducting difference calculation between currents i.sub.e1 and i.sub.e2 flowing through the Re1 and the Re2, i.e., i.sub.e1i.sub.e2, to obtain current values equivalent to the excitation currents i.sub.e; [0110] S4calculating average values of the excitation currents on the excitation coil, i.sub.av; and [0111] S5calculating the to-be-measured primary DC currents, I.sub.d;

[0112] Please refer to FIG. 9 which is a schematic diagram of a computer-readable storage medium provided by an embodiment of the present invention. As shown in FIG. 9, the present embodiment provides a computer-readable storage medium 1400, comprising a computer program 1411 stored thereon, wherein when the computer program 1411 is executed by the processor to realize following steps: [0113] S2controlling the excitation and detection circuit to output alternating excitation voltages to both ends of the excitation coil, so that alternating excitation currents are excited to flow in the excitation coil and cause the excitation iron core to reach saturation alternately; [0114] S3conducting difference calculation between currents i.sub.e1 and i.sub.e2 flowing through the Re1 and the Re2, i.e., i.sub.e1i.sub.e2, to obtain current values equivalent to the excitation currents i.sub.e; [0115] S4calculating average values of the excitation currents on the excitation coil, i.sub.av; and [0116] S5calculating the to-be-measured primary DC currents, I.sub.d.

[0117] It should be noted that, in the foregoing embodiments, descriptions of each embodiment have their own emphases, and for parts that are not described in detail in a certain embodiment, reference may be made to relevant descriptions of other embodiments.

[0118] Those skilled in the art should understand that the embodiments of the present invention may be provided as methods, systems, or computer program products. Accordingly, the present invention can take forms of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention may take forms of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storages, CD-ROM, optical storages, etc.) having computer-usable program code embodied therein.

[0119] The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatuses (systems), and computer program products according to embodiments of the present invention. It should be understood that each procedure and/or block in the flowcharts and/or block diagrams, and a combination of procedures and/or blocks in the flowchart and/or block diagram can be realized by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded computer, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing equipment are used to realize functions specified in one or more processes of the flowchart and/or one or more blocks of the block diagram device.

[0120] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data-processing device to work in a particular manner, so that instructions stored in the computer-readable memory to produce a manufacturing product including an instruction device that implements the functions specified in a flow chart or flow chart and/or a box or boxes of a block diagram.

[0121] These computer program instructions may also be loaded onto a computer or other programmable data processing device, causing a series of operational steps to be performed on the computer or other programmable device to produce a computer-implemented processing, so that instructions executed on a computer or other programmable device provide steps to implement functions specified in a process or processes in a flowchart and/or a box or boxes in a block diagram.

[0122] While preferred embodiments of the present invention have been described, additional changes and modifications can be made to these embodiments by those skilled in the art once basic inventive concepts of the present invention are understood. Therefore, it is intended that appended claims be construed to cover the preferred embodiment as well as all changes and modifications which fall within protection scope of the present invention.

[0123] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from spirit and scope of the present invention. Thus, provided that these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.