A neural network-based MEMS gyroscope temperature drift compensation method
By combining the LSTM model and the baseline compensation model, and using the composite perturbation index and confidence level assessment, the temperature drift compensation strategy of the MEMS gyroscope is dynamically adjusted, which solves the problem of unstable output of the MEMS gyroscope under extreme conditions, achieves high-precision and high-robust compensation effect, and improves the navigation and control performance of the UAV.
Patent Information
- Application Number
- CN202511604128.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-05
- Publication Date
- 2026-02-10
- Estimated Expiration
- 2045-11-05
AI Technical Summary
Temperature drift in MEMS gyroscopes can lead to unstable output signals in high-performance applications. Existing deep learning models have insufficient generalization ability under extreme conditions, which may result in unreliable or even catastrophic error in the output compensation values, threatening flight safety.
By combining a pre-trained LSTM model and a temperature-related baseline compensation model, the compensation results are dynamically weighted and fused using a composite perturbation index. The robustness of the model is evaluated using confidence levels, and the compensation strategy is dynamically adjusted to adapt to different working conditions.
Achieving precise and robust compensation for temperature drift of MEMS gyroscopes in complex and ever-changing environments improves the stability and reliability of UAV attitude control and significantly enhances navigation and control performance.
Smart Images

Figure CN121071265B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing, and specifically to a method for temperature drift compensation of MEMS gyroscopes based on neural networks. Background Technology
[0002] MEMS gyroscopes are core components for attitude perception and navigation control in various autonomous systems such as drones and robots, and their output accuracy directly affects the stability and reliability of the entire system. However, the output signal of MEMS gyroscopes is highly susceptible to changes in operating temperature, resulting in so-called temperature drift, which is a major source of error limiting their use in high-performance applications. Therefore, how to accurately and reliably compensate for the temperature drift of gyroscopes is a critical problem that urgently needs to be solved in the current technological field.
[0003] To address the aforementioned issues, considering the complex, highly nonlinear, and time-series dependent relationship between temperature drift and temperature—meaning the current drift is related not only to the current temperature but also to historical temperature changes—existing technologies commonly employ deep learning models such as Long Short-Term Memory (LSTM) networks for compensation. LSTM models can effectively capture and learn these time-series characteristics, and their prediction accuracy under normal operating conditions is far superior to traditional static compensation models such as polynomial fitting.
[0004] However, LSTM-based compensation methods have an inherent drawback: their robustness and generalization ability are highly dependent on the coverage of the training dataset. In real-world flight scenarios such as those involving drones, systems often encounter extreme conditions or unforeseen events not covered in the training data. Examples include severe high-frequency mechanical vibrations caused by airflow disturbances or sudden temperature fluctuations due to rapid altitude changes. In these situations, the sensor data input to the LSTM model deviates significantly from its learned distribution during training, leading to a sharp drop in the model's generalization ability and potentially resulting in unreliable or even catastrophically erroneous compensation values, thus posing a serious threat to flight safety. Summary of the Invention
[0005] To address the problem that the generalization ability of the aforementioned models may drastically decrease, potentially resulting in unreliable or even catastrophically erroneous compensation values, this invention proposes a neural network-based method for temperature drift compensation in MEMS gyroscopes. The method includes: acquiring the angular velocity, temperature, and acceleration of nearby locations of the gyroscope; obtaining a first compensation value using a pre-trained LSTM model based on the temperature and angular velocity; obtaining a second compensation value using a temperature-related baseline compensation model established during the calibration phase based on the temperature; multiplying the first compensation value by the confidence level of the LSTM model, and multiplying the second compensation value by the difference between 1 and the confidence level, with the product being... The sum constitutes the final compensation value; the angular velocity minus the final compensation value is then input into the attitude control system of the UAV; the confidence level ranges from [0,1] and is negatively correlated with the composite disturbance index; the composite disturbance index is positively correlated with the thermal stress factor and the mechanical excitation factor; the thermal stress factor is positively correlated with the absolute value of the rate of change of temperature; and when the sign of the rate of change of temperature is inconsistent with the sign of the vertical acceleration of the UAV, the thermal stress factor is exponentially amplified; the mechanical excitation factor is positively correlated with the standard deviation of the magnitude of the resultant acceleration and the standard deviation of the magnitude of the resultant angular acceleration within a set time window.
[0006] Compared to existing technologies that typically employ a single compensation model, this invention combines a pre-trained LSTM model and a temperature-related baseline compensation model, and introduces a confidence level based on a composite perturbation index to dynamically weight and fuse the compensation results of the two models. This design makes the compensation method adaptive: under stable operating conditions with gradual temperature changes and minimal mechanical vibration, the system relies more on the accurate and reliable baseline model; while under dynamic operating conditions with drastic temperature changes or violent UAV maneuvers, it relies more on the LSTM model, which is better at capturing temporal features. Therefore, this invention can achieve more accurate and robust compensation for temperature drift of MEMS gyroscopes in complex and variable operating environments, significantly improving the stability and reliability of UAV attitude control.
[0007] Furthermore, the method for calculating the confidence level is as follows:
[0008] ;
[0009] in express time The confidence score of the model, its value is in arrive between; This represents the set attenuation coefficient, with a value range of [value range missing]. ; This represents the set confidence threshold center, with a value range of [value range missing]. ; express The composite disturbance index at time t.
[0010] Furthermore, the specific method for calculating the composite disturbance index is as follows:
[0011] ;
[0012] in for The composite perturbation index at any given time; Represents a logarithmic function; express The thermal stress factor at time; express The mechanical excitation factor at time.
[0013] Furthermore, the specific method for calculating the thermal stress factor is as follows:
[0014] ;
[0015] in express Thermal stress factor at any given time; Represents a symbolic function; express The rate of temperature change over time is: ,in express The temperature of the gyroscope at any given time; ,in This represents the Z-axis acceleration reading of the drone while it is hovering. This represents the drone's Z-axis acceleration.
[0016] Unlike existing technologies that only consider the rate of temperature change, this invention correlates the sign of the rate of temperature change with the sign of the UAV's vertical acceleration and amplifies it using an exponential function. This design can intelligently distinguish between rapid convective heat dissipation caused by the UAV's own motion and drastic fluctuations in external ambient temperature. When the signs of the two are inconsistent, the thermal stress factor is significantly increased, enabling the system to respond more sensitively to and cope with harsh thermal shock environments, thus improving the targeted nature of compensation.
[0017] Furthermore, the specific method for calculating the mechanical excitation factor is as follows:
[0018] ;
[0019] in express The mechanical excitation factor at any given moment; express The standard deviation of the combined acceleration signal within the set time window at which the moment occurs; express The standard deviation of the resultant angular acceleration signal within the time window at which the moment occurs; Represents the hyperbolic tangent function; This represents the set reference value used to eliminate the unit dimension of the resultant angular acceleration.
[0020] Compared to simple methods that rely solely on instantaneous acceleration or angular velocity to determine disturbances, this invention, by calculating the standard deviation of the resultant acceleration and resultant angular acceleration within a set time window, can more accurately measure the vibration level and maneuver severity of the UAV platform. The use of the hyperbolic tangent function further smooths and saturates the impact of high-frequency, severe vibrations, preventing extreme disturbance values from impacting the compensation system and resulting in more stable and reliable quantification of mechanical disturbances.
[0021] Furthermore, the specific method for calculating the resultant acceleration is as follows:
[0022] ,in They represent The components of the acceleration at time t in the spatial coordinate system along the X, Y, and Z axes.
[0023] Furthermore, the resultant angular acceleration is the root mean square of the angular acceleration along the X, Y, and Z axes in the spatial coordinate system. ,have: ,in This indicates the angular velocity.
[0024] Furthermore, the baseline compensation model is a quadratic polynomial model about temperature established during the calibration phase through a temperature chamber experiment, specifically as follows:
[0025] ,in express The second compensation value at time; express Temperature at any given time; coefficient This represents the polynomial coefficients obtained by curve fitting the calibration data.
[0026] Compared with the linear model or more complex higher-order model that may be used in the existing technology, the quadratic polynomial model can effectively fit the common nonlinear relationship between temperature and static drift of MEMS gyroscope while ensuring lower computational complexity. It is more accurate than the linear model and has better generalization ability and stability than the higher-order model, providing a reliable compensation benchmark for the system under stable operating conditions.
[0027] Furthermore, the process of establishing the baseline compensation model includes: placing the gyroscope in a temperature chamber and keeping it stationary; immersing the gyroscope in heat at multiple set temperature points until the temperature stabilizes; collecting the static angular velocity output at each temperature point and calculating its average value as the static drift; using the collected temperature points and the corresponding static drift as calibration data, and fitting the quadratic polynomial using the least squares method to determine the coefficients. .
[0028] By performing multi-point hot immersion in an incubator and collecting static drift data, followed by fitting using the least squares method, the accuracy of the calibration data and the reliability of the model parameters were ensured. Compared to simple calibration in an uncontrolled environment, this standardized experimental procedure can effectively eliminate other interfering factors, establish a high-precision temperature-drift relationship model, and lay a solid foundation for the effectiveness of the entire compensation method.
[0029] Furthermore, it also includes synchronous alignment and normalization of the acquired angular velocity, temperature, and acceleration.
[0030] The technical effects of this invention are as follows:
[0031] This invention overcomes the limitations of a single fixed model by constructing a confidence assessment mechanism based on a composite disturbance index such as thermal stress and mechanical vibration. This mechanism enables dynamic and smooth weighting between an LSTM neural network model adept at handling dynamic conditions and a baseline compensation model suitable for stable conditions. This method intelligently identifies the gyroscope's operating environment and automatically adjusts the compensation strategy, thus providing high-precision and robust drift compensation under various complex flight conditions, significantly improving the navigation and control performance of UAVs. Attached Figure Description
[0032] Figure 1 This is a schematic flowchart illustrating a method for compensating for temperature drift of a MEMS gyroscope based on a neural network, according to an embodiment of the present invention.
[0033] Figure 2 This is a schematic diagram illustrating a physical example of a three-axis MEMS gyroscope according to an embodiment of the present invention;
[0034] Figure 3 This is a schematic diagram illustrating the curves of the original angular velocities of the gyroscope's X, Y, and Z axes as a function of time in an embodiment of the present invention;
[0035] Figure 4 This is a schematic diagram illustrating the curves of the original acceleration of the gyroscope accelerometer along the X, Y, and Z axes over time in an embodiment of the present invention.
[0036] Figure 5This is a schematic diagram illustrating the temperature change over time collected by the gyroscope temperature sensor in an embodiment of the present invention;
[0037] Figure 6 This is a schematic diagram illustrating the change of the mechanical excitation factor over time in an embodiment of the present invention;
[0038] Figure 7 This is a schematic diagram illustrating the curves of the composite perturbation index changing over time and the center of the confidence threshold in an embodiment of the present invention;
[0039] Figure 8 This is a schematic diagram showing the comparison between calibration temperature and static drift data in an embodiment of the present invention;
[0040] Figure 9 This is a schematic comparison curve of the instantaneous error compensation of the conventional LSTM model and the instantaneous error compensation of the adaptive fusion model of the present invention on the X-axis in an embodiment of the present invention;
[0041] Figure 10 This is a schematic bar chart showing the comparison of the X-axis compensation error RMSE of the conventional LSTM and adaptive fusion models under normal and extreme conditions in an embodiment of the present invention.
[0042] Figure 11 This is a bar chart illustrating the percentage improvement in compensation performance across three axes by the adaptive fusion method of the present invention compared to the conventional LSTM method. Detailed Implementation
[0043] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0044] The specific embodiments of the present invention will now be described in detail with reference to the accompanying drawings.
[0045] An example of a neural network-based method for temperature drift compensation in MEMS gyroscopes:
[0046] like Figure 1 As shown, the present invention provides a method for compensating for temperature drift in a MEMS gyroscope based on a neural network, comprising:
[0047] S1. Real-time acquisition and synchronization of data streams from three types of sensors: angular velocity, temperature, and acceleration, and performance of timestamp alignment and normalization preprocessing to eliminate the influence of dimensions.
[0048] In one embodiment, the system acquires and synchronously samples the following three types of data streams in real time via an airborne sensor interface: First, acquires... Raw output signal of the three-axis angular velocity of the gyroscope Secondly, obtain the temperature reading from the gyroscope's built-in temperature sensor. Finally, the raw output signal of the three-axis accelerometer, which is located immediately adjacent to the physical position of the gyroscope, is obtained. That is, linear acceleration.
[0049] like Figure 2 As shown, it demonstrates a triaxial Gyroscope.
[0050] To ensure the consistency of data from various sensors across time, the acquired data sequences need to be preprocessed. Specifically, timestamp alignment can be used to process each data stream, and the data can be normalized to eliminate the influence of different physical dimensions. Subsequently, the aligned and normalized data is divided into fixed-length time windows, which serve as the basic units for subsequent processing. The above preprocessing operations are well-known techniques in this field and will not be elaborated upon here.
[0051] like Figure 3 As shown, it displays the raw output signals of the gyroscope's three-axis angular velocity; as Figure 4 As shown, it displays the raw output signal of the gyroscope's three-axis accelerometer; as Figure 5 As shown, it displays the raw output signal of the gyroscope's temperature sensor.
[0052] S2. To assess the failure risk of the LSTM model in real time, a composite perturbation index representing the system's deviation from normal operating conditions is obtained by integrating the mechanical excitation factor and the thermal stress factor.
[0053] In temperature drift compensation for UAV gyroscopes, the relationship between temperature and drift is highly nonlinear and temporally correlated; that is, the current drift is not only related to the current temperature but also to the historical temperature changes. Therefore, a long short-term memory network (LSTM) is employed. The ) model is currently the preferred technical approach for achieving high-precision compensation. It can effectively learn such complex time series dependencies, and its prediction accuracy far exceeds that of traditional static multinomial models.
[0054] The standard used for temperature drift compensation in this embodiment The model includes:
[0055] Network structure: Employs a network consisting of 2 to 4 stacked layers. layer.
[0056] Hidden Units: Each Layer The number of hidden units is typically set to 64, 128, or 256.
[0057] Sequence length: The length of the input sequence, i.e. the size of the time window, is usually set according to the correlation between the time constant of temperature change and angular velocity drift. For example, the empirical range is 50 to 200 time steps, which corresponds to 5 to 20 seconds of historical data when the sampling frequency is 10 Hz.
[0058] Training parameters: Use the Adam optimizer, set the learning rate to 1e-3 to 1e-4, and set the batch size to 32 or 64.
[0059] However, The robustness of a model is highly dependent on the coverage of its training dataset. In regular flight, The model performs excellently, but when the drone encounters extreme conditions or unforeseen events not covered in the training data, such as severe high-frequency vibrations of the aircraft or sudden temperature shocks due to rapid ascents and descents, the input data deviates from its normal distribution. In this case, The model's generalization ability may be insufficient, and its output compensation values may become unreliable or even produce catastrophic errors, thereby endangering flight safety.
[0060] S2.1. The linear vibration and rotational turbulence experienced by the body are quantified by calculating the standard deviation of the resultant acceleration and resultant angular acceleration within a set time window and using the nonlinear gain modulation of the hyperbolic tangent function.
[0061] Instability of an organism mainly includes two aspects: linear vibration and rotational turbulence.
[0062] First, from the linear acceleration signal Calculating the magnitude of the resultant acceleration That is, the overall vibration intensity is characterized by combining the three-axis acceleration components into a single scalar value, specifically:
[0063] ;
[0064] in They represent linear acceleration signal at any time Components on three axes. Calculated within the current time window. Standard deviation It can characterize the high-frequency linear vibration energy of the body.
[0065] Secondly, from the angular velocity signal Calculate its rate of change, i.e., angular acceleration. Then calculate the magnitude of the resultant angular acceleration. and its standard deviation within the current time window. It can effectively capture the turbulence intensity of rotational motion. The calculation method of the resultant angular acceleration is the same as that of the resultant acceleration, and will not be repeated here.
[0066] Since linear vibration and rotational turbulence are two different forms of instability characteristics that often occur simultaneously, combining them can provide a more comprehensive assessment of the deviation from the mechanical state. Here, the mechanical excitation factor is calculated to comprehensively evaluate the mechanical stress borne by the organism. Linear vibration is used as the basic term, and the rotational turbulence term is nonlinearly modulated to reflect its aggravating effect during the instability process. The specific calculation method is as follows:
[0067] ;
[0068] in express The mechanical excitation factor at any given moment; express The standard deviation of the combined acceleration signal within the time window in which the moment occurs; express The standard deviation of the resultant angular acceleration signal within the time window at which the moment occurs; This represents the hyperbolic tangent function, used to amplify the effects of rotating turbulence in a bounded, nonlinear manner; The value of 1, representing a unit of radians per second, is used to eliminate the dimension of the resultant angular acceleration. From this formula, it can be seen that when linear vibration... Or rotational turbulence When it increases, the mechanical excitability factor All of these will increase accordingly, reflecting the intensification of the body's mechanical instability.
[0069] like Figure 6 As shown, it displays the curve of the mechanical excitation factor changing over time.
[0070] S2.2. Combining the sign of the rate of temperature change with the sign of the UAV's vertical acceleration, an exponential function is used to amplify abnormal thermal events that contradict physical laws, thereby achieving intelligent assessment of the thermodynamic state.
[0071] This embodiment also requires assessing the degree of thermodynamic anomaly. Since thermodynamic anomalies are not isolated temperature changes, but are closely related to the current flight scenario, especially the vertical motion state, it is essential to effectively distinguish between expected temperature changes and anomalous temperature changes, such as a decrease in ambient temperature due to climb and an abnormal temperature rise due to electronic malfunction.
[0072] First, we can calculate the current rate of temperature change: .
[0073] Secondly, the Z-axis acceleration obtained in step S2.1 is processed. To determine the vertical motion state of the drone. Specifically, to calculate... ,in This is the Z-axis acceleration reading of the drone while it is hovering, and its value is approximately... This is related to the current altitude. The symbol can intuitively reflect whether the drone is accelerating upward (represented by a positive value) or accelerating downward (represented by a negative value).
[0074] By combining the rate of thermal change with the vertical motion state, abnormal thermal events that contradict physical laws can be identified. Therefore, in this embodiment, a matching degree discriminator is determined using a sign function. When the thermal change and the vertical motion state do not match, the thermal stress is exponentially amplified; otherwise, it is suppressed. The specific calculation method is as follows:
[0075] ;
[0076] in express Thermal stress factor at any given time; express The absolute rate of temperature change at any given moment; For sign functions. When and The product is For example, when accelerating upwards, the temperature decreases, which conforms to the laws of physics. In this case, the exponential term is... , It is proportional to the rate of temperature change; and when the product is For example, if the temperature rises during accelerated descent, this is an abnormal situation, and the exponential term will be... , It will be significantly suppressed.
[0077] As a preferred approach, to highlight abnormal situations, the exponent term can be adjusted to... ,in The gain is a positive constant, such that the matching factor is... When there is a mismatch, the factor is This allows for an exponential amplification of abnormal thermal events.
[0078] S2.3. The thermal stress factor is used as a basic term and multiplied by the mechanical excitation factor after nonlinear compression by a logarithmic function to obtain the composite perturbation index that reflects concurrent anomalies in multiple physical dimensions.
[0079] Finally, based on the mechanical excitatory factor With thermal stress factor Obtain the composite disturbance index Since the most dangerous operating condition involves simultaneous extreme anomalies in both mechanical and thermodynamic processes, the final composite perturbation index should be the result of the interaction and mutual reinforcement of the two factors. The specific calculation method is as follows:
[0080] ;
[0081] in for The composite perturbation index at any given time; This represents a logarithmic function used to nonlinearly compress the mechanical excitation factor, making it an enhancement coefficient. The value of thermal stress factor or mechanical activator When one of them is high, it will increase; when both are at high levels, it will increase sharply, thus providing a comprehensive indication of whether the drone is in an extreme or sporadic situation.
[0082] S3. Based on the composite disturbance index, the system anomaly degree is defined as dynamic confidence level using the parameter-calibrable logistic function.
[0083] In obtaining the composite perturbation index characterizing the degree of anomaly in the system Furthermore, a higher composite perturbation index indicates that the current system state deviates further from the normal range covered by the training data. The less reliable the model's predictions, the lower its confidence level should be. To achieve this inverse relationship and constrain its range... Within the interval, in this embodiment, the logistic function is used to calculate... The confidence level of the model. The specific calculation method is as follows:
[0084] ;
[0085] in express time The confidence score of the model, its value is in arrive between; This represents the composite disturbance index calculated in step S2; Indicates the attenuation coefficient; This indicates the center of the confidence threshold.
[0086] like Figure 7 As shown, the green curve represents the calculated composite disturbance index. The red dashed line represents the confidence threshold center calibrated and set in this step. When the system is in a stable operating condition, the composite disturbance index is much smaller than the confidence threshold center. The model's confidence level approaches 1. When the system encounters extreme or random events (as shown by multiple spikes in the figure), the composite perturbation exponent instantaneously and significantly exceeds the confidence threshold center, leading to... The model's confidence level rapidly approaches 0, thus triggering a smooth transition to the baseline model.
[0087] From the above formula, it can be seen that when much smaller hour, Approaching ,at this time Approaching This indicates that the model is highly reliable. When equal hour, for .when Much larger hour, Approaching infinity, at this point Approaching This indicates that the model is completely unreliable.
[0088] As a preferred option, parameters and It has a clear physical meaning and is determined based on flight test data during the system calibration phase.
[0089] parameter The attenuation coefficient controls the steepness of the confidence curve and determines the sensitivity of the confidence level to changes in the perturbation exponent. The larger the value, the higher the confidence level. arrive The narrower the transition range, the more aggressive the system's response to disturbances. In this embodiment, The optimal range can be determined experimentally to achieve a balance between sensitivity and smoothness. A reasonable... The set range is When lower This will make the transition zone too wide; higher than It will make the curve at The near-vertical transition near the critical point is too aggressive and may cause the system to experience high-frequency jitter due to noise near the critical point.
[0090] parameter The confidence threshold center represents the point at which the system begins to believe... The model outputs an unreliable disturbance index level. Its value should be based on the analysis of a large amount of flight data to define the boundary between the normal flight envelope and anomalous events. A reasonable... The set range is When lower than It might be overly sensitive, causing even normal maneuvers to be misjudged as abnormal, leading the system to frequently switch to the baseline model and sacrificing unnecessary accuracy; higher than It may be too slow to detect truly extreme events in time.
[0091] S4. Using the confidence level obtained in S3 as weights, the high-precision LSTM prediction value and the high-robust baseline multinomial model compensation value are linearly weighted and fused to obtain the final compensation value.
[0092] In order to distrust The model can still provide a safe and reliable compensation. In this embodiment, a baseline compensation model with a simple structure and strong robustness is introduced.
[0093] In one embodiment, the baseline model can be a temperature-related model established during the ground calibration phase through chamber experiments. Low-order polynomial model Although the model has limited accuracy, its output is stable and predictable, and it will not produce catastrophic errors under any input.
[0094] For example, the baseline model It can be expressed in the form of a quadratic polynomial:
[0095] ; where the coefficient The data was obtained by fitting static drift data of the gyroscope at different temperatures during calibration in a temperature chamber. The following is an example of a specific implementation step:
[0096] First, the MEMS gyroscope under test (or its IMU unit) is removed from the drone and fixedly placed in a high-precision programmable temperature chamber. Ensure the gyroscope remains absolutely still throughout the calibration process.
[0097] Then follow the calibration procedure below:
[0098] Step I (Cooling Down): Set the chamber temperature to the lower operating limit of the gyroscope, for example, -20°C; Step II (Hot Immersion): Maintain a constant temperature of -20°C for at least 30 minutes. This hot immersion step ensures that the internal temperature of the gyroscope is completely consistent with the ambient temperature of the chamber, achieving thermal equilibrium; Step III (Static Acquisition): While maintaining a constant temperature of -20°C and with the gyroscope stationary, continuously acquire the raw angular velocity output of the gyroscope, for example, at a sampling rate of 100Hz for 60 seconds; Step IV (Drift Calculation): Calculate the average value of all sampled data within these 60 seconds. Since the gyroscope is stationary (true value is 0), this average value is the static temperature drift at -20°C; Step V (Looping): Repeat steps II, III, and IV. Gradually increase the chamber temperature in fixed steps, for example, every 10°C, until the upper operating temperature limit is reached, for example, 60°C. The hot immersion and static acquisition steps must be repeated at each temperature point.
[0099] After completing the above operation process, a set of corresponding data points for temperature and static drift can be obtained, for example, such as Figure 8 As shown, next Figure 8 Import the data points into mathematical analysis software, such as MATLAB's polyfit tool or Python's scipy.optimize.curve_fit. Use quadratic polynomials. Perform least squares curve fitting on these data points.
[0100] Finally, the fitting tool will automatically calculate the optimal coefficients. For example, based on the example data above, the fitting result is: The final baseline compensation model is as follows:
[0101] .
[0102] Final gyroscope drift compensation value Through pre-trained high precision Model's predicted output Output of the baseline model The model confidence score is obtained by weighted fusion. (Step S3 calculates the model confidence score.) This refers to the dynamic weights of the fusion process.
[0103] The final drift compensation value is a linear weighted average, with the weights dynamically determined by the confidence level, to achieve a smooth transition between the two models. The specific calculation method is shown below:
[0104] ;
[0105] in express The compensation value is ultimately applied to the original output of the gyroscope at any given moment; Indicates pre-training The model in The drift prediction value at time can also be denoted as the first compensation value; This indicates that the baseline polynomial model is based on the current temperature. The calculated drift compensation value can also be recorded as the second compensation value; This indicates the result calculated in step S3. Model confidence.
[0106] As can be seen from the above formula, when the system is under normal operating conditions, Lower Approaching ,at this time Mainly composed of high precision This decision ensures high accuracy in compensation. When the system encounters extreme or unpredictable events, rise, Approaching ,at this time Then it smoothly transitions to being mainly composed of highly stable The decision was made to sacrifice some accuracy in exchange for absolute security and reliability.
[0107] like Figure 9 As shown in the figure, this diagram intuitively illustrates the effect of the adaptive fusion strategy of the present invention.
[0108] The blue curve shows that when the system encounters severe disturbances, the conventional LSTM model outputs catastrophic errors, resulting in huge spikes in the compensation error. The green curve shows that the present invention successfully suppresses these error spikes by reducing the confidence level at the same time, thus ensuring the reliability of the system.
[0109] like Figure 10 As shown, under normal conditions, the adaptive fusion model of this invention has the same low error as the conventional LSTM model, preserving the high accuracy of LSTM. However, under extreme events, the error of conventional LSTM surges, while the adaptive fusion model keeps the error at a low value, significantly improving robustness and safety under extreme conditions.
[0110] Finally, the calculated final drift compensation value From the raw angular velocity reading of the gyroscope Subtracting the positive value from the negative value yields the corrected angular velocity, which is then input into the UAV's attitude control algorithm to complete the entire closed-loop compensation process.
[0111] like Figure 11As shown, in a complete test sequence including normal and extreme conditions, the adaptive fusion scheme of the present invention achieved better RMSE than conventional LSTM on all three axes, proving that the present invention improves overall robustness through dynamic fusion strategy while ensuring accuracy.
Claims
1. A method for temperature drift compensation of a MEMS gyroscope based on a neural network, characterized in that, The method includes: acquiring the angular velocity, temperature, and acceleration of the gyroscope at a nearby location; Based on the temperature and angular velocity, a first compensation value is obtained using a pre-trained LSTM model; based on the temperature, a second compensation value is obtained using a temperature-related baseline compensation model established during the calibration phase; the first compensation value is multiplied by the confidence level of the LSTM model, and the second compensation value is multiplied by the difference between 1 and the confidence level, and the sum of the two products constitutes the final compensation value; the final compensation value is then subtracted from the angular velocity and input into the attitude control system of the UAV. The confidence level ranges from [0,1] and is negatively correlated with the composite perturbation index; the composite perturbation index is positively correlated with the thermal stress factor and the mechanical excitation factor. The thermal stress factor is positively correlated with the absolute value of the rate of change of temperature; and when the sign of the rate of change of temperature is inconsistent with the sign of the vertical acceleration of the UAV, the thermal stress factor is exponentially amplified. The mechanical excitation factor is positively correlated with the standard deviation of the magnitude of the resultant acceleration and the standard deviation of the magnitude of the resultant angular acceleration within a set time window. The baseline compensation model is a quadratic polynomial model about temperature established during the calibration phase through chamber experiments, specifically as follows: ,in express The second compensation value at time; express Temperature at any given time; coefficient This represents the polynomial coefficients obtained by curve fitting the calibration data.
2. The method for temperature drift compensation of a MEMS gyroscope based on a neural network according to claim 1, characterized in that, The specific method for calculating the confidence level is as follows: ; in express time The confidence score of the model, its value is in arrive between; This represents the set attenuation coefficient, with a value range of [value range missing]. ; This represents the set confidence threshold center, with a value range of [value range missing]. ; express The composite disturbance index at time t.
3. The method for temperature drift compensation of a MEMS gyroscope based on a neural network according to claim 2, characterized in that, The specific method for calculating the composite disturbance index is as follows: ; in for The composite disturbance index at any given time; Represents a logarithmic function; express The thermal stress factor at time; express The mechanical excitation factor at time.
4. The method for temperature drift compensation of a MEMS gyroscope based on a neural network according to claim 3, characterized in that, The specific method for calculating the thermal stress factor is as follows: ; in express Thermal stress factor at any given time; Represents a symbolic function; express The rate of temperature change over time is: ,in express The temperature of the gyroscope at all times; and ,in This represents the Z-axis acceleration reading of the drone while it is hovering. This represents the drone's Z-axis acceleration.
5. The method for temperature drift compensation of a MEMS gyroscope based on a neural network according to claim 3, characterized in that, The specific method for calculating the mechanical excitability factor is as follows: ; in express The mechanical excitation factor at any given moment; express The standard deviation of the combined acceleration signal within the set time window at which the moment occurs; express The standard deviation of the resultant angular acceleration signal within the time window at which the moment occurs; Represents the hyperbolic tangent function; This represents the set reference value used to eliminate the unit dimension of the resultant angular acceleration.
6. The method for temperature drift compensation of a MEMS gyroscope based on a neural network according to claim 5, characterized in that, The specific method for calculating the resultant acceleration is as follows: ,in They represent The components of the acceleration at time t in the spatial coordinate system along the X, Y, and Z axes.
7. The method for temperature drift compensation of a MEMS gyroscope based on a neural network according to claim 5, characterized in that, The resultant angular acceleration is the root mean square of the angular acceleration along the X, Y, and Z axes in the spatial coordinate system. ,have: ,in This indicates the angular velocity.
8. The method for temperature drift compensation of a MEMS gyroscope based on a neural network according to claim 1, characterized in that, The process of establishing the baseline compensation model includes: Place the gyroscope in a temperature chamber and keep it stationary; The gyroscope was immersed in heat at multiple set temperature points until the temperature stabilized. Collect the static angular velocity output at each temperature point and calculate its average value as the static drift; The collected temperature points and corresponding static drifts are used as calibration data. The least squares method is used to fit the quadratic polynomial to determine the coefficients. .
9. The method for temperature drift compensation of a MEMS gyroscope based on a neural network according to claim 1, characterized in that, It also includes synchronizing and normalizing the acquired angular velocity, temperature, and acceleration.
Citation Information
Patent Citations
Modularized collaborative layout method for gyroscopes and accelerometers
CN119884556A
Automatic strapdown inertial navigation calibration test method of temperature control biaxial rate position turntable
CN120252792A