Vibrating wire sensor acquisition frequency precision adaptive optimization method based on Kalman filtering algorithm
By embedding an improved Kalman filter algorithm into the vibrating wire sensor, the problems of frequency error and noise interference of the vibrating wire sensor in the health monitoring of civil engineering structures are solved, realizing real-time adaptive optimization and high-precision data output, and improving the reliability and real-time performance of the monitoring system.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- TONGJI UNIV
- Filing Date
- 2026-01-23
- Publication Date
- 2026-05-12
AI Technical Summary
Existing vibrating wire sensors suffer from frequency acquisition errors and noise interference in civil engineering structure health monitoring, resulting in unreliable data. Existing hardware solutions are complex and costly, while software post-processing solutions cannot adaptively adjust in real time.
An improved Kalman filter algorithm is embedded in the microcontroller of the vibrating wire sensor to achieve noise adaptation and model adaptation, optimize the frequency signal in real time, and directly output structural state information.
This enables real-time, online adaptive optimization of the vibrating wire sensor, simplifies the system architecture, reduces the risk of failure, and improves the reliability and real-time response capability of the monitoring system.
Smart Images

Figure CN122019932A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of civil engineering structural health monitoring technology, and in particular to an adaptive optimization method for the acquisition frequency accuracy of a vibrating wire sensor based on the Kalman filter algorithm. Background Technology
[0002] In the process of monitoring the health of civil engineering structures, vibrating wire sensors are commonly used. The stress and deformation state of the structure is indirectly expressed by the monitoring frequency of the vibrating wire sensor. If the collected frequency value has errors, the accurate stress and deformation state of the structure cannot be obtained. Furthermore, the collected signal of the vibrating wire sensor is often affected by many interference factors such as environmental noise and equipment noise. The noise of the vibrating wire sensor is usually calibrated in the laboratory. When sensor aging, transition from construction to operation, or sudden environmental changes occur, the noise will also change. If a fixed factory noise level is used, the filter will be unable to filter out the true noise, ultimately leading to increasingly larger data errors and an inability to provide reliable monitoring data of the civil engineering structure's condition.
[0003] Existing technologies for improving the acquisition accuracy of vibrating wire sensors mainly fall into two categories: The first category involves designing hardware anti-interference circuits to filter out noise at the source; however, this type of solution suffers from complex circuitry, high cost, and increased risk of failure, and its parameters are usually fixed, lacking the ability to adaptively adjust according to signal changes. The second category involves software post-processing of the acquired frequency data, with the Kalman filter algorithm being a commonly used tool for state estimation and denoising. However, this type of solution typically uses Kalman filtering as a post-processing algorithm on a host computer or server, which has the following limitations: it requires establishing a data window for signal interception, which can easily lead to spectral leakage; it also requires high quality of the original vibrating wire signal; and it uses fixed factory noise, making it impossible to dynamically adjust the noise in real time, and it cannot output the actual state value in one step, leading to problems such as algorithm delay and error accumulation. Summary of the Invention
[0004] This invention overcomes the shortcomings of the prior art and provides an adaptive optimization method for the acquisition frequency accuracy of a vibrating wire sensor based on the Kalman filter algorithm.
[0005] To achieve the above objectives, the technical solution adopted by this invention is: an adaptive optimization method for the acquisition frequency accuracy of a vibrating wire sensor based on the Kalman filter algorithm, comprising: S1. Establish a Kalman filter model for the monitored structure, and use the Kalman filter model to establish appropriate state equations and observation equations; S2. Perform adaptive optimization settings on the Kalman filter model, including setting initial filter values, setting adaptive noise adjustment, and adaptive model adjustment; S3. Embed the algorithm program established and optimized in steps S1 and S2 into the microcontroller of the vibrating wire sensor, so that the sensor can output the optimized structural state information in real time while acquiring frequency signals.
[0006] In a preferred embodiment of the present invention, the specific steps in step S1 include: S11. Define the frequency signal collected by the vibrating wire sensor as the observation variable, and define the parameters reflecting the physical quantities to be monitored in the civil structure as state variables. S12. Establish a dynamic model describing the evolution of state variables over time and construct state equations; S13. Establish a measurement model describing the mapping relationship between the observed variables and the state variables, and construct the observation equation.
[0007] In a preferred embodiment of the present invention, the initial filtering values in step S2 include an initial state vector, an initial state error covariance matrix, an observation noise covariance matrix, and a process noise covariance matrix.
[0008] In a preferred embodiment of the present invention, the specific steps of setting the noise adaptive adjustment in step S2 include: S221. Calculate the state estimation residual at the current time. S222. Based on the residual, construct the noise covariance sample for the current moment; S223. Using an adaptive filtering algorithm, the historical noise covariance is fused with the current sample to update the noise covariance matrix estimate for the next time step.
[0009] In a preferred embodiment of the present invention, the adaptive filtering algorithm employs an exponentially weighted moving average algorithm or a sliding window estimation algorithm to iteratively update the observation noise covariance matrix and the process noise covariance matrix based on the state estimation residual at the current moment.
[0010] In a preferred embodiment of the present invention, the model adaptive adjustment in step S2 includes: Kalman optimal gain calculation is used to ensure that the sum of squares of the state error is minimized, so as to obtain the optimal unbiased estimate that is closest to the true state; The fading factor is introduced to enhance the suppression of the growth of the state error covariance matrix. In a preferred embodiment of the present invention, the Kalman optimal gain calculation step specifically includes: S2321. Construct the optimization objective of Kalman gain based on minimizing the trace of the state error covariance matrix; S2322. The optimal Kalman gain value is obtained by solving the partial derivative of the trace of the state error covariance matrix with respect to the Kalman gain and setting it to zero. S2323. Update the state estimate and the state error covariance matrix using the Kalman optimal gain value.
[0011] In a preferred embodiment of the present invention, the step of introducing a fading factor to modify the model specifically includes: S2331. Estimate the magnitude of the residual based on the observed state, and dynamically calculate the fading factor; S2332. Use the fading factor to suppress the growth of the state error covariance matrix; S2333. Based on the amplified state prediction error covariance matrix, update the state estimate.
[0012] In a preferred embodiment of the present invention, step S2 further includes setting and calibrating the initial parameters of the Kalman filter model, specifically as follows: During the first preset time period after monitoring starts, filtering is performed using a preset initial state error covariance matrix; After entering the second preset time period, the initial state error covariance matrix is updated based on the statistical value of the state error covariance matrix actually calculated within this time period, and the updated value is used in subsequent monitoring.
[0013] In a preferred embodiment of the present invention, the microcontroller of the vibrating wire sensor is an MCU chip or a SOC chip.
[0014] This invention addresses the shortcomings of the prior art and has the following beneficial effects: This invention integrates an improved Kalman filter algorithm that combines noise adaptation and model adaptation mechanisms, embedded in the vibrating wire sensor terminal. This enables real-time, online, and adaptive optimization of the acquired frequency signal and can directly output high-precision structural state information, solving the technical challenges of complex existing hardware solutions and non-adaptive software post-processing solutions.
[0015] The algorithm of this invention is embedded in the vibrating wire sensor as a complete program, fundamentally eliminating the time delay caused by data uploading and post-processing in traditional solutions. Compared with existing technologies that rely on complex anti-interference hardware circuits, increasing costs and failure rates, or host computer software post-processing and resulting in poor real-time performance, this solution simplifies the system architecture, reduces the risk of failure due to circuit complexity or communication link problems, thereby improving the reliability, real-time response capability, and ease of on-site deployment of the entire monitoring system.
[0016] This invention, based on specific engineering monitoring projects, establishes a Kalman filter model according to the working principle of vibrating wire sensors and the physical laws of structures. During the filtering recursion process, it simultaneously completes the conversion from the original frequency signal to engineering-meaning state values. This avoids error propagation and accumulation in multi-stage processing, improving data processing efficiency and the reliability and usability of the final results.
[0017] To address the sensitivity of initial parameter settings in Kalman filters, this invention first uses conservative parameters set based on prior engineering knowledge to stabilize the system for a period of time after the structure begins to be loaded. Then, using actual monitoring data from the initial stage when the structural response tends to stabilize, the initial state error covariance matrix is statistically calibrated and fixed, reducing subjective arbitrariness and ensuring that the filter can converge quickly, thereby improving the quality of the initial monitoring data and the overall system performance. Attached Figure Description
[0018] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. Figure 1 This is the overall flowchart of the present invention; Figure 2 This is a schematic diagram of the intelligent sensor system structure with embedded adaptive algorithm of the present invention; Figure 3 This is a flowchart of the noise adaptive adjustment process of the present invention; Figure 4 This is the adaptive adjustment logic diagram of the model of this invention. Detailed Implementation
[0019] 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 embodiments of the present invention, and not all embodiments. 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.
[0020] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein. Therefore, the scope of protection of the invention is not limited to the specific embodiments disclosed below.
[0021] In the description of this application, it should be understood that the terms "center," "longitudinal," "lateral," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," and "outer," etc., indicating orientation or positional relationships based on the orientation or positional relationships shown in the accompanying drawings, are only for the convenience of describing this application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as limiting the scope of protection of this application. Furthermore, the terms "first," "second," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Therefore, features defined with "first," "second," etc., may explicitly or implicitly include one or more of that feature. In the description of this invention, unless otherwise stated, "a plurality of" means two or more.
[0022] In the description of this application, it should be noted that, unless otherwise expressly specified and limited, the terms "installation," "connection," and "linking" should be interpreted broadly. For example, they can refer to fixed connections, detachable connections, or integral connections; they can refer to mechanical connections or electrical connections; they can refer to direct connections or indirect connections through an intermediate medium; and they can refer to the internal communication between two components. Those skilled in the art will understand the specific meaning of the above terms in this application based on the specific circumstances.
[0023] Application Overview: In the field of structural health monitoring in civil engineering, there is a fundamental contradiction between the technical goal of pursuing higher-precision monitoring data and the means of implementation limited by the limited resources of sensor terminals. While adding anti-interference circuit modules can improve signal quality, more modules mean higher costs, more potential failure points, and a lack of adaptability to dynamically changing environments. Using advanced algorithms on servers or host computers, although enabling complex processing, leads to data feedback delays and cannot overcome the problems of fixed sensor noise parameters and inability to adapt to sensor aging and sudden environmental changes during long-term service.
[0024] To address the aforementioned contradictions, this invention proposes a technological breakthrough for embedded real-time adaptive filtering systems. By embedding an improved Kalman filter algorithm, which combines an exponentially weighted moving average noise adaptive mechanism with a fading factor model adaptive mechanism, into the microcontroller of a vibrating wire sensor, this invention effectively solves the technical defects of existing hardware solutions, such as high complexity and poor adaptive capability, as well as the shortcomings of software post-processing solutions, such as insufficient real-time performance and inability to adapt to dynamic noise environments.
[0025] An adaptive optimization method for the acquisition frequency accuracy of a vibrating wire sensor based on the Kalman filter algorithm includes: S1. Establish a Kalman filter model for the monitored structure, and use the Kalman filter model to establish appropriate state equations and observation equations; S2. Perform adaptive optimization settings on the Kalman filter model, including setting initial filter values, setting adaptive noise adjustment, and adaptive model adjustment; S3. Embed the algorithm program established and optimized in steps S1 and S2 into the microcontroller of the vibrating wire sensor, so that the sensor can output the optimized structural state information in real time while acquiring frequency signals.
[0026] When using this method, the following key issues need to be addressed: complex filtering recursion, matrix operations, and real-time noise estimation will consume a lot of the controller's processing space; after the sensor leaves the factory, it is in a dynamically changing environment, and fixed parameter models are not applicable, so an adaptive mechanism that can automatically track changes in noise characteristics and adapt to the model is needed at the terminal; to achieve direct output from frequency to engineering state value, a mathematical model that maps the laws of the physical world needs to be built at the embedded end.
[0027] The adaptive optimization method for the acquisition frequency accuracy of the vibrating wire sensor using the Kalman filter algorithm of the present invention will be described in detail below. Example 1
[0028] In step S1, a Kalman filter model is established for the monitored structure, and appropriate state equations and observation equations are established using the Kalman filter model.
[0029] The essence of step S1 is to construct a dedicated mathematical model. Taking the frequency measured by the vibrating wire sensor as input, the model directly outputs the stress and other state values of the structure through a recursive estimation calculation process using a Kalman filter algorithm, based on the pre-set state equations and observation equations according to physical laws; thus achieving a one-step conversion from raw signals to engineering-meaning information.
[0030] The monitored structure refers to a specific civil engineering entity such as a tunnel, and its health status is the ultimate goal of monitoring.
[0031] The Kalman filter model is a mathematical framework and algorithm model, whose core consists of state equations and observation equations, and is used for optimal estimation.
[0032] Specifically, step S1 includes: S11. Define the frequency signal collected by the vibrating wire sensor as the observation variable, and define the parameters reflecting the physical quantities to be monitored in the civil structure as state variables. S12. Establish a dynamic model describing the evolution of state variables over time and construct state equations; S13. Establish a measurement model describing the mapping relationship between the observed variables and the state variables, and construct the observation equation.
[0033] Among them, the frequency signal collected by the vibrating wire sensor in S11 is the original output obtained by the actual measurement of the sensor. It is a sequence of physical quantities that changes with time. This signal is directly measurable, but it contains the actual structural response and various types of noise.
[0034] Defined as a modeling behavior involving assignment and mapping, it completes the conceptual transformation from sensor signals and engineering requirements to mathematical model observation variables and state variables.
[0035] The observation refers to the raw frequency signal directly acquired by the vibrating string sensor, which is the input data of the model.
[0036] Parameters reflecting the physical quantities to be monitored in civil engineering structures refer to key engineering conditions that cannot be directly measured inside the structure but need to be known, such as stress, strain, displacement, and temperature.
[0037] State variables refer to engineering parameters that reflect the actual physical condition inside a structure.
[0038] The dynamic model of the evolution of state variables over time in S12 is a mathematical descriptive framework used to characterize how state variables change from the previous moment to the current moment. Based on physical laws and engineering experience, it describes the intrinsic dynamics of state changes, endows the model with predictive ability, and can predict the possible range of the current state based on historical states when there is no new observation data.
[0039] The process of constructing a mathematical model and formulating system translates physical laws into specific mathematical equations that can track dynamic changes in state.
[0040] The measurement model for the mapping relationship between observed variables and state variables in S13 is a mathematical description framework. Based on the working principle of sensors, it describes the deterministic transformation relationship between state variables and observed variables, and establishes a bridge between state space and observation space.
[0041] By constructing a mathematical equation to express the working principle of the sensor, the observation equation required for Kalman filtering is generated, enabling the actual observed data to be used to correct and optimize purely model-based predictions, thereby outputting the optimal state estimate.
[0042] For example, taking a tunnel structure health monitoring project as an example, the monitoring item is steel reinforcement stress, and the model is designed based on the Kalman filtering principle and the tunnel structure health monitoring scheme.
[0043] S11. If the frequency data of steel reinforcement strain from tunnel structural health monitoring is used as the observation variable, then... f k This represents the frequency of the steel strain collected by the steel strain gauge at time k; The strain frequency data of steel bars can be converted into the corresponding steel bar stress. Therefore, if the steel bar stress is taken as a state variable, then... σ k This represents the magnitude of the steel reinforcement stress in the tunnel structure at time k; S12. Considering the influence of ambient temperature on the stress of the steel reinforcement in the tunnel structure, the following stress state equation for the steel reinforcement in the tunnel structure is established: x(k) is a state variable representing the stress state of the reinforcing steel at time k, including the reinforcing steel stress. σ k And the temperature T(k) of the reinforcing steel, i.e. ; u(k) is the input signal, representing the external factors affecting the stress of the reinforcing steel. This invention considers the influence of changes in ambient temperature, i.e. ; v(k) represents the process noise, indicating the influence of other random factors in the model on the stress state of the steel reinforcement. Represent the covariance matrix; F(k) is the state transition matrix, representing how the state variables transition from time k to time k+1, i.e. , a The stress coefficient related to the steel reinforcement material, b This is the coefficient representing the effect of temperature on stress. g The temperature coefficient related to the steel reinforcement material; G(k) is the input matrix, describing the influence of external factors (i.e., changes in ambient temperature) on the stress state of the reinforcing steel. , This is the coefficient representing the influence of ambient temperature changes on the stress of reinforcing steel. This represents the influence coefficient of ambient temperature changes on the temperature of the reinforcing steel.
[0044] The above state equation can then be written as: .
[0045] S13. Establish a measurement model describing the mapping relationship between the observed variables and the state variables, and construct the observation equations:
[0046] In the formula: z(k) is the observed variable, representing the frequency value of the steel bar strain measured by the vibrating wire sensor at time k; x(k) is a state variable, containing the steel reinforcement stress and temperature at time k, i.e. ; w(k) represents the observation noise, indicating random errors during the measurement process. Represent the covariance matrix; H(k) is the observation matrix, which maps the state variables to the observation space. Considering that the strain frequency of the steel reinforcement is related to both the stress and temperature of the steel reinforcement, then... f0 is the reference frequency of the vibrating wire sensor under no stress and temperature change, and E is the elastic modulus of the steel bar. K s This is the coefficient representing the effect of stress on frequency, i.e., the frequency change caused by a unit change in stress. K T This is the coefficient representing the effect of temperature on frequency, i.e., the frequency change caused by a unit change in temperature.
[0047] The above observation equation can then be written as: .
[0048] Furthermore, step S2 involves setting accuracy optimization settings, including setting initial filter values, setting adaptive noise adjustment, and setting adaptive model adjustment.
[0049] The initial values for filtering include the initial state vector. Initial state error covariance matrix The observation noise covariance matrix R and the process noise covariance matrix Q.
[0050] The initial state vector is the estimated value of the initial values of the system state variables at the start of the Kalman filter; it is a vector containing the initial estimates of all state variables; in this application, it refers to the estimated value of the initial state of the structure, such as initial stress and initial temperature, at the moment before the vibrating wire sensor is installed and the structure begins to be loaded. The initial state vector is an engineering estimate calculated by formula using the initial frequency and initial temperature read after the sensor is powered on, combined with the factory-calibrated physical conversion coefficients, providing a reasonable starting point for the entire recursive filtering process.
[0051] Specifically, the initial state vector It is necessary to estimate the moment when the vibrating wire sensor is installed but not under load. This can be achieved by reading the initial frequency of the vibrating wire using the MCU chip built into the sensor. and initial temperature Enter the factory calibration coefficient. and The initial state vector can then be calculated. :
[0052] The initial state error covariance matrix is used to quantify the uncertainty or confidence level of the initial state vector estimate. The diagonal elements of this matrix represent the variance of the initial estimates of each state variable, while the off-diagonal elements represent the initial covariance between the state variables. This matrix determines whether the filter places more trust in the model predictions or in the newly arrived observations during the initial stage. A larger initial state error covariance matrix indicates high uncertainty in the initial estimates, leading the filter to place more trust in early observations and adjust quickly. Conversely, a smaller initial state error covariance matrix tends to adhere more firmly to the initial estimates, resulting in slower convergence.
[0053] Specifically, the initial state error covariance matrix It needs to be set manually, and its essence is to represent the uncertainty of the initial estimate. If the uncertainty is set too small, the initial value will be over-relied during the filtering process, resulting in slow convergence or even divergence in the early stages. If the uncertainty is set too large, the estimation results in the first few steps will fluctuate greatly, wasting observation data.
[0054] In this application, the stress uncertainty Take 5% to 10% of the design strength of the steel reinforcement, and consider the temperature uncertainty. Taking twice the sensor's temperature resolution, the initial uncertainty can be hardcoded as a constant into the program. Therefore, the initial state error covariance matrix... : .
[0055] The observation noise covariance matrix is used to describe the statistical characteristics of noise in sensor measurements, mainly representing the uncertainty of the observation values; based on the maximum comprehensive error in the sensor's factory calibration report, it provides a starting point for the noise level based on objective performance indicators.
[0056] The size of the observation noise covariance matrix determines the filter's confidence in the current observation. A large observation noise covariance matrix indicates high observation noise, resulting in a lower weight for the current observation; a small observation noise covariance matrix indicates greater confidence in the current observation. The observation noise covariance matrix is updated in real time using an exponentially weighted moving average (EWMA) algorithm to adapt to changes in noise levels caused by sensor aging or environmental changes.
[0057] The process noise covariance matrix is used to describe the statistical characteristics of noise in the state equation during the system's state evolution process, representing the impact of various random disturbances on the state that the model fails to describe. In this application, the imperfection of the mathematical model itself, which quantifies the changes in the structural state, is quantified. The size of the process noise covariance matrix determines the filter's confidence in the model's predictions. A large process noise covariance matrix indicates high model uncertainty, leading to a reduction in the weight of model predictions; a small process noise covariance matrix indicates greater confidence in model predictions. Real-time adaptive updates are also performed using the exponentially weighted moving average (EWMA) algorithm to address the time-varying characteristics of structural behavior or environmental disturbances.
[0058] Specifically, the initial calibration of the observation noise covariance matrix R and the process noise covariance matrix Q can be determined based on the maximum error in the factory calibration report to determine the observation variance: ; In the formula, The calibration report provides the maximum overall error.
[0059] Process noise covariance matrix It is a 2×2 diagonal matrix: ; in, For stress components, denoted as , where 'a' is the stress drift coefficient, which is determined empirically; For the design strength of the reinforcing steel, This refers to the time step, i.e., the sampling interval; For stress components, denoted as b is the temperature drift coefficient, which is determined empirically.
[0060] Later, the observation noise covariance matrix R and the process noise covariance matrix Q are updated in real time using an adaptive algorithm. The empirical coefficients a and b are different during the construction period and the operation period, and can be changed by being distributed from the cloud.
[0061] In step S2, the noise adaptive adjustment uses an exponentially weighted moving average adaptive algorithm to correct and update the observation noise covariance matrix R and the process noise covariance matrix Q in real time.
[0062] The specific steps include: S221. Calculate the state estimation residual at the current time. S222. Based on the residuals, construct the noise covariance sample for the current time. S223. Using an adaptive filtering algorithm, the historical noise covariance is fused with the current sample to update the noise covariance matrix estimate for the next time step.
[0063] Among them, the residual in S221 is the only new information in the filtering process. If the model is perfect and noise-free, the residual should be zero. Non-zero residuals contain mixed information of model error and noise at the current time. The magnitude and statistical characteristics of the residual are the basis for judging whether the system has experienced a sudden noise change, and are the input signal for starting subsequent adaptive adjustment.
[0064] Before calculating the residuals, we first construct the initial observation noise covariance matrix R and the process noise covariance matrix Q. For the first 24 hours, we use fixed noise, which is the initial noise for adaptive correction.
[0065] Observation noise covariance matrix, ; Process noise covariance matrix, ; Then calculate the residual at time k+1. , ; x is the state variable at time k+1. ; For state valuation, .
[0066] S222 constructs the noise covariance sample for the current time step based on the residuals; where the observed noise sample is... Process noise samples are Using the theoretical relationship of Kalman filtering to infer the noise characteristics is an instantaneous capture based solely on the latest data, and serves as the raw material for subsequent smoothing and stable estimation.
[0067] Specifically, the observed noise samples are , ; in, The outer product of the residuals contains the total mismatch information; The state error covariance matrix is, i.e. ; The observation matrix (a 2x2 identity matrix); The projection of the uncertainty of state prediction onto the observation space; Subtracting the two eliminates the uncertainty of the state prediction itself from the total mismatch, thereby separating the instantaneous estimate of the observation noise.
[0068] Process noise samples are , ; Where W is the Kalman optimal gain value; the observation residuals are back mapped to the state space through the gain matrix to estimate the process noise intensity driving the state change.
[0069] S223 utilizes an adaptive filtering algorithm to fuse historical noise covariance with the current sample, updating the noise covariance matrix estimate for the next time step. The adaptive filtering algorithm employs an exponentially weighted moving average algorithm, iteratively updating the observed noise covariance matrix and the process noise covariance matrix based on the current state estimation residual.
[0070] The exponentially weighted moving average algorithm combines the historical estimate from the previous moment with the current sample according to certain rules to form an estimate of the noise at the next moment. The noise parameter changes from a fixed value to a time variable. By continuously feeding the latest observation information into the noise estimate, the filter can automatically adapt to scenarios such as sensor performance degradation and changes in environmental interference. It avoids directly using potentially unreliable instantaneous samples and smooths the noise using historical data to obtain a more reliable noise estimate, thereby ensuring the stability of the entire filter recursion.
[0071] Specific calculation method: ; ; It is a forgetting factor, and ; A value close to 1 indicates that the algorithm has long memory, is slow to react to new samples, produces smooth estimation results, but has a weak ability to track sudden noise changes; A value close to 0 indicates that the algorithm has a short memory, is sensitive to new samples, and has strong tracking ability, but the estimation results fluctuate greatly. This is a weighted averaging process that achieves the optimal balance between historical and current trust levels.
[0072] Each time a new set of data is collected, steps S221, S222, and S223 are executed once. Compared to the sliding window method, which requires storing the most recent n residuals before calculating the variance, the exponential iteration method only needs to store the R and Q data from the previous time step. It is suitable for MCUs with small memory and will not cause memory explosion.
[0073] The adaptive adjustment steps for the model in step S2 are as follows: S231. Based on the state equation and observation equation in step S1, the following content is defined: State estimation error: ; State estimation equation: ; Observation state error: ; Observational estimation equation: ; In the formula, This represents the estimate of x(k+1) at time k. This represents the estimate of z(k+1) at time k.
[0074] Based on the above formula, two error covariance matrices are defined as follows: State error covariance matrix: ; Observation error covariance matrix: .
[0075] S232. Derive the state error covariance matrix to obtain the error estimate at time k for time k+1: ; The derivation of the state error covariance matrix at time k+1 is as follows: .
[0076] The smaller the variance of the diagonal elements in the state error covariance matrix, the smaller the error fluctuation, and the closer the estimated value is to the true value.
[0077] The optimal Kalman gain is obtained by minimizing the sum of squares of the state errors at time k+1.
[0078] The specific steps for calculating the Kalman optimal gain include: S2321. Construct the optimization objective of Kalman gain based on minimizing the trace of the state error covariance matrix; S2322. The optimal Kalman gain value is obtained by solving the partial derivative of the trace of the state error covariance matrix with respect to the Kalman gain and setting it to zero. S2323. Update the state estimate and the state error covariance matrix using the Kalman optimal gain value.
[0079] Specifically, by taking the partial derivative of P with respect to W, the Kalman optimal gain value W is calculated as follows: ; The optimal Kalman gain value W(k+1) is obtained: ; Substituting W(k+1) back into P(k+1|k+1), the state error covariance matrix is updated as follows: ; In the process of solving for the optimal Kalman gain value W, the Kalman filter recursion is also completed simultaneously: .
[0080] By continuously updating the state error covariance matrix, the estimation error is gradually reduced, thereby improving the accuracy of state estimation.
[0081] Kalman gain W is a core concept in the Kalman filter, used to balance the confidence level between predicted and observed values during state estimation. The filter updates the state estimate using an increased Kalman gain, bringing the estimated state closer to the current observation, thus quickly pulling back from a trajectory that might have deviated due to model mismatch. The optimal Kalman gain is calculated to ensure the minimum sum of squared state errors, yielding the optimal unbiased estimate that best approximates the true state.
[0082] S233. When the model has errors, the data at time k will adversely affect the state estimation at time k+1. Therefore, a fading factor k+1 needs to be introduced to limit the divergence of the Kalman filter, specifically including: S2331. Estimate the magnitude of the residuals based on the observed conditions and dynamically calculate the fading factor; S2332. Use the fading factor to suppress the growth of the state error covariance matrix; S2333. Based on the amplified state prediction error covariance matrix, update the state estimate.
[0083] In step S2331, a fading factor is introduced. , The value is not fixed, but is calculated in real time based on the latest state estimation residual in each filtering cycle. When the system experiences model mismatch or sudden state change, the uncertainty of the system is actively and in a controlled manner amplified.
[0084] The calculation logic is as follows: continuously monitor the actual value of the residuals against the theoretical statistical value, based on whether the noise parameters of the current model match; if the actual residuals are significantly greater than the theoretical expectations, it indicates that the model may be overestimating the true state, and the predictive power of the old data is decreasing. At this time, the algorithm automatically calculates a fading factor greater than 1. The larger the residual, the better the calculated result. The larger the value, the better; by increasing... This prepares for amplifying uncertainty in the next step and quickly reduces the inertial influence of past data on current estimates.
[0085] Specifically, before proceeding with the correction steps, the state equation and observation equation are defined: S2332 utilizes a fading factor to suppress the growth of the state error covariance matrix. The covariance matrix of the state prediction error represents a measure of the uncertainty of the model prediction for the current state estimate based solely on the absence of new observation data, i.e., using the calculated fading factor. Perform scalar multiplication on the matrix.
[0086] Among them, the fading factor is a Kalman filter and its variants, used to adjust the prediction error covariance matrix. Its core function is to control the degree of influence of old data on the current state estimation by introducing a weighting factor, thereby improving the robustness and tracking accuracy of the filter when there is system model mismatch, noise mutation or data anomaly.
[0087] The introduction of a fading factor to amplify the variance matrix in this step indicates that the algorithm acknowledges the reduced reliability of current predictions derived from historical data, injecting a signal into the filter that relies more on the latest observations to correct predictions that may have deviated.
[0088] Specifically, a fading factor is introduced. l k+1 To limit the divergence of the Kalman filter, the state error covariance matrix can be written as: ; The system employs a one-step algorithm to automatically calculate the appropriate fading factor, with the following results: .
[0089] In the formula: ; When the observation state error Enlargement will lead to Increase, optimal fading factor l k+1 The value also increases accordingly, which strengthens the suppression of the growth of the state error covariance matrix, enhances the adaptability to changes in the current state of the system, and to a certain extent suppresses the impact of the uncertainty of the system model or the mismatch of prior statistical characteristics on the estimation results.
[0090] Based on the estimated value at time k and the observed value at time k+1, S2333 obtains the state estimate at time k+1: .
[0091] Step S2 also includes setting and calibrating the initial parameters of the Kalman filter model, specifically: During the first preset time period after monitoring starts, a preset initial state error covariance matrix is used for filtering. After entering the second preset time period, the initial state error covariance matrix is updated based on the statistical values of the state error covariance matrix actually calculated during this time period, and the updated values are used consistently in subsequent monitoring. The first preset time period is 24 hours after the structure begins to be loaded, and the second preset time period is the following 3 days.
[0092] Specifically, the initial state error covariance matrix It is set when the Kalman filter is started, but there is a problem: if If the initial value is set too small, the filter will rely too heavily on the initial value, becoming sluggish in responding to new observations and resulting in slow convergence; if... Setting the value too high can lead to unnecessary fluctuations in early estimates due to over-reliance on potentially noisy initial observations, wasting valuable data. Therefore, adopting a phased approach can further improve the accuracy of the estimates.
[0093] The first phase is the first 24 hours after the monitoring starts. The reason for choosing 24 hours is that 24 hours covers a complete daily cycle when the structure is most unstable after being loaded, ensuring that initial disturbances that may be caused by diurnal temperature differences, construction activities, etc. are included, and waiting for the initial transient process to basically end so that the system enters a quasi-steady state that can be well described by the model.
[0094] During the first 24 hours after the structure begins loading, the filter uses a fixed value calculated based on prior engineering knowledge. When working with values, in the initial stage of structural loading, its response is in a transient adjustment period, changing rapidly and without strong regularity; at this time, it is premature to adjust using unstable data. This could introduce noise or even lead to mistuning. Therefore, the primary goal at this stage is to ensure stable filter startup and prevent divergence.
[0095] The second phase lasts for three days. The reason for choosing three days is that the monitoring items of the civil structure basically reach a stable state within the first three days of construction. The data from 72 consecutive hours can smooth out occasional abnormal readings and obtain a statistically representative sequence of initial state error covariance matrix, ensuring the robustness of the calibration results.
[0096] Statistical analysis was performed on the state error covariance matrix actually calculated by the filter at each time point within 3 days. After 24 hours of initial operation, the system dynamics tended to stabilize and the filter had also adapted to the initial conditions. At this point, the sequence of state error covariance matrices calculated over 3 consecutive days reflected the filter's true assessment of the uncertainty of state estimation under actual operating conditions.
[0097] After calibration, the updated state error covariance matrix value is locked as a fixed initial parameter for long-term operation of the filter. This parameter will not be changed for each subsequent startup or long-term operation unless a new calibration is performed.
[0098] S3 involves embedding the algorithm program, which has been established and optimized through steps S1 and S2, into the microcontroller of the vibrating wire sensor, so that the sensor can output optimized structural state information in real time while acquiring frequency signals; the microcontroller of the vibrating wire sensor uses an MCU chip.
[0099] An MCU chip is a single-chip microcomputer that integrates a processor core, memory, and input / output interfaces. In this application, it is the core computing chip inside the vibrating wire sensor responsible for signal acquisition, processing, and communication.
[0100] MCU chips are responsible for executing instructions, processing data, and controlling peripherals. They are characterized by low cost, low power consumption, and high integration, making them suitable for large-scale deployment in sensors.
[0101] By using chips to integrate and process data, complex intelligent algorithms are moved from the back-end server to the edge device, improving the system's real-time performance, autonomy, and reliability. Moreover, all optimization algorithms are embedded, so field engineers do not need to perform complex software configuration or post-processing operations. The sensors can provide the best state estimates as soon as they are powered on, reducing the threshold for use and the technical complexity. Example 2
[0102] The difference from Example 1 lies in that the adaptive filtering algorithm, which previously used an exponentially weighted moving average algorithm, is modified to employ a sliding window estimation algorithm. A sliding data window is established to capture a number of monitoring data points, and the estimated residuals for the corresponding states are calculated. Based on the statistical characteristics of the residuals, the noise covariance matrix is updated. The sliding window method, based on a finite but definite amount of recent data, typically provides more accurate noise estimation than the exponentially weighted moving average method, especially in scenarios where noise characteristics do not change frequently or where more precise statistical values are required.
[0103] The sliding window algorithm consumes a lot of RAM in the controller, so it requires a microcontroller with strong processing power and a relatively large amount of memory.
[0104] When using the sliding window estimation algorithm, it is necessary to maintain a sliding window of fixed length and estimate and update the noise covariance matrix based on the statistical characteristics of the data within the window.
[0105] Establish a sliding window with a window length of n, and allocate a buffer in memory to store the state estimation residual sequence of the most recent n time steps in chronological order: ,in Let be the residual at time k.
[0106] When new data is collected, new residuals are calculated. At that time, the oldest residual Remove from window, and Add a window, ensuring that the window always contains the latest n residual data.
[0107] Based on the noise estimation covariance using a sliding window, the specific steps for adaptive noise adjustment at each time k+1 are as follows: S221' Calculate the state estimation residual at time k+1. And update the sliding window according to the above rules, so that the window content is updated to... ; S222' uses the n residuals within the entire window to perform statistical calculations to obtain smoother and more stable noise estimation samples; S223' obtains the noise covariance sample at the current time. and Then, the noise covariance matrix at the next time step can be updated by direct replacement. Example 3
[0108] The difference from Example 1 is that the microcontroller of the vibrating wire sensor uses a System-on-a-Chip (SoC) chip. An SoC chip integrates a microprocessor core, digital signal processor, memory, high-speed communication interface, dedicated hardware acceleration module, and other functional components onto a single chip. Compared to traditional MCU chips, SoC chips typically have more powerful computing capabilities, larger memory capacity, and richer peripheral interfaces. They are capable of implementing more complex algorithms, faster processing speeds, and richer system functions.
[0109] Based on the preferred embodiments of the present invention described above, those skilled in the art can make various changes and modifications without departing from the inventive concept. The technical scope of this invention is not limited to the contents of the specification, but must be determined according to the scope of the claims.
Claims
1. A method for adaptive optimization of the acquisition frequency accuracy of a vibrating wire sensor based on the Kalman filter algorithm, characterized in that, include: S1. Establish a Kalman filter model for the monitored structure, and use the Kalman filter model to establish appropriate state equations and observation equations; S2. Perform adaptive optimization settings on the Kalman filter model, including setting initial filter values, setting adaptive noise adjustment, and adaptive model adjustment; S3. Embed the algorithm program established and optimized in steps S1 and S2 into the microcontroller of the vibrating wire sensor, so that the sensor can output the optimized structural state information in real time while acquiring frequency signals.
2. The adaptive optimization method for the acquisition frequency accuracy of a vibrating wire sensor based on the Kalman filter algorithm according to claim 1, characterized in that: The specific steps in step S1 include: S11. Define the frequency signal collected by the vibrating wire sensor as the observation variable, and define the parameters reflecting the physical quantities to be monitored in the civil structure as state variables. S12. Establish a dynamic model describing the evolution of state variables over time and construct state equations; S13. Establish a measurement model describing the mapping relationship between the observed variables and the state variables, and construct the observation equation.
3. The adaptive optimization method for the acquisition frequency accuracy of a vibrating wire sensor based on the Kalman filter algorithm according to claim 1, characterized in that: The initial filtering values in step S2 include the initial state vector, the initial state error covariance matrix, the observation noise covariance matrix, and the process noise covariance matrix.
4. The adaptive optimization method for the acquisition frequency accuracy of a vibrating wire sensor based on the Kalman filter algorithm according to claim 1, characterized in that: The specific steps for setting the adaptive noise adjustment in step S2 include: S221. Calculate the state estimation residual at the current time. S222. Based on the residual, construct the noise covariance sample for the current moment; S223. Using an adaptive filtering algorithm, the historical noise covariance is fused with the current sample to update the noise covariance matrix estimate for the next time step.
5. The adaptive optimization method for the acquisition frequency accuracy of a vibrating wire sensor based on the Kalman filter algorithm according to claim 4, characterized in that: The adaptive filtering algorithm employs an exponentially weighted moving average algorithm or a sliding window estimation algorithm to iteratively update the observation noise covariance matrix and the process noise covariance matrix based on the state estimation residual at the current moment.
6. The adaptive optimization method for the acquisition frequency accuracy of a vibrating wire sensor based on the Kalman filter algorithm according to claim 1, characterized in that: The adaptive adjustment of the model in step S2 includes: Kalman optimal gain calculation is used to ensure that the sum of squares of the state error is minimized, so as to obtain the optimal unbiased estimate that is closest to the true state; A fading factor is introduced to enhance the suppression of the growth of the state error covariance matrix.
7. The adaptive optimization method for the acquisition frequency accuracy of a vibrating wire sensor based on the Kalman filter algorithm according to claim 6, characterized in that: The Kalman optimal gain calculation steps specifically include: S2321. Construct the optimization objective of Kalman gain based on minimizing the trace of the state error covariance matrix; S2322. The optimal Kalman gain value is obtained by solving the partial derivative of the trace of the state error covariance matrix with respect to the Kalman gain and setting it to zero. S2323. Update the state estimate and the state error covariance matrix using the Kalman optimal gain value.
8. The adaptive optimization method for the acquisition frequency accuracy of a vibrating wire sensor based on the Kalman filter algorithm according to claim 6, characterized in that: The introduction of a fading factor to modify the model specifically includes: S2331. Estimate the magnitude of the residual based on the observed state, and dynamically calculate the fading factor; S2332. Use the fading factor to suppress the growth of the state error covariance matrix; S2333. Based on the amplified state prediction error covariance matrix, update the state estimate.
9. The adaptive optimization method for the acquisition frequency accuracy of a vibrating wire sensor based on the Kalman filter algorithm according to claim 1, characterized in that: Step S2 also includes setting and calibrating the initial parameters of the Kalman filter model, specifically: During the first preset time period after monitoring starts, filtering is performed using a preset initial state error covariance matrix; After entering the second preset time period, the initial state error covariance matrix is updated based on the statistical value of the state error covariance matrix actually calculated within this time period, and the updated value is used in subsequent monitoring.
10. The adaptive optimization method for the acquisition frequency accuracy of a vibrating wire sensor based on the Kalman filter algorithm according to claim 1, characterized in that: The microcontroller of the vibrating wire sensor is an MCU chip or a SOC chip.