arXiv:2610.06046cs.ROOct 2026

Manuscript Offprint

arXiv:2610.06046

MagServo: Uncertainty-Resilient Hierarchical Magnetic Servoing via Learned Latent Representations

Yuhan Tan, Yameng Zhang, Pei Liu, Yao Zhong, Zhongliang Jiang

Yuhan Tan 1,2,†^{1,2,\dagger}, Yameng Zhang 2,3,†,∗^{2,3,\dagger,*}, Pei Liu 2,4^{2,4}, Yao Zhong 2^{2}, Zhongliang Jiang 2,∗^{2,*}

Abstract—Magnetic navigation provides contact-free and line-of-sight-independent feedback for robotic systems, yet existing approaches typically rely on explicit pose estimation or direct use of raw magnetic measurements, making accurate control susceptible to modeling errors, measurement noise, and disturbances. This work presents MagServo, a hierarchical learning-based framework for robust 6-DoF magnetic servoing directly using the learned latent magnetic feature. MagServo learns uncertainty-resilient magnetic representations through masked reconstruction and captures state-dependent interaction dynamics between robot motion and latent magnetic transitions without analytical magnetic models or explicit Jacobian supervision. Based on the learned dynamics, a hierarchical controller combines nonlinear model predictive control for coarse approach with local Jacobian inversion for precise fine regulation. Extensive physical experiments demonstrate submillimeter and subdegree accuracy, achieving mean terminal errors of 0.386 mm and 0.479° for 6-DoF pose reaching. MagServo further outperforms a localization-based control baseline in complex trajectory tracking and maintains robust performance under unseen magnetic-source configurations without retraining. A supplementary video of the real-robot experiments is available at https://youtu.be/rZt1NUP1Mr0.

Figure

Fig. 1. Magnetic servoing system comprising a robot manipulator, a dual-magnet end-effector fixture, and a 4×44 \times 4 magnetometer array.

I. INTRODUCTION

Magnetic localization and navigation technologies have attracted increasing attention due to their non-contact, real-time, and line-of-sight-independent nature, enabling reliable operation in visually occluded or confined environments [1], [2], [3], [4]. Their radiation-free nature further makes them particularly well suited for medical applications, particularly robot-assisted endoscopic examinations and minimally invasive procedures [5], [6]. In these cases, visual feedback is often compromised due to poor lighting conditions or physical obstructions between the observer and the target, such as a robotic capsule for gastrointestinal examination [2], [7].

Magnetic navigation methods can be broadly divided into two categories: explicit localization-based navigation and direct raw magnetic data-based servoing. The former requires explicit estimation of the robot end-effector pose from real-time magnetometer measurements using an accurate magnetic model. Navigation is then achieved by minimizing the error between the estimated current pose and the desired pose. To establish the mapping between the magnetic flux density measured by the magnetometers and the robot pose, various magnetic models have been investigated, including the magnetic dipole model [8], analytical model [9], and complete elliptic integral model [10]. Considering the inherent nonlinearity and modeling uncertainties of this mapping, Son et al. adopted a quadratic measurement model for online calibration [11]. To further improve pose estimation accuracy, numerical optimization methods, such as particle swarm optimization [12] and the Levenberg-Marquardt algorithm [13], are commonly employed to minimize the discrepancy between the measured and model-predicted magnetic fields. While these model-based approaches offer strong physical interpretability, they often require careful system calibration and computationally intensive iterative optimization, limiting their efficiency for real-time applications [14].

Recently, to reduce the complexity associated with parameter identification and iterative optimization while improving localization accuracy, learning-based methods have emerged to directly estimate robot poses from magnetometer measurements. Su et al. proposed AMagPoseNet for 6-DoF pose estimation of an annular magnet, where PoseNet is pretrained using data generated from a mathematical model and CaliNet adapts the learned mapping to the real magnetic field using a small amount of experimental data [15]. This model-assisted learning strategy substantially reduces the need for large-scale real-world data collection. Similarly, Zhao et al. employed differential magnetic signals and a

†^{\dagger}Yuhan Tan and Yameng Zhang contributed equally to this work.

*Corresponding authors: Yameng Zhang and Zhongliang Jiang (email: yamengzhang@mrc-cuhk.com; zljiang@hku.hk).

1^{1}Department of Bioengineering, Imperial College London, UK. 2^{2}Department of Mechanical Engineering, The University of Hong Kong, Hong Kong SAR. 3^{3}Multi-scale Medical Robotics Center, AIR@InnoHK, Hong Kong SAR. 4^{4}School of Computation, Information and Technology, Technical University of Munich, Germany.

precisely calibrated magnetic model to generate large-scale simulated data for training a deep network, enabling accurate and real-time pose estimation [16]. Yang et al. proposed PRPosNet, which combines CNN-based local feature extraction, coordinate attention, and Transformer-based modeling to capture both local spatial characteristics and long-range dependencies among magnetic sensors [17]. Beyond direct pose regression, recent studies have increasingly incorporated physical priors into neural models to improve accuracy and generalizability. Shen et al. proposed a physics-informed residual network with a dual-branch architecture to explicitly correct discrepancies between the ideal magnetic dipole model and real magnetic measurements [18]. To account for measurement noise in practical magnetometers, Xie et al. augmented ideal magnetic data generated from a theoretical model with Gaussian noise and trained PoseNet on the synthetically corrupted measurements, achieving localization errors of approximately 1.54 mm in position and 2.24° in orientation [19].

Instead of explicitly estimating the robot pose, direct raw magnetic data-based servoing uses magnetometer measurements as feature descriptors and directly actuates the robot end-effector to minimize the corresponding feature errors [20]. This eliminates the need to map magnetic flux density measurements into Cartesian poses. However, direct servoing requires a Jacobian matrix that relates robot motion to variations in magnetometer measurements, which is challenging to derive analytically. To address this issue, Su et al. pioneered an online Jacobian estimation approach, in which the Jacobian matrix is vectorized as a state variable within a state-space formulation and estimated online using a Kalman filter (KF) [21]. Building upon this formulation, Tan et al. and Edelmann et al. developed model-free control strategies for magnetically actuated endoscopes [22], [23]. However, the performance of such methods strongly depends on appropriate characterization of the process and measurement noise statistics used by the KF. To relax the reliance on predefined static noise models, adaptive approaches have been introduced to dynamically update the process and measurement noise covariances during online control [24], [25]. Nevertheless, these approaches primarily estimate the Jacobian from feature variations and robot motion at the current control step, making the estimation susceptible to instantaneous measurement noise and disturbances. To further improve servoing stability, Zhang et al. introduced a Jacobian consistency assumption and incorporated a moving window of historical feature-error and actuation data, which are linearly combined with current observations to achieve more robust Jacobian estimation [20]. However, this approach remains susceptible to environmental disturbances and transient measurement drift induced by sensor noise.

To address these challenges, we introduce MagServo, a hierarchical learning-based framework for robust and accurate magnetic servoing. MagServo learns uncertainty-resilient magnetic representations through masked reconstruction and captures their motion-conditioned dynamics without requiring analytical magnetic models or explicit Jacobian supervision. The representation and dynamics are further jointly refined through multi-step rollout learning, establishing a robust, control-aware latent space for magnetic servoing. Leveraging the learned dynamics, MagServo combines nonlinear model predictive control (MPC) for rapid coarse approach with local Jacobian inversion for precise fine regulation. By directly translating latent magnetic discrepancies into corrective robot motions, MagServo bypasses explicit magnetic-to-pose estimation and enables accurate closed-loop 6-DoF servoing. The contributions of this work are summarized as follows:

  • We propose a direct magnetic servoing algorithm that uses learned latent magnetic representations as control features, eliminating explicit pose estimation and analytical magnetic modeling while remaining robust to measurement noise and disturbances.

• We introduce MagServo, which jointly learns latent magnetic representations and state-dependent interaction dynamics and integrates them into a hierarchical coarse-to-fine controller, combining nonlinear MPC with local Jacobian inversion for accurate and reliable magnetic servoing.

To evaluate MagServo, we conduct extensive physical experiments on 6-DoF pose reaching, complex trajectory tracking, and unseen magnetic-source configurations to assess its accuracy and generalizability. MagServo achieves submillimeter and subdegree accuracy, with mean terminal errors of 0.386 mm and 0.479° for pose reaching. Its effectiveness is further demonstrated by substantially outperforming the localization-based baseline and maintaining robust performance under unseen magnetic-source configurations without retraining.

References (29)