Magnetic position sensing for self-calibration and image registration of scanning fiber endoscopes

Abstract. We present a magnetic position sensor for scanning fiber endoscopes to address their inherent short- and long-term position instability, which is a major hurdle before their widespread clinical deployment. The position sensor uses a ring-shaped micro-magnet at the tip of the fiber cantilever, producing a dynamic magnetic field as the scanner resonates. A miniaturized three-dimensional Hall sensor accommodated within the endoscopic probe housing measures the magnetic field vector, which is then mapped directly to the beam position using closed-form calibration curves empirically obtained through a one-time calibration step using a position sensitive detector. By integrating the sensor into an OCT-endomicroscope recently developed in our group, we demonstrate an average position resolution of 20  μm over a field-of-view of 2.1 mm field-of-view and distortion-free OCT images recorded with various scan parameters. We also discuss how sub-pixel (e.g., better than half the diffraction-limited spot size) position resolution can be attained with the new sensing scheme.


Introduction
Reducing the outer diameter of endoscopes to access ever-narrower lumens in the human body has been a persistent goal in biomedical instrumentation research.Fiber bundles terminated with micro-objectives were the first to reach sub-mm outer diameters, albeit with very low resolution to maintain catheter flexibility.2][3][4] SFEs emerged to have a significantly stronger impact in endomicroscopy research than in standard video-endoscopy as the latter became dominated by chip-on-tip systems, since they offer the most compact solution to scan a laser beam in two dimensions with relative ease.Over the last two decades, fiber scanners have been adapted to numerous microscopy modalities, including confocal reflectance and fluorescence microscopy, 5,6 multiphoton microscopy, 7,8 optical coherence tomography, 9 second/third harmonic generation, and CARS microscopy. 10However, clinical translation efforts for this remarkably rich literature have been exceedingly rare.
It can be argued that the biggest hurdle before clinical deployment of SFEs is the need for calibration of their scan pattern and the long term viability of this calibration, which directly impacts the quality of acquired images.The complex interaction between the two degenerate natural modes of the fiber cantilever and their misalignment with the symmetry axes of the piezo actuator makes it practically impossible to establish a direct correlation between driving signals and the scanner position. 11Furthermore, due to the assembly tolerances, each unique scanner has a different set of optimum operating parameters (drive frequency, amplitudes, and phase angles).Therefore, after assembly, each scanner needs to go through a calibration step to identify its optimum operating point and to record a look-up table to act as a reference to locate the position of each acquired sample point.However, for an actual clinical imaging system, an open-loop calibration poses significant limitations.Due to high-temperature sterilization steps between patients, or simply due to varying environmental conditions, the operating point and the scan pattern at that point should be calibrated again before every imaging session.This elongates and complicates the clinical work flow.The solution is to equip fiber scanners with a position feedback mechanism to enable close-loop control, and hence, automated identification of the operating point, and scan calibration.Until very recently, there were only two attempts at solving this problem.2][13] The actual scan position was calculated from the actuator deflection using a linear spring-mass-damper model of scanning fiber.While this model works well for small fiber displacements, it cannot accommodate the nonlinear scan behavior observed in large field-of-view (FoV) SFEs for endomicroscopy.Furthermore, the parameters of the linear model can drift over time due to changes in clamping conditions, temperature changes, and aging, which can only be readjusted via a new calibration step.Zhang et al. extended this approach by interrogating the charge-sensing signal via a convolutional neural network to eliminate the effects of temperature changes and noise. 14The results are promising, but the sensor remains indirect, and susceptible to the effects of aging and changes in the clamping conditions.
In this work, we present a sensor-based direct position feedback mechanism for SFEs, which needs a single post-assembly mapping step to enable automated position calibration potentially for the rest of the instruments' lifetime.The sensor uses a miniaturized three-dimensional (3D) Hall sensor to track the magnetic field vector due to a ring-shaped micro-magnet accommodated at the tip of the fiber cantilever.Since it directly measures the position of the fiber tip, and hence the scanned beam, this sensor is insensitive to the changes in the piezo properties and the cantilever boundary conditions, given that the Hall sensor and the micro-magnet remains stable.Since it is not model-based, it can also accommodate nonlinear scanner behavior.We incorporated this sensor in an OCT endomicroscope that we have recently published 15,16 by modifying the on-tip optics of a fiber scanner.We discuss the details of the field-to-position mapping, and the sensor data post-processing methods necessary to attain accurate position information.We compare the resolution and the accuracy of scan patterns reconstructed with the new sensor to reference measurements from a position sensitive detector (PSD).
2 Piezoelectric Fiber Scanning 2.1 Operation Principle Figure 1(a) summarizes the working principle of an SFE that uses a radially polarized piezoelectric tube with four outer electrodes and an inner electrode.An applied electrical field between two opposite electrodes induces an electrical field Ẽ, which, due to the radial piezoelectric polarization Pp of the tube, points in the same direction as the polarization on one side and in the opposite direction on the other side.The resulting strain induces a bending of the piezoelectric tube.For a bipolar operation, the tip deflection can be estimated as E Q -T A R G E T ; t e m p : i n t r a l i n k -; e 0 0 1 ; 1 1 4 ; 1 0 6 where U is the applied voltage to the electrodes, d 31 is the piezoelectric strain coefficient perpendicular to the polarization direction, l piezo is the piezoelectric tube length, t piezo is the wall thickness of the tube, and D piezo is the outer diameter of the tube. 17Commercially available actuators usually have actuation ranges between 1 and 50 μm, depending on their geometry and material properties.While this range is not sufficient for any imaging application, it can be used to resonantly drive a cantilever formed by the delivery fiber.With resonant amplification, the fiber tip can be deflected by hundreds of micrometers, which enables high resolution imaging.
Once the operating frequency is chosen, sinusoidal signals of the chosen frequency are applied to the outer electrodes of the piezo-tube, leading to a fast circular motion of the beam.This generates a ring-shaped scan on the sample plane.An additional modulation signal with a much lower frequency (in the range of 0.5 to 20 Hz, which corresponds to the frame-rate) is used to modulate the excitation signals, effectively creating a spiral pattern.Due to resonance excitation, each ring is traced within the same amount of time, leading to a sampling density reducing from the center toward the periphery of the FoV.

Stability Issues
The fiber cantilever can be implemented as a bare fiber scanner or with beam shaping optics at its tip.Either way, the system can be modeled to a first degree as a simple harmonic oscillator.Since the resonance frequency of the piezoelectric tube is typically orders of magnitude larger than that of the cantilever, it can be treated simply as a pure harmonic excitation source.Figure 1(b) shows the frequency response of a sample fiber scanner we developed previously. 18Ideally, due to the rotational symmetry of the structure, the first two natural frequencies should overlap, leading to a circular motion.However, due to manufacturing tolerances, the first two modes can slightly bifurcate, forming two preferred axes.It should be noted that these axes are completely independent of the electrode orientation of the piezoelectric actuator (a thorough guide to driving such a fiber scanner can be found in Ref. 13).This splitting leads to significant challenges in driving and control of fiber scanners.Figure 1(b) also plots the scan patterns recorded with a PSD with the scanner driven along one of its preferred axes.Due to the complex interplay of two resonances, and the spring stiffening effects at large deflection angles, the scan pattern changes rapidly with drive frequency around the resonance peaks.A stable scan pattern can only be obtained slightly away from the resonance peaks, which comes at a cost of reduced scan amplitude.

Magnetic Position Sensing
The position sensing method we propose in this work comprises a micro-magnet at the tip of the fiber scanner and a 3D Hall sensor at a fixed position to track the changes in the magnetic field along the two transverse directions (x and y in Figs.2(a) and 2(b), respectively).A diametrically magnetized ring-shaped micro-magnet, whose size should be optimized for the desired resonance frequency of the scanner and the sensitivity of the sensor, has several advantages over alternative geometries.Foremost is the intact rotational symmetry of the scanner around the optical axis, which minimizes the bifurcation of primary axis resonances.Furthermore, compared to axial magnetization, this configuration enhances the field gradient at the sensor location for a given magnet size, leading to higher resolution.In this work, we used a single sensor placed at an offset along the y-axis to track the magnet position, leading to an inherent asymmetry in sensitivity.Figure 2(c) shows the simulated magnetic field intensity at the sensor location along the xand y-axes as the micro-magnet traces a spiral scan pattern.The magnet properties used for the simulations are those of the magnet used in the experimental realization: An NdFeB ring magnet with 1 mm outer and 0.5 mm inner diameter, 0.5 mm thickness, and a remnant flux density of 1.4 T. Figure 3 shows the simulation results for the mapping of magnet position on a uniform grid to the magnetic field at the sensor location.As this mapping is one-to-one, any arbitrary ðB x i ; B y i Þ vector can be uniquely mapped to a position vector x i ; y i .The significant distortion of the mapping, on the other hand, indicates a sensitivity that varies strongly across the position space, predominantly due to quadratic dependence of field intensities on the magnet-sensor spacing.
For instance, a magnet displacement of 1 mm along the x-axis corresponds to 7 mT and 1.2 mT field change on the sensor when the magnet is closest to and farthest from the sensor Fig. 3 Mapping from the position space ðx; yÞ, depicted in (a), to magnetic field space ðB x ; B y Þ, depicted in (b), shows that there is a one-to-one mapping between the two.Therefore, any combination of ðB x i ; B y i Þ corresponds to a unique magnet position ðx i ; y i Þ. Due to the asymmetry of the sensor position, the mapping is non-uniform, indicating a varying sensitivity across the position space.
Çalıko glu et al.: Magnetic position sensing for self-calibration and image registration. . . in the y-direction, respectively.With the same displacement, the B y spans a strongly asymmetrical range of 27 mT.The position-dependent sensitivity can in principle be addressed by using multiple Hall sensors in the probe housing.

Design and Manufacturing of the Prototype
For experimental demonstration of the position sensing principle, we built an OCT endomicroscope that shares its main architecture with a fiber-scanning endomicroscope that our group recently developed for OCT and OCT-angiography (OCT-A) imaging in bladder. 15Using selective laser-induced etching, this probe featured a high-precision lens mount manufactured in fused silica to accommodate a focusing lens at the fiber tip.In addition, a glass structure with precision passive alignment features produced using the same process enclosed both the optical and mechanical components.With a custom-developed encapsulation, this probe was proved to survive multiple standard sterilization process for multiple use. 16After sterilization, the dynamic behavior of the scanner changed noticeably, which imposed the need of open-loop calibration before every measurement session. 16igure 4 shows a rendering and a schematic of the modified endomicroscope with the position sensor.The excitation/collection light is delivered to/from the probe head to the proximal end through a single mode fiber (SM980G80, Thorlabs Inc.), which also acts as the scanning cantilever.For actuation, the probe features a tubular piezoelectric actuator 0.8 mm in outer diameter and 3.7 mm in length (custom manufactured by PI Ceramic GmbH, Germany).The main difference of this new probe design compared to the probe discussed in our work 16 is the functional fiber tip, which serves both as the focusing element with an aspheric surface at its distal end, and as the mount for the micro-magnet (R0100D-10, SuperMagnetMan LLP, properties listed above).We used a commercial 3D nano-printer (Photonic Professional GT+, Nanoscribe GmbH, Germany) to manufacture this element.A commercial three-axis Hall sensor (TLI493D, Infineon Technologies 19 ) integrated to the glass housing provides the means for magnetic field measurements.With chip dimensions of 1.13 × 0.93 × 0.59 mm, this sensor is the smallest one in the market today to the best of our knowledge.

Opto-Mechanical Characteristics
The mechanical performance of the scanner is defined by the length of the fiber cantilever, and the weight of the functional unit at its tip.With a free cantilever length of 2 mm, the first resonance frequency is located at 437 Hz.The profile of the aspherical lens surface provides a numerical aperture (NA) of 0.053, which translates to an expected confocal en face resolution of 9 μm in tissue.Since the design is non-telecentric, the maximum possible FoV is limited by the inner diameter of the probe housing, which is 2.8 mm.The surface of the tip was modeled in a commercial software package (OpticStudio 22.1.2,Zemax LLC), and the optical properties of the material, a commercially available resin (IP-S; NanoScribe GmbH, Germany), were modeled using the Sellmeier equation provided by Schmid et al. 20 Both were included in a merit function that minimizes the spot size at the desired working distance in water, varying the curvature c, conic constant k, and the even aspheric power coefficients a i of an aspheric surface of the form E Q -T A R G E T ; t e m p : i n t r a l i n k -; e 0 0 2 ; 1 1 4 ; 6 6 4 At the same time, the fiber-to-lens distance d fl was kept within the range of 0.2 to 1.5 mm during optimization to simplify the manufacturing process.We found that including only the second power coefficient was sufficient to achieve diffraction-limited performance for a deflection of up to 10 deg, with d fl ¼ 0.828 mm, c ¼ −3.56 mm −1 , k ¼ −0.327, and a 2 ¼ −0.449 mm −2 with d fl ¼ 820 μm.

Hall Sensor Characteristics
The Hall sensor used in this work has a maximum sampling rate of 11 kHz, and a noise floor of 85 μT at full bandwidth.With 12-bit data resolution within a measurement range of AE160 mT, it can provide a resolution of 156 μT.There are a few issues with these specifications, particularly considering the mapping plots shown in Fig. 3.The first is the speed of the sensor, which is not sufficient to provide a corresponding position data for a sufficiently dense (e.g., meeting the Nyquist criteria) sampling at reasonable volume rates (please see the OCT system specifications for a more detailed discussion).Furthermore, the sensor resolution is too low to match optical resolution, particularly when the sensor is far away from the magnet [e.g., lower part of the field map given in Fig. 3(b)].This imposes a lower limit on the volume of the micro-magnet, as well as the maximum distance between the active area of the sensor and the magnet.As we discuss below, these issues can be addressed using the a priori knowledge that the scanner motion is harmonic, and thus the position data are significantly band-limited.The complete spiral pattern can be reconstructed with a resolution close to the resolution of the probe, given that the sampling rate is larger than the Nyquist rate.

3D Micro-Printing of the Housing
The glass housing, which also acts as the micro-assembly platform, was identical to that discussed in Ref. 15 except the cap, which was modified to accommodate the Hall sensor mounted on a flexible printed circuit board (PCB).It features a mount for the piezoelectric tube at its proximal end, which aligns the scanning unit with the optical fiber and the central axis of the probe.To enable two-dimensional (2D) scanning, all four external electrodes of the piezo tube require connectorization.At the proximal end, the design includes holes for applying conductive epoxy and windows for verifying the electrode alignment.Each of these holes is accompanied by a channel that secures the wires in place.Further details on the structure, as well as the manufacturing process that uses selective laser etching of glass, 21 can be found in Ref. 15.

3D Nano-Printing of the Functional Tip
The functional tip has two main features.The base of the tip, oriented vertically in the printers coordinate system, is the part that includes the fiber inlet and the magnet mount.The lens, on the other hand, comprises an aspherical surface responsible from focusing the laser beam onto the desired plane.To reduce printing time, the base is printed at high writing speed and laser power.Since the fiber is glued into the fiber inlet with an index-matching adhesive, the optical quality of this surface is not of primary importance as long as the mechanical tolerances are acceptable.Layer-by-layer printing is achieved using the z drive of the 3D printer, which prevents stitching at the cost of reduced z-accuracy.Once the lens position is reached, the slicing distance, power, and speed are reduced to improve the surface roughness.Table 1 lists the relevant parameters used for the 3D printing process.Since OCT can be sensitive to layers with different hatching direction, 22 we chose a uniaxial hatching with 0.5 μm distance.The difference between the ideal and printed profiles is represented in terms of Zernike coefficients and compensated for accordingly in the subsequent printing step, as other groups have previously demonstrated. 23

Complete Probe Assembly
Once the piezo is assembled in the probe housing following the process detailed elsewhere, 15 the fiber is secured in position maintaining a free length of 2 mm.The 3D nano-printed tip is picked by vacuum through a flat-top syringe needle with an inner diameter of 0.5 mm, matching that of the magnet.This needle is then mounted on a xyz-stage for precise positioning.A small amount of index-matching adhesive (Loctite 3301, Henkel AG, Germany) is applied, and the tip is moved in the z-direction to ensure that its inlet is coated with the adhesive.After visual confirmation of the absence of air bubbles, the adhesive is cured using a focused ultraviolet (UV) beam.The vacuum is then released and the needle is removed from the fixture.For assembly of the magnet, it is critical that its poles are accurately aligned with the y-axis of the Hall sensor.Since the orientation of the magnetic field components (positive or negative) is not critical, a flattened syringe needle is used to allow the magnet to self-align.The needle is then mounted on the same stage, and the magnet is guided onto the tip, where it is securely attached using the same adhesive, applied only from the proximal side of the magnet to ensure that the optical surface is not damaged.Figure 5(a) shows the probe head after this step.Finally, the probe is closed with the cap [Fig.5(b)], which also bears the Hall sensor.A photo of the final assembly is shown in Fig. 5(c).

Optical Performance
Figure 6(a) shows the 3D nano-printed functional tip after assembly onto the fiber.The surface profile of the aspherical lens measured by white light interferometry is given in Fig. 6(b).The surface roughness was estimated by measuring a 25 μm × 25 μm area of lens with a 0.8-NAobjective (I190053, Zygo Cooperation), applying a high-pass Gaussian spline filter with a cut-off frequency of 25 μm and calculating the resulting RMSE. 24The lens is measured to have an RMS roughness of 10 nm, and a shape deviation well below 1 μm within the radius defined by the beam waist.
For beam characterization, the focal spot after the lens is imaged onto a CCD (UI-1240SE-NIR, IDS GmbH) through a 0.28-NA objective (Plan Apo 10x, Mitutoyo AC) and a relay lens  (TTL200-A, Thorlabs Inc.).By moving this simple microscope axially using a motorized stage (M-531 DDB, PI miCos GmbH), the entire beam profile could be imaged.The details of this characterization setup were presented in an earlier publication. 25The resolution and depth-offocus (FWHM) were determined to be 6.4 and 551 μm in air, and 8.5 and 716 μm in water, respectively [Fig.6(c)].

Scan Performance
The scan performance of the probe was first characterized with a PSD, which was also the basis for the mapping/calibration of the magnetic position sensor.The resonance frequency of the cantilever was measured to be 443.8Hz deviating from the simulated value by 7 Hz.probe with a drive frequency of 441 Hz and a modulation frequency of 0.25 Hz.A stable spiral scan pattern with a diameter of 2.12 mm could be obtained at this operating point.

Raw Sensor Data
Figure 8(a) shows the 2D magnetic field data recorded with the Hall sensor at a sampling frequency of 3.8 kHz for the scan pattern depicted in Fig. 7.A LabView routine that uses an FPGA for data acquisition was used for the sensor readout. 26The field distribution of the diametrically magnetized micro-magnet provides roughly three times higher sensitivity along y-axis at the sensor location, as expected.The non-uniform sensitivity across the position space manifests itself as higher harmonics in the sensor output, even though underlying motion is harmonic as shown in Fig. 7. Furthermore, due to the relatively low field strength compared to the measurement range of the sensor, the position feedback for small displacements, shown as insets in Fig. 8, is dominated by noise and quantization errors.The scatter plot of two sensor data along the two axes shown in Fig. 8(b) has no rotational symmetry unlike the scan pattern, which is also a result of the position dependent sensitivity.

Sensor Calibration
In order to map the sensor output shown in Fig. 7(a) to the reference PSD data of Fig. 7(b), a onetime calibration step is necessary, assuming that the magnetic properties of the micro-magnet and the sensitivity of the Hall sensor remains constant over the lifetime of the instrument.As Fig. 3 discussed, there is a complex and nonlinear relationship between the magnet position and the Hall sensor output.0][31][32] Figure 9 summarizes our implementation.The first step of the procedure is to simultaneously record the Hall sensor output and the reference PSD data at the defined operating point.Since the two data streams are not necessarily sampled at the same rate, an interpolation is necessary for one of the signals.In this work, the PSD was sampled at the OCT A-scan rate of 173 kHz, where the Hall sensor was sampled at 3.8 kHz.Thus, the former was downsampled to match the time series of the latter.Then, the beam position along the two axes is mapped on 3D scatter plots as functions of field strengths x PSD ðB x ; B y Þ and y PSD ðB x ; B y Þ, respectively.To increase the number of data point on these scatter plots, and the quality of the polynomial regression that follows, the modulation frequency (e.g., opening speed of the spiral) should be lower than the minimum required for ensuring Nyquist position sampling along the radial direction.In this work, we used a dense spiral scan of 0.25 Hz modulation frequency for this step.Finally, these scatter plots are fitted with sixth order polynomials to obtain the analytical expressions that can be used to map any arbitrary magnetic field vector to a unique beam position vector.

Sensor Performance
With the calibration curves in hand, we tested the performance of the magnetic position sensor for various drive parameters and compared the results to reference PSD measurements to quantify their deviation.The calculated x and y positions against the reference measurement are plotted in Fig. 10 for a spiral pattern recorded at 441 Hz drive and 0.5 Hz modulation frequency.Comparing Figs.10(a) and 10(b), it can be observed from the shape of the scan pattern can be reconstructed with some fidelity, but the non-uniformity of the sensitivity is discernible from the shape of the overall pattern.At its top half, where the magnet is closer to the sensor, the field gradients are stronger and the position can be traced more accurately.Furthermore, at the center of the scan pattern, the resolution is limited by the sensor quantization, particularly along the x-axis.The correlation of the reference and sensor output is plotted in Fig. 10(c).The sensed position error has a standard deviation of 79.6 and 61.3 μm along the xand y-axes, respectively, with respect to the reference measurements.The difference between the sensitivity of the two axes is due to the larger range B y spans for the same displacement compared to B x .The prior knowledge regarding the harmonic nature of the scan pattern allows for noise rejection by filtering the sensor output with a narrow band-pass filter centered around the drive frequency of the piezoelectric actuator. 26Figure 11(a) shows the spectrum of the scan position acquired with the PSD, which confirms that the scanner motion is purely harmonic as the second harmonic components was −42 dB below the fundamental for both axes.We therefore used a sixth order Butterworth filter centered around 440 Hz with 100 Hz bandwidth to reduce the noise in the position data measured with the sensor.The frequency response of this filter is also depicted in Fig. 11(a).Further reduction of the bandwidth did not lead to higher sensitivity, as the main limiting factor at this range is the resolution of the Hall sensor itself.additional filtering step.In this case, the standard deviation between the measured and reference positions reduced to 23.6 and 21.2 μm along xand y-axes, respectively [Fig.11(c)].The impact of this improvement can be observed in Fig. 12, which plots the position traces along three different radial trajectories of different radii with and without the filtering step.

Imaging Results
To demonstrate the performance of the new position sensor for practical imaging, we have acquired 3D OCT images.The en face position of the A-scans were registered both by the PSD and the new sensor in open-loop to allow direct comparison.We used a custom-developed OCT system based on an akinetic tunable source (Atlas Akinetic Laser, Insight Photonic Solutions) with a central wavelength of 1310 nm, a bandwidth of up to 90 nm, and a maximum output power of 60 mW.The A-scan rate was 173 kHz.The interferograms were detected with a balanced photodetector of 400 MHz bandwidth (PDB48xC-AC, Thorlabs Inc.) and digitized with a high-speed data acquisition card (ATS9360-4G, Alazartech, Canada).The scan profile at the specific operating point was recorded by a PSD shortly before the OCT measurements and assumed to remain stable until the OCT data were recorded.The output of the magnetic position sensor was also recorded alongside the PSD data, such that the same OCT volumes can be registered with both.Figure 13(a) depicts an OCT image of a common European castor bean tick (Ixodes ricinus) acquired in 0.5 s at 1 Hz spiral modulation frequency.The sample was chosen, as it was readily available during the imaging session, which followed a hiking trip.The body and the head of the tick can be identified from the tomogram.The highly reflective figure on the body is a scratch  formed by the tweezers during handling of the sample, providing a convenient feature for qualitative comparison of PSD and magnetic sensor based position registration.Figures 13(a) and 13(b) are maximum intensity projection images for 1 to 2 mm and 0 to 1 mm depth range, respectively, which are registered in position by the PSD (left) and magnetic position sensor (right).The arrows of matching colors highlight sample features that present noticeable differences between the two matching images.As the magnetic sensor has about half the optical resolution, the images registered with it has a lower image quality compared to the one with PSD registration.This effect can be observed for both of the projection images, but it is more noticeable in Fig. 13(a), as this image has finer features.2D tomograms showing the cross-section view of the sample along the symmetry axis of sample's body registered in position by the PSD (left) and the magnetic position sensor (right) are depicted the Fig. 13(a).Similar to the maximum intensity projection images, the two images match very well, with the latter showcasing the expected loss of resolution.Any major phase error in position reconstruction would manifest itself as a characteristic "whirling" pattern, which is completely absent in the sensor-registered images.On the other hand, the certain features in the images, particularly the trace of the scratch on the sample surface, deviate in shape compared to the matching ones on the reference images.As the correlation of the two position data plotted in Fig. 12 does not indicate any systematic error in position reconstruction, such distortions are unexpected.We believe that the major factor behind this discrepancy is the difference in the relative angles between the probe and the PSD during the initial sensor calibration and the successive OCT experiments.Furthermore, the images registered with the magnetic sensor also have missing pixels, which are all appear on a spiral pattern, indicating a periodic loss of magnetic position data.We attribute this effect to interruptions in the communication between the sensor and the control computer.

Conclusion
We discussed an electromagnetic position sensor for SFEs commonly used for endomicroscopy applications.In this method, a micro-magnet is attached to the tip of the fiber cantilever.As the fiber oscillates, the 3D magnetic field generated by the magnet is measured using a commercial 3D Hall sensor embedded in the cap of the endoscopic probe.The magnetic field vector at the sensor is mapped to the spatial location of the magnet by a one-time calibration step, which is invariant with respect to the scan pattern (or cantilever's behavior).This map can then be used at any given time to recall the position of the laser spot on the imaging plane.By addressing both the short and long term stability problems of SFEs, the developed process can pave the way for their widespread clinical use not only for OCT but also for other endomicroscopy modalities.
With an average sensor resolution of 20 μm and an FWHM spot size of 10 μm, the probe in its current form could not attain sub-pixel position registration.This is mostly due to the limitations imposed by the use of a standard commercial Hall sensor.Using a bare Hall sensor placed closer to the micro-magnet, whose sensing range closely matches the field strength of it would lead to a significantly higher sensitivity.On the other hand, even with the current magnet-Hall sensor pair, reducing the initial gap between the sensor and the magnet can quadratically improve sensitivity, whereas compromising the maximum FoV.The can also be enhanced by increasing the magnet volume, but this would compromise the operation frequency.Florian Lux received his bachelor's and master's degrees in microsystems engineering from the University of Freiburg, with a focus on photonics and biomedical engineering, in 2020 and 2022, respectively.He is currently with the Microsystems for Biomedical Imaging Laboratory, where his research concentrates on miniscopes.
Yanis Taege received his BSc degree in physics from the University of Constance in 2017 and his MSc degree in applied physics from the University of Freiburg in 2019.He received his PhD in microsystems engineering in 2023 from the University of Freiburg at the Laboratory for Micro-Optics working on 3D micro-and nanofabrication strategies for microendoscopic systems.
Çaglar Ataman received his PhD in electrical engineering from Koç University, Istanbul, Turkey, in 2008, and worked as a postdoctoral researcher at École Polytechnique Fédérale de Lausanne, in Switzerland, between 2008 and 2012.From 2012 to 2021, he was a senior scientist at the Department of Microsystems Engineering of the University of Freiburg, Germany, where he has been an assistant professor since 2021, leading the Microsystems for Biomedical Imaging Group.

)
Çalıko glu et al.: Magnetic position sensing for self-calibration and image registration. . .

Fig. 1
Fig.1(a) Operation principle of a typical piezoelectric fiber scanner.If the drive frequency f drive is close to the natural frequency of the fiber cantilever, small bending of the piezo tube can be resonantly amplified to obtain large tip deflection.(b) Typical frequency response of an SFE.Due to assembly tolerances, the natural oscillation modes along the primary axes might slightly split, leading to unstable scanning within the proximity of resonance peaks.To obtain more stable scan, SFEs are usually operated off-resonance, which compromises scan amplitude.

Fig. 2
Fig. 2 Magnetic position feedback principle with diametrically magnetized ring-shaped micro-magnet.(a), (b) The field vector ðB x ; B y Þ at a particular point in space is measured by a multi-axis Hall sensor.If the fiber is displaced during each A-scan to a position ðx i ; y i Þ, shown in the middle panels, the corresponding magnetic field components ðB x i ; B y i Þ change as well.These are plotted on the right, with the amplitude of B y being color-coded in red (positive) and blue (negative).(c) Variation of B x (top) and B y (bottom) during a typical spiral scan of the fiber tip from the center to the edge of the image field.

Fig. 4
Fig.4Integration of the Hall sensor and functional tip into the OCT probe head.(a) Schematic render the probe head.The functional tip, including the diametrically polarized magnet, is mounted at the tip of the fiber.The 3D-Hall sensor, which is placed into the cover of the probe, is located 1.4 mm away from the optical axis.As the field strength scales quadratically with the distance from the magnet, moving the sensor closer the optical axis would boost the position sensitivity while compromising maximum achievable FoV.(b) Drawing of the functional tip, in which the magnet is color-coded according to its magnetic field orientation.

Fig. 5
Fig. 5 Photos of the probe during assembly process.(a) Photo of the OCT probe before the cap assembly.(b) The Hall sensor is mounted on a flexible PCB, which itself is placed on the probe cap.(c) Photo of the complete probe after assembly.

Figure 7 (Fig. 7
Fig. 7 pattern of the probe measured at the distal end of the probe with a drive frequency of 441 Hz and a modulation frequency of 0.25 Hz.As this pattern is used forming the sensor response surfaces through multivariate polynomial regression, its long duration helped to increase the size of the data set used for the fitting.(a) Position traces along the x-and y-axes as a function of time.(b) The resulting spiral scan pattern with an outer diameter of 2.12 mm.

Fig. 6
Fig. 6 Results of the optical characterization of the functional tip.(a) Photograph of the functional tip depicting the base that accommodates the micro-magnet, and the aspherical lens surface.(b) Lens profile measured with a white-light interferometer.(c) The comparison of the measured cross-section profile to the ideal profile.The RMS surface roughness is 10 nm, whereas the maximum shape deviation across the beam waist is <1 μm.(d) The measured beam profile indicates an FWHM spot-size of 10 μm, which leads to an OCT (e.g., confocal) MTF cut-off of 140 linepairs/mm, according to the Rayleigh criterion.Scale bars: 100 μm.

Fig. 8
Fig. 8 Raw data from the magnetic position sensor for the scan pattern depicted in Fig. 7 for a complete opening and closing of the spiral.(a) Magnetic field traces along the two motion axes.(b) The resulting field space addressed by the same spiral scan.

Figure 11 (Fig. 9
Fig.9The sensor calibration procedure begins with the simultaneous and synchronized recording of reference PSD and the Hall sensor data for a dense, slow-opening spiral pattern.The former is downsampled to match the time series of both signals.The final calibration curves are obtained by fitting sixth order polynomials to the scatter plots x PSD ðB x ; B y Þ and y PSD ðB x ; B y Þ, respectively.

Fig. 10
Fig. 10 Sensor performance for a typical scan pattern.(a) The reference scan pattern recorded with the PSD at 453 Hz drive frequency.(b) The same scan pattern reconstructed using the Hall sensor output mapped onto the position domain using the calibration curves.(c) The correlation of reference and sensor measurements, indicating a standard deviation of 79.6 and 61.6 μm along the x -and y -axes, respectively.

Fig. 11
Fig. 11 Sensor performance with filtering for the same scan pattern depicted in Fig. 10.(a) The spectrum of the PSD data showing the harmonic scan behavior, allowing the filtering of the position data with a narrow-band filter centered around the scan frequency.(b) The same scan pattern reconstructed using the Hall sensor output mapped onto the position domain using the calibration curves, followed by the narrow-band filtering step.(c) The correlation of reference and filtered sensor measurements, indicating a standard deviation of 24.28 and 21.0 μm along the x -and y -axes, respectively.

Fig. 12
Fig. 12 Comparison of sensor output with the reference PSD measurement for a (0.25 Hz) spiral scan before filtering.(a) The radial lines over which the sensor data are compared with the reference.(b) Position traces along three arbitrary radial lines depicted in (a) calculated from the sensor without filtering.(c) Same lines reconstructed from the sensor data after filtering.

Fig. 13
Fig. 13 OCT measurements acquired with the probe with integrated position sensor.(a) 3D OCT tomogram of a castor bean tick (Ixodes ricinus) acquired with the custom-developed OCT setup.Position registration is done in open-loop using a scan pattern recorded prior to imaging both with the PSD and the developed position sensor.(b) Comparison of maximum intensity projection images of the 3D tomogram between 1 and 2 mm depth registered with the PSD (left) and the magnetic position sensor (right).(c) Comparison of maximum intensity projection images of the 3D tomogram between 1 and 2 mm depth registered with the PSD (left) and the magnetic position sensor (right).(d) Comparison of the cross-section views taken along the middle of the 3D tomogram registered with the PSD (left) and the magnetic position sensor (right).

David
Ilioae received his BSc and MSc degrees from the Nuremberg Institute of Technology Georg Simon Ohm in 2017 and 2019, respectively.Currently, he is a PhD candidate at the Laboratory for Micro-Optics at the University of Freiburg.Marius Kienzler received his BSc degree in medical engineering from the University of Furtwangen in 2018 and his MSc degree in optics and photonics from the Karlsruhe of Technology in 2021.Currently, he is a PhD candidate at the Microsystems for Biomedical Imaging Laboratory at the University of Freiburg.His research interests are focused on the development of endomicroscopes.

Table 1
Parameters used for the 3D nano-printing of the functional tip.