Abstract
This paper presents a new digital fluxgate current sensor based on second harmonic detection for DC and AC measurement. The sensor utilizes a feedback loop to obtain an almost zero-flux condition, i.e., a balance between the magnetic flux of the primary current and the feedback current, in which way the feedback current is proportional to the primary current. The AC magnetic flux is detected with an induction coil, and the DC zero-flux condition is realized by magnetic saturation effect method, where the magnetic core is periodically magnetized and then the second harmonic of the magnetization current is calculated as an indication of the DC magnetic flux. After theoretical derivation, the operating principle of the sensor was investigated using a numerical simulation model built with Simulink of MATLAB. In addition, a prototype sensor was developed and tested. The experiment results demonstrate that the current sensor works properly for DC and AC measurement. The average error is about 0.06% for DC measurement.
Introduction
Measurement of electrical currents are required in many industrial and laboratory applications. In the past decays, different methods for measuring electrical currents have been studied and developed. The most widely used electrical current sensors includes shunt resistors, magnetic field sensor based transducers, current transformers, fluxgate current sensor and Rogowski coils et al. Detailed discussions about the comparison of these transducers can be found in ref [1–3]. Suitable current sensor should be chosen for a specified application based on the current characteristics and the measurement requirements.
Thanks to its excellent linearity and accuracy, high-accurate fluxgate current sensors are widely used in applications such as precision control of current, motion, power and magnetic field etc. And it also widely used in medical equipment. The most significant advantages of this kind of sensor are good linearity, excellent precision and large range of current measurement. The basic operating principle of the sensor is based on the detection of the saturation state of a magnetic circuit. This kind of sensor operates under closed-loop conditions and it uses its own ring core as a magnetic field detector [4]. The high accuracy of this type device is achieved by obtaining an almost zero-flux condition, i.e., a balance between the magnetic flux of the primary current and the feedback current. Thus, coils are used in the sensor to detect the zero flux state of the core and it is crucial to accurately detect the zero-flux condition. For AC current, an electromagnetic induction signal is generated in an AC detection coil by the current and the zero-flux condition is detected based on electromagnetic induction principle [5]. However, this principle does not work for DC current. The DC signal does not produce an electromagnetic induction voltage signal in the induction coil. Precision measurement of DC zero-flux condition is usually realized by magnetic saturation effect method. This method generally uses two magnetic cores, which are magnetically saturated alternatively in opposing directions by the current in the excitation coils. Then the difference of the currents in the two coils is monitored, which is associated with the DC magnetic flux in the cores [6,7]. The drawback of this method is that it requires two identical cores and coils, which is challenging to prepare. The difference between these two cores and coils will cause an error in the result and affect the accuracy of the measurement.
This paper presents a new design of digital fluxgate current sensor based on second harmonic detection that uses only one magnetic core. It greatly reduces the fabrication complexity of fluxgate current sensors.
Operating principle
The diagram of the fluxgate current sensor is shown in Fig. 1. The current to be measured I P flows through a circular magnetic core, on which a DC modulation coil (coil 1), a feedback coil (coil 2) and an induction measurement coil (coil 3) are wound.

Diagram of digital fluxgate current sensor.
A square wave with frequency f is generated by the micro controller unit (MCU) and then connected to the coil 1. The core is magnetically saturated periodically by this square wave. Assume the current driven through coil 1 is I
e
. In zero-flux condition, the core is magnetized similarly in the positive and negative half period. So, the positive and negative half period of I
e
is symmetry, as the blue curve shown in Fig. 2(a). Consequently, if we shift the I
e
by a half period and then sum it with the original I
e
, as Eq. ((1)) shown, the resulted signal I
s
= 0.

(a) the excitation current of the excitation coil I e and (b) I s calculated according Eq. (1) verse time with and without DC magnetic bias field in the core.
As shown in Fig. 1, a micro controller unit (MCU) is utilized to detect the second harmonic of I
s
. Firstly, the waveform of I
e
is obtained by digitalization of the voltage on the resistor R1 (VR1) with a high-resolution analog to digital converter (ADC). Secondly, the I
s
is calculated according Eq. (1) by the MCU. Thirdly, the I
s
is demodulated with a 2f cosine signal as Eq. (2) shown resulting in a voltage signal V
sh
.
Next, the signal V
sh
is filtered by a low pass filter with cutoff frequency much lower than 2f resulting in a value that is linearly proportional to the amplitude of the second harmonic of I
s
, which is proportional to the DC magnetic field in the core. Therefore, the output of the digital to analog converter (DAC) V1 is written as Eq. (3).
In addition to the DC magnetic flux detection, the AC magnetic flux is detected by the coil 3. According to Faraday’s low, the AC voltage signal (V2) is written as Eq. (4).
Substitute Eq. (3) and (4) into (5):
Assume the gain of the power amplifier is A
p
, then the feedback current I
f
is written as Eq. (7).
The I
h
is a constant error term with period T, which can theoretically be subtracted by the MCU. Equation (8) is a close loop proportional integral (PI) controller. Consequently, if k ≫1, then
It is seen that the I P is linearly correlated with I f meaning the I P can be measured by monitoring I f . Therefore, the I P is measured by the MCU digitally and can be transferred to user through a digital connection.
The operating principle of the fluxgate current sensor was numerically studied with a model constructed with Simulink of MATLAB. The diagram of the simulation model is shown in Fig. 3. The transfer function of the low pass filter was set as Eq. (1) shown, where the cutoff frequency was 1.92 kHz. The transfer function of the high past filter was H2 as shown in Eq. (11). The values of the resistors R2, R3 and R4 were 3.32 kΩ, 15 kΩ, 15 kΩ respectively. The value of capacitor C
f
was 50 nF. The gain N2 and N3 were set as 2000 and 600 respectively.
The current ratio I
P
∕I
f
of the current transducer is written as Eq. (12). If
Firstly, the operating principle of the sensor was numerically validated. The input signal I
P
was a triangular wave with frequency 1kHz and amplitude 1 A, as shown in Fig. 4 (a). The curve of the output current I
f
was as shown in Fig. 4 (b). It is seen that the output current is also a triangular wave, of which the frequency is identical as the input current and the amplitude is 5 ×10−4 A. The current ratio

Diagram of the simulation model.

The input and output curves of the close loop control system.
Next, the bode plot of the sensor was calculated. As shown in Fig. 5, the operating frequency range of the sensor is from 0 Hz to about 10 MHz with the current ratio about 5 ×10−4 This is the theoretical operating frequency range. However, it should be noticed that in realistic, much more parameters of the coils and the circuits should be considered, which may limit the frequency range.

The bode diagram of the close loop control system.
A prototype sensor was designed and tested experimentally. The circuit diagram of the prototype sensor is as shown in Fig. 6. A photo of the prototype sensor is shown in Fig. 7. The diameter of the cooper wire of the coils was 0.41 mm. The number of turns of the low frequency coil, feedback coil, and high frequency coil were 250, 600 and 600 respectively. An ultra-low-power microcontroller MSP430f5529 from Texas Instruments was utilized as the digital controller. The microcontroller features a powerful 16-bit RISC CPU, 16-bit registers, and constant generators that contribute to maximum code efficiency. A low noise, low power, high speed, 20-bit, 1.8 MSPS precision successive approximation register analog-to-digital converter (ADC) AD4020 was employed to digitalize the signal. After second harmonic calculation, the output voltage was generated by a 16 bit digital-to-analog converter DAC8871. The cutoff frequency of the low pass filter was set about 344 Hz.

Diagram of the experiment setup.

Pictures of (a) the magnetic core with coils and (b) the circuit boards.
Firstly, DC characteristic of the sensor was tested. The primary current was generated by a DC source. The feedback current flowed through a 2.5 Ω measurement resistor and the voltage on the resistor was measured with a Keithley 2000. The experiment result of DC measurement is presented in Table 1. It is seen that the current sensor works properly for DC measurement. The average error is 0.0594%.
Experiment result of DC measurement of the prototype sensor
Next, DC and AC currents were measured simultaneously by the sensor. The primary current was generated by a large current power amplifier, the waveform of which was controlled by a digital waveform generator The voltage on the measurement resistor (R m ) was measured by an oscilloscope Tektronix MSO54 Then the voltage was divided by the value of R m and multiplied by the theoretical current ratio of the sensor. The resulted waveform of an AC sinusoid current without DC offset is shown in Fig. 8(a). Meanwhile, the output current waveform of an AC sinusoid current with DC offset is shown in Fig. 8(b). The frequency and amplitude of the AC signal were 1 kHz and 16 A respectively. The DC offset in Fig. 8(b) was 6 A. It is seen that this sensor is capable of measuring DC and AC simultaneously.

Measured current waveform of a current without (a) and with (b) DC bias.
This paper presented a new design of digital fluxgate current sensor based on second harmonic detection. Compared with traditional fluxgate current sensors based on second harmonic detection technique, this sensor uses only one low frequency magnetic core, whereas the performance is expected to reach the same level. It greatly reduces the fabrication complexity of the fluxgate current sensor. The operating principle of the sensor was analyzed and simulated with a Simulink model. In addition, a prototype sensor with high resolution ADC, DAC and MCU was designed and tested. Both the simulation and experimental results demonstrated the feasibility of the new sensor design. It is shown that the average error of the prototype sensor for DC measurement is 0.0594%, which is comparable with the state of art fluxgate current sensor. The sensor is capable of measuring DC and AC simultaneously. However, it should be noticed that much more extensive study should be conducted before field application. Several key specifications, including the linearity, small-signal bandwidth, ratio stability under full load, magnetic error, and temperature coefficient, still need be characterized.
