Pipeline Bending Strain Measurement and Compensation Technology Based on Wavelet Neural Network

The bending strain of long distance oil and gas pipelines may lead to instability of the pipeline and failure of materials, which seriously deteriorates the transportation security of oil and gas. To locate the position of the bending strain for maintenance, an Inertial Measurement Unit (IMU) is usually adopted in a Pipeline Inspection Gauge (PIG). The attitude data of the IMU is usually acquired to calculate the bending strain in the pipe. However, because of the vibrations in the pipeline and other system noises, the resulting bending strain calculations may be incorrect. To improve the measurement precision, a method, based on wavelet neural network, was proposed. To test the proposed method experimentally, a PIG with the proposed method is used to detect a straight pipeline. It can be obtained that the proposed method has a better repeatability and convergence than the original method. Furthermore, the newmethod is more accurate than the original method and the accuracy of bending strain is raised by about 23% compared to original method. This paper provides a novel method for precisely inspecting bending strain of long distance oil and gas pipelines and lays a foundation for improving the precision of inspection of bending strain of long distance oil and gas pipelines.


Introduction
With the development of the oil and gas production, the long distance buried pipeline is used in transporting the production of oil and gas [1].Because of the geologic hazards (such as frost heaving, thaw, and landside), the pipelines may be displaced and deformed [2,3], and that results in the bending strain of the pipelines [4][5][6].As well known, the bending strain of the pipeline may lead to instability and failure of materials, which seriously deteriorate the transportation security of oil and gas.
In order to locate the position of the bending strain for maintenance and avoid oil or gas leakage and pollution, bending strain of the pipeline should be inspected efficiently.
Nowadays, a geometry Pipeline Inspection Gauge (PIG) is usually adopted to locate damaged pipeline segments [7][8][9].A PIG consists of a Data Acquisition System (DAS), an Inertial Measurement Unit (IMU), some mechanical fingers, and an odometer.Based on the pressure difference in pipeline, the PIG is driven to move through the pipeline and collect data regarding dents, bends, and navigation.PetroChina Pipeline Company has developed an IMU system based on a navigation system, which is suitable for a geometry PIG.The IMU system has been adopted to inspect the northeast pipelines in China and collected attitude data with a PIG, as shown in Figure 1.
As reported, based on the attitude data, which can be acquired inline, the bending strain of the pipeline can be obtained through calculation [10,11].However, due to the vibration and other system noises, the acquired attitude data may be introduced errors, and the calculation of bending strain may deviate from the real value, and the risk evaluation for bending strain of the pipeline would be incorrect and difficult to decide the repair work.
In this paper, to improve the inspection precision of bending strain, based on wavelet neural network, a new method to modify the Kalman filter with the noise covariance matrix is proposed.Because of the learning ability and selfadaptability of the wavelet neural network, it can acquire the ratio of variance of new theory in real time and acquire the actual variance to modify the noise covariance matrix.This method could restrain the divergence of Kalman filter and improve the precision of the pipeline bending strain.

The Calculation Method of the Pipeline Bending Strain
In this section, the calculation method of the pipeline bending strain is described.The total curvature of the centerline of a pipe is described at each point along the pipeline by the curvature vector.In order to calculate the pipeline curvature, the centerline of a pipe is considered as a 3D parametric curve described in a Cartesian system by a vector v(s), which is a function of a distance () along the curve [12]: Assume that the vector  is tangent of v(s), separating the vertical and horizontal curvature components as shown in Figure 2. The calculation of the pipeline bending strain can be given as where the pitch () and azimuth () of the pipeline centerline can be measured by the PIG.
Assume that the vector  is the curvature vector of a 3D curve at a given point, and  consists of the vertical curvature  V and the horizontal curvature  ℎ , which can be given as The above equation can be written separately for each component of the curvature vector in the Cartesian system: Based on (1)-( 4), the components of the defined curvature vector can be calculated as follows: ) . ( The vertical curvature  V and the horizontal curvature  ℎ can be given as From (6), it can be seen that the pipeline bending strain can be calculated with the attitude data, which can be acquired with a PIG.

Pipeline Bending Strain Calculation Method
Based on Wavelet Neural Network

Extended Kalman Filter (EKF).
Error of the inertial navigation, which accumulates over time, greatly affects the accuracy of navigation and positioning system.As the algorithm for computing the navigation and positioning is an iterative calculation, if the calculation errors cannot be corrected, the navigation and positioning system will not accurately reflect the operation situation of the PIG.Based on analysis of all errors generated by the system, to correct errors of the measure system, an extended Kalman filter is proposed.The basic idea of the extended Kalman filter is to distribute processing, and then the global integration can be done.The extended Kalman filter can be described by the following equations [13].
(1) State and output equations are as follows: where  is the system state vector,  is the system control vector,  is the system noise,  is the measurement vector, and V is the measurement noise.
As the real-time state of the system can be obtained with a series of nonlinear formula, the extended Kalman filter can be adopted for calculation.Based on the information of all observations, the speed, location of INS, odometer, and above ground GPS location marker information can be integrated, and then the global estimates  can be obtained.
(2) State estimates partial derivative matrix is as follows: where   is the Jacobian matrix of the system state and   is the Jacobian matrix of the measurement.
(3) Filter update equation is as follows: where   is the gain matrix of the optimal Kalman and Q and R are the covariance matrixes for   and V  , respectively.Based on ( 7)-( 9), a system state equation can be obtained from the system error model, which establishes the relationship between the speed error, position error, and the other errors.All the errors can be estimated with the extended Kalman filter, and then the values of each state can be obtained.
The IMU is loaded on the PIG to collect the data, which consists of the angular velocity, acceleration, and mileage from the odometer.The data above and the GPS coordinate are utilized to compute the attitude of the PIG and the bending strain.As the vibration error and other system errors are unknown, the statistic characteristics of the state noise covariance matrix Q and the observation noise covariance matrix R cannot be required.It not only affects the accuracy of the filter, but also leads to diffusion.To improve the accuracy of the estimate for noise in the covariance matrices Q and R, a new method will be proposed.
The innovation sequence could be gained from EKF as described: where   is the difference between the observed value and estimated value and its statistical properties influence the decision of the statistical properties of the output of the filter [14].Because the innovation sequence and the observation sequence contain the same statistical data, the innovation of EKF should be a zero mean white noise when the model of filter is correct.The innovation, which is inspected in field, can be used to decide whether the model should be changed or the parameters should be adjusted.When the actual remainder is not compatible with  −1 and  −1 ,   and   should be reestimated to replace the

Hidden layer Wavelet layer
Output layer original value.A method to adjust the noise covariance of the system can be proposed, which can be used to modify the error variance matrix and the filtering gain matrix of the EKF.
The noise covariance of system can be rewritten as where  and  are the initial constant matrixes and    and    are the adaptive adjustment factors,  > 0 and  > 0. Superscripts  and  are the constants.A method based on the neural network to adjust the factor, which related to the innovation, can be proposed.

Structure of Wavelet Neural Network (WNN).
In the new method, based on the offline observation data, the real-time access of adjustable factor was trained by the neural network, and the noise variance matrix was adjusted by the neural network, which was dynamically adjusted according to the actual noise.In order to remove the navigation gross error, the data was processed by the wavelet.
The wavelet neural network (WNN) [15], based on the topology of BP neural network, uses wavelet basis function as transmit function in hidden layer nodes.The signal transmits forward when the errors transmit in opposite direction.The structure of a WNN topology model is shown in Figure 3.It consists of an input layer, a hidden layer (wavelet layer), and a linear output layer.The input data in input layer of WNN is  = [ 1 ,  2 , . . .,   ], which is directly transmitted into the wavelet layer.  ( = 1, 2, . . ., ;  = 1, 2, . . ., ) is the connection weight between input and hidden nodes;   ( = 1, 2, . . ., ;  = 1, 2, . . ., ) is the connection weight between hidden and output nodes;  = [ 1 ,  2 , . . .,   ] is the output of the WNN.
When the input signal sequence is   ( = 1, 2, . . ., ), the output of hidden layer is described as follows: where ℎ() is the output of the hidden layer for  node, ℎ  is the wavelet basis function,   is the contraction-expansion factor for ℎ  , and   is the shift factor for ℎ  .The output of WNN, as shown in Figure 3, can be given as In WNN calculation, its real part will be taken and the wavelet basis function is the Morlet function as The wavelet neural network (WNN) is derived based on the neural network and wavelet theory.It is effective at localization of wavelet transform and combines with the selflearning ability of neural network.The WNN can be adapted to reduce extrapolation errors according to new data.The adjustable parameters of the structure of WNN could shorten the training time as well.

Study on the Method of Adaptive Kalman Filter Based on
Innovation of WNN.Based on the related theory of statistics, the innovation value of EKF can be given as [16]: The actual innovation is estimated by forward  innovation in  time.The window width of  is determined by the experience and the repeated test.A new matrix variable, (), can be defined to indicate the inconsistency between the theoretical and actual values for the variance of innovation.And the new matrix can be calculated as Each element of () approximately is equal to one when the statistical characteristics of the filter noise are more accurate.If () > 1 or () < 1, it indicates that the noise of system might be increased or decreased.The input of WNN should be the element of () and the output should be the adjustment factors    and    .The method of adaptive Kalman filter based on innovation of WNN to compute the pipeline bending strain can be shown as in Figure 4.

Equipment and Performance.
To test the proposed method experimentally, a PIG (shown in Figure 5) with the proposed method is used to detect a straight pipeline, which is about 100 meters as shown in Figure 6.
As is known, most domestic oil pipelines are heating transportation and pass through mountains, hills, rivers, and other complex environmental areas; the technical and safety requirements of electrical equipment are extremely strict.To safely detect the actual pipeline, the IMU should meet not only the technical performance, but also the actual situation of the pipe and the external environment should be considered.Technical performances of inertial devices, which are used in the field test, are shown in Table 1.

Data Analysis.
The first two rounds of original pitch and the pitch, which is obtained with the improved method, are compared as shown in Figure 7.The first two rounds of  original azimuth and the azimuth, which is obtained with the improved method, are compared as shown in Figure 8 as well.
As shown in Figure 7, it can be seen that if the attitude of the PIG is not processed by the new method, the pitch differs by approximately 1.5 ∘ at the starting point, and this attitude increases as time increases.As shown in Figure 8, it is clear  that the difference between two rounds in azimuth is about 1.4 ∘ .Furthermore, because the bending strain is computed by the attitude of PIG, which is stated in Section 2, the bending strain is more inaccurate when inspected in the same status pipeline.
The 8 times of round for inspection of bending strain are computed by the proposed method in Section 2 and the results are shown in Figure 9.As shown in Figure 10, the red curves are the bending strain which use the modified method.The blue curves are the original method.It can be seen that the modified method which was used to process the data has a better repeatability and convergence than the original method.The bending strain which used modified method is more close to the actual value.The error of bending strain is compared in Figure 11 and Table 2. From Figure 10 and Table 2, it can be seen that the new method is more accurate than the original method.The average of accuracy for bending strain is calculated as The strain is raised by 23% compared to original method by formula (17).
Because the test pipeline is still in state of straight in the pull-through test, the results of multi-inspection should be consistent.However, the error affects the calculation of the pipeline centerline due to the uncompensation attitude of IMU tool.The present method can be not only compensated by the bending strain, but also useful for calculation of pipeline centerline.In order to verify the effectiveness of the method further, the eight times of height of straight pipeline are computed by the present method.As shown in Figure 12, the eight times of height of pipeline which used compensation method and uncompensation are compared.The blue lines are the uncompensation height of the pipeline.The red lines are the height of pipeline by the compensation.From the eight times of pull-through test, the repetition of compensation method is improved obviously for the same pipeline.

Conclusions
The error of the inertial navigation, which accumulates over time, will greatly affect the accuracy of navigation and positioning system.In this paper, based on the analysis of the calculation method of pipeline bending strain, to correct errors of the measure system, an extended Kalman filter based on the innovation of wavelet neural network is proposed.
To test the proposed method experimentally, a PIG with the proposed method is used to detect a 100-meter-long straight pipeline.The following can be obtained: (1) Comparing the analysis results of pitch and azimuth with original method and the suggested WNN procedure with each other, it can be seen clearly that the new method deeply reduces the difference between two test rounds, of which the pitch difference is decreased by about 1.4 degrees, and the azimuth difference is cut off by almost 1.5 degrees.
(2) The inspection result of the bending strains shows that the proposed method has a better repeatability and convergence than the original method and is much closer to the actual value.According to the comparison of the errors of the two methods, the new method is more accurate than the original one; moreover, the accuracy of bending strain is raised by about 23%.
This paper provides a novel method for precisely inspecting bending strain of long distance oil and gas pipelines and lays a foundation for improving the precision of inspection of bending strain of long distance oil and gas pipelines.

Figure 1 :Figure 2 :
Figure 1: Measurement system of inline inspection of pipeline centerline.

K = K + 1
filter and compute the theoretical and actual innovation Input the filter factor of the the neural network Create the WNN and train the neural network Modify system noise covariance matrix by the output of neural network and compute filter status factor Yes No If the D(K) = 1 diagonal elements of the state into

Figure 4 :
Figure 4: The flowchart for the adaptive Kalman filter based on WNN.

Figure 9 :Figure 10 :
Figure 9: Eight times of inspection for the bending strain.

Figure 11 :Figure 12 :
Figure 11: The comparison for the error of the inspection.

Table 1 :
Characteristics of sensors.

Table 2 :
Error between two methods.