A level environment adaptive error compensation algorithm method and device

By constructing an environmental adaptive error compensation algorithm for the level, and utilizing the segmented response characteristics mapping of angular velocity and angle switching data and the fusion of historical deviation patterns, the error compensation problem of the level under dynamic working conditions is solved, and stable measurement is achieved under the conditions of rotational speed change and angle switching.

CN122170922APending Publication Date: 2026-06-09BENXI HUACHENG CONSTRUCTION ENGINEERING CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
BENXI HUACHENG CONSTRUCTION ENGINEERING CO LTD
Filing Date
2026-03-10
Publication Date
2026-06-09

AI Technical Summary

Technical Problem

Existing technologies struggle to effectively handle the coupling relationship between changes in carrier rotation speed and the timing of angle switching under dynamic operating conditions, leading to jumps, lags, and overshoots in the level indicator output, making it impossible to achieve continuous and stable error compensation.

Method used

By collecting angular velocity and angle switching data, a segmented adjustable response characteristic mapping is constructed. Combined with historical deviation patterns and simulation verification, adaptive synchronous updates of compensation parameters are achieved, including steps such as data acquisition, preprocessing, feature extraction, response characteristic mapping, historical correction, deviation pattern fusion, simulation confirmation, and closed-loop update.

Benefits of technology

It effectively suppresses the jumps, lags, and overshoots in angle measurement during the switching process, improves the measurement stability and robustness of the level in dynamic environments, and ensures the continuity and reliability of the compensation effect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122170922A_ABST
    Figure CN122170922A_ABST
Patent Text Reader

Abstract

The application discloses a level environment self-adaptive error compensation algorithm method and device, belongs to the technical field of surveying and mapping services; for solving the problem of measurement jump, lag and overshoot caused by coupling of rotation speed change and angle switching under dynamic working condition. The method comprises the following steps: collecting angular velocity and angle switching data in real time; preprocessing and extracting speed change trend and switching time sequence; constructing a segmented adjustable response characteristic mapping based on double driving variables; combining historical deviation distribution and deviation mode characteristics to correct and fuse the initial compensation value; confirming the effectiveness of the compensation parameters through simulation verification; generating compensation instructions synchronized with the response of intelligent sensors by using time alignment mechanism; finally realizing closed-loop parameter updating based on feedback. The application adaptively adjusts the compensation parameters by sensing the speed change and switching action, significantly improving the measurement continuity, stability and overall accuracy of the level in the dynamic environment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of surveying and mapping service technology, specifically to a level instrument environmental adaptive error compensation algorithm method and device. Background Technology

[0002] A level is a crucial instrument used to measure the tilt angle of a carrier relative to a horizontal plane; hereinafter referred to as "level" or "instrument". Its dynamic accuracy directly affects the reliability of applications such as industrial leveling, platform stability, and attitude control. In actual dynamic working conditions, such as when the carrier is continuously rotating, accelerating or decelerating, or frequently changing the target angle, the level's output often exhibits significant errors, manifesting as drift in angle values, jumps during switching, or response lag.

[0003] Currently, methods for improving the dynamic accuracy of levels mainly focus on error modeling and filtering compensation. For example, invention patent CN111678538B discloses a "dynamic level error compensation method based on velocity matching". This method collects angular velocity, acceleration, and temperature signals through an inertial measurement unit, and performs compensation parameter calibration and Kalman filtering calculation in a navigation computer. It aims to compensate for velocity errors caused by lever effect, so as to output more accurate pitch and roll angles.

[0004] However, existing technical solutions have the following limitations: Their core lies in handling slowly changing or model-specific errors (such as lever effects) through filtering algorithms within the navigation framework, without explicitly modeling the carrier's angular velocity itself and its changing trend as key variables driving error changes. Under dynamic conditions, sensor response characteristics (such as gain and delay) change with rotational speed, making it difficult for a single set of compensation parameters to remain optimal across the entire speed range. Secondly, existing methods fail to effectively handle the coupling relationship between "rotational speed changes" and "angle switching timing." When the carrier simultaneously switches angles during rotation, the velocity state and the switching action influence each other, generating complex transient errors (such as jumps and overshoot). Conventional filtering methods, due to their inherent hysteresis, cannot compensate for such rapidly coupled errors in a timely and accurate manner, leading to decreased measurement consistency and continuity in acceleration / deceleration or frequent switching scenarios.

[0005] Therefore, existing technologies lack a targeted solution that can directly respond to changes in rotational speed and proactively adapt to angle switching, thereby achieving continuous and stable error compensation in dynamic environments. Summary of the Invention

[0006] The purpose of this invention is to provide an environmental adaptive error compensation algorithm method and device for a level instrument. By using the trend of angular velocity change and the timing of angle switching as two key variables, a segmented adjustable response characteristic mapping is constructed. By integrating historical deviation patterns and simulation verification, the compensation parameters are adaptively and synchronously updated for dynamic working conditions, thereby effectively suppressing the jump, lag and overshoot phenomena of angle measurement during the switching process.

[0007] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is as follows:

[0008] An environmental adaptive error compensation algorithm for a level meter includes the following steps:

[0009] Step 1, Data Acquisition: The rotation speed sensor and angle output module of the level instrument acquire angular velocity data and angle switching data in real time, wherein the angle switching data includes the time when the angle switching occurs, the angle value before the switching, and the angle value after the switching;

[0010] Step 2, Preprocessing and Feature Extraction: Denoise and smooth the angular velocity data and angle switching data, extract the velocity change trend of the angular velocity, and extract the angle switching timing sequence from the angle switching data;

[0011] Step 3, Response Characteristic Mapping Construction and Segmented Adjustment: Based on the speed change trend and angle switching timing sequence, combined with the compensation parameter weight distribution and parameter environment adaptation rules, a sensor response characteristic mapping relationship is constructed; when the speed change trend exceeds a preset threshold range, the response characteristic mapping relationship is segmented and linearly adjusted to obtain the adjusted response characteristic parameter set;

[0012] Step 4, Initial Compensation and Historical Correction: Determine the initial compensation value based on the adjusted set of response characteristic parameters; obtain the correlation between the deviation distribution range and the deviation trend from the historical deviation data based on the deviation recording period, and correct the initial compensation value according to the deviation distribution range to obtain the basic set of compensation parameters;

[0013] Step 5, Deviation Pattern Fusion: Based on deviation pattern classification and deviation triggering conditions, extract deviation pattern features corresponding to the current dynamic environment from the historical deviation data; when the deviation trend correlation and the speed change trend meet the matching conditions, fuse the deviation pattern features with the basic set of compensation parameters to obtain the intermediate set of compensation parameters;

[0014] Step 6, Simulation Confirmation: Based on the intermediate set of compensation parameters and combined with the parameter switching timing and historical weight of the deviation, a real-time data simulation method is used to simulate the error performance during the angle switching process; when the simulation error is lower than the preset tolerance and the parameter synchronization accuracy meets the requirements, the intermediate set of compensation parameters is confirmed as the final set of compensation parameters;

[0015] Step 7, Instruction generation and time alignment: Based on the final set of compensation parameters, parameter error tolerance and deviation environment markers, a dynamic adjustment instruction sequence is generated, and the dynamic adjustment instruction sequence is synchronized with the sensor response through a time alignment mechanism to obtain the calibrated instruction execution sequence;

[0016] Step 8, Closed-loop update: Apply the calibrated instruction execution sequence to the level error compensation module, collect the compensated measurement data feedback; when the feedback deviation value is within the preset range, update the final set of compensation parameters and output the adaptive error compensation result.

[0017] Furthermore, the sampling frequency of the denoising and smoothing process is 50-500 Hz, the smoothing window length is 5-50 sampling points, and any one or a combination of moving average, exponential weighted average, or Kalman filtering is used.

[0018] Furthermore, the velocity change trend is obtained by calculating the short-time mean and short-time slope of the angular velocity data, with the calculation window for the short-time slope being 10-200 milliseconds.

[0019] Furthermore, the angle switching timing sequence is obtained by detecting abrupt changes in the angle value within a threshold band of 0.05-1.0 degrees, the angle switching frequency, or the angle switching duration, and the key nodes of the angle switching are output.

[0020] Furthermore, the preset threshold range includes an angular velocity amplitude threshold and a velocity change rate threshold, wherein the angular velocity amplitude threshold is 0.5-20 degrees per second, and the velocity change rate threshold is 0.5-50 degrees per second squared.

[0021] Furthermore, the weight distribution of the compensation parameters is weighted according to different angular velocity ranges, angle switching frequency ranges, and environmental markers. The sum of the weights in the weighted distribution is 1, and each weight is between 0.05 and 0.95.

[0022] Furthermore, the piecewise linear adjustment divides the response characteristic mapping relationship into at least 2 segments and no more than 10 segments according to the speed change trend, and the mapping parameters of adjacent segments satisfy the continuity constraint.

[0023] Furthermore, the deviation distribution interval is obtained by adding or subtracting the standard deviation from the quantiles or mean of historical deviation data, and the deviation recording period is 10-600 seconds.

[0024] Furthermore, the deviation mode classification includes at least one of the following: uniform drift deviation mode, acceleration lag deviation mode, deceleration overshoot deviation mode, and angle switching jump deviation mode; the deviation triggering conditions include at least the angular velocity range, the velocity change rate range, and the angle switching frequency range.

[0025] Furthermore, the real-time data simulation method includes generating a simulation input sequence based on the current speed change trend and angle switching timing sequence, and calculating the simulation error on the simulation input sequence; the preset tolerance is 0.01-0.5 degrees.

[0026] Furthermore, the time alignment mechanism includes any one or a combination of delay compensation, phase correction, or interpolation resampling of the dynamically adjusted command sequence, so that the difference between the command effective time and the sensor response delay is controlled within 1-20 milliseconds.

[0027] In addition, the present invention also discloses a level instrument environmental adaptive error compensation device, comprising: a data acquisition module, a preprocessing and feature extraction module, a response characteristic mapping and segmented adjustment module, a history correction and deviation mode fusion module, a simulation confirmation module, an instruction generation and time alignment module, and a closed-loop update module; wherein each module is used to execute the steps of the level instrument environmental adaptive error compensation algorithm method described above.

[0028] In addition, the present invention also discloses a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, causes the processor to execute a level instrument environmental adaptive error compensation algorithm method as described above.

[0029] Compared with the prior art, the present invention has the following beneficial effects:

[0030] Existing compensation schemes often rely on static parameters or slow-responding filtering algorithms, making it difficult to adapt to the rapid changes in the carrier's rotational speed and angle switching rhythm. This results in significant jumps or lags in the output near the switching points. This invention acquires angular velocity and angle switching data in real time and uses these two driving variables to construct a piecewise adjustable response characteristic mapping relationship. This allows the compensation parameters to closely follow the actual changes in the sensor's dynamic response. When the speed change trend exceeds a threshold, a piecewise linear adjustment of the mapping relationship is automatically triggered, ensuring that the compensation model maintains optimal fit across different speed ranges. This fundamentally eliminates the output discontinuity problem caused by mismatch of a single parameter across operating conditions, achieving smooth and stable measurement in various dynamic scenarios, from uniform speed, acceleration, deceleration to frequent angle switching.

[0031] This invention enhances the intelligent suppression capability and system robustness against complex transient error patterns. Traditional methods fail to adequately utilize historical error data and lack proactive learning and response mechanisms for specific error patterns. This invention introduces a historical deviation distribution interval correction and deviation pattern classification fusion mechanism. It not only generates initial compensation based on real-time data but also corrects it by analyzing the statistical distribution and trends of historical deviations. Furthermore, it proactively matches deviation pattern characteristics consistent with the current speed trend, injecting learned typical error patterns (such as acceleration-lag and switching-jump types) into the compensation parameters through feature fusion. By employing a strategy combining real-time perception and empirical learning, this invention possesses the ability to proactively compensate for recurring or predictable transient errors, significantly reducing repetitive response errors to similar interferences and improving the overall measurement robustness.

[0032] To avoid system performance degradation caused by directly issuing defective compensation parameters, this invention adds a simulation verification step before parameter application. Through simulation based on real-time data and an internal model, the error performance of the candidate parameter set during simulated angle switching is pre-verified, and confirmation is only granted if preset tolerances and synchronization accuracy requirements are met. This mechanism constitutes a firewall for parameter reliability. Simultaneously, a precise time alignment mechanism compensates for the output timing of the dynamic adjustment command sequence, ensuring synchronization with the physical response delay of the sensor and eliminating secondary errors caused by command timing misalignment. By collecting post-compensation feedback data and updating parameters in a closed loop, a complete adaptive closed loop of perception-decision-verification-execution-optimization is formed, ensuring the continuity and reliability of the compensation effect during long-term operation. Attached Figure Description

[0033] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained from these drawings without creative effort.

[0034] Figure 1 This is the overall flowchart of the present invention.

[0035] Figure 2 This is a flowchart of the data acquisition process for this invention.

[0036] Figure 3 This is a schematic diagram of the preprocessing and feature extraction process of the present invention.

[0037] Figure 4 This is a flowchart of the response characteristic mapping construction and segmentation adjustment process of the present invention. Detailed Implementation

[0038] In the following description, only certain exemplary embodiments are briefly described. As those skilled in the art will recognize, the described embodiments can be modified in various ways without departing from the spirit or scope of the embodiments of the invention. Therefore, the drawings and description are considered to be exemplary in nature and not restrictive.

[0039] The embodiments of the present invention will now be described in detail with reference to the accompanying drawings.

[0040] Example 1: The technical problem to be solved in this example is that, under dynamic working conditions, due to the coupling between the change in rotational speed and the timing of angle switching, the update rhythm of the compensation parameters cannot match the change in sensor response, which causes the measurement error to jump, lag or overshoot during the angle switching stage.

[0041] See Figures 1-4 This embodiment provides a level indicator environmental adaptive error compensation algorithm method, which adopts an integrated algorithm chain, including steps such as real-time acquisition, feature extraction, mapping segment adjustment, historical deviation correction, deviation mode fusion, simulation confirmation, command time alignment, and closed-loop update. The physical essence of the method is to calculate a real-time compensation amount. This compensation amount is consistent with the original angle output of the level. Add them together to get the calibrated angle. To suppress dynamic errors.

[0042] The specific steps are as follows:

[0043] By treating the trend of angular velocity change and the timing sequence of angle switching as equally important driving variables, the influence of their coupling on the error is explicitly characterized.

[0044] The dynamic response of the sensor under different speed ranges and different switching rhythms is characterized by a segmentable response characteristic mapping relationship, and segmented linear adjustment is triggered when the speed trend exceeds the threshold to avoid mismatch of a single compensation parameter across speed ranges.

[0045] By introducing the correlation between historical deviation distribution range and deviation trend, the initial compensation value is corrected based on historical dependence. Furthermore, by using deviation pattern classification as a carrier, the deviation pattern characteristics that match the current working condition are integrated into the compensation parameters.

[0046] Real-time data simulation is introduced as a "feasibility verification" before parameters are issued, with tolerance and synchronization accuracy as the closing loop termination conditions.

[0047] By compensating for sensor response delay through a time alignment mechanism, the synchronization between command activation and sensor response is achieved, and the compensation parameters are finally updated under feedback constraints.

[0048] This embodiment is used to achieve continuous compensation during low-speed-to-high-speed switching by mapping segmented response characteristics and correcting for historical deviation intervals. The selected range endpoint value in this embodiment is the sampling period. milliseconds; rotational speed amplitude threshold Degrees per second; threshold for rate of change of velocity degrees per second squared; error tolerance Spend.

[0049] Step S1: Denoising and smoothing.

[0050] The smoothed angular velocity is obtained by using an exponentially weighted average. :

[0051] ;

[0052] in:

[0053] : The smoothed angular velocity at the k-th sampling time (unit: degrees / second);

[0054] Smoothing coefficient, with a value ranging from 0.05 to 0.95, is selected based on noise characteristics and can be determined through signal-to-noise ratio estimation or empirical values.

[0055] : The raw angular velocity at the kth sampling time (unit: degrees / second);

[0056] Angular velocity smoothed at the (k-1)th sampling time (unit: degrees / second), initial value It can be 0 or the average of the first few sampling points.

[0057] This embodiment takes Assuming hour , ,but .when hour ,but .

[0058] Step S2: Extract the trend of speed change and the timing of angle switching.

[0059] (1) Short-term mean: within the window Internal calculation speed average .

[0060] (2) Short-time slope: The short-time slope is calculated using the first-order difference. :

[0061] ;

[0062] in , The short-time calculation window length has a value range of [value range missing]. millisecond, Indicates rounding down;

[0063] : Short-time slope of the angular velocity at the k-th sampling time (unit: degrees / second²); its value is given by the formula Calculation, where , For short-time calculation window length, the value range is... millisecond;

[0064] Sampling period (unit: seconds);

[0065] Angular velocity after smoothing at the k-th sampling time (unit: degrees / second);

[0066] : No. The smoothed angular velocity at each sampling time point (unit: degrees / second).

[0067] Define speed change trend index The absolute value of the short-time slope is used to characterize the drasticness of velocity changes.

[0068] ;

[0069] Its unit is degrees per second²;

[0070] : Velocity change trend index at the kth sampling time (unit: degrees / second²);

[0071] : Short-time slope of rotational speed at the kth sampling time (unit: degrees / second²).

[0072] This embodiment takes milliseconds, corresponding ;

[0073] like , ,but = 60 degrees per second squared, Triggering the segment adjustment condition.

[0074] Angle switching timing sequence is detected Does it exceed the threshold? get, The value is 0.05-1.0 degrees; in this embodiment, it is... Degree, when Time, record ,and .

[0075] Step S3: Response characteristic mapping construction and piecewise linear adjustment.

[0076] The angular velocity range is divided into part( The value range is 2 to 10), each segment A corresponding set of mapping parameters: compensation coefficients representing the proportional relationship between error and angular velocity. (Unit: degrees / (degrees / second)) and basic compensation amount (Unit: degree). Among them, It can be understood as a time constant that characterizes the proportional relationship between the angular velocity and the steady-state error of the system under the current operating condition; This represents a fixed deviation independent of angular velocity. When smoothing angular velocity... Falling into During the period, calculate the basic compensation amount. :

[0077] ;

[0078] in:

[0079] : The base compensation amount at the k-th sampling time (unit: degrees);

[0080] : The compensation coefficient of the j-th segment (unit: degrees / (degrees / second)), which characterizes the proportional relationship between error and angular velocity;

[0081] : The basic compensation amount of segment j (unit: degrees), representing a fixed deviation independent of angular velocity;

[0082] : Segment index, j=1,2,…,L (L is the number of segments, ranging from 2 to 10);

[0083] Angular velocity after smoothing at the k-th sampling time (unit: degrees / second).

[0084] When speed change trend indicator or At that time, for the current segment parameters Perform adaptive adjustments:

[0085] ;

[0086] in,

[0087] : Adjusted compensation coefficient for segment j (unit: degrees / (degrees / second));

[0088] : Compensation coefficient for segment j before adjustment (unit: degrees / (degrees / second));

[0089] : Dimensionless adjustment sensitivity coefficient for segment j, with a value range of 0.01 to 0.5;

[0090] : Sign function (returns 1 for positive input, -1 for negative input, and 0 for 0 input);

[0091] : Short-time slope of angular velocity at the k-th sampling time (unit: degrees / second²);

[0092] (k): The velocity change trend index at the kth sampling time (unit: degrees / second²);

[0093] : Threshold for rate of change of velocity (unit: degrees / second²), with a range of 0.5 to 50 degrees / second²;

[0094] : Reference value for the rate of change of velocity (unit: degrees / second²), used to normalize the amount exceeding the threshold (e.g., take 10 degrees / second²).

[0095] This adjustment remains unchanged, and the compensation coefficient is adjusted accordingly. The change is related to the proportion of the relative threshold exceeded and the direction of the change.

[0096] This embodiment is set Low speed range (degrees per second), parameters degrees / (degrees / second), Speed; High-speed section (degrees per second), initial parameters degrees / (degrees / second), Degree. Take. , degrees / second² Degrees per second². When degrees / second² (corresponding to) )and At a speed of degrees per second, trigger the parameters of the high-speed section. Adjustments:

[0097] ;

[0098] Obtain the adjusted set of response characteristic parameters At this point, the basic compensation amount for:

[0099] ;

[0100] Step S4: Basic compensation amount and historical range correction.

[0101] The result calculated in step S3 As compensation amount to be corrected.

[0102] Historical Deviation Series Derived from the comparison reference angle (e.g., obtained through a high-precision static calibration device) and the original angle output. The difference was recorded over a period of 10-600 seconds. To obtain a robust statistical interval, the upper and lower quartiles were used to construct the deviation distribution interval. .

[0103] This embodiment takes typical dynamic error data as the basis for... Degree. A soft limiting function is used for... Make corrections to obtain the historically corrected compensation amount. :

[0104] when hour, ;

[0105] when hour, ;

[0106] when hour, ;

[0107] The attenuation coefficient;

[0108] in:

[0109] : Compensation amount after historical correction at the k-th sampling time (unit: degree);

[0110] : The base compensation amount at the k-th sampling time (unit: degrees);

[0111] Deviation distribution range ( The lower quartile of the historical deviation data. (Upper quartile, unit: degrees).

[0112] The upper limit of the deviation distribution interval (i.e. (Unit: degrees)

[0113] The lower limit of the deviation distribution interval (i.e. (Unit: degrees)

[0114] : Attenuation coefficient, with a value of 0.5 (dimensionless).

[0115] This correction smoothly pulls back compensation amounts that exceed the historical range, rather than truncating them, thus preserving the trend information calculated in real time.

[0116] Substitution Degree, because it is greater than Degree, applicable formula The calculation yields:

[0117] ;

[0118] Will and its corresponding parameter index Store the compensation parameter base set .

[0119] Step S5: Generate instructions and perform closed-loop update.

[0120] Define the compensation command as And compensate for sensor response delay through a time alignment mechanism. The measurements in this embodiment are as follows: In milliseconds, the time when the instruction delay compensation takes effect is... Data collection feedback deviation ,when Update parameters and output results as needed.

[0121] The advantage of this embodiment is that by segmented mapping and historical interval correction, it avoids jumps caused by excessive compensation gain in high-speed segments, and the closed-loop condition ensures that the compensation result can be verified.

[0122] Example 2: This example adds deviation mode fusion to Example 1, focusing on solving the jump error caused by frequent angle switching. This example selects the middle value of the range: sampling period. milliseconds; rotational speed amplitude threshold Degrees per second; threshold for rate of change of velocity degrees per second squared; error tolerance Degree; Synchronization error target millisecond.

[0123] Step S1: Deviation pattern classification.

[0124] Define the set of deviation patterns For historical deviation sequences Classified by triggering conditions:

[0125] If the angle switching frequency 1-20 times per second and switching amplitude If the temperature is between 0.1 and 5 degrees, it is marked as... If the rate of change of velocity If the squared value is between 10 and 50 degrees per second and the error is lagging, it is marked as... The rest are categorized according to the rules.

[0126] Step S2: Deviation pattern feature extraction and fusion.

[0127] For each mode Feature extraction , where represent the mean, standard deviation, and typical duration of the model deviation, respectively.

[0128] Let the historical data be marked as patterns The mean of the velocity change trend over time is The standard deviation is The mean frequency of angle switching is The standard deviation is The matching degree calculation formula is:

[0129] ;

[0130] in,

[0131] The degree of matching between the current operating condition and the m-th deviation mode;

[0132] Deviation mode index: m=1 is constant speed drift type, m=2 is acceleration lag type, m=3 is deceleration overshoot type, m=4 is angle switching jump type;

[0133] : Velocity change trend index at the kth sampling time (unit: degrees / second²);

[0134] : The average velocity change trend corresponding to the m-th deviation pattern (unit: degrees / second²).

[0135] Standard deviation of the velocity change trend corresponding to the m-th deviation pattern (unit: degrees / second²).

[0136] : Angle switching frequency at the kth sampling time (unit: times / second);

[0137] : Average angle switching frequency corresponding to the m-th deviation mode (unit: times / second);

[0138] Standard deviation of angle switching frequency corresponding to the m-th deviation mode (unit: times / second).

[0139] and These are the patterns marked in the historical data. The mean and standard deviation of the velocity change trend over time; and These are the patterns marked in the historical data. The mean and standard deviation of the frequency of angle switching.

[0140] when ( When the value ranges from 0.3 to 0.9, bias mode fusion is performed. Let's assume... The current compensation amount obtained is The compensation amount after fusion The calculation is as follows:

[0141] ;

[0142] in,

[0143] : Compensation amount after bias mode fusion at the k-th sampling time (unit: degree);

[0144] : Compensation amount after historical correction at the k-th sampling time (unit: degree);

[0145] : Historical weights of the m-th deviation pattern;

[0146] : The mean deviation of the m-th deviation pattern (unit: degree).

[0147] At the same time, the typical duration of the pattern will be... Recorded in The duration of the compensation command is used to guide its execution. For the first The historical weights of the bias patterns range from [value range missing]. .

[0148] This embodiment takes , ,like The degree, then the compensation bias increment is Degree, and in Smooth injection over the duration.

[0149] Step S3: Adaptive switching timing.

[0150] When switching angles Set the instruction pre-quantity as the center. This causes the compensation command to begin changing gradually before the switch:

[0151] ;

[0152] in:

[0153] : Pre-command amount for the i-th angle switch (unit: milliseconds);

[0154] : Proportional coefficient, in milliseconds (degrees per second²);

[0155] : The time of the i-th angle switch Speed ​​change trend index (unit: degrees / second²);

[0156] : The time of the i-th angle switch (in milliseconds);

[0157] : Truncation function, which restricts the result to the range of [0, 20] milliseconds.

[0158] This embodiment takes milliseconds / (degrees per second squared), if ,but Milliseconds. Therefore, compensation is injected starting 15 milliseconds before the handover to reduce the sudden jump during the handover.

[0159] The advantage of this embodiment is that it can improve the continuity and stability under frequent switching conditions by explicitly reusing the historical "jump-type" error pattern through deviation mode fusion, and by coordinating pre-switching compensation and time alignment.

[0160] Example 3: This example demonstrates how to confirm compensation parameters through real-time data simulation under complex operating conditions and automatically revert to the previous state when tolerances are not met. The sampling period in this example is... milliseconds; error tolerance Degree; Synchronization error target millisecond.

[0161] Step S1: Construct the simulation model and input sequence.

[0162] A simplified second-order dynamic model of the level sensor system is used as the simulation object, and its transfer function is:

[0163] ;

[0164] in, The transfer function of the sensor system. For the system's inherent frequency (e.g.) rad / s For damping ratio (e.g.) Using methods such as bilinear transformation to... Discretize it into difference equation form.

[0165] With the current window With angle switching timing sequence Construct a simulation input sequence. Input this sequence into the discrete simulation model to obtain the simulation output angle. Simulation reference angle It is obtained by ideal integration of the input angular velocity sequence. The superimposed noise is Gaussian white noise, and its variance is... Estimated from historical static data.

[0166] Step S2: Simulation error calculation and verification.

[0167] Let the simulation output angle be The simulation reference is Then the simulation error ;

[0168] in:

[0169] Simulation error at the kth sampling time (unit: degrees);

[0170] Simulation reference angle at the kth sampling time (unit: degrees);

[0171] : Simulated output angle at the kth sampling time (unit: degrees).

[0172] Calculate the root mean square error of the window ;

[0173] in:

[0174] : Root mean square of simulation error (unit: degree);

[0175] Simulation error at the kth sampling time (unit: degrees);

[0176] : The function for calculating the mean within a time window.

[0177] when And synchronization error Confirmation in milliseconds for .

[0178] If the conditions are not met, parameter rollback will be performed, using the valid compensation parameter set confirmed in the previous round. With the present Perform weighted fusion:

[0179] ;

[0180] in:

[0181] The final confirmed set of compensation parameters;

[0182] : Backoff weighting coefficient, with a value range of ;

[0183] : Intermediate set of compensation parameters that have not passed simulation verification;

[0184] : The set of valid compensation parameters confirmed in the previous round.

[0185] Step S3: Example of rollback calculation.

[0186] This embodiment takes ,like A certain gain parameter is 0.30. If the corresponding parameter is 0.20, then the rollback will be... By rolling back, parameter abrupt changes are reduced, and errors caused by the issuance of incorrect parameters are avoided.

[0187] The advantage of this embodiment is that it introduces a simulation confirmation and rollback mechanism before the parameters are issued, forming a closed loop of "verification first, then execution", which reduces the risk of instability under complex working conditions.

[0188] Example 4: This example, based on Examples 1, 2, or 3, introduces a data-driven model to predict the trend correlation of deviations. This is to improve the generalization ability to unknown working conditions. The model described in this embodiment can be any of a long short-term memory network, a gated recurrent unit, or a one-dimensional convolutional network; for ease of implementation, this embodiment uses a one-dimensional convolutional network as an example.

[0189] (a) Model building.

[0190] Constructing input vectors ;

[0191] in:

[0192] Angular velocity after smoothing at the k-th sampling time (unit: degrees / second);

[0193] : Velocity change trend index at the k-th sampling time (unit: degrees / second²);

[0194] : Angle switching frequency at the k-th sampling time (unit: times / second);

[0195] : Angle switching amplitude statistics at the kth sampling time (unit: degrees).

[0196] Build output , indicating prediction bias.

[0197] Model satisfy ,in, : The predicted deviation value at the kth sampling time (unit: degree); Data-driven model (one-dimensional convolutional network). For the set of model parameters; : The model input vector at the kth sampling time.

[0198] (ii) Model training.

[0199] The model training is completed during the high-precision calibration phase before shipment. A level is fixed to a programmable high-precision three-axis rotary table, with the reference angle provided by the rotary table controller. By executing a dynamic test program involving different angular velocities, acceleration / deceleration, and angle switching on the turntable, sensor data is collected synchronously. and error This constitutes the training dataset. Define the loss function. :

[0200] ;

[0201] in, The loss function value of the model;

[0202] : The prediction bias of the model for the k-th sample (unit: degree);

[0203] : Model parameter set;

[0204] Total number of training samples;

[0205] The true bias of the k-th sample (Unit: degrees)

[0206] Regularization coefficient, with a value range of 100%. ;

[0207] The reference angle of the k-th sample;

[0208] The original angle output of the k-th sample;

[0209] Model parameters of Regular term (square) Norm)

[0210] Mini-batch gradient descent update :

[0211] ;

[0212] : Model parameter set;

[0213] Learning rate, with a range of values ​​of 100%. ;

[0214] Loss function L on model parameters The partial derivative (gradient).

[0215] After training is complete, the validation set is calculated. And solidify the model parameters.

[0216] (III) Model application and integration.

[0217] Utilizing model output during the online phase Constructing Deviation Trend Correlation :

[0218] ;

[0219] in:

[0220] : Deviation trend correlation at the kth sampling time (unit: degree), characterizing the changing trend of the deviation prediction value;

[0221] : The predicted deviation value at the kth sampling time (unit: degree);

[0222] : The predicted deviation value at the (k-1)th sampling time (unit: degree);

[0223] when and Satisfying the condition of change in the same direction and matching degree At that time, fusion is performed. Let the rule link compensation amount obtained through the aforementioned steps (S1-S5, or including simulation confirmation in S6) be... Then the model compensation amount and final compensation amount The calculation is as follows:

[0224] ;

[0225] ;

[0226] in:

[0227] : Model compensation amount at the kth sampling time (unit: degrees);

[0228] Model compensation weights, with values ​​ranging from 0.05 to 0.95 (dimensionless).

[0229] : The predicted deviation value at the kth sampling time (unit: degree);

[0230] : The final compensation amount at the k-th sampling time (unit: degrees);

[0231] : The compensation amount (unit: degree) obtained at the k-th sampling time through the rule link (steps in Example 1-3).

[0232] The advantages of this embodiment are: the model has a stronger ability to fit complex noise and nonlinear response, can compensate for boundary conditions that are difficult to cover by regular links, and at the same time, interpretability and stability are guaranteed through weight control.

[0233] Example 5: This example discloses a level instrument environmental adaptive error compensation device for implementing the level instrument environmental adaptive error compensation algorithm method described in Example 1. The device is communicatively connected to the level instrument body, forming a complete adaptive control loop, specifically including a data acquisition module, a preprocessing and feature extraction module, a response characteristic mapping construction and segmented adjustment module, a history correction and deviation mode fusion module, a simulation confirmation module, an instruction generation and time alignment module, and a closed-loop update module connected in sequence.

[0234] The data acquisition module communicates directly with the level's built-in rotational speed sensor and angle output module. This module is configured to continuously acquire the sensor's raw output, collect the instantaneous value of the rotational speed in real time, and simultaneously monitor the state changes of the angle output value, thereby obtaining angle switching data including the time of angle switching, the angle value before switching, and the angle value after switching.

[0235] The preprocessing and feature extraction module receives raw angular velocity data and angle switching data from the data acquisition module. This module first performs denoising and smoothing on the raw data to suppress noise interference. Then, it calculates and extracts the velocity change trends (e.g., short-time mean and short-time slope) from the processed angular velocity data. Simultaneously, this module analyzes the angle switching data, extracting a series of time-sequential angle switching timing sequences by detecting abrupt changes in angle values.

[0236] The response characteristic mapping construction and segmented adjustment module operates based on the velocity change trend and angle switching timing sequence output by the preprocessing and feature extraction modules. This module internally stores preset compensation parameter weight distributions and environmental adaptation rules for different operating conditions. Its core function is to construct a mapping model describing the relationship between the sensor's dynamic response characteristics (such as gain and delay) and the input variables. This module continuously checks whether the velocity change trend exceeds a preset threshold range. If it does, it immediately triggers a segmented linear adjustment mechanism for the mapping model, thereby outputting a set of adjusted response characteristic parameters adapted to the current dynamic conditions.

[0237] The historical correction and deviation pattern fusion module connects to a database storing historical measurement deviations. It first derives the initial compensation value from the adjusted set of response characteristic parameters. Then, according to a set recording period, the module queries historical deviation data, calculates the recent deviation statistical distribution intervals and their trend correlations, and uses this information to correct the initial compensation value, resulting in a more robust set of compensation parameters. Furthermore, based on predefined deviation patterns (such as uniform drift and acceleration lag) and their triggering conditions, the module identifies deviation feature markers and typical durations matching the current environment from historical data. When the historical deviation trend matches the current speed change trend, the corresponding deviation pattern features are quantified and fused into the compensation parameter set, generating a more refined intermediate set of compensation parameters.

[0238] The simulation verification module performs virtual verification of the compensation parameters before their actual application, ensuring their safety and effectiveness. It receives an intermediate set of compensation parameters and constructs a high-fidelity simulation test environment using real-time acquired velocity trends and angle switching sequences. Within this environment, the entire angle switching process is simulated, and the error performance after applying the candidate parameter set is evaluated. Only when the simulation error is below a strictly preset tolerance threshold, and the synchronization accuracy between parameter switching and system response meets the requirements, is this intermediate set of parameters confirmed as the final usable set of compensation parameters; otherwise, a fallback logic is initiated, employing more conservative parameters.

[0239] The instruction generation and time alignment module is responsible for converting the final set of confirmed compensation parameters into executable control instructions. Based on the parameters in the final set, the system's allowable error tolerance, and the current deviation environment markers, this module generates a sequence of dynamically adjusted instructions ordered by time. To address the issue of instruction asynchrony caused by inherent sensor response delays, this module incorporates a time alignment mechanism. Through precise delay compensation, phase correction, or interpolation resampling techniques, it ensures that the effective time of each instruction is precisely aligned with the actual response time of the sensor, ultimately outputting a calibrated instruction execution sequence.

[0240] The closed-loop update module is crucial for the system's adaptive capability. This module sends the calibrated instruction execution sequence to the level's error compensation module for real-time compensation. Simultaneously, it continuously collects compensated actual measurement data as feedback, calculating the feedback deviation from the ideal reference value. This module determines whether the feedback deviation is stable within a preset acceptable range. If the condition is met, it triggers the parameter update logic, writing the final set of valid compensation parameters back to the knowledge base for optimizing subsequent compensation calculations, and outputting a stable adaptive error compensation result, thus completing the closed-loop control of "execution-feedback-evaluation-update".

[0241] Through the coordinated operation of the above modules, the system achieves fully automated processing from real-time perception, feature analysis, model construction and adjustment, experience learning and fusion, security verification, command synchronization to closed-loop optimization, effectively improving the measurement accuracy and adaptive stability of the level in complex dynamic environments.

[0242] Although preferred embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including both the preferred embodiments and all changes and modifications falling within the scope of the invention.

[0243] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. It should be noted that any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A level instrument environmental adaptive error compensation algorithm method, characterized in that, Includes the following steps: Step 1, Data Acquisition: The rotation speed sensor and angle output module of the level instrument acquire angular velocity data and angle switching data in real time, wherein the angle switching data includes the time when the angle switching occurs, the angle value before the switching, and the angle value after the switching; Step 2, Preprocessing and Feature Extraction: Denoise and smooth the angular velocity data and angle switching data, extract the velocity change trend of the angular velocity, and extract the angle switching timing sequence from the angle switching data; Step 3, Response Characteristic Mapping Construction and Segmented Adjustment: Based on the speed change trend and angle switching timing sequence, combined with the compensation parameter weight distribution and parameter environment adaptation rules, a sensor response characteristic mapping relationship is constructed; when the speed change trend exceeds a preset threshold range, the response characteristic mapping relationship is segmented and linearly adjusted to obtain the adjusted response characteristic parameter set; Step 4, Initial Compensation and Historical Correction: Determine the initial compensation value based on the adjusted set of response characteristic parameters; Based on the deviation recording period, the deviation distribution interval and deviation trend are obtained from historical deviation data. The initial compensation value is then corrected according to the deviation distribution interval to obtain the basic set of compensation parameters. Step 5, Deviation Pattern Fusion: Based on deviation pattern classification and deviation triggering conditions, extract deviation pattern features corresponding to the current dynamic environment from the historical deviation data; When the deviation trend correlation and the speed change trend meet the matching conditions, the deviation pattern features are fused with the basic set of compensation parameters to obtain an intermediate set of compensation parameters; Step 6, Simulation Confirmation: Based on the intermediate set of compensation parameters and combined with the parameter switching timing and historical weight of deviation, a real-time data simulation method is used to simulate the error performance during the angle switching process; When the simulation error is lower than the preset tolerance and the parameter synchronization accuracy meets the requirements, the intermediate set of compensation parameters is confirmed as the final set of compensation parameters. Step 7, Instruction generation and time alignment: Based on the final set of compensation parameters, parameter error tolerance and deviation environment markers, a dynamic adjustment instruction sequence is generated, and the dynamic adjustment instruction sequence is synchronized with the sensor response through a time alignment mechanism to obtain the calibrated instruction execution sequence; Step 8, Closed-loop update: Apply the calibrated instruction execution sequence to the level error compensation module and collect the compensated measurement data for feedback; When the feedback deviation value is within the preset range, the final set of compensation parameters is updated, and the adaptive error compensation result is output.

2. The environmental adaptive error compensation algorithm method for a level instrument according to claim 1, characterized in that, The denoising and smoothing process uses a sampling frequency of 50-500 Hz, a smoothing window length of 5-50 sampling points, and employs any one or a combination of moving average, exponential weighted average, or Kalman filtering.

3. The environmental adaptive error compensation algorithm method for a level instrument according to claim 1, characterized in that, The velocity change trend is obtained by calculating the short-time mean and short-time slope of the angular velocity data, with the calculation window for the short-time slope being 10-200 milliseconds.

4. The environmental adaptive error compensation algorithm method for a level instrument according to claim 1, characterized in that, The angle switching timing sequence is obtained by detecting abrupt changes in angle values ​​within a threshold range of 0.05-1.0 degrees, the frequency of angle switching, or the duration of angle switching, and outputs key nodes of angle switching.

5. The environmental adaptive error compensation algorithm method for a level instrument according to claim 1, characterized in that, The preset threshold range includes an angular velocity amplitude threshold and a velocity change rate threshold, wherein the angular velocity amplitude threshold is 0.5-20 degrees per second and the velocity change rate threshold is 0.5-50 degrees per second squared.

6. The environmental adaptive error compensation algorithm method for a level instrument according to claim 1, characterized in that, The piecewise linear adjustment divides the response characteristic mapping relationship into at least 2 segments and no more than 10 segments according to the speed change trend, and the mapping parameters of adjacent segments satisfy the continuity constraint.

7. The environmental adaptive error compensation algorithm method for a level instrument according to claim 1, characterized in that, The deviation distribution range is obtained by adding or subtracting the standard deviation from the quantiles or mean of historical deviation data, and the deviation recording period is 10-600 seconds.

8. The environmental adaptive error compensation algorithm method for a level instrument according to claim 1, characterized in that, The deviation mode classification includes at least one of the following: uniform drift deviation mode, acceleration lag deviation mode, deceleration overshoot deviation mode, and angle switching jump deviation mode; the deviation triggering conditions include at least the angular velocity range, the velocity change rate range, and the angle switching frequency range.

9. The environmental adaptive error compensation algorithm method for a level instrument according to claim 1, characterized in that, The real-time data simulation method includes generating a simulation input sequence based on the current speed change trend and angle switching timing sequence, and calculating the simulation error on the simulation input sequence; the preset tolerance is 0.01-0.5 degrees.

10. A level instrument environmental adaptive error compensation device, characterized in that, include: The system comprises a data acquisition module, a preprocessing and feature extraction module, a response characteristic mapping and segmented adjustment module, a history correction and deviation mode fusion module, a simulation verification module, an instruction generation and time alignment module, and a closed-loop update module; wherein each module is used to execute the steps of the environmental adaptive error compensation algorithm method for a level as described in any one of claims 1-9.

Citation Information

Patent Citations

  • A Dynamic Level Error Compensation Method Based on Velocity Matching

    CN111678538B