Collaborative Magnetic Manipulation via Two Robotically Actuated Permanent Magnets

Magnetically actuated robots have proven effective in several applications, specifically in medicine. However, generating high actuating fields with a high degree of manipulability is still a challenge, especially when the application needs a large workspace to suitably cover a patient. The presented work discusses a novel approach for the control of magnetic field and field gradients using two robotically actuated permanent magnets. In this case, permanent magnets—relative to coil-based systems—have the advantage of larger field density without energy consumption. We demonstrate that collaborative manipulation of the two permanent magnets can introduce up to three additional Degrees of Freedom (DOFs) when compared to single permanent magnet approaches (five DOFs). We characterized the dual-arm system through the measurement of the fields and gradients and show accurate open-loop control with a 13.5% mean error. We then demonstrate how the magnetic DOFs can be employed in magnetomechanical manipulation, by controlling and measuring the wrench on two orthogonal magnets within the workspace, observing a maximum crosstalk of 6.1% and a mean error of 11.1%.

several applications in medical robotics. Remote actuation capabilities facilitate miniaturization, which is particularly desirable for minimally invasive diagnosis and treatment in the human body. However, current approaches to magnetic actuation are typically limited by either a reduced workspace or potential to control a restricted number of DOFs. Herein, we present and fully characterize the dual external platform, which has the potential to overcome both limitations. It is characterized by a large workspace and can generate gradient-free fields in three dimensions and up to five independent magnetic field gradients.
While the platform can be applied to magnetic robots, spanning nano-, micro-, and millimeter scale, we mainly focus on the latter. Millimeter scale magnetic actuation poses several challenges, related to the generated uniform fields in a larger workspace and the requirement of higher actuating wrenches (forces and torques), thus higher field strengths. While successful multi-DOFs magnetic actuation has been demonstrated at small scale [1], [2], [3], [4], [5], [6], by using systems of coils, large-scale (milli-to centimeter) manipulation is yet to be fully proven. In fact, it might require several independently-controlled coils [7], [8], [9] to be effective along any possible direction of motion. Despite their ability to generate both homogeneous fields [10] and gradients [5], [7], [11], systems of coils are less scalable, compared to permanent-magnet-based magnetic actuators [10], [12], [13]. In fact, generating high fields via coil-based systems requires high power and can necessitate high-performance cooling systems. In many cases, designs are, therefore, restricted to a limited workspace [14], [15]. However, the main advantage of coil-based actuation comes from the possibility to readily generate linear field change, which is difficult to produce with permanent-magnet-based systems.
Systems of rotating permanent magnets have been proposed to mitigate energy consumption [16], but large-scale actuation is yet to be demonstrated.
Large-scale actuation systems include the usage of dualexternal permanent magnets (EPMs) [17], the coil actuation systems presented in [18], [19], [20], and [21] as well as the use of MRIs for both actuation and intraoperative imaging. The former is in use for actuation of magnetic cardiovascular catheters but only field actuation has been considered, so far, while we consider the control of fields and gradients independently. By considering that the EPMs can move asymmetrically with respect to each other, we contrast the idea of minimizing gradients [22], [23]. Both the gradient coils within an MRI [24], [25] and the fringe field created by the MRI bore magnet [26] have been shown to be suitable magnetic actuators. However, these systems have not yet been proven effective for multimagnet manipulation. Although multimagnet actuation techniques have been proposed, such systems are either characterized by workspace constraints [14] or exhibit low controllability [27] compared to the findings discussed in this article. By further developing the idea of remotely actuating a single internal permanent magnet (IPM) (internal since, generally, inside the human body) with a single EPM [12], we discuss how a pair robotically actuated EPMs are able to magnetically manipulate two IPMs, independently. This is achieved by independently controlling the torque (correlated to the magnetic field) and the force (correlated to field gradients) applied to each IPM.
In the present work, we assume the field generated by the two EPMs can be approximated with the dipole model and that the superposition principle applies. This is the case when the EPMs are far enough from the point of interest [28] and the workspace is free from metallic objects, which could deflect the field. We, first, introduce the concept of magnetic actuation and discuss the maximum controllable DOFs in a point. Then, we analyze the case of multipoint magnetic manipulation and provide a numerical analysis of the independent magnetic DOFs controllable in a large workspace.
Finally, we focus on robotic control of two EPMs and discuss magnetic manipulability, i.e., the ability of the robotic platform to generate combinations of independent fields and gradients. We validate our results by analyzing the fields and gradients generated by the platform by using a teslameter. We also prove that we can control up to eight magnetomechanical DOFs by measuring the generated wrench on two IPMs by means of highresolution load cells.

II. MAGNETIC ACTUATION
In the following, we describe the concept of multi-DOF magnetic manipulation. Specifically, we introduce the components of field and gradients that can be independently controlled.
We consider the case of actuating magnetic fields and gradients in a specified workspace W ≡ {O, x, y, z}, with origin O and principal axes x, y, z, as indicated in Fig. 1. From here on, unless specified, all variables are written in the frame W and avoid the reference W ·.
The general field at any point p can be expressed as [10] with B 0 field in the origin of W. The term o(p), lim ||p||→0 o(p) = 0 groups the terms of order higher than one. In Section V, we quantify the linearity of the generated fields to validate our assumption. By neglecting higher-order terms, the EPMs are considered as dipole sources. Although this reduces the fidelity of the model, it allows simplification when considering a small workspace. In the presented work, we consider the case of actuating two IPMs with minimal separation. This represents the worst case scenario for the determination of controllable magnetic DOFs; as with increased distance between IPMs the number of magnetic DOFs that can be controlled will only increase. In Section V, we quantify the linearity of the generated fields to validate this assumption. The matrix can be seen as the codistribution collection of each gradient, i.e.
or, equivalently, as the Jacobian matrix of B at the point p. We will consider the former definition, since mostly used in the literature. We assume that our workspace is free of currents, thus, Consequently, the matrix ∂B(p)/∂p must be symmetric and zero trace and the five independent components of the gradients can be collected in the vector field We will refer to · * : R 5 → R 3×3 as the mapping from the independent components of the gradients to the gradients codistribution: dB * (p) = ∂B(p) ∂p .

III. MAGNETOMECHANICAL MANIPULATION
The magnetic actuation paradigm presented here targets mechanical manipulation. Specifically, we aim to translate the magnetic work into mechanical work, to facilitate remote manipulation of magnetic agent(s). A magnetic agent is here referred to as a body, either locally rigid or flexible, characterized by an intrinsic magnetization; they can be permanent-magnet-based or electrically actuated coils. We can describe the magnetization of the ith agent with its global magnetic dipole vector W m i ∈ R 3 or m i , for simplicity's sake.
Each agent is also characterized by a specific and, generally time-dependent, location W p i ≡ p i ∈ R 3 . Thus, when the actuation system applies a field B 0 and gradients dB 0 at the origin of W, the ith agent experiences the gradients dB 0 and a field following (1): Consequent to its magnetic dipole m i and location p i within a field, the agent would experience a wrench f i and τ i refer to the force and torque on the agent i, respectively. To rearrange the field-wrench relationship to be linear with respect to the field and gradients [29], we introduce the operator · + : R 3 → R 3×5 which rearranges any vector v ∈ R 3 , premultiplied by the gradients so that the multiplication commutes as j + e j e T i and E ii = e i e T i , we can rearrange to The vector e i is here referred to as the ith element of the canonical basis of R 3 . We also introduce the operator · × : Eventually, (2) can be written as We can rewrite (1) as and, since dB 0 = dB(p), due to homogeneity assumption We combine (5) with (3), and obtain the wrench on the ith agent of magnetic dipole m i in a point p i To simplify the dissertation, we will focus on permanent magnets and refer to the magnetic agents as IPMs; however, the following applies to any object which may manifest a magnetic behavior, such as coils.
As known, we can actuate a maximum five DOFs for one IPM, as rank{S i } = 5. It can also be noticed that the maximum number of magnetomechanical DOFs we can actuate in a point is eight, as discussed in [5] and [12].
Consider the wrench applied to two IPMs First, we can see that rank{S i } = rank{P (m i )}, ∀p i , i, since V (p i ) is always full-rank. We can then consider the case p 1 = p 2 = p 0 , as general. It is easy to notice that if m 1 and m 2 are parallel, we can control up to five DOFs, as in the single magnet case. In the case m 1 and m 2 are not parallel, we can decompose m 2 in the parallel and orthogonal component to m 1 , i.e. m 2 = m 2 ⊥ + m 2 = m 2 ⊥ + λm 1 for some λ ∈ R and rewrite the wrench as and being norm-independent, i.e., for any vectors of nonzero norm m 1 , m 2 the rank of To find the rank of S ⊥ , we need to investigate the independent vectors between m 1 × and m 2 × , and the independent vectors between m 1 + and m 2 + . We can compute Between m 1 × and m 2 × we can find three independent vectors Equivalently, we analyze m 1 + and m 2 + and find five independent vectors Overall, this demonstrates that two magnets with nonparallel magnetic dipole direction can be actuated in eight independent DOFs anywhere in the workspace. In fact Notice that this holds when they experience the same gradient thus, generally, when they are close enough. When the agents are far (i.e., the gradient is not constant), up to nine magnetic DOFs could be actuated. The further DOF, however, depends on the IPM-IPM distance and can undergo singularity issues when the magnets are in close proximity. This article has the aim of discussing the nonsingular DOFs and does not analyze the case of the additional DOF, leaving this to future application-specific work.
It can also be noticed that adding further IPMs, in the case under analysis, would not introduce independent DOFs, since U 0 ∈ R 8 and no further independent inputs can be controlled.

IV. DUAL-EPM ACTUATION
In this article, we describe collaborative magnetic manipulation based on two KUKA LBR iiwa14 robots (KUKA, Germany) manipulating two cylindrical axially magnetized N52 EPMs (101.6 mm diameter and length). The pose of any permanent magnet can be related to field and gradients they generate by means of the dipole model. This model is accurate when the distance between the permanent magnet and the point of actuation is large enough [28]; for the EPMs considered the error is lower than 2% when the distance is larger than the magnet's radius. Our aim is to invert this relationship and find the target pose of the EPMs that generate a desired magnetic field and/or gradients.
We describe the field generated by one of the pair of EPMs as Herein, r i ∈ R 3 and μ i ∈ R 3 are the respective position and dipole moment of the EPM with respect to the workspace center; | · | stands for the Euclidean norm,· = · |·| and μ 0 is the air magnetic permeability. In (7), we highlighted the "modulus" of the field-dependent on the EPM-workspace distance (|r i |) and EPM magnetic dipole strength |μ i |-and "direction" of the field-related to the direction of the ith EPM to the workspace (r i ) and EPM orientation (μ i ). It should also be noted that (7) is linear with respect to the EPM dipole moment (μ i ) and that the modulus of the EPMs' dipole moment (|μ i |) is constant.
The gradients of the field with respect to the EPM-workspace relative position (r i ) results into We parameterize the magnetic dipole of the ith EPM through its orientation with respect to the world frame W. Specifically, we consider the ith EPM reference frame E i such that E i μ i = ||μ i ||e 1 . Notice that the orientation of the other axes is arbitrary, since the field is invariant to any rotation around μ i . In world frame W, the magnetic dipole here θ i and φ i are the respective pitch and yaw of the ith EPM. Specifically, R μ i (θ i , φ i ) = rot e 2 (θ i )rot e 3 (φ i ), with rot e j (·) elementary rotation around the axis e j .
The position of each EPM is described in polar coordinates We define the field and independent gradients generated by the ith EPM in the origin of the world frame W as The overall field and gradient in the origin of the world frame W can be written as according to the superimposition principle. We define the state space vector χ = (ρ 1 ψ 1 γ 1 θ 1 φ 1 ρ 2 ψ 2 γ 2 θ 2 φ 2 ) T and find the pose of the EPMs, by solving the optimization problem subject to the set of linear constraints    The polar limits were selected as a linear representation in polar space of the manipulators' reach. This is done in order to reduce the complexity of the error function compared with calculating the full inverse kinematic and checking against the joint space constraints at each sample point. For any desired field and gradients U d , the minimum radius ρ was imposed to guarantee the EPMs would not exceed safety limits. Table I specifies the parameters selected.
The optimization problem is solved by least-squares optimization utilizing the "Levenberg-Marquardt" algorithm. For an initial start point for the optimization an initial start state χ 0 is utilized as a guess. This state is chosen as the central point within the linear constraints. In the case that the algorithm fails to converge below the maximum permissible norm error (e max ), then the algorithm is reinitialized with a random start state selected uniformly from within the linear constraints. This process is repeated for a maximum of N random restarts. Once a solution has been found in polar space, standard inverse kinematic solvers are utilized in order to obtain the joint state solution for the collaborative manipulators, given their joint constraints (See Table II) and base pose (See Table III). The initial state for the inverse kinematics solver is provided by a random configuration from the KUKA robot constraints.
In Fig. 2, we report the results for ρ = 0.2 m, by generating all the combinations of positive field and gradients up to a maximum, for cylindrical EPMs with dipole moment norm 970.1 A·m 2 . Specifically, we impose a maximum of (max =) 10 mT for fields and (max =) 50 mT/m for gradients; these were found to be the maximum values we can actuate while satisfying the imposed constraints. For each of the eight DOFs, we sample at three discrete levels (0, max/2, and max) and solve for all the 3 8 combinations. We imposed error tolerance of e max = 10 −10 and N = 5. The error reported in Fig. 2 is the optimization target. Fig. 2 underlines the position of the EPMs for all the combinations and highlights the error for each desired field and gradients after the kinematics is inverted, i.e., once the kinematic limits were introduced. We show that the robots can reach each individual configuration with minimal error; thus, all the desired DOFs can be guaranteed.
In contrast to coil-based actuation, where the current-tofield mapping is linear, robotically-actuated permanent magnets present a more complex pose-to-field relationship where linear motions do not necessarily result in linear field changes. To understand this relationship within the actuation workspace, we consider the number of positive singular values of the Jacobian matrix ∂U ∂χ ; σ i = λ i > 0, with λ ith singular value as a measure of the magnetic reach from a specific pose. This represents the number of magnetic DOFs that can be reached from a given configuration of the EPMs through small linear motion of the EPMs themselves. Fig. 3 shows the magnetic reach for the set of poses considered in Fig. 2. It is apparent from Fig. 3 that regions closer to the center of the workspace show high magnetic reach, indicating multiple configurations can be guaranteed through small linear motions. Conversely, at the borders of the workspace, we see reduced magnetic reach, meaning that linear motion does not translate into linear field change and undesirable fields may occur during linear transitions. Fig. 4 shows how the error is less than 1% for the majority of field and gradient combinations (81.1%), before robots' kine- Fig. 3. Representation of the magnetic reach throughout the workspace, i.e., the magnetic DOFs that can be reached from each EPMs' pose via linear motion. Fig. 4. Representation of samples associated to each error percentage bin of 1%. Error in solving the optimization in (9) over grid of 3 8 combinations of the desired field and gradients at discrete levels (0, max/2 and max); maximum field (max=) 10 mT and maximum gradient (max =) 50 mT/m. matics is considered. We also notice that applying kinematic constraints minimally impacts the solutions, leading to 76.6% of the error being less than 1%.
The main limiting factor in achieving full convergence is the need for safety constraints. In fact, for some desired gradients, the optimal is achieved when the EPMs are too close to each other. Without constraints, we notice that, in 9.6% of the cases, the robots are closer than 0.2 m, which would apply a load beyond the maximum payload limit for the robots. For this reason, some of the solutions are suboptimal but safe in terms of EPM-EPM interaction.

V. EXPERIMENTAL ANALYSIS
We perform two sets of experiments to characterize the dEPM platform. First, we demonstrate multi-DOF magnetic actuation (see Section V-A), i.e., the ability to control multiple components of fields and gradients independently (measured by means of a teslameter) and multi-DOF magnetomechanical manipulation (see Section V-B) to validate how multi-DOF magnetic actuation can guarantee mechanical actuation of two independent magnets (measured via two six-axis load cells). The experimental setup is reported in Fig. 5.
For the first experiment [see Fig. 5(a)], a teslameter was placed in between the robots and its tip-the sensing portion-localized with respect to the base of each robot ( B i T E i , i = 1, 2) using a four-camera optical tracking system (OptiTrack, NaturalPoint, Inc., USA). For the second set of experiments, described in Fig. 5(b), we fixed two IPMs onto two load cells in a vertical rig; we can track the central point between the IPMs by means of the optical tracker and calibrate the system as for the teslameter.
All experiments rely on knowing the pose of the base of each robot with respect to the center of the workspace. For the presented experiments, this was achieved using an optical tracking system shown in Fig. 5; however, for a clinical scenario, this may be replaced with an alternative localization system (e.g., electromagnetic [30]) or intraoperative imaging (e.g., fluoroscopy). Optical markers were placed on the end-effector of each robot as well as on the instrument in question (teslameter Using direct kinematics, we find the transformation between the base of robot i and its end-effector B i T E i ; the position of the base of each robot with respect to the world frame was thus found as This was employed in the control of each robot using the optimization described in Section IV. The distance between the EPMs was also always controlled to guarantee negligible attraction/repulsion. The maximum safe field and gradients controllable with the system are 200 mT and 500 mT/m, respectively; beyond this, the EPM-EPM torque is close to the maximum payload of the robots (EPM-EPM distance of 0.2 m).

A. Magnetic Field Actuation
To validate the multi-DOF magnetic manipulation capabilities of the proposed platform, we measured the generated field using a three-axial teslameter (AS-N3DM, Projekt Elektronik GmbH, Berlin), represented in Fig. 5(a). The robots were controlled as described in Section IV, where the world frame is the tip of the teslameter. We performed eight experiments, controlling the robots to each of the three independently controllable fields and five gradients. In order to compute the gradients in each direction, we varied the position of the world frame origin p 0 in discrete steps, such that the field could be measured along each axis [26,30] with d = 0.01 m, for an overall workspace of 0.1×0.1×0.1 m 3 . By measuring the field along each axis, it was possible to compute the numerical derivative of the field in each direction and measure every component of the gradients. For more details on these experiments, see the Supplementary Video no. 1.
We controlled the field and gradients to values for which we can obtain a large operative workspace, i.e., feasible for general medical applications. We imposed a minimum EPM-EPM distance of 0.5 m and targeted a maximum applied field of 10 mT and gradients between 50 mT/m. Since these experiments require suitable sideways motion of the EPMs for the numerical derivative to be computed, we could not have the EPMs too close to the workspace. In Tables IV and V, we report the results obtained for all the eight DOFs, when controlled to its positive and negative maximum values, respectively. The crosstalk is the measure of the amount of activation of the DOFs, which are controlled to 0 (off-diagonal elements); it was measured as the mean for each trial (row of Tables IV and V).
Since we assume linear fields (or constant gradients), for each trial, we computed how much the measured field differs from the ideal linear field For each measured field B m (T ), we compute the max absolute error which is reported in Tables IV and V as the linear error ("Lin. err.").
Overall, the experiments demonstrate that the approximation of constant gradients holds, given the limited errors with respect to linear fields (maximum 9.2%). The maximum experienced crosstalk is 17.2%, which is acceptable in open loop. The mean error with respect to desired set-point is 13.5% on the field and gradient actuation (i.e., the one on the diagonal components of Tables IV and V). These results highlight that the optimization technique discussed in Section IV is able to accurately control eight independent magnetic DOFs. We expect closed-loop control will further reduce errors and crosstalk.

B. Magnetomechanical Manipulation
In the following, we describe how the independent magnetic DOFs, analyzed in the previous section, can be used to actuate two independent permanent magnets. These results would also apply to other objects exhibiting magnetic behavior, such as coils or magnetic particles embedded in soft polymers [31]. The scenario is schematically represented in Fig. 6. We positioned two orthogonally-magnetized IPMs along the global z-axis, spaced at a distance δ = 9.5 mm from the center of the world reference frame (W). The magnets, 9.5 × 9.5 × 9.5 mm 3 grade N-42 (K&J Magnetics, Inc., USA), were aligned so that their magnetic dipole was along z,m 1 = e 3 and y,m 2 = −e 2 ; here, ||m 1 || = ||m 2 || = ||m|| By applying (3), the wrench on each IPM can be computed as We assume δ ≈ 0 and select the independent DOFs to actuate These DOFs can be independently manipulated using our actuation system. To demonstrate this, we controlled the field and gradient components to the same maximum values of the previous experiments.
We performed these experiments with the setup shown in Fig. 5(b). The wrench on each IPM was measured with a six-axis load cell (Nano 17, ATI Industrial Automation, USA) with 6.25 mN and 31.25 mN·m resolution in force and torque, respectively. The load cell readings were zeroed before each experiment to offset the IPM-IPM interaction. Since the IPMs are not able of relative motion, the zeroing applies to the entire data acquisition.
The results for positive and negative wrenches are reported in Fig. 7. In figure, we show the activation of each independent DOF, as we control them in a precomputed sequence of EPMs positions. We selected the eight independent DOFs and computed the EPMs pose by applying the optimization described in Section IV. The y-axis represents the amount of activation of each independent force and torque, in their respective units. The torque is reported in N·mm and the force in cN (10 −2 N) to be comparable in the figures. For more details on the experiments, see the Supplementary Video no. 2.
The data show minimal crosstalk and demonstrate that all the target DOFs can be actuated independently in an open loop. We built the time-series T = (T 1 , T 2 , . . . , T 8 ) where T i is the time where the ith DOF activates. To compute the crosstalk, we find the mean cross-activation of the ith DOF (DOF i ) as i.e., the activation when it is desired not to be active. Its activation, when controlled to its maximum, is We measure the percentage mean crosstalk as 100 · A i /α i and report the results in Table VI.
We can see that the worst case mean crosstalk is as small as 6.1%, which demonstrates that up to eight DOFs can be actuated independently. We also notice that the assumption of small δ is satisfied, since the application of gradients (forces) does not generate undesired torques. The mean error with respect to the prediction from the dipole model is 10.85% and 11.10% in the respective positive and negative case, which is comparable to what experienced with field measurements (see Tables IV and  V).
Compared to coil-based actuation, the transition between independent DOFs is not inherently smooth when the robots are controlled in a point-to-point fashion. In fact, this approach does not guarantee that the transition is linear and it may generate undesired transient behaviors. This can be mitigated by introducing appropriate path planning for the robots' motion.

VI. CONCLUSION
In the present work, we introduced a novel approach for multi-DOF magnetic actuation in magnetomechanical robot manipulation. We discussed how this can be achieved by using a dual permanent magnet approach, with the EPMs being collaboratively actuated by two independent serial manipulators. We show that the introduced dEPM platform can both control gradient-free fields in all three directions and five main independent gradients components.
We demonstrate that a least-squares optimization routine can find the pose of the EPMs for a consistent set of combinations of every field and gradient. The solution is found within safety constraints, i.e., the EPMs are imposed not to invade a reserved workspace. We also consider the effect of the kinematic constraints of the robots and prove that a seven-axis manipulator is able to accurately control the EPMs to the desired poses.
We validate our claims with multiple experiments. First, we measure the fields and gradients in a 10 3 cm 3 workspace with EPMs at a distance of 50 cm to one another, by means of a teslameter. We prove that both the desired gradient-free field and gradients can be generated independently. The distance between the robots is compatible with medical applications, since the workspace is large enough to fit a patient.
We then prove how the applied field and gradients can be used for mechanical actuation by measuring the wrench on two separated magnets via a pair of six-axis load cells. We constrain the motion of the robots to a safe area and prove that eight mechanical DOFs can be actuated in this case. In the worst case scenario, we record a mean crosstalk of 6.1% in an open loop. During the experiment, the EPMs were controlled to move in a point-to-point fashion, which leads to possible spikes in the measured wrench. In the future, we will investigate smoothing of the applied wrench via optimal planning of the EPMs motion.
Herein, we prove that the dEPM platform is capable of achieving similar levels of magnetic manipulability to what can be obtained with the system of coils [5], [6]. We expect that the proposed actuation system can introduce a novel approach in remote actuation of small medical devices, which can generate stronger fields in a larger workspace compared to its coil-based counterpart.
Utilizing the dual EPM system within specific applications will necessitate consideration of the IPMs interaction forces and associated mechanical constraints of the robot's design. The associated force and torque requirements will determine suitability of the system, however, to minimize instabilities caused by IPMs crosstalk and nonlinear transitions, we will investigate closed-loop control, robots path planning, and improved modeling of the field. Furthermore, application to medical diagnosis and treatment will be analyzed with the aim of applying the actuation system to large-scale anatomy [31]. In these cases, the large fields and workspace, combined with the magnetic manipulability here demonstrated, will play a fundamental role in enabling navigation of complex anatomical structures.
ACKNOWLEDGMENT Any opinions, findings and conclusions, or recommendations expressed in this article are those of the authors and do not necessarily reflect the views of the Royal Society, EPSRC, or the ERC.
Tomas da Veiga received the master's degree in