Kalman filter-based treadmill user center trajectory recognition method
By using an ultrasonic sensor array and an adaptive Kalman filter algorithm, the problems of insufficient position estimation accuracy and noise adaptability in treadmill user center trajectory recognition are solved, achieving high-precision and stable user trajectory recognition.
Patent Information
- Application Number
- CN202610218087.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-02-24
- Publication Date
- 2026-05-01
- Estimated Expiration
- 2046-02-24
Smart Images

Figure CN121741738B_ABST
Abstract
Description
A method for identifying the user center trajectory on a treadmill based on Kalman filtering Technical Field
[0001] This invention belongs to the field of ultrasonic measurement technology, specifically relating to a method for identifying the user center trajectory of a treadmill based on Kalman filtering. Background Technology
[0002] The treadmill user center trajectory refers to the path of a user's lateral position change relative to the center line of the running belt while running on a treadmill. Accurately identifying the user's center trajectory is crucial for obtaining user motion parameters and providing a better exercise experience during treadmill use. Ultrasonic sensors are widely used in treadmill user position detection systems due to their advantages such as non-contact measurement, low cost, and fast response. By installing an array of ultrasonic sensors above the running belt, the distance between the user and each sensor can be measured, thereby calculating the user's lateral position. Kalman filtering, as a classic state estimation method, can fuse model predictions and observation information, effectively suppressing measurement noise, and is therefore often used for sensor data processing and position estimation.
[0003] However, existing methods for user center trajectory recognition have several technical problems. Traditional weighted centroid algorithms typically use a simple inverse distance weighting method, failing to fully consider the spatial distribution characteristics of sensors and distance attenuation patterns, resulting in insufficient position estimation accuracy and difficulty in meeting the requirements of precise control. While fixed-parameter Kalman filtering can suppress measurement noise, its process noise covariance and observation noise covariance remain constant throughout the entire operation, making it unable to adapt to changes in measurement noise levels and user movement patterns in practical applications. When noise characteristics change or the movement state abruptly changes, the filtering performance will significantly degrade, and may even lead to filter failure. Existing methods generally lack mechanisms for detecting and processing abnormal observations. When sensors are interfered with and generate abnormal data, this erroneous data will directly participate in position calculation, seriously affecting the reliability of the recognition results. Therefore, designing a Kalman filtering-based user center trajectory recognition method for treadmills that solves the above problems is of great significance. Summary of the Invention
[0004] To address the problems existing in the background technology, this invention provides a method for recognizing the center trajectory of a treadmill user based on Kalman filtering, comprising the following steps:
[0005] S1: Ultrasonic sensor array data acquisition. An ultrasonic sensor array is installed above the treadmill belt to collect user position data.
[0006] S2: Calculation of position observations based on the weighted centroid method, calculating the user's lateral position observations based on the distance values measured by the ultrasonic sensor;
[0007] S3: Establishment of user position dynamic model, including second-order motion state equations and observation equations containing position and velocity;
[0008] S4: Adaptive noise covariance estimation, dynamically adjusting the observation noise covariance and process noise covariance based on the statistical characteristics of the innovation sequence;
[0009] S5: Kalman filter state estimation, which uses a Kalman filter prediction and update framework to estimate the user's position and velocity in real time.
[0010] Furthermore, the specific steps for data acquisition from the S1 ultrasonic sensor array include:
[0011] S11: Install evenly along the width of the running belt One ultrasonic ranging sensor, among which ;
[0012] S12: Each ultrasonic sensor emits ultrasonic pulses and receives reflected waves to measure the distance to the user;
[0013] S13: Perform data acquisition to obtain each sampling time. hour Distance measurements from each sensor , , , .
[0014] Furthermore, the specific steps of S2 include:
[0015] S21: Sampling time of Each distance measurement value is validated to ensure its validity, and those exceeding the valid measurement range are discarded. Data points;
[0016] S22: Calculate user lateral position observations using an improved weighted centroid algorithm. The formula is:
[0017] ;
[0018] in For a moment Location observation (m); For the first The weight of each sensor; For the first The lateral coordinate position (m) of each sensor; This represents the total number of sensors; This is the summation operator;
[0019] S23: The weight The calculation is performed using the inverse distance weighted method, and the formula is as follows: ;
[0020] in For the first The weight of each sensor; It is an exponential function; This is the distance attenuation coefficient, with a value ranging from 0.5 to 2.0; For the first Each sensor at time The measured distance value (m); This is the distance weighting index, with a value ranging from 1.5 to 2.5; It represents the power exponent.
[0021] Furthermore, the specific steps of S3 include:
[0022] S31: Define the state vector ,in The user's horizontal position (m); Transverse velocity (m / s); superscript Indicates transpose;
[0023] S32: Establish the state transition equation ;in For a moment The state vector; This is the state transition matrix; For a moment The state vector; It is process noise, and follows a zero-mean Gaussian distribution; This is the matrix multiplication operator;
[0024] S33: The state transition matrix for A matrix, represented as: ;
[0025] in The sampling period (s) is equal to , The sampling frequency in step S1; the element in the first row and first column of the matrix is 1, and the element in the first row and second column is... The element in the second row and first column is 0, and the element in the second row and second column is 1;
[0026] S34: Establish the observation equation ;in For a moment The observed values, i.e., the position observation values calculated in step S2. ; For the observation matrix, ; To observe the noise, it follows a zero-mean Gaussian distribution;
[0027] S35: Define the process noise covariance matrix and observation noise covariance It is used to characterize model uncertainty and measurement error; the Initialize to ,in Represents a diagonal matrix; Variance of position process noise; Let V be the variance of the velocity process noise.
[0028] Furthermore, the specific steps of the S4 adaptive noise covariance estimation include:
[0029] S41: Calculate the innovation sequence ;in For a moment The new information (m); These are the observed values; The observation matrix; For a moment State prediction value;
[0030] S42: Calculate the theoretical value of the new information covariance. ;in The theoretical value of the new information covariance (m) ); For a moment The state prediction covariance matrix; Observation matrix transpose; To observe the noise covariance;
[0031] S43: Estimate the actual value of the innovation covariance using the sliding window method, window length... Take 10 to 20 sampling points, the formula is: ;
[0032] in The actual estimate of the new information covariance (m) ); The length of the sliding window; For the time index within the window; For a moment The new information;
[0033] S44: Adaptive update of observation noise covariance using exponential smoothing method. ;in The updated observation noise covariance (m ); This is the forgetting factor, with a value range of 0.90 to 0.98; The observation noise covariance of the previous time step; when season ,in This is the lower limit value;
[0034] S45: Calculate the residual sequence ;in The residual vector is the state estimation vector; For a moment State estimates; For a moment State prediction value;
[0035] S46: Adaptive adjustment of process noise covariance ;in This is the updated process noise covariance matrix; The reference process noise covariance matrix defined in step S35; For adjustment coefficients; This is a function to find the maximum value. The magnitude of the residual change ; This is the threshold for residual change.
[0036] Furthermore, the specific steps of the S5 Kalman filter state estimation include:
[0037] S51: Perform state prediction ;in For a moment State prediction value; This is the state transition matrix; For a moment The optimal state estimate;
[0038] S52: Perform covariance prediction ;in For a moment The predicted covariance matrix; For a moment The estimated covariance matrix; State transition matrix transpose; The process noise covariance matrix is adaptively adjusted in step S4;
[0039] S53: Calculate the Kalman gain: ;
[0040] in For a moment The Kalman gain matrix; This is the transpose of the observation matrix; This refers to the adaptively updated observation noise covariance in step S4; superscript This represents the matrix inversion operation;
[0041] S54: Perform a state update ;in For a moment The optimal state estimate; This refers to the new information calculated in step S4;
[0042] S55: Perform covariance update ;in For a moment The estimated covariance matrix; It is the identity matrix;
[0043] S56: From state estimates Extracting location estimates and speed estimates ,in This is the filtered estimate of the user's lateral position (m). This is an estimate of the lateral velocity (m / s); and These represent the first and second components of the state vector, respectively.
[0044] Furthermore, the lateral coordinate position of the sensor in S11 The sensors are evenly distributed along the width of the running belt, with a spacing of [missing information]. ;in The width of the running belt (m); The total number of sensors; with the center of the running belt as the origin; when and At that time, the lateral coordinates of the five sensors were respectively , , , , .
[0045] Furthermore, a filter initialization step is included before step S5:
[0046] Before use The state vector is initialized by the average of the observations. ,in:
[0047] ;
[0048] This is the initial state vector; For the front The average value (m) of the observations; This represents the initial number of observations, ranging from 5 to 10. For the first One observation value; Observation index; initial covariance matrix Set as a diagonal matrix ,in ; .
[0049] Furthermore, an abnormal observation detection step is included before the S54 state update step:
[0050] Calculate the theoretical value of the new information covariance ;in The theoretical value of the new information covariance (m) ); The observation matrix; For a moment The state prediction covariance matrix; This is the transpose of the observation matrix; To observe the noise covariance; when the absolute value of the innovation... More than 3 times the theoretical standard deviation, i.e. When the time is right, it is determined to be an abnormal observation; among which This refers to the new information calculated in step S4; This is the square root operator; at this point, the Kalman gain is reduced to... ,in The original Kalman gain calculated in step S53 is then used to execute step S54.
[0051] Furthermore, step S2 also includes a sensor fault handling step:
[0052] When a sensor continuously If no valid data is obtained in a given cycle, the sensor is marked as faulty. ; Remove faulty sensors from the position observation calculation in step S2, recalculate the weights using the remaining normal sensors, and normalize them; the normalization formula is: ;
[0053] in For the first The normalized weights of a normal sensor; For the first The original weights of a normal sensor; For the first The original weights of a normal sensor; This represents the summation over all normal sensors.
[0054] The beneficial effects achieved by this invention are as follows:
[0055] This invention designs an adaptive noise covariance estimation mechanism based on innovation sequences, enabling the filter to dynamically adapt to the time-varying characteristics of measurement noise. Traditional fixed-parameter Kalman filtering methods cannot adjust in a timely manner when measurement noise levels change, leading to decreased filtering performance or even divergence. This invention uses a sliding window method to estimate the actual value of the innovation covariance and dynamically updates the observation noise covariance using exponential smoothing, allowing the filter to automatically identify the current measurement uncertainty level. This adaptive mechanism automatically reduces dependence on observations when measurement noise increases and restores normal fusion weights when noise levels are normal, thus maintaining stable filtering performance under various noise environments and significantly enhancing the system's robustness.
[0056] This invention designs an improved weighted centroid algorithm to enhance the accuracy of location observation. Compared to the traditional inverse distance weighting method, this invention introduces a combined calculation method of exponential decay term and power weights, allowing closer sensors to receive higher weights while reasonably suppressing the contributions of distant sensors. The improved weight allocation strategy fully utilizes the spatial distribution information of multiple sensors, effectively reducing the impact of individual sensor measurement errors on the overall positioning results and significantly improving the accuracy of user lateral position recognition. The algorithm's parameters are highly adjustable and can be optimized according to different sensor configurations and application scenarios.
[0057] This invention achieves rapid response to changes in user motion patterns through an adaptive adjustment mechanism based on the process noise covariance of the residual sequence. When a user's motion state changes, the deviation between the model prediction and the actual state increases, manifesting as a significant change in the residual sequence. This invention monitors the change in residuals and compares it with a threshold, automatically increasing the process noise covariance when a change in motion pattern is detected. This reduces the dependence on model predictions and enhances the responsiveness to new observations. This adaptive adjustment mechanism enables the filter to quickly track changes in the user's motion trajectory, avoiding the lag phenomenon of traditional fixed-parameter methods when motion patterns change abruptly, and improving the real-time performance and accuracy of trajectory recognition. Attached Figure Description
[0058] Figure 1 is a trajectory tracking effect diagram of Example 1. Sub-figure (a) is a trajectory comparison diagram of the whole time period, including the real trajectory, the original observation value and the filtered trajectory. Sub-figure (b) is a local magnified view of 30-40s.
[0059] Figure 2 is a bar chart comparing the position estimation errors of Example 1 with those of Comparative Examples 1, 2, and 3, including two indicators: RMSE and MAE.
[0060] Figure 3 is a diagram of the adaptive noise covariance adjustment process in Example 1, where subplot (a) is the curve of the observed noise covariance R(k) changing over time, and subplot (b) is the curve of the process noise covariance Q. 11 (k) Curve showing the change over time.
[0061] Figure 4 is a dual-axis curve comparing the performance of Example 1, Example 2, and different sensor configurations with N=4, 6, and 7. The left axis represents RMSE, and the right axis represents computation time.
[0062] Figure 5 is a robustness comparison curve between Example 1 and Comparative Example 2 under different measurement noise levels.
[0063] Figure 6 is a speed estimation accuracy verification diagram of Example 1, where sub-figure (a) is a speed estimation time series diagram, including the actual speed and the estimated speed, and sub-figure (b) is a speed estimation error time series diagram.
[0064] Figure 7 is a flowchart of the treadmill user center trajectory recognition method based on Kalman filtering according to the present invention. Detailed Implementation
[0065] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings. In addition, the forms of the various structures described in the following embodiments are merely illustrative. The present invention is not limited to the structures described in the following embodiments. All other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0066] This invention provides a method for identifying the center trajectory of a treadmill user based on Kalman filtering. It uses an ultrasonic sensor array to collect user position data in real time and combines this data with an improved adaptive Kalman filter algorithm to perform optimal estimation, thereby accurately identifying the user's position and movement trajectory on the running belt. Referring to Figure 7, the specific implementation steps are as follows:
[0067] S1: Ultrasonic Sensor Array Data Acquisition Step. This step involves strategically placing an ultrasonic sensor array above the treadmill belt to acquire the user's location information in real time using the principle of ultrasonic ranging. Ultrasonic ranging technology is a non-contact measurement method. Its basic principle is based on the fact that the speed of ultrasonic waves in air is a known constant; distance is calculated by measuring the time difference between the emission and reception of the reflected ultrasonic wave. This technology has advantages such as low cost, strong anti-interference ability, and immunity to ambient light, making it very suitable for treadmill applications.
[0068] S11: The spatial arrangement of the ultrasonic sensor array is fundamental to the entire system. It should be installed evenly along the width of the running belt. There are 1 ultrasonic ranging sensor, and the number of sensors is... There should be at least three. The choice of the number of sensors requires a trade-off between positioning accuracy and system cost; more sensors generally result in higher positioning accuracy, but also increase the cost. Typically, A value of 3 to 7 is sufficient for most application needs. Sensor installation height. The installation height is set between 1.0 and 1.5 meters. This height range is chosen based on the following considerations: too low an installation height may cause the sensor to detect the running belt surface instead of the user's legs, while too high an installation height will result in an excessively large measurement angle, reducing measurement accuracy. The optimal installation height should be determined based on the average height and running posture of the target user. For most adults, an installation height of 1.2 meters can reliably detect the user's calves or thighs.
[0069] S12: Each ultrasonic sensor operates on the principle of ultrasonic time-of-flight ranging. The sensor emits ultrasonic pulses at a frequency of 40kHz. 40kHz ultrasound has minimal attenuation when propagating through air, and the receiver filter design is relatively simple. The ultrasonic pulse is reflected after encountering the user's leg, and the sensor receives the reflected echo. By measuring the time difference between transmission and reception... According to the distance calculation formula The distance between the sensor and the user's leg was calculated. ;in The speed of sound in air is approximately 343 m / s. Dividing by 2 is based on the fact that the sound travels back and forth, and the actual distance is half of the propagation path. This ranging method is simple and reliable in principle, and its measurement accuracy can reach the millimeter level, which can meet the accuracy requirements of position identification.
[0070] S13: Data Acquisition Frequency The sampling frequency is set within the range of 20Hz to 50Hz. The choice of sampling frequency needs to strike a balance between system real-time performance and computational load. Too low a frequency will result in untimely position updates and inability to capture rapid user movement, while too high a frequency will increase data processing burden and system power consumption. Considering that the frequency of lateral swaying during human running is typically in the range of 0.5Hz to 2Hz, according to the Nyquist sampling theorem, the sampling frequency should be at least twice the highest frequency of the signal; therefore, a sampling frequency of 20Hz is theoretically sufficient. In practical applications, a sampling frequency of 30Hz to 40Hz can maintain a lower computational load while ensuring tracking accuracy. At each sampling time... The system also records The distance measurements from each sensor are denoted as follows: , , , These measurements form the raw data for subsequent location calculations.
[0071] S2: Position Calculation Steps Based on the Weighted Centroid Method. The core of this step is to fuse distance measurements from multiple sensors into a single position estimate, providing the observation input for Kalman filtering. The weighted centroid method is a classic multi-sensor data fusion algorithm. Its basic idea is to assign different weights to the measurements of each sensor based on their reliability; sensors closer to the ground have more reliable measurements and should receive higher weights.
[0072] S21: Data validity testing is a crucial step in data preprocessing. (Regarding the sampling time...) of Each distance measurement value is checked individually, and data points that exceed the effective measurement range are discarded. The lower limit of the effective measurement range is determined. The setting is 0.3m because ultrasonic sensors are prone to blind spots when measuring at close range, which may lead to inaccurate measurements. Upper limit. Setting the measurement range to 2.0m is recommended. Measurements outside this range typically indicate that the sensor has either failed to detect the user or detected other parts of the treadmill. By setting the measurement range, obvious erroneous data can be effectively filtered out, preventing it from adversely affecting subsequent position calculations.
[0073] S22: An improved weighted centroid algorithm for calculating user lateral position observations. The core formula of this algorithm is:
[0074] ;
[0075] in For a moment The location observations are in meters. For the first Each sensor at time The weights are dimensionless. For the first The lateral coordinates of each sensor, in meters; This represents the total number of sensors; The summation operator represents summation from 1 to... The summation is performed across all sensors. The physical meaning of this formula is that it calculates a weighted average of the position coordinates of each sensor according to its weight; the sensor with the larger weight contributes more to the final position estimate. This weighted averaging method utilizes measurement information better than a simple arithmetic average, thus improving the accuracy of position estimation.
[0076] S23: Weight The calculation employs a modified distance-inverse weighted method. The calculation formula is:
[0077] ;
[0078] in For the first The weights of each sensor are dimensionless. It is an exponential function, that is, the base of the natural logarithm. The power function; This is the distance attenuation coefficient, ranging from 0.5 to 2.0, which controls the rate of exponential decay. For the first Each sensor at time The measured distance is in meters. The distance-weighted exponent, ranging from 1.5 to 2.5, controls the rate at which the weight decays with distance; the power exponent represents the percentage of weight decreases. of The power of this weighting function is based on the theoretical principle that ultrasonic measurement errors increase with distance; therefore, sensors closer to the user have more reliable measurements and should receive a higher weight. The exponential term in the formula... To further reduce the weight of long-range sensors, the power term This method causes the weights to decay rapidly with distance. Compared to the traditional simple inverse distance weighting, this improved method can more effectively suppress the influence of measurement noise from long-range sensors. In practical applications, The preferred value is 1.0. The preferred value is 2.0. At this value, the weighting function can effectively distinguish the reliability of different distance sensors without making the weight distribution too concentrated.
[0079] S3: User Position Dynamic Model Establishment Steps. The purpose of this step is to establish a mathematical model describing the user's motion patterns, providing state transition equations and observation equations for the Kalman filter. The dynamic model is the core of the Kalman filter algorithm; a reasonable model can fully utilize motion continuity information, improving the accuracy and stability of state estimation.
[0080] S31: Define a second-order state vector containing position and velocity. The state vector is represented as:
[0081] ;
[0082] in For a moment The state vector is a two-dimensional column vector; The horizontal position of the user is in meters; Horizontal velocity, in meters per second; superscript This represents the vector transpose operation, converting a row vector into a column vector. A second-order model was chosen instead of a simple first-order position model because velocity information reflects the user's movement trend, and utilizing the continuity of movement improves the accuracy of position prediction. For example, when a user is moving to the right, they are likely to continue moving to the right in the next moment; velocity information can capture this movement trend.
[0083] S32: Establish a state transition equation to describe the evolution of the state vector over time. The state transition equation is:
[0084] ;
[0085] in For a moment The state vector; Let be the state transition matrix, describing the state transition from... Time's up The pattern of time transition; For a moment The state vector; The process noise is a two-dimensional random vector that follows a zero-mean Gaussian distribution and is used to describe model uncertainty; matrix multiplication operator. This represents the multiplication of a matrix and a vector. The physical meaning of this equation is: the current state is transformed from the previous state through a deterministic transition matrix. It was obtained through evolution, but it contains certain random perturbations. The introduction of process noise is necessary because actual user movements are not entirely predictable and may include sudden acceleration, deceleration, or changes in direction.
[0086] S33: State transition matrix It is The matrix is derived based on the uniform motion model. Represented as:
[0087] ;
[0088] The element in the first row and first column of the matrix is 1, and the element in the first row and second column is... The element in the second row and first column is 0, and the element in the second row and second column is 1; The sampling period is in seconds, equal to , This refers to the sampling frequency set in step S1. The derivation of this matrix is based on the assumption of uniform motion: in a short time... Assuming the velocity remains constant, the change in position is the velocity multiplied by the time, i.e. The speed remains constant, that is Rewriting these two equations in matrix form yields the state transition equations. ,in For the above The matrix. This uniform motion model is a first-order approximation, suitable for situations with short sampling periods, and can well describe the lateral motion characteristics of the human body when running.
[0089] S34: Establish the observation equation to describe the relationship between the observed values and the state vector. The observation equation is:
[0090] ;
[0091] in For a moment The observed value, in this invention, is the position observation value calculated in step S2. The unit is meters; For the observation matrix, It is The row vector; It is a state vector; For observation noise, is a scalar that follows a zero-mean Gaussian distribution and is used to describe measurement error. This equation indicates that the position sensor can only observe the position component of the state vector. The velocity components cannot be directly observed. Therefore, the observation matrix The first element is 1, and the second element is 0. Observation noise. The introduction of this reflects the uncertainty in ultrasonic measurement, including measurement errors of the sensor itself, environmental noise, quantization errors, etc.
[0092] S35: Define the process noise covariance matrix and observation noise covariance This is used to quantify the magnitude of model uncertainty and measurement error. Process noise covariance matrix. Initialize to ;in This indicates a diagonal matrix operation, constructing a diagonal matrix by using the vectors within the parentheses as diagonal elements. Variance represents the positional process noise variance, in square meters; Variance of velocity process noise, in square meters per square second. Observation noise covariance. Initialize to The unit is square meters. The initial value of the covariance parameter can be determined based on the measurement accuracy in the sensor specifications, actual test data, or empirical values. and The relative size reflects the level of confidence in the model and measurement: A larger value indicates greater uncertainty in the model, and the filter relies more on the observations. A larger value indicates that the measurement is unreliable, and the filter relies more on model predictions. In traditional Kalman filtering, and Normally set to a fixed value, but this invention adjusts adaptively. and This enables the filter to adapt to different models and measurement characteristics under different operating conditions.
[0093] S4: Adaptive noise covariance estimation step. This step dynamically adjusts the observation noise covariance by analyzing the statistical properties of the innovation sequence in real time. Process noise covariance This enables the filter to adapt to changes in user motion patterns and fluctuations in sensor measurement accuracy. The innovation sequence is an important concept in Kalman filtering theory; its statistical properties reflect the filter's operating state and the rationality of its parameter settings.
[0094] S41: Calculate the innovation sequence. Innovation is defined as the difference between the observed value and the predicted value, and is calculated using the following formula:
[0095] ;
[0096] in For a moment The new information is in meters; These are the observed values; The observation matrix; For a moment State prediction value, hat symbol Vertical lines indicate estimated values. This indicates an estimation based on information prior to a certain point in time. Indicates based on Information about time and prior times Predicting the state at a given time; the minus sign indicates scalar or vector subtraction. The physical meaning of innovation is the deviation of the observed value from the model's prediction, reflecting the portion of the observed information that the model failed to explain. If the model is accurate and the noise parameters are set reasonably, the innovation sequence should exhibit zero-mean, white noise characteristics. By monitoring the statistical characteristics of the innovation sequence, it is possible to determine whether the filter is operating optimally.
[0097] S42: Calculate the theoretical value of the innovation covariance. According to Kalman filtering theory, the theoretical value of the innovation covariance can be calculated by the following formula:
[0098] ;
[0099] in This represents the theoretical value of the new information covariance, in square meters; The observation matrix; For a moment The state prediction covariance matrix is a The matrix reflects the uncertainty of state prediction; Observation matrix transpose; This is the observation noise covariance. The formula is derived from the error propagation law: prediction error... The covariance is The observation error is expressed through the observation matrix. Linear mapping to the observation space, then superimposed with independent observation noise. Therefore, the new information covariance is Theoretical covariance Based on the current noise parameter settings, the theoretical value should be close to the actual variance of the innovation if the parameter settings are accurate.
[0100] S43: The sliding window method is used to estimate the actual value of the new information covariance. This method utilizes the recent... The sample variance is calculated from the new information samples at each time point using the following formula:
[0101] ;
[0102] in This is the actual estimate of the new information covariance, in square meters; The value is the length of the sliding window, which is the number of samples involved in the calculation, ranging from 10 to 20 sampling points; For the time index within the window, from 0 to ; For a moment The new information; Transpose it; product In this invention, it is a scalar, equal to the square of the innovation; the summation symbol... Indicates the window Summing of each sample; dividing by The mean value, or sample variance, is obtained. The sliding window method is a commonly used variance estimation method in time series analysis. Its advantages include the ability to track the time-varying characteristics of variance while suppressing random fluctuations through averaging multiple samples. Window length. The choice requires a trade-off between tracking speed and estimation accuracy: Too small a value will lead to large fluctuations in variance estimation. If the value is too large, it will reduce the tracking speed of variance changes. Based on experience, The optimal value is 15, which ensures both estimation accuracy and timely reflection of variance changes.
[0103] S44: The observation noise covariance is adaptively updated using exponential smoothing. The update formula is:
[0104] ;
[0105] in The updated observation noise covariance is expressed in square meters. The forgetting factor is a constant between 0 and 1, with a value ranging from 0.90 to 0.98. The previous time step represents the observation noise covariance; the term within square brackets represents a new estimate of the observation noise covariance, obtained by subtracting the projection of the state prediction error onto the observation space from the actual innovation covariance. The derivation of this formula is based on the decomposition of the innovation covariance: according to the formula in step S42, Theoretical value Replace with actual estimated value That is, to obtain The new estimate. Exponential smoothing, by weighting historical values and the current new estimate, can track... Changes in this factor can suppress estimation errors. Forgetting factor The larger the value, the greater the weight of historical values, resulting in a smoother estimation result but a slower tracking speed; The smaller the value, the faster the response to new estimates, but the greater the fluctuation in the estimate. Preferred A value of 0.95 strikes a good balance between smoothness and tracking performance. To prevent numerical issues, when updated... Less than the minimum threshold At that time, Set as ,in As a lower limit value, to prevent The value becomes too small or negative, ensuring the numerical stability of the filtering algorithm.
[0106] S45: Calculate the residual sequence to evaluate the model fit. The residual is defined as the difference between the state estimate and the predicted value, and is calculated using the following formula:
[0107] ;
[0108] in The residual vector for state estimation is a two-dimensional vector. For a moment The optimal state estimate, based on including All information, including time-based observations; For a moment The state prediction value is based only on Information from the time point and prior. The residuals reflect the amount of correction made by the observations to the state estimate. If the observations are highly consistent with the model predictions, the residuals should be small; if there is a model mismatch, such as a sudden change in the user's movement pattern, the residuals will increase significantly. Monitoring changes in the residual sequence can help determine whether the model needs adjustment.
[0109] S46: Adaptive adjustment of process noise covariance. The adjustment formula is:
[0110] ;
[0111] in The updated process noise covariance matrix, in units of 1 and 2. same; The reference process noise covariance matrix defined in step S35; The adjustment coefficient, ranging from 5 to 15, controls the magnitude of the increase in noise during the control process. This is a function to find the maximum value. Let be the magnitude of the residual change, i.e., the Euclidean norm of the residual change vector; The change in residual is equal to ; This is the threshold for residual variation, ranging from 0.01 to 0.05; the multiplicative factor within the square brackets is always greater than or equal to 1. When the residual variation exceeds the threshold, this factor becomes greater than 1, making... Increase. The physical meaning of this adjustment strategy is: when the residual changes rapidly, it indicates that the user's motion pattern has changed, and the existing uniform motion model is no longer accurate. In this case, the process noise covariance should be increased. This reduces reliance on model predictions and increases dependence on observations, enabling filters to respond quickly to changes in motion patterns. For example, when a user suddenly moves laterally from running in a straight line, the residuals increase rapidly. Automatic scaling allows the filter to track new motion trajectories more quickly. This improves the filter's adaptability to changes in motion patterns. In practical applications, The preferred value is 10. The preferred value is 0.02, which allows for timely response to motion changes while maintaining the smoothness of the filter.
[0112] S5: Kalman Filter State Estimation Step. Using the standard Kalman filter prediction-update framework, combined with the noise covariance parameter adaptively estimated in step S4, real-time optimal estimation of the user's position and velocity is performed. Kalman filtering is a recursive optimal estimation algorithm proposed by the Hungarian mathematician Kalman in 1960 and has been widely applied in navigation, control, signal processing, and other fields. Its core idea is to use the system's dynamic model to predict the state, and then use observations to correct the prediction results to obtain the optimal estimate of the current state. Under the assumption of a linear Gaussian system, Kalman filtering is the optimal estimator in the sense of minimum mean square error.
[0113] S51: Perform state prediction. The prediction equation is:
[0114] ;
[0115] in For a moment The predicted state value is a two-dimensional column vector; This is the state transition matrix; For a moment Optimal state estimate; matrix multiplication express Multiplying a matrix by a two-dimensional column vector results in a two-dimensional column vector. This is based on the state transition equation. Ignore the process noise term with a mean of zero, and use The optimal estimate of time extrapolation yields Predicted value at time State prediction fully utilizes the dynamic characteristics and motion continuity of the system, even when... Even if the observed value at a given moment has not yet been reached, a prediction of the current state can still be given based on historical information.
[0116] S52: Perform covariance prediction. The covariance prediction equation is:
[0117] ;
[0118] in For a moment The prediction covariance matrix is a A symmetric matrix that describes the covariance of the state prediction error; This is the state transition matrix; For a moment The estimated covariance matrix; for transpose; This is the process noise covariance matrix for adaptive adjustment in step S4. The equation describes the propagation law of the prediction error covariance: [The equation is missing here, likely due to an incomplete sentence or a formatting error]. Covariance of estimation error at time Through the state transition matrix spread to At that moment, we received Then superimposed process noise covariance The total prediction error covariance is obtained. Covariance prediction not only reveals the uncertainty of state prediction, but also provides necessary information for subsequent gain calculation.
[0119] S53: Calculate the Kalman gain. The formula for calculating the gain is:
[0120] ;
[0121] in For a moment The Kalman gain matrix is a Column vector; To predict the covariance matrix; The transpose of the observation matrix is a Column vector; scalar within square brackets This is the theoretical value of the new information covariance in step S42; superscript This represents the operation of finding the reciprocal of a scalar; This is the observation noise covariance adaptively updated in step S4. The physical meaning of the Kalman gain is to determine how to utilize the information. To correct state predictions, a larger gain indicates greater confidence in the observations and a larger correction; conversely, a smaller gain indicates greater confidence in the model's predictions and a smaller correction. The formula's derivation is based on the criterion of minimizing the estimation error covariance, a core result of Kalman filtering theory. Gain Automatically balancing the reliability of model predictions and observations: when prediction uncertainty Larger or observational noise When the gain is small, the gain increases, relying more on observations; conversely, when the gain is large, the gain decreases, relying more on predictions. This adaptive trade-off mechanism enables the Kalman filter to achieve optimal estimation.
[0122] S54: Perform a state update. The update equation is:
[0123] ;
[0124] in For a moment The optimal state estimate is a fusion of... State estimation based on time-series observation information; This is the predicted state value; Kalman gain; The innovation calculated in step S4; the product of the Kalman gain and the innovation. Let $\frac{ ...
[0125] S55: Perform covariance update. The update equation is:
[0126] ;
[0127] in For a moment The estimated covariance matrix describes the covariance of the state estimation error; It is the identity matrix, which is A matrix where diagonal elements are 1s and off-diagonal elements are 0s; Kalman gain; The observation matrix; the matrix within square brackets. This is the gain correction matrix; To predict the covariance matrix. The covariance update equation describes the reduction in estimation uncertainty after introducing observation information: predicting the covariance. After applying the gain correction matrix, the updated estimated covariance is obtained. Due to gain Greater than zero, updated covariance Always less than or equal to the predicted covariance This means that observational information can always reduce the uncertainty of the estimation. The recursive update of the covariance ensures that the filtering algorithm can evaluate the estimation accuracy in real time.
[0128] S56: Extract position and velocity information from the state estimate. Position estimate Speed estimate ;in This is the filtered estimate of the user's lateral position, in meters. This is an estimate of the lateral velocity, in meters per second; the number in square brackets represents the extracted state vector. The corresponding components, This indicates the position of the first component. This represents the second component, velocity. At this point, a complete Kalman filter cycle has been completed, yielding the optimal estimates of the user's position and velocity at the current moment. These estimates exhibit higher accuracy and stability compared to the original observations, effectively suppressing the influence of measurement noise while utilizing the continuous nature of the user's motion. Position estimate. It can be used to determine the user's offset relative to the center of the running belt and to estimate the speed. It can be used to predict a user's movement trends.
[0129] Based on steps S1 to S5, in order to improve the robustness and practicality of the system, the present invention further includes the following auxiliary steps:
[0130] The proper arrangement of the sensor's lateral coordinates has a significant impact on the accuracy of position estimation. In step S11, The sensors are evenly distributed along the width of the running belt, with a spacing of [missing information]. ;in The width of the running belt is in meters. This represents the total number of sensors. Sensor coordinates are established with the center of the running belt as the origin, with negative coordinates on the left side and positive coordinates on the right. Even distribution ensures sensor coverage across the entire width of the running belt, avoiding blind spots. When the number of sensors... And the width of the running belt At that time, the sensor spacing is The horizontal coordinates of the five sensors are as follows: , , , , They are distributed within a 0.2m range on both sides of the center of the running belt, basically covering the area where users might appear.
[0131] Filter initialization is a necessary step during system startup. Before step S5, filter initialization is required to set the initial state and covariance. Initial state vector Before use The initialization formula for the average of the observations is as follows: ;in ; This is the initial state vector; For the front The average of the observations at each location, in meters; This represents the initial number of observations, ranging from 5 to 10. For the first One observation value; The observation numbers are from 1 to... ; Summation symbol Indicates to Sum of all observations; divide by Obtain the average value. Setting the initial velocity to 0 is a reasonable assumption, as users are typically stationary or moving slowly when the system starts. Initial covariance matrix. Set as a diagonal matrix ;in Let V be the initial position variance. Let be the initial velocity variance. The initial covariance reflects the uncertainty of the initial state estimate. A larger initial covariance implies insufficient confidence in the initial estimate, causing the filter to converge quickly to the true state; a smaller initial covariance assumes a more accurate initial estimate. Initializing by averaging multiple observations yields a more reliable initial state, accelerating the filter's convergence speed.
[0132] Outlier detection is an important measure to improve system robustness. An outlier detection step is added before the state update in step S54. First, the theoretical value of the new information covariance is calculated. The formula is the same as in step S42. Then, determine whether the absolute value of the new information exceeds three times the theoretical standard deviation, i.e., determine... ;in For new information; vertical lines indicate absolute value operations; This is the square root operator; The square root of this is the theoretical standard deviation of the innovation. This criterion is based on 3 Criterion: Under the assumption of normal distribution, a random variable falls within the mean. The probability of an observation being outside the range of one standard deviation is only 0.27%, therefore, observations outside this range are very likely outliers. When an observation is identified as an outlier, to avoid the outlier having an excessive impact on the state estimation, a strategy of reducing the Kalman gain is adopted, setting the gain to [value missing]. ;in The original Kalman gain is calculated in step S53. After reducing the gain, the influence of observations on state estimation is significantly weakened, and the state estimation is mainly maintained by model prediction, thereby avoiding estimation jumps caused by anomalous observations. The anomaly detection mechanism significantly improves the system's robustness to sudden noise and measurement errors.
[0133] Sensor fault handling is a necessary function to ensure the long-term stable operation of the system. In step S2, the position observation calculation includes a sensor fault detection and handling step. When a sensor continuously... When there is no valid data for a given period, meaning the number of times the measurement exceeds the valid measurement range reaches a certain threshold. The sensor was then marked as faulty; among which This ensures that accidental measurement failures are not mistaken for malfunctions. Faulty sensors are removed from subsequent calculations and no longer participate in the weighted centroid calculation. The weights of the remaining normal sensors need to be renormalized to ensure that the sum of the weights is 1. The normalization formula is as follows: ;in For the first The normalized weights of a normal sensor are dimensionless. For the first The original weights of each normal sensor are calculated according to step S23; For the first The original weights of a normal sensor; summation symbol This represents the summation over all normal sensors. After normalization, the weights of normal sensors are increased accordingly to compensate for the absence of faulty sensors, ensuring the accuracy of position estimation. The sensor failure handling mechanism allows the system to continue operating normally even with partial sensor failure, improving system reliability and fault tolerance.
[0134] Through the synergistic effect of the above steps, this invention achieves accurate identification of the user's position and movement trajectory on a treadmill. The improved weighted centroid algorithm fully utilizes multi-sensor information, improving the accuracy of position observation; adaptive noise covariance estimation enables the filter to adapt to different operating conditions; the Kalman filter framework effectively fuses model prediction and observation information to obtain optimal state estimation; and anomaly detection and fault handling mechanisms enhance the system's robustness.
[0135] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Those skilled in the art, inspired by the technical solution of the present invention, can make various modifications and variations. For example, the number of sensors... The sampling frequency can be adjusted according to the belt width and accuracy requirements; The settings can be configured according to processor performance and real-time requirements; the specific form of the weighting function can be optimized based on sensor characteristics; the state model can be extended to a third-order model that includes acceleration; and the specific parameters of the adaptive algorithm can be tuned based on actual test data.
[0136] Example 1: This example uses standard configuration parameters to apply the method of this invention on a home treadmill. Running belt width... To measure the distance to the treadmill belt, install five HC-SR04 ultrasonic ranging sensors above the belt, proceeding to step S1. The five sensors are evenly distributed along the width of the belt, with lateral coordinates of -0.2m, -0.1m, 0m, 0.1m, and 0.2m, respectively, proceeding to step S11. The sensors operate at a frequency of 40kHz, with a measurement range of 0.02m to 4m, proceeding to step S12. Data acquisition frequency... Set to 30Hz, sampling period If the value is 0.0333s, proceed to step S13. For each sampling time... The validity of the five distance measurements was verified, and the effective measurement range was determined. 0.3m The value is 2.0m, so proceed to step S21. The improved weighted centroid algorithm is used to calculate the position observations, with weighting parameters... Values 1.0, Set the value to 2.0 and execute steps S22 and S23. Establish a second-order motion state model, where the state vector includes position and velocity. The state transition matrix is constructed based on the uniform motion model, and the process noise covariance is initialized to... The observation noise covariance is initialized to Execute steps S31 to S35. Adaptive noise covariance estimation based on the innovation sequence is used, with a sliding window length of... The value is 15, representing the forgetting factor. The value is 0.95, which is the threshold for residual variation. The value is 0.02, which is the adjustment coefficient. Set the value to 10 and execute steps S41 to S46. Use Kalman filtering for state estimation and execute steps S51 to S56. During filter initialization, utilize the previous... The average of the observations is used to set the initial state, and the initial covariance is... 0.01 The value is 0.001. Anomaly detection uses... The criterion is to reduce the Kalman gain to 0.1 times its original value when the absolute value of the innovation exceeds 3 times the theoretical standard deviation. Sensor fault detection threshold. Set to 5 cycles.
[0137] Example 2: This example uses a smaller number of sensors to reduce system cost. Number of sensors Set to 3, installation height The distance is 1.2m, so proceed to step S11. The lateral coordinates of the three sensors are -0.2m, 0m, and 0.2m, respectively. Data acquisition frequency. To set the frequency to 30Hz, proceed to step S13. Weighting parameters. Values 1.0, Set the value to 2.0 and execute steps S22 and S23. Adaptive noise estimation parameters. For 15, 0.95 0.02 If the value is 10, proceed with steps S41 to S46. Other parameters and steps are the same as in Example 1.
[0138] Example 3: This example uses a high sampling frequency to improve system response speed. Data acquisition frequency. Set to 50Hz, sampling period If the time is 0.02s, proceed to step S13. Number of sensors. There are 5, installation height The value is 1.2m, proceed to step S11. Weighting parameters Values 1.0, Set the value to 2.0 and execute steps S22 and S23. Adaptive noise estimation parameters. For 15, 0.95 0.02 If the value is 10, proceed with steps S41 to S46. Other parameters and steps are the same as in Example 1.
[0139] Example 4: This example uses different combinations of weighting parameters. Number of sensors There are 5, installation height The distance is 1.2m, and the data acquisition frequency is... For a frequency of 30Hz, execute steps S11 and S13. Weighting parameters. Values 0.5 Set the value to 1.5 and execute steps S22 and S23. Adaptive noise estimation parameters. For 15, 0.95 0.02 If the value is 10, proceed with steps S41 to S46. Other parameters and steps are the same as in Example 1.
[0140] Comparative Example 1 uses the traditional weighted centroid method without Kalman filtering. The sensor configuration is the same as in Example 1, but the number of sensors is different. There are 5, installation height The distance is 1.2m, and the data acquisition frequency is... For a frequency of 30Hz, proceed to step S1. Calculate the position using a simple distance-inverse weighted method; the weighting formula is as follows: It does not use exponential decay terms or power terms. The location observations are output directly as the final result without filtering.
[0141] Comparative Example 2 uses a traditional Kalman filter method with fixed parameters. The sensor configuration is the same as in Example 1, but the number of sensors is... There are 5, installation height The distance is 1.2m, and the data acquisition frequency is... For a frequency of 30Hz, proceed to step S1. Weighting parameters. Values 1.0, Set the value to 2.0 and execute steps S22 and S23. Establish a second-order motion state model and process noise covariance. Fixed as Observation noise covariance The value is fixed at 0.0004 and remains unchanged throughout the entire operation; no adaptive adjustment is performed. Standard Kalman filtering is used for state estimation, and steps S51 to S56 are executed, but the adaptive noise covariance estimation in steps S41 to S46 is not performed.
[0142] Comparative Example 3 uses a simple moving average filtering method. The sensor configuration is the same as in Example 1, but the number of sensors is... There are 5, installation height The distance is 1.2m, and the data acquisition frequency is... For a frequency of 30Hz, proceed to step S1. Calculate the location observations using a simple distance-inverse weighted method. The weighting formula is as follows: A 5-point moving average filter is applied to the location observations, meaning the filtered output at the current time is the arithmetic mean of the last 5 observations. The formula is as follows: .
[0143] Experiment Example 1: This experiment uses simulation to verify the feasibility and filtering effect of the method of the present invention. The experiment adopts the method of Example 1.
[0144] Experimental Methods: A simulation model was established to generate the user's actual motion trajectory. The simulation duration was 120 seconds, the sampling frequency was 30 Hz, and a total of 3600 data points were collected. The user's initial position was 0m. For the first 30 seconds, the user randomly wandered near the center of the running belt, with a standard deviation of 0.02m. From 30 to 60 seconds, the user shifted to the right at a constant speed of 0.03m / s. From 60 to 90 seconds, the user shifted to the left at a constant speed of -0.04m / s. From 90 to 120 seconds, the user gradually returned to the center, with a speed of 0.02m / s. Zero-mean Gaussian measurement noise was superimposed on the actual trajectory, with a standard deviation of... The position observation value was obtained by simulating the sensor measurement error with a value of 0.02m. Kalman filtering was then performed according to the method in Example 1.
[0145] The experimental results are shown in Figure 1. Figure 1(a) shows the time series of the user's location over 120 seconds, including three curves: the actual trajectory, the original observation, and the filtered trajectory. Figure 1(b) is a magnified view from 30 to 40 seconds, clearly demonstrating the filtering effect.
[0146] As shown in Figure 1(a), the original observations fluctuated around the true trajectory with a large amplitude, and the maximum deviation reached ±60mm. The filtered trajectory was significantly smoother, closely tracking the true trajectory, and responding quickly at the 30s, 60s, and 90s intervals when the motion pattern changed. A magnified view in Figure 1(b) shows that the original observations contained significant high-frequency noise, with instantaneous deviations reaching 30mm to 40mm. The filtered trajectory effectively suppressed the noise, and the deviation from the true trajectory was controlled within 10mm.
[0147] This experimental example demonstrates the successful implementation of the method of this invention, enabling real-time estimation of the user's position on a treadmill in a simulation environment. The filtering algorithm effectively suppresses measurement noise, improves position recognition accuracy, and verifies the feasibility of the method. The rapid response capability of the filtering algorithm at moments of abrupt changes in motion mode is attributed to the adaptive noise covariance adjustment mechanism: when the user's motion mode changes, the residual sequence changes more, and the process noise covariance... It automatically increases the reliance on model predictions, increases the response to observations, and thus achieves rapid tracking.
[0148] Experimental Example 2: This experimental example compares the position estimation errors of different methods to verify the superiority of the method of the present invention. The experiment uses the methods of Example 1, Comparative Example 1, Comparative Example 2, and Comparative Example 3.
[0149] Experimental Method: The same simulation environment and real trajectory as in Experiment Example 1 were used. The noise standard deviation was measured. The value was set to 20mm. Position estimation was performed using the adaptive Kalman filtering method of Example 1, the traditional weighted centroid method of Comparative Example 1, the fixed-parameter Kalman filtering of Comparative Example 2, and the moving average filtering method of Comparative Example 3, respectively. The root mean square error (RMSE) and mean absolute error (MAE) of each method were calculated using the following formulas: , ;in For estimates, For the true value, For the sample size, This is for square root operations.
[0150] The experimental results are shown in Figure 2. Figure 2 is a bar chart comparing the position estimation errors of different methods. The vertical axis represents the error value in mm, and the horizontal axis represents different methods, including two indicators: RMSE and MAE. The bar chart is presented in a grouped format.
[0151] As shown in Figure 2, the RMSE and MAE of Example 1 are significantly lower than those of the comparative examples. Compared to Comparative Example 1, Example 1 shows a 69.5% reduction in RMSE and a 70.7% reduction in MAE, demonstrating that Kalman filtering has a significant advantage over directly outputting observations. Compared to Comparative Example 3, Example 1 shows a 63.9% reduction in RMSE and a 65.1% reduction in MAE, demonstrating that Kalman filtering using a motion model outperforms simple moving averages. Compared to Comparative Example 2, Example 1 shows a 40.4% reduction in RMSE and a 40.9% reduction in MAE, demonstrating that adaptive noise covariance estimation significantly improves upon fixed parameters.
[0152] The improved weighted centroid algorithm and Kalman filter framework significantly enhance position estimation accuracy. The adaptive noise covariance estimation method enables the filter to adapt to different operating conditions, reducing the error by approximately 40% compared to the fixed-parameter method, thus validating the effectiveness of the adaptive mechanism. The fixed-parameter method cannot adjust when noise characteristics change or motion patterns alter, leading to a suboptimal filter state; while the adaptive method dynamically adjusts the filter by real-time monitoring of the innovation and residual sequences. and This ensures that the filter always remains in an optimal or near-optimal state.
[0153] Experiment Example 3: This experiment demonstrates the adaptive noise covariance adjustment process and verifies the working principle of the adaptive mechanism. The experiment uses the method of Example 1.
[0154] Experimental Method: The same simulation environment as in Experiment 1 was used. During the 60-70 second period, the standard deviation of the measurement noise was artificially increased to 0.04 m to simulate sensor interference; during other periods, the standard deviation of the noise was kept at 0.02 m. The observed noise covariance was recorded throughout the process. Process noise covariance diagonal elements The changes.
[0155] The experimental results are shown in Figure 3. Figure 3 illustrates the adaptive noise covariance adjustment process, comprising two subplots. Figure 3(a) shows the observation noise covariance. Time series curve, with the vertical axis as Value, unit is m 2 The horizontal axis represents time, in seconds. Figure 3(b) shows the process noise covariance. Time series curve, with the vertical axis as Value, unit is m 2 The horizontal axis represents time.
[0156] As can be seen from Figure 3(a), It can track and measure changes in noise. During periods of normal noise levels, Maintain stability; when measurement noise increases, Automatic rise; after the noise subsides, The noise level gradually decreased. This demonstrates that the adaptive estimation method based on the innovation sequence can effectively identify changes in the measurement noise level. As can be seen from Figure 3(b), The residual value automatically increases when the motion pattern changes. At 30 seconds, when the user begins to move to the right at a constant speed, at 60 seconds, they switch to moving to the left, and at 90 seconds, they begin to return to the center. If the residual change exceeds the threshold at these times, a trigger is activated. Increase the filter's ability to adapt to new motion patterns.
[0157] This experimental example demonstrates the effectiveness of the adaptive noise covariance estimation mechanism. The adaptive adjustment enables the filter to adapt to the time-varying characteristics of the measurement noise. The adaptive adjustment enables the filter to respond quickly to changes in motion patterns. These two adaptive mechanisms work together to ensure the filter maintains good performance under different operating conditions. The actual value of the information covariance reflects the current measurement uncertainty, and the change in residuals reflects the model fit. By monitoring these two quantities and adjusting accordingly... and This enables online optimization of filter parameters.
[0158] Experiment Example 4: This experiment compares the impact of different numbers of sensors on position estimation performance, providing a basis for sensor configuration. The experiment uses the methods of Examples 1 and 2, and configurations with 4, 6, and 7 sensors N.
[0159] Experimental Method: The same simulation environment and real trajectory as in Experiment 1 were used. Position estimation performance was tested when N was 3, 4, 5, 6, and 7. The experimental results are shown in Figure 4. Figure 4 compares the performance with different numbers of sensors, including two vertical axes. The left vertical axis represents RMSE in mm, and the right vertical axis represents the average computation time in ms. The horizontal axis represents the number of sensors N. The figure includes the RMSE curve (solid line with square markers) and the computation time curve (dashed line with circular markers).
[0160] As shown in Figure 4, RMSE decreases with increasing number of sensors, but the rate of decrease gradually diminishes. arrive RMSE decreased by 30.4%; from arrive The RMSE only decreased by 16.1%, indicating limited accuracy improvement after the number of sensors exceeded five. The computation time increased linearly with the number of sensors. The time increased from 0.8ms to The sampling time is 1.8ms, but both are much smaller than the sampling period of 33.3ms, which meets the real-time requirements.
[0161] This experimental example provides a quantitative basis for sensor configuration. Increasing the number of sensors can improve positioning accuracy, but the marginal effect diminishes. Considering both accuracy and cost, This is a better choice, controlling costs while ensuring good accuracy. Increasing the number of sensors provides more spatial information, and the weighted centroid algorithm can more accurately locate the user's position; however, when the number of sensors is large enough, the marginal information provided by the newly added sensors decreases, and the improvement in accuracy is limited.
[0162] Experiment Example 5: This experiment tests the robustness of the method of the present invention under different noise levels and verifies the adaptability of the adaptive algorithm. The experiment adopts the methods of Example 1 and Comparative Example 2.
[0163] Experimental Method: The same simulation environment and real trajectory as in Experiment Example 1 were used. The noise standard deviation was measured. The noise level was increased from 10mm to 40mm in 5mm increments, for a total of 7 noise levels. The adaptive Kalman filter of Example 1 and the fixed-parameter Kalman filter of Comparative Example 2 were used for position estimation. The RMSE at each noise level was calculated.
[0164] The experimental results are shown in Figure 5. Figure 5 is a robustness comparison curve under different noise levels. The vertical axis represents RMSE (in mm), and the horizontal axis represents the standard deviation of the measured noise. The unit is mm. The figure includes the curve of Example 1 (solid line with circular marker) and the curve of Comparative Example 2 (dashed line with square marker).
[0165] As shown in Figure 5, the RMSE of both methods increases with increasing noise level, but the growth rate of Example 1 is significantly lower than that of Comparative Example 2. The RMSE of Example 1 increased from 6.1 mm to 15.8 mm, an increase of 159%; the RMSE of Comparative Example 2 increased from 8.3 mm to 33.1 mm, an increase of 299%. At low noise levels (… At mm), Example 1 had a 26.5% lower RMSE than Comparative Example 2; at high noise levels ( When the RMSE of Example 1 was 52.3% lower than that of Comparative Example 2 (mm), the advantage was obvious.
[0166] This experimental example demonstrates the robustness of the method of the present invention. Adaptive noise covariance estimation enables the filter to adapt to different measurement noise levels and automatically adjust as noise increases. To maintain filtering performance. The fixed-parameter method, due to... A fixed value cannot adapt to changes in noise, and its performance degrades more rapidly. When measurement noise increases, the actual value of the information covariance increases; the adaptive algorithm detects this change and increases accordingly. This reduces reliance on observations and increases dependence on model predictions, thereby suppressing the impact of noise; while the fixed parameter method If the value is too small, it leads to over-reliance on unreliable observations, resulting in increased error.
[0167] Experiment Example 6: This experiment verifies the accuracy of the method of the present invention in estimating the user's lateral velocity, demonstrating the advantages of the second-order model. The experiment uses the method of Example 1.
[0168] Experimental Method: The same simulation environment and real trajectory as in Experiment Example 1 were used. The actual velocities were: random walk from 0s to 30s, with an average velocity close to 0; 0.03 m / s from 30s to 60s; -0.04 m / s from 60s to 90s; and gradually decreasing to 0 from 90s to 120s. The lateral velocity was estimated using the method in Example 1. The RMSE of the velocity estimate was calculated.
[0169] The experimental results are shown in Figure 6. Figure 6 verifies the accuracy of velocity estimation, containing two sub-figures. Figure 6(a) shows the velocity estimation time series curve, with the vertical axis representing lateral velocity in m / s and the horizontal axis representing time in s, including the actual velocity curve (solid line) and the estimated velocity curve (dashed line with circular markers). Figure 6(b) shows the velocity estimation error time series curve, with the vertical axis representing velocity error in m / s and the horizontal axis representing time. This experimental example demonstrates that the method of this invention can accurately estimate the user's lateral velocity. The second-order state model estimates not only position but also velocity simultaneously, and velocity information is of great significance for predicting user movement trends and providing early warnings. Kalman filtering infers the velocity state by observing changes in position and combining it with the motion model; the adaptive mechanism automatically adjusts at the moment of velocity change. This allows the filter to quickly track new velocity states. Velocity estimation accuracy is affected by the sampling frequency; a higher sampling frequency provides more accurate velocity information.
[0170] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for recognizing the user center trajectory on a treadmill based on Kalman filtering, characterized in that, Includes the following steps: S1: Data acquisition using an ultrasonic sensor array. An ultrasonic sensor array is installed above the treadmill belt to collect user position data. S2: Calculation of position observations based on the weighted centroid method. The user's lateral position observations are calculated based on the distance values measured by the ultrasonic sensors. S3: Establishment of a dynamic model of user position. A second-order motion state equation and observation equation containing position and velocity are established. S4: Adaptive noise covariance estimation, dynamically adjusting the observation noise covariance and process noise covariance based on the statistical characteristics of the innovation sequence; The specific steps of S4 adaptive noise covariance estimation include: S41: Calculate the innovation sequence ;in For a moment The new information; These are the observed values; The observation matrix; For a moment State prediction value; S42: Calculate the theoretical value of the new information covariance ;in This represents the theoretical value of the new information covariance. For a moment The state prediction covariance matrix; Observation matrix Transpose of; To observe the noise covariance; S43: The actual value of the innovation covariance is estimated using the sliding window method, with a window length of... Take 10 to 20 sampling points, the formula is: ;in This represents the actual estimate of the new information covariance. The length of the sliding window; For the time index within the window; For a moment News; S44: Adaptive update of observation noise covariance using exponential smoothing method ;in The updated observation noise covariance; This is the forgetting factor, with a value range of 0.90 to 0.98; The observation noise covariance at the previous time step; when season ,in S45: Calculate the residual sequence (lower limit value); ;in The residual vector is the state estimation vector; For a moment State estimates; For a moment State prediction; S46: Adaptive adjustment process noise covariance ;in This is the updated process noise covariance matrix; The reference process noise covariance matrix; For adjustment coefficients; This is a function to find the maximum value. The magnitude of the residual change ; S5: Kalman filter state estimation, which uses a Kalman filter prediction and update framework to estimate the user's position and velocity in real time.
2. The treadmill user center trajectory recognition method based on Kalman filtering according to claim 1, characterized in that, The specific steps for data acquisition of the S1 ultrasonic sensor array include: S11: uniformly installing along the width direction of the running belt. One ultrasonic ranging sensor, among which S12: Each ultrasonic sensor emits an ultrasonic pulse and receives the reflected wave to measure the distance to the user; S13: Data acquisition is performed to obtain the data at each sampling time. hour Distance measurements from each sensor 、 、 、 。 3. The treadmill user center trajectory recognition method based on Kalman filtering according to claim 1, characterized in that, The specific steps of S2 include: S21: sampling time of Each distance measurement value is validated to ensure its validity, and those exceeding the valid measurement range are discarded. Data points; S22: Calculate user lateral position observations using an improved weighted centroid algorithm. The formula is: ;in For a moment Location observations; For the first The weight of each sensor; For the first The lateral coordinate position (m) of each sensor; This represents the total number of sensors; For summation operator; S23: the weight The reciprocal distance weighted method is used for calculation, and the formula is as follows: ;in For the first The weight of each sensor; It is an exponential function; This is the distance attenuation coefficient, with a value ranging from 0.5 to 2.0; For the first Each sensor at time The measured distance value; This is the distance weighting index, with a value ranging from 1.5 to 2.5; It represents the power exponent.
4. The treadmill user center trajectory recognition method based on Kalman filtering according to claim 3, characterized in that, The specific steps of S3 include: S31: Define the state vector. ,in For the user's horizontal position; Lateral velocity; superscript S32: Indicate transpose; S32: Establish state transition equations ;in For a moment The state vector; This is the state transition matrix; For a moment The state vector; It is process noise, and follows a zero-mean Gaussian distribution; S33: The state transition matrix; (This refers to the matrix multiplication operator; S33: the state transition matrix) for A matrix, represented as: ;in The sampling period is equal to , The sampling frequency in step S1; the element in the first row and first column of the matrix is 1, and the element in the first row and second column is... The element in the second row and first column is 0, and the element in the second row and second column is 1; S34: Establish the observation equation ;in For a moment The observed values, i.e., the position observation values calculated in step S2. ; For the observation matrix, ; The observed noise follows a zero-mean Gaussian distribution; S35: Define the process noise covariance matrix. and observation noise covariance It is used to characterize model uncertainty and measurement error; the Initialize to ,in Represents a diagonal matrix; Variance of position process noise; Let V be the variance of the velocity process noise.
5. The treadmill user center trajectory recognition method based on Kalman filtering according to claim 4, characterized in that, The specific steps of the S5 Kalman filter state estimation include: S51: Perform state prediction. ;in For a moment The predicted state value; This is the state transition matrix; For a moment S52: Optimal state estimate; S52: Perform covariance prediction ;in For a moment The predicted covariance matrix; For a moment The estimated covariance matrix; State transition matrix Transpose of; S53: Calculate the Kalman gain: (This refers to the adaptive adjustment of the process noise covariance matrix in step S4.) ;in For a moment The Kalman gain matrix; This is the transpose of the observation matrix; This refers to the adaptively updated observation noise covariance in step S4; superscript S54: Perform a matrix inversion operation; ;in For a moment The optimal state estimate; S55: Perform covariance update for the information calculated in step S4. ;in For a moment The estimated covariance matrix; For the identity matrix; S56: From the state estimate Extracting location estimates and speed estimates ,in This is the filtered estimate of the user's lateral position; This is an estimate of the lateral velocity; and These represent the first and second components of the state vector, respectively.
6. The treadmill user center trajectory recognition method based on Kalman filtering according to claim 2, characterized in that, The lateral coordinate position of the sensor in S11 The sensors are evenly distributed along the width of the running belt, with a spacing of [missing information]. ;in The width of the running belt; The total number of sensors; with the center of the running belt as the origin; when and At that time, the lateral coordinates of the five sensors were respectively 、 、 、 、 。 7. The treadmill user center trajectory recognition method based on Kalman filtering according to claim 5, characterized in that, A filter initialization step is included before step S5: utilizing the previous step The state vector is initialized by the average of the observations. ,in: ; This is the initial state vector; For the front The average of the observations; This represents the initial number of observations, ranging from 5 to 10. For the first One observation value; Observation index; initial covariance matrix Set as a diagonal matrix ,in ; 。 8. The treadmill user center trajectory recognition method based on Kalman filtering according to claim 5, characterized in that, Prior to the S54 state update step, an outlier detection step is included: calculating the theoretical value of the new information covariance. ;in This represents the theoretical value of the new information covariance. The observation matrix; For a moment The state prediction covariance matrix; This is the transpose of the observation matrix; To observe the noise covariance; when the absolute value of the innovation... More than 3 times the theoretical standard deviation, i.e. When this occurs, it is determined to be an abnormal observation; in This refers to the new information calculated in step S4; This is the square root operator; at this point, the Kalman gain is reduced to... ,in The original Kalman gain calculated in step S53 is then used to execute step S54.
9. The treadmill user center trajectory recognition method based on Kalman filtering according to claim 5, characterized in that, The S2 step also includes a sensor fault handling step: when a sensor continuously... If no valid data is obtained in a given cycle, the sensor is marked as faulty. Remove faulty sensors from the position observation calculation in step S2, and recalculate and normalize the weights using the remaining normal sensors. The normalization formula is: ;in For the first The normalized weights of a normal sensor; For the first The original weights of a normal sensor; For the first The original weights of a normal sensor; This represents the summation over all normal sensors.
Citation Information
Patent Citations
Method and system of lithium battery state of charge estimation based on second-order difference particle filtering
US20220196745A1
Method for determining kalman filter parameters, ARMA model parameters and associated devices
WO2017129569A1