Fluxgate PDF
Fluxgate PDF
The aim of this bachelor thesis is to summarize the general principle of uxgate
magnetometer with relevant physical and engineering knowledge, give an overview of
current space-born instruments and design and build simple magnetometer capable
of terrestrial measurement of sun-triggered activity of Earth's magnetic eld. The
design accents low cost, circuit's simplicity, digital implementation and usage of
accessible components. Complete description of the manufacturing process is given.
Název práce:
Návrh a konstrukce uxgate magnetometru pro vesmírný výzkum
Autor: Roman Pavelka
Obor: Inºenýrská informatika
Druh práce: Bakalá°ská práce
Vedoucí práce: Ing. Pavel M. Trávní£ek, Ph.D.
Space Plasma Group
Astronomický ústav Akademie v¥d R
Konzultant: Ing. Josef Blaºej, Ph.D.
Fakulta jaderná a fyzikáln¥ inºenýrská
eské vysoké u£ení technické
Abstrakt:
I thank my friend Petr Waschinger for helping me to get into the world of mi-
crocontrollers, providing me various electronic material, for moral support and for
our invaluable technical discussions. Also I would like to thank Jakub Kákona for
providing me their great kit MLAB and for sharing his knowledge with others.
I would like to acknowledge Prof. Ing. Pavel Ripka, CSc. for our discussion, which
gave me a lot, and for providing me his comprehensive book Magnetic Sensors and
Magnetometers. I also appreciate valuable discussion with Ing. Jaroslav Pavel
about general electronics design. I thank Pavel Hude£ek for insightful advices and
his idea to optically interface driving electronics. I'm grateful to Mat¥j Laitl for his
invaluable help with GNU/Linux, especially for introducing me Gentoo distribution
and for a plenty of various programming knowledge and tricks, which he taught me.
Also I thank Ing. Josef Voltr, CSc. and Ing. David Vyhlídal for their help with
microcontroller-peripheries interfacing.
I would like to thank Bc. Adam Winsdor for reading the text, drawing gures
4.2, 4.3 and 4.4, taking all used photographies and teaching me some useful image
manipulation tricks. Also I would thank Petr Vála, Bc. Mirek Zima, my father
Ing. Roman Pavelka, PhD. and others who read this text and helped me to correct
mistakes.
I thank my family for all their support and understanding.
Contents
1 Introduction 6
2 Goals 7
3 Physical background 8
3.1 Magnetic eld . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
3.2 Magnetic materials . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
3.3 Transformer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
4 Principle and basics of uxgate magnetometers 12
4.1 Non-linear transformer . . . . . . . . . . . . . . . . . . . . . . . . . . 12
4.2 Dierential measurement . . . . . . . . . . . . . . . . . . . . . . . . . 13
4.3 Feedback measurement . . . . . . . . . . . . . . . . . . . . . . . . . . 15
4.4 Materials for uxgate sensors . . . . . . . . . . . . . . . . . . . . . . 15
4.5 Sensor designs and multi-axial measurement . . . . . . . . . . . . . . 16
5 Successful instruments, proposed designs and trends 18
5.1 Ørsted magnetometers . . . . . . . . . . . . . . . . . . . . . . . . . . 18
5.2 THEMIS magnetometers . . . . . . . . . . . . . . . . . . . . . . . . . 20
5.3 Other designs and trends . . . . . . . . . . . . . . . . . . . . . . . . . 21
6 Design and prototyping 22
6.1 Approach . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
6.2 Prototyping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
6.3 Control unit and communication interface . . . . . . . . . . . . . . . 23
6.4 Drive electronics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
6.5 Sense electronics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
6.6 Sensor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
6.7 Firmware, software and operational procedure . . . . . . . . . . . . . 29
7 Testing 32
8 Conclusion 37
Bibliography 38
A Content of enclosed CD-ROM 40
B Used software 41
Chapter 1
Introduction
6
Chapter 2
Goals
7
Chapter 3
Physical background
where R = r − l. Expressing the divergence and the curl of the formula (3.1) we
can write laws of magnetism in form
∇ · B = 0, (3.4)
∇ × B = µ0 j. (3.5)
j stands for the overall current density including free currents, bound currents, which
are results of electromagnetic properties of matter, and the Maxwell displacement
current 0 ∂E/∂t. The variable magnetic eld generates an electric eld given by
Faraday law of induction
∂B
∇×E=− . (3.6)
∂t
We deneR the inductance L for a current loop, which induces an overall magnetic
ux Φ = S B · S by a current I
Φ = LI (3.7)
8
For a system of current loops 1, ..., k we dene the inductance matrix Lij to express
a coupling between loops. The ux through the i-th loop is obtained as a sum of
uxes generated by currents in our system
k
(3.8)
X
Φi = Lij Ij .
j=1
Lij are for i = j called self inductances and for i 6= j mutual inductances. Taking
the derivative of (3.8) and the induction law (3.6), we obtain dynamic denition of
inductance, useful for circuit analysis,
k
dIj
(3.9)
X
Ui = − Lij .
j=1
dt
9
Figure 3.1: Common steel magnetization curves, credit: Wikipedia[18]
3.3 Transformer
We will use introduced theory to explain principle of a transformer. Our system
consists of two windings on a cylindrical core. One winding is called the primary,
has N1 turns and is connected to a resistor R1 and a voltage source U1 (t) in series.
Secondary winding with N2 turns is connected to a resistor R2 with a voltmeter in
parallel. The problem is sketched in gure 3.2.
10
For long solenoids with volumes V and no ux leakage, we can approximate [17]
Li = µr µ0 Ni2 V, M = µr µ0 N1 N2 V. (3.16)
Problem is transformed into a set of rst order ordinary dierential equations and
can be solved numerically.
If we assume R2 → +∞ (open circuit), we can set the second current zero and keep
constant the product Uind (t) = −R2 I2
dI1
U1 (t) − R1 I1 − L1 = 0, (3.17)
dt
dI1
M = Uind (t). (3.18)
dt
With solution
M
Uind (t) = (U1 (t) − R1 I1 ). (3.19)
L1
Assuming R1 = 0 and idealized inductances (2.15), we obtain well-known formula
for transformer with open secondary winding
N2
Uind (t) = U1 (t). (3.20)
N1
We assumed the full ux through both windings, but real transformers have some
ux leakage. This is the reason for high permeable cores keeping the most ux in
their volume and thus lowering a transfer loss. Saturation limits maximal power,
which the transformer is capable to eciently transfer. Those and other aspects are
analyzed in the publication [17].
11
Chapter 4
Principle and basics of uxgate
magnetometers
12
Assuming Hext constant, we can rewrite the mechanism to
dHD dI dµr
U (t) ≈ −µ0 N2 S H + µr |H . (4.3)
dI dt dH H
The dependence on the external eld is slightly hidden in permeability and its deriva-
tive parameters.
If we drive the primary winding with a sinusoidal current signal into saturation, we
obtain derivative of induced magnetic ux Φ. Undisturbed output is an odd function
relative to every zero-crossing point. It implies zero second harmonic signal in the
output.
An external magnetizing eld in longitudinal direction disturbs this symmetry be-
cause it shifts the core into the saturation earlier, when we drive it to the same
direction as the external eld, and later for the opposite direction. This brings
a second harmonic signal into the output. It is possible to lter out the second
harmonic, obtain its phase and rectify it to obtain a steady value proportional to
a magnitude of the external eld, but the presence of large original signal complicates
the extraction of measured signal.
13
Figure 4.2: Clockwise: Vacquier's conguration scheme, Φ(I) diagram undisturbed
(dashed) and disturbed (full), disturbed dΦ(I)
dI diagram, Example disturbed waveform
!
d2 µr
dµr |H1 dµr dµr
= H1 ≈ + Hext (HD + Hext ) (4.8)
dH dH H1 dH HD dH 2 HD
and
!
d2 µr
dµr |H2 dµr dµr
=− H2 ≈ − Hext (−HD + Hext ). (4.9)
dH dH H2 dH HD dH 2 HD
First term in parentheses is our signal. For our idealized material and symmetrical
square wave, it is phase synchronized with driving signal and occurs with twice-
frequency of the drive. Second term is more problematical, but simple considerations
for our idealized material shows it is a quick phenomenon, which will disappear after
integration. Further examination is needed for real materials.
To improve sensitivity, we can add more turns to both windings, increase the sensor
cross-section, use faster transition driving signal and high-permeable core with sharp
transition into saturation. It is important to drive the core deep into saturation.
14
The output signal is present when permeability is changing (linear/saturated tran-
sition) and is proportional to the asymmetry introduced by the external eld. The
sign is determined by a current direction, an external eld orientation and by the
core transition in/out of the saturation.
One way of output processing is the second harmonic demodulation. We integrate
the signal only in moments of positive polarity of the output signal for chosen ex-
ternal eld orientation. Measuring electronics needs to be phase synchronized with
driving electronics. This principle is drawn in gure 4.3.
15
Figure 4.4: Second harmonic demodulation uxgate magnetometer with feedback mea-
surement
Also low structural imperfections, uniform properties, low deformations and low
mechanical stress decrease sensor oset and improve stability.[15]
16
Bi-axial magnetometer can be implemented by the ring core design with two or-
thogonal sense windings. Tri-axial measurement is more complicated. Multiple ring
cores in an orthogonal layout are used. Figure 4.6 shows example of a successful
design.
17
Chapter 5
Successful instruments, proposed
designs and trends
18
Figure 5.1: One channel of Ørsted uxgate magnetometer electronics,
credit: Nielsen et al.[12]
19
Figure 5.3: Ørsted sense electronics, credit: Nielsen et al.[12]
20
Figure 5.4: THEMIS magnetometer electronics, credit: Auster et al. [1]
21
Chapter 6
Design and prototyping
6.1 Approach
Chosen electronic design exploits digital control of the excitation electronics together
with digital output signal processing. This approach is a compromise between an
analog 2nd harmonic demodulation system and modern digital design implemented
on FPGA, which I am unfortunately not experienced with.
This approach will require digitally interfaced drive electronics, sense amplier, con-
ditioning circuit and fast analog-digital converter (further only ADC ). Simple com-
munication interfaces, as is serial peripheral interface (further only SPI ), are pre-
ferred. Block diagram of this general idea is sketched in gure 6.1.
SPI
Display&UI
ADC ADC
conditioning
Figure 6.1: General idea of digitally controlled 2nd harmonic demodulation uxgate
magnetometer
22
6.2 Prototyping
I used to develop electronic devices by the following procedure. First, all required
abilities and properties of device are written out and a block diagram is sketched.
Then electronics is divided into subsystems with dened tasks. Then again, all
required functions are written out for every subsystem with input and output spec-
ications.
Schematics is designed by hand and the proposed circuit is simulated. I use simple
open source circuit simulator by Paul Falstad [7]. Component values are adjusted
to improve performance and to minimize currents in the system. Then the circuit
is tested on a breadboard and soldered on a prototyping board. SMD components
are preferred because of compactness of the resulting device.
Useful tool is open source electronic construction kit MLAB. It provides reliable and
universal prototyping platform. MLAB kit consists of a base board with 3 mm holes
aligned to 400 mil (0.4 inch, 10.16 mm) grid and set of various modules as power sup-
plies, basic microcontroller circuits of dierent architectures (AVR, PIC and ARM),
their programmers, communication devices, ADC and DAC modules, sensors, hu-
man interface devices and many others. See MLAB homepage for exhausting list
and description of modules [11].
23
cated PC serial port with baud rate 115.2 kBd. Current development stage utilizes
USB232R01B MLAB module. This module is a basic circuit for the FT232RL
USART-USB translator IC. This device has a native Linux driver translating the
communication to a common serial terminal, which appears as a /dev/ttyUSBX de-
vice le (where X stands for 0, 1, 2...). All communication is simplied to reading
and writing this device le. FT232RL module allows baud rate up to 1 MBd.
It is important to disable character echoing and terminal control signals for full
binary data transfer. This together with baud rate setting can be done on PC side
using GNU stty utility:
stty -F /dev/ttyUSB0 1000000 raw -hupcl
See stty manual for details [9]. µC setting is described in rmware section.
µC, communication and programmer modules are supplied from USB +5 V power
line.
Fluxgate magnetometer performs requested action after receiving a specied byte.
Data exchange is implemented as a binary transfer. The whole operation is described
in the last section of this chapter. Block diagram of implemented system is in gure
6.2. Photography of assembled MLAB board is in gure 6.3.
Interfacing Development
bash scope logger kate nano
avr-binutils, avr-gcc
avrdude
stty /dev/ttyUSB0
/dev/ttyUSB1
1 MBd
GNU/LINUX user space
USB232R01B ATprogISPUSB02A
ATX supply
+5V RX TX
+/-12V 1 MBd
RX TX AVR ISP 6pin
Analog supply
USART
+5V +/-8V ATMEGA801B
16 MHz
SPI
pos neg PORTC 1 MHz
Drive Sense
Fluxgate sensor 12-bit ADC
250 kS/s
24
Figure 6.3: Control and communication system with the ADC build from MLAB kit
parts
25
Figure 6.4: Drive electronics
26
Figure 6.5: Sense electronics
6.6 Sensor
The rst sensor was constructed for testing of electronics. It consists of the iron
wire 1.5 mm in diameter, 45 cm long. Excitation winding was winded along its full
length by approximately 400 turns. Then the wire was bended in its half to form
parallel symmetrical pair of long solenoids connected in sharp knee. Then the sense
(pick-up) coil was winded over the excitation pair. See photography in gure 6.6.
Similar sensor is described in the article [4].
27
Figure 6.6: My sensor
28
6.7 Firmware, software and operational procedure
µC is programmed in the C programming language. Its operation can be described
by following pseudocode:
main() {
set_pins_directions();
USART_init(1 MBd, 8 bits, no parity, 1 stop bit,
asynchronous, USART receive interrupt enable);
SPI_init(Master, 1 Mhz);
set_interrupt();
USART_receive_interrupt_routine() {
clear_interrupt;
if (recieved=='a' )
send_waveform();
else if (recieved=='v' )
send_value();
set_interrupt();
}
send_waveform() {
for(j=0;j<32;j++) { // to charge blocking capacitors
for(i=0;i<128;i++) {
drive(i);
_delay_us(5);
}
}
for(i=0;i<128;i++) {
drive(i);
data[i]=SPI_get_ADC_value();
delay_us(4);
}
drive_off();
USART_transmit(data);
}
send_value() {
29
for(j=0;j<32;j++) { // to charge blocking capacitors
for(i=0;i<128;i++) {
drive(i);
_delay_us(5);
}
}
for(i=0;i<128;i++) {
drive(i);
if (i<32) // even harmonic demodulation:
result = result + SPI_get_ADC_value();
else if ( (i>=64) && (i<96) )
result = result - SPI_get_ADC_value();
delay_us(4);
}
drive_off();
USART_transmit(result);
}
drive(i) {
if (i<64) {
negative_drive_pin=0;
positive_drive_pin=1;
} else {
positive_drive_pin=0;
negative_drive_pin=1;
}
}
drive_off() {
positive_drive_pin=0;
negative_drive_pin=0;
}
The actual code is included on the enclosed CD-ROM.
Debugging is possible by simple bash commands (don't forget stty setting described
in the communication section)
cat /dev/ttyUSB0 &
echo -n a > /dev/ttyUSB0
echo -n v > /dev/ttyUSB0
This is simple and powerful tool in combination with output redirecting and utilities
as GNU gnuplot, but it shows it is more comfortable to write two graphing PC pro-
grams. Scope and logger are written in C++ using the qT graphical toolkit to direct
plotting of measured data. (The qT is for its simplicity, programming paradigm,
30
documentation and completeness the best graphical API I have ever worked with.)
The scope periodically asks by sending 'a' for a measured waveform and plots it.
Nothing can be simpler:
void Scope::getData() { // Called every 100 ms
char c='a' ;
data=new char[LEN*sizeof(char)];
dataAquired=1;
update(); // update the screen
}
The logger acts very similarly. By periodically sending 'v' it plots the evolution
of measured value in time. The complete code of both programs is on enclosed
CD-ROM.
31
Chapter 7
Testing
We exit the scope and start the logger. The sensor sends now an integral value.
It can vary in dependence on actual setting of the device everywhere in between
±105 . This is the reason for adjustable parameters shif t and divisor. Graphed
y-coordinate is then computed as
input + shif t
y= (7.1)
divisor
We see two sliders, bigger for setting the shif t (oset) and smaller for the divisor.
First we set the shif t to move the signal level to central horizontal line, than lower
32
the divisor, than again adjust the oset and so on, until the divisor is set to minimal
value 1. Result looks as gure 5.2.
We can verify the basic function by a common fridge magnet being rotated ca 15 cm
from the sensor head. This is a problematical verication because length of our
sensor is large in comparison to magnet's size and its characteristic distance of eld
variation, but we obtained expected result as seen in gure 5.3.
33
Figure 7.3: Turning a small magnet about 15 cm from the head of the sensor
We will try another test. We align the sensor in the east-west direction, null the oset
and we let the sensor turn a full circle. We see we need to set the divisor at least 4.
Result can be seen in gure 5.4.
34
Figure 7.4: The sensor turns one full circle in horizontal plane
First practical experiments revealed an unpleasing fact: the sensor is very sensible
to deformation and stress. Although it was mounted on plastic rule, any movement
of whole setup brings noise to measurement and device parameters are unstable in
time. See gure 7.5 where one horizontal full circle is followed by ve gentle touches
on sensor body. This fact forces us to develop a new sensor.
35
Figure 7.5: The sensor turns one full circle in horizontal plane, then it faces few soft
touches on sensor body
36
Chapter 8
Conclusion
37
Bibliography
[1] AUSTER et al. The THEMIS Fluxgate Magnetometer. Space Sci. Rev. 2008.
[2] AVRDUDE - AVR Downloader/UploaDEr [online]. last revision 8th of January
2010.
URL: <[Link] [cit. 2011-7-16]
[3] AVR Libc Home Page [online]. last revision 16th of February 2010.
URL: <[Link] [cit. 2011-7-16]
[4] BROWN UNIVERSITY. A Simple Fluxgate Magnetometer [online].
last revision 2006. URL: <[Link]
download/attachments/29069/Fluxgate+[Link]?version=
1&modificationDate=1183038899000> [cit. 2011-7-16]
[5] CARR et al. The Double Star magnetic eld investigation: instrument design,
performance and highlights of the rst years observations. Annales Geophysicae.
2005.
[6] DANMARKS METEOROLOGISKE INSTITUT. Øersted mission web page
[online]. last revision 4th of July 2004.
URL: <[Link] [cit. 2011-6-3]
[7] FALSTAD, Paul. Math, Physics, and Engineering Applets [online]. last revision
date not available.
URL: <[Link] [cit. 2011-7-16]
[8] GLASSMEIER et al. The Fluxgate magnetometer of the BepiColombo Mercury
Planetary Orbiter. Planet. Space Sci. 2008.
[9] MACKENZIE, David stty man page [online]. last revision January 2011.
URL: <[Link] [cit. 2011-7-16]
[10] MAUGH, Thomas. Victor Vacquier Sr. dies at 101; geophysicist was a
master of magnetics. [online]. Los Angeles Times, January 24, 2009. URL:
<[Link]
0,[Link]> [cit. 2011-6-3]
[11] MLAB homepage [online]. last revision 16th of July 2011.
URL: <[Link] [cit. 2011-7-16]
[12] NIELSEN et al. Development, construction and analysis of the 'Øersted' ux-
gate magnetometer. Meas. Sci. Technol. 1995
38
[13] PAVELKA, Roman. Atmel AVR development on GNU/Linux [online]. last
revision 5th December 2010.
URL: <[Link]
[cit. 2011-7-16]
[14] PRIMDAHL, Fritz. The Fluxgate Mechanism, Part I: The Gating Curves of
Parallel and Orthogonal Fluxgates. IEEE Trans. Magn. 1970
[15] RIPKA, Pavel, Magnetic Sensors and Magnetometers. Artech House Publish-
ers. ISBN-10: 1580530575. 494 p.
[16] SNARE, Robert. A History of Vector Magnetometry in Space [online]. last
revision date not available.
URL:<[Link]
[Link]> [cit. 2011-6-3]
[17] TOLL, Ivan. Elekt°ina a magnetismus. 2nd edition. Nakladatelství VUT.
2003. 215 p. ISBN 80-01-02693-0.
[18] WIKIMEDIA COMMONS. B-H Loop [online]. last revision 20th May of 2006.
URL:
<[Link] [cit. 2011-6-3]
39
Appendix A
Content of enclosed CD-ROM
40
Appendix B
Used software
Development
• bash GNU Bourne-Again SHell
• nano Nano's ANOther editor, an enhanced free Pico clone
• kate Advanced text editor for KDE
• make GNU make utility to maintain groups of programs
• avr-gcc GNU C Compiler for AVR microcontroller
• avrdude AVR Downloader/UploaDEr
• gnuplot An interactive plotting program
• kicad Open source software suite for electronic design automation
• CicuitSimulator Paul Falstadt's circuit simulation applet
• Qt cross-platform application framework
Publication
• nano Nano's ANOther editor, an enhanced free Pico clone
• kate Advanced text editor for KDE
• LATEX Structured text formatting and typesetting system
• pdatex PDF output front-end for LATEX
• gimp GNU Image Manipulation Program
• pygments Python-based syntax highlighter
41