Introduction

Train length refers to the physical coupling of trains using devices known as couplers (Li et al. 2017a, b). The track circuit and axle counter are used for traditional train length monitoring in the Chinese Train Control System (CTCS-3) and the European Train Control System (ETCS-2) (Li et al. 2017a, b; Neri et al. 2014). The large quantity of ground equipment requires considerable manpower, resulting in significant costs for installation as well as inconvenience for maintenance tasks. The next-generation train control system (NGTC) has stated that the NGTC would adopt the use of onboard equipment for the purpose of train length monitoring, decreasing dependence on trackside equipment (Scholten et al. 2009a, b) such as track circuits and axle counters.

Train length monitoring can refer to that all the carriages of the train are linked together without decoupling. Carriages connected with each other are assumed as the normal condition. Sometimes, a carriage is accidentally decoupled from the train due to coupler device malfunction. In the process of train operation, train couplers are frequently squeezed and stretched under different movement conditions (traction, emergency braking, acceleration, and deceleration) and different line conditions (uphill, downhill, switches, etc.) (Li et al. 2017a, b). Worn couplers may lead to decoupling of carriages, and these decoupled carriages will be left in the block section. Train operation efficiency will be reduced if these carriages canot be found and cleaned in time. Hence, it is necessary to check whether the train is deformed by monitoring the train’s length status (Scholten et al. 2009a, b).

Current onboard equipment-based train length monitoring mainly uses wireless communication transmission technology to transmit the wind pressure state (Cui 2019) and movement of the head of the train (HOT) and end of the train (EOT) (Fig. 1). The air pressure brake pipe will disconnect when the train carriages are separated. Therefore, the pressure value will be lower than its normal value and hence can reflect the train length state. However, this method has a probability of false alarm if the wind pressure pipe leaks (Li et al. 2017a, b; Oh et al. 2012; Guo 2020). For the movement detection method, although the accelerometer equipment is simple and easy to implement, the movement state of HOT and EOT might be inconsistent due to the buffer gap between train couplers, which will affect the accuracy of the train length monitoring (Guo 2020).

Fig. 1
figure 1

Train length monitoring using onboard equipment

Satellite positioning technology is increasing in train control systems (Jiang et al. 2018; Jia 2020). The European Union’s Shift2Rail (S2R) plan proposes a multi-sensor train positioning system, and Global Navigation Satellite System (GNSS) technology is to be used to further improve the quality of train length information (Lin et al. 2019). The PTC system proposed by the U.S. Federal Railway Administration (FRA) also requires that train positioning be carried out using GPS (Cai and Zhao 2010). In China, Alstom’s Incremental Train Control System (ITCS) has been successfully implemented in Chinese Qinghai-Tibet Railway.

Calculating the train length using satellite positioning is one way of monitoring the train’s length state independent of trackside equipment (Stallo et al. 2018; Lauer and Stein 2014). The method of monitoring the train’s length state by satellite positioning has the advantages of higher real-time performance and more accuracy. The localization of the HOT and EOT are determined using GNSS signals; then, the distance between the two carriages is calculated in real-time. When the train length monitoring is realized by satellite positioning, the directly related parameter is the moving-baseline (baseline length of the head and end antennas of the train), the indirect parameters include satellite signal observations such as pseudorange and carrier phase. Currently, most of these methods are realized using GNSS pseudorange positioning. For example, Neri proposed a method based on double-differenced pseudorange measurements. Although this method eliminates the clock errors and reduces signal propagation errors, the train length error still reaches 2 m (Neri et al. 2014). Compared with pseudorange measurements, carrier phase measurement processing can achieve higher positioning accuracy due to the much lower measurement noise. However, the phase ambiguity needs to be estimated. A double-differenced carrier phase algorithm was used to improve positioning accuracy. Train length calculation method using the double-differenced carrier phase algorithm for a single GNSS constellation has demonstrated an RMS of 0.6 m in train length determination (Jiang et al. 2020).

However, the performance of a system based on a single GNSS constellation might be impacted in certain satellite signal blockage situations, such as tunnels, bridges, and among urban buildings, which are common environments along railway lines. A system based on multi-constellation GNSS has more visible satellites and better geometric distribution of satellites (He et al. 2019; Erhu et al. 2017; Odolinski et al 2015). It is more suitable for train operations, resulting in continuous, stable and reliable positioning. BDS has just completed deployment and achieved full operational capability (FOC) (Lu and Schnieder 2014). The combination of GPS and BDS was studied to solve the problem that satellite signals are easily blocked in railway scenes and improve the reliability of the train length monitoring algorithm.

The number of visible satellites is increased in the multi-constellation system; the probability of fault satellite observation information may increase thereafter (Yang et al. 2014). In order to ensure the accuracy of the train moving-baseline calculation and avoid the results unavailability due to the fault measurement information, the robustness of the train length monitoring system needs to be improved. In related research, fault detection and exclude technology (FDE) is usually used to remove faulty satellites to improve the accuracy of moving-baseline solution (Zhu et al. 2019; Li et al. 2010). However, the failed satellite may also contain useful observation information, the simply satellite exclusion may exclude “residual” useful information, the number of visible satellites would decrease, and the satellites geometric distribution would be affected as well. The conventional FDE method still has the chance to decrease the system performance. Therefore, the algorithm that makes full use of measurement information should be adopted to improve the performance of the train length calculation system (Lee et al. 2016). We present the fault measurement identification and adaptive filtering algorithm to improve the robustness of train length monitoring system. For fault measurement, the conduct process is not simply direct exclusion, but change the weight of fault measurement in the filtering process to decrease the adverse effects on the moving-baseline calculation results. In addition, the influence of the coupling between satellite observation information during the double-difference carrier phase process may be reduced through this method. Furthermore, in order to improve the robustness of our system, the system can be achieved with floating-point and fixed ambiguity solutions. Both of them can help achieving stable train length calculations. The fixed ambiguity solutions are assumed with better train length computation accuracy compared with the floating-point solutions, but the GNSS signal quality is required to be in good condition. While the floating-point solutions can be obtained without such critical requirements. In areas with good satellite signal quality, the system will operate under the ambiguity-fixed mode, while when the train runs on the GNSS difficult areas, the system will switch to the ambiguity floating-point mode.

We discuss a robust train length calculation method based on multi-constellation GNSS measurements to improve train’s length resolution. The space–time reference frame needs to be unified at first. A double-differenced carrier phase algorithm is used to eliminate the satellite and receiver clock errors and mitigate the signal propagation delay errors. Then, the moving-baseline vector coordinates are calculated using a Kalman filter. In order to further improve the positioning accuracy, the ambiguity floating-point solution obtained by the Kalman filter was transformed to an integer solution. Then, the adaptive filtering algorithm is proposed based on the multi-constellation moving-baseline solution to improve the robustness of train length calculation method. This enables the system to perform well in the various uncertainties of railway complexity and in different challenging positioning scenarios. The robustness of the system is reflected in two aspects: On the one hand, the system has a certain tolerance for input and has the ability to handle fault data. On the other hand, the system outputs stable and reliable train length results under both fixed and floating ambiguity mode. There are two contributions of this paper: (1) The moving-baseline length of the train is calculated through double-difference carrier phase algorithm, which is used to monitor the length of the train. The safety threshold for this paper is given, and the train decoupling scenario is simulated in the experimental section. (2) The fault identification and adaptive filtering algorithm is proposed to improve the robustness of the system; hence, the influence of incorrect satellite observation on the accuracy of moving-baseline calculation is reduced.

The real high-speed railway experiment data are selected to verify the effectiveness of the algorithm. The antennas are installed in the HOT and EOT, and the moving-baseline length between the two antennas is calculated to reflect the length of the train. The advantages of multi-constellation system and adaptive filtering algorithm are proved through the comparison of the experiment results. In addition, two GPS limited positioning situations are simulated to verify the advantages of multi-constellation system. Then, the different types of random faults (include random gross error and random constant error) are simulated to further verify the robustness of multi-constellation train length calculation method. The safety threshold for this paper is designed and given, and then, the calculated train length results are compared with the safety threshold to obtain the train length status. In the experimental section, the train decoupling scenario was simulated. It is further proved that the algorithm is effective for train length status.

The second part describes measurement processing algorithm, which can be divided into five sections: The first section presents the space–time reference unification for the multi-constellation combination approach. The second section introduces the double-differenced carrier phase algorithm. Then, the next section describes the multi-constellation Kalman filtering. The fourth section is concerned with the ambiguity fixing algorithm. The last section presents the fault measurement identification and adaptive fault-tolerant algorithm. The third part summarizes the train length monitoring process. The experimental results are presented in the fourth part. Finally, the conclusions are drawn in the last part. The framework is shown in Fig. 2.

Fig. 2
figure 2

The structural framework

Multi-constellation combination algorithm

A space–time reference frame is a basic requirement for a satellite positioning system. A user receiver position can be located accurately using multi-constellation integrated positioning solutions only in a unified space–time frame (Li 2020). We present that the BDS space–time frame was converted to the GPS frame.

The GPS time scale (GPST) is realized by the atomic time system (AT) and starts at 00:00:00 on January 6, 1980. The BDS time scale uses the BeiDou time (BDST), generated by the master clock (Li 2020), and starts at 00:00:00 on January 1, 2006. The time system difference between BDS and GPS was 1356 weeks from 1980-01-06 to 2006-01-01. Besides, there is also an integer difference of 14 s between BDT and GPST because of the inclusion of leap seconds. Hence, the relationship between BDST and GPST can be written as:

$${\text{GPST}}_{{\text{week}}} = {\text{BDST}}_{{\text{week}}} + 1356({\text{week}})$$
(1)
$${\text{GPST}}_{\sec } = {\text{BDST}}_{\sec } + 14(s)$$
(2)

In terms of spatial reference frames, BDS uses the Chinese Geodetic Coordinate System (CGCS-2000), whereas GPS uses the World Geodetic System (WGS84). Both are consistent with the realization of the International Earth Reference System (ITRS) known as the International Terrestrial Reference Frame (ITRF). See Table 1.

Table 1 Comparison of different coordinate systems

The origin and semi-major axis of the reference ellipsoids of the two coordinate systems are the same. The universal gravitational constant and flattening of the ellipsoid are of the two coordinate systems very small (Ning et al. 2013; Li et al. 2014); hence, we ignore them.

Double-differenced carrier phase algorithm

The carrier phase observation equation can be written as:

$$\lambda \phi = r - I + T + c(\delta t - {\hbox{d}}t) + \lambda N + \varepsilon$$
(3)

where \(\phi\) represents the measured carrier phase, \(\lambda\) is the wavelength of the observed signal, \(r\) is the geometric distance between satellite and receiver, I is the ionospheric delay in satellite signal propagation path, T is the tropospheric delay,\(\delta t\) and \({\hbox{d}}t\) are clock error of receivers and satellites, respectively. \(N\) is the integer ambiguity, and \(\varepsilon\) is the residual error.

Figure 3 is the concept of double-differenced carrier phase for multi-constellation train length monitoring. The antennas are installed on the HOT and EOT. When a satellite is observed by two antennas, the ionospheric error, tropospheric error, other propagation path errors, and satellite clock error are eliminated by inter-station measurement differencing. For the same antenna, the reference satellite and other satellites using inter-satellite differencing eliminate the receiver clock error.

Fig. 3
figure 3

Double-differenced carrier phase concept

The double-differenced carrier phase observation equation can therefore be written as:

$$\phi_{\rm{EH}}^{\rm{ij}} = (\phi_E^i - \;\phi_H^i {)} - (\phi_E^j - \;\phi_H^j {) = }\lambda^{ - 1} r_{\rm{EH}}^{\rm{ij}} + N_{\rm{EH}}^{\rm{ij}} + \varepsilon_{\rm{EH}}^{\rm{ij}}$$
(4)

where the superscript \({\hbox{ij}}\) indicates the pair of satellites in the between satellite differences, the subscript H stands for HOT, the subscript E stands for EOT, and the subscript \({\hbox{EH}}\) indicates the difference between the HOT and EOT measurements.

\(r_{\rm{EH}}^{\rm{ij}}\) in (4) can be further expressed as:

$$r_{\rm{EH}}^{\rm{ij}} = r_E^{\rm{ij}} - r_H^{\rm{ij}} = r_E^i - r_E^j - (r_H^i - r_H^j )$$
(5)

The distance between satellite and receiver is nonlinear, so it needs to select an antenna as the main antenna (EOT antenna is used as the main antenna), and the \(r_E^i\),\(r_H^i\),\(r_E^j\),\(r_H^j\) will be linearized at the approximate position of the main antenna. The linearized distance between ith satellite and EOT antenna can be written as:

$$r_E^i \approx \tilde{r}_E^i - \frac{{x^i - \tilde{x}_E }}{{\tilde{r}_E^i }}{\hbox{d}}x - \frac{{y^i - \tilde{y}_E }}{{\tilde{r}_E^i }}{\hbox{d}}y - \frac{{z^i - \tilde{z}_E }}{{\tilde{r}_E^i }}{\hbox{d}}z$$
(6)

where \((x^i ,y^i ,z^i )\) is coordinates of the ith satellite in question, \((\tilde{x}_E ,\tilde{y}_E ,\tilde{z}_E )\) is approximate coordinates of the EOT antenna. \(\tilde{r}_E^i\) indicates the approximate distance between the ith satellite and the EOT antenna. \({\hbox{d}}x,{\hbox{d}}y,{\hbox{d}}z\) in (6) denotes the baseline vector between the position of EOT antenna and its approximate position, which can be neglected.

Therefore, the (6) can be further expressed as:

$$r_E^i \approx \tilde{r}_E^i$$
(7)

Similarly, the linearized distance between ith satellite and HOT antenna can be written as:

$$r_H^i \approx \tilde{r}_E^i - \frac{{x^i - \tilde{x}_E }}{{\tilde{r}_E^i }}{\hbox{d}}x - \frac{{y^i - \tilde{y}_E }}{{\tilde{r}_E^i }}{\hbox{d}}y - \frac{{z^i - \tilde{z}_E }}{{\tilde{r}_E^i }}{\hbox{d}}z$$
(8)

The \({\hbox{d}}x,{\hbox{d}}y,{\hbox{d}}z\) in (8) means the baseline vector between the position of HOT antenna and approximate position of EOT antenna, which can be further expressed as \(\Delta x,\Delta y,\Delta z\).

The \(r_{E}^{j} r_{H}^{j}\) can be obtained in the same way.

Therefore, the difference between the distance from ith satellite to EOT antenna and the distance from satellite ith to HOT antenna can be written as:

$$r_{\rm{EH}}^i = r_E^i - r_H^i = \frac{{x^i - \tilde{x}_H }}{r_H^i }\Delta x + \frac{{y^i - \tilde{y}_H }}{r_H^i }\Delta y + \frac{{z^i - \tilde{z}_H }}{r_H^i }\Delta z$$
(9)
$$r_{\rm{EH}}^{\rm{ij}} = r_{\rm{EH}}^i - r_{\rm{EH}}^j$$
(10)

Substituting \(r_{\rm{EH}}^{\rm{ij}}\) (after double-differencing) into (4), the double-differenced carrier phase observation equation can be rewritten as:

$$\lambda \phi_{\rm{EH}}^{\rm{ij}} = \left[ {\begin{array}{*{20}c} {a^{\rm{ij}} } & {b^{\rm{ij}} } & {c^{\rm{ij}} } \\ \end{array} } \right]\left[ {\begin{array}{*{20}c} {\Delta x} \\ {\Delta y} \\ {\Delta z} \\ \end{array} } \right] + \lambda N_{\rm{EH}}^{\rm{ij}}$$
(11)
$$a^{\rm{ij}} = a^i - a^j = \frac{x^i - x_H }{{r_H^i }} - \frac{x^j - x_H }{{r_H^j }}$$
(12)

\(b^{\rm{ij}}\) and \(c^{\rm{ij}}\) can be obtained in the same way.

Multi-constellation moving-baseline resolution algorithm

A system filter is needed to combine the GPS and BDS measurements so as to calculate the system state and subsequently calculate the length of the moving-baseline.

The Kalman filter (KF) is a linearized estimation process that utilizes a dynamic system model. The dynamic model describes how the state of the system evolves over time. The system states include position, velocity, acceleration, and ambiguity. The KF includes a movement model and the observation model. The movement model is based on the previous state of the system and is used to predict the present state, which can be written as:

$${{\varvec{X}}}(k) = {{\varvec{AX}}}(k - 1){ + }{{\varvec{W}}}{(}k{)}$$
(13)

The measurement model can be written as:

$${{\varvec{Z}}}(k) = {{\varvec{H}}}(k){{\varvec{X}}}(k) + {{\varvec{V}}}(k)$$
(14)

Since the relative speed of the moving-baseline has a strong correlation, the first-order Markov acceleration model was selected as the movement model. The estimated state \(X(k)\) can be written as:

$$\begin{gathered} {{\varvec{X}}}(k)^{\text{T}} = \left[ {\Delta x\;\;\Delta y\;\;\Delta z\;\;\Delta v_x \;\;\Delta v_y \;\;\Delta v_z \;\;\Delta \dot{v}_x \;\;\Delta \dot{v}_y \;\;\;\Delta \dot{v}_z } \right. \hfill \\ \;\;\;\;\;\;\;\;\;\;\left. {N_{{\rm HE}}^{G1Gm} \;\;N_{{\rm HE}}^{G2Gm} \;\; \cdots \;\;N_{{\rm HE}}^{G(n_G - 1)Gm} \;\;N_{{\rm HE}}^{B1Bl} \;\;N_{{\rm HE}}^{B2Bl} \;\; \cdots \;\;N_{{\rm HE}}^{B(n_B - 1)Bl} } \right] \hfill \\ \end{gathered}$$
(15)

where \((\Delta v_x ,\;\Delta v_y ,\;\Delta v_z )\) and \((\Delta \dot{v}_x ,\;\Delta \dot{v}_y ,\;\Delta \dot{v}_z )\) are the relative velocity and acceleration in three directions, respectively, G and B correspond to GPS system and BDS system. \(n_G\) and \(n_B\) are the number of GPS and BDS satellites, respectively. \((N_{{\rm HE}}^{G_1 G_m } ,N_{{\rm HE}}^{G_2 G_m } , \cdots ,N_{{\rm HE}}^{G_{(n_G - 1)} G_m } )\) is the matrix composed of double-differenced integer ambiguity terms corresponding to GPS; \((N_{{\rm HE}}^{B_1 B_l } ,N_{{\rm HE}}^{B_2 B_l } , \cdots ,N_{{\rm HE}}^{B_{(n_G - 1)} B_l } )\) is the matrix composed of double-differenced integer ambiguity terms corresponding to BDS. \(m\) and \(l\) denote the reference GPS and BDS satellites, respectively. \(N_{{\rm HE}}^{G_{1} G_m }\) indicates the ambiguity after GPS double-differencing, and the subscript \(G_{1} G_m\) indicates the inter-satellite difference between the first satellite and the reference satellite. Similarly, \(N_{{\rm HE}}^{B_{1} B_l }\) indicates the integer ambiguity after BDS double-differencing.

State transition matrix A can be written as:

$${{\varvec{A}}} = \left[ {\begin{array}{*{20}c} {{{\varvec{I}}}_{3 \times 3} } & {\Delta T \cdot {{\varvec{I}}}_{3 \times 3} } & {0_{3 \times 3} } & {0_{3 \times [({\text{n}}_G { - 1) + }({\text{n}}_B { - 1)}]} } \\ {0_{3 \times 3} } & {{{\varvec{I}}}_{3 \times 3} } & {\Delta T \cdot {{\varvec{I}}}_{3 \times 3} } & {0_{3 \times [({\text{n}}_G { - 1) + }({\text{n}}_B { - 1)}]} } \\ {0_{3 \times 3} } & {0_{3 \times 3} } & {{{\varvec{I}}}_{3 \times 3} } & {0_{3 \times [({\text{n}}_G { - 1) + }({\text{n}}_B { - 1)}]} } \\ {0_{[({\text{n}}_G { - 1) + }({\text{n}}_B { - 1)}] \times 3} } & {0_{[({\text{n}}_G { - 1) + }({\text{n}}_B { - 1)}] \times 3} } & {0_{[({\text{n}}_G { - 1) + }({\text{n}}_B { - 1)}] \times 3} } & {{{\varvec{I}}}_{[({\text{n}}_G { - 1) + }({\text{n}}_B { - 1)}] \times [({\text{n}}_G { - 1) + }({\text{n}}_B { - 1)}]} } \\ \end{array} } \right]$$
(16)

\({{\varvec{W}}}(k)\ {{\varvec{N}}}(0,{{\varvec{Q}}}(k))\) is the process noise of the system. The noise matrix of the system can be written as:

$${{\varvec{Q}}}(k) = {\text{diag}}\left( {\begin{array}{*{20}c} {0_{1 \times 3} \;\;0_{1 \times 3} } & {\frac{2 \ast \Delta T^2 }{\tau }} & {\frac{2 \ast \Delta T^2 }{\tau }} & {\frac{2 \ast \Delta T^2 }{\tau }} & {w_{1 \times (n_G - 1)} \;\;w_{1 \times (n_B - 1)} } \\ \end{array} } \right)$$
(17)

where \(\tau\) is the correlation time, \(w\) is the double-differenced ambiguity of random walk process, and \(\Delta T\) is the sampling frequency.

The observation matrix of the system consists of the double-differenced carrier phase measurements:

$${{\varvec{Z}}}(k) = \left[ {\begin{array}{*{20}c} {\begin{array}{*{20}c} {\phi_{\rm{EH}}^{G1Gm} } & {\phi_{\rm{EH}}^{G2Gm} } & {...} \\ \end{array} } & {\phi_{\rm{EH}}^{G(n_G - 1)Gm} \;\;\begin{array}{*{20}c} {\begin{array}{*{20}c} {\phi_{\rm{EH}}^{B1Bl} } & {\phi_{\rm{EH}}^{B2Bl} } & {...} \\ \end{array} } & {\phi_{\rm{EH}}^{B(n_B - 1)Bl} } \\ \end{array} } \\ \end{array} } \right]^T$$
(18)

The measurement matrix of the system can be written as:

$${{\varvec{H}}}(k) = \left[ {\begin{array}{*{20}c} {a^{G1Gm} } & {b^{G1Gm} } & {c^{G1Gm} } & {\,} & {\,} \\ {a^{G2Gm} } & {b^{G2Gm} } & {c^{G2Gm} } & {\,} & {\,} \\ \vdots & \vdots & \vdots & {{{\varvec{0}}}_{(n_G - 1) \times {6}} } & {\lambda_G \cdot {{\varvec{I}}}_{(n_G - 1) \times (n_G - 1)} } \\ {a^{G(n_G - 1)Gm} } & {b^{G(n_G - 1)Gm} } & {c^{G(n_G - 1)Gm} } & {\,} & {\,} \\ {a^{B1Bl} } & {b^{B1Bl} } & {c^{B1Bl} } & {\,} & {\,} \\ {a^{B2Bl} } & {b^{B2Bl} } & {b^{B2Bl} } & {\,} & {\,} \\ \vdots & \vdots & \vdots & {{{\varvec{0}}}_{(n_B - 1) \times {6}} } & {\lambda_B \cdot {{\varvec{I}}}_{(n_B - 1) \times (n_B - 1)} } \\ {a^{B(n_B - 1)Bl} } & {b^{B(n_B - 1)Bl} } & {c^{B(n_B - 1)Bl} } & {\,} & {\,} \\ \end{array} } \right]$$
(19)

\(\lambda_G\) and \(\lambda_B\) are the GPS and BDS signal wavelengths, respectively.

\({{\varvec{V}}}(k)\ {{\varvec{N}}}(0,{{\varvec{R}}}(k))\) is the measurement noise of the system. The covariance matrix \({{\varvec{R}}}(k)\) can be written as:

$${{\varvec{R}}}(k) = 2\sigma^2 \left[ {\begin{array}{*{20}c} 2 & 1 & \cdots & 1 \\ 1 & 2 & \cdots & 1 \\ {\,} & {\,} & \ddots & {\,} \\ 1 & 1 & \cdots & 2 \\ \end{array} } \right]_{[(n_G - 1) + (n_B - 1)] \times [(n_G - 1) + (n_B - 1)]}$$
(20)

After the time updating and measurement updating process, the state vector values are corrected and the relative position for every epoch can be used to calculate the train length. The calculated moving-baseline length is:

$$L{ = }\sqrt {\Delta x^2 + \Delta y^2 + \Delta z^2 }$$
(21)

By comparing the calculated moving-baseline length and actual length of the train, the train length status can be determined.

Online fixing of multi-constellation system ambiguities

Estimating the integer ambiguity terms is a key requirement to achieving high-precision carrier phase-based GNSS positioning. The double-differenced ambiguity terms estimated by the KF have floating-point values. Floating-point ambiguity is easier to obtain, but the accuracy is relatively low. Fixed ambiguity corresponds to higher positioning accuracy, but it is difficult to achieve long-term sustainability in railway applications. This requirement is that the system should be robust and ensure reliable positioning results regardless of floating-point ambiguity or fixed ambiguity. These need to be “fixed” to their integer values. Furthermore, the visible satellites may change frequently with the train running at high speed. An online ambiguity fixing algorithm is used, as in Fig. 4.

Fig. 4
figure 4

Online fixing of ambiguity process

The integer ambiguity fixing process can be simply summarized as constructing an integer space, which will contain all fixed ambiguity solutions, so as to reduce the integer search range in the integer ambiguity fixing process. Decorrelation through the linear Gauss transformation solution was carried out because the integer ambiguities in the search space are correlated with each other. The integer Z-transformation was used for this decorrelation process. Then, search for the integer ambiguities from back to front (Zhang et al 2012). When the number of visible satellites changes and new satellites is observed, the corresponding ambiguity floating-point solution is calculated using the antenna position at the previous epoch, and then using the ambiguity fixing algorithm to obtain the integer value. The three main steps of the ambiguity fixing algorithm therefore are:

  1. 1.

    The decorrelation of integer ambiguity

The covariance matrix of ambiguity floating-point estimates has the characteristics of symmetry and positive definiteness. Therefore, the lower Cholesky decomposition method is used to decompose variance–covariance matrix for the correlated ambiguity solution calculated by the KF. Due to the integer nature of the Z-transformation, the elements of the decomposed triangular matrix need to be rounded. Repeating above steps until the final triangular matrix becomes a unit matrix. The variance–covariance matrix obtained by this method reduces the correlation between ambiguity estimates.

  1. 2.

    Determination of search space

After obtaining the variance–covariance matrix in step (1), the integer minimization solution of the transformed ambiguities was obtained, and thus, the search boundary of integer ambiguity could be determined.

  1. 3.

    Solution of integer ambiguity

Integer ambiguity values were searched recursively from ambiguity of the nth carrier phase (double-differenced) observable to the ambiguity of the first carrier phase observable. Finally, the fixed integer ambiguity values could be obtained by inverse integer transformation.

The fixed ambiguities can be used to improve the accuracy of positioning. In addition, compared with the single constellation approach, the multi-constellation approach ensures that there are more measurements. Therefore, the online fixing ambiguity algorithm for multi-constellation observables can generate fast and accurate baseline computations for accurate and reliable train length calculation.

Robust optimization of train length calculation algorithm

In order to avoid the adverse impact of fault measurement information on the results, the fault identification and adaptive filtering algorithm of train length calculation are proposed. The algorithm will be divided into two parts: the first is to identify the fault measurement information for each epoch, and the second is to adjust the fault measurement adaptively. Railway positioning scenarios are complex and change frequently. It is required that the performance of the system is not affected by incorrect data input or slight changes. The system can maintain stability and robustness under different types of input data.

  1. 1.

    Fault satellite identification based on measurement innovation

According to the linearized observation equation, the measurement innovation of the train length calculation system can be written as:

$${{\varvec{r}}}(k) = {{\varvec{Z}}}(k) - {{\varvec{H}}}(k) \cdot {{\varvec{X}}}(k)$$
(22)

Therefore, the theoretical covariance matrix \(S(k)\) of measuring innovation can be further expressed as:

$${{\varvec{S}}}(k) = E\left[ {{{\varvec{r}}}(k){{\varvec{r}}}(k)^T } \right] = {{\varvec{H}}}(k){{\varvec{P}}}(k/k - 1){{\varvec{H}}}(k)^T + {{\varvec{R}}}(k)$$
(23)

where \({{\varvec{P}}}(k/k - 1)\) represents the covariance matrix of one-step prediction state error.

The fault identification of measurement is based on the ratio of theoretical covariance matrix and actual covariance matrix of measurement innovation. The actual covariance matrix of measured innovation can be expressed as:

$${\hat{\varvec{S}}}(k) = \hbox{diag}({{\varvec{r}}}[i]^2 )i = 1,2,\ldots,n$$
(24)

The \(k\) represents the current epoch, \(i\) represents the satellite in the current epoch.

The actual covariance matrix of the measurement innovation is related to the moving-baseline solution of the previous epoch. In order to obtain a more accurate actual covariance matrix of measurement information, a sliding window is set to obtain the average value of actual covariance of measurement innovation within the length of a sliding window. The average value \({\hat{\varvec{S}}}_w (k)\) of the actual covariance after adding the sliding window can be written as:

$${\hat{\varvec{S}}}_w (k) = \frac{1}{N}\sum_{l = k - N + 1}^k {{{\varvec{r}}}(l){{\varvec{r}}}(l)^T }$$
(25)

where \(N\) is the length of the sliding window, which is set to 20. \(l\) represents the epoch in the sliding window.

The ratio between theoretical covariance matrix and actual covariance matrix of measured innovation can be expressed as \(\lambda\),

$${{\varvec{\lambda}}}[i] = \frac{{{\hat{\varvec{S}}}_w [i,i]}}{{{{\varvec{S}}}[i,i]}}$$
(26)

When the value of \(\lambda\) reaches 1, the current filtering estimation is optimal, but this situation is hard to achieve. Therefore, a coefficient factor \(d\) is set to judge whether there is a fault measurement in the current epoch. The value of \(d\) depends on the measurement innovation when there is no fault. While the \(\lambda\) is bigger than the set coefficient factor \(d\), it means that the measurement value of this satellite needs to be further adjusted. The judgment condition can be further expressed as:

$${\hat{\varvec{S}}}_w [i,i] \ge {{\varvec{S}}}[i,i] \cdot d$$
(27)

The \(d\) of (27) can be written as:

$$d = \frac{{(\delta_{\min } - \sigma_{\min } )^2 }}{{\delta_{\min }^2 }}$$
(28)

where \(\delta_{\min }\) is the minimum error of measurement, \(\sigma_{\min }\) is minimum value of measurement failure. The values of \(\delta_{\min }\) and \(\sigma_{\min }\) are set according to the experimental data.

If the judgment condition of (27) is established, it proves that the measurement information of the ith satellite is faulty, which need to be adjusted using adaptive filtering algorithm.

  1. 2.

    Adaptive filtering algorithm

After the fault measurement information is identified, the influence of the fault measurement information on the final result can be reduced through changing and assigning the weight to the fault measurement information. The negative impact of the fault information can be decreased, and the observation information can be used adequately using this adaptive adjustment.

The measurement noise covariance \({{\varvec{R}}}(k)\) reflects the degree of trust in the observation during the process of filtering. Therefore, a measurement noise covariance adjustment method based on adaptive adjustment factor is proposed. If there is a fault in the measurement of the satellite \(i\), the measurement weight can be further reduced by increasing the measurement noise covariance corresponding to this satellite, and the influence of the fault measurement on the result accuracy can be reduced.

The process of the measurement noise covariance matrix \(R\) adaptive adjustment is as follows:

$${\hat{\varvec{R}}}[i,i] = \lambda [i]{{\varvec{R}}}[i,i]$$
(29)

After adjusting the matrix \({{\varvec{R}}}(k)\), the filter gain \({\hat{\varvec{K}}}(k)\) is calculated in the process of KF:

$${\hat{\varvec{K}}}(k) = {{\varvec{P}}}(k/k - 1){{\varvec{H}}}(k)^T [{{\varvec{H}}}(k){{\varvec{P}}}(k/k - 1){{\varvec{H}}}(k)^T + {\hat{\varvec{R}}}(k)]^{ - 1}$$
(30)

Furthermore, the state \({\hat{\varvec{X}}}(k)\) and its covariance matrix be obtained.

$${\hat{\varvec{X}}}(k) = {\hat{\varvec{X}}}(k/k - 1) + {\hat{\varvec{K}}}(k)[{{\varvec{Z}}}(k) - {{\varvec{H}}}(k){\hat{\varvec{X}}}(k/k - 1)]^{ - 1}$$
(31)
$${\hat{\varvec{P}}}(k) = ({{\varvec{I}}} - {\hat{\varvec{K}}}(k){{\varvec{H}}}(k)){{\varvec{P}}}(k/k - 1)$$
(32)

Through the above steps, the adaptive filtering adjustment is completed, and the adjusted state estimation is obtained. The adjusted measurement noise matrix \({{\varvec{R}}}(k)\) will continue to be used in the next epoch. The complete process of fault measurement identification and adaptive filtering is shown in Fig. 5.

Fig. 5
figure 5

Fault measurement fault identification and adaptive filtering process

Train length state judgment safety threshold setting

The setting of threshold greatly affects the efficiency of train length monitoring. Therefore, an appropriate value should be taken when setting the train length monitoring threshold. If the given threshold is too small, the train length monitoring system will be too sensitive, which will increase the probability of false alarm and affect the efficiency of train operation. On the contrary, if the monitoring threshold is too large, the train carriages cannot be found out in time, which will affect the safety of train operation. The threshold is normally defined based on the accuracy of the train length resolution. In this paper, the accuracy of moving-baseline can reach sub-meter level, the threshold also should be lowered appropriately to ensure the accuracy and efficiency of the train length monitoring system.

This paper investigates two key factors for threshold selection: the baseline solution error and communication delay. On the one hand, calculating train length by using a moving-baseline model, the train carriages are not rigidly connected, which makes it a challenge to apply effective baseline length constraints, thus affecting the accuracy of train length calculation. On the other hand, the railway operating environment is complex, with bridges, mountainous areas, cities, etc. along the route. Even if fault detection algorithm is used for robust processing, the multipath effect is still obviously affecting the quality of train length calculations. Considering the general accuracy of baseline length calculation based on carrier phase and the results of baseline calculation in this paper, it is concluded that the baseline accuracy level is sub-meter. Thus, the threshold can be set by the assumed train length error as,

$$L_{\rm{error}} = L_{\rm{error}}^{\rm{baseline}} = 1m$$
(33)

With the development of railway communication technology, the current train control system adopts LTE-R communication technology, and the upper limit of communication transmission delay is 50 ms (He et al. 2016). The adverse effects of communication delays in train length monitoring systems should be considered. EOT needs to send the measured data to HOT through communication link, and then, the system calculates the train length. Under the condition of abnormal train separation, EOT will be in a coasting state due to air resistance, and HOT will continue to operate at the previous constant speed. The train length error caused by communication delay can be calculated by multiplying the maximum relative speed by the time delay, and the maximum relative speed can be obtained by multiplying the deceleration by time. With the increase of the relative speed between HOT and EOT, the equivalent length error related to the communication delay also increases. According to the traction dynamics model of high-speed trains (Serajian et al. 2019), the train natural deceleration caused by air resistance and friction is about 3 m/s2. According to the requirements of the train length detection system, it is assumed that the abnormal train length will be detected within 10 s. The dynamic model of train operation is complex, and here, the braking deceleration of the train is simplified as a constant, rather than accurately describing the relative movement of trains. The maximum relative speed between HOT and EOT is 30 m/s within 10 s; thus, the threshold of the train length is set as 1.5 m by the computed distance caused by communication delay as,

$$\Delta V_{{\text{max}}} = a*10 = 30m/s$$
(34)
$$L_{\rm{delay}} = \Delta V_{{\text{max}}} *t_{\rm{delay}} = 30*0.05 = 1.5m$$
(35)

Train length calculation error and communication delay error are considered together. The threshold level of integrated train length is set to 2.5 m.

$$L_{\rm{threshold}} = L_{\rm{error}} + L_{\rm{delay}} = 2.5m$$
(36)

There is no published standard value for the safety threshold of train length status. If the train length is calculated by pseudorange single-point positioning to judge the train length status, the corresponding train length error threshold is about 10 m. The application of the robust train length calculation method proposed in this paper is very beneficial to reduce the safety threshold \(L_{\rm{error}}\) and ensure the safe and efficient train operation. Reducing the threshold \(L_{\rm{threshold}}\) for train length monitoring related to train length calculation errors is one of the main innovations of this paper.

The operation flow of train length monitoring system

The performance of train length monitoring system based on moving-baseline calculation is mainly improved from two aspects, which include the addition of multi-constellation system and adaptive filtering algorithm. The operation flow of the train length monitoring system is as follows:

Step1: Data acquisition and pre-processing: Receive GPS and BDS satellite signals through antennas installed at the head and end of the train, analyze the received satellite signals, and select reference satellites based on altitude angle.

Step2: Multi-constellation moving-baseline solution: Inter-station differences and inter-satellite differences eliminate the influence of clock errors and mitigate propagation path errors. The KF is used to estimate the position vector between the two antennas, at HOT and EOT. The floating-point value ambiguity terms are fixed to their expected integer values using a single-epoch online ambiguity fixing algorithm.

Step3: Adaptive filtering: The adaptive filtering algorithm is used to adjust the measurement noise and the influence of fault measurement on the result accuracy is reduced.

Step4: Train length monitoring: The train moving-baseline length can be computed from the relative position between the HOT and EOT antennas, and the moving-baseline result is compared with the reference length of the train. If the error of the moving-baseline calculation result is greater than the set safety threshold, the train length state is abnormal.

$$\left| {L - R} \right| < L_{\rm{threshold}}$$
(37)

where \(R\) is reference train length, \(L_{\rm{threshold}}\) is the given train length monitoring threshold.

Train length results and evaluation

In order to evaluate the proposed method, a field train test was conducted on the Beijing-Shenyang high-speed railway line (see Figs. 6 and 7). The test lasted about 30 min and the trace was 78 km long. The train operation scenes that enter the station twice and leave the station twice are selected, including the common motion states of the train, such as traction, braking, acceleration, deceleration and stationary. The whole experimental data is a relatively complete process of high-speed rail movement, and includes more extreme scenes where the satellite signal is seriously blocked after the train enters the station. The NovAtel OEM6 GNSS receiver was installed at the HOT, and the Unicore UR380 GNSS receiver was installed at the EOT. Both receivers can support BDS and GPS signal tracking and the data acquisition frequency is 10 HZ. During the experiment, the reference value of the moving-baseline solution is 186.9 m, it is the length of the train when it is stationary, which is a constant value.

Fig. 6
figure 6

Experiment trajectory

Fig. 7
figure 7

The operation flow of train length monitoring system

Figure 8 shows the train speed during the experimental period. The maximum speed is approximately 250 km/h. The train is almost stopped between 6738 and 8459 epochs and 15,670–17,650 epochs, because the train has entered the Xinminbei and Shenyangxi stations.

Fig. 8
figure 8

Train speed during the experimental period

The DOP value reflects the influence of satellite geometric distribution on positioning error. The DOP value of the visible GPS satellites is shown in Fig. 9. It can be seen that when the train enters the station twice, the DOP value will increase so as to affect the positioning accuracy. During 10,000 ~ 12,000 epochs, the DOP value changes frequently, which indicates that the geometric distribution of satellites changes frequently and the satellite signal quality is poor.

Fig. 9
figure 9

GPS DOP values during the experiment

Figure 10 shows the number of visible satellites. The number of visible satellites in either the GPS or BDS constellations does not exceed 6. The total number of visible satellites is over 10 for most epochs. The number of GPS and BDS satellites both change frequently in the 10,000–16,000 epoch period.

Fig. 10
figure 10

The number of visible satellites

The satellites are also constantly changing due to the frequent changes and obstruction of satellite signals during train operation, with a maximum of 12 visible satellites and a minimum of 8 visible satellites. Table 2 shows the PRN of GPS and BDS visible satellites in most scenes.

  1. 1.

    Experimental verification of multi-constellation system

Table 2 The PRN of GPS and BDS visible satellites

Figure 11 shows the moving-baseline floating-point solution of GPS and GPS/BDS (GPS-FLOAT and GPS/BDS-FLOAT). It can be seen that the difference between the two results is small before epoch 6000 because the number of visible satellites is sufficient and does not change frequently. After epoch 6000, the result of the multi-constellation moving-baseline solution is obviously better than that using a single GNSS constellation.

Fig. 11
figure 11

Ambiguity float-solution (multi-constellation and single constellation)

The results of GPS and GPS/BDS moving-baseline with fixed ambiguity (GPS-FIX and GPS/BDS-FIX) are shown in Fig. 12. In most epochs (2000 ~ 13,000), the accuracy of GPS/BDS-FIX results is higher than GPS-FIX solution. Compared with Fig. 11, the results are stable and accurate after the integer ambiguity algorithm is added, with an RMS of about 0.15 m.

Fig. 12
figure 12

Moving-baseline solution with fixed ambiguity (multi-constellation and single constellation)

Figure 13 shows the error cumulative distribution function (CDF) of the four solutions. The performance of the multi-constellation moving-baseline using fixed ambiguity is the best, with an absolute value of error distribution being in the range 0–0.4 m. The statistical analysis of these four results is shown in Table 3.

Fig. 13
figure 13

CDF of the four train length calculation methods

Table 3 Evaluation of the four train length resolution methods

The error of GPS-FLOAT is the largest. The GPS/BDS-FIX solution has the best performance compared with other three solutions, with mean of 0.11 m and RMS of 0.15 m, which has an improvement of 76% compared with the GPS-FLOAT solution. Both FLOAT and FIX solutions can achieve the goal of correctly calculating the train length, and their error RMS is within the threshold range of train length. The long-term experimental results show that our algorithm has robust performance.

In order to further demonstrate the advantage of the proposed multi-constellation monitoring system, two “GPS-difficult situations” are simulated by blocking a number of visible satellites (Fig. 14). The 3700–3900 epoch period and 7300–7500 epoch period were selected.

Fig. 14
figure 14

Sky plot of GPS

Only three GPS satellites with the highest elevation angles (PRN 3, PRN 17, and PRN 28) were retained since satellites with low elevation angles are easier to be blocked. Figure 15 shows the moving-baseline solution errors for the two GPS-difficult situations.

Fig. 15
figure 15

Comparison of GPS and GPS/BDS solution results in two GPS-difficult situations

The graph (a) and (b) shows the baseline error of the GPS-FIX and GPS/BDS-FIX solutions in the 3700–3900 epoch period. Graph (c) and (d) shows the baseline error of the GPS-FIX and GPS/BDS-FIX solutions in the 7300–7500 epoch period. “GPS-difficult situations” are marked with red dashed boxes in Fig. 15. Note that the simulation shows hardly any impact on the performance of the GPS/BDS-FIX solution.

  1. 2.

    Experimental verification of adaptive filtering algorithm

The results of adding adaptive filtering algorithm (GPS/BDS-AFT) and the GPS/BDS-FIX solution are shown in Fig. 16. After adding the adaptive filtering algorithm, the accuracy of train length is further improved on the basis of GPS/BDS-FIX solution. The GPS/BDS-AFT solution is close to the reference train length before the 6000th epoch. Although the train length error increases in the subsequent epochs, it is obviously better than GPS/BDS-FIX solution.

Fig. 16
figure 16

Comparison of GPS/BDS-FIX solution and GPS/BDS-AFT solution

Figure 17 shows the error CDF of GPS/BDS-FIX solution and GPS/BDS-AFT solution. The number of epochs with error less than 10 cm using adaptive filtering algorithm accounts for 80% of the total epoch number, while the number of epochs with error less than 10 cm of the original multi-constellation fixed solution accounts for about 45%. Moreover, the accuracy of the train length solution after adaptive filtering algorithm is all better than that of the original multi-constellation fixed solution.

Fig. 17
figure 17

CDF comparison between GPS/BDS-FIX solution and GPS/BDS-AFT solution

The error statistics of GPS/BDS-FIX and GPS/BDS-AFT solution are analyzed in Table 4. It can be seen that the train length error of GPS/BDS-FIX solution at decimeter level with RMS 0.155 m, the error of GPS/BDS-AFT solution at centimeter level with RMS 0.077 m. The accuracy of the train length result has an improvement of 50.3% compared with GPS/BDS-FIX solution.

Table 4 Comparison of error statistics between GPS/BDS-FIX and GPS/BDS-AFT result

The experimental results prove that the adaptive filtering algorithm can effectively smooth the noise and other influences existing in the measurement information, which can improve the accuracy and stability of the train length calculation results. In order to further verify the tolerant ability of the proposed adaptive filtering algorithm to different types of faults, the different random faults are simulated artificially. In order to ensure the randomness of simulated fault, the random gross error and random constant error are mainly included in this dataset. The satellite with the lowest elevation angle is selected to include the two types of the fault: one is the “Random gross error" and the other is the “Random constant error". The “random gross error" is the error injected randomly in some epochs, and “random constant error" is the error injected randomly for a period of epochs. The simulated failure modes and descriptions are shown in Table 5.

Table 5 Description of different simulated fault types

The results of comparing the GPS/BDS-FIX solution and GPS/BDS-AFT solution with random gross error are shown in Fig. 18. It can be seen that before the adaptive filtering algorithm is added, the including of random gross error will lead to obvious abrupt change in the calculation result of train length. On the contrary, the random gross error has little effect on the result when the adaptive filtering algorithm is added, and the result of GPS/BDS-AFT solution is more stable than GPS/BDS-FIX solution. The specific values of fault epoch and random gross error generated by random function during the experiment are shown in Table 6.

Fig. 18
figure 18

Comparison of GPS/BDS-FIX and GPS/BDS-AFT with random gross error

Table 6 Fault epoch and fault value of random gross error

Figure 19 shows the tolerance of the adaptive filtering algorithm to the random constant error. Compared with random gross errors, the time of random constant error last longer and the effect to the train moving-baseline solution is more serious. Before the adaptive filtering algorithm is added, the train length calculation results have different degrees of jumping at these epochs, which lead to the calculation results unstable and take some time to gradually converge. However, after the adaptive filtering algorithm is added, the impact of random faults is relatively small, and the train length calculation results can remain stable all the time. The specific values of fault epoch and random constant error generated by random function during the experiment are shown in Table 7.

Fig. 19
figure 19

Comparison of GPS/BDS-FIX and GPS/BDS-AFT with random gross error

Table 7 Fault epoch and fault value of random constant error

Table 8 shows the comparison of error statistics between GPS/BDS-FIX solution and GPS/BDS-AFT solution when different types of faults are simulated. For random gross error, the adaptive filtering algorithm can decrease RMS from 0.157 m to 0.079 m, which has an improvement of 49.7%. For the random constant error, the value of RMS can decrease from 0.166 m to 0.077 m, which has an improvement of 53.6%.

Table 8 Statistics of GPS/BDS-FIX and GPS/BDS-AFT solution with different types of faults

Train length state simulation in separation scenarios

The experimental results calculated the sub-micron train length which needs to be compared with the safety threshold to further determine the train length status.

  1. 1.

    Simulation process description

In order to verify the performance of the train length monitoring system based on train length calculation, the measured data and simulation data are used to simulate the changes of train length under the train separation scenarios, and the length state of the train is judged by comparing with the safety threshold. The relevant simulation parameter settings are shown in Table 9. The standard train length is 186.9 m, and the detection threshold is set to 2.5 m. When the train length error exceeds the safety threshold, the train length state is abnormal.

Table 9 Main performance parameters of train length simulation

The initial 400 s represent actual train operation data. The epoch 0 ~ 4000 is real measured data of the antennas at both ends of the train. The train is set to separate at epoch 4000th. The 4001 ~ 6000 epoch is the simulated data of the two antennas under the train decoupling scenario. The HOT antenna keeps moving forward, while the velocity of the EOT antenna decreases continuously due to air resistance and other factors and stopped at epoch 230th. the EOT antenna stays in the block and stops moving. The changes of longitude, latitude, and speed of HOT and EOT antennas are shown in Fig. 20.

  1. 2.

    Analysis of simulation results

Fig. 20
figure 20

Comparison of latitude, longitude, and speed simulation data of HOT and EOT antennas

The calculated real-time train length is subtracted from the reference length to obtain the real-time train length error, and then, the error result is compared with the set detection threshold to determine the train length state. In the first 4000 epochs, compared with the standard train length, the train length error was within 0.5 m, and the train length status is normal. After the 4000th epoch, the HOT and EOT antennas are simulated to be in a separate state. The EOT antenna begins to coasting operation, while the HOT antenna continues to operate at its previous speed. In this configuration, the train length status is flagged as abnormal and an alarm should be triggered.

Figure 21a displays the train length simulation result, and the corresponding train length status is shown in Fig. 21b. At the epoch 4012nd, the calculated train length error is 2.42 m, which was less than the set safety detection threshold 2.5 m. At this epoch, the train length status is still considered normal. The calculated train length is 2.75 m at the epoch 4013rd, which is greater than the set safety detection threshold. The train length state in this epoch is detected as abnormal, and there are 13 epoch delays.

Fig. 21
figure 21

Simulation results of train length and monitoring status: a Train length simulation results and b train length status simulation results

The design of detection thresholds is based on the considerations of communication delay and train length error. In practical applications, ensuring train length normal necessitates the foundation of high-precision train length calculation. Furthermore, it needs to integrate data from multiple sources, including details on train head and end positions, speed, wind pressure, and so on. This comprehensive approach is essential for making a well-informed assessment of train length status and ensuring the safety and reliability of the system.

In order to verify whether the efficiency of the algorithm meets the time requirement of the actual train operation, the elapsed time of GPS/BDS-AFT is computed. All timing results were performed in Matlab software on a laptop PC with AMD 3.2 GHz and 16 GB RAM. The Matlab ran with versionR2018b. The running time of the program is 616 s, and the average calculation time of each epoch is 0.03 s. So the train length calculation algorithm proposed in this paper has a good performance in efficiency, which can meet the physical demand.

Conclusions

We present a robust multi-constellation train length monitoring method, which can provide continuous and accurate train length status. The parameter of the algorithm is the moving-baseline length, which directly affects the accuracy of train length monitoring. Therefore, GPS/BDS integrated system was used to increase the number of visible satellites and hence to improve satellite geometric distribution. The utilization of double-differenced carrier phase observables can eliminate the clock errors and mitigate the orbit and signal propagation errors. Then, the KF was used to estimate the moving-baseline vector and ambiguity floating-point values. The ambiguity values were fixed to their expected integer values to decrease the moving-baseline estimation error. The noise interference is smoothed, and the tolerance to faults is improved using the proposed adaptive filtering algorithm, which can further ensure the accuracy and robustness of the train length monitoring system. The calculated moving-baseline length error is compared with the set safety threshold to judge the length state of the train.

The field test was conducted on the Beijing-Shenyang Railway. The train length computed using the GPS/BDS-FIX solution was compared with the GPS-FLOAT, GPS-FIX, and GPS/BDS-FLOAT solutions. All the four solutions can achieve the train length computation with sub-meter level accuracy, which can prove that the system is able to be adapt to the different GNSS signal conditions, where the GPS/BDS-FIX solution can achieve train length accuracy with RMS of 0.155 m, better than the other three solutions. The solution of GPS/BDS-AFT enhances the fault handling performance and further improves the robustness of the system. Furthermore, the results demonstrate that the proposed robust multi-constellation train length monitoring method can provide accurate and reliable train length estimation in both “GNSS-difficult” and “fault measurement” operational environments.