Additive Manufactured and Topology Optimized Passive Shimming Elements for Permanent Magnetic Systems

A method to create a highly homogeneous magnetic field by applying topology optimized, additively manufactured passive shimming elements is investigated. The topology optimization algorithm can calculate a suitable permanent and nonlinear soft magnetic design that fulfills the desired field properties. The permanent magnetic particles are bonded in a polyamide matrix and they are manufactured with a low-cost, end-user 3D printer. Stray field measurements and an inverse stray field simulation framework can determine printing and magnetization errors. The customized shimming elements are manufactured by a selective melting process which produces completely dense soft magnetic metal parts. The methodology is demonstrated on a simple example of two axial symmetric cylindrical magnets, which generates a high inhomogeneous magnetic field. In this case, the maximum magnetic field density is 25 mT and the the homogeneity can be increased by a factor of 35 or down to 6‰. Simulation and measurement results point out a good conformity. Additional topology optimizations of more than one shimming element layer show the opportunity to make the manufactured magnetic system even more homogeneous.

Maintaining a highly homogeneous magnetic field is a key feature of many magnetic analysis methods and experiments in different scientific fields. Nuclear magnetic resonance (NMR) and magnetic resonance imaging (MRI) are given as examples. A uniform magnetic field is also required in some other applications such as magnetometers, neutron interferometers, magnetic traps, particle counters etc. The resolution of magnetic analysis methods can be improved by generating a stronger and more homogeneous field over the region of interest (ROI). As a result of production tolerances and of the magnetic field of the environment, the magnetic field of a permanent or electromagnetic system will be far from homogeneous compared with an ideal field of the system. The technique to correct the field inhomogeneity is typically called shimming of the magnetic system. In general, two shimming methods exists to increase the magnetic field homogeneity of a permanent magnet. (i) Passive shimming corrects the magnetic field by ferromagnetic materials placed on specific locations along the magnet 1-3 . (ii) Active shimming uses electro magnets with specialized coils to generate a correction field 4,5 . A passive shimming technique, manufactured by an additive manufacturing technology, for any kind of permanent magnetic systems is researched in this paper.
Several optimized permanent magnetic designs exist that obtain a homogeneous magnetic field [6][7][8][9] . Such magnetic designs can be found with different methods. Examples of numerical optimization methods include: (i) inverse magnetic field computation based on a finite elements method (FEM) where the magnetization M of a defined structure is optimized 10,11 , (ii) shape optimization improves existing designs for better performance 12 , (iii) parameter variation simulations can be used to find an optimal layout of predefined magnetic structures 13,14 and (iv) topology optimization which allows the designer of magnetic systems to find a suitable topology of the magnets from scratch [15][16][17] .
The advantage of topology optimization is the ability to create complicated magnetic field shapes, but this freedom-of-design is also the biggest disadvantage in terms of manufacturing of such optimized structures. Time and cost intensive production processes are necessary. This disadvantage can be eradicated by additive manufacturing (AM) techniques. AM or colloquially called 3D printing is an affordable technique to manufacture models, prototypes, or end-user products with a minimum amount of assigned material and time. Recently, it has been shown that an end-user fused deposition modeling (FDM) 3D printer can be used to print polymer-bonded magnets with a complex shape 11,16,18 . The FDM technology works by heating up wire-shaped thermoplastic filaments above the softening point. A movable extruder presses the molten thermoplastic through a nozzle and builds up the object layer by layer 19 .
Soft magnetic materials can be in-situ synthesized by selective laser melting (SLM). SLM is a powder bed method, implying that objects are created layerwise from metal powder under influence of a localized heat source. After each finished layer, the workpiece is lowered by one layer thickness. Then, a new layer of powder is spread on the top of the object and defined areas are melted selectively by scanning the part's cross-section with a laser beam. Typically, permalloys like FeNi 3 or Ni-Fe-V and Ni-Fe-Mo are used, respectively 20,21 . A big advantage of this method is to manufacture dense soft magnetic objects with an arbitrary shape. While the saturation magnetization of these alloys is comparable to conventionally processed versions of similar composition, the coercivities were higher for the laser-processed alloys, presumably due to microstructural defects. Thus, the magnetic properties can be modified by the laser process parameters, that can be used to produce tailored soft magnets for various applications like transformers, electric motors and other electromagnetic devices.
In contrast to SLM produced dense magnets, magnets can also be manufactured by FDM from compound materials which consist of soft magnetic particles embedded in a thermoplastic filament 22 . Samples of commercially available extruded composite filament from Proto-Pasta (Magnetic Iron PLA) are printed. This filament consists of 40 wt.% Fe particles embedded in a polylactic acid (PLA) polymer matrix. The magnetic properties of soft magnetic compounds are mainly influenced by their filler fraction. Filling fraction of more than 65 vol.% would be necessary to fabricate functional soft magnetic parts.
This work describes the complete designing and manufacturing method for a magnetic system that generates a homogeneous magnetic field in a defined ROI. With topology and inverse stray field simulation tools, the optimized design can be found. The permanent magnetic structures are printed with a FDM technique. Printing and magnetization errors are considered. A SLM process produces the passive shimming elements for the error correction.

Method
The method to find a permanent magnetic design with passive shimming elements that generates a homogeneous magnetic field in a defined ROI should be described by a simple example with a poor magnetic homogeneity to demonstrate the technique. The inhomogeneity η inside the ROI is defined with the magnetic flux density B as The ROI has a radius of 6 mm and a thickness of 1 mm. The inhomogeneity η should be smaller than 10‰. As a starting point for the optimization, a naive design of two cylindrical permanent magnets with radius r = 10 mm, thickness t = 10 mm and a gap of g = 20 mm is chosen. Starting from such a design ( Fig. 1(a)), the topology of this permanent magnetic system should be optimized ( Fig. 1(b)) in oder to minimize the inhomogeneity η. After magnetization of the system along the z-axis, the field is measured and the quality of the print and magnetization is determined by an inverse stray field simulation 10,11 . The result of this simulation is an input for the topology optimization of the soft magnetic shimming elements ( Fig. 1(c)).

Simulation Framework
In a simply connected domain without current, the stray field strength H of a magnetic body is given by with the magnetic scalar potential u. The relation between the magnetic flux density B and the field strength H is with μ = μ 0 μ r . μ 0 is the vacuum permeability and J = μ 0 M are the magnetic polarization with the magnetization M. The nonlinear isotropic permeability μ r (J) of the material is defined as For the topology optimization framework we use a density based method, also known as solid isotropic microstructure with penalization (SIMP) 16 . This method is based on a 3D finite-element method (FEM) simulation algorithm. Each tetrahedral finite element has a density parameter , which ranges from 0 (void) to 1 (bulk). This leads to only one design parameter per element 23 with the objective function J and the maximum Volume V of the design as a constraint; i ∈ {hard, soft} defines the permanent and soft magnetic domain, respectively. In our case, to minimize the inhomogeneity of the magnetic flux density B in the ROI, following objective function J has to be minimized No regularization is performed for this problem. Because, after several tests with different filters and perimeter controls, no improvement of the design quality or the magnetic homogeneity is detected 25 .
The finite-element package FEniCS is used to implement and solve the demagnetization field problem and the topology optimization method. FEniCS is an open-source software project with the goal to enable automated solution of nonlinear differential equations 26 . This involves the automation of: (i) discretization, (ii) discrete solution, (iii) error control, (iv) modeling and (v) optimization 27 . The topology optimization problem can be solved by the adjoint variable method (AVM) 23 . It is a well-known method for sensitivity analysis using FEM. The main advantage of this method is the low computational and storage costs compared to other techniques. To solve the topology optimization with the AVM method, the well-suited Dolfin-Adjoint library is used 28,29 . Dolfin-adjoint contains a framework to solve nonlinear partial differential equation (PDE) constraint optimization problems.

Results
The topology optimized hard magnetic system should be realized by a FDM 3D printing process 18 . A prefabricated compound material (Neofer ® 25/60p) from Magnetfabrik Bonn GmbH is used to realize the setup. It consists of NdFeB particles in a PA11 polymer matrix. The powder has a spherical form and the NdFeB grains have a uniaxial magnetocrystalline anisotropy and the orientation of the grains is random leading to isotropic magnetic properties of the bulk magnet. The powder is produced by employing an atomization process followed head treatment. The compound consist of 52 vol.% of the magnetic powder.
After printing of the optimized design ( Fig. 1(b)), the objects are magnetized inside an electro magnet with a maximum flux density of 1.9 T along the z-axis. To deduce the quality of the print and the correct magnetization, the field in the ROI is scanned by a 3D stray field measurement setup 18 . By the help of an inverse stray field simulation framework, the magnetization distribution inside the permanent magnetic structure is calculated 10,11 . As shown in Fig. 2(a), the magnetization is not perfectly orientated along the z-axis. This error originates from a nonconforming magnetization, as well as other printing errors and it should be eradicated with soft magnetic shimming elements (Fig. 1(c)). For this reason, the recalculated magnetization is an input for the nonlinear soft magnetic topology optimization.
The first idea was to use a commercially available soft magnetic compound material (Iron Metal PLA Composite, Proto-Pasta). This compound material shows good printing capability. However, due to its low amount of soft magnetic particles of only 16 vol.%, it shows weak magnetic properties compared to complete dense soft magnetic materials.
For bonded soft magnets, the relation between coercivity and filler fraction φ f can be described be the equation from Néel 31,32  fractions (φ f < 0.85). The permeability of the polymer matrix material is μ m ≈ 1. In the case of the Iron Metal PLA Composite from Proto-Pasta, a theoretical permeability of only μ = 2 is reachable. This value of the permeability fits well with hysteresis measurement performed by a pulse field magnetometry (PFM) (Hirst PFM11) where the material is printed in a cube shape with edge length of 5 mm 36,37 . All measurements are carried out 3 times with the same parameters -temperature of 297 K and a magnetic field up to 4 T peak field. The internal field is where H ext is the external field, N is the average demagnetisation factor for a cube (N = 1/3) 38 and J is the material polarization. Figure 3(a) shows hysteresis measurements of the Iron Metal PLA Composite for FDM. Since the permeability of the magnetic material produced by FDM is only around 2, we decided to utilize a different approach were we expect higher permeability and better properties for the shimming application. As mentioned before it is possible to manufacture soft magnetic materials additively by a SLM process. In our case, the SLM machine EOSINT M280 with a laser power of 400 W is used. A commercial available steel powder (EOS MaraginSteel MS1, 1.2709) is used for this work 39 . This powder has optimal properties for the SLM process. The printing parameters are summarized in Table 1. Figure 3(b) shows hysteresis measurements of the EOS MaraginSteel MS1 material by SLM. The hysteresis curve of the first quadrant is an input parameter for the topology optimization with a nonlinear soft magnetic material (Eq. 5). In combination with the recalculated magnetization distribution, the topology of the soft magnetic shimming elements can be simulated. The maximum radius and thickness of the elements is 10 mm and 1 mm, respectively. Figure 2(b) shows the simulated topology of the elements. The topology of the optimization is similar to "Rose rings" as expected in 40 , but due to the incorrect magnetization of the permanent magnets, the soft magnetic shimming elements are not rotational symmetric. For a better printing result, the ring shape is divided into two sections. This will avoid poor printing resulting from large overhangs.
The produced shimming elements are then mounted onto the permanent magnets. Figure 4(a) shows a picture of the fully assembled setup (with shimming elements) during the field measurement.
The measurements of the inhomogeneity η along the x-axis for the different phases of magnet design are shown in Fig. 4(b) and are compared to simulation results. It is visible that inhomogeneity of the topology optimized permanent magnets is not completely symmetrical about the x-axis. This is a result of the printing and magnetization errors. Good conformity between simulation and measurement results is given at all different iteration steps. In case of the final design with mounted shimming elements, the maximum field density in the middle of the system is 24.64 mT and the maximum inhomogeneity with shimming elements is around 6‰.
The presented methodology can be continued with more than one layer of shimming elements. To show the opportunity of this technique we simulate two more shimming elements on the top of the first one. The printing errors are considered with the same inverse stray field calculations as above. Figure 5(a) shows the simulation results of the inhomogeneity η along the x-axis for the different amount of shimming elements. The field inhomogeneity can be decrease for each iteration optimized shimming elements. Results of the topology optimization simulations for each iteration can be seen in Fig. 5(b).

Conclusion
Additive manufacturing offers new opportunities of magnetic field designs and manipulations. It can manufacture objects with highest individual design flexibility at minimum costs. The full potential of additive manufacturing comes into play when complex and customized parts have to be produced, which would otherwise be complicated to fabricate with conventional subtractive manufacturing methods.  Topology optimization of permanent and nonlinear soft magnetic materials offers the possibility to find the best possible topology of a given design domain for a desired field distribution. It needs to be said that that such optimization techniques can only find the best suitable design for a given arrangement of the design domains. Another disadvantage of such topology optimization algorithms is that the simulation results are difficult to manufacture with conventional manufacturing technologies. Additive manufacturing technologies opens here a new and easy way of the production process.
Nowadays, 3D printing of polymer-bonded permanent magnetic materials is an active research topic. 3D printing of soft magnetic materials by the aim of a FDM technique is not particular due to its low filler fraction of soft magnetic powder. For this reason, a SLM process is a better technique to manufacture soft magnets for field shaping applications. Nevertheless, if only a weak modification of the external field is necessary (field inhomogeneity in the range of parts per million), FDM with bonded soft magnetic materials could be suitable to shape the field in a small range.
A homogeneous magnetic field is necessary for many experiments and magnetic analysis methods. Traditionally, shimming elements of simple geometric shape are used to minimize field inhomogeneities. This work presents a additive manufacturing method to find a proper topology optimized design that generate a homogeneous magnetic field in a defined region. The inhomogeneity can be decrease by a factor of around 35. Even more, unavoidable printing and magnetization errors can be detected by an inverse stray field simulation technique which shows good accordance to the measured data. These errors can be considered in the next iteration step. Additional topology optimization simulations show the opportunity to make the magnetic field more homogeneous.
To improve this iterative shimming optimization, additional simulations and experiments, with locally varying permeabilities and thicknesses of the soft magnets should be considered. A FDM manufacturing process could offer a possibility to generate shimming elements with a location-dependent permeability. This would open a fourth dimension for the optimization process.