A derailment device working condition recognition method based on multi-sensor adaptive weighted fusion
Patent Information
- Application Number
- CN202610684775.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-18
- Publication Date
- 2026-09-01
AI Technical Summary
目前,传统垂直式脱轨器存在以下问题:传统垂直式脱轨器的实时状态难以监控,当脱轨器发生动作时,车站工作人员无法及时得到信息,严重时会危害人身财产安全
[0192] This invention addresses the inherent complementary characteristics of gyroscopes—fast dynamic response and continuous trajectory tracking, but with time-accelerated drift—and accelerometers—which are susceptible to vibration interference and prone to angle jumps but lack cumulative error. It also addresses the technical pain points of traditional multi-sensor fusion methods—low accuracy and high computational complexity. By innovatively introducing a strapdown inertial navigation system framework, it integrates accelerometers, magnetic field sensors, and gyroscopes to construct a multi-sensor perception system. Furthermore, it employs a quaternion method to construct the state vector for attitude calculation, replacing traditional Euler angles to complete the rotational transformation between the carrier coordinate system and the geographic coordinate system. This fundamentally avoids the gimbal lock-up problem inherent in Euler angle attitude calculation, achieving continuous and singularity-free calculation of the derailment's attitude angles. Simultaneously, it fully leverages the performance advantages of each sensor, achieving complementary multi-sensor data fusion, improving the basic accuracy and stability of attitude angle calculation, and effectively enhancing the operational condition identification accuracy of vertical derailment systems.
Smart Images

Figure CN122673591A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the angle measurement and status perception technology of vertical intelligent derailers in the field of railway track traffic safety protection, and involves a derailer condition identification method based on adaptive weighted fusion of multiple sensors such as gyroscope, accelerometer and magnetic field sensor. Background Technology
[0002] A derailer is a protective device on the track used to protect personnel or important locomotives and rolling stock. Once a locomotive or rolling stock enters the track section protected by the derailer, it derails to ensure the safety of the protected object. Derailers are also installed at both ends of freight trains arriving at the station for inspection. If the locomotive slips, the derailer will force it off the track to protect the lives of station personnel. Additionally, derailers are installed at both ends of some important locomotives and rolling stock to protect their safety. Currently, traditional vertical derailers have the following problems: The real-time status of traditional vertical derailers is difficult to monitor. When a derailer activates, station staff cannot receive timely information, which can seriously endanger personal safety and property. Existing intelligent derailers mostly use a single sensor to measure angles to determine operating conditions. Due to the complex environment of rail transit, with various adverse factors such as vibration, collisions, and electromagnetic interference, a single sensor cannot achieve high-precision, stable angle measurement under all operating conditions and thus accurately determine the actual operating conditions. However, some derailers that use multiple sensors also have problems such as weak abnormal data processing capabilities, rigid weight allocation, poor drift suppression effect, and inaccurate working condition judgment, which cannot meet the process requirements of accurate monitoring of the working status of derailers in the field of track safety. Summary of the Invention
[0003] To address the aforementioned technical issues, this invention proposes a derailment condition identification method based on multi-sensor adaptive weighted fusion.
[0004] This invention is a derailer condition identification method based on adaptive weighted fusion of multiple sensors such as gyroscopes, accelerometers, and magnetic field sensors. It can fully integrate information from gyroscopes, accelerometers, and magnetic field sensors to achieve real-time and accurate monitoring of the status of traditional vertical derailers, which is of great significance and practical value for ensuring the safe operation of railways.
[0005] Technical solution:
[0006] A derailment condition identification method based on multi-sensor adaptive weighted fusion includes the following steps:
[0007] Step 1, Initialization Configuration: Set the initial fusion angle, sampling period T, and forgetting factor. Residual forgetting factor Weakening factors Process noise covariance Q, state vector Estimation error covariance Measurement of noise covariance New information covariance Fault variance threshold Calculate the upper limit of the angle threshold. Lower limit of angle threshold Initial velocity threshold and static determination variance threshold Calculate the triaxial zero bias values of Acc1 and Acc2 for the 9250 and ADXL345 accelerometers. and , Define the axial standards for the carrier coordinate system B and the navigation coordinate system N;
[0008] Step 2, Data Acquisition: Acquire raw data from the gyroscope sensor, the 9250 and ADXL345 accelerometer sensors, and the magnetic field sensor, as well as obtain the fused angle from the previous cycle. ;
[0009] Step 3, Data Preprocessing: The raw triaxial acceleration data collected by Acc1 and Acc2 accelerometers are sequentially subjected to zero drift correction and low-pass filtering; adaptive weight allocation and data fusion of the two accelerometers are completed based on the real-time variance of the filtered data; and single-sensor fault detection and data fault-tolerant replacement are achieved through variance thresholding.
[0010] Step 4: Weighted Strong Tracking Adaptive Extended Kalman Filtering and Update: A 7-dimensional state vector containing quaternions and gyroscope three-axis drift bias is constructed based on the quaternion method. A 6-dimensional measurement vector is formed using the three-axis data from the accelerometer and magnetometer sensors. A fading factor is introduced in the covariance prediction stage. Furthermore, a filter convergence criterion is set, and a weighted adaptive method is used to update the measurement noise covariance matrix only when the filter is determined to be diverging. ;
[0011] Step 5, Threshold Update and Operating Condition Judgment: Complete the speed threshold update. The adaptive update uses gyroscope variance analysis and velocity threshold to determine static / dynamic operating conditions, and introduces fused angles. and angle threshold upper limit Lower limit of angle threshold The operating conditions are further divided into six categories: upper rail static, upper rail dynamic, transitional static, transitional dynamic, lower rail static, and lower rail dynamic.
[0012] Preferably, in step 1, the initial value is set to 0°, the sampling period is T = 0.02s, and the forgetting factor is... =0.95, residual forgetting factor =0.95, weakening factor =15, process noise covariance Estimation error covariance Measure noise covariance New information covariance =0, fault variance threshold =0.1, calculate the initial velocity threshold. Upper limit of angle threshold and angle threshold lower limit and static determination variance threshold Calculate the triaxial zero bias values of the Acc1 and Acc2 accelerometers. and , To accurately calculate the pitch angle of the derailment device, axial standards for the carrier coordinate system B and the navigation coordinate system N are defined.
[0013] Preferably, step 1 specifically includes the following:
[0014] (1) Define the axial standards of the carrier coordinate system B and the navigation coordinate system N:
[0015] To accurately calculate the pitch angle of the derailment device, axial standards are defined for the carrier coordinate system B and the navigation coordinate system N. The two coordinate systems are transformed by rotation through an attitude matrix.
[0016] The carrier coordinate system B takes the center of gravity of the derailer fixed on the rail as its origin, and points horizontally outward from the derailer along the rail. The pitch and rotation axis along the derailment device is ,vertical Plane upwards ;
[0017] The geographic coordinate system N adopts the Northeast-Eastern Sky geographic coordinate system, that is, with the east as the orientation. North is The opposite direction of gravity is ;
[0018] (2) Calculate the initial velocity threshold :
[0019] In a laboratory setting or under standard conditions without additional vibration or instantaneous disturbance, the derailment device was manually moved from the static upper rail to the dynamic upper rail and from the static lower rail to the dynamic lower rail. For each type of switching process, 500 independent sets of dynamic start-up phase data were collected. Each set of data includes 50 gyroscope X-axis angular velocity samples at the completion time of the continuous switching action. The collected data is a two-dimensional dataset, denoted as follows:
[0020]
[0021] Where m is the data group index and n is the sampled data index within the group; This represents the measured value of the X-axis angular velocity of the gyroscope at the nth sampling moment of the m-th test group under the condition of switching the derailer from static upper rail to dynamic upper rail. This represents the measured value of the gyroscope X-axis angular velocity at the nth sampling moment of the m-th test group, under the condition of switching the derailer from static to dynamic lower rail operation.
[0022] For any group of data in m groups, calculate the total angle change in a single group. :
[0023] in, Indicates the gyroscope sampling period; This represents the sampled value of the gyroscope's X-axis angular velocity at the i-th sampling moment;
[0024] Calculate the total duration of a single group :
[0025]
[0026] in, Indicates the gyroscope sampling period;
[0027] Calculate the velocity of a single set of motions :
[0028]
[0029] Based on the speed of a single set of movements The formulas calculate the starting speeds of 500 sets of upper rail movements respectively:
[0030]
[0031] 500 sets of lower rail starting speed:
[0032]
[0033] The minimum value is taken from the starting speeds of the upper and lower rails, respectively, and denoted as . , ;
[0034] Determine the initial velocity threshold:
[0035]
[0036] (3) Calculate the upper limit of the angle threshold and angle threshold lower limit :
[0037] (a) Upper limit of angle threshold :
[0038] Collect 1000 static upper rail stable fusion angles Calculate the mean :
[0039]
[0040] This represents the stable fusion angle of the i-th static upper rail;
[0041] Standard deviation :
[0042]
[0043] The lower limit of the 95% confidence interval is used as the upper rail angle threshold. :
[0044]
[0045] (b) Lower limit of angle threshold :
[0046] Collect 1000 static lower rail stable fusion angles Calculate the mean:
[0047]
[0048] This represents the stable fusion angle of the i-th static lower rail;
[0049] Standard deviation:
[0050] The upper limit of the 95% confidence interval is used as the lower rail angle threshold. :
[0051]
[0052] (4) Calculate the static decision variance threshold :
[0053] Static determination variance threshold In a standard static environment with no vibration and the derailment device stationary in the laboratory, 100 independent sets of gyroscope X-axis angular velocity data were collected. For each set of data, the sample variance was calculated, and the arithmetic mean of the 100 sample variances was denoted as . Based on the slight vibration characteristics of the actual installation scenario of the derailment device, the static judgment variance threshold was finally determined by verifying the fine-tuning coefficient on site. ;
[0054] (5) Calculate the zero bias values of Acc1 and Acc2 on the three axes. and , :
[0055] In a standard static environment with no vibration and the derailment device stationary in the laboratory, 500 static raw data points were continuously collected along the X, Y, and Z axes of a single accelerometer at a sampling period T. The three-axis data were stored on Acc1 as follows: The Acc2 stores the triaxial data as follows: ;
[0056] The core of the accelerometer is to detect the component of gravitational acceleration g. In a horizontal, stationary state, with the derailment device B frame as the horizontal coordinate system, the theoretical output values of the sensor's three axes are:
[0057]
[0058]
[0059]
[0060] In a static state, the raw output value of the accelerometer = theoretical output value + zero bias + random noise. The random noise is zero-mean Gaussian white noise. The random noise can be canceled out by averaging 500 samples, thus obtaining the zero bias.
[0061]
[0062] in, This refers to the static zero-bias error values of the accelerometer Acc1 on the x, y, and z axes. The mean of the Acc1 triaxial static raw data is given; N is the total number of static data samples, here N=500; g is the acceleration due to gravity. .
[0063] Similarly, the formula for calculating the three-axis zero bias of Acc2 is as follows:
[0064] .
[0065] Preferably, step 2, data acquisition, involves the gyroscope sensor acquiring raw angular velocity data. The 9250 accelerometer collects triaxial acceleration data. , , The ADXL345 accelerometer sensor collects triaxial acceleration data. , , The magnetic field sensor collects raw triaxial magnetic field data. And retrieve the fusion angle from the previous cycle. .
[0066] Preferably, the data preprocessing in step 3 involves performing zero-drift correction, low-pass filtering, adaptive weight allocation, and fault detection replacement on the raw triaxial data from the Acc1 and Acc2 accelerometers. The specific implementation steps include:
[0067] (1) Zero drift correction, to eliminate the inherent zero bias error of the accelerometer under static conditions, the correction formula is:
[0068]
[0069]
[0070] in, , This provides the raw acceleration data for Acc1 and Acc2. The acceleration data is after zero-drift correction; , This corresponds to the zero-offset value of each axis of the sensor.
[0071] (2) Low-pass filtering: A first-order low-pass filter is used to suppress high-frequency vibration noise of railway tracks. The filtering formula is as follows:
[0072]
[0073] in, These are the filter coefficients. This is the data after low-pass filtering;
[0074] (3) Adaptive weight allocation and data fusion: Adaptive weighted fusion is achieved based on sliding window variance, with a window length of N=20, and the real-time variance is calculated. The formula is:
[0075]
[0076] Where m=1 and m=2 correspond to acceleration sensors Acc1 and Acc2, respectively. This represents the average value of the data within the window.
[0077] Calculate the fusion weights for each axis of Acc1 and Acc2. ,satisfy :
[0078]
[0079]
[0080] Where i = x, y, z
[0081] Real-time acceleration fusion data output for:
[0082]
[0083] in, ,
[0084] (4) Sensor fault detection, based on fault variance threshold criterion If a single accelerometer sensor is found to be faulty, it will be replaced with data from another known good sensor.
[0085]
[0086] in, , For the first Fusion data of axes; Normal sensor In the Measured data of the shaft; The numbering of normal sensors satisfies a mutual exclusion relationship: when hour, ;when hour, .
[0087] Preferably, the specific implementation of the weighted strong tracking adaptive extended Kalman filter and update in step 4 includes: to adapt to the nonlinear characteristics of sensor data, the quaternion method is used to calculate the pitch angle of the derailment device; a 6-dimensional state vector is constructed using quaternions and the three-axis drift deviation of the gyroscope; and the three-axis data of the accelerometer and magnetic field sensor are used as a 6-dimensional measurement vector; a fading factor is introduced in the covariance prediction process. To improve the tracking performance for sudden attitude changes of the derailment device, a filter convergence criterion is set, and a weighted adaptive method is used to update the measurement noise covariance matrix only when filter divergence is detected. The specific implementation steps include:
[0088] (1) Establish the state vector and state equation:
[0089] Quaternions With gyroscope three-axis drift As a state vector, a 7-dimensional state vector is defined:
[0090]
[0091] in, This refers to the drift deviation of the gyroscope's X / Y / Z axes;
[0092] The derailment is initially in a horizontal, stationary lower rail state, with the B-series and N-series completely overlapping, and the pitch angle... Roll angle and All are 0 and there is no prior drift information; the corresponding quaternion initial values are... Initial values of gyroscope three-axis drift ;
[0093] Based on the first-order Runge-Kutta method for updating quaternions and combined with the time-invariant properties of gyroscope drift, a nonlinear state equation is established:
[0094]
[0095] in, The process noise is represented by a covariance matrix Q, which is a constant diagonal matrix; the nonlinear state transition function... for:
[0096]
[0097] In the formula, T is the sensor sampling period; , This is the antisymmetric matrix of the gyroscope's original output angular velocity. This is the antisymmetric matrix of the gyroscope's drift angular velocity; Represented as:
[0098] -
[0099] in, ,
[0100] To acquire raw angular velocity data for the gyroscope sensor, This refers to the three-axis drift of the gyroscope.
[0101] (2) Establish the measurement vector and measurement equation:
[0102] The measurement vector is composed of pre-processed and fused accelerometer triaxial data. triaxial data from magnetic field sensor Composition, defining a 6-dimensional measurement vector :
[0103]
[0104] Establish the nonlinear measurement equation:
[0105]
[0106] Among them, nonlinear measurement function Rotation matrix from the carrier coordinate system to the geographic coordinate system Derivation, reflecting gravity and geomagnetic field Projection in B system:
[0107]
[0108] In the formula, Let be the rotation matrix, represented as:
[0109] =
[0110]
[0111] By rotation matrix Settlement:
[0112]
[0113]
[0114]
[0115] in, The pitch angle, This is the roll angle. For heading angle;
[0116] (3) Extended Kalman filter linearization process:
[0117] For nonlinear state transition functions and measurement function Performing a first-order Taylor expansion at the given position yields the Jacobian matrix, achieving linearization:
[0118] State transition Jacobian matrix:
[0119] Measuring the Jacobian matrix:
[0120] (4) State prediction and covariance prediction:
[0121] (i) State prediction:
[0122]
[0123] (ii) Covariance prediction:
[0124] To track the sudden attitude changes during rapid derailment, a fading factor is introduced. Corrected forecast covariance:
[0125]
[0126] in, The state transition Jacobian matrix is... It is a gradually diminishing factor;
[0127] (iii) Gradual fading factor calculate:
[0128]
[0129]
[0130] in: Matrix trace operation, By weakening factors Reduced historical measurement noise covariance The impact; It provides a theoretical covariance benchmark;
[0131] New information covariance sliding estimation, smoothing the estimation results to improve robustness:
[0132]
[0133] Forgetting factor;
[0134] (5) Extended Kalman filter update:
[0135] (i) Residual calculation:
[0136]
[0137] (ii) Calculation of filter gain:
[0138]
[0139] (iii) Update of optimal state estimate:
[0140]
[0141] (iv) Estimation error covariance update:
[0142]
[0143] (6) Filter convergence criterion:
[0144] To determine whether the filter has converged and avoid meaningless updates, the criterion is:
[0145]
[0146] If the criterion is met: the filter convergence order No update required;
[0147] If the criteria are not met—filter divergence or abrupt system state change—then the filter is updated using the weighted positive definite Sage-Husa algorithm. ;
[0148] (7) Weighted positive definite Sage-Husa measurement noise covariance update:
[0149] Customized weighted matrix for railway derailer environment ,ensure Positive definiteness, suppressing filter divergence:
[0150]
[0151] Among them, the positive definite residual matrix :
[0152]
[0153] Among them, the weighting matrix A 6×6 diagonal matrix, with higher weights assigned to the derailment pitch Y-axis; adaptive factor Used to control the intensity of updates;
[0154] (8) Derailer pitch angle output:
[0155] By rotation matrix Calculate the pitch angle of the derailment device. Roll angle heading angle for:
[0156]
[0157]
[0158]
[0159] From the optimal state vector after filtering and updating Extracting the optimal quaternion Substituting into the above formula, we obtain the optimal estimate of the derailment pitch angle at time k:
[0160] .
[0161] Preferably, step 5 involves using gyroscope variance analysis and velocity thresholding. Determine static / dynamic operating conditions and introduce a fusion perspective. and angle threshold upper limit Lower limit of angle threshold The operating conditions are subdivided into six categories: upper rail static, upper rail dynamic, transition static, transition dynamic, lower rail static, and lower rail dynamic. The specific implementation steps include:
[0162] (1) Calculate the variance of the gyroscope :
[0163] Calculate the average angular velocity of the gyroscope's X-axis over the last 10 sampling points. and sample variance :
[0164]
[0165]
[0166] in, This represents the angular velocity at the i-th sampling point;
[0167] (2) Speed threshold Adaptive updates:
[0168] The velocity threshold is updated after each sampling period T is completed. Add one, when ≥10, trigger speed threshold renew;
[0169] (3) Operating condition judgment:
[0170] like or and This is determined to be a static working condition. Combined with the angle threshold, when... This is the static lower rail interval; This is a static transition zone; , represents the static upper rail interval;
[0171] like and Determined to be a dynamic operating condition, and based on the angle threshold, when The lower bound is a dynamic range. This is a dynamic transition zone; , represents the dynamic upper rail range.
[0172] Preferably, a speed threshold is achieved. The adaptive update, specifically implemented as follows:
[0173] The velocity threshold is updated after each sampling period T. Add one, when ≥10, trigger speed threshold Update; starting from an array of upper sliding windows with a fixed capacity of 200. and the lower rail sliding window array Extract the minimum value and Set the speed threshold Updated to and The minimum value in, i.e. .
[0174] Preferably, the steps for updating the upper and lower sliding windows include:
[0175] a) Determine if a switchover is valid:
[0176] The switching events of the derailer from static upper rail condition to dynamic upper rail condition and from static lower rail condition to dynamic lower rail condition are defined as valid switching events, and all other switching events are invalid switching events. During the condition monitoring process, the current condition curr_work is compared with the previous condition last_work in real time. The switching counter debounce_cnt is incremented only when both are valid switching events, otherwise debounce_cnt is reset to 0.
[0177] b) Calculate startup speed:
[0178] Starting from the moment a valid switch is determined, 50 gyroscope X-axis angular velocity sampling points are continuously collected and stored in a temporary array temp_omega. The start-up speed of the derailment device is then calculated based on the valid data in this array.
[0179] (i) Calculate the total change in angle. :
[0180]
[0181] (ii) Calculate the total duration :
[0182]
[0183] (iii) Calculate the startup speed :
[0184]
[0185] (iv) Speed validity verification:
[0186] Determine whether the calculated starting speed v is within the normal starting speed range of the derailer. If the startup speed v is not within the above range, the data collected this time is determined to be invalid data, and the data is discarded and will not participate in subsequent steps;
[0187] c) Sliding window update:
[0188] Pre-construct two upper rail sliding window arrays with a capacity of 200. With the lower rail sliding window array These are used to store valid startup speed data under upper and lower rail operating conditions, respectively.
[0189] If the target sliding window array is not full, the effective startup speed v will be directly appended to the end of the array, and the number of elements in the array will be incremented by one.
[0190] If the target sliding window array is full, first delete the first element with index 0 in the array, and then append the effective startup speed v to the end of the array to ensure that the number of elements in the sliding window array always remains at 200.
[0191] Beneficial effects of the present invention
[0192] This invention addresses the inherent complementary characteristics of gyroscopes—fast dynamic response and continuous trajectory tracking, but with time-accelerated drift—and accelerometers—which are susceptible to vibration interference and prone to angle jumps but lack cumulative error. It also addresses the technical pain points of traditional multi-sensor fusion methods—low accuracy and high computational complexity. By innovatively introducing a strapdown inertial navigation system framework, it integrates accelerometers, magnetic field sensors, and gyroscopes to construct a multi-sensor perception system. Furthermore, it employs a quaternion method to construct the state vector for attitude calculation, replacing traditional Euler angles to complete the rotational transformation between the carrier coordinate system and the geographic coordinate system. This fundamentally avoids the gimbal lock-up problem inherent in Euler angle attitude calculation, achieving continuous and singularity-free calculation of the derailment's attitude angles. Simultaneously, it fully leverages the performance advantages of each sensor, achieving complementary multi-sensor data fusion, improving the basic accuracy and stability of attitude angle calculation, and effectively enhancing the operational condition identification accuracy of vertical derailment systems.
[0193] This invention addresses the problems of traditional Kalman filtering algorithms, such as filter divergence, low filtering accuracy, and poor real-time performance, in the process of multi-sensor data fusion. It proposes a weighted strong tracking adaptive extended Kalman filtering algorithm to accurately fuse multi-sensor data and achieve optimal estimation of the derailment's attitude information. Compared with traditional algorithms, this invention incorporates three key improvements, with the following core benefits:
[0194] (1) Based on the simplified Sage-Husa filter, a strong tracking fading factor is introduced, which can accurately track the attitude change during the derailer's operation, greatly improve the dynamic tracking capability of the filtering algorithm, and adapt to the motion characteristics of the derailer's working condition switching.
[0195] (2) Add a filter convergence criterion, and only perform the measurement noise covariance update operation when the filter diverges, avoiding meaningless calculation process, effectively reducing CPU computation, and improving system real-time performance and filter stability.
[0196] (3) The measurement noise covariance matrix (R) update stage of the Sage-Husa algorithm is optimized. The filter residual is retained and combined with the improved adaptive factor. The update formula of the R matrix is given again. The positive definiteness of the measurement noise covariance matrix is guaranteed from the algorithm level, and the filter divergence problem caused by matrix distortion is completely avoided. Attached Figure Description
[0197] Figure 1 This is a flowchart of a derailer condition identification method based on multi-sensor adaptive weighted fusion according to the present invention.
[0198] Figure 2 This is a schematic diagram of the principle of pitch angle estimation based on weighted strong tracking adaptive extended Kalman filter in this invention.
[0199] Figure 3 This is a flowchart of the threshold update and working condition judgment process of the present invention.
[0200] Figure 4 This is a flowchart of the speed threshold update process of the present invention. Detailed Implementation
[0201] The present invention will be further described below with reference to embodiments, but the scope of protection of the present invention is not limited thereto:
[0202] This method utilizes a multi-sensor system consisting of a gyroscope sensor, a 9250-type accelerometer sensor, an ADXL345-type accelerometer sensor, and a magnetic field sensor. This system is fixedly mounted on a rigid reference surface of the derailment actuator, near the derailment shaft. The sensor's X-axis is parallel to the derailment shaft, its Z-axis is parallel to the vertical direction of gravity, and its Y-axis is orthogonal to the horizontal direction within the derailment's action plane. The ADXL345-type accelerometer sensor is mounted on another rigid reference surface of the derailment body, maintaining the same three-axis attitude definition as the MPU9250. The flatness error between the sensor mounting surface and the derailment body is no greater than 0.1°, and the installation eccentricity is no greater than 5mm. The sensor housing employs a waterproof and dustproof sealed structure and is located away from ferromagnetic components to avoid magnetic field distortion. Figure 1 As shown, this method includes five steps in sequence: initialization configuration, data acquisition, data preprocessing, weighted strong tracking adaptive extended Kalman filtering and updating, threshold updating and operating condition judgment, to achieve accurate identification of six operating conditions of the derailment device: upper rail stationary, upper rail moving, transitional stationary, transitional moving, lower rail stationary, and lower rail moving. The following is a detailed explanation of each step.
[0203] The initialization configuration sets the basic parameters and coordinate system standard for the entire working condition identification method, and completes the calculation of various initial threshold values and sensor zero bias values. It is a prerequisite for subsequent data processing and filtering estimation. The specific implementation is divided into 5 sub-steps:
[0204] (1) Assigning basic parameters
[0205] The initial fusion angle is set to 0°, meaning the derailer is initially in a horizontal, stationary lower rail state; the sampling period T = 0.02s, and the forgetting factor... =0.95, residual forgetting factor =0.95, weakening the impact of historical data on real-time estimation and improving dynamic tracking; weakening factor =15, reducing the interference of historical measurement noise covariance on the calculation of innovation covariance. Setting the process noise covariance. Estimation error covariance Measure noise covariance New information covariance =0, fault variance threshold =0.1.
[0206] (2) Standard definition of coordinate system axial direction
[0207] To accurately calculate the derailment pitch angle, axial standards are defined for the carrier coordinate system (B-frame) and the navigation coordinate system (N-frame). The two coordinate systems are then transformed using an attitude matrix:
[0208] The carrier coordinate system B: with the center of gravity of the derailer fixed on the rail as the origin, and the coordinate system extending horizontally outward from the derailer as the coordinate system. The pitch and rotation axis along the derailment device is ,vertical Plane upwards .
[0209] Geographic coordinate system N system: adopts the Northeast-Northeast geographic coordinate system, that is, with east as the orientation. North is The opposite direction of gravity is .
[0210] (3) Initial velocity threshold calculate
[0211] In a standard laboratory setting with no additional vibration or instantaneous disturbance, the two core actions of the derailment device were simulated: from the static upper rail to the dynamic upper rail, and from the static lower rail to the dynamic lower rail. For each switching process, 500 independent sets of dynamic start-up phase data were collected. Each set of data contains 50 consecutive gyroscope X-axis angular velocity samples at the moment the switching action is completed. These are denoted as the upper rail dataset. and lower track dataset , where m is the data group index and n is the sampled data index within the group.
[0212] For each set of data, calculate the velocity of a single set of motion using the following formula:
[0213] Total change in angle:
[0214] Total duration:
[0215]
[0216] Speed of movement:
[0217]
[0218] Based on the above formula, the starting speeds of 500 sets of upper rail movements were obtained respectively. and 500 sets of lower rail starting speed Extract the minimum value of the two sets of velocities. , The minimum of the two values is taken as the initial velocity threshold.
[0219] (4) Degree threshold upper and lower limits , calculate
[0220] Angle threshold upper limit : Collect fusion angles of 1000 derailment devices in static upper rail stable state Calculate the mean of this set of data. and standard deviation Take the lower limit of the 95% confidence interval as , serving as the angular boundary that distinguishes the upper rail from the transition zone;
[0221] Lower limit of angle threshold : Collect fusion angles of 1000 derailment derailment devices in static lower rail stability state Calculate the mean of this set of data. and standard deviation Take the lower limit of the 95% confidence interval as , which serves as the angular boundary distinguishing the lower rail from the transition zone.
[0222] (5) Static determination of variance threshold Calculation of zero bias with accelerometer
[0223] Static determination variance threshold In a standard static environment with no vibration and the derailment device stationary in the laboratory, 100 independent sets of gyroscope X-axis angular velocity data were collected. For each set of data, the sample variance was calculated, and the arithmetic mean of the 100 sample variances was denoted as . Considering the slight vibration characteristics of actual railway track installation scenarios, a fine-tuning coefficient of 1.5 was introduced to ultimately determine... , serving as the variance benchmark for judging the static / dynamic state of the derailment device;
[0224] Accelerometer triaxial zero bias values: Acc1 and Acc2 have inherent zero bias errors under static conditions, which need to be eliminated through standard environment sampling. In the aforementioned standard static environment, 500 raw data points are continuously collected for each of the X, Y, and Z axes of Acc1 and Acc2 at a sampling period T. The Acc1 data is denoted as... Acc2 data is denoted as .
[0225] In a static state, the raw output value of the accelerometer = theoretical output value + zero bias + random noise. The random noise is zero-mean Gaussian white noise. The random noise can be canceled out by averaging 500 samples, thus obtaining the zero bias.
[0226]
[0227]
[0228] The six zero bias values obtained from the calculation will be used for zero drift correction of subsequent acceleration data.
[0229] The data acquisition is based on a multi-sensor system to collect real-time raw data and retrieve historical data, providing a data foundation for subsequent preprocessing, including the acquisition of raw angular velocity data by a gyroscope sensor. The 9250 accelerometer collects triaxial acceleration data. , , The ADXL345 accelerometer sensor collects triaxial acceleration data. , , The magnetic field sensor collects raw triaxial magnetic field data. Retrieve the fusion angle from the previous sampling period from the data cache module. This serves as a reference for assessing the working conditions in this case.
[0230] The data preprocessing process involves processing the raw triaxial acceleration data of Acc1 and Acc2, sequentially performing zero drift correction, low-pass filtering, adaptive weight allocation, and fault detection replacement. The processed fused acceleration data will then be used as the measurement input for subsequent Kalman filtering.
[0231] (1) Zero drift correction
[0232] Using the Acc1 and Acc2 triaxial zero-bias values calculated during initialization, the static zero-bias error of the sensor is eliminated. The correction formula is as follows:
[0233]
[0234]
[0235] in, This provides the raw acceleration data for Acc1 and Acc2. The acceleration data is after zero-drift correction; , This corresponds to the zero-offset value of each axis of the sensor.
[0236] (2) Low-pass filtering
[0237] The railway track environment contains high-frequency vibration noise. A first-order low-pass filter is used to suppress high-frequency noise while retaining the effective low-frequency signal reflecting the pitch action of the derailment device. The filter coefficient is... =0.2, the filtering formula is:
[0238]
[0239] in, The acceleration data at time k is after low-pass filtering. Given the filtering result from the previous time step, real-time filtering is achieved through recursive calculation.
[0240] (3) Adaptive weight allocation and data fusion
[0241] Adaptive weighted fusion of Acc1 and Acc2 is implemented based on sliding window variance, with a window length of N=20. The stability of the sensor data is reflected by calculating the real-time variance of each axis. The smaller the variance, the more stable the data, and the higher the fusion weight is assigned, and vice versa. The specific implementation is as follows:
[0242] Calculate the real-time variance: For the filtered acceleration data at time k, calculate the sliding window variance for each axis of Acc1 and Acc2 using the following formula:
[0243]
[0244] Where m=1 and m=2 correspond to acceleration sensors Acc1 and Acc2, respectively. This is the average of 20 data points within the window.
[0245] Calculate the fusion weights: The weights satisfy... To achieve complementarity between the data from the two sensors, the formula is:
[0246]
[0247]
[0248] Data fusion: Acceleration fusion data at time k is calculated based on fusion weights, and the output is three-axis fusion data in the carrier coordinate system B. The formula is:
[0249]
[0250] For example: if the real-time variance of the X-axis of Acc1 =0.02, Real-time variance of the X-axis of Acc2 =0.08, then Acc1's X-axis data is assigned higher weights due to its greater stability.
[0251] (4) Single sensor fault diagnosis and data fault-tolerant replacement
[0252] Using the fault variance threshold in the initial configuration As a criterion, if the real-time variance of a certain axis of a certain accelerometer... If the sensor is determined to be faulty on that axis, then the fused data is directly replaced with coaxial filtered data from another working sensor. The formula is as follows:
[0253]
[0254] The numbering of normal sensors satisfies a mutual exclusion relationship: when hour, ;when hour, .
[0255] The weighted strong tracking adaptive extended Kalman filter and update, such as Figure 2 As shown, to address the nonlinear characteristics of sensor data, a quaternion method is used to construct a 7-dimensional state vector, and the fused acceleration and magnetic field data are used to construct a 6-dimensional measurement vector. A fading factor is introduced to improve the tracking performance for sudden attitude changes in the derailment. A filtering convergence criterion is set, and the measurement noise covariance matrix is adaptively updated using a weighted positive definite Sage-Husa algorithm, ultimately achieving the optimal estimation of the derailment's pitch angle. Specific implementation steps:
[0256] (1) Establish the state vector and state equation
[0257] To avoid the gimbal lock-up problem of Euler angles, quaternions are used to describe the attitude of the derailment device. Simultaneously, the three-axis drift deviation of the gyroscope is incorporated into the state vector, constructing a 7-dimensional state vector that comprehensively reflects the attitude of the derailment device and sensor errors. The state vector is defined as follows:
[0258]
[0259] in It is a quaternion. This represents the drift deviation of the gyroscope's X / Y / Z axes.
[0260] The derailment is initially in a horizontal, stationary lower rail state, with the B and N frames coinciding and both attitude angles at 0. There is no prior information regarding gyroscope drift; therefore, the initial value is... ,
[0261] Based on the first-order Runge-Kutta method for updating quaternions, and combined with the time-invariant properties of gyroscope drift, a nonlinear state equation is established:
[0262]
[0263] Among them, the nonlinear state transition function for:
[0264]
[0265] T is the sampling period. , is the corrected antisymmetric matrix of angular velocity. The process noise has a covariance matrix of Q initialized.
[0266] (2) Establish measurement vectors and measurement equations
[0267] Based on the fused acceleration data obtained after data preprocessing and the raw data from the magnetic field sensor, a 6-dimensional measurement vector is constructed to reflect the actual attitude measurement value of the derailment. The measurement vector is defined as follows:
[0268] in To integrate acceleration data, This is the raw data of the magnetic field.
[0269] Establish a nonlinear measurement equation to reflect the mapping relationship between the state vector and the measurement vector:
[0270] in To measure noise, the covariance matrix is: Nonlinear measurement function , The rotation matrix from the B system to the N system can be represented by quaternions or Euler angles. The gravity vector This is the geomagnetic field vector in the geographic coordinate system.
[0271] Rotation matrix It is the core of attitude angle calculation. The quaternion representation avoids the complex calculations of trigonometric functions, improving calculation efficiency. At the same time, the rotation matrix can realize the relationship between quaternions and pitch angles. Roll angle Heading angle The conversion formula is:
[0272]
[0273]
[0274]
[0275] pitch angle The core attitude angle for identifying the derailment's operating conditions.
[0276] (3) Extended Kalman filter linearization processing
[0277] Kalman filtering is only applicable to linear systems, therefore it is not suitable for nonlinear state transition functions. and measurement function In the predicted state Performing a first-order Taylor expansion at the given point, ignoring higher-order terms, yields the Jacobian matrix, thus achieving a linear approximation of the nonlinear system:
[0278] State transition Jacobian matrix:
[0279] Measuring the Jacobian matrix:
[0280] (4) State prediction and covariance prediction
[0281] State prediction:
[0282]
[0283] Covariance Prediction: To address the filter divergence issue caused by rapid attitude changes during derailment, a fading factor λ(k) is introduced to correct the prediction covariance and improve the strong tracking performance of the filter. The formula is as follows:
[0284]
[0285] Gradual decay factor Calculation: The fading factor must be greater than or equal to 1 to amplify the predicted covariance and increase the weight of new measurement data. The calculation process is as follows:
[0286] in
[0287] Matrix trace operation, , ;
[0288] New covariance The robustness is improved by using a sliding estimation method:
[0289] It is a forgetting factor.
[0290] (5) Extended Kalman Filter Update
[0291] Based on the residual between the predicted and actual measured values, the predicted state and covariance are updated to obtain the optimal state estimate at time k, specifically:
[0292] (i) Residual calculation
[0293]
[0294] (ii) Calculation of filter gain
[0295]
[0296] (iii) State Optimization Estimation Update
[0297]
[0298] (iv) Estimation error covariance update
[0299]
[0300] (6) Filter convergence criterion
[0301] To avoid meaningless measurement noise covariance updates, a filter convergence criterion is set to determine whether the filtering process is stable:
[0302]
[0303] If the criterion is met, it indicates that the filter has converged and the system state has not changed abruptly. Let... Keep the measurement noise covariance constant;
[0304] If the criterion is not met, it indicates that the filter has diverged or the derailment attitude has changed abruptly, requiring adaptive updates via the weighted positive definite Sage-Husa algorithm. .
[0305] (7) Weighted positive definite Sage-Husa measurement noise covariance update
[0306] A customized 6×6 diagonal weighted matrix was developed to address the operational characteristics of railway derailers. The core axis of the derailment pitch motion is given a higher weight, and an adaptive factor is introduced. Control the update intensity to ensure that the update is successful. The positive definiteness of the filter suppresses divergence, and the update formula is:
[0307]
[0308] Among them, the positive definite residual matrix Adaptive factor b is the forgetting factor.
[0309] (8) Derailer pitch angle output
[0310] From the optimal state vector after filtering and updating Extracting the optimal quaternion Substituting the values into the pitch angle conversion formula, the optimal estimate of the derailment pitch angle at time k is obtained. As the fusion perspective for this sampling period, the formula is:
[0311]
[0312] This pitch angle estimate will be simultaneously stored in the data cache module for use in the next sampling period. Then, it is passed to the next step for working condition judgment.
[0313] The threshold update and operating condition judgment, combined with gyroscope variance analysis and adaptive speed threshold, determine the static / dynamic operating condition of the derailment, and incorporate the fused angle from the previous cycle. and angle threshold , The derailment operating conditions are subdivided into six categories: upper rail stationary, upper rail moving, transitional stationary, transitional moving, lower rail stationary, and lower rail moving. Combined with... Figure 3 The specific implementation steps are as follows:
[0314] (1) Input data
[0315] Obtain the angular velocity data of the 10 most recent sampling points on the X-axis of the gyroscope from the data acquisition system. The derailment fusion angle from the previous sampling period is retrieved from the filtering stage. ,
[0316] Retrieve the static determination variance threshold from the initialization module. Upper limit of angle threshold and angle threshold lower limit Initial velocity threshold .
[0317] (2) Gyroscope variance calculation
[0318] Calculate the average angular velocity of the gyroscope's X-axis over the last 10 sampling points. and sample variance :
[0319]
[0320]
[0321] (3) Velocity threshold Adaptive update
[0322] Speed threshold An adaptive update is performed every 10 sampling periods. Specifically, the speed threshold is updated as a counter every time a sampling period T is completed. Add one, when ≥10, calculate and update the latest speed threshold. .
[0323] (4) Working condition judgment
[0324] like or and This is determined to be a static working condition. Combined with the angle threshold, when... This is the static lower rail interval; This is a static transition zone; , which is the static upper rail interval.
[0325] like and Determined to be a dynamic operating condition, and based on the angle threshold, when The lower bound is a dynamic range. This is a dynamic transition zone; , represents the dynamic upper rail range.
[0326] An example illustrating the working condition judgment process:
[0327] Assumption :
[0328] If the calculation is It is determined to be a static operating condition, combined with The final determination was that the operating condition was in the static transition zone.
[0329] The speed threshold The adaptive update process is shown in Figure 4, consisting of four core steps: triggering update, valid switch judgment, startup speed calculation, and sliding window update. Initial speed threshold. As the initial judgment criterion during the system startup phase, it was obtained through calculations under standard laboratory conditions. To adapt to changes in on-site operating conditions such as track vibration and derailer wear, this method performs a sampling every 10 sampling periods. Perform an adaptive update to ensure the real-time performance and accuracy of the dynamically determined threshold.
[0330] (1) Trigger update
[0331] Speed threshold An adaptive update is performed every 10 sampling periods. Specifically, the speed threshold is updated as a counter every time a sampling period T is completed. Add one, when ≥10, calculate and update the latest speed threshold. .
[0332] (2) Effective switching judgment
[0333] Valid switching is defined as the switching of the derailer from static upper rail condition to dynamic upper rail condition and from static lower rail condition to dynamic lower rail condition. All other switching conditions are invalid.
[0334] Switching determination logic: The current working condition curr_work is compared with the working condition last_work of the previous sampling period in real time. If the two match a valid switching event, the switching counter debounce_cnt is incremented by 1; if it is an invalid switching, debounce_cnt is directly reset to 0, and the current update process is terminated. In order to prevent bouncing and avoid single false judgments, the same valid switching event is only determined when debounce_cnt≥2, that is, two consecutive sampling periods are determined to be the same, and the switching is confirmed to be valid, and the next step is carried out.
[0335] An example illustrating the effective switching judgment execution process:
[0336] In this example, the sampling period T = 0.02s, the initial value of the anti-shake counter debounce_cnt is 0, and the switching is confirmed to be effective only when debounce_cnt ≥ 2.
[0337] If the previous working condition `last_work` is a static lower rail and the current working condition `curr_work` is a dynamic lower rail, and a valid switching event is matched between them, `debounce_cnt` is incremented by 1. Since the anti-jitter threshold `debounce_cnt ≥ 2` is not met, the subsequent startup speed calculation is not initiated. Monitoring continues in the next sampling period. If the previous working condition `last_work` is still a dynamic lower rail and the current working condition `curr_work` is also a dynamic lower rail, and valid switching events are continuously matched, `debounce_cnt` is incremented again by 1 up to 2, satisfying the anti-jitter verification condition. This confirms a genuine and valid switch, and the startup speed calculation process begins.
[0338] (3) Start-up speed calculation
[0339] Starting from the moment a valid switch is determined, 50 gyroscope X-axis angular velocity sampling points are continuously collected and stored in a temporary array temp_omega. The start-up speed of the derailment device is then calculated based on the valid data in this array.
[0340] (i) Calculate the total angular change:
[0341]
[0342] (ii) Calculate the total duration:
[0343]
[0344] (iii) Calculate startup speed:
[0345]
[0346] (iv) Speed validity verification:
[0347] Determine whether the calculated starting speed v is within the normal starting speed range of the derailer. If the startup speed v is not within the above range, the collected data is determined to be invalid, and the data is discarded and will not participate in subsequent steps.
[0348] (4) Sliding window update
[0349] (i) Window initialization: Pre-build two independent arrays of sliding windows: the upper sliding window... , lower rail sliding window Each has a capacity of 200, storing the effective startup speed under upper and lower rail conditions respectively;
[0350] (ii) Window update rules:
[0351] If the target sliding window array is not full, the effective startup speed v will be directly appended to the end of the array, and the number of elements in the array will be incremented by one.
[0352] If the target sliding window array is full, first delete the first element with index 0 in the array, and then append the effective startup speed v to the end of the array to ensure that the number of elements in the sliding window array always remains at 200.
[0353] An example illustrating the window update process:
[0354] like There are currently 198 elements. The effective starting speed of the upper rail was 0.2° / s, so it will be directly appended to the end of the array, making the number of elements 199. If there are already 200 elements, first delete the first element, such as 0.21° / s, and then append 0.2° / s, while keeping the array capacity at 200.
[0355] (iii) Velocity threshold calculate:
[0356] when ≥10, trigger speed threshold Update. Starting from a fixed-capacity upper-rail sliding window array of 200... and the lower rail sliding window array Extract the minimum value and Set the speed threshold Updated to and The minimum value in, i.e. .
[0357] The specific embodiments described herein are merely illustrative of the spirit of the invention. Those skilled in the art to which this invention pertains may make various modifications or additions to the described specific embodiments or use similar methods to substitute them, without departing from the spirit of the invention or exceeding the scope defined by the appended claims.
Claims
1. A method for identifying the operating conditions of a derailer based on multi-sensor adaptive weighted fusion, characterized in that, Includes the following steps: Step 1: Initialize configuration; Step 2, Data Acquisition: Acquire raw data from the gyroscope sensor, the 9250 and ADXL345 accelerometer sensors, and the magnetic field sensor, as well as obtain the fused angle from the previous cycle. ; Step 3, Data Preprocessing: The raw triaxial acceleration data collected by the Acc1 and Acc2 accelerometers are sequentially subjected to zero drift correction and low-pass filtering; Adaptive weight allocation and data fusion from two accelerometers are achieved based on the real-time variance of the filtered data; and single-sensor fault detection and data fault-tolerant replacement are realized through variance threshold; Step 4: Weighted Strong Tracking Adaptive Extended Kalman Filtering and Update: A 7-dimensional state vector containing quaternions and gyroscope three-axis drift bias is constructed based on the quaternion method. A 6-dimensional measurement vector is formed using the three-axis data from the accelerometer and magnetometer sensors. A fading factor is introduced in the covariance prediction stage. Furthermore, a filter convergence criterion is set, and a weighted adaptive method is used to update the measurement noise covariance matrix only when the filter is determined to be diverging. ; Step 5, Threshold Update and Operating Condition Judgment: Complete the speed threshold update. The adaptive update uses gyroscope variance analysis and velocity threshold to determine static / dynamic operating conditions, and introduces fused angles. and angle threshold upper limit Lower limit of angle threshold The operating conditions are further divided into six categories: upper rail static, upper rail dynamic, transitional static, transitional dynamic, lower rail static, and lower rail dynamic.
2. The method according to claim 1, characterized in that, Step 1: Initialize the configuration with an initial value of 0°, a sampling period of T = 0.02s, and a forgetting factor. =0.95, residual forgetting factor =0.95, weakening factor =15, process noise covariance Estimation error covariance Measure noise covariance New information covariance =0, fault variance threshold =0.1, calculate the initial velocity threshold. Upper limit of angle threshold and angle threshold lower limit and static determination variance threshold Calculate the triaxial zero bias values of the Acc1 and Acc2 accelerometers. and , To accurately calculate the pitch angle of the derailment device, axial standards for the carrier coordinate system B and the navigation coordinate system N are defined.
3. The method according to claim 2, characterized in that, Step 1 includes the following specific implementation details: (1) Define the axial standards of the carrier coordinate system B and the navigation coordinate system N: To accurately calculate the pitch angle of the derailment device, axial standards are defined for the carrier coordinate system B and the navigation coordinate system N. The two coordinate systems are transformed by rotation through an attitude matrix. The carrier coordinate system B takes the center of gravity of the derailer fixed on the rail as its origin, and points horizontally outward from the derailer along the rail. The pitch and rotation axis along the derailment device is ,vertical Plane upwards ; The geographic coordinate system N adopts the Northeast-Eastern Sky geographic coordinate system, that is, with the east as the orientation. North is The opposite direction of gravity is ; (2) Calculate the initial velocity threshold : In a laboratory setting or under standard conditions without additional vibration or instantaneous disturbance, the derailment device was manually moved from the static upper rail to the dynamic upper rail and from the static lower rail to the dynamic lower rail. For each type of switching process, 500 independent sets of dynamic start-up phase data were collected. Each set of data includes 50 gyroscope X-axis angular velocity samples at the completion time of the continuous switching action. The collected data is a two-dimensional dataset, denoted as follows: Where m is the data group index and n is the sampled data index within the group; This represents the measured value of the X-axis angular velocity of the gyroscope at the nth sampling moment of the m-th test group under the condition of switching the derailer from static upper rail to dynamic upper rail. This represents the measured value of the gyroscope X-axis angular velocity at the nth sampling moment of the m-th test group, under the condition of switching the derailer from static to dynamic lower rail operation. For any group of data in m groups, calculate the total angle change in a single group. : in, Indicates the gyroscope sampling period; This represents the sampled value of the gyroscope's X-axis angular velocity at the i-th sampling moment; Calculate the total duration of a single group : in, Indicates the gyroscope sampling period; Calculate the velocity of a single set of motions : Based on the speed of a single set of movements The formulas calculate the starting speeds of 500 sets of upper rail movements respectively: 500 sets of lower rail starting speed: The minimum value is taken from the starting speeds of the upper and lower rails, respectively, and denoted as . , ; Determine the initial velocity threshold: (3) Calculate the upper limit of the angle threshold and angle threshold lower limit : (a) Upper limit of angle threshold : Collect 1000 static upper rail stable fusion angles Calculate the mean : This represents the stable fusion angle of the i-th static upper rail; Standard deviation : The lower limit of the 95% confidence interval is used as the upper rail angle threshold. : (b) Lower limit of angle threshold : Collect 1000 static lower rail stable fusion angles Calculate the mean: This represents the stable fusion angle of the i-th static lower rail; Standard deviation: The upper limit of the 95% confidence interval is used as the lower rail angle threshold. : (4) Calculate the static decision variance threshold : Static determination variance threshold In a standard static environment with no vibration and the derailment device stationary in the laboratory, 100 independent sets of gyroscope X-axis angular velocity data were collected. For each set of data, the sample variance was calculated, and the arithmetic mean of the 100 sample variances was denoted as . Based on the slight vibration characteristics of the actual installation scenario of the derailment device, the static judgment variance threshold was finally determined by verifying the fine-tuning coefficient on site. ; (5) Calculate the zero bias values of Acc1 and Acc2 on the three axes. and , : In a standard static environment with no vibration and the derailment device stationary in the laboratory, 500 static raw data points were continuously collected along the X, Y, and Z axes of a single accelerometer at a sampling period T. The three-axis data were stored on Acc1. The Acc2 stores the triaxial data as follows: ; The core of the accelerometer is to detect the component of gravitational acceleration g. In a horizontal, stationary state, with the derailment device B frame as the horizontal coordinate system, the theoretical output values of the sensor's three axes are: In a static state, the raw output value of the accelerometer = theoretical output value + zero bias + random noise. The random noise is zero-mean Gaussian white noise. The random noise can be canceled out by averaging 500 samples, thus obtaining the zero bias. in, This refers to the static zero-bias error values of the accelerometer Acc1 on the x, y, and z axes. The mean of the Acc1 triaxial static raw data is given; N is the total number of static data samples, here N=500; g is the acceleration due to gravity. . Similarly, the formula for calculating the three-axis zero bias of Acc2 is as follows: 。 4. The method according to claim 1, characterized in that, Step 2 data acquisition involves: acquiring raw angular velocity data using a gyroscope sensor. The 9250 accelerometer collects triaxial acceleration data. , , The ADXL345 accelerometer sensor collects triaxial acceleration data. , , The magnetic field sensor collects raw triaxial magnetic field data. And retrieve the fusion angle from the previous cycle. .
5. The method according to claim 1, characterized in that, The data preprocessing described in step 3 involves performing zero-drift correction, low-pass filtering, adaptive weight allocation, and fault detection and replacement on the raw triaxial data from the Acc1 and Acc2 accelerometers. The specific implementation steps include: (1) Zero drift correction, to eliminate the inherent zero bias error of the accelerometer under static conditions, the correction formula is: in, , The raw acceleration data for Acc1 and Acc2. The acceleration data is after zero-drift correction; , This corresponds to the zero-offset value of each axis of the sensor. (2) Low-pass filtering: A first-order low-pass filter is used to suppress high-frequency vibration noise of railway tracks. The filtering formula is as follows: in, These are the filter coefficients. This is the data after low-pass filtering; (3) Adaptive weight allocation and data fusion: Adaptive weighted fusion is achieved based on sliding window variance, with a window length of N=20, and the real-time variance is calculated. The formula is: Where m=1 and m=2 correspond to acceleration sensors Acc1 and Acc2, respectively. This represents the average value of the data within the window. Calculate the fusion weights for each axis of Acc1 and Acc2. ,satisfy : Where i = x, y, z Momental acceleration fusion data output for: in, , (4) Sensor fault detection, based on fault variance threshold criterion If a single accelerometer sensor is found to be faulty, it will be replaced with data from another known good sensor. in, , For the first Fusion data of axes; Normal sensor In the Measured data of the shaft; The numbering of normal sensors satisfies a mutual exclusion relationship: when hour, ;when hour, .
6. The method according to claim 1, characterized in that, The specific implementation of the weighted strong tracking adaptive extended Kalman filter and update in step 4 includes: to adapt to the nonlinear characteristics of sensor data, the quaternion method is used to calculate the pitch angle of the derailment device; a 6-dimensional state vector is constructed using quaternions and the three-axis drift deviation of the gyroscope; and the three-axis data of the accelerometer and magnetic field sensor are used as a 6-dimensional measurement vector; a fading factor is introduced in the covariance prediction process. To improve the tracking performance for sudden attitude changes of the derailment device, a filter convergence criterion is set, and a weighted adaptive method is used to update the measurement noise covariance matrix only when filter divergence is detected. The specific implementation steps include: (1) Establish the state vector and state equation: Quaternions With gyroscope three-axis drift As a state vector, a 7-dimensional state vector is defined: in, This refers to the drift deviation of the gyroscope's X / Y / Z axes; The derailment is initially in a horizontal, stationary lower rail state, with the B-series and N-series completely overlapping, and the pitch angle... Roll angle and All are 0 and there is no prior drift information; the corresponding quaternion initial values are... Initial values of gyroscope three-axis drift ; Based on the first-order Runge-Kutta method for updating quaternions and combined with the time-invariant properties of gyroscope drift, a nonlinear state equation is established: in, The process noise is represented by a covariance matrix Q, which is a constant diagonal matrix; the nonlinear state transition function... for: In the formula, T is the sensor sampling period; , This is the antisymmetric matrix of the gyroscope's original output angular velocity. This is the antisymmetric matrix of the gyroscope's drift angular velocity; Represented as: - in, , To acquire raw angular velocity data for the gyroscope sensor, This refers to the three-axis drift of the gyroscope. (2) Establish the measurement vector and measurement equation: The measurement vector is composed of pre-processed and fused accelerometer triaxial data. triaxial data from magnetic field sensor Composition, defining a 6-dimensional measurement vector : Establish the nonlinear measurement equation: Among them, nonlinear measurement function Rotation matrix from the carrier coordinate system to the geographic coordinate system Derivation, reflecting gravity and geomagnetic field Projection in B system: In the formula, Let be the rotation matrix, represented as: = By rotation matrix Settlement: in, The pitch angle, This is the roll angle. For heading angle; (3) Extended Kalman filter linearization process: For nonlinear state transition functions and measurement function Performing a first-order Taylor expansion at the given position yields the Jacobian matrix, achieving linearization: State transition Jacobian matrix: Measuring the Jacobian matrix: (4) State prediction and covariance prediction: (i) State prediction: (ii) Covariance prediction: To track the sudden attitude changes during rapid derailment, a fading factor is introduced. Corrected forecast covariance: in, The state transition Jacobian matrix is... It is a gradually diminishing factor; (iii) Gradual fading factor calculate: in: Matrix trace operation, By weakening factors Reduced historical measurement noise covariance The impact; It provides a theoretical covariance benchmark; New information covariance sliding estimation, smoothing the estimation results to improve robustness: Forgetting factor; (5) Extended Kalman filter update: (i) Residual calculation: (ii) Calculation of filter gain: (iii) Update of optimal state estimate: (iv) Estimation error covariance update: (6) Filter convergence criterion: To determine whether the filter has converged and avoid meaningless updates, the criterion is: If the criterion is met: the filter convergence order No update required; If the criteria are not met—filter divergence or abrupt system state change—then the filter is updated using the weighted positive definite Sage-Husa algorithm. ; (7) Weighted positive definite Sage-Husa measurement noise covariance update: Customized weighted matrix for railway derailer environment ,ensure Positive definiteness, suppressing filter divergence: Among them, the positive definite residual matrix : Among them, the weighting matrix A 6×6 diagonal matrix, with higher weights assigned to the derailment pitch Y-axis; adaptive factor Used to control the intensity of updates; (8) Derailer pitch angle output: By rotation matrix Calculate the pitch angle of the derailment device. Roll angle heading angle for: From the optimal state vector after filtering and updating Extracting the optimal quaternion Substituting into the above formula, we obtain the optimal estimate of the derailment pitch angle at time k: 。 7. The method according to claim 1, characterized in that, Step 5 describes the use of gyroscope variance analysis and velocity thresholding. Determine static / dynamic operating conditions and introduce a fusion perspective. and angle threshold upper limit Lower limit of angle threshold The operating conditions are subdivided into six categories: upper rail static, upper rail dynamic, transition static, transition dynamic, lower rail static, and lower rail dynamic. The specific implementation steps include: (1) Calculate the variance of the gyroscope : Calculate the average angular velocity of the gyroscope's X-axis over the last 10 sampling points. and sample variance : in, This represents the angular velocity at the i-th sampling point; (2) Speed threshold Adaptive updates: The velocity threshold is updated after each sampling period T is completed. Add one, when ≥10, trigger speed threshold renew; (3) Operating condition judgment: like or and This is determined to be a static working condition. Combined with the angle threshold, when... This is the static lower rail interval; This is a static transition zone; , represents the static upper rail interval; like and Determined to be a dynamic operating condition, and based on the angle threshold, when The lower bound is a dynamic range. This is a dynamic transition zone; , represents the dynamic upper rail range.
8. The method according to claim 7, characterized in that, Achieve speed threshold The adaptive update, specifically implemented as follows: The speed threshold is updated after each sampling period T. Add one, when ≥10, trigger speed threshold Update; starting from an array of upper-rail sliding windows with a fixed capacity of 200. and the lower rail sliding window array Extract the minimum value and Set the speed threshold Updated to and The minimum value in, i.e. .
9. The method according to claim 8, characterized in that, The steps to update the top and bottom sliding windows include: a) Determine if a switchover is valid: The switching events of the derailer from static upper rail condition to dynamic upper rail condition and from static lower rail condition to dynamic lower rail condition are defined as valid switching events, and all other switching events are invalid switching events. During the condition monitoring process, the current condition curr_work is compared with the previous condition last_work in real time. The switching counter debounce_cnt is incremented only when both are valid switching events, otherwise debounce_cnt is reset to 0. b) Calculate startup speed: Starting from the moment a valid switch is determined, 50 gyroscope X-axis angular velocity sampling points are continuously collected and stored in a temporary array temp_omega. The start-up speed of the derailment device is then calculated based on the valid data in this array. (i) Calculate the total change in angle. : (ii) Calculate the total duration : (iii) Calculate the startup speed : (iv) Speed validity verification: Determine whether the calculated starting speed v is within the normal starting speed range of the derailer. If the startup speed v is not within the above range, the collected data is determined to be invalid data, discarded, and will not participate in subsequent steps; c) Sliding window update: Pre-construct two upper rail sliding window arrays with a capacity of 200. With the lower rail sliding window array These are used to store valid startup speed data under upper and lower rail operating conditions, respectively. If the target sliding window array is not full, the effective startup speed v will be directly appended to the end of the array, and the number of elements in the array will be incremented by one. If the target sliding window array is full, first delete the first element with index 0 in the array, and then append the effective startup speed v to the end of the array to ensure that the number of elements in the sliding window array always remains at 200.
10. The method according to claim 1, characterized in that, The initialization configuration includes: setting the initial fusion angle, sampling period T, and forgetting factor. Residual forgetting factor Weakening factors Process noise covariance Q, state vector Estimation error covariance Measurement of noise covariance New information covariance Fault variance threshold Calculate the upper limit of the angle threshold. Lower limit of angle threshold Initial velocity threshold and static determination variance threshold Calculate the triaxial zero bias values of Acc1 and Acc2 for the 9250 and ADXL345 accelerometers. and , Define the axial standards for the carrier coordinate system B and the navigation coordinate system N.