Study of Train-Side Passive Magnetic Measurements with Applications to Train Localization

Passive magnetic sensors measure the magnetic field density in three axes and are often integrated on a single chip. These low-cost sensors are widely used in car navigation as well as in battery powered navigation equipment such as smartphones as part of an electronic compass. We focus on a train localization application with multiple, exclusively onboard sensors and a track map. This approach is considered as a base technology for future railway applications such as collision avoidance systems or autonomous train driving. In this paper, we address the following question: how beneficial are passive magnetic measurements for train localization? We present and analyzemeasurements of two differentmagnetometers recorded on a regional train at regular passenger service.We show promising correlations of the measurements with the track positions and the traveled switch way. The processed data reveals that the railway environment has repeatable, location-dependent magnetic signatures. This is considered as a novel approach to train localization, as the use of these magnetic signals at first view is not obvious.The proposedmethods based on passive magnetic measurements show a high potential to be integrated in new and existing train localization approaches.


Introduction
Train localization with exclusively onboard sensors and a track map is considered as a base technology for future railway applications, such as train control without additional track-side equipment, decentralized collision avoidance systems between trains, and autonomous train driving.
The train location is defined with a unique identifier of the current track and a longitudinal 1D position on that current track (see [1]).Train localization estimates this location, direction, and the train speed from train-side sensor measurements and a map of the railway environment.The technical challenges for onboard train localization are the requirements for safety-of-life applications with a very high reliability, track-selective accuracy, and seamless continuity of the train position.Track-selective localization identifies the correct track especially after passed switches and in parallel track scenarios.Global Navigation Satellite System (GNSS) position measurements are useful for train localization, but satellite geometry or reception can be poor or not available parts of the railway environment.A stand-alone GNSS receiver cannot fulfill the requirements for safety-of-life train localization, in particular in parallel track scenarios and in tunnels [2].Therefore, onboard train localization is often addressed by multisensor approaches as in [1,3,4].The general idea is to combine complimentary measurements.This implies that statistical and systematical errors of GNSS and other measurements are independent and suitable to compensate each other.
Passive magnetic sensors can measure the magnetic field as it appears at the sensor.These measurements are considered passive, as it does not use a self-generated magnetic field for sensing.Furthermore, there are no additional placed magnets or other markers in the railway environment.These sensors are often integrated in automotive and personal navigation equipment, such as smartphones.There, the usual purpose is the estimation of the heading angle with an electronically gimbaled compass technique [5].Classical compass approaches typically suffer from the effects of different magnetic fields compared to the earth field, which are denoted as distortions.On the one hand, there might be doubts about the

Related Work
Localization with magnetic field measurements is based on the comparison of signatures or landmarks.Magnetic fields in special environments can have a location-dependent signature, as shown in [7] for indoor environments.There, the distorted terrestrial magnetic field in buildings is measured with a passive sensor to create a magnetic map for indoor localization.
Extensive research on a magnetic train-side sensor has been conducted with the "Eddy Current Sensor (ECS)" in [8][9][10][11].This sensor is based on inductance measurements with coils.It uses an active self-generated field and measures conductive material in the railway environment.The ECS measures and classifies railway specific track components, such as clamps of sleepers and elements of a switch.It is used for train localization in [9,10] and the system can estimate speed, position, and the switch way.For an improved speed measurement, two coil-based sensors were placed with a defined distance in longitudinal train direction [11].The speed is estimated from the transit time of the signature between the two sensors.The signature is caused by local conductive material.
The abovementioned approaches are based only on components that are exclusively installed on the train without additional infrastructure in the railway environment.Infrastructure based localization with magnetic markers was proposed in [12] for road vehicles.This study contains a comprehensive analysis of magnetic signatures of highway bridges with magnetometers.However, the terrestrial magnetic field and the distortions were considered as interference.

Magnetic Field Model
3.1.Magnetic Field.The magnetic field in a railway environment is a complex superposition of different magnetic fields.An example of a typical railway environment is shown in Figure 1 with numerous ferromagnetic materials, possible dipoles, and power lines.Examples of these magnetic fields are the geomagnetic earth field, dipoles from ferromagnetic materials, and alternating fields from AC power lines, engines, and signaling.Two magneto static effects are of importance: Ferromagnetic materials, such as steel, can either contain a magnetic dipole or change an external field in the vicinity of the material.The first effect describes a permanent magnet and the resulting field is a superposition with the external magnetic field.The resulting field at the sensor element can be lower or higher depending on the strength and the directions between the external and the magnet's field vector.The second effect changes an external magnetic field in the vicinity of the ferromagnetic object.A ferromagnetic material has a higher permeability than air and concentrates more field lines inside the material.This causes a distortion of the directions and density of the external magnetic field lines in the vicinity.A lower field density is measured near and outside the object due to the concentration inside.This effect depends mainly on the distance to the sensor and it depends on geometry and dimension of the object.
The terrestrial magnetic field is very important as it is present over all locations and approximately time invariant.It serves as the mentioned external field, which interacts with the local ferromagnetic materials.The undisturbed local terrestrial magnetic field of the main station in Augsburg (start point of measurements) is given by total field strength, declination angle to north (), and inclination angle () from a magnetic model [13]: This is considered as the ideal magnetic field without interactions with the railway environment.

Magnetic Sensor Model.
The resulting magnetic field at the sensor is assumed by a simplified model, based on superpositions of different magnetic field origins and ferromagnetic effects (FE): This model contains the major effects from the application analysis of [6] and this study.The first part ⃗  env.(id, ) depends on the train location of a specific track id and a position  on that track.It contains the repeatable effects and signal components on a certain train location.The observed frequencies range from 0 Hz up to 20 Hz according to actual train speed.The heading-dependent component ⃗  earth () was analyzed in [6] with a railway compass evaluation.Depending on the vertical mounting position, the compass evaluation showed better results for higher positions (cabin sensor).For lower mounting positions (bogie sensor), the location and speeddependent parts are stronger, and the compass results were worse.The train attitude is mainly defined by the heading, as pitch and roll angles of trains are relatively small.The changes of the heading-dependent part are approx.1 Hz and below, because trains turn slowly.The wheel speed-dependent component ⃗  wheel (V) is caused by the turning ferromagnetic wheels.As shown in [6], the signals are periodic and linearly dependent on the wheel speed.The frequencies of the speeddependent wheel turns are in the range from 0 Hz (still-stand) up to 100 Hz and above, as aliasing effects were visible [6].The last part ( ⃗  rest ) contains currents and other effects such as a passing train.Currents are usually well defined in frequency.
For the localization with signatures, only the first component is of interest.Therefore, appropriate signal processing methods are needed to filter the location-dependent part.

Magnetic Field Measurements
4.1.Magnetic Sensors.Magnetic sensors such as Anisotropic Magneto-Resistance (AMR) sensors measure the magnetic field strength ⃗  [14].AMR sensors are low-cost sensors and up to three axes are integrated on a single chip [15].The measurement principle is based on a special material, called Permalloy, which changes the resistance according to the magnetic field in one direction.The resistance is measured by the bridge voltage of a bridge circuit with Permalloy resistors [14].A setup of three orthogonal sensor elements allows measurements of the magnetic field vector in three dimensions.

Measurements Setup.
The measurements were recorded on the passenger train "Alstom Coradia Lint41" at regular passenger service conditions.Two magnetic sensors, a Global Navigation Satellite System (GNSS) receiver and a data recorder, were installed on a regional train as shown in Figure 2. One magnetometer was mounted inside the cabin, the other magnetometer on top of the bogie (Figure 3).The Inertial Measurement Unit (IMU) with integrated magnetometer can be seen as an orange box in the opened housing.A data recorder collected the measurements synchronously to the GNSS time.The magnetic data set was recorded with 200 Hz in the cabin and on the bogie with Xsens MTi sensors.This sensor system is based on low-cost sensor elements and contains the magnetic sensor element HMC1053 from Honeywell [15].The bogie sensor was placed 0.8 m above one rail and the cabin sensor was placed 1.38 m above the opposite rail near the cabin floor.The data set contains additionally GNSS measurements with 1 Hz from Ublox LEA 6 T receiver.

Measurement Model and
The two different sensors have been factory calibrated by scales and biases to an undisturbed earth field at the factory: For the following measurements, the white noise showed to be negligible.We consider the magnetic measurements in the train frame ( ⃗  train ), as shown in Figure 3: (i) X: longitudinal train axis pointing to train front (red).
(ii) Y: lateral train axis pointing to the right side (green).
The color definition is given in brackets and is valid for the following signal plots.The signal magnitude will be colored in black: As the sensor measures in the sensor frame, a rotation of the measurement vector ⃗  is needed: The rotation matrix C train sensor is a direction cosine matrix (DCM) and can be calculated by Euler angles of roll, pitch, and yaw between sensor and train frame.

Spatial Transformation.
The measurements are recorded sample by sample in the temporal domain with a constant frequency of 200 Hz.We are interested in location-dependent correlations of the measurements in the railway environment.Within one track, the railway localization problem is onedimensional and signals or features can be addressed in the metric, spatial domain.The spatial transformation removes the speed dependency of the measured signal and transforms the signal from seconds to meters.For our transformations we use the GNSS speed measurement V  of the PVT (position, velocity, and time) output of a GNSS receiver.The GNSS speed is used here, as it is part of the experimental data set and there are no tunnels.
The measurement samples   are equally spaced in time at discrete time samples   =  ⋅ Δ.In a first step, distance samples are assigned to each measurement: {  ,   }.These distance samples are achieved with an integration of the speed measurement for each time step: In case of different data rates of speed and magnetic measurements, there is an additional interpolation of the speed or distance necessary.The distance samples   have irregular spacing depending on the speed.For the transformation, distance samples   are created with equally spacing of Δ.
Finally, the spatial signal   corresponds to the equally spaced distance samples   and is computed by a data interpolation of the temporal measurement signal   and the corresponding distance samples   : The transformation in the following uses Δ of 0.1 m.

Spatial Spectrogram. The spatial spectrogram is able to
show the spatial frequency (per meter) and enables an insight to magnetic structures over the traveled distance .The spatial processing uses the spatial transformed signal and the algorithm of a temporal spectrogram.This plot is achieved by the following steps by well-known signal processing methods [16]: (1) First, the measurements are divided into sequences of  samples.At a fixed sampling rate of the spatial signal, the sequences have a length of  ⋅ Δ meters.
(2) The second step calculates the Power Spectral Density (PSD) using a Fast Fourier Transform (FFT) of each sequence.
(3) The plot displays all PSDs as columns consecutively and each column refers to a position of the traveled distance.
5.3.Signature Processing.The signatures are computed from the magnetic measurements and a speed estimate.At first, the spatial transformation computes a sequence of magnetic measurements with synchronized speed estimates with ( 7) and (8).After this, a signal filter extracts the locationdependent part of the magnetic signal of (3) in spatial domain.There are two signatures used in the context of train localization: a reference signature is known prior and stored in a map, while the current signature is computed from the latest measurements.

Correlation.
Cross-correlation is a common way to measure similarity and lag of two signals.The cross-correlation is defined with the signals  and  as where  is the shift and  is the index that selects a sample of the signal.The signal match ĉ with its maximizing lag  max is the highest value: For a comparison of different signatures, the autocorrelations   and   at lag  = 0 are used to normalize the crosscorrelation:

Magnetic Data Set
Figure 4 shows different scenarios, which are analyzed in the following.The train runs multiple times between Augsburg main station and Friedberg station.Towards Friedberg, the train runs backwards on track P1 followed by a single track S. Towards Augsburg, the train runs forward on single track S followed by track P2.Depending on the subsequent journey, the train runs to platform 101 or platform 2. This causes different switch ways of different runs on a railway switch ahead of Augsburg.Same applies for the switch near Friedberg.
6.1.Temporal Data. Figure 5 shows the magnetometer data clip of a 10 min train run from Augsburg to Friedberg.The data is shown in the -, -, and -axes of the train and the magnitude.The normalized earth field corresponds to the (unknown) position of factory calibration.The signal of the magnitude indicates the resulting magnetic fields by superposition as described in (2).The cabin sensor shows a significant attenuation compared to the bogie signal.This can be explained by the sensor position surrounded by steel which is a ferromagnetic material.The sensor was placed inside a steel box, which was inside a server rack with steel elements, within the steel cabin of the train.The bogie sensor was mounted inside a nonferromagnetic aluminum box.

Magnetic Signature Analysis
7.1.Spatial Analysis.The spatial spectrogram of Figure 6 shows the spatial frequencies over the traveled distance of a train run from Augsburg to Friedberg.The spatial signal is sampled with a frequency of   = 10 m −1 (Δ = 0.1 m).The spectrogram was processed with an FFT of 2048 samples and spatial frequencies up to 5 m −1 (wave length: 0.2 m) can be visualized.This spectrogram zooms to the lower part below 0.5 m −1 , as the interesting position-dependent signals are below the fundamental frequency of the wheel 0.41 m −1 .This corresponds to the wheel circumference of 2.42 m and can be identified as a parallel line.In other words, the magnetic signatures are shown between wave lengths of 2 m and 204.8 m (FFT window).The actual magnetic signatures of interest are between 2.42 m and a defined signature length.The railway environment of Figure 6(b) shows the passed switches (red), parallel tracks (blue), platform areas of stations (green), and a river bridge (yellow) over the traveled distance and aligned with the spectrogram.In this diagram, the train runs along the zero-line from left to right and the passed switches are indicated with the travel direction of the train (switch way).
It is not possible to identify the fastenings of the rails, which are separated by approximately 0.6 m with the bogie or the cabin sensor.It is also not possible to identify other tracks in the vicinity from the sensor positions.
There is a metallic railway bridge (Figure 7) with a ferromagnetic structure around the railway line, which is marked in yellow regions in Figure 6.It concentrates the field lines of the earth field and causes a lower magnetic field inside the structure.The bridge reduces the mean absolute field compared to the mean absolute field of other areas.In case of the cabin, the field is reduced to 83.3% and for the bogie to 84.6%.This can be seen in Figure 5 between 330 s and 340 s.

Along-Track Analysis: Single Track.
For the position analysis, the signatures of the bogie sensor are used.The cabin sensor shows similar results.Figure 8 shows a 1 km sequence of the spatial signature of two runs over the single track S, as described in the scenarios (Figure 4).The first run (   It is noticeable that the correlations of the single track show signature similarities approx.every 30 m.This can be also seen in Figure 6 for the single track scenario between 5200 m and 7200 m.

Cross-Track Analysis: Parallel Track.
Train positions on parallel tracks are difficult to resolve to one track with GNSS position measurements.So, it is of high interest to determine the correct track.The parallel track scenario is shown in Figure 9 and comprises a run on track P1 towards Friedberg and a reversed run on P2 from Friedberg station.The run on P1 and the reversed run on P2 are compared by a crosscorrelation normalized on run P1 (Figure 9(c)).As analyzed before, a reversed signal achieves a fair correlation.The other parallel track P2 shows a low correlation versus P1 with 14.8% at a far lag.This indicates a separability between parallel tracks.In comparison, a third run on P1 shows a correlation to the reference run 1 of 87.7%.

Along-Track Analysis: Cabin versus Bogie.
The bogie and the cabin signature show slightly different signatures in Figure 10.It should be noted that the scaling of the cabin plot (Figure 10(a)) is five times magnified versus bogie plot scaling.The cross-correlation of the cabin and bogie signal should match automatically at a lag of 0 m, as both signals are synchronized.However, the correlation is as low as 18.0% in this scenario.In the single track scenario with the strong periodic signal, the correlation can reach over 50%.The cabin and the bogie sensor measure on different heights above the rails and on opposite sides.switch (switch A) is passed with approx.20 km/h and switch B is passed with approx.55 km/h in average.Each switch way is passed three times on the left switch way and three times on the right switch way.The switches are shown in a satellite image in the middle and aligned to the -axis of the data graphs.The scaling of the cabin plots above the images is magnified by five compared to the bogie plots.It can be seen that the signatures of the same switch way are repetitive and different to the opposite switch way.This property is very important for the switch way estimation in train localization.

Challenges of Magnetic Train Localization
There are some challenges towards a robust use of magnetic data for train localization.We show effects of inaccurate speed measurements, passing other trains and long-term stability of the signature.Figures 13, 14, and 15 show the signatures of the magnitude from the bogie sensor.

Inaccurate Speed.
The localization application requires reproducible signatures.These signatures and especially the spatial sampling method are very dependent on a correct speed for the transformation.An error in speed will cause a distorted signature as shown in Figure 13.A single speed distortion causes a phase shift of the signature.Localization results based on comparisons of signatures will be ambiguous.In this paper, we use the GNSS speed, which shows decreased accuracy below bridges for instance.An approach  for better speed accuracy would be reliable speed estimation, based on good measurements and/or multiple sensors.train passes, the magnetic field will be influenced and the signature is distorted.In Figure 14, 8 runs without passing trains are compared to the passing cargo train and a passenger train passing at the same place on a different run.One possible approach could be a monitoring and integrity check of the signal.A passing train might interrupt the magnetic localization for some time.

Long-Term Effects.
In the previous chapter, we showed a good repeatability of the signatures.We discovered an area just behind a station, where the signature changed completely.Figure 15 shows 9 runs until 10 January and 31 runs after the 13 January.A video analysis did not show any visible changes.There could be many reasons: track maintenance by a change or grinding of rails, a tamping maintenance, and underground works or after a use of a magnetic emergency brake.Due to the position (departing track of the station) and the pattern of approx.20 m of the new signature (Figure 15, magenta line), we assume a change of rails as the most likely option.Over the measurement period of three weeks, there were other parts with small changes, but not as much as in Figure 15.The changes affect stretches with lengths from 10 m to 100 m and the majority of the signatures between Augsburg and Friedberg did not change.After a change event, the new signature shows the same repeatable characteristic within the measurement period.The problem of changing signatures can be approached by a permanent map update with SLAM techniques (Simultaneous Localization and Mapping) for railways [17,18].

Train Localization Approach
A train localization algorithm estimates the along-track position and identifies the current track, especially at switches.Localization based on magnetic signatures requires a map with reference signatures.For each track, the magnetic signatures are sampled over the track length.
A basic reference approach is presented by alongtrack estimation and track detection at switches.Alternate approaches may include a multisensor fusion with other sensor measurements such as IMU or GNSS.

Along-Track Estimation.
The along-track localization compares a current signature with a reference signature by a signal similarity method.A cross-correlation is used in this case.At first, the algorithm predicts a position from a traveled distance estimate and the previous position.Then, the current signature is generated from the magnetic measurements and the speed estimates with the length   .After this, a reference signature is extracted from the map at the predicted position.The reference signature includes a tolerance length  tol before and after the candidate reference: This limits the search area for a correlation with the measured signature.After that, the current signature is evaluated with the reference for the lag between the two signatures.This lag corresponds to a metric shift, as the signatures are sampled with a constant distance.Finally, the along-track position can be updated with this shift.

Track Estimation.
At switches, the reference signature is aligned with the measured signature before the switch.
For the region behind the switch, the measured signature is compared with the two candidate signatures from the map.Finally, the switch way is identified with the highest match.This comparison is evaluated by cross-correlation at the lag, which was found by the alignment.

Results
10.1.Along-Track Position.The position error of the alongtrack estimation is evaluated over multiple train runs with GNSS positions.The along-track estimation used a signature length of  meas = 50m and a tolerance of  tol = 10m.Thus, the maximum error is bounded to a 20 m long search area.The evaluation contained 1804 signature matches over 45.6 Km.The results are shown in Table 1 with accuracies of less than 2.9 m and 2.8 m in 95.4% of all matches (2 error).These accuracies are in the expected GNSS error range.In case of a signature match at the true position, the evaluation contains additionally the GNSS position inaccuracy of the reference map and the actual signature.The match results showed sporadic outliers for both sensors.Nevertheless, the magnetic signatures show a significant position dependency and are suitable for the observation of the 1D track position.The error effects of 8 have the following impacts on the along-track position estimation: a speed distortion is translated into a bias of the 1D position estimation as seen in Figure 13.The passing train effect is a short-term distortion with a possible wrong match of the signature.As seen in Figure 14 this distortion depends on the type of the passing train.In case of the changed signature effect (Figure 15), the along-track position estimation is impossible.

Cross-Track and Switch
Way.The characteristic signature of the track position is also suitable for the identification of different tracks, in particular the critical parallel tracks.The switch analysis showed repeatable signatures for the same switch way and separable signatures for competing switch ways.The different switch way signatures and the different signatures of parallel tracks are considered as a real benefit for track-selective train localization.An evaluation of six runs over the two presented switches is shown in Table 2 which could identify the correct track in all cases for both sensors.
The correlation scores of a test signature between the true switch way were always larger than the score between the opposite switch way signature.The error effects of Section 8 have the following impacts on the switch way estimation.A speed distortion before the switch has no influence as the signature is shifted within the tolerance region.A speed distortion within the switch lowers the correlation score depending on the distortion and the signature signal.The switch way measurements of switch A (Figure 11) show a speed distortion of one right switch way (blue line) for each sensor with no impact on the detection.A passing train (Figure 14) may distort the switch way detection depending on the magnetic influence of the passing train.Finally, the changing signature effect (Figure 15) will distort the switch way detection.As seen from the error effect analysis, the passing cargo train and the changed signature distortions have different signatures than the original ones.Furthermore, it seems unlikely that the distorted signature is similar to the false switch way signature.In this case, the distorted signature would match to neither the left nor the right switch way signature.

Cabin versus Bogie
Sensor.The bogie and cabin mounted sensors show different signatures.They cannot be used for a signature match among each other.This means that a map or reference signature needs to be recorded at the same sensor position and the maps are not interchangeable.In general, the cabin signals are weaker compared to the bogie signals.Nevertheless, the performance of both sensor positions is very similar, as seen in the results of the alongtrack estimation and switch way identification.In [6], the cabin sensor outperforms the bogie sensor in the estimate of the compass angle.

Conclusions
We analyzed real magnetic measurements of two different sensor positions from a regional train in terms of relevance for the train localization application.The main benefits of magnetic chip sensors are the small size, low power, and lowcost compared to other navigation sensors.
The railway environment has a very distinctive magnetic signature dependency of the track position.The analysis of different tracks and switch ways showed repeatable signatures for the same switch way and separable signatures for the competing switch ways.The discrimination of signatures from parallel tracks or different switch ways is very advantageous for track-selective train localization.The alongtrack estimation showed promising results with a simple correlation method.
The performance for the passive magnetic train localization of the cabin and the bogie sensor position is similar.This is a valuable result, as the installation of a sensor inside the cabin is easier and less problematic as outside at the bogie with the rough environmental conditions.
Localization based on magnetic signatures is a suitable candidate approach for train localization in GNSS denied environments.Furthermore, it is expected that the proposed approach may be used to validate GNSS and other sensor measurements in multisensor train localization.The proposed methods and measurements have a high potential to increase the accuracy and reliability of multisensor train localization for future safety-of-life applications.

Figure 2 :
Figure 2: Magnetic measurement setup on regional train.
Frame.A simple measurement model ⃗  meas for a three-axis sensor is defined by
Figure 8(a)) travels towards Friedberg and the autocorrelation of the complete single track length is shown.All signals are normalized to the autocorrelation of run 1.The crosscorrelation of run 1 and a second run towards Friedberg matches by 97.9% and shows a lag of −14.7 m.This lag is caused by the coarse alignment of the two signatures with a match of the first GNSS position on the single track.The third run (Figure 8(b)) travels in the opposite direction on the same single line track.This signature is reversed and compared to run 1 by a normalized cross-correlation.The reversed signature matches the first signature by 73.1% at a lag of −16.4 m.

Figure 6 :
Figure 6: (a) Spatial signature spectrum over distance (bogie).(b) Graph of railway environment along the traveled distance.

Figure 8 :
Figure 8: Spatial magnetic signatures of different runs over the single track (a) towards station Friedberg, (b) from Friedberg (signal reversed), and (c) different correlations of signatures between the same and different runs.

Figure 9 :Figure 10 :
Figure 9: Similarity by cross-correlation of different parallel tracks.

Figure 13 :Figure 14 :
Figure 13: Speed distortion causes bias in signature after spatial sampling.

Table 1 :
Along track accuracy of the cabin and bogie mounted sensor.

Table 2 :
Evaluation matrix of the switch way detection.