# Macroscopic emulation of microscopic magnetic particle system

Viesturs Spūlis  Daniels Gorovojs  Jānis Pudāns  Rolands Lopatko  Andris P.
Stikuts  Mārtiņš Brics  Guntars Kitenbergs  Jānis Cīmurs<EMAIL_ADDRESS>
###### Abstract

In this work, it is shown that macroscopic experiments can be used to
investigate microscopic system. The macroscopic experiment allow to test the
assumptions and results obtained in theory or simulations which can not be
obtained under microscope (e.g. the orientation of the spherical particle).

To emulate dynamics of single hematite cube in water in a rotating magnetic
field, a cubic magnet is firmly positioned in the 3D printed superball shell.
The dimensionless parameter can be equalized between microscopic and
macroscopic experiment using glycerol-water mixture instead of water and by
material and infill of the 3D printed shell. The pose of the superball is
tracked using ArUco (QR code) stickers.

It was found that qualitatively macroscopic experiments coincide with
theoretical predictions. However, the reduced thermal effects in the
macroscopic experiments increase friction between the superball and the
surface which shifts the critical frequency of the system.

Since the shell is 3D printed, the given method can be extended for use of any
shape and magnetization orientation.

###### keywords:

scale-up experiments , magnetic cubes , rotation tracking

###### PACS:

07.05.Fb , 05.65.+b

††journal: Journal of Magnetism and Magnetic Materials

[LU]organization=MMML lab, Department of Physics, University of
Latvia,addressline = Jelgavas iela 3, city=Riga, postcode=LV-1004,
country=Latvia

Microscopic magnetic materials can be emulated by small magnets in 3d printed
shells

Macroscopic emulation reveals complex dynamics in higher detail

With macroscopic experimental setup it was possible to observe all motion
modes of microscopic hematite cube.

##  1 Introduction

Building macroscopic analogue experiments to validate theoretical results
originally derived for microscopic systems has a history dating back at least
a century. For instance, in the classical work by G. B. Jeffery, he calculates
the increase of viscosity of a viscous fluid containing small elliptical
particles [1]. He proposes a hypothesis about the equilibrium orientation of
the particles, which could not be evaluated by the vanishing inertia theory.
Later G. I. Taylor validated the hypothesis by using millimeter sized
particles and a macroscopic apparatus filled with a very viscous fluid [2].
Similarly, Taylor developed an approximate theoretical description of the
viscosity of emulsions of tiny droplets [3]. Afterwards he validated the
theory and found its limits using a macroscopic experiment, where he visually
observed the deformation of individual centimetre sized drops in a very
viscous fluid [4].

To better understand behavior of microscopic multiparticle system, it is
desirable to examine what is happening at the individual particle level.
However, orientation of the isotropic (spherical) particles [5, 6] and even of
colloidal microscopic cubic particles [7, 8, 9] and particles of other forms
under an optical microscope can only be seen in a limited way. The latter is
because the resolution is insufficient to determine the orientation of the
particle.

The resolution can be improved using an electron microscope [10, 11, 12] or
the orientation can be obtained using NV-centers [13, 14], but both methods
requires stationary particles and do not allow the investigation of the
dynamic behavior of the particles.

The widely used method to describe the discrepancies between theory and
microscopic experiments is numerical simulations. Numerical simulations allow
the user to find the regimes that were missed in the theoretical evaluation.
However, not all discrepancies between theory and experiment can be explained
using simulations because simulations may have the same assumptions as the
theory that could be false in the experimental realization.

Some recent works using the macroscopic experiments focus on many-partcile
system behavior. For example, 3D self-assembly using dipolar interaction in
turbulent flow [15], self-assembly in suspension on the millimeter scale [16],
and self-assembly based on macroscale tiles [17] to name a few.

The advantage of the macroscopic measurements is that you can see the behavior
of the system with a naked eye from all angles. This allows one to determine
the movement of all particles and to grasp the dynamics in a much higher
detail. However, when comparing microscopic system with the macroscopic one,
it is important to equate the dimensionless quantities. The cost of enlarging
the particles using the macroscopic experiment, is the increase in the
Reynolds number for reasonable rotation speeds and the decrease in the thermal
noise effects. Other limitations are linked to the fact that a much smaller
number of particles can be investigated in macroscopic experiments and the
experimental setup becomes notably larger, and it is hard to ensure
corresponding external fields, e.g., magnetic field. Overcoming the latter
ones is important, as systems of colloidal microscopic cubic particles have
interesting collective effects, including swarming[18] and behaving as a a
chiral fluid [19].

This work has been motivated by the limitations in investigating dynamics of a
small number of microscopic hematite cubes, reported in Brics et al. [7, 8].
There the resolution limitation of the optical microscope did not allow us to
study the dynamics of a single hematite cube in a rotating field. Here we
overcome it by emulating a single hematite cube as a macrocsopic cube, as
shown below.

##  2 Theory

The shape of a magnetic hematite cube closely resembles a superball, the
surface of which is given by Eq. 1. The shape parameter $q$ defines how close
the superball is to a perfect cube, with the typical $q=\left[1.5,2\right]$
for hematite cubes, while the constant $a$ is the edge length [7]. Further
$q=2$ will be used.

$\left|\frac{2x}{a}\right|^{2q}+\left|\frac{2y}{a}\right|^{2q}+\left|\frac{2z}{a}\right|^{2q}=1$
(1)

The magnetic moment of a hematite cube is located on the plane defined by two
diagonals, at an angle of $12^{\circ}$ against the diagonal pointing out of
the face [7].

The motion of a cube in a rotating magnetic field can be modeled using a
microscopic model [8] of a magnetic superball. The equations of motion (EOMs)
are based in the Newton mechanics approach where only the essential forces are
introduced (hydrodynamics force $\vec{F}^{HD}$, buoyancy force $\vec{F}^{b}$,
and reaction force with bottom of the capillary $\vec{F}^{wall}$ ) to keep the
number of parameters minimal and ease interpretation.

For a hematite cube with an edge length $a$, magnetic moment $\vec{\mu}$, mass
$m$, and moment of inertia tensor $\boldsymbol{I}$ in an external homogeneous
magnetic field $\vec{B}$ the force and torque balance reads as follows:

$\displaystyle{m\frac{\mathrm{d}}{\mathrm{d}t}\vec{v}}=\vec{F}^{HD}+\vec{F}^{b}+\vec{F}^{wall},$
(2)
$\displaystyle{\boldsymbol{I}\frac{\mathrm{d}}{\mathrm{d}t}\vec{\Omega}}=\vec{\mu}\times{\vec{B}}+\vec{T}^{HD}+\vec{T}^{wall},$
(3)

where $\vec{\mu}\times{\vec{B}}$ is magnetic torque produced by the external
field and $\vec{T}^{HD}$, $\vec{T}^{wall}$ are torques of corresponding forces
in Eq. 2.

Unfortunately, the equation system Eqs 2-3 is not closed as the knowledge of
$\vec{\Omega}$ at a specific time point is not sufficient to determine the
orientation of the superball. Thus, reaction forces and torques with the
bottom surface can not be calculated. To overcome this issue quaternions
$\vec{q}$ are used [20]. Quaternions themselves are four dimensional
normalized quantities which provides a convenient representation of spatial
orientations and rotations of elements in three dimensional space.
Quaternions, in principle, correspond to a rotation matrix, however,
quaternion approach requires to calculate time evolution of less dimensional
quantity than rotational matrices. Equation of motion for the quaternion

$\frac{\mathrm{d}}{\mathrm{d}t}\vec{q}=\frac{1}{2}\begin{pmatrix}0&-\Omega_{z}&\Omega_{y}&\Omega_{x}\\\
\Omega_{z}&0&-\Omega_{x}&\Omega_{y}\\\ -\Omega_{y}&\Omega_{x}&0&\Omega_{z}\\\
-\Omega_{x}&-\Omega_{y}&-\Omega_{z}&0\end{pmatrix}\vec{q}=\boldsymbol{Q}(\vec{\Omega})\vec{q}$
(4)

is always stable [21, 22], unlike EOM for Euler angles. Note that in this work
the angular velocities are given in the laboratory reference frame and for
quaternions scalar part last notation is used [23]. In the code Quaternion
operations are performed using a C++ template library for linear algebra Eigen
[23].

The buoyancy force can be calculated as:

$\vec{F}^{b}=d(\rho_{h}-\rho_{s})ga^{3},$ (5)

where $g=9.81\,\mathrm{m/s^{2}}$ is the free-fall acceleration, $\rho_{p}$ and
$\rho_{s}$ are densities of particle and solvent respectively, and
$d=\frac{\sqrt{2}\pi\Gamma^{2}(5/4)}{3\Gamma^{2}(3/4)}\approx 0.81$ is a
prefactor for the volume of superball $V=d\cdot a^{3}$(with $q=2$). In both
microscopic and macroscopic cases (see Tab. 1) the superball particles
sediment.

Both, for the experimental microscopic [8] and macroscopic conditions, it
turns out that corresponding Reynolds numbers $Re\ll 1$ and inertial terms can
be neglected as (${m\frac{\mathrm{d}}{\mathrm{d}t}\vec{v}}\ll\vec{F}^{HD}$)
and the relaxation frequency $f_{rel}=\frac{I}{\zeta}$ is several orders
higher than the driving frequency of the system ($f_{rel}\gg f$ see Tab. 1).
Therefore, the Stokes approximation assuming inertialess particles is used.
For hydrodynamics forces and torques, to keep equations analytically
analyzable, linear velocity drag approximation is used which for a cubic
shaped particle reads [24]:

$\displaystyle{\vec{F}^{HD}}$ $\displaystyle=-\xi\vec{v};\quad\xi\approx
3\pi\eta a\cdot 1.384;$ (6) $\displaystyle{\vec{T}^{HD}}$
$\displaystyle=-\zeta\vec{\Omega};\quad\zeta=\pi\eta a^{3}_{0}\cdot 2.552,$
(7)

where $\eta$ is the viscosity of the solvent, and $\xi$ and $\zeta$ are drag
and rotational drag coefficients respectively.

Already mentioned reaction forces $\vec{F}^{wall}$ and corresponding torques
$\vec{T}^{wall}$ are added so that the cube does not fall through the bottom
surface. The results do not depend on the choice of the exact expression for
the reaction forces whenever the model for the reaction forces is reasonably
chosen. To calculate them one could use the approach as in [8], however, even
for a single superball this becomes computationally very demanding. Thus, to
ease the computational task superballs are reconstructed out of spheres and
reaction forces are calculated as in [25, 7]. The superball located at
$\vec{p}=\\{x,y,z\\}$ is replaced with 93 spheres with radius $R_{i}$ and
radius vectors of centers $\vec{P}_{i}=\\{X_{i},Y_{i},Z_{i}\\}$ relative to
the center of superball as in [7] and repulsion forces and torques are
calculated for every sphere with bottom surface located at $z=z_{0}$. For
steric repulsion Weeks-Chandler-Anderson potential is used [26]:

$U_{i}=\left\\{\begin{array}[]{ll}4\varepsilon\left[\left({\frac{\sigma_{i}}{r_{i}}}\right)^{12}-\left({\frac{\sigma_{i}}{r_{i}}}\right)^{6}\right],+\epsilon&{\rm
if}\;r_{i}<R_{i}\\\ 0&{\rm if}\;r_{i}\geq R_{i}\end{array}\right.\,,$ (8)

with $r_{i}=Z_{i}+z-z_{0}$ and $\sigma_{i}=R_{i}/2^{1/6}.$ Thus, reaction
forces and torques read:

$\displaystyle\vec{F}^{wall}$
$\displaystyle=\sum_{i=1}^{93}-\vec{\nabla}U_{i}\,$ (9)
$\displaystyle\vec{T}^{wall}$
$\displaystyle=\sum_{i=1}^{93}\vec{\nabla}U_{i}\times\vec{P}_{i}.$ (10)

Combining all expressions the EOM for dimensionless variables reads:

$\displaystyle\begin{split}\tilde{v}_{z}&=kS\left(\tilde{F}^{b}_{z}+{\tilde{F}}_{z}^{wall}\right),\\\
\boldsymbol{\tilde{\Omega}}&=\boldsymbol{\hat{\mu}}\times\boldsymbol{\hat{B}}+S\boldsymbol{\tilde{T}}^{wall},\\\
\frac{\mathrm{d}}{\mathrm{d}\tilde{t}}\boldsymbol{q}&=\boldsymbol{Q}(\boldsymbol{\tilde{\Omega}})\boldsymbol{q},\end{split}$
(11)

with $\tilde{}$ denoting dimensionless variables apart from unit vectors,
which are denoted with $\hat{}$, e.g. $\boldsymbol{r}=r\hat{\boldsymbol{r}}$.
Note that here nondimensionalization for time $\tilde{t}=\frac{\zeta t}{\mu
B}$ and distance $\tilde{\boldsymbol{r}}=\frac{\boldsymbol{r}}{a}$ is used
leading to dimensionless variables
$\tilde{\boldsymbol{v}}=\frac{\boldsymbol{v}\zeta}{\mu Ba}$ ,
$\tilde{\boldsymbol{\Omega}}=\frac{\boldsymbol{\Omega}\zeta}{\mu B}$,
$\tilde{\boldsymbol{F}}=\frac{\boldsymbol{F}}{d(\rho_{h}-\rho_{s})ga^{3}}$,
and
$\tilde{\boldsymbol{T}}=\frac{\boldsymbol{T}}{d(\rho_{h}-\rho_{s})ga^{4}}$.
The EOM has two parameters $S$ and $k$, from which only

$S=\frac{d(\rho_{h}-\rho_{s})ga}{MB}$ (12)

is adjustable in experiments by changing the magnitude of the external
magnetic field. The parameter

$k=\frac{\zeta}{a^{2}\xi}\approx 0.614$ (13)

is drag coefficient ratio. It does not depend on the size of the particle but
depend only on its shape and thus is fixed if shape of the particle keeps the
same.

##  3 Experimental setup

The macroscopic 3D model geometry was defined with shape parameters $q=2$ and
$a=1\,\mathrm{cm}$. A $5\times 5\,\mathrm{mm}$ large and $0.1\,\mathrm{mm}$
deep square indent was made on all faces of the superball to allow for
accurate placement of markers. A cube with an edge length of $3\,\mathrm{mm}$
is subtracted from the center of the superball, allowing for the insertion of
a magnet once the shell is printed. The insert is positioned in a way that
positions the magnetic moment of the cube magnet in the same way as the the
magnetic moment is positioned in a hematite cube. The superball is split along
the shape of symmetry, and circular indents/extrusions are made to connect the
two halves of the shell. The lower half of the superball model is shown in
Fig. 1.

Figure 1: 3D model of the superball shell lower half, modelled in Fusion 360
CAD software.

The shells are printed in a resin 3D printer (Elegoo Mars 2 Pro), using black
resin for high contrast against the background and markers.

When the lower and the upper parts of the superball have been printed, in the
center of the superball we place a 3$\times$3$\times$3 mm neodymium magnet
(class N45, Supermagnete) with volume magnetization
$M=$860\text{\,}\mathrm{k}\mathrm{A}\mathrm{/}\mathrm{m}$$ and magnetic dipole
moment $\mu=$0.02\text{\,}\mathrm{A}\mathrm{m}^{2}$$. Then the two halves are
pressed tightly together. On each face of the superball unique ArUco markers
[27] are glued. The superball is placed in a rectangular box with inner size
L$\times$W$\times$H$=$17\text{\,}\mathrm{cm}$\times$11\text{\,}\mathrm{cm}$\times$8\text{\,}\mathrm{cm}$$.
The box is half filled with glycerol ($99.5\%$). However, the glycerol was
left for many days in an open box. As a result, due to water absorption, the
viscosity of the glycerol-water mixture has decreased to
$\eta=$130\text{\,}\mathrm{mPa}\text{\,}\mathrm{s}$$, which was measured by
Anton Paar Rheometer MCR 502.

The box is placed within three pairs of Helmholtz coils (see [28] for more
details), which generate the magnetic field. They are powered by 3 current
sources (KEPCO), which are controlled by a NI DAQ card using Python code. To
record the observations we use digital cameras - mobile phone (Apple) for
qualitative measurements and industrial camera (Basler ac1920-155um) with a
camera objective (Nikon) for quantitative measurements using tracking
explained in the next section.

The comparison between parameters of microscopic experiment (article [8]) and
macroscopic experiment (this paper) can be seen in table 1.

Parameter | Notation | Micro | Macro
---|---|---|---
Superball side length | $a$ | $1.5\text{\,}\mathrm{\SIUnitSymbolMicro m}$ | $1\text{\,}\mathrm{cm}$
Viscosity of liquid | $\eta$ | $1\text{\,}\mathrm{mPa}\text{\,}\mathrm{s}$ | $800\text{\,}\mathrm{mPa}\text{\,}\mathrm{s}$
Mean density of the superball | $\rho_{\mathrm{cube}}$ | $5.25\text{\,}\mathrm{g}\mathrm{/}\mathrm{c}\mathrm{m}^{3}$ | $1.47\text{\,}\mathrm{g}\mathrm{/}\mathrm{c}\mathrm{m}^{3}$
Fluid density | $\rho_{\mathrm{fluid}}$ | $1\text{\,}\mathrm{g}\mathrm{/}\mathrm{c}\mathrm{m}^{3}$ | $1.26\text{\,}\mathrm{g}\mathrm{/}\mathrm{c}\mathrm{m}^{3}$
Mean magnetization of superball | $M$ | $2.2\text{\,}\mathrm{k}\mathrm{A}\mathrm{/}\mathrm{m}$ | $31\text{\,}\mathrm{k}\mathrm{A}\mathrm{/}\mathrm{m}$
External field strength | $B$ | $\approx$1\text{\,}\mathrm{mT}$$ | $\approx$0.2\text{\,}\mathrm{mT}$$
Torque ratio | $S$ | $0.03$ | $0.65$
Gravitational parameter | $G_{m}$ | $0.04$ | $0.12$
Critical frequency of superball | $f_{\mathrm{c}}$ | $\approx$40\text{\,}\mathrm{Hz}$$ | $\approx$2\text{\,}\mathrm{Hz}$$
Relaxation frequency | $f_{\mathrm{rel}}$ | $\approx$5\text{\,}\mathrm{MHz}$$ | $\approx$0.4\text{\,}\mathrm{kHz}$$
Magnetic field frequency | $f$ | 0.1 – 40$\,\mathrm{Hz}$ | 0.1 – 10$\,\mathrm{Hz}$
Reynolds number | $Re$ | $\approx 0.001$ | $\approx 0.15$
Table 1: Comparison of parameters in microscopic experiments of hematite cubes
done in article [8] and macroscopic experiments of 3D printed superball with
enclosed cube magnet presented in this article.

##  4 Automatic tracking method

The addition of ArUco markers [29] on the faces of the superball allows to
track its position and rotation using a camera. This works by detecting and
recognising the markers on an image of the superball, and then using this
information to estimate its position and orientation. The details of this
method are described in this section.

The method of operation of a pinhole camera can be described by a $3\times 4$
matrix which maps 3D coordinates of real-world objects to their position on a
2D image. This is often termed the _camera matrix_. The camera matrix for a
given camera can be determined empirically using multi-plane calibration via
chessboard detection [30]. This functionality is implemented in various
computer visual libraries, such as OpenCV [31], which also offers
functionality to remove lens distortions from the images.

It is possible to detect and recognise different ArUco markers in an image of
the superball [29]. Each face of the superball has a unique marker, thus it is
possible to determine which sides of the superball are facing the camera by
considering which markers are detected on the image.

The relative positions between each marker and between their corners on the
superball are known. By finding the image coordinates of the corners of each
marker, it is possible to construct a 2D to 3D point correspondence. Then, a
perspective-n-point algorithm can be used to recover the position and rotation
of the superball by minimising the re-projection error [32]. An example image
with detected markers and estimated superball pose can be seen in Fig. 2.

Figure 2: From experimental superball image to detection and pose estimation.
(a) Experimental image of a superball. (b) Image after correction for
refraction. (c) Estimated pose of the superball (blue contour), where white
lines show the detected markers and red dots indicate marker corners. The
perspective-n-point algorithm attempts to minimize the distance between the
estimated location of the marker corners (red) and the detected markers
(white).

This method can be extended to track multiple superballs at the same time by
ensuring that each superball has a unique set of six markers. Having unique
markers for each superball allows to differentiate between each superball in
an image. However, having too many superballs in the setup is likely to limit
the precision to which the position and rotation of superballs can be
determined, since some markers might be covered by other superballs.

There are many effects that introduce errors in detecting the coordinates of
the corners of the markers. These include imperfectly cut and attached
markers, optical distortions due to ripples in the glycerol-water mixture,
vibrations of the setup and camera, etc. There are practical limits to the
extent to which these can be addressed, always leaving some errors in corner
detection.

To minimize the error in pose estimation, it helps if multiple markers can be
detected at once, thus giving more points to use in pose estimation. Due to
the cube-like shape of the superball, most of the time it will lie flat with
one marker facing upwards. Hence, it is inefficient to position the camera
right above the setup. Instead, if the camera is positioned at an angle to the
setup, most of the time at least two markers of a single superball will be
visible to the camera. This achieves the goal of having more points to use in
the perspective-n-point algorithm. It should be noted that having the camera
at an angle to the liquid-air interface introduces a visual distortion in the
images taken due to refraction. However, to the first order approximation,
this is simply a scaling in two orthogonal directions which can easily be
reversed digitally. For the particular camera position, the example in Fig. 2
(b) includes enlarging (a) image by $30\%$ along the vertical direction.

Perspective-n-point pose estimation algorithms rely on the perspective
distortion caused by some points being closer to the camera than others. If
the camera is located far from the setup, the perspective distortion is very
small. Thus, even small errors in the detected positions of marker corners can
lead to erroneous rotation and position estimates of the superball. This can
be minimized by moving the camera closer to the setup and thus causing a
greater perspective distortion. However, this significantly reduces the field
of view.

##  5 Results and Discussion

To validate and justify our macroscopic experimental setup, initially
experiments with a superball dimer in a rotating magnetic fields are
performed. It is verified that, for superball dimers, both synchronous and
asynchronous motion of dimer, including breaking and reconnecting, is
possible. This can be seen in the Supplementary Video S1. In the case of
synchronous rotation for magnetic fields, which corresponds to microscopic
experiments [8], the dimer rotates on an edge with magnetic moment in the
plane of the rotating magnetic field, as predicted. In the asynchronous
regime, back-and-forth rotation is observed. However, no modes were observed
where the dimer goes out of the plane of the rotating magnetic field. This can
be explained by a higher gravitational parameter $G_{m}$ in the macroscopic
experiments.

Further we performed experiments on a single superball, which were not
possible in microscopic scale due to microscope resolution limitations [7, 8].
The experiments were divided in two groups. First we tried to visually
determine qualitative cube motion characteristics, followed by more precise
measurements where motion of each superball’s face was tracked.

###  5.1 Phases of a single cube

The first thing tested in the macroscopic experiment was whether we can
visually identify all predicted motion modes that were predicted for a single
cube in the microscopic experiment [8]. Indeed, in synchronous regime, when a
magnetic particle rotates with the frequency of the rotating magnetic field,
we were able to observe all predicted cases in Video2 of [8]: superball
rotation on an edge, corner or face, depending on the rotating magnetic field
strength. However, rotation on an edge was observable only for small
frequencies, which were smaller than predicted in [8]. The reason for that is
probably the dry friction between a superball and the bottom of the container
which is more pronounced in the macroscopic experiment as thermal fluctuations
are negligible. Thus, in the macroscopic experiment, the superball rotates
more frequently on a corner than on an edge and face as friction torque for
rotation on the corner is several orders of magnitude smaller.

In the asynchronous regime we were able to observe precession (see
Supplementary Video S2) and back-and-forth motion (see lower two videos in
Supplementary Video S3). However, no complicated motion modes which are
combinations of precession and back-and-forth motion as in [8] were observed.
This can be explained again with dry friction as precession was observed only
for small frequencies slightly above critical frequency when asynchronous
motion was observed.

To be more sure that dry friction is the cause for discrepancies, we performed
experiments at weak rotating magnetic fields and noted the cube behavior in a
phase diagram, which is shown in Fig. 3 (see Supplementary Video S3 for some
examples). According to [8] the superball should always rotate on the face.
This prediction is true in the synchronous regime, however only for small
frequencies. In addition, the boundary between rotation on a face and rotation
on a corner is almost independent of the magnetic field strength. Moreover,
the slopes $k_{f}$ and $k_{c}$ for the lines separating synchronous regimes
(rotation on face or corner, respectively) from the asynchronous regime (back-
and-forth rotation) are different.

Figure 3: Rough sketch of the observed phases of a single cube from 91
measurements. Bi-colored regions denote magnetic field strength and rotation
frequency parameters at which multiple phases were observed to be stable.
Dashed lines indicate phase transitions where it was difficult to discern the
exact moment when the phase transition occurs.

If the dry friction is added to the model, the torque balance for synchronous
rotation reads:

$\zeta\vec{\Omega}=\vec{\mu}\times\vec{B}-\vec{T}_{\mathrm{Fr}},$ (14)

where $\vec{T}_{\mathrm{Fr}}$ is torque due to dry friction which is
independent on velocity. Thus, for the line separating synchronous regime from
asynchronous regime average slope $k_{i}$ and intercept $b_{i}$ reads:

$k_{i}=\frac{2\pi\zeta}{\mu_{\mathrm{plane}}};\quad
b_{i}=\frac{T_{\mathrm{Fr}}}{\mu_{\mathrm{plane}}},$ (15)

where $\mu_{\mathrm{plane}}$ is the projection of the magnetic moment in the
plane of the rotating magnetic field. When a superball rotates on a face
$\mu_{\mathrm{plane}}\approx 0.877\mu$, but when on a corner
$\mu_{\mathrm{plane}}\in(0.877\mu,\mu)$. Thus, the line separating asichronous
regime from synchronous regime, where superball rotates on a corner, has
$\mu_{\mathrm{plane}}\approx\mu$.

From Fig. 3 for $f>0.5\,\mathrm{Hz}$ for rotation on a face one finds
$k_{f}\approx(0.22\pm 0.1)\,\mathrm{mT/Hz}$ , $b_{f}\approx(0.16\pm
0.4)\,\mathrm{mT}$ and for rotation on a corner $k_{c}\approx(0.19\pm
0.1)\,\mathrm{mT/Hz}$ , $b_{c}\approx 0\,\mathrm{mT}$. The ratio $k_{c}/k_{f}$
within error range matches to predicted value of 0.877. Therefore, for
rotation on a face if $f>$0.5\text{\,}\mathrm{Hz}$$ the dry friction torque is
$T_{\mathrm{Fr}}\approx(4\pm 1)\mathrm{\mu N\cdot m}$.

###  5.2 Tracking markers

ArUco markers on a superball allow tracking of its position and rotation as
outlined in Sec 4. Imperfections in determining the exact positions of the
markers in an image cause errors in the measured rotation. Aside from small
scatter (noise on the order of few degrees), it was observed that occasionally
the measured pose was mirrored across a given plane. Often this could be fixed
by additional pre-processing of the collected data by guessing the plane
across which the pose was mirrored. However, this was not always feasible, as
the distortion was too great across the whole measurement. While increased
precision in the setup and improved pre-processing methods can likely
eliminate this issue, enough data could still be collected.

In general, the rotation of a three-dimensional object can be expressed via
three Euler angles. However, only one angle is sufficient when the object
rotates around a single fixed axis. Thus, the simplest example to track and
attempt to fit to theory is the motion of a superball when it rotates around
the axis normal to the surface it rests on. This subsection provides such an
example of a superball exhibiting back-and-forth motion around a fixed axis.

Fig. 4 shows the measured angle, $\theta_{t}$, of a superball in the plane of
rotation subjected to a uniformly rotating magnetic field. The field rotates
in-plane with the surface on which the superball rests. This data is fit to
Eq. 16, which is adapted from [8]. The fit, in principle, allows to extract
two crucial parameters—frequency of the rotating magnetic field, $\omega$
(which can be compared with the coil settings), and the critical frequency
when back-and-forth motion starts, $\omega_{c}$ (which can be compared with
theory). However, here to be sure that we are not overfitting as for small
times there are some discrepancies between fit and measured data, the $\omega$
was fixed to the value extracted from the coil data. The remaining two
variables, $t_{0}$ and $\alpha$, set the initial time and angle offset
respectively.

$\displaystyle\theta_{t}=\omega$ $\displaystyle\cdot(t-t_{0})+\alpha$
$\displaystyle-2\arctan\quantity[\frac{\omega_{c}+\sqrt{\omega^{2}-\omega_{c}^{2}}\tan\quantity(\frac{1}{2}\quantity(t-t_{0})\sqrt{\omega^{2}-\omega_{c}^{2}})}{\omega}]$
$\displaystyle\qquad{}-2\pi\left\lfloor\frac{(t-t_{0})\sqrt{\omega^{2}-\omega_{c}^{2}}}{2\pi}+\frac{1}{2}\right\rfloor$
(16)

The first term of Eq. 16 is the continuous rotation due to the rotating
magnetic field, and the second term is an initial angle offset. The third term
describes how much the superball “laggs begind” the magnetic field due to its
inability to rotate sufficiently fast. The final term in Eq. 16 makes the
arctangent term continuous, where $\lfloor x\rfloor$ brackets denotes whole
part of $x$.

Figure 4: Measured angle of a superball around an axis perpendicular to the
surface the superball rests on. The superball is subjected to a magnetic field
strength of $0.15\,\mathrm{mT}$ rotating with frequencies of
$f=1.4\,\mathrm{Hz}$ ($\omega=8.94\,\mathrm{rad/s}$) and $f=1.8\,\mathrm{Hz}$
($\omega=11.30\,\mathrm{rad/s}$). Solid curves are the fit of Eq. 16 with the
best-fit parameter $\omega_{c}=1.19\,\mathrm{rad/s}$ for both frequencies.

On visual inspection of Fig. 4, it seems that the measured data match the
best-fit line rather well, although for small times there are notable
discrepancies which most likely are caused by the inertial effects of the
fluid. The fluid flow was created by the superball, when the external magnetic
field was turned on as for rotation with relaxation frequency $f_{ref}$ (see
Tab. 1) $Re\gg 1$. For later times, the curve notably better fits measured
data. The data were also fitted with a numerical solution of the Eq. 3 with
included constant magnitude friction torque calculated in the previous
section. The curves were hardly distinguishable from the ones obtained by Eq.
16, therefore they are not shown in Fig. 4. Thus, it can be concluded that dry
friction do not influence the solid curve shape in Fig. 4. Only the critical
value of the magnetic field is affected.

Although there is some noise and scatter in the measured data, the
characteristic back-and-forth motion is clearly discernible and quantitatively
consistent with theory. The determined critical frequency
$\omega_{c}=1.19\,\mathrm{rad/s}$ ($f_{c}=0.19\,\mathrm{Hz}$) within the error
range is well consistent with the critical value determined for
$B=0.15\,\mathrm{mT}$ in Fig. 3. This demonstrates that the method of tracking
a superball using ArUco markers is viable. While analysis similar to the
example in this subsection can be done on a superball undergoing a more
complicated motion (e.g., with rotation along multiple axes), such examples
are out of scope for this paper.

##  6 Conclusions

Using macroscopic experiments, it is possible to check the theoretical
predictions of a single magnetic superball in a rotating magnetic field.
Macroscopic experiments allowed to distinguish between rotation on the face,
rotation on the edge and rotation on the corner of a magnetic superball. This
allowed to construct a phase diagram of the single magnetic superball in the
rotating magnetic field (Fig. 3). Qualitatively, the phase diagram coincides
with theoretical predictions. The pose of the superball can be obtained using
ArUco markers on each face.

Deviations from theoretical predictions were observed in the macroscopic
experiments, which can be explained by dry friction between the superball and
the bottom of the container. Further improvements for the given experimental
setup is needed to remove the effect of dry friction to better emulate
microscopic system where dry friction plays negligible role.

Macroscopic experiments with 3D-printed shell and magnetic core can be used to
simulate a wide variety of magnetic micro-particles. Adding water to glycerol
allows to control viscosity and density of the liquid. The size of the magnet,
form, material, and infill of the 3D-printed shell allows one to control
parameters of the particle. This allows equalization of dimensionless
parameters with the microscopic system and to obtain critical values in the
desired range. For single magnetic superball experiments, only one
dimensionless parameter should be equalized. If the size of the coil system
allows, the given approach can be used to investigate many particles systems
in higher resolution. For many magnetic superball system there would be two
dimensionless parameters to equalize.

##  7 Acknowledgments

This research is funded by the Latvian Council of Science, PostDoc Latvia
project No.1.1.1.2/VIAA/3/19/562 and project No.1.1.1.2/VIAA/1/16/060, and
FLPPLV project BIMs No. lzp-2020/1-0149.

## References

  * [1] G. B. Jeffery, The motion of ellipsoidal particles immersed in a viscous fluid, Proceedings of the Royal Society of London. Series A, Containing papers of a mathematical and physical character 102 (715) (1922) 161–179.
  * [2] G. I. Taylor, The motion of ellipsoidal particles in a viscous fluid, Proceedings of the Royal Society of London. Series A, Containing Papers of a Mathematical and Physical Character 103 (720) (1923) 58–61.
  * [3] G. I. Taylor, The viscosity of a fluid containing small drops of another fluid, Proceedings of the Royal Society of London. Series A, Containing Papers of a Mathematical and Physical Character 138 (834) (1932) 41–48.
  * [4] G. I. Taylor, The formation of emulsions in definable fields of flow, Proceedings of the Royal Society of London. Series A, containing papers of a mathematical and physical character 146 (858) (1934) 501–523.
  * [5] G. Camacho, A. Rodriguez-Barroso, O. Martinez-Cano, J. R. Morillas, P. Tierno, J. de Vicente, Experimental realization of a colloidal ratchet effect in a non-newtonian fluid, Phys. Rev. Appl. 19 (2023) L021001.  doi:10.1103/PhysRevApplied.19.L021001.
  * [6] D. Lips, E. Cereceda-López, A. Ortiz-Ambriz, P. Tierno, A. Ryabov, P. Maass, Hydrodynamic interactions hinder transport of flow-driven colloidal particles, Soft Matter 18 (2022) 8983–8994.  doi:10.1039/D2SM01114J.
  * [7] M. Brics, V. Šints, G. Kitenbergs, A. Cēbers, Energetically favorable configurations of hematite cube chains, Physical Review E 105 (2) (feb 2022).  doi:10.1103/physreve.105.024605.
  * [8] M. Brics, V. Šints, G. Kitenbergs, A. Cēbers, Rotating hematite cube chains, Phys. Rev. E 108 (2023) 024601.  doi:10.1103/PhysRevE.108.024601.
  * [9] W. Chen, X. Fan, M. Sun, H. Xie, The cube-shaped hematite microrobot for biomedical application, Mechatronics 74 (2021) 102498.  doi:https://doi.org/10.1016/j.mechatronics.2021.102498.
  * [10] P. Kruit, R. Hobbs, C.-S. Kim, Y. Yang, V. Manfrinato, J. Hammer, S. Thomas, P. Weber, B. Klopfer, C. Kohstall, T. Juffmann, M. Kasevich, P. Hommelhoff, K. Berggren, Designs for a quantum electron microscope, Ultramicroscopy 164 (2016) 31–45.  doi:https://doi.org/10.1016/j.ultramic.2016.03.004.
  * [11] X. Jin, Y. Li, J. Jiang, S. Xiao, J. Yang, J. Yao, Facile synthesis of monodispersed $\alpha$-fe2o3 cubes as a high-performance anode material for lithium-ion batteries, Ionics 27 (8) (2021) 3291–3299.  doi:10.1007/s11581-021-04128-4.
  * [12] M. Tadic, L. Kopanja, M. Panjan, J. Lazovic, B. V. Tadic, B. Stanojevic, L. Motte, Rhombohedron and plate-like hematite ($\alpha-fe_{2}o_{3}$) nanoparticles: synthesis, structure, morphology, magnetic properties and potential biomedical applications for mri, Materials Research Bulletin 133 (2021) 111055.  doi:10.1016/j.materresbull.2020.111055.
  * [13] L. Hall, C. Hill, J. Cole, L. Hollenberg, Ultrasensitive diamond magnetometry using optimal dynamic decoupling, Physical Review B - Condensed Matter and Materials Physics 82 (4) (2010).  doi:10.1103/PhysRevB.82.045208.
  * [14] J. Smits, A. Berzins, F. H. Gahbauer, R. Ferber, K. Erglis, A. Cebers, J. Prikulis, Estimating the magnetic moment of microscopic magnetic sources from their magnetic field distribution in a layer of nitrogen-vacancy (nv) centres in diamond, Eur. Phys. J. Appl. Phys. 73 (2) (2016) 20701.  doi:10.1051/epjap/2016150449.
  * [15] L. Abelmann, T. A. G. Hageman, P. A. Löthman, M. Mastrangeli, M. C. Elwenspoek, Three-dimensional self-assembly using dipolar interaction, Science Advances 6 (19) (2020) eaba2007.  doi:10.1126/sciadv.aba2007.
  * [16] A. Hafez, Q. Liu, J. C. Santamarina, Self-assembly of millimeter-scale magnetic particles in suspension, Soft Matter 17 (2021) 6935–6941.  doi:10.1039/D1SM00588J.
  * [17] M. Jílek, K. Stránská, M. Somr, M. Kulich, J. Zeman, L. Přeučil, Self-stabilizing self-assembly, IEEE Robotics and Automation Letters 7 (4) (2022) 9763–9769.  doi:10.1109/LRA.2022.3191795.
  * [18] O. Petrichenko, G. Kitenbergs, M. Brics, E. Dubois, R. Perzynski, A. Cēbers, Swarming of micron-sized hematite cubes in a rotating magnetic field – experiments, Journal of Magnetism and Magnetic Materials 500 (2020) 166404.  doi:10.1016/j.jmmm.2020.166404.
  * [19] V. Soni, E. S. Bililign, S. Magkiriadou, S. Sacanna, D. Bartolo, M. J. Shelley, W. T. M. Irvine, The odd free surface flows of a colloidal chiral fluid, Nature Physics 15 (11) (2019) 1188–1194.  doi:10.1038/s41567-019-0603-8.
  * [20] W. Hamilton, On quaternions; or on a new system of imaginaries in algebra, The London, Edinburgh, and Dublin Philosophical Magazine and Journal of Science 25 (169) (1844) 489–495.  doi:10.1080/14786444408645047.
  * [21] I. P. Omelyan, Algorithm for numerical integration of the rigid-body equations of motion, Phys. Rev. E 58 (1998) 1169–1172.  doi:10.1103/PhysRevE.58.1169.
  * [22] K. I. Kou, Y.-H. Xia, Linear quaternion differential equations: Basic theory and fundamental results, Studies in Applied Mathematics 141 (1) (2018) 3–45.  doi:10.1111/sapm.12211.
  * [23] G. Guennebaud, B. Jacob, et al., Eigen v3, http://eigen.tuxfamily.org (2010).
  * [24] K. Okada, A. Satoh, Diffusion coefficients of cube-like particles for application to brownian dynamics simulations, Transactions of the JSME (in Japanese) 85 (871) (2019) 18–00476–18–00476.  doi:10.1299/transjsme.18-00476.
  * [25] J. G. Donaldson, S. S. Kantorovich, Directional self-assembly of permanently magnetised nanocubes in quasi two dimensional layers, Nanoscale 7 (2015) 3217–3228.  doi:10.1039/C4NR07101H.
  * [26] J. D. Weeks, D. Chandler, H. C. Andersen, Role of repulsive forces in determining the equilibrium structure of simple liquids, The Journal of Chemical Physics 54 (12) (1971) 5237–5247.  doi:10.1063/1.1674820.
  * [27] O. Oda, S. Feiner, Goblin XNA: A Platform for 3D AR and VR Research and Education, Columbia University, Computer Graphics & User Interfaces Lab (2009).
URL https://graphics.cs.columbia.edu/projects/goblin/goblinXNA.htm

  * [28] M. Auzinsh, A. Berzins, R. Ferber, F. Gahbauer, L. Kalvans, A. Mozers, A. Spiss, Dependence of the shapes of nonzero-field level-crossing signals in rubidium atoms on the laser frequency and power density, Phys. Rev. A 87 (2013) 033412.  doi:10.1103/PhysRevA.87.033412.
  * [29] S. Garrido-Jurado, R. Muñoz-Salinas, F. Madrid-Cuevas, M. Marín-Jiménez, Automatic generation and detection of highly reliable fiducial markers under occlusion, Pattern Recognition 47 (6) (2014) 2280–2292.  doi:10.1016/j.patcog.2014.01.005.
  * [30] Z. Zhang, A flexible new technique for camera calibration, IEEE Transactions on Pattern Analysis and Machine Intelligence 22 (11) (2000) 1330–1334.  doi:10.1109/34.888718.
  * [31] G. Bradski, A. Kaehler, Learning OpenCV: Computer vision with the OpenCV library, ” O’Reilly Media, Inc.”, 2008.
  * [32] V. Lepetit, F. Moreno-Noguer, P. Fua, Epnp: An accurate o(n) solution to the pnp problem, International Journal of Computer Vision 81 (2) (2009) 155–166.  doi:10.1007/s11263-008-0152-6.