Technical Note The following article is Open access

A do-it-yourself approach for developing a magnetic field mapping setup using a 3D printer

, , , , and

Published 30 June 2023 © 2023 The Author(s). Published by IOP Publishing Ltd
, , Citation Alexander Omelyanchik et al 2023 Meas. Sci. Technol. 34 107001 DOI 10.1088/1361-6501/acde9b

0957-0233/34/10/107001

Abstract

The mapping of magnetic fields is an important task for characterizing permanent magnets, their systems, and the various devices that use magnets. However, commercial devices for this task are quite expensive and difficult to acquire. In this study, a design process for an automatized magnetic mapping setup utilizing a 3D printer was proposed via a do-it-yourself approach using common parts found in a laboratory. We used a 3D printer for two purposes: to create instrument parts to fix the Hall probe instead of the printer extruder, and to use the same 3D printer as the position controller of the magnetic probe. We describe the device assembly process, including hardware and software aspects. Several tests of the assembled setup were performed on samples with different magnetic texture dimensions from several centimeters (graduated permanent magnet) to tens of micrometers (flexible magnet with a planar Halbach structure and a 5¼ inch floppy disk). The spatial resolution was in the sub-millimeter range. The parameters of the mapping, such as the number of points and data acquisition time, were optimized for such samples.

Export citation and abstract BibTeX RIS

Original content from this work may be used under the terms of the Creative Commons Attribution 4.0 license. Any further distribution of this work must maintain attribution to the author(s) and the title of the work, journal citation and DOI.

1. Introduction

Magnetic materials and devices operating with magnetic fields are widely used in everyday life and in scientific laboratories [13]. For example, the modern smartphone contains several tens of magnetic elements in the speaker, vibration mode motor, geolocation, camera autofocus mechanism, and others [4]. Inside and outside of the laboratory, we find magnetic materials to be indispensable elements in electrical generators, motors, drivers, and many biomedical devices. For researchers, many specific experiments require designed, confirmed, controlled, or measured magnetic fields, i.e. magnetic force and electron microscopy, and particle accelerators, among others. Some magnetic fields are generated explicitly for specific applications, while others are undesired parasitic signals. Independent of the signal type and value, magnetic fields must be measured in laboratories for magnetic-field-affected experiments.

There are several magnetic field sensors for measuring magnetic fields of different intensities, ranging from extremely low biomagnetic signals (∼pT) to around the geomagnetic field (∼μT), and the magnetic field generated by permanent magnets or superconductors (∼T) [5, 6]. There is a wide range of different types of magnetic field sensors, which allow one to measure magnetic field induction in different field ranges; the most commonly used sensors for the high magnetic field range (from mT to T) are based on the Hall effect [7]. The advantages of Hall sensors are their low cost and the possibility to manufacture miniature sensors. While magnetic field sensors are widely available on the market, the systems for mapping the spatial distribution of the magnetic field are rare and quite expensive [8]. The cost of commercial systems for 3D mapping of the magnetic field is more than 25 000 euros [810].

A do-it-yourself (DIY) approach to creating a unique device/setup for experiments or automatizing the experimental process is essential and can be implemented in any laboratory. This method is used in physical, chemical, biological, and multidisciplinary laboratories to become a standard tool for creating new devices and sample holders or restoring broken equipment parts. Over the last decade, the DIY approach has been expanding due to the increasingly available additive manufacturing technologies like 3D printing [11, 12]. Recently, a DIY approach was used to produce magnetic field mappers and map the magnetic fields of radiofrequency coils [13] and stray fields of magnetic resonance imaging devices [14]. For example, Erglis et al used common parts found in laboratories: a motorized microscope platform to move samples in the x,y plane, the z position was manually controlled by a micro screw, and a 3-axis Hall probe was used to measure the magnetic field [8].

This paper aims to demonstrate a cheap and simple DIY approach to realize a device for fully automatized magnetic field mapping in 3D, which uses the mechanical part of a commercially available 3D printer to position the Hall probe. This paper focuses on the strategy to assemble this device and to optimize the working conditions by collecting the magnetic field flux spatial distribution of different objects. This approach can have multipurpose use in laboratories and has a high potential to be scaled and improved, for example, by replacing or adding another type of sensor. Our group has applied this approach to map the magnetic field of assemblies of permanent magnet arrays for cell manipulation and molecule harvesting [1517].

2. Development of setup

2.1. Equipment and software

A DIY kit of a 3D printer, Anet A8 (CTC A8 W5), with an A1284-base mainboard, was used as a base for position control. The kit was purchased from an online store, where different analog kits are available at about one hundred euros [18]. As declared by the manufacturer, the position accuracy is 0.012 mm for the x,y-axes and 0.004 mm for the z-axis. The working area is 220 mm × 220 mm × 240 mm.

For the magnetic induction (B) measurements, we used a Lake Shore gaussmeter model 475 DSP coupled with an axial Lake Shore 400 HSE Hall probe (Lake Shore Cryotronics Inc., USA). Thus, the instrument gives the measurement of the axial component (${B_z}$) of the induction field ${\boldsymbol{B}}$ vector. The probe's sensitivity was lower than 5 milligauss (mG), while the magnetic induction range was up to 35 kG. As reported by the manufacturer, the nominal active area of the sensing element is about 1 mm in diameter. The stem for the Hall probe is made from fiberglass epoxy and has a diameter of 5 mm. It should be noted that the center of the active area of the Hall probe is inside the stem at a distance of 1.9 mm. Therefore, the position of the active area is at a distance of zactive = z + 1.9 mm, where z is the position of the surface of the Hall probe stem. The stem was therefore fixed perpendicularly to the magnet plane. The LabView 8.2 (National Instruments, USA) development environment was used as an interface to control both the 3D printer and the gaussmeter.

2.2. Design and realization

The magnetic mapping setup consists of three components (figures 1(a) and (b)): (i) a personal computer (PC); (ii) a Hall probe connected to the gaussmeter; and (iii) a modified 3D printer (PC-controlled) to drive the probe movements. Serial commands achieve communication with the printer via USB. A Hall probe holder (figure 1(c)) fabricated with the 3D printer replaces the original extruder in which the probe is vertically inserted. Data obtained by the gaussmeter and, simultaneously, the spatial position of the probe, are collected and stored in the PC.

Figure 1.

Figure 1. (a) A scheme of the system and workflow; (b) a picture of the assembled system; and (c) a picture of a test sample (HKCM test-magnet) near the Hall probe.

Standard image High-resolution image

The software program for 3D printer movement control and data acquisition was operated using the LabView platform. The software solution provides a user interface consisting of several blocs (figure 2): (i) settings and checkout of the system; (ii) control of the position of the probe; (iii) the settings of the sequence of the measurement; and (iv) a real-time plot of the result.

Figure 2.

Figure 2. The main window of the program created via LabView.

Standard image High-resolution image

The commands for position control are specified using the numerical control code (G-code) [19]. An example of the G-code, setting the relative position of the probe, and moving the probe along the x-axis, is:

G91; set to relative positioning

G1 X1; move 1 mm along the x-axis

Similarly, one can control the position for the y- and z-axes by replacing 'X1' with 'Y1' and 'Z1', respectively. The step size can be selected, and additional parameters, such as the speed, can be controlled by the command 'Fxxx' that sets it to xxx mm/time unit (the time unit may depend on the printer's firmware, mm/min for Marlin). The movement achievable by a standard commercial printer is about 3000 mm min−1 (usually, at speeds above, the printer starts to shake).

A 'VISA Instrument I/O' interface in LabView sends such commands to the device. The feedback signal is received from a gaussmeter connected to a PC via an IEEE-488.2 GPIB interface for USB (National Instruments). The program solution was obtained using 'LabView Instrument Driver Export Wizard', after installing appropriated drivers provided by LakeShore [20].

Briefly, the software solution consisted of three stacked control statement structures ('for' loop). Each loop defines the position of the probe in one of the planes in the Cartesian coordinate system. Accordingly, the number of iterations and the increment allow one to control the scanning area. At each point, after a delay time (td), required for system stabilization to prevent the effects of both mechanical vibrations (induced by movement) and instrumental time delay, due to the gaussmeter time constant, the data are collected from the gaussmeter. Data collection occurs through an addition 'for' loop. This structure collects the desired number N of values of B from the gaussmeter to average them. The standard deviation (σ) over the N points is also calculated.

It should be noted that the magnetic induction B is a vector with three projections (Bx, By, Bz ), and the Hall probe is only sensitive to one of those projections if it is not a 3-axis probe. There are three basic configurations of probes (figure 3):

  • Axial—usually has a cylindrical shape and measures the axial component of B;
  • Transverse—usually has a rectangular shape and measures perpendicular to the plane component of B ;
  • 3-axis probe—allows measurement of all three components of the magnetic field.

Figure 3.

Figure 3. A schematic presentation of different types of Hall probes.

Standard image High-resolution image

3. Experimental tests

3.1. Optimization of scanning parameters

We used an N35-grade test-magnet (HKCM Engineering e.K., Germany) with a block shape of 20 mm × 40 mm × 5 mm coated with Ni and well-known polarity to calibrate and test the system. The magnet was placed on the surface of the printing bed below the sensor (figure 1(c)). Using both axial and transverse probes in two perpendicular orientations, the three components of magnetic flux density, Bx, By, and Bz , were collected at 4 mm from the magnet surface. Ten measurements of the signal (N = 10) were collected every 100 ms; then, the signal was averaged, and the standard deviation σ was calculated at each point every 2 mm over a rectangular area of 40 mm × 50 mm. The first parameter to optimize was the delay time td between measurements: this parameter was chosen to be equal to 0.1, 2, 5, and 10 s. All the measured Bx, By , and Bz signals are reported in figure 4(a). All the obtained maps depict physically reasonable profiles expected for the axially magnetized magnet, with the maximum value of the Bz component of the magnetic induction of about 1.4 kG under the magnet's edges. A more precise evaluation was achieved by comparison of standard deviation values (figure 4(b)). According to our experiments, for td ⩽ 5 s, σ increases to its maximum, reaching 3%, associated with residual vibrations after the mechanical movement of the probe and a significant time delay in the response of the probe.

Figure 4.

Figure 4. (a) The results of mapping of the HKCM test-magnet at a distance z = 5.9 mm and a step size of 2 mm: Bx, By , and Bz components of magnetic induction with different delay times td. The color scale is the same for all the color fill plots; (b) the averaged standard deviation over ten measurements at each point with different delay times td.

Standard image High-resolution image

The next parameter of the experimental protocol, fixing td = 5 s, is the step size for mapping (figure 5). At first glance, the smaller step size provides a better resolution; however, it dramatically increases the measurement time. For the test-magnet sample (figure 5), a single measurement took around 7, 40, and 170 min for a step size of 5, 2, and 1 mm, respectively. Therefore, this parameter and td should be selected based on the task required and the size of the investigated object. The accuracy of the positioner setup (>0.012 mm for the x,y-axes) and the sensor's active-area size limit the lower spatial resolution. The sensor used in this study was 1 mm2 in size, which provides sub-millimeter resolution. However, qualitative analysis with lower resolution is also possible. In this case, the magnetic flux at each point presents an average value over a region larger than the step size. In section 3.2, we show the mapping with a step size of 0.1 mm.

Figure 5.

Figure 5. The ${B_z}$ component of magnetic induction generated by the HKCM test-magnet at a distance z = 5.9 mm and fixed td = 5 s with different step sizes: (a) 5 mm (measurement time is 7 min), (b) 2 mm (40 min), and (c) 1 mm (170 min).

Standard image High-resolution image

By considering a step size = 2 mm, td = 5 s, and N = 10 s as optimal parameters, we measured the induction B of the HKCM test-magnet at different heights over the magnet (z = 1.9, 5.9, and 9.9 mm). As reported in figures 6(a)–(c), vector B is composed by the three independently measured values of projections Bx, By , and Bz utilizing the axial and transversal probes in two perpendicular orientations. In this case, the magnitude of $B$ is proportional to the length of the arrows because the dimension of the axes is mm (length). The vectors start from the point of measurement in the space ($x,{\text{ }}y,{\text{ }}z$) and the coordinates of the ends of the arrows are (x+ Bx/k, y+ By/k, z+ Bz/k), where k is a scale factor (converting Gauss units into millimeters for visual rendering). Thus, the orientation of arrows shows the orientation of B , and their magnitude is proportional to the intensity of B .

Figure 6.

Figure 6. A 3D vector plot of magnetic field line distribution of the HKCM test-magnet at distances (a) z = 1.9 mm, (b) z = 5.9 mm, and (c) z = 9.9 mm.

Standard image High-resolution image

3.2. Mapping of a complex magnetic field

To demonstrate this approach's applicability to mapping the magnetic field of different objects, we selected a smartphone, a flexible refrigerator (fridge) magnet, and a 5¼ inch floppy disk media. All the samples show a particular magnetic field texture with different magnetic fields and size ranges. We performed all scans at the minimal possible distance (<0.1 mm) above the objects' surface. The most intense component of the magnetic field for this configuration, ${{\text{B}}_{\text{z}}}$, was measured with an axial Hall probe.

The magnetic field of the smartphone is mainly produced by the loudspeakers and vibration mode motor, placed on the upper central and downright part of the device. To overcome the significant difference in the magnitude of signals from different parts, the smartphone magnetic map is presented on a logarithmic scale (figure 7). This example demonstrates the potential of the device for mapping sophisticated macroscopic objects. The maximal scanning area of our device is 220 mm × 220 mm × 240 mm. This area can be increased by extending the frame of the positioner setup (replacing guides with longer ones).

Figure 7.

Figure 7. Magnetic field induction over a smartphone at a distance of 1.9 mm (component of ${\boldsymbol{B}}$ perpendicular to the front panel).

Standard image High-resolution image

To define the device's spatial resolution, the magnetic field of a flexible fridge magnet was measured (figure 8(a)). Typically, this material consists of magnetic ferrite particles embedded into resin [21, 22]. The magnetic structure of the fridge magnet presents planar Halbach arrays that allow increasing magnetic flux from one side of this array [2325]. Figure 8(a) shows a magnetic map of a 10 × 3 mm2 part of the strong side of the Halbach planar array, performed with a step size of 0.1 mm along the x-axis. The upper part presents an average among all y-axis measurements of the field profile along the x-axis for one period of the structure. The signal has a sinusoidal shape with a period of 3.2 ± 0.1 mm and a magnitude of 204 ± 5 G. The corresponding width of one stripe ∼1.6 mm is in the range of 1–2 mm, known for standard flexible-sheet refrigerator magnets [21]. Measurement of this sample with a step size of 0.1 mm gives a reasonable result. The bottom part of figure 8(b) represents a domain structure of a single segment of a standard refrigerator magnet [22]. The magnetic induction vector gradually changes its local orientation along the x-axis [24, 26]. The measured Bz component was fitted with a sinusoidal function, which describes the behavior of the rotating vector of the magnetic induction well.

Figure 8.

Figure 8. (a) The Bz component of the magnetic field induction measured over the surface of the strong side of a fridge magnet (z = 1.9 mm); (b) the 1D-profile of Bz measured along the x-axis (y = 0 mm, z = 1.9 mm), and an illustration of a single segment of the Halbach planar array (longer arrows show magnetization of the domains; the smaller arrows show the magnetic induction vector on the surface of the strong side of the array).

Standard image High-resolution image

To demonstrate the possibility of further scaling of the system to measure at lower dimensions, a 10 mm × 10 mm area of the 5¼ inch floppy was mapped with a resolution of 0.1 mm (figure 9). The size of magnetic domains representing bits of information is of the order of tens of micrometers [27], which is lower than the sensor's resolution. However, the map shows distinguished areas with periodicity, probably resulting from several bits of information. Moreover, a clear stripe with a thickness around 0.4 mm was detected, presumably corresponding to a sector on the disk. The amplitude of the magnetic field was about 0.3 G; that is, the order of magnitude of the ambient magnetic field, which was subtracted. To accurately measure magnetic fields below ∼1 G in the position controller, it is necessary to replace metallic parts made of magnetic materials (e.g. steel) with non-magnetic materials and insulate the environment's magnetic fields.

Figure 9.

Figure 9.  A Bz map of a floppy disk media (z = 1.9 mm).

Standard image High-resolution image

4. Conclusion and further perspectives

In this work, a method to automatize magnetic field mapping utilizing a 3D printer and a DIY approach to map the static magnetic field of a given 3D region with a sub-millimeter lateral resolution is presented. The printer was used in the first step to produce several parts of the device and transformed into the computer-controlled Hall probe positioner. The process was fully automatized using the LabView environment. As an alternative to commercial LabView, a free Python or other languages can be used, and simpler magnetic field sensors (with a cost of a few tens of euros) and an Arduino card can be implemented. Thus, the total cost of this device will be less than 200 euros.

The operational conditions of the created mapper were optimized and validated using a test-magnet of well-known magnetization. Then, the scaling was demonstrated by mapping samples generating more complex magnetic fields. The spatial resolution was found to be on the order of hundreds of micrometers and with sensitivity to a magnetic field magnitude of less than one Gauss. Lower resolution can be expected if sensors with a smaller active area are used. This setup has already been used to map assemblies of small permanent magnets for biomedical applications [15]. This approach may find applications in many other areas, for example, to study the micropatterned electromagnetic or micromagnetic structures for magnetophoretic technology [28, 29]. Moreover, the Hall probe can be replaced by another sensor or additional sensors can be added for multiparametric spatial analysis.

We remark that the DIY approach to build up an instrumental system using a 3D printer can be exploited to teach physics or engineering in schools and colleges. Indeed, implementation of this project by students provides the following highly demanded traits in modern world knowledge and competitions:

  • A deep understanding of 3D printing technology, including hardware design of the 3D printer and software solutions (G-code) behind the printing process;
  • Training in computer-aided design (CAD) software for the creation of objects for further manufacturing with 3D printers;
  • Exploring the use of the LabView platform to control instruments;
  • Elaboration, curation, and presentation of complex data (3D vector fields).

The assembled device is a learning tool that allows students to investigate magnetic objects and magnetic fields. Everyday-live devices (smartphones, fridge magnets, hard drives of PCs, etc) can be used to analyze their structure and the rendered not visible by the naked eye magnetic field. Permanent magnets, assemblies, or electromagnets can be used to study the basic concepts of magnetism. The magnet's assemblies and coils can be manufactured using printed parts. In this case, students can deepen their understanding of CAD software.

Acknowledgments

This work was partially supported by the Russian Science Foundation, Grant No. 21-72-30032 (in part of the assembly of the magnetic mapping setup). The authors thank the Government of Principality of Asturias (Spain) for the Grant FICYT/IDI/2021/000100 (in part of the testing of the device).

Data availability statement

The data cannot be made publicly available upon publication because they are not available in a format that is sufficiently accessible or reusable by other researchers. The data that support the findings of this study are available upon reasonable request from the authors.

Conflict of interest

The authors declare no conflict of interest.

Please wait… references are loading.