Variable single-axis magnetic-field generator using permanent magnets

We present a design for producing precisely adjustable and alternating single-axis magnetic fields based on nested Halbach dipole pairs consisting of permanent magnets only. Our design allows for three dimensional optical and mechanical access to a region with strong adjustable dipolar fields, is compatible with systems operating under vacuum, and does not effectively dissipate heat under normal operational conditions. We present a theoretical analysis of the properties and capabilities of our design, and construct a proof-of-concept prototype. Using our prototype, we demonstrate fields of up to several kilogauss with field homogeneities of better than 5%, which are harmonically modulated at frequencies of $\sim$1Hz with a power consumption of approximately 1W. Moreover, we discuss how our design can be modified to generate adjustable quadrupolar magnetic fields with gradients as large as 9.5T/m in a region of optical and mechanical access. Our design is scalable and can be constructed to be suitable for table-top experiments, as in the case of polarimetric and magnetometric setups that require strong alternating magnetic fields, but also for large scale applications such as generators.

We present a design for producing precisely adjustable and alternating single-axis magnetic fields based on nested Halbach dipole pairs consisting of permanent magnets only. Our design allows for three dimensional optical and mechanical access to a region with strong adjustable dipolar fields, is compatible with systems operating under vacuum, and does not effectively dissipate heat under normal operational conditions. We present a theoretical analysis of the properties and capabilities of our design, and construct a proof-of-concept prototype. Using our prototype, we demonstrate fields of up to several kilogauss with field homogeneities of better than 5%, which are harmonically modulated at frequencies of ∼1 Hz with a power consumption of approximately 1 W. Moreover, we discuss how our design can be modified to generate adjustable quadrupolar magnetic fields with gradients as large as 9.5 T/m in a region of optical and mechanical access. Our design is scalable and can be constructed to be suitable for table-top experiments, as in the case of polarimetric and magnetometric setups that require strong alternating magnetic fields, but also for large scale applications such as generators.
Special arrangements of magnetic structures that increase the magnetic flux on one side of the arrangement while reducing, or even cancelling, it on the opposite side, were first theoretically proposed by Mallinson 1 , but later realized by K.  , who constructed yokeless arrangements of permanent multipole magnets. Nowadays, these arrangements are known as Halbach arrays.
Halbach arrays allow for the generation of strong and homogeneous magnetic fields in dipole, quadrupole, or even higher-order multipole configurations. Furthermore, these magnetic fields are the strongest possible per mass of permanent magnet material. Halbach arrays are used in a wide range of applications in science research 5 , e.g. particle accelerators 3 , nuclear magnetic resonance [6][7][8] , drug targeting 9,10 , but most importantly in the industrial sector, such as in the cases of brushless motors 11 , magnetic gears 12 , magnetic refirgeration 13 , and magnetically levitating trains 14 , and most notably in "kitchen-refrigerator" and pin-board magnets.
Recent developments in polarimetry 15,16 and magnetometry [17][18][19] require the use of strong and adjustable, or alternating, magnetic fields, but the ability to maintain three-dimensional (3D) optical and mechanical access in these applications is, in most cases, critical. A typical solution is to use electromagnets, but their usage can be undesirable due to power-supply-related noise [15][16][17][18][19] , or untenable due to power-availability constraints. Moreover, in the case of high-field generation using electromagnets, active cooling typically becomes necessary, introducing additional mechanical noise into the system 18 . Leupold et al. 20 presented the idea of nested, concentric, and rotatable Halbach cylinders for the generation of adjustable, homogeneous magnetic fields using permanent magnets, circumventing issues associated with the use of electromagnets, but these, and similar presented systems, lack the 3D optical and mechanical accessibility.
In this article, we present a design based on concentri- cally nested Halbach dipole pairs, axially separated by an appropriate distance. This particular arrangement allows for the production of single-axis adjustable and alternating magnetic fields at the central plane of the structure while enabling 3D optical and mechanical access to a region of a homogeneous magnetic field. We first describe the principles of operation of our design using a theoretical analysis. Then, we present a proof-of-concept prototype along with magnetic field measurements obtained with it, demonstrating the capabilities of our system. Finally, we discuss the ability to create quadrupolar magnetic fields using our design, and present simulations for the attainable mag-netic field gradients. Our primary motivation is the employment of the proposed system in cavity-enhanced polarimetry 15,16 , where the generation of adjustable and reversible circular birefringent effects (e.g. Faraday rotation) is typically required. We also discuss the flexibility of our device and several possible applications that potentially benefit from it. Here we focus on cylindrical Halbach arrays that generate homogeneous dipolar fields, i.e. Halbach dipoles, as shown in Fig. 1. An ideal Halbach dipole, represented as an infinitely long tube with continuously rotating magnetization inside the material of the wall, produces a homogeneous magnetic field within a cross-sectional plane of strength B outer = B rem · ln (r 1 /r 2 ), where B rem is the remanence of the permanent magnetic material, and r 1 and r 2 are the outer and inner radii of the tube, respectively [see Fig. 1 Let us now assume a configuration of two concentric, nested, Halbach dipoles as shown in Fig. 1 (b). In this case, the inner dipole now produces a homogeneous magnetic field of strength B inner = B rem · ln (r 3 /r 4 ). If this inner dipole has an inner and outer radius of: respectively, then |B outer | = |B inner |. Since the resulting field in the center of the dipole pair is given by the vector addition of B outer and B inner , i.e. B tot = B outer +B inner , it becomes apparent that for this specific geometry, appropriately equal and opposite rotations of the two nested dipoles yields any desired field in the range of ±|B| max. tot along one axis of the system, as schematically depicted in Fig. 2. Such arrangements of nested Halbach dipoles allow for great versatility in choice of operating alternating frequency as well as in field tuning 7,20 . While this design allows for single-axis variable magnetic fields, it does not allow for flexible 3D optical and mechanical access.

B. Discretized Halbach dipole
To translate the idea of nested Halbach dipoles in a realistic design we need to modify the ideal model presented above, since an infinitely long tube of continuously changing magnetized material is impossible to realize. Various discrete versions of the ideal case have been suggested to approximate it 7 , with the most straightforward discretization being the division of the cylindrical structure into segments of identical shape and magnetization, but with different magnetization directions 21,22 .
In this work we choose to focus on cylindrical arrays of square-shaped permanent magnets as the discrete equivalent of ideal Halbach dipoles, similar to the ones depicted in Fig. 1 Fig. 1 (c)], we can estimate the resulting magnetic field within and outside its magnetization plane (namely the x-y plane; see Fig. 2). The simplest approach is to model the cylindrical array of the N square-shaped permanent magnets as an array of N point-dipoles. In this case, the resultant magnetic field B array , at a particular point in space with radius vector R, is the vector sum of the magnetic field B i of each of the N dipoles at positions r i 23 : By using this approximation we can estimate the strength of the magnetic field of the discretized Halbach dipole along its x-axis as a function of the distance from its central plane (i.e. along the z-axis, Fig. 2) as follows 23 : where µ 0 = 4π · 10 −7 T · m/A is the permeability of vaccum, m is the magnetic dipole moment of a single dipole (we assume here that each dipole, representing each magnet, has the same magnetic dipole moment), r the effective radius of the array of the point dipoles, and z the distance from the array's x-y plane. By appropriately choosing the characteristics, dimensions, and orientation of the two arrays comprising a nested Halbach dipole, we can carefully tune the strength and homogeneity of the dipolar field inside and outside the plane of the nested dipoles. It is this property that we exploit for the creation of a device that allows for adjustable, homogeneous, magnetic fields within a region of 3D optical and mechanical access, by using concentrically nested Halbach dipole pairs, axially separated by an appropriate distance.

A. Nested Halbach dipole pairs
For a prototype device that integrates the above discussed concepts and is appropriate for our applications, we use two identical pairs of nested Halbach cylindrical arrays, shown in Fig. 3. Note that we choose the dimensions of the cylindrical structures to be in accordance with the design criteria imposed by Eq. 1.
Each cylindrical array consists of 12 magnets, and we use polyoxymethylene (POM) as a material for the cylindrical support structures to encase the magnets. We use cuboid-shaped neodymium (Nd 2 Fe 14 B) permanent magnets (N50 alloy; B rem ≈ 1.4 T) of two different sizes: 6×6×6 mm 3 for the inner arrays, and 12×12×6 mm 3 for the outer arrays. The thickness of the plastic housings is chosen to be equal to the height of the magnets (i.e. 6 mm). We characterize the magnets separately, and find their magnetization to vary no more than ∼5%. We note here that great care is required when assembling systems consisting of strong permanent magnets as contact can strongly influence their magnetic properties.
Our goal is to obtain strong, homogeneous, magnetic Schematic of the discretized Halbach arrays used in our proof-of-concept prototype device, which consists of concentrically nested Halbach dipole pairs. We use a total of four cylindrical arrays for our design: two identical large (outer) and two identical small (inner) ones; using one of each we create a nested Halbach dipole pair. Each array consists of 12 cubic neodymium magnets (yellow) which are encased in a plastic housing (gray). In the nested Halbach dipole pair configuration, we define as h the distance between the central planes of the nested dipoles, and as offset the distance between the central planes of the small (inner) and large (outer) arrays in each nested configuration. By tuning h and the offset, one can tune the magnetic field strength at the geometrical center of the structure (marked by a cross symbol), which is the area of 3D optical and mechanical access. All dimensions are in mm.
fields along one axis of the system (x-axis; Fig. 3) in an area with optical and mechanical axis (with its geometrical center marked by a cross in Fig. 3), that can be adjustable and reversible, while minimising the strength of the magnetic field along the other axes. For this reason, we start by measuring the magnetic field strengths of the built arrays along the x-axis as a function of displacement from their central planes (i.e. along the z-axis; Fig. 3).
In Fig. 4 we present our measurements which we analyze using Eq. 3, yielding the effective magnetic moments for the large and small magnets to be 0.161(1) A·m 2 and 0.721(7) A·m 2 , respectively, and their radial position around the arrays to be located at r = 14.1(1) mm and r = 27.8(1) mm, respectively. These results are consistent with the parameters and geometry of our design. Most importantly, we see that there exists a position outside the arrays (along the z-axis), where the strengths of the B x magnetic field component produced by the large and small cylindrical arrays are equal. Therefore, as the nested dipoles are rotated in opposite directions, we expect that at this intersection point the B x magnetic field component will cancel when the angle between the nested arrays of 90 • , and completely reverse for 180 • (Fig. 2). It is at this position that the nested dipole Halbach pair configuration allows for single-axis variable magnetic fields with 3D optical and mechanical access. Moreover, this intersection point indicates that the gap h ( Fig. 3), between the axially separated nested arrays, must be approximately equal to twice this intersection distance. For the built arrays we use in our prototype device, the separation between them should be, therefore, set to h 16−18 mm. We note here that the introduction of an additional offset between the central planes of the small (inner) and large (outer) nested arrays (see Fig. 3), allows us to further tune the intersection point and, as a consequence, the strength of the total magnetic field strength at that point. This offset adds an extra degree of freedom in the design parameters of our proposed system.
To decide on the final design parameters for our prototype device, we use the geometric characteristics of our built arrays (Fig. 3) and the results shown in Fig. 4 to theoretically estimate the attainable magnetic field strength and homogeneity for possible configurations of our device in the area between the axially separated nested dipole pairs. In particular, as a measure of the maximally attainable magnetic field homogeneity in a given geometry we use the following parameter: where α is the angle between the nested arrays (Fig. 2), |B x (0, 0, 0, 0)| is the absolute value of B x on the x-axis at the center of the Halbach array system for α = 0 • (equal FIG. 6. Theoretical simulation of the exact volume (light red) within which the Pα(x, y, z)-parameter and the Bx magnetic field strength vary less than 5%, for a gap of h = 17 mm and an offset of +2 mm (Fig. 3). This volume is 3D accessible optically and mechanically. The lower nested Halbach arrays are shown as a size reference, while the upper arrays are not shown.
to the case of α = 180 • ), B yz (α, x, y, z) is the projection of the magnetic-density flux vector on the yz-plane at a point with coordinates {x, y, z}, and S is the volume around the {x, y, z} point within which we estimate the P α parameter. We use three different approaches to calculate the magnetic field strengths and their homogeneity -as characterized by the P α (x, y, z) parameter -for a given design geometry of the proposed nested Halbach-pair device: we use (a) a dipole model, where each permanent magnet in the arrays is modelled as an ideal magnetic dipole; (b) an analytical model that uses analytical expressions for the magnetic field of a cuboidshaped permanent magnet following the work of Ref. 24 ; and (c) a COMSOL-based finite element method that uses as inputs the geometry of our design and the measured magnetic moments of our magnets. In Fig. 5 we show the dependence of the P α (x, y, z)parameter on the distance between the central planes of the Halbach arrays for two extreme orientations, parallel (α = 0 • ) and perpendicular (α = 90 • ), and for different offset parameters. In particular, we estimate the value of the P α (x, y, z)-parameter within a sphere (S) of a given diameter centered around the geometrical center of the structure, estimating thus the homogeneity within a given volume for the structures shown in Fig. 3. We see, that, for α = 0 • the magnetic field homogeneity is better than 5% within a sphere of ≈ 8 mm in diameter and for dipole separation gaps in the range of h ≈ 10 − 20 mm. Moreover, for α = 90 • we see that similar homogeneities are attainable, suggesting that for carefully selected gaps we can achieve overall field homogeneities of better than 5% while the system is rotating. We perform the same calculations assuming an additional offset (Fig. 3). We see that by adjusting this offset we can tune the optimum gap distance for the system without affecting its field homogeneity, ensuring thus that one can add a small offset in the final design to allow for an increase in the maximum attainable magnetic field without significantly affecting its overall performance. Additionally, in Fig. 6 we show the exact shape of the volume within which two conditions are satisfied simultaneously: a) P α (x, y, z) is less than 5% for any angle α, and b) the strength of B x does not vary more than 5% for α = 0 • . For these calculations we use a gap of h = 17 mm. This volume and its predicted homogeneity are sufficient for our polarimetric and magnetometric applications, but further adjustment is possible for suitability in other applications. In the following section we present a proof-of-concept prototype device, and, for its construction, we use the presented numerical simulations as our guide.

B. Instrument Design
In Fig. 7 we present a rendering and a schematic crosssectional side view of our assembled prototype device. The inner and outer Halbach cylindrical arrays [with dimensions and characteristics as presented in Fig. 3, and annotated as (h) and (i) in Fig. 7], are screwed on a rotating system which consists of a hollow stainless-steel-based hub assembly [(a) and (b)], constrained axially and radially by angular ball and thrust roller bearings [(d)-(e)]. This hollow hub assembly allows for the insertion of, for example, optomechanical mounts enabling the positioning of optics within the region of strong, homogeneous magnetic fields. The hub assembly together with the bearings are pressed and held in position by pulleys (c) on a stainless-steel plate. An external thread on the hub assembly (a) also enables the use of a locking mechanism, e.g. a locking nut (external thread not shown in Fig. 7). The same mechanism is mirrored to host and control the rotation of the opposite nested Halbach dipole pair, and is held in position by the overall stainless steel body of the device. Finally, a system of timing belts (f) and gears (g) allows for the synchronized counter-rotation of the inner (h) and outer (i) Halbach arrays. The whole system can be driven using the gear shafts (j), manually and/or electrically by an external motor. This prototype design is adaptable to produce strong magnetic fields in any direction in a horizontal plane, and is suitable for operation under vacuum. We wish to emphasize that the use of stainless steel in our prototype is chosen for reasons of robustness and it can affect the magnetic properties of the design, but other materials can be used without obvious shortcomings.
The presented design is scalable, but for suitability to our experimental plans, and in accordance with our simulations, we have chosen a gap of h 17 mm and an offset of +2 mm for our prototype device.

A. Adjustable dipole magnetic fields
In Fig. 8 we present measurements of the magnetic field generated at the geometrical center of our prototype design (marked by cross; Fig. 7). For our measurements we use a transverse and an axial Hall probe magnetometer (HIRST Magnetic Instruments GM08 magnetometer) with a < 1 mm sensor size. We see that with our prototype system we can obtain fields as strong as ∼1.6 kG at the geometrical center, where we have 3D optical and mechanical access. We observe that any remnant field strengths along the other two axes (y & z) to be less than 4% of the maximum attainable field strength along the xaxis. Moreover, with the use of a stepping motor (Sanyo Denki 103H7123) we are able to continuously rotate our system at a rate of ∼1 Hz (we are limited by our stepping motor's holding torque, which is frequency dependent). For this rotational frequency, and for a torque required to rotate the system of approximately 0.2 N·m, we estimate the power consumption for generating this alternating field to be ∼1 W. We also perform a harmonic fit of FIG. 8. Magnetic field measurements using our prototype device at its geometrical center (marked by a cross; Fig. 7) while rotating the system using a stepping motor. Black points-Bx; yellow points -By; green points -Bz; solid lines -harmonic fits of Bx,y,z.
our measurements and verify that our system has a stable and harmonic behaviour. Most critically, we observe that the remnant fields are out of phase with respect to the magnetic field along the x-axis, which suggests that by finely adjusting the geometry parameters of our design we can tune the off-axis fields to be completely out of phase with the field along x-axis. Finally, we note here, that, if an anharmonic magnetic-field oscillation is FIG. 9. Generation of quadrupolar magnetic fields using axially separated concentrically nested Halbach dipole pairs. a) Schematic representation of the initial orientation parameters for the axially separated arrays for the generation of dipole vs. quadrupolar fields. b) Using a finite element method (COMSOL) we simulate the magnetic field Bx component in xz-plane generated by our design. Red arrows show the directions and relative magnitude of the magnetic flux density vector B. c) Magnetic field gradient ( dBx / dz ) obtained using our design. For these simulations we assume a gap of 30 mm and an offset of +2 mm (Fig. 3).
desirable, it can be achieved by simply modulating the speed of the driving motor.

B. Adjustable quadrupole magnetic fields
An additional feature of our design is the ability to generate homogeneous magnetic fields of multipole configurations. In particular, quadrupole magnetic fields can be generated inside single Halbach cylinders with quadrupolar magnetization distributions 25 , but these cannot be adjusted and single arrays do not allow for 3D optical and mechanical access.
Using our design and by oppositely aligning the axially separated nested Halbach pairs, as schematically presented in Fig. 9 (a), we can create an adjustable quadrupolar magnetic field along the x-z plane. In particular, in Fig. 9 (b) we present a vector field map of the quadrupole magnetic field attainable using our design, and in Fig. 9 (c) we present the attainable magnetic field gradient. For these simulations we choose a gap h (Fig. 3) equal to 30 mm for which we obtain a permanent quadrupolar field along the x-z plane for any angle α. Moreover, we see that we can obtain magnetic field gradients ( dBx / dz ) of up to 9.5 T/m, and by adjusting the relative orientation of the axially spaced nested Halbach pairs we can adjust this gradient, a unique feature of our design. The presented configuration could be used in fields where linear magnetic gradients are required, e.g.: nuclear magnetic resonance imaging 25 , ion-beam focusing 26 , spin-polarized atom trapping 27 . Detailed investigations of generation of quadrupolar fields using our design will be part of future work.

IV. Conclusions
In conclusion, we present here a design for producing variable single-axis magnetic fields based on nested Halbach dipole pairs consisting of permanent magnets. We provide the design parameters for a prototype device with moderate dimensions that allows for 3D optical and mechanical access to a region with an adjustable field of up to several kilogauss and with field homogeneities of better than 5%. Our device is compatible with systems operat-ing under vacuum and does not effectively dissipate heat under normal operational conditions. Moreover, using our prototype, we demonstrate harmonic generation of ∼1.6 kG strong magnetic fields at a frequency of ∼ 1 Hz, with an estimated power consumption of ∼1 W. We finally discuss the ability to create adjustable quadruple magnetic fields, making our design appropriate for other applications such as utility in linear accelerators and in magnetic particle trapping applications.
While the design parameters of our prototype device were selected to be suitable for table-top scientific experiments such as highly sensitive polarimeters and magnetometers built in our laboratories, it is important to emphasize that the proposed design can be scaled in all dimensions, with particular interest in industrial applications, such as DC motor generators.