Next Article in Journal
A Dual-Structured Convolutional Neural Network with an Attention Mechanism for Image Classification
Previous Article in Journal
A Novel Convolutional Vision Transformer Network for Effective Level-of-Detail Awareness in Digital Twins
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Design and Experiment of Trajectory Reconstruction Algorithm of Wireless Pipeline Robot Based on GC-LSTM

School of Electrical and Electronic Engineering, Wuhan Polytechnic University, Wuhan 430048, China
*
Author to whom correspondence should be addressed.
Electronics 2025, 14(19), 3941; https://doi.org/10.3390/electronics14193941
Submission received: 15 August 2025 / Revised: 27 September 2025 / Accepted: 28 September 2025 / Published: 4 October 2025

Abstract

Wireless pipeline robots often suffer from localization drift and position loss due to electromagnetic attenuation and shielding in complex pipeline configurations, which hinders accurate pipeline reconstruction. This paper proposes a trajectory reconstruction method based on Geometric Constraint–Long Short-Term Memory (GC-LSTM). First, a motor control system based on Field-Oriented Control (FOC) was developed for the proposed pipeline robot; second, trajectory errors are mitigated by exploiting pipeline geometric characteristics; third, a Long Short-Term Memory (LSTM) network is used to predict and compensate the robot’s velocity when odometer slip occurs; finally, multi-sensor fusion is employed to obtain the reconstructed trajectory. In straight-pipe tests, the GC-LSTM method reduced the maximum deviation and mean absolute deviation by 69.79% and 72.53%, respectively, compared with the Back Propagation (BP) method, resulting in a maximum deviation of 0.0933 m and a mean absolute deviation of 0.0351 m. In bend-pipe tests, GC-LSTM reduced the maximum deviation and the mean absolute deviation by 60.48% and 69.91%, respectively, compared with BP, yielding a maximum deviation of 0.2519 m and a mean absolute deviation of 0.0850 m. The proposed method significantly improves localization accuracy for wireless pipeline robots and enables more precise reconstruction of pipeline environments, providing a practical reference for accurate localization in pipeline inspection applications.

1. Introduction

As a critical infrastructure for national energy transmission, oil and gas pipelines are prone to safety hazards such as leakage and rupture during long-term operation due to corrosion, wear, and other factors [1]. Traditional manual inspection methods suffer from low efficiency and limited coverage, making them difficult to meet the demands of refined management of complex pipeline networks [2]. In recent years, pipeline inspection robots, with their automation and real-time sensing capabilities, have become an important technical means for pipeline defect detection and location [3,4,5].
However, simply detecting defects is not enough to meet practical engineering needs. Accurate defect management relies on precisely mapping the inspection results to the pipeline’s global coordinate system and reconstructing the robot’s trajectory. Only after accurately restoring trajectory and time information can defects be accurately located, quantitatively assessed, and subsequently determined for repair and accountability. Therefore, trajectory reconstruction is both a prerequisite for making defect detection results usable and a key step in improving the overall reliability of the inspection system.
In studies of pipeline robot localization and trajectory reconstruction, fusion of inertial measurement unit (IMU) and odometers are widely adopted because it can provide continuous motion estimates over short time scales [6,7]. Nevertheless, The IMU is vulnerable to sensor noise and bias drift, which lead to error accumulation, while odometers are susceptible to slip and failure under complex operating conditions, introducing significant localization errors. These problems are further aggravated in wireless communication scenarios where electromagnetic attenuation and shielding can impede online correction and exacerbate positioning drift [8,9,10,11,12,13]. Therefore, it is imperative to introduce robust dynamic compensation models and constraint mechanisms via environmental features, physical modeling, or data-driven approaches to calibrate and constrain sensor errors, achieve accurate modeling of the pipeline environment, and obtain reliable estimates of the robot state, thereby enhancing the accuracy and robustness of trajectory reconstruction and defect localization [14,15].
To address the above challenges, various improvement strategies have been proposed in the literature. Chen et al. [16] developed a factor graph optimization (FGO) framework for aided inertial navigation systems (AINS), which integrates information from physical sensor measurements, motion constraints, and scene constraints. In a 1700 m pipeline, this framework achieved autonomous localization with a horizontal accuracy of 1.0 m and a vertical accuracy of 0.5 m. Wei et al. [17] proposed a dead-reckoning algorithm based on start–end correction and bidirectional solution reuse, which, in a 100 m simulated pipeline, yielded maximum positioning errors within 5 cm in straight sections and within 20 cm in 90° bends. Liu et al. [18] introduced a novel multi-position initial alignment method for a single-axis FOG combined with a tri-axial micro-electromechanical inertial measurement unit (MIMU) based on data backtracking. Experiments demonstrated pitch and roll errors less than 0.05° and azimuth errors less than 0.2°. Chen et al. [19] investigated the problem of PIG installation angle calibration, derived closed-form analytical solutions for IMU attitude angles, and proposed an alignment angle difference estimation method. Simulation and experimental results validated the method, showing accurate estimation and compensation of installation angle errors. Yu et al. [20] proposed using extremely low-frequency (ELF) magnetic fields radiated from ground-based coils to constrain INS positioning inside pipelines. Field tests with ductile iron pipes (DIP) at burial depths of 3.4–4.2 m showed average horizontal and vertical positioning errors of 0.12 m and 1.6 m, respectively. Nguyen et al. [21] utilized 3D point clouds obtained from LiDAR or time-of-flight cameras to simultaneously estimate pipeline attributes and PIG poses. Simulation results using a PIG simulator on the Robot Operating System (ROS) platform demonstrated that the proposed SPPE framework could accurately estimate both pipeline attributes and PIG poses. Li et al. [22] combined transient signal detection with multi-sensor data fusion using the Dempster–Shafer evidence framework and developed algorithms for transient pressure wave analysis. The fusion approach provided accurate localization estimates under both single- and multi-leak scenarios. Liu et al. [23] proposed a compensation method for pipeline centerline measurements based on LSTM networks to reduce odometer errors caused by wheel slip. Field test results showed that the average absolute position error decreased from 8.75 m to 2.02 m; however, the approach required above-ground markers (AGMs) with GPS information, which limited its applicability. Wang et al. [24] presented an enhanced localization method for underground pipeline robots based on inertial sensors and wheel odometer. Experiments in three pipelines of different lengths demonstrated position errors not exceeding 0.18%, 0.07%, and 0.11% of the survey length, respectively. Lu et al. [25] proposed a vibration-signal-based localization method for in-pipe detectors. They designed a structural model of an internal detector localization system and adopted a two-stage neural network consisting of a convolutional neural network (CNN) and a recurrent neural network (RNN) to achieve positioning. Chen et al. [26] proposed an error compensation Bessel bidirectional long short-term memory real-time path prediction model deployed in ground stations. This model can predict drone flight paths with a root mean square error (RMSE) of less than 1 m within 0.1 s. However, its accuracy relies on GPS positioning information, resulting in certain limitations. Liu et al. [27] modeled indoor trajectory uncertainty as a sequence prediction problem and proposed a novel data-driven approach based on LSTM. Experiments demonstrated that this method outperforms previous models in terms of balanced accuracy, achieving over 80% coverage density and completeness of ground truth points. However, their research relies on high-precision sensors in large quantities, resulting in high costs and limited applicability. Chen et al. [28] proposed an error compensation method for GNSS/inertial navigation systems based on LSTM neural networks attention mechanism-long short-term memory (AT-LSTM), aiming to enhance positioning accuracy during GNSS outages for unmanned aerial vehicles. Experimental results demonstrate that during a 60 s GNSS outage, the AT-LSTM method achieves over 90% higher positioning accuracy than relying solely on the inertial navigation system. However, their research was conducted under GPS-available conditions, and its applicability in harsh environments without GPS coverage remains to be investigated. Table 1 summarizes recent work by methodology and key performance.
Although these approaches have achieved remarkable progress, existing solutions often rely on external infrastructure for error correction, resulting in high costs and limited applicability. Moreover, some high-accuracy methods depend on expensive or sophisticated sensors, such as fiber optic gyroscopes or 3D point cloud cameras, which increase system cost and hardware complexity, thereby hindering large-scale commercial deployment. In contrast, low-cost inertial sensors are more suitable for practical applications but are easily affected by interference in complex in-pipe environments, leading to lower data accuracy.
To address the limitations of trajectory reconstruction methods that rely on external markers, the high cost of high-precision sensors, and the susceptibility of low-cost sensors to interference, this paper proposes a trajectory reconstruction approach for wireless pipeline robots based on GC-LSTM. The remainder of this paper is organized as follows: Section 2 presents the overall hardware architecture of the pipeline robot system; Section 3 elaborates on the core principles and implementation details of the proposed GC-LSTM-based trajectory reconstruction method; Section 4 evaluates and analyzes the performance of the proposed method through comparative experiments; and Section 5 concludes the paper with a summary of the work.

2. Pipeline Robot System Structure

2.1. Pipeline Robots

The overall structure of the pipeline robot is shown in Figure 1. It utilizes a six-wheeled support structure, with the vehicle body connected by two interlocking intermediate plate assemblies. Adjustable gears at each end allow the support module to be extended or retracted via a lead screw module, enabling it to accommodate pipelines of varying inner diameters. The entire robot is powered by a portable power module. The host computer is responsible for task dispatch and result management, while the MCU performs low-level motion control and data acquisition.
The drive system employs a stepper-motor drive based on FOC. Compared to traditional microstepping drives, FOC enables continuous control of electromagnetic torque over a wider speed range, significantly reducing torque ripple and improving dynamic response. This ensures the robot maintains stable propulsion even when encountering sudden changes in radius or grip within the tube. The motor transmits its output torque to the rubber drive wheels via a reduction gearbox. The tire material and clamping force are designed to ensure sufficient friction while minimizing damage to the tube wall.
Attitude and velocity measurement employs a fusion scheme that combines an IMU (MPU6050, TDK InvenSense. MPU-6050 Product Specification; TDK InvenSense: San Jose, CA, USA,2013.) and an odometer module (MT6816 magnetic encoder module integrated on the FOC board, Shanghai MagnTek Microelectronics Co., Ltd. MT6816—High Speed & High Resolution Magnetic Angle Sensor IC; Shanghai MagnTek Microelectronics: Shanghai, China, rev. 2022.). The MPU6050 provides three-axis acceleration and angular velocity signals, while the odometer provides the pipeline robot’s linear velocity and mileage increments. These two sensors are fed into a fusion filter using a unified timestamp and mutual correction mechanism. This suppresses the cumulative errors caused by IMU drift and odometer slip, resulting in stable attitude and velocity estimates. The pipeline robot’s main structural and performance parameters are shown in Table 2.

2.2. Pipeline Robot Trajectory Acquisition Model

The trajectory of the pipeline robot running inside the oil and gas transmission pipeline highly coincides with the pipeline centerline. Based on this feature, the spatial distribution of the geometric centerline of the pipeline can be obtained by reconstructing the motion trajectory of the pipeline robot with high accuracy. The robot is equipped with an IMU, which uses the principle of inertial navigation to treat the position, speed, and attitude of the robot in the inertial coordinate system as state variables and establishes relevant mathematical models.
The motion analysis model of the pipeline robot is shown in Figure 2, with the coordinate system AA as the reference coordinate system and the coordinate system BB as the dynamic coordinate system, which is fixed on the pipeline robot. The origin CC is on the central axis of the pipe robot and is equal to the front and rear wheels, and the robot pose is represented by the Euler angle ϕ, θ, ψ.
The coordinate transformation of the pipeline robot synchronously drives changes in the robot’s attitude, and it is necessary to convert the ontology coordinate system O 1 X 1 Y 1 Z 1 and the reference coordinate system O X Y Z . For any point r O 1 on the robot body, it is represented in the reference coordinate system as Equation (1).
r O = R ϕ , θ , ψ r O 1 + P
where P = x , y , z T is the position of the robot’s coordinate origin in the frame of reference.
In the process of realizing 3D trajectory reconstruction, accurate characterization of sensor errors and integral drift correction are the key. The following is described in detail from four aspects: sensor output model, filtering and zero bias correction, numerical integration and drift estimation, and position reconstruction, and the trajectory acquisition model is shown in Figure 3.
The pipeline robot operation is output by sensors to establish the model and define the coordinate system, and the sampling time is t k = k T s , k = 0 , 1 , , N . Considering zero bias and noise, the measurement model is as shown in Equation (2).
a m t = R t T a ω t g ω + b a + n a t
where a ω t R 3 is the real linear acceleration under world coordinates, g ω is the gravity vector, R t is the body-to-world rotation matrix composed of Euler angles, b a is the acceleration zero deviation, and n a t is the high-frequency Gaussian noise.
The obtained raw data has interference factors such as zero bias and noise, and the auxiliary stationary detection is obtained by using low-pass filtering, and the acceleration threshold is set for stationary judgment, as shown in Equation (3).
a l k = L P F a c o r r , f c l   s k = 1 , 0 ,   | | a l k | | < ε o t h e r w i s e
where a c o r r is the correction acceleration, f c l is the low-pass filter frequency, and ε is the acceleration threshold.
The drift of each stationary interval is estimated according to the stationary determination, the acceleration is numerically integrated by the trapezoidal method, and the drift is calibrated as Equation (4).
v k = i = 1 k a h i 1 + a h i 2 T s g i = v k f v k i k f k i T s Δ v k = k k i T s g i v c k = v k Δ v k
where a h is the high-pass filter acceleration, g i is the velocity drift rate, Δ v is the drift in the resting interval, and v c is the corrected velocity value.
The corrected velocity is integrated again for preliminary trajectory reconstruction, and the trajectory position is obtained as shown in Equation (5).
p k = i = 1 k v c i 1 + v c i 2 T s
Finally, the Euler angle is converted into a rotation matrix R k , and the trajectory position p k is combined to generate the trajectory of the pipeline robot.

3. GC-LSTM-Based Trajectory Reconstruction Method

Trajectory reconstruction for pipeline robots depends on strongly temporally correlated data. The gating mechanisms of LSTM accurately capture both long- and short-term temporal dependencies: they alleviate the gradient problems of traditional RNNs for modeling long sequences, adaptively suppress IMU noise, preserve historical trends during odometer slip, and accommodate non-stationary data caused by abrupt changes in pipe geometry, making LSTM particularly suitable for temporal modeling. Moreover, the inclusion of geometric constraints further enhances reconstruction accuracy. The following section provides a detailed description of the proposed GC-LSTM trajectory reconstruction method.

3.1. Overall Flow of the Trajectory Acquisition Method

In order to realize the error identification and compensation of sensor information distortion in the pipeline, the data processing process based on GC-LSTM as shown in Figure 4 is proposed. Firstly, the IMU and odometer sensor outputs are synchronously collected, and the original data is time aligned and preprocessed. Secondly, the robot posture is constrained by combining the geometric characteristics of the pipeline, and the attitude offset introduced by the accuracy of the equipment and external disturbances is eliminated to produce the output of pipeline features. In addition, the residual between the IMU and the odometer speed is calculated to determine the threshold of the residual sequence to identify whether the odometer has slipped and failed. When the residuals are less than the preset threshold, the data at this stage is marked as normal and included in the training set of the LSTM model. When the residual exceeds the threshold, it is considered to be an abnormal odometer operation, and the trained LSTM model is used to predict and compensate for the speed error at the current moment in real time. Finally, the compensated odometer speed is fused with the IMU attitude information, and the pipeline centerline trajectory is reconstructed through integral operation.

3.2. Data Processing Model Based on GC-LSTM

To fully leverage the complementary advantages of the geometric constraint model for pipelines and the LSTM-based velocity prediction model, this study employs an Extended Kalman Filter (EKF) framework. The initial state selection and covariance configuration for the EKF in this research are as follows. The initial state x 0 = p 0 ; v 0 is derived from sensor position and velocity data. When external references are unavailable, the initial state is set to the zero vector, and the initial covariance matrix is assigned a relatively large value to account for uncertainty. The process noise Q is designed based on the acceleration measurement noise spectral density q c , obtained by discretizing the constant acceleration model as shown in Equation (6).
Q = q c Δ t 4 4 I 3 Δ t 3 2 I 3 Δ t 3 2 I 3 Δ t 2 I 3
When no spectral density data is available, q c is estimated using the variance of acceleration samples. The observation noise R is determined by the position measurement accuracy; if unknown, it is estimated online via the sample covariance of the innovation sequence and updated using smoothing to ensure numerical stability. To improve long-term accuracy, the acceleration bias b a is treated as an optional extended state and assumed to follow a random walk.
To extract attitude constraints from IMU data, this paper employs a sliding window technique. Let the sliding window size be L, corresponding to the time set {k − L + 1,…,k}. The quaternion estimates obtained via the EKF can be converted into a right-multiplicative rotation matrix, which is then transformed into roll angle α ^ 1 , pitch angle α ^ 2 , and yaw angle α ^ 3 . Based on the changes in Euler angles within the sliding window, the following attitude constraint rules are established.
If α ^ 2 , k < ε , the robot is considered to be in a horizontal pipe section with a pitch angle of 0; if α ^ 2 , k π 2 < ε , the robot is considered to be in a vertical pipe section with a pitch angle of 90 degrees; if α ^ 2 , k α ^ 2 , k L + 1 < ε and α ^ 3 , k α ^ 3 , k L + 1 < ε , the robot is considered to be in a straight pipe section where both pitch and yaw angles should remain constant; if α ^ 3 , k α ^ 3 , k L + 1 θ < ε , the robot is considered to be passing through a standard elbow, and the yaw angle should increase by θ .
Where ε is the attitude angle threshold, and M is determined by the sampling time and the robot’s velocity.
By incorporating the aforementioned attitude constraints as supplementary measurement information into the state estimation algorithm, IMU attitude drift can be directly suppressed, attitude estimation errors corrected, and position integration errors indirectly mitigated. This further enhances trajectory spatial accuracy, accommodates complex pipeline geometries, reduces dynamic scene uncertainties, and ultimately improves trajectory reconstruction accuracy.
The attitude constraint module uses a sliding window to interpret pipeline geometry, generating targeted constraints to suppress IMU integration drift and noise, thereby outputting cleaner fundamental attitude and acceleration data. The LSTM module takes historical motion sequences as input to learn odometer velocity patterns, predicting velocity information to compensate for measurement gaps during odometer slippage or failure. Ultimately, the attitude-constrained purified IMU data and the odometer velocity information predicted by LSTM undergo multi-source fusion. Combined with the state quantities output by algorithms such as EKF, they jointly drive the trajectory generation module to obtain the precise operational trajectory of the pipeline robot. The established GC-LSTM network is shown in Figure 5.
Taking the speed error sequence of the past n moments as the input and the speed error of the current moment as the output, the error characteristics when the odometer slips are learned by LSTM network. Where φ V denotes the speed, φ V t denotes the speed error at the current moment, and φ V t n n = 1 , 2 , , L denotes the error value at each moment in history. When skidding data is detected, the speed error is predicted and compensated by the input speed error at the previous moment and the training model of LSTM, and the prediction and compensation process when the odometer is skidding is shown in Figure 6.
In LSTM networks, predicting the velocity error at the first moment requires the errors of the previous L moments as an input sequence whose length is the sequence length. The relevant parameters are established as in Equation (7).
ϕ = φ V t 1 , φ V t 2 , , φ V t n ψ = ψ 1 , ψ 2 , , ψ n L + 1 ψ t r a i n = ψ 1 , ψ 2 , , ψ m ψ t e s t = ψ m + 1 , ψ m + 2 , , ψ n L ψ i = φ V t i , φ V t i 1 , , φ V t i L
where ϕ is the original error sequence, ψ is the vector sample of the original error sequence, ψ t r a i n is the training set, and ψ t e s t is the test set.
The velocity prediction of the LSTM model is introduced as a compensating quantity for the measurement update, followed by the fusion of the pipeline feature model under the Extended Kalman Filter (EKF) as the main framework to correct the attitude. To balance the uncertainty of the feature model with the LSTM model, the fused velocity is defined as in Equation (8).
V f k = α k V g c e k f k + 1 α k V o d o k φ V l s t m k
where V g c e k f k is the predicted velocity of the pipe attitude feature in the EKF framework, V o d o k is the original velocity of the odometer, φ V l s t m k is the velocity error predicted by the LSTM, and α k is the adaptive weight determined by the model covariance.
On the basis of the fusion speed AA, the extended observation vector and covariance matrix are shown in Equation (9).
z k = z i m u k V f k R k = R i m u 0 0 R v k
where z i m u is the attitude angle and acceleration matrix data of the IMU, R i m u is the measurement noise covariance, and R v is the noise covariance of the fused velocity observations.
The compensated velocities are used as observations of the EKF for the measurement update, along with the results of the eigenmodel corrections, and the final state of the output is shown in Equation (10).
K k = P k k 1 H T H P k k 1 H T + R k 1 x k = x k k 1 + K k z k h x k k 1
where H is the observation matrix.
During the operation of the pipeline robot, the above fusion process is executed in real time to correct the velocity and attitude online. The fused velocity and attitude information is finally utilized to obtain the pipeline trajectory data by integration as shown in Equation (11).
p k = p k 1 + t 1 t V f τ R q τ e x d τ
where q is the output pose, R(q) is the rotation matrix of the quaternion transformation, and e x is the forward unit vector of the robot body.
An LSTM network was employed to predict velocity errors. The network architecture features an input layer receiving a sequence of 15 historical velocity errors. An LSTM layer with 15 hidden units captures temporal dependencies, followed by a fully connected layer with Rectified Linear Unit (ReLU) activation functions. The final prediction is obtained through a linear output layer. The network was trained using the RMSprop optimizer with an initial learning rate of 0.05 and a batch size of 1000, employing mean squared error as the loss function. An early stopping mechanism was implemented to prevent overfitting. All input and output data underwent Z-score normalization based on statistics from the training set.

4. Experiments and Results

To validate the proposed GC-LSTM trajectory acquisition and optimization method, experiments were conducted on a purpose-built pipeline-robot testbed. The instrumented prototype recorded inertial and odometer signals while operating in representative straight and curved pipe sections; these tests were designed to evaluate attitude stability, odometer slip effects, and the accuracy of reconstructed trajectories. Algorithm performance is quantified using maximum error, mean absolute error, and standard deviation, and comparative results with BP and standard LSTM compensation schemes are presented below.

4.1. Experimental Platforms

To validate the feasibility of the proposed method, this study constructed a pipeline robot motion experimental platform as shown in Figure 7a. The pipeline material selected was polypropylene (PP) ducting, which offers excellent chemical corrosion resistance, low density, high thermal stability, and low cost. An MPU6050 IMU was used to acquire attitude, while a MT6818 (Shanghai MagnTek Microelectronics Co., Ltd. MT6816—High Speed & High Resolu-tion Magnetic Angle Sensor IC; Shanghai MagnTek Microelectronics: Shanghai, China, rev. 2022.) magnetic encoder provided odometry measurements. The pipeline robot operated at an average speed of 0.18 m/s during experiments. The experimental platform encompassed two typical operating conditions: straight pipe sections and curved pipe sections. Straight-pipe experiments utilized a 3 m standard straight pipe to evaluate the robot’s attitude stability and positioning accuracy within straight sections; The curved-pipe experiments were conducted in a 6.5 m-long combined curved pipe environment to test the robot’s motion characteristics and trajectory reconstruction performance when navigating bends. The curved pipe environment and internal operation conditions are shown in Figure 7b. During the experiment, the pipeline robot was equipped with an IMU and an odometer, which recorded raw data such as three-axis angular velocity, linear acceleration, and odometer velocity in real time.

4.2. GC-LSTM Simulation Experiment

To validate the performance of the proposed GC-LSTM model, this paper constructed simulation comparison models for GC-LSTM, LSTM, and BP neural networks using the MATLAB (The MathWorks, Inc. MATLAB R2023a Documentation; The MathWorks, Inc.: Natick, MA, USA, 2023.) simulation platform. BP serves as the classical benchmark model, featuring a simple structure without temporal modeling capabilities, thereby highlighting its core difference from LSTM’s temporal modeling approach. In tasks such as odometer slippage prediction and IMU drift identification, the BP model relies solely on the current frame, whereas the LSTM model can incorporate historical time series data. This directly demonstrates the necessity of the LSTM’s temporal characteristics for improving trajectory accuracy. A total of over 7000 valid samples were collected from a 6 m-long pipeline through magnetic encoders on the FOC development board, spanning more than 50 experiments. These samples formed the odometer velocity database used for a series of simulation experiments. Model inputs comprised velocity data collected from pipeline robots under normal operating conditions (velocity fluctuations between 0.18–0.185 m/s) and slippage failure conditions (velocity fluctuations between 0.13–0.14 m/s). Outputs represented predicted velocity values at corresponding time points. All simulations were conducted using identical datasets and training strategies to ensure fair comparison among the three methods. Figure 8 compares the prediction compensation results during slip failure periods, Figure 9 shows the error distribution comparison, and Figure 10 presents the performance comparison. It can be observed that GC-LSTM significantly outperforms the BP network in velocity prediction compensation.
Table 3 displays the main error performance indicators of the three models under slip failure conditions. The root mean square error, maximum absolute error, and standard deviation of BP do not exceed 0.0282 m/s, 0.0331 m/s, and 0.0014 m/s, respectively; those of LSTM under the same conditions do not exceed 0.0054 m/s, 0.0084 m/s, and 0.0008 m/s; and those of GC-LSTM do not exceed 0.0008 m/s, 0.0042 m/s, and 0.0008 m/s. Compared with BP, the average performance improvement of LSTM in the root mean-square error and the maximum absolute error reaches 85.40% and 77.78%, respectively. GC-LSTM achieves an average performance improvement of 80.00% and 43.05% in root mean square error and maximum absolute error, respectively, compared to LSTM.

4.3. Experiments on Pipeline Trajectory Acquisition Based on GC-LSTM

After completing the experiment, the collected raw data are preprocessed and trajectory reconstructed. First, the actual path length of the robot’s movement in the pipeline was calculated using the multi-sensor fusion algorithm, and the reconstruction results are evaluated by comparing them with the odometer measurements. The results show that the error between the measured trajectory distance and the actual value exceeds the engineering tolerance range in most cases, which is mainly due to the sensor accuracy error, environmental noise interference, and the odometer slipping failure phenomenon when traveling inside the pipeline, which leads to the local trajectory offset, and then causes a decrease in the overall trajectory reconstruction accuracy. Therefore, it is necessary to post-process the original measurement values to improve the accuracy and reliability of pipeline trajectory reconstruction.
In order to further verify the effectiveness of the proposed method, a speed-error prediction and compensation scheme based on a backpropagation (BP) neural network was designed and implemented, and a comparative study with an LSTM method and the GC-LSTM method was conducted. During 20 straight-pipe and 20 curved-pipe experiments, the odometer’s measured distances and the corresponding ground-truth distances were recorded whenever wheel slippage occurred; the results are shown in Figure 11 and Figure 12. In these figures, the blue line denotes the error between the original odometer-measured trajectory distance and the ground-truth distance; the orange line denotes the BP method’s predicted distance error relative to the ground truth; the yellow line denotes the LSTM method’s predicted distance error; and the purple line denotes the GC-LSTM method’s predicted distance error.
Table 4 lists the deviation results of the four methods in the straight pipe environment, the maximum deviation, mean absolute deviation, and standard deviation of the original measurements are 0.298, 0.202, and 0.063, respectively; the maximum deviation, mean absolute deviation, and standard deviation of the BP-corrected method are 0.149, 0.091, and 0.029, respectively, which are reduced in comparison with that of the original measurements by 50.00% and 54.95%; the maximum deviation, mean absolute deviation, and standard deviation after LSTM correction were 0.095, 0.059, and 0.019, respectively, and the maximum deviation and mean absolute deviation were further reduced by 36.24% and 35.16% based on the BP method, and the maximum deviation, mean absolute deviation, and standard deviation after GC-LSTM correction were 0.045, 0.025 and 0.013, and the maximum deviation, mean absolute deviation were further reduced by 52.63% and 57.62% based on LSTM method.
Table 5 demonstrates the deviation results of the four methods in the bending environment; the maximum deviation, mean absolute deviation, and standard deviation of the original measurements are 0.941, 0.725, and 0.141, respectively; the maximum deviation, mean absolute deviation, and standard deviation of the BP-corrected method are 0.334, 0.226, and 0.051, respectively, which are reduced in comparison with that of the original measurements by 64.50% and 68.82%; the maximum deviation, mean absolute deviation, and standard deviation after LSTM correction were 0.288, 0.151, and 0.047, respectively, and the maximum deviation and mean absolute deviation were further reduced by 13.77% and 33.18% on the basis of the BP method, and the maximum deviation, mean absolute deviation, and standard deviation after GC-LSTM correction were 0.132, 0.068 and 0.040, and the maximum deviation, mean absolute deviation were further reduced by 54.17% and 54.96% based on LSTM method. The experimental results show that the proposed LSTM compensation strategy performs better in terms of positioning accuracy, can significantly improve the accuracy of trajectory reconstruction, and provides a solid algorithmic foundation for realizing high-precision online detection.

4.4. Comparison of GC-LSTM Optimization Results

In order to verify the effectiveness of the GC-LSTM method in trajectory optimization, straight-pipe and curved-pipe experimental data were selected to analyze the original trajectories and the trajectories reconstructed by the GC-LSTM method. For the straight-pipe environment, Figure 13a,b show the effect of trajectory reconstruction after filtering out interference: noise offsets and equipment accuracy errors are partially suppressed, and trajectory linearity is improved. For the curved-pipe environment, Figure 13c,d indicate that lateral disturbances induced by curvature changes are more complex, and irregular offsets are also corrected after applying the attitude-constraint method. In Figure 13, the colored traces correspond to the three coordinate axes: the green trace represents the X-axis component, the blue trace represents the Z-axis component, and the red trace represents the Y-axis component.
Combining the results in Table 6 with those in Table 7, it can be seen that in the straight-pipe experiment, the maximum deviation of the trajectory reconstruction after applying the GC-LSTM constraints decreases from the original measurement value of 0.7284 m to 0.0933 m, with an average reduction of 87.19% in deviation, and the average absolute deviation decreases from the original measurement value of 0.2693 m to 0.0351 m, with an average reduction of 86.96% in deviation. In the pipe bending experiment, the method makes the maximum deviation decrease from the original measurement value of 1.8710 m to 0.2519 m, with an average reduction of deviation of 86.53%, and the average absolute deviation decrease from the original measurement value of 0.6278 m to 0.0850 m, with an average reduction of deviation of 86.46%.

5. Conclusions

Aiming at the problems of positioning drift and loss of wireless pipeline robots caused by pipeline electromagnetic attenuation and shielding effect, this paper proposes a trajectory reconstruction method based on GC-LSTM. Experiments on a prototype integrating an STM32 controller, a FOC stepper motor drive, and an IMU-odometer fusion module show that the performance of this method is significantly superior to that of BP and LSTM methods. Under the slipping condition, the Root Mean Square Error and Mean Absolute Error of the proposed method are reduced by an average of 80.00% and 43.05% compared with those of the LSTM method. Moreover, the maximum positioning deviations in straight pipes and elbow pipes are reduced to 0.0933 m and 0.2519 m, respectively, which effectively solves the problem of positioning accuracy.
Although the GC-LSTM model demonstrated promising results in experiments, its adaptability in complex heterogeneous environments remains to be validated.; the real-time performance of the embedded platform and the robustness under extreme working conditions need to be optimized. In future work, this study will expand multi-scenario verification, explore multi-robot collaborative positioning, and realize complementary trajectory correction through multi-robot data interaction, so as to solve the positioning blind area problem in branched pipelines and long-distance pipelines. In addition, algorithm lightweighting will be carried out, and multi-sensor fusion strategies will be optimized to further improve the adaptability and robustness of the method.

Author Contributions

Conceptualization, W.W. and M.Z.; methodology, W.W. and M.Z.; software, W.W.; validation, W.W. and M.Z.; formal analysis, W.W.; writing—original draft preparation, W.W.; writing—review and editing, W.W.; supervision,W.W. and M.Z.; project administration, M.Z.; funding acquisition, M.Z. All authors have read and agreed to the published version of the manuscript.

Funding

This research was funded by Fundamental Research Funds for the Central Universities (Grant No. 2024RZ075) and the Guiding Project of Hubei Provincial Department of Education’s Scientific Research Plan for 2023 (Grant No. B2023054).

Data Availability Statement

The original contributions presented in this study are included in the article. Further inquiries can be directed to the corresponding author.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Chen, P.; Li, R.; Jia, G.; Lan, H.; Fu, K.; Liu, X. A Decade Review of the Art of Inspection and Monitoring Technologies for Long-Distance Oil and Gas Pipelines in Permafrost Areas. Energies 2023, 16, 1751. [Google Scholar] [CrossRef]
  2. Lu, J.; Song, W.; Zhang, Y.; Yin, X.; Zhao, S. Real-time defect detection in underground sewage pipelines using an improved YOLOv5 model. Autom. Constr. 2025, 173, 106068. [Google Scholar] [CrossRef]
  3. Xie, J.; Zhang, Y.; He, Z.; Liu, P.; Qin, Y.; Wang, Z.; Xu, C. Automated leakage detection method of pipeline networks under complicated backgrounds by combining infrared thermography and Faster R-CNN technique. Process Saf. Environ. Prot. 2023, 174, 39–52. [Google Scholar] [CrossRef]
  4. Chen, Q.; Zhang, Q.; Niu, X.; Wang, Y. Positioning Accuracy of a Pipeline Surveying System Based on MEMS IMU and Odometer: Case Study. IEEE Access 2019, 7, 104453–104461. [Google Scholar] [CrossRef]
  5. Zhang, S.; Dubljevic, S. Trajectory determination for pipelines using an inspection robot and pipeline features. Metrol. Meas. Syst. 2021, 28, 439–453. [Google Scholar] [CrossRef]
  6. Yoo, K.; Kim, D.K.; Kim, J.J.; Yang, S.U.; Yoo, H.R.; Song, H.; Jeong, H.Y.; Nguyen, H.H.; Song, J.W.; Kim, D.K. Improving Localization Accuracy of Offline Navigation Algorithms for Intelligent Pipeline Inspection Gauges and In-Line Inspection Robotic Systems. J. Field Robot. 2025, 42, 2218–2233. [Google Scholar] [CrossRef]
  7. Chowdhury, M.S.; Abdel-Hafez, M.F. Pipeline Inspection Gauge Position Estimation Using Inertial Measurement Unit, Odometer, and a Set of Reference Stations. ASCE-ASME J. Risk Uncertain. Eng. Syst. Part B Mech. Eng. 2016, 2, 021001. [Google Scholar] [CrossRef]
  8. Wang, W.; Yang, D.; Zhang, J.; Lao, L.; Yin, Y.; Zhu, X. A dead reckoning localization method for in-pipe detector of water supply pipeline: An application to leak localization. Measurement 2021, 171, 108835. [Google Scholar] [CrossRef]
  9. Gokce, K.; Yavasoglu, H.A.; Yılmaz, M. A novel position determination method for the modular snake-like natural gas pipeline inspection robot in a GPS denied environment. Int. J. Glob. Warm. 2023, 29, 240. [Google Scholar] [CrossRef]
  10. Vignesh, G.D.; Ramu, A.; Raja, J.T.; Ponmurugan, P.; Haldorai, A.; Senthilkumar, G. Sensor data fusion techniques in the construction of generalized VORONOI graph for on-line motion planning in robot navigation. Int. J. Syst. Assur. Eng. Manag. 2022, 6, 117–132. [Google Scholar] [CrossRef]
  11. Niu, X.; Hu, J.; Chen, Q.; Zhao, D. A MEMS IMU-Based Air-Propelled Positioning Ball for Small-Diameter Underground Pipelines Localization. IEEE Sens. J. 2025, 10, 18257–18267. [Google Scholar] [CrossRef]
  12. Liu, Y.; Luo, Q.; Zhou, Y. Deep Learning-Enabled Fusion to Bridge GPS Outages for INS/GPS Integrated Navigation. IEEE Sens. J. 2022, 22, 8974–8985. [Google Scholar] [CrossRef]
  13. Kazeminasab, S.; Sadeghi, N.; Janfaza, V.; Razavi, M.; Ziyadidegan, S.; Banks, M.K. Localization, Mapping, Navigation, and Inspection Methods in In-Pipe Robots: A Review. IEEE Access 2021, 9, 162035–162058. [Google Scholar] [CrossRef]
  14. Kahnamouei, J.T.; Moallem, M. A comprehensive review of in-pipe robots. Ocean. Eng. 2023, 277, 114260. [Google Scholar] [CrossRef]
  15. Zhang, P.; Hancock, C.M.; Lau, L.; Roberts, G.W.; de Ligt, H. Low-cost IMU and odometer tightly coupled integration with Robust Kalman filter for underground 3-D pipeline mapping. Measurement 2019, 137, 454–463. [Google Scholar] [CrossRef]
  16. Chen, Q.; Li, S.; Chen, Q.; Niu, X.; Wang, Y.; Jiang, W. Multi-level information fusion enhanced by scene constraint: Key to improve autonomous positioning accuracy in urban underground pipeline using MEMS inertial sensors. Measurement 2025, 239, 115442. [Google Scholar] [CrossRef]
  17. Wei, X.; Fan, S.; Zhang, Y.; Chang, L.; Wang, G.; Shen, F. Positioning Algorithm of MEMS Pipeline Inertial Locator Based on Dead Reckoning and Information Multiplexing. Electronics 2022, 11, 2931. [Google Scholar] [CrossRef]
  18. Liu, J.; Wang, L.; Zu, Y.; Hu, Y. Multi-Position Inertial Alignment Method for Underground Pipelines Using Data Backtracking Based on Single-Axis FOG/MIMU. Micromachines 2024, 15, 1168. [Google Scholar] [CrossRef] [PubMed]
  19. Chen, Q.; Niu, X.; Kuang, J.; Liu, J. IMU Mounting Angle Calibration for Pipeline Surveying Apparatus. IEEE Trans. Instrum. Meas. 2020, 69, 1765–1774. [Google Scholar] [CrossRef]
  20. Yu, T.-T.; Peng, W.-F.; Chen, H.-M.; Hsu, C.-L.; Deng, S.-L. Applying Electrical Magnetic Coil and In-Pipe INS to Map Underground Pipeline Track. J. Pipeline Syst. Eng. Pract. 2024, 15, 04223060. [Google Scholar] [CrossRef]
  21. Nguyen, H.-H.; Park, J.-H.; Jeong, H.-Y. A Simultaneous Pipe-Attribute and PIG-Pose Estimation (SPPE) Using 3-D Point Cloud in Compressible Gas Pipelines. Sensors 2023, 23, 1196. [Google Scholar] [CrossRef] [PubMed]
  22. Li, J.; Zhang, Z. Pipeline leakage localization method based on transient signal detection and data fusion from multi-sensor. J. Hydroinformatics 2024, 26, 2235–2250. [Google Scholar] [CrossRef]
  23. Liu, S.; Zheng, D.; Li, R. Compensation Method for Pipeline Centerline Measurement of in-Line Inspection during Odometer Slips Based on Multi-Sensor Fusion and LSTM Network. Sensors 2019, 19, 3740. [Google Scholar] [CrossRef]
  24. Wang, Q.; Cai, M.; Guo, Z. An enhanced positioning technique for underground pipeline robot based on inertial Sensor/Wheel odometer. Measurement 2023, 206, 112298. [Google Scholar] [CrossRef]
  25. Lu, S.; Zhou, T.; Wang, C.; Lin, Z.; Yi, G. An Internal Detector Positioning Method in Oil Pipelines Using Vibration Signal. IEEE Sens. J. 2023, 23, 13411–13421. [Google Scholar] [CrossRef]
  26. Chen, S.; Chen, B.; Shu, P.; Wang, Z.; Chen, C. Real-time unmanned aerial vehicle flight path prediction using a bi-directional long short-term memory network with error compensation. J. Comput. Des. Eng. 2023, 10, 16–35. [Google Scholar] [CrossRef]
  27. Liu, Z.; Shi, W.; Yu, Y.; Chen, P.; Yu Chen, B. A LSTM-based approach for modelling the movement uncertainty of indoor trajectories with mobile sensing data. Int. J. Appl. Earth Obs. Geoinf. 2022, 108, 102758. [Google Scholar] [CrossRef]
  28. Chen, S.; Xin, M.; Yang, F.; Zhang, X.; Liu, J.; Ren, G.; Kong, S. Error Compensation Method of GNSS/INS Integrated Navigation System Based on AT-LSTM During GNSS Outages. IEEE Sens. J. 2024, 24, 20188–20199. [Google Scholar] [CrossRef]
Figure 1. System Composition of Pipeline Robots: 1. FOC motor control board; 2. Computer; 3. Portable power supply module; 4. Stepper motor; 5. IMU data acquisition module; 6. Motor reducer.
Figure 1. System Composition of Pipeline Robots: 1. FOC motor control board; 2. Computer; 3. Portable power supply module; 4. Stepper motor; 5. IMU data acquisition module; 6. Motor reducer.
Electronics 14 03941 g001
Figure 2. Schematic diagram of kinematic analysis of pipeline robot.
Figure 2. Schematic diagram of kinematic analysis of pipeline robot.
Electronics 14 03941 g002
Figure 3. Trajectory acquisition model.
Figure 3. Trajectory acquisition model.
Electronics 14 03941 g003
Figure 4. GC-LSTM-based trajectory compensation method flow.
Figure 4. GC-LSTM-based trajectory compensation method flow.
Electronics 14 03941 g004
Figure 5. GC-LSTM network model.
Figure 5. GC-LSTM network model.
Electronics 14 03941 g005
Figure 6. Predicting the compensation process in case of odometer slip failure.
Figure 6. Predicting the compensation process in case of odometer slip failure.
Electronics 14 03941 g006
Figure 7. Pipeline Robot Experimental Environment: (a) Pipeline robot prototype; (b) Experimental piping environment.
Figure 7. Pipeline Robot Experimental Environment: (a) Pipeline robot prototype; (b) Experimental piping environment.
Electronics 14 03941 g007
Figure 8. Comparison of different methods for predicting compensated odometer speed.
Figure 8. Comparison of different methods for predicting compensated odometer speed.
Electronics 14 03941 g008
Figure 9. Comparison of the distribution of error results of different methods.
Figure 9. Comparison of the distribution of error results of different methods.
Electronics 14 03941 g009
Figure 10. Comparison of performance index results of different methods.
Figure 10. Comparison of performance index results of different methods.
Electronics 14 03941 g010
Figure 11. Error results of different methods under a straight pipe.
Figure 11. Error results of different methods under a straight pipe.
Electronics 14 03941 g011
Figure 12. Error results for different methods under bends.
Figure 12. Error results for different methods under bends.
Electronics 14 03941 g012
Figure 13. Comparison of GC-LSTM experimental results: (a) Raw data on straight pipes; (b) Optimization results of straight pipe GC-LSTM; (c) Bend raw data; (d) Bend GC-LSTM optimization results.
Figure 13. Comparison of GC-LSTM experimental results: (a) Raw data on straight pipes; (b) Optimization results of straight pipe GC-LSTM; (c) Bend raw data; (d) Bend GC-LSTM optimization results.
Electronics 14 03941 g013
Table 1. Summary of related works by method.
Table 1. Summary of related works by method.
MethodReferencesRoot Mean Square ErrorStandard Deviation
Sensor fusion & optimization[16,22]Factor graph optimization (FGO); Dempster–Shafer evidence fusionComplex models and computational load; strong dependence on measurement models and priors.
Dead-reckoning & odometry correction[17,23,24]Start–end correction & bidirectional solution reuse; LSTM-based slip compensation; INS + wheel odometry fusionSome methods are validated only in simulation; LSTM approaches often rely on AGM/GPS or extensive training data.
IMU/FOG alignment & calibration[18,19]Multi-position initial alignment (FOG + MIMU); closed-form installation-angle calibrationDependence on high-precision IMU/FOG hardware; focuses mainly on angular error sources.
External constraints (artificial fields)[20]Ground-based coils radiating extremely low-frequency (ELF) magnetic fields to constrain INSRequires deployment of ground transmitters; vertical errors can be large; deployment complexity.
3D perception/point-cloud methods[21]LiDAR/time-of-flight (ToF) point clouds for simultaneous pipeline and pose estimation (SPPE)Mostly validated in simulation; optical sensors sensitive to environment; real-world deployment challenges.
Vibration/transient-signal based methods[22,25]Transient pressure-wave detection; vibration-signal analysis with CNN + RNNSignal detectability, noise sensitivity, and sensor placement affect applicability.
Learning-based/LSTM & deep prediction[23,26,27,28]LSTM/Bi-LSTM/attention LSTM variants for error prediction and path compensationDependence on training data and reference signals (e.g., GPS) or many high-precision sensors; generalization issues.
Table 2. The main structural parameters of the pipeline robot.
Table 2. The main structural parameters of the pipeline robot.
Technical ParameterParameter Value
Robot length/mm400
Robot weight/kg5.7
Adaptive pipe diameter/mm380–560
Radius of Curvature/mmρ ≥ 400
Running speed range/m/s0.01–0.2
Slope Climbing Capability0–45°
Tractive Force/N49
Table 3. Comparison of prediction model error performance metrics.
Table 3. Comparison of prediction model error performance metrics.
MethodNumberRoot Mean Square ErrorMaximum ErrorStandard Deviation
BP10.02750.03280.0014
20.02670.03150.0014
30.02820.03310.0014
LSTM10.00300.00650.0008
20.00540.00840.0008
30.00380.00670.0008
GC-LSTM10.00080.00420.0008
20.00080.00400.0008
30.00080.00410.0008
Table 4. Comparison of bias results of different algorithms in a straight pipe environment.
Table 4. Comparison of bias results of different algorithms in a straight pipe environment.
MethodMaximum ErrorMean Absolute ErrorStandard Deviation
measured value0.2980.2020.063
BP0.1490.0910.029
LSTM0.0950.0590.019
GC-LSTM0.0450.0250.013
Table 5. Comparison of bias results for different algorithms in a bending environment.
Table 5. Comparison of bias results for different algorithms in a bending environment.
MethodMaximum ErrorMean Absolute ErrorStandard Deviation
measured value0.9410.7250.141
BP0.3340.2260.051
LSTM0.2880.1510.047
GC-LSTM0.1320.0680.040
Table 6. Straight pipe test deviation results.
Table 6. Straight pipe test deviation results.
MethodMaximum ErrorMean Absolute ErrorStandard Deviation
measured value0.72840.26930.2422
GC-LSTM0.09330.03510.0386
Table 7. Bending pipe test deviation results.
Table 7. Bending pipe test deviation results.
MethodMaximum ErrorMean Absolute ErrorStandard Deviation
measured value1.87100.62780.3014
GC-LSTM0.25190.08500.0981
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Wang, W.; Zhou, M. Design and Experiment of Trajectory Reconstruction Algorithm of Wireless Pipeline Robot Based on GC-LSTM. Electronics 2025, 14, 3941. https://doi.org/10.3390/electronics14193941

AMA Style

Wang W, Zhou M. Design and Experiment of Trajectory Reconstruction Algorithm of Wireless Pipeline Robot Based on GC-LSTM. Electronics. 2025; 14(19):3941. https://doi.org/10.3390/electronics14193941

Chicago/Turabian Style

Wang, Weiwei, and Mingkuan Zhou. 2025. "Design and Experiment of Trajectory Reconstruction Algorithm of Wireless Pipeline Robot Based on GC-LSTM" Electronics 14, no. 19: 3941. https://doi.org/10.3390/electronics14193941

APA Style

Wang, W., & Zhou, M. (2025). Design and Experiment of Trajectory Reconstruction Algorithm of Wireless Pipeline Robot Based on GC-LSTM. Electronics, 14(19), 3941. https://doi.org/10.3390/electronics14193941

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop