## Abstract

Magnetic dipole-dipole interactions govern the behavior of magnetic matter across scales from micrometer colloidal particles to centimeter magnetic soft robots. This pairwise long-range interaction creates rich emergent phenomena under both static and dynamic magnetic fields. However, magnetic dipole particles, from either ferromagnetic or paramagnetic materials, tend to form chain-like structures as low-energy configurations due to dipole symmetry. The repulsion force between two magnetic dipoles raises challenges for creating stable magnetic assemblies with complex two-dimensional (2D) shapes. In this work, we propose a magnetic quadrupole module that is able to form stable and frustration-free magnetic assemblies with arbitrary 2D shapes. The quadrupole structure changes the magnetic particle-particle interaction in terms of both symmetry and strength. Each module has a tunable dipole moment that allows the magnetization of overall assemblies to be programmed at the single module level. We provide a simple combinatorial design method to reach both arbitrary shapes and arbitrary magnetizations concurrently. Last, by combining modules with soft segments, we demonstrate programmable actuation of magnetic metamaterials that could be used in applications for soft robots and electromagnetic metasurfaces.

## INTRODUCTION

In 1903, Gustav Mie proposed a generalized form to describe the interaction between two particles, later known as the Mie potential (*1*). Since then, this phenomenological description of particle-particle interaction has been widely used to describe the balance between two competing forces at different length scales, one well-known example being the Lennard-Jones potential for interatomic and intermolecular interactions (*2*). The symmetry and the strength of particle-particle interactions contain critical information to model a system’s dynamics, which is necessary for understanding the complex emergent behaviors of multiparticle systems.

Dominated by magnetic dipole-dipole interactions, magnetic particles can self-organize into various complex structures under spatiotemporally varying magnetic fields (*3*–*11*). Such structures include chains (*11*), rings (*12*), asters (*6*), ribbons (*13*), and microtubules (*10*). This list can be extended to include more complex emergent structures if combined with external acoustic (*9*) and electric (*14*) stimuli or on superhydrophobic surfaces (*15*). The shape and dynamics of such assemblies attract interest for both fundamental research and applications, including self-assembled colloids (*16*, *17*), programmable matter (*18*), directed particle transport (*19*), and reconfigurable modular microrobots (*20*–*22*).

Magnetic dipole-dipole interactions exhibit some limitations. First, the repulsion force between magnetic dipoles under certain configurations undermines the stabilities of overall assemblies and sometimes leads to local frustrations under geometric constraints (*23*–*27*). Here, the geometric frustration comes from local conflicting magnetic interactions. As a result, magnetic particles tend to form simple quasi–one-dimensional (1D) structures such as chains and rings at low densities. This makes many interesting configurations energetically unfavorable. The symmetry of magnetic dipoles fundamentally inhibits stable assemblies with complex 2D shapes. Although this limit can be overcome by adding other interparticle interactions, such as electrostatics, the local repulsions between dipoles remain, making it difficult to predict the responses of overall assemblies as can be done for artificial spin ice systems (*24*).

In addition, there is a strong coupling between the shape and the magnetization of the overall magnetic assemblies, because the magnetizations are determined by the local magnetic dipole arrangements. For soft magnetic robots in liquid, the shape determines the fluidic drag, whereas the magnetization determines the force and torque applied by external magnetic fields. To obtain desired assembly motions, it would be ideal to program the shape and the magnetization independently. Decoupling shape and magnetization could markedly broaden the design space of magnetic assemblies for programmable deformations, complex actuation, and locomotion in various environments.

Despite the advances in complex configurations of magnetic particle assemblies, there are no design rules illustrating how to assemble magnetic particles for an arbitrary structure. Although generalized solutions were proposed for structured mechanical metamaterials (*28*, *29*), DNA origami (*30*), and reconfigurable modular robots (*31*, *32*), the reverse design problem remains challenging for magnetic assemblies. Simplifying the assembly rules of magnetic particles for any given shape and magnetization would allow rational designs of customized programmable matter (*33*), a strongly desirable capability for many engineering applications.

Here, we address these challenges by developing magnetic quadrupole modules for 2D assemblies. Each module has a dominant quadrupole moment and small dipole moment, which were designed to govern the near-field interactions with neighboring modules and to encode the magnetization, respectively. The dominate quadrupole structure with fourfold symmetry allows modules to be assembled in a 2D square lattice without local repulsion. We also developed a simple frustration-free combinatorial design method for arbitrary 2D shapes with arbitrary magnetizations. This provides a previously unseen design space for magnetic assemblies to form customized small structures at the single module level that is inspirational for magnetic assemblies across all scales.

## RESULTS

### Quadrupole module with a tunable dipole moment

The magnetic quadrupole module is composed of two identical NdFeB block magnets (1.2 mm by 1 mm by 0.5 mm) inside a 3D-printed square case (Fig. 1A). Two magnets are arranged with a relative angle θ between their dipole moments. Using magnetic multipole expansion, the module structure can be decomposed into a quadrupole term and a dipole term, respectively, based on their arrangements. By varying the relative angle θ between the two magnets, both dipole and quadrupole terms can be tuned from a pure quadrupole (θ = 0°) to a pure dipole (θ = 180°) (Fig. 1, B and C). The magnetic fields produced by dipoles and quadrupoles decay at different rates with *34*), where *p* is the distance away from the center of the magnetic module. One can design the relative strength between two terms to use their different properties at near and far field. A simple comparison of dipole and quadrupole terms is shown with different θ angles (Fig. 1C). The quadrupole term gets weaker with an increasing θ angle, whereas the dipole term gets stronger.

We used the quadrupole’s fourfold symmetry for assembly with other modules while keeping a small dipole moment inside the module to determine the magnetization of the assemblies and to respond to external magnetic fields. After analytical studies and numerical simulations, an angle (θ = 20°, type A) was chosen so that four alternating magnetic poles can be easily identified on each side of the module structure with a noticeable magnetic dipole moment. This quadrupole module has a mirror design (type B).

### Magnetic quadrupole-quadrupole interactions

To show that each quadrupole module can form stable bonds with four neighbors, we modeled the potential energy of two quadrupole modules at any given position. The potential energy of two quadrupole modules can be written as the summation of magnetic dipole pairs (Eq. 1) with respect to the relative position and angle. Here, we assume that the magnets are point dipoles at geometric centers.*H*_{di}_{−}_{dj} is the magnetic energy between dipoles *i* and *j*, and *H*_{q1}_{−}_{q2} is the magnetic energy between two quadrupole modules. The magnetic permeability in vacuum is μ_{0}, **m _{i}** is the

*i*-th magnetic dipole,

*r*is the distance between them. For any given two quadrupole modules (θ = 20°), there exist four minimal energy positions on each side of the quadrupole module (Fig. 1D).

The potential energy at each of the four stable positions is not equivalent due to the fact that a quadrupole module has two strong poles and two weak poles (fig. S4). We experimentally demonstrate that assemblies between different types (type A and type B) and the same types (type A and type A) are possible (Fig. 1, F and G). With an increasing θ, the quadrupole module gradually loses its four stable bonding sites and behaves like a dipole particle (fig. S5).

### Combinatorial design method for arbitrary shapes and magnetizations

To assist in the design process, we proposed a combinatorial design method for the magnetic quadrupole modules. After this method, one can easily design 2D frustration-free magnetic assemblies with arbitrary shape and arbitrary magnetization (Fig. 3) by pick-and-place according to the design map (Fig. 2). We simplified the magnetization profile of each quadrupole module by assigning the corresponding north and south pole on each side. The system energy of quadrupole assemblies can be modeled as Ising interactions between nearest neighbors (fig. S6) (*35*). The assemblies become stable if all internal north poles are paired with south poles. This principle ensures that quadrupole assemblies will be structurally stable without internal frustrations in a square lattice. After determining the shape, four independent magnetization directions are available for each module, as shown in Fig. 2A.

Although each quadrupole module has only four directions of magnetization in the square lattice, the overall magnetization of the assembly can be much more complex. The magnetization of the assembly is simply the summation of magnetic dipole moments of each quadrupole module. To illustrate the design space, we used a nine-module assembly “small rocket” to demonstrate the possible magnetizations in the structure plane (Fig. 3B). By combining different magnetization directions of individual quadrupole modules, the magnetization direction of the assembly can be fine-tuned to an arbitrary angle. The smallest tunable angle of the magnetization direction depends on the total number of the modules in the assembly (fig. S7).

### Programmable soft actuators and soft metamaterials

The freedom to design complex magnetization profiles is particularly interesting if the assembly structure is soft (*36*–*39*). Soft material enables the local magnetizations to transform into relative deformations under an external magnetic field. We developed a soft segment with magnetic quadrupole modules at both ends. These two quadrupole modules have zero dipole moments, which serve as assembly anchors. By combining quadrupole modules with a dipole moment, we could assemble multisegment soft structures with a programmable motion under external dynamic magnetic fields (Fig. 4). Selected deformations are presented by programming the magnetization of various types of mechanical metamaterials, including an auxetic material characterized by their negative Poisson’s ratio. The active magnetic fields could dynamically deform the preprogrammed soft structures, making it a versatile tool for soft robotic applications.

## CONCLUSION

In summary, we propose a quadrupole magnetic module with a tunable dipole moment. The fourfold symmetry of the quadrupole module promotes stable complex assemblies with arbitrary magnetizations. In this work, the fabrication process of quadrupole magnetic modules is limited by the resolution of the 3D printer, the permanent magnets that are commercially available, and the manual assembly process, which can be replaced using a three-axis robotic stage. Further efforts can be focused to overcome these fabrication limitations using similar quadrupole designs and 3D assemblies using a robotic hand. Compared with 3D printing (*38*) and laser cutting (*37*), magnetic soft robotic assemblies can reconfigure to various morphologies through disassembly and reassembly in situ, providing a new strategy to design minimally invasive medical devices.

## MATERIALS AND METHODS

### Fabrication of magnetic quadrupoles

The shell of the quadrupole module was printed with rigid resins (IC131 black, PR57 magenta, PR57 yellow, and PR57 white, Colorado Polymer Solutions) by an Ember 3D printer (Autodesk). The quadrupole modules with soft segments were directly printed by a Connex (Objet 350, Stratasys) with Agilus as the soft material and VeroWhite as the hard material. The 1.2 mm–by–1 mm–by–0.5 mm block magnets were N42 grade NdFeB block magnets with nickel-plated surfaces (article no. 9964-2353, HKCM Engineering). The magnets were assembled together and glued with ethyl 2-cyanoacrylate adhesives (Pattex).

### Simulations

The static magnetic field simulation (Fig. 1B) was performed using COMSOL Multiphysics. The magnetization flux conservations were applied to each NdFeB magnet with a predefined magnetization direction. The color shows the norm of the magnetic field (**B**). The 2D streamlines were plotted with uniform density showing the magnetic field direction. The quadrupole-quadrupole potentials were calculated based on Eq. 1. The results were implemented and visualized in MATLAB. The color map shows the potential energy between two quadrupole modules with a fixed relative angle.

### Assembly process

We built up an assembly stage for quadrupole modules (extended data Fig. 1A). The stage had a transparent polymethyl methacrylate cover (3 mm) and a thin brass substrate (0.5 mm painted as white color). The motions of quadrupole modules were confined in two dimensions inside the assembly platform. A small bar magnet (1 mm by 1 mm by 4 mm) as the magnetic tweezer moved under the brass substrate to move individual quadrupole modules for desired position and orientation. Glycerol (99%, abcr GmbH) was used to damp the motion of quadrupole modules providing facile control of the assembly processes. The equations of motion for each quadrupole module are**M** is the magnetization of the material; **B** is the magnetic field generated by the magnetic tweezer; **v** and ω are the linear and rotational velocity vector, respectively; ψ_{Linear_drag} and ψ_{Rotation_drag} are the linear and rotational drag coefficients, respectively; and **F** and **T** are the friction force and torque applied to the module, respectively. In this setup, the magnetic field gradient generated by the magnetic tweezer is the dominant force to move the quadrupole modules (fig. S1B).

Only single module assemblies and a π shape were demonstrated in this setup (Fig. 1 and fig. S2). The rest of the quadrupole module assemblies were achieved manually using a normal tweezer. Although we demonstrate the assembly process using manual control of the magnetic tweezer, this process can be automated using a 3D robotic hand and computer vision feedback.

### Multipole expansion of a quadrupole module

We implemented the multipole expansion for permanent magnets based on our quadrupole module structure. The generalized magnetic scalar potential Φ of a permanent magnet is represented in fig. S3A, which can be expressed as**M** is the magnetization, *ds*, **p** is the vector to the point of interest, and **ρ** is from the center O to the point of integration. Applying the multipole expansion using Legendre polynomials *P _{n}*(), the magnetic potential can be expressed as

*p*= ∣

**p**∣, ρ = ∣

**ρ**∣,

**p**and

**ρ**, respectively. In the following, we are primarily interested in the terms of the series corresponding to

*n*= 1 and 2 that respectively correspond to the dipole and quadrupole terms. For a block magnet magnetized along its major axis, only two surfaces perpendicular to the magnetization need to be integrated. The multipole expansion in this case can thus be rewritten as

*M*= ∣

**M**∣ and

*S*is the

_{i}*i*-th surface contributing to the potential, i.e., the surfaces corresponding to the north and south poles of each block magnet. The term

*D*

_{0}is always zero because there is no magnetic monopole, and the dipole and quadrupole contributions to the magnetic potential can be expressed in spherical coordinates (fig. S3B) as follows for a type A module

The magnetic field can be calculated outside of the permanent magnets as **B** = −μ_{0} ∇ Φ with μ_{0} = 4π × 10^{−7}N ⋅ A^{−2}, the magnetic permeability for free space. The magnetic field **B** described in spherical coordinates is then expressed as**p** direction, and

### Strong poles and weak poles

The magnetic poles on each side of the quadrupole module are not equivalent. If we consider the implementation of the quadrupole structure in three dimensions, there are two poles on the top and bottom sides of the module (fig. S4A). For type A quadrupole modules, both top and bottom poles are north poles. The magnetic flux from four north poles is equivalent to the flux coming back from two south poles, making the south poles stronger than the north poles. For type B quadrupole modules, the north poles are stronger than the south poles. The difference can be evaluated by the quadrupole-quadrupole interaction model based in Eq. 1 (fig. S4B). During the experiments, stronger poles are more likely to bond together than two weak poles between type A and type B quadrupole modules.

### Ising model of quadrupole assemblies

The magnetic energy of the quadrupole assemblies can be calculated on the basis of all the dipole-dipole pairs, except for the ones that belong to the same module. To simplify the calculation, we provided an equivalent Ising model for quadrupole assemblies, considering the interactions only within the nearest neighbors.

*J _{ij}* is the energy map, and σ

*is the “spin” of the magnetic pole on each side of the quadrupole module. As in fig. S6, the total energy of the quadrupole assemblies can be written as the summation of all the binding pole pairs. The red and blue circles represent the strong north and south poles, and the half red and blue circles represent the weak north and south poles, respectively. Six different energy bonds are listed between strong and weak magnetic poles. This method provides a simple evaluation tool for calculating the minimal energy configurations and quick access to stabilities of the assemblies.*

_{i}### Magnetization design space

On the basis of our quadrupole formulation, the magnetization and the shape can be decoupled for quadrupole assemblies. For a given shape made of *N* quadrupole modules, each quadrupole has a dipole moment either pointing to one of the four directions (north, south, west, and east) in a square lattice. Considering each module in a 2D assembly as a distinct order, the magnetization design space is 4* ^{N}*, considering the spatial distribution of the magnetization space. However, in terms of the overall magnetization, there are several degeneracies that different combinatorics give the same magnetization. For any number

*N*=

*N*

_{north}+

*N*

_{south}+

*N*

_{east}+

*N*

_{west}, the magnetization vector is

*y*axis (of unit vector

*x*axis (of unit vector

For the assemblies with the same magnetization, we calculated the number of designs based on simple combinatorics. The number of designs with identical magnetization and shape is*m* ≤ *n*.

As an example, we studied the number of designs yielding equivalent magnetization in fig. S7. We calculated the designs in one-eighth of the magnetization design space based on assembly made of nine modules.

### Actuations of magnetic assemblies

The alignment experiments (Fig. 3B) and actuation of soft metamaterial were performed in the eight electromagnetic systems. Only uniform magnetic fields were applied to the assemblies. A dry polytetrafluoroethylene petri dish was used as the substrate to reduce friction. The configuration of the structure could be dynamically changed within a rapidly changing magnetic field (fig. S8). Some of the assembled metamaterials were disassembled during the experiments due to strong magnetic torque applied to the materials that overcame the magnetic bonding interactions (fig. S9, C and D). All videos were recorded using an iPhone 8 Plus under the room light. The static images of the assemblies were acquired using a mirrorless camera (Fuji X-T20), an iPhone 8 Plus, and a FireWire camera (Grasshopper, Point Grey Research Inc.).

**Corrected (19 November 2019):** The unit of measure in the x axis of Fig. 1C and numerous mathematical symbols and equations were corrected. The results and conclusions are not affected.

## SUPPLEMENTARY MATERIALS

robotics.sciencemag.org/cgi/content/full/4/35/eaax8977/DC1

Fig. S1. Magnetic assembly stage for quadrupole modules.

Fig. S2. Assemble process of a “pi” shape using the quadrupole modules in the assembly stage.

Fig. S3. Multipole expansion of the quadrupole structures.

Fig. S4. Strong poles and weak poles.

Fig. S5. Magnetic potential energy map of two quadrupole modules with varying angle θ.

Fig. S6. Ising model of magnetic quadrupole assemblies.

Fig. S7. Design space of the magnetization of a “small rocket”.

Fig. S8. Dynamic performance of the auxetic material assembled by quadrupole modules.

Fig. S9. Single-segment bending motion and collapse of soft metamaterials under large magnetic fields.

Fig. S10. Stability of quadrupole assemblies with mechanical disturbances.

Movie S1. Assembly process of magnetic quadrupole modules.

Movie S2. Actuation of programmable soft metamaterials assembled by magnetic quadrupole modules.

This is an article distributed under the terms of the Science Journals Default License.

## REFERENCES AND NOTES

**Acknowledgment:**We thank J.-C. Tse for assistance in 3D printing and T.-Y. Huang and X.-Z. Chen for fruitful discussions.

**Funding:**This work was supported by ETH grant (1916-1) and the European Research Council under the ERC grant SOMBOT (743217).

**Author contributions:**H.G. and Q.B. conceived the project and performed the modeling, simulations, experiments, and analysis of the results. All authors contributed to the discussion and wrote the manuscript.

**Competing interests:**The authors declare that they have no competing financial interests.

**Data and materials availability:**All data needed to support the conclusions of this manuscript are included in the main text or in the Supplementary Materials.

- Copyright © 2019 The Authors, some rights reserved; exclusive licensee American Association for the Advancement of Science. No claim to original U.S. Government Works