Strain gauge pressure sensor creep compensation method, device, equipment and medium
By performing analog-to-digital conversion and weight conversion on the bridge output of the resistive strain gauge pressure sensor, a continuous sampling sequence is formed. The weight stability is determined and the flow rate is calculated, which solves the creep drift problem of the resistive strain gauge pressure sensor under loading conditions and realizes stable measurement under continuous loading scenarios.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ZHONGSHAN YILAI ELECTRONICS
- Filing Date
- 2026-01-20
- Publication Date
- 2026-04-28
AI Technical Summary
In existing technologies, resistance strain gauge pressure sensors are prone to creep under load, causing the weight value to drift slowly, making it difficult to maintain measurement stability and response speed under continuous loading and long-term measurement scenarios.
By acquiring the bridge output sampling value of the resistive strain gauge pressure sensor, performing analog-to-digital conversion and weight conversion, forming a continuous sampling sequence, determining weight stability, calculating the weight change flow rate, updating the zero-point AD value based on the flow rate determination result, correcting the zero-point reference, and realizing the distinction between creep drift and real change.
Real-time correction of creep drift in resistive strain gauge pressure sensors was achieved without relying on fixed waiting time and manual tare, avoiding hysteresis and dependence on additional calibration conditions, and improving the reliability and consistency of measurements.
Smart Images

Figure CN121933102A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of measurement data processing, and in particular to a method, apparatus, equipment and medium for creep compensation of a strain gauge pressure sensor. Background Technology
[0002] In practical applications, resistance strain gauge pressure sensors are prone to creep under load. That is, when the external load remains constant or changes only slightly, the bridge output still drifts slowly over time, resulting in a continuous shift in the calculated weight value. This shift is not only related to the strain gauge material and bonding process, but is also affected by factors such as temperature changes, adhesive layer stress relaxation, micro-deformation of the mechanical structure, and drift of the bridge power supply and amplification circuit. It is especially noticeable when the load is continuous, the sampling time is long, or the environment changes significantly.
[0003] In existing technologies, creep drift is typically suppressed using methods such as fixed-time waiting, static tare, periodic recalibration, temperature compensation curves, or filtering smoothing. Fixed-time waiting and static tare rely on manual or process constraints, making it difficult to adapt to dynamic changes in load during use. Periodic recalibration requires additional calibration actions or reference load conditions, making it difficult to implement frequently during continuous equipment operation. Temperature compensation curves rely on sufficient environmental data and multi-point calibration, resulting in high implementation costs. While filtering smoothing can reduce fluctuations, it easily introduces hysteresis and masks the true weight changes, making it difficult for the system to simultaneously achieve measurement stability and response speed. Summary of the Invention
[0004] To improve the measurement reliability and consistency of strain gauge pressure sensors under continuous loading and long-term measurement scenarios, this application provides a method, apparatus, device, and medium for creep compensation of strain gauge pressure sensors.
[0005] The above-mentioned objective of this application is achieved through the following technical solution: A creep compensation method for a strain gauge pressure sensor, the method comprising: Obtain the bridge circuit output sample value of the resistance strain gauge pressure sensor under loading state, perform analog-to-digital conversion on the bridge circuit output sample value to obtain the sampled AD value; The sampled AD values are converted into weight values based on preset calibration parameters to obtain real-time weight values. A continuous sampling sequence of real-time weight values is obtained under a preset sampling period. Stability determination processing is performed based on the continuous sampling sequence to obtain a weight stability indicator. When the weight stability indicator shows that the weight is stable and the real-time weight value meets the preset weight threshold, the current real-time weight value is recorded as the stable weight value. The weight difference is calculated by performing a difference calculation between the real-time weight value and the stable weight value. The flow rate is calculated based on the continuous sampling sequence and the preset sampling period to obtain the weight change flow rate. When the weight stability indicator shows that the weight is stable, the flow rate determination result is obtained based on the weight difference, the weight change flow rate and the preset threshold rule. The flow rate determination result includes the creep drift determination result and the actual change determination result. When the flow rate determination result is a creep drift determination result, the zero-point AD value and the weight-AD mapping calibration coefficient are determined based on the preset calibration parameters, the zero-point AD correction amount is determined based on the weight difference and the weight-AD mapping calibration coefficient, and the zero-point AD value is updated by adding or subtracting according to the sign of the weight difference to obtain the updated zero-point AD value. The weight conversion process is performed based on the sampled AD value, the updated zero-point AD value, and the weight-AD mapping calibration coefficient to obtain the updated real-time weight value; If the flow rate determination result is a true change determination result, then the stable weight value is updated based on the current real-time weight value to obtain the updated stable weight value.
[0006] By adopting the above technical solution, the problem of continuous weight value shift caused by the slow drift of the bridge output of a resistive strain gauge pressure sensor under load can be addressed. Without relying on fixed waiting times or manual tare, a continuous sampling sequence is formed based on the real-time weight value, and a stability judgment is performed to obtain a weight stability indicator. When the weight stability indicator indicates that the weight is stable, the real-time weight value is recorded as the stable weight value, and the weight difference is calculated. Simultaneously, the weight change velocity is calculated based on the continuous sampling sequence and a preset sampling period. Based on the weight difference, the weight change velocity, and a preset threshold rule, a creep drift judgment result or a true change judgment result is obtained. Thus, when the external load remains constant or changes only slightly but the bridge output still drifts slowly, the judgment result is aligned with the creep drift judgment result, and the zero-point AD value is updated by addition or subtraction to correct the zero-point reference. When the external load undergoes a true change, the judgment result is aligned with the true change judgment result, and the stable weight value is updated to follow the load change. This avoids the lag and masking of true changes caused by filtering and smoothing alone, and also avoids the dependence of periodic recalibration and temperature compensation curves on additional calibration conditions and environmental data.
[0007] Preferably, the step of performing flow rate calculation processing based on a continuous sampling sequence and a preset sampling period to obtain the weight change flow rate includes: Obtain the first real-time weight value and the second real-time weight value corresponding to adjacent sampling times in a continuous sampling sequence; The weight change is obtained by performing differential calculation based on the first real-time weight value and the second real-time weight value. The weight change flow rate is obtained by performing a ratio calculation based on the weight change and the preset sampling period.
[0008] By adopting the above technical solution, the weight change can be obtained by the difference between the first real-time weight value and the second real-time weight value corresponding to adjacent sampling times in the continuous sampling sequence. The weight change rate is obtained by performing a ratio calculation between the weight change rate and the preset sampling period, so that the weight change rate corresponds to the sampling time interval and the weight change direction is consistent with the sign of the weight change.
[0009] Preferably, the ratio calculation process includes: Divide the weight change by the preset sampling period to obtain the original value of the weight change flow rate; When the weight change is greater than zero, the original value of the weight change flow rate is determined as the original value of the positive weight change flow rate; when the weight change is less than zero, the original value of the weight change flow rate is determined as the original value of the negative weight change flow rate. Multiply the original value of the weight change velocity by the preset velocity scaling factor to obtain the velocity scale value. Round the velocity scale value to obtain the weight change velocity.
[0010] By adopting the above technical solution, the weight change amount can be divided by the preset sampling period to obtain the original value of the weight change velocity. The original value of the weight change velocity is distinguished by the sign of the weight change amount to maintain the consistency of the weight change direction. Then, the original value of the weight change velocity is scaled by the preset velocity scaling factor and the velocity scale value is rounded to obtain the weight change velocity. This makes the weight change velocity a discrete representation value and facilitates consistent comparison with the preset threshold rule.
[0011] Preferably, when the flow velocity determination result is a creep drift determination result, the zero-point AD value and the weight-AD mapping calibration coefficient are determined based on preset calibration parameters, the zero-point AD correction amount is determined based on the weight difference and the weight-AD mapping calibration coefficient, and the zero-point AD value is updated by addition or subtraction according to the sign of the weight difference to obtain the updated zero-point AD value, including: Under the condition that the absolute value of the weight difference is not less than the preset weight difference threshold and the weight change flow rate is within the preset slow change flow rate range, the weight difference is divided by the preset weight normalization benchmark value in the preset calibration parameters to obtain the weight normalization ratio value. Multiply the weight normalization ratio by the weight-AD mapping calibration coefficient to obtain the zero-point AD correction. The absolute value of the zero-point AD correction is compared with the preset correction step threshold in the preset calibration parameters. When the absolute value of the zero-point AD correction is greater than the preset correction step threshold, the preset correction step threshold is determined as the target zero-point AD correction. When the absolute value of the zero-point AD correction is not greater than the preset correction step threshold, the absolute value of the zero-point AD correction is determined as the target zero-point AD correction. When the weight difference is greater than zero, the target zero-point AD correction amount is added to the zero-point AD value to obtain the updated zero-point AD value. When the weight difference is less than zero, the target zero-point AD correction amount is subtracted from the zero-point AD value to obtain the updated zero-point AD value. When the weight difference is equal to zero, the zero-point AD value is determined as the updated zero-point AD value.
[0012] By adopting the above technical solution, under the condition that the weight difference reaches a preset weight difference threshold and the weight change flow rate is within a preset slow change flow rate range, the weight difference is proportionally represented according to a preset weight normalization benchmark value, and the proportional representation is converted into a zero-point AD correction amount by combining the weight-AD mapping calibration coefficient. Then, the zero-point AD correction amount is limited by a preset correction step threshold to determine the target zero-point AD correction amount, and the zero-point AD value is updated by addition or subtraction according to the sign of the weight difference to obtain the updated zero-point AD value. Thus, the update direction of the zero-point AD value is consistent with the direction of the weight difference and the single update amplitude is controlled.
[0013] Preferably, the preset correction step threshold includes: The basic step threshold is determined based on preset calibration parameters, and the basic step threshold corresponds to the weight-AD mapping calibration coefficient; When the weight change velocity is within the preset slow change velocity range, the step weight coefficient is determined based on the interval position between the weight change velocity and the preset slow change velocity range. Multiply the base step threshold by the step weight coefficient to obtain the preset corrected step threshold.
[0014] By adopting the above technical solution, a correspondence can be established between the basic step threshold and the weight-AD mapping calibration coefficient based on the preset calibration parameters, so that the basic step threshold is consistent with the calibration scale. When the weight change velocity is within the preset slow change velocity range, the step weight coefficient is determined according to the interval position of the weight change velocity within the preset slow change velocity range. Then, the preset correction step threshold is generated by multiplying the basic step threshold and the step weight coefficient, so that the preset correction step threshold is adjusted synchronously with the position change of the weight change velocity within the preset slow change velocity range.
[0015] Preferably, the step of performing weight conversion processing based on the sampled AD value, the updated zero-point AD value, and the weight-AD mapping calibration coefficient to obtain the updated real-time weight value includes: Subtract the sampled AD value from the updated zero-point AD value to obtain the differential AD value; The differential AD value is compared with the preset valid AD range. When the differential AD value falls into the preset valid AD range, the differential AD value is divided by the weight-AD mapping calibration coefficient to obtain the AD normalization ratio value. The updated real-time weight value is obtained by multiplying the AD normalization ratio value by the preset calibration weight span.
[0016] By adopting the above technical solution, a differential AD value can be obtained by the difference between the sampled AD value and the updated zero-point AD value. The differential AD value is then compared with a preset valid AD range to limit the range of differential AD values participating in the conversion. When the differential AD value falls into the preset valid AD range, the AD normalization ratio is obtained by dividing the differential AD value by the weight-AD mapping calibration coefficient. The AD normalization ratio is then converted into the updated real-time weight value by combining it with the preset calibration weight span, so that the updated real-time weight value is consistent with the updated zero-point AD value and the preset calibration parameters.
[0017] Preferably, the step of comparing the differential AD value with a preset valid AD interval, and when the differential AD value falls within the preset valid AD interval, includes: Store the lower limit AD value and upper limit AD value of the preset valid AD interval in the preset calibration parameters; Read the lower limit AD value and the upper limit AD value of the interval based on the preset calibration parameters; The difference AD value is compared with the lower limit AD value and the upper limit AD value of the interval. When the difference AD value is not less than the lower limit AD value and not greater than the upper limit AD value of the interval, it is determined that the difference AD value falls into the preset valid AD interval.
[0018] By adopting the above technical solution, the lower limit AD value and the upper limit AD value corresponding to the preset effective AD interval can be stored in the preset calibration parameters. In the weight conversion process, the lower limit AD value and the upper limit AD value can be read directly based on the preset calibration parameters. The upper and lower boundaries of the differential AD value are compared to determine whether the differential AD value falls into the preset effective AD interval. This ensures that the determination boundary of the preset effective AD interval is consistent with the preset calibration parameters and facilitates consistent comparison.
[0019] The second objective of this invention is achieved through the following technical solution: A creep compensation device for a strain gauge pressure sensor, the strain gauge pressure sensor creep compensation device comprising: The sampling conversion module is used to acquire the bridge output sampling value of the resistance strain gauge pressure sensor under loading conditions, and to perform analog-to-digital conversion on the bridge output sampling value to obtain the sampled AD value. The weight conversion module is used to perform weight conversion processing on the sampled AD value based on preset calibration parameters to obtain the real-time weight value. The stability determination module is used to obtain a continuous sampling sequence of real-time weight values under a preset sampling period, and perform stability determination processing based on the continuous sampling sequence to obtain a weight stability indicator. The stability recording module is used to record the current real-time weight value as a stable weight value when the weight stability flag indicates that the weight is stable and the real-time weight value meets the preset weight threshold. The difference calculation module is used to perform difference calculation processing based on the real-time weight value and the stable weight value to obtain the weight difference; The flow rate calculation module is used to perform flow rate calculation processing based on the continuous sampling sequence and the preset sampling period to obtain the flow rate of weight change. The flow rate determination module is used to determine the flow rate based on the weight difference, the flow rate of weight change, and a preset threshold rule when the weight stability indicator indicates that the weight is stable. The flow rate determination result includes the creep drift determination result and the actual change determination result. The zero-point update module is used to determine the zero-point AD value and the weight-AD mapping calibration coefficient based on preset calibration parameters when the flow rate determination result is a creep drift determination result. It also determines the zero-point AD correction amount based on the weight difference and the weight-AD mapping calibration coefficient, and performs addition and subtraction update processing on the zero-point AD value according to the sign of the weight difference to obtain the updated zero-point AD value. The weight recalculation module is used to perform weight conversion processing based on the sampled AD value, the updated zero-point AD value, and the weight-AD mapping calibration coefficient to obtain the updated real-time weight value. The stable update module is used to update the stable weight value based on the current real-time weight value if the flow rate determination result is a true change determination result, so as to obtain the updated stable weight value.
[0020] By adopting the above technical solution, the problem of continuous weight value shift caused by the slow drift of the bridge output of a resistive strain gauge pressure sensor under load can be addressed. Without relying on fixed waiting times or manual tare, a continuous sampling sequence is formed based on the real-time weight value, and a stability judgment is performed to obtain a weight stability indicator. When the weight stability indicator indicates that the weight is stable, the real-time weight value is recorded as the stable weight value, and the weight difference is calculated. Simultaneously, the weight change velocity is calculated based on the continuous sampling sequence and a preset sampling period. Based on the weight difference, the weight change velocity, and a preset threshold rule, a creep drift judgment result or a true change judgment result is obtained. Thus, when the external load remains constant or changes only slightly but the bridge output still drifts slowly, the judgment result is aligned with the creep drift judgment result, and the zero-point AD value is updated by addition or subtraction to correct the zero-point reference. When the external load undergoes a true change, the judgment result is aligned with the true change judgment result, and the stable weight value is updated to follow the load change. This avoids the lag and masking of true changes caused by filtering and smoothing alone, and also avoids the dependence of periodic recalibration and temperature compensation curves on additional calibration conditions and environmental data.
[0021] The above-mentioned objective three of this application is achieved through the following technical solution: A computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the above-described strain gauge pressure sensor creep compensation method.
[0022] The fourth objective of this application is achieved through the following technical solution: A computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the above-described creep compensation method for a strain gauge pressure sensor.
[0023] In summary, this application includes at least one of the following beneficial technical effects: 1. This system addresses the issue of continuous weight value shifts caused by the slow drift of the bridge output of a resistive strain gauge pressure sensor under load. Without relying on fixed waiting times or manual tare, it generates a continuous sampling sequence based on real-time weight values and performs stability checks to obtain a weight stability indicator. When the weight stability indicator indicates stable weight, the real-time weight value is recorded as the stable weight value, and the weight difference is calculated. Simultaneously, the weight change velocity is calculated based on the continuous sampling sequence and a preset sampling period. Based on the weight difference, weight change velocity, and preset threshold rules, either a creep drift determination result or a true change determination result is obtained. Thus, when the external load remains constant or changes only slightly but the bridge output still drifts slowly, the determination result is aligned with the creep drift determination result, and the zero-point AD value is updated by addition or subtraction to correct the zero-point reference. When the external load undergoes a true change, the determination result is aligned with the true change determination result, and the stable weight value is updated to follow the load change. This avoids the lag and masking of true changes caused by filtering and smoothing alone, and also avoids the dependence of periodic recalibration and temperature compensation curves on additional calibration conditions and environmental data. Attached Figure Description
[0024] Figure 1 This is a flowchart of a creep compensation method for a strain gauge pressure sensor according to one embodiment of this application.
[0025] Figure 2 This is a flowchart illustrating the implementation of step S6 in a creep compensation method for a strain gauge pressure sensor according to an embodiment of this application. Figure 3 This is a flowchart illustrating the implementation of step S603 in a creep compensation method for a strain gauge pressure sensor according to an embodiment of this application. Figure 4 This is a flowchart illustrating the implementation of step S8 in a creep compensation method for a strain gauge pressure sensor according to an embodiment of this application. Figure 5 This is a flowchart illustrating the implementation of step S803 in a creep compensation method for a strain gauge pressure sensor according to an embodiment of this application. Figure 6 This is a flowchart illustrating the implementation of step S9 in a creep compensation method for a strain gauge pressure sensor according to an embodiment of this application. Figure 7 This is a flowchart illustrating the implementation of step S902 in a creep compensation method for a strain gauge pressure sensor according to an embodiment of this application. Detailed Implementation
[0026] The present application will be further described in detail below with reference to the accompanying drawings.
[0027] In one embodiment, such as Figure 1 As shown, this application discloses a creep compensation method for a strain gauge pressure sensor, which specifically includes the following steps: S1: Obtain the bridge output sampling value of the resistance strain gauge pressure sensor under loading condition, perform analog-to-digital conversion on the bridge output sampling value to obtain the sampled AD value.
[0028] In this embodiment, the loading state refers to the resistance strain gauge pressure sensor bearing an external load and the bridge circuit being in a working state where the output changes with the load. The bridge circuit output sample value refers to the analog output value obtained from the bridge circuit output terminal in the loading state. The analog-to-digital conversion process refers to the process of converting the bridge circuit output sample value from an analog quantity to a digital code value. The sampled AD value refers to the digital code value output by the analog-to-digital conversion process that corresponds one-to-one with the bridge circuit output sample value.
[0029] Specifically, the bridge output terminal continuously outputs an analog signal that varies with the load under load. The bridge output sample value is read at each sampling time according to the preset sampling period and a sampling order is formed. The bridge output sample value corresponding to each sampling time is input into the analog-to-digital conversion process. During the analog-to-digital conversion process, the bridge output sample value is mapped to a digital code value according to the internal discrete coding rules and output. The output digital code value is determined as the sampling AD value.
[0030] S2: Perform weight conversion processing on the sampled AD value based on the preset calibration parameters to obtain the real-time weight value.
[0031] In this embodiment, the preset calibration parameters refer to the set of parameters determined during the calibration stage and used to describe the correspondence between the sampled AD value and the weight. The preset calibration parameters include at least the zero-point AD value and the weight-AD mapping calibration coefficient. The weight conversion process refers to the conversion process of performing zero-point alignment on the sampled AD value based on the zero-point AD value and converting the aligned AD value into a weight value based on the weight-AD mapping calibration coefficient. The real-time weight value refers to the weight value corresponding to the current sampled AD value and used to characterize the weight of the current loading state. The real-time weight value and the stable weight value are used together for subsequent creep determination and zero-point compensation logic.
[0032] Specifically, the zero-point AD value and the weight-AD mapping calibration coefficient in the preset calibration parameters are read. The difference between the sampled AD value and the zero-point AD value is calculated to obtain the differential AD value. The differential AD value and the weight-AD mapping calibration coefficient are converted to obtain the real-time weight value. The weight-AD mapping calibration coefficient represents the AD change corresponding to a unit weight or the AD change corresponding to a preset calibration weight span. When the weight-AD mapping calibration coefficient represents the AD change corresponding to 0 to 100g, the real-time weight value is converted to a weight value according to the ratio between the differential AD value and the weight-AD mapping calibration coefficient. For example, when the zero-point AD value is 800 and the weight-AD mapping calibration coefficient corresponds to an AD change of 200 from 0 to 100g, the differential AD value corresponding to the sampled AD value of 900 is 100, and the real-time weight value is converted to 50g.
[0033] S3: Obtain a continuous sampling sequence of real-time weight values under a preset sampling period, perform stability determination processing based on the continuous sampling sequence, and obtain a weight stability flag.
[0034] In this embodiment, the continuous sampling sequence refers to a sequence of multiple real-time weight values arranged in chronological order under a preset sampling period constraint. The stability determination process refers to the process of judging whether the weight is in a stable state based on the changes in the real-time weight values in the continuous sampling sequence between adjacent sampling times. The weight stability flag refers to the flag information used to characterize the stability determination result. The weight stability flag is used to indicate whether the weight is stable or unstable.
[0035] Specifically, the real-time weight value acquisition operation is repeatedly performed according to a preset sampling period, and the real-time weight values obtained in chronological order are sequentially written into a continuous sampling sequence. During the stability determination process, the first real-time weight value and the second real-time weight value corresponding to adjacent sampling times are read from the continuous sampling sequence, and the weight change is obtained by performing a difference calculation on the first real-time weight value and the second real-time weight value. The absolute value of the weight change is compared with a preset stability threshold. When the absolute value of the weight change is not greater than the preset stability threshold, it is determined that the weight corresponding to the adjacent sampling time is in a stable state, and the adjacent sampling times in the continuous sampling sequence that meet the stable state are included in the stability count value. When the stability count value reaches a preset stability count threshold, the weight stability flag is set to indicate that the weight is stable. When the stability count value does not reach the preset stability count threshold, the weight stability flag is set to indicate that the weight is unstable.
[0036] S4: When the weight stability flag indicates that the weight is stable and the real-time weight value meets the preset weight threshold, the current real-time weight value is recorded as the stable weight value.
[0037] In this embodiment, the preset weight threshold refers to a weight threshold parameter used to limit the triggering conditions for recording stable weight values. The stable weight value recording triggering conditions are used to avoid recording stable weight values when the weight is too small or has not reached the effective loading range. The preset weight threshold is stored in the preset threshold rules and is used together with the weight stability flag to trigger the recording action of stable weight values.
[0038] Specifically, after each real-time weight value is obtained, the weight stability flag is read and the preset weight threshold is read. The real-time weight value is compared with the preset weight threshold. When the weight stability flag indicates that the weight is stable and the real-time weight value is not less than the preset weight threshold, the real-time weight value is written to the stable weight value storage location and the original stable weight value is overwritten. The written value is used as the stable weight value. For example, when the preset weight threshold corresponds to 10g and the weight stability flag continuously indicates that the weight is stable, if the real-time weight value appears consecutively from 11g, 11g, 11g, then 11g, then 11g, then 11g, then 11g, then 11g, then 12 ...
[0039] S5: Perform difference calculation processing based on the real-time weight value and the stable weight value to obtain the weight difference.
[0040] In this embodiment, the weight difference refers to the difference between the real-time weight value and the stable weight value. The weight difference is used to characterize the direction and magnitude of the deviation of the current real-time weight value from the stable weight value. A positive weight difference indicates that the real-time weight value is greater than the stable weight value, a negative weight difference indicates that the real-time weight value is less than the stable weight value, and a weight difference of zero indicates that the real-time weight value is consistent with the stable weight value.
[0041] Specifically, the current real-time weight value and the current stable weight value are read, and the real-time weight value is subtracted from the stable weight value to obtain the weight difference. When the real-time weight value is A and the stable weight value is B, the weight difference is A−B. For example, when the real-time weight value is 50g and the stable weight value is 48g, the weight difference is 2g; when the real-time weight value is 48g and the stable weight value is 50g, the weight difference is −2g; and when the real-time weight value is 50g and the stable weight value is 50g, the weight difference is 0g.
[0042] S6: Perform flow rate calculation processing based on the continuous sampling sequence and the preset sampling period to obtain the weight change flow rate.
[0043] In this embodiment, the weight change rate refers to the rate at which the real-time weight value changes over time in a continuous sampling sequence. The weight change rate is used to characterize the correspondence between the direction and magnitude of the change in the real-time weight value between adjacent sampling times within a preset sampling period. A positive weight change rate indicates that the real-time weight value is increasing, a negative weight change rate indicates that the real-time weight value is decreasing, and a zero weight change rate indicates that the real-time weight value is unchanged or the change is negligible.
[0044] Specifically, the first real-time weight value and the second real-time weight value corresponding to adjacent sampling times are read from the continuous sampling sequence. The first real-time weight value is subtracted from the second real-time weight value to obtain the weight change. The weight change is then compared with a preset sampling period to obtain the weight change rate. When the first real-time weight value is W1 and the second real-time weight value is W2 and the preset sampling period is T, the weight change is W2−W1 and the weight change rate is (W2−W1) / T. For example, when the preset sampling period is 1s, the first real-time weight value is 50g, and the second real-time weight value is 50.2g, the weight change is 0.2g and the weight change rate is 0.2g / s. When the preset sampling period is 1s, the first real-time weight value is 50g, and the second real-time weight value is 49.8g, the weight change is −0.2g and the weight change rate is −0.2g / s.
[0045] S7: When the weight stability indicator indicates that the weight is stable, the flow rate determination result is obtained based on the weight difference, the weight change flow rate and the preset threshold rule. The flow rate determination result includes the creep drift determination result and the actual change determination result.
[0046] In this embodiment, the preset threshold rule refers to a set of rules used to make threshold judgments on the weight difference and the weight change flow rate. The preset threshold rule includes at least a preset weight difference threshold, a preset slow change flow rate range, and a preset true change flow rate threshold. The flow rate judgment result refers to the result information obtained by judging the weight difference and the weight change flow rate according to the preset threshold rule. The creep drift judgment result refers to the result information indicating that the weight difference is slowly drifting under the weight stability condition and that zero-point AD value update needs to be performed. The true change judgment result refers to the result information indicating that the weight difference is caused by the true change of load and that stable weight value update needs to be performed.
[0047] Specifically, when the weight stability indicator indicates that the weight is stable, the weight difference and the weight change rate are read. The preset weight difference threshold, the preset slow change rate range, and the preset true change rate threshold are also read from the preset threshold rules. The absolute value of the weight difference is taken and compared with the preset weight difference threshold to determine whether the weight difference reaches the discrimination threshold. When the absolute value of the weight difference is not less than the preset weight difference threshold, the weight change rate is compared with the preset slow change rate range to determine whether the weight change rate is in a slow change state. When the weight change rate is in the preset slow change rate range, the rate determination result is determined as the creep drift determination result. When the weight change rate is not in the preset slow change rate range, the weight change rate is compared with the preset true change rate threshold. When the weight change rate is not less than the preset true change rate threshold or not greater than the negative threshold of the preset true change rate threshold, the rate determination result is determined as the true change determination result. When the absolute value of the weight difference is less than the preset weight difference threshold, the rate determination result is determined as the true change determination result.
[0048] S8: When the flow rate determination result is the creep drift determination result, the zero point AD value and the weight-AD mapping calibration coefficient are determined based on the preset calibration parameters, the zero point AD correction amount is determined based on the weight difference and the weight-AD mapping calibration coefficient, and the zero point AD value is updated by adding or subtracting according to the sign of the weight difference to obtain the updated zero point AD value.
[0049] In this embodiment, the zero-point AD correction amount refers to the AD amount calculated from the weight difference and used to correct the zero-point AD value. The updated zero-point AD value refers to the zero-point AD value update result obtained by superimposing the zero-point AD correction amount on the zero-point AD value. The zero-point AD correction amount and the updated zero-point AD value are used to keep the zero-point alignment reference in the weight conversion process consistent with the current weight stability state.
[0050] Specifically, when the flow velocity determination result is a creep drift determination result, the zero-point AD value and weight-AD mapping calibration coefficient in the preset calibration parameters are read, and the current weight difference is read. A conversion relationship is established between the weight difference and the weight-AD mapping calibration coefficient to obtain the zero-point AD correction amount. The weight difference is used to characterize the deviation of the real-time weight value from the stable weight value, and the weight-AD mapping calibration coefficient is used to characterize the proportional correspondence between weight and AD. The weight difference is converted into an equivalent AD offset to obtain the zero-point AD correction amount. Then, the update direction of the zero-point AD value is determined according to the sign of the weight difference. When the weight difference is greater than zero, the zero point... The AD correction is added to the zero-point AD value to obtain the updated zero-point AD value. When the weight difference is less than zero, the zero-point AD correction is subtracted from the zero-point AD value to obtain the updated zero-point AD value. When the weight difference is equal to zero, the zero-point AD value is determined as the updated zero-point AD value. For example, if the zero-point AD value is 800 and the weight-AD mapping calibration coefficient represents a change of 200 AD corresponding to 100g, and the weight difference is 2g, then the zero-point AD correction is converted to 4AD and the zero-point AD value is updated to 804. If the zero-point AD value is 800 and the weight difference is −2g, then the zero-point AD correction is converted to 4AD and the zero-point AD value is updated to 796.
[0051] S9: Perform weight conversion processing based on the sampled AD value, the updated zero-point AD value, and the weight-AD mapping calibration coefficient to obtain the updated real-time weight value.
[0052] In this embodiment, the updated real-time weight value refers to the updated real-time weight value obtained by converting the sampled AD value according to the weight-AD mapping calibration coefficient when the updated zero-point AD value is used as the zero-point alignment reference. The updated real-time weight value is used to replace the real-time weight value in subsequent stability determination and difference calculation.
[0053] Specifically, the sampled AD value, the updated zero-point AD value, and the weight-AD mapping calibration coefficient are read. The sampled AD value and the updated zero-point AD value are then compared to obtain the differential AD value. The differential AD value is then compared with a preset valid AD range. When the differential AD value falls within the preset valid AD range, a proportional conversion relationship is established between the differential AD value and the weight-AD mapping calibration coefficient to obtain the AD normalization ratio. The AD normalization ratio is then multiplied by a preset calibration weight span to obtain the updated real-time weight value. For example, when the updated zero-point AD value is 804 and the sampled AD value is 900, the differential AD value is 96. The weight-AD mapping calibration coefficient represents the AD normalization ratio when 100g corresponds to a 200AD change, which is 96 / 200. The AD normalization ratio is then multiplied by 100g to obtain the updated real-time weight value of 48g.
[0054] S10: If the flow rate determination result is a true change determination result, then the stable weight value is updated based on the current real-time weight value to obtain the updated stable weight value.
[0055] In this embodiment, the updated stable weight value refers to the stable weight value result after updating the stable weight value according to the current real-time weight value when the flow rate determination result indicates a real change. The updated stable weight value is used to replace the stable weight value in the subsequent calculation of the weight difference.
[0056] Specifically, when the flow rate determination result is a true change determination result, the current real-time weight value and the current stable weight value are read, and the current real-time weight value is compared with a preset weight threshold. When the current real-time weight value meets the preset weight threshold, the current real-time weight value is written to the stable weight value storage location and the original stable weight value is overwritten. The written value is determined as the updated stable weight value. For example, if the stable weight value is 50g and the current real-time weight value is 52g and the preset weight threshold is met, 52g is written to the stable weight value and 52g is determined as the updated stable weight value. If the stable weight value is 50g and the current real-time weight value is 48g and the preset weight threshold is met, 48g is written to the stable weight value and 48g is determined as the updated stable weight value.
[0057] In one embodiment, such as Figure 2 As shown, in step S6, namely, the flow rate calculation process based on the continuous sampling sequence and the preset sampling period to obtain the weight change flow rate, includes: S601: Obtain the first real-time weight value and the second real-time weight value corresponding to adjacent sampling times in the continuous sampling sequence.
[0058] In this embodiment, the first real-time weight value refers to the real-time weight value corresponding to the earlier sampling time in the continuous sampling sequence, and the second real-time weight value refers to the real-time weight value corresponding to the later sampling time adjacent to the earlier sampling time. Adjacent sampling times refer to two sampling times that are sequentially adjacent and are spaced apart by a preset sampling period.
[0059] Specifically, two adjacent sequence elements are read according to the time order of the continuous sampling sequence, and the sequence element with the earlier time order is determined as the first real-time weight value, and the sequence element with the next later time order is determined as the second real-time weight value. When reading, the adjacent index interval corresponding to the preset sampling period is used as the judgment condition for adjacent sampling time. For example, when the continuous sampling sequence is arranged according to sampling time t1, t2, t3, the real-time weight value corresponding to t1 is read as the first real-time weight value and the real-time weight value corresponding to t2 is read as the second real-time weight value, or the real-time weight value corresponding to t2 is read as the first real-time weight value and the real-time weight value corresponding to t3 is read as the second real-time weight value.
[0060] S602: Perform differential calculation processing based on the first real-time weight value and the second real-time weight value to obtain the weight change.
[0061] In this embodiment, the weight change refers to the change in the second real-time weight value relative to the first real-time weight value. A positive weight change indicates that the second real-time weight value is greater than the first real-time weight value, a negative weight change indicates that the second real-time weight value is less than the first real-time weight value, and a zero weight change indicates that the second real-time weight value is the same as the first real-time weight value.
[0062] Specifically, the first real-time weight value and the second real-time weight value are read, and the first real-time weight value is subtracted from the second real-time weight value to obtain the weight change. When the first real-time weight value is W1 and the second real-time weight value is W2, the weight change is W2−W1. For example, when the first real-time weight value is 50g and the second real-time weight value is 50.2g, the weight change is 0.2g; when the first real-time weight value is 50g and the second real-time weight value is 49.8g, the weight change is −0.2g; and when the first real-time weight value is 50g and the second real-time weight value is 50g, the weight change is 0g.
[0063] S603: Perform ratio calculation based on the weight change and the preset sampling period to obtain the weight change flow rate.
[0064] In this embodiment, the weight change rate refers to the ratio of the weight change amount to the corresponding time interval of the preset sampling period. The weight change rate is used to characterize the rate of change of the weight amount per unit time. A positive weight change rate is used to characterize the weight increase, a negative weight change rate is used to characterize the weight decrease, and a zero weight change rate is used to characterize no weight change or negligible weight change.
[0065] Specifically, the weight change is read and the preset sampling period is calculated. The weight change is then divided by the preset sampling period to obtain the weight change flow rate. When the weight change is ΔW and the preset sampling period is T, the weight change flow rate is ΔW / T. For example, when the weight change is 0.2g and the preset sampling period is 1s, the weight change flow rate is 0.2g / s; when the weight change is −0.2g and the preset sampling period is 1s, the weight change flow rate is −0.2g / s; and when the weight change is 0g and the preset sampling period is 1s, the weight change flow rate is 0g / s.
[0066] In one embodiment, such as Figure 3 As shown, in step S603, the ratio calculation process includes: S6031: Divide the weight change by the preset sampling period to obtain the original value of the weight change flow rate.
[0067] In this embodiment, the original value of the weight change flow rate refers to the weight change flow rate calculation result obtained by dividing the weight change amount by the preset sampling period without scaling or rounding.
[0068] Specifically, the weight change and the preset sampling period are read, and a division operation is performed on the weight change and the preset sampling period to obtain the original value of the weight change flow rate. When the weight change is ΔW and the preset sampling period is T, the original value of the weight change flow rate is ΔW / T. For example, when the weight change is 0.2g and the preset sampling period is 1s, the original value of the weight change flow rate is 0.2g / s; when the weight change is −0.2g and the preset sampling period is 1s, the original value of the weight change flow rate is −0.2g / s; and when the weight change is 0g and the preset sampling period is 1s, the original value of the weight change flow rate is 0g / s.
[0069] S6032: When the weight change is greater than zero, the original value of the weight change flow rate is determined as the original value of the positive weight change flow rate; when the weight change is less than zero, the original value of the weight change flow rate is determined as the original value of the negative weight change flow rate.
[0070] In this embodiment, the original value of positive weight change flow rate refers to the original value of weight change flow rate when the weight change is positive, and the original value of negative weight change flow rate refers to the original value of weight change flow rate when the weight change is negative. The original values of positive and negative weight change flow rate are used to distinguish the direction of weight change and to keep the signs of the original value of weight change flow rate consistent with the weight change.
[0071] Specifically, the weight change is read and a sign judgment is performed. When the weight change is greater than zero, the original value of the weight change flow rate is directly assigned to the original value of the positive weight change flow rate. When the weight change is less than zero, the original value of the weight change flow rate is directly assigned to the original value of the negative weight change flow rate. For example, when the weight change is 0.2g, the original value of the weight change flow rate is 0.2g / s and is assigned to the original value of the positive weight change flow rate. When the weight change is −0.2g, the original value of the weight change flow rate is −0.2g / s and is assigned to the original value of the negative weight change flow rate.
[0072] S6033: Multiply the original value of the weight change flow rate by a preset flow rate scaling factor to obtain a flow rate scale value, and round the flow rate scale value to obtain the weight change flow rate.
[0073] In this embodiment, the preset flow rate scaling factor refers to the coefficient parameter used to numerically scale the original value of the flow rate of weight change to form a discrete representation scale, the flow rate scale value refers to the scaling result obtained by multiplying the original value of the flow rate of weight change by the preset flow rate scaling factor, and rounding refers to the numerical normalization method of converting the flow rate scale value into an integer value.
[0074] Specifically, the original value of the weight change flow rate and the preset flow rate scaling factor are read, and the original value of the weight change flow rate and the preset flow rate scaling factor are multiplied to obtain the flow rate scale value. Then, the flow rate scale value is rounded to obtain an integer flow rate value, and the integer flow rate value is determined as the weight change flow rate. For example, when the original value of the weight change flow rate is 0.23 g / s and the preset flow rate scaling factor is 10, the flow rate scale value is 2.3. The flow rate scale value is rounded to obtain 2, and 2 is determined as the weight change flow rate. When the original value of the weight change flow rate is −0.23 g / s and the preset flow rate scaling factor is 10, the flow rate scale value is −2.3. The flow rate scale value is rounded to obtain −2, and −2 is determined as the weight change flow rate.
[0075] In one embodiment, such as Figure 4 As shown, in step S8, when the flow rate determination result is a creep drift determination result, the zero-point AD value and the weight-AD mapping calibration coefficient are determined based on preset calibration parameters, the zero-point AD correction amount is determined based on the weight difference and the weight-AD mapping calibration coefficient, and the zero-point AD value is updated by addition or subtraction according to the sign of the weight difference to obtain the updated zero-point AD value, including: S801: Under the condition that the absolute value of the weight difference is not less than the preset weight difference threshold and the weight change flow rate is within the preset slow change flow rate range, the weight difference is divided by the preset weight normalization benchmark value in the preset calibration parameters to obtain the weight normalization ratio value.
[0076] In this embodiment, the weight normalization ratio refers to the ratio of the weight difference to the preset weight normalization reference value. The weight normalization ratio is used to characterize the relative magnitude of the weight difference under the preset weight normalization reference value scale and to maintain the sign information of the weight difference.
[0077] Specifically, the weight difference is read and its absolute value is calculated. A preset weight difference threshold is read and the absolute value of the weight difference is compared with the preset weight difference threshold to determine whether the weight difference meets the condition of not being less than the preset weight difference threshold. At the same time, the weight change flow rate is read and the weight change flow rate is compared with a preset slow change flow rate interval to determine whether the weight change flow rate is within the preset slow change flow rate interval. If the absolute value of the weight difference is not less than the preset weight difference threshold and the weight change flow rate is within the preset slow change flow rate interval, the preset weight normalization reference value in the preset calibration parameters is read, and the weight difference is divided by the preset weight normalization reference value to obtain the weight normalization ratio value. For example, when the preset weight normalization reference value is 100g and the weight difference is 2g, the weight normalization ratio value is 0.02. When the preset weight normalization reference value is 100g and the weight difference is −2g, the weight normalization ratio value is −0.02.
[0078] S802: Multiply the weight normalization ratio value by the weight-AD mapping calibration coefficient to obtain the zero-point AD correction amount.
[0079] In this embodiment, the zero-point AD correction amount refers to the AD amount obtained by converting the weight normalization ratio value and the weight-AD mapping calibration coefficient and used to update the zero-point AD value.
[0080] Specifically, the weight normalization ratio and the weight-AD mapping calibration coefficient are read, and a multiplication operation is performed on the weight normalization ratio and the weight-AD mapping calibration coefficient to obtain the zero-point AD correction amount. The weight normalization ratio is used to characterize the proportional relationship between the weight difference and the preset weight normalization reference value, and the weight-AD mapping calibration coefficient is used to characterize the AD change amount corresponding to the preset calibration weight span. The zero-point AD correction amount obtained by the multiplication operation is used to characterize the amount of AD that should be updated under the said proportional relationship. For example, when the weight normalization ratio is 0.02 and the weight-AD mapping calibration coefficient characterizes a 200 AD change amount corresponding to the preset calibration weight span, the zero-point AD correction amount is 4AD. When the weight normalization ratio is −0.02 and the weight-AD mapping calibration coefficient characterizes a 200 AD change amount corresponding to the preset calibration weight span, the zero-point AD correction amount is −4AD.
[0081] S803: Compare the absolute value of the zero-point AD correction with the preset correction step threshold in the preset calibration parameters. When the absolute value of the zero-point AD correction is greater than the preset correction step threshold, the preset correction step threshold is determined as the target zero-point AD correction. When the absolute value of the zero-point AD correction is not greater than the preset correction step threshold, the absolute value of the zero-point AD correction is determined as the target zero-point AD correction.
[0082] In this embodiment, the target zero-point AD correction amount refers to the zero-point AD correction amount determined under the constraint of a preset correction step threshold for updating the zero-point AD value.
[0083] Specifically, the zero-point AD correction value is read and its absolute value is calculated. The preset correction step threshold in the preset calibration parameters is read and compared with the absolute value of the zero-point AD correction value. When the absolute value of the zero-point AD correction value is greater than the preset correction step threshold, the preset correction step threshold is assigned as the target zero-point AD correction value. When the absolute value of the zero-point AD correction value is not greater than the preset correction step threshold, the absolute value of the zero-point AD correction value is assigned as the target zero-point AD correction value. For example, when the preset correction step threshold is 5AD and the zero-point AD correction value is 8AD, the absolute value of the zero-point AD correction value is 8AD and greater than 5AD, so 5AD is determined as the target zero-point AD correction value. When the preset correction step threshold is 5AD and the zero-point AD correction value is 4AD, the absolute value of the zero-point AD correction value is 4AD and not greater than 5AD, so 4AD is determined as the target zero-point AD correction value.
[0084] S804: When the weight difference is greater than zero, the target zero-point AD correction amount is added to the zero-point AD value to obtain the updated zero-point AD value; when the weight difference is less than zero, the target zero-point AD correction amount is subtracted from the zero-point AD value to obtain the updated zero-point AD value; when the weight difference is equal to zero, the zero-point AD value is determined as the updated zero-point AD value.
[0085] In this embodiment, the addition / subtraction update process refers to the update method that selects addition or subtraction update based on the sign of the weight difference to form the updated zero-point AD value.
[0086] Specifically, the weight difference is read and a sign determination is performed. Simultaneously, the target zero-point AD correction and the zero-point AD value are read. When the weight difference is greater than zero, an addition operation is performed on the target zero-point AD correction and the zero-point AD value to obtain the updated zero-point AD value. When the weight difference is less than zero, a subtraction operation is performed on the target zero-point AD correction and the zero-point AD value to obtain the updated zero-point AD value. When the weight difference is equal to zero, the updated zero-point AD value is directly assigned to the zero-point AD value. For example, when the zero-point AD value is 800, the target zero-point AD correction is 4AD, and the weight difference is 2g, the updated zero-point AD value is 804. When the zero-point AD value is 800, the target zero-point AD correction is 4AD, and the weight difference is −2g, the updated zero-point AD value is 796. When the zero-point AD value is 800, the target zero-point AD correction is 4AD, and the weight difference is 0g, the updated zero-point AD value is 800.
[0087] In one embodiment, such as Figure 5As shown, in step S803, i.e., the preset correction step threshold, the following are included: S8031: Determine the basic step threshold based on the preset calibration parameters, wherein the basic step threshold corresponds to the weight-AD mapping calibration coefficient.
[0088] In this embodiment, the basic step threshold refers to the basic threshold parameter used to generate the preset corrected step threshold. The correspondence between the basic step threshold and the weight-AD mapping calibration coefficient means that the value of the basic step threshold is determined based on the proportional relationship between weight and AD represented by the weight-AD mapping calibration coefficient.
[0089] Specifically, the weight-AD mapping calibration coefficient in the preset calibration parameters is read, and the basic step threshold is determined based on the AD change corresponding to the preset calibration weight span represented by the weight-AD mapping calibration coefficient. The basic step threshold is determined as a preset proportion value of the AD change corresponding to the preset calibration weight span. For example, when the weight-AD mapping calibration coefficient represents a 200 AD change corresponding to the preset calibration weight span, the preset proportion value corresponding to the 200 AD change is determined as the basic step threshold.
[0090] S8032: When the weight change flow rate is within the preset slow change flow rate range, determine the step weight coefficient based on the interval position of the weight change flow rate and the preset slow change flow rate range.
[0091] In this embodiment, the step weight coefficient refers to the coefficient parameter used to weight the basic step threshold to generate the preset modified step threshold, and the interval position refers to the relative position of the weight change velocity within the preset slow change velocity interval relative to the lower limit and the upper limit of the interval.
[0092] Specifically, the lower and upper limits of a preset slow-changing flow rate interval are read, and the weight change flow rate is read. The weight change flow rate is compared with the lower and upper limits of the interval to confirm that the weight change flow rate is within the preset slow-changing flow rate interval. If the weight change flow rate is within the preset slow-changing flow rate interval, the lower limit of the interval is subtracted from the weight change flow rate to obtain the interval offset. The interval offset is then compared with the interval span obtained by subtracting the lower limit from the upper limit to obtain the interval position ratio. The interval position ratio is mapped to a preset weight mapping rule to determine the step weight coefficient. For example, when the lower limit of the preset slow-changing flow rate interval is −0.2g / s, the upper limit of the interval is 0.2g / s, and the weight change flow rate is 0g / s, the interval position ratio is 0.5. The step weight coefficient corresponding to 0.5 is determined as the preset value according to the preset weight mapping rule.
[0093] S8033: Multiply the basic step threshold by the step weight coefficient to obtain the preset modified step threshold.
[0094] In this embodiment, the preset correction step threshold refers to the step threshold parameter used to limit the single action amplitude of the zero-point AD correction amount. The preset correction step threshold is used as the basis for determining the target zero-point AD correction amount.
[0095] Specifically, the basic step threshold and step weight coefficient are read, and a multiplication operation is performed on the basic step threshold and step weight coefficient to obtain the preset corrected step threshold. When the basic step threshold is S0 and the step weight coefficient is K, the preset corrected step threshold is S0×K. For example, when the basic step threshold is 5AD and the step weight coefficient is 0.8, the preset corrected step threshold is 4AD, and when the basic step threshold is 5AD and the step weight coefficient is 1.2, the preset corrected step threshold is 6AD.
[0096] In one embodiment, such as Figure 6 As shown, in step S9, the weight conversion process is performed based on the sampled AD value, the updated zero-point AD value, and the weight-AD mapping calibration coefficient to obtain the updated real-time weight value, including: S901: Subtract the sampled AD value from the updated zero-point AD value to obtain the differential AD value.
[0097] In this embodiment, the differential AD value refers to the difference between the sampled AD value and the updated zero-point AD value. The differential AD value is used to characterize the AD offset of the sampled AD value after zero-point alignment.
[0098] Specifically, the sampled AD value and the updated zero-point AD value are read, and a subtraction operation is performed between the sampled AD value and the updated zero-point AD value to obtain the difference AD value. When the sampled AD value is AD1 and the updated zero-point AD value is AD0, the difference AD value is AD1−AD0. For example, when the sampled AD value is 900 and the updated zero-point AD value is 804, the difference AD value is 96; when the sampled AD value is 800 and the updated zero-point AD value is 804, the difference AD value is −4; and when the sampled AD value is 804 and the updated zero-point AD value is 804, the difference AD value is 0.
[0099] S902: Compare the differential AD value with the preset valid AD interval. When the differential AD value falls into the preset valid AD interval, divide the differential AD value by the weight-AD mapping calibration coefficient to obtain the AD normalization ratio value.
[0100] In this embodiment, the preset effective AD interval refers to the interval parameter used to limit the effective range of the differential AD value, and the AD normalization ratio refers to the ratio obtained by dividing the differential AD value by the weight-AD mapping calibration coefficient. The AD normalization ratio is used to characterize the relative amplitude of the differential AD value under the weight-AD mapping calibration coefficient scale.
[0101] Specifically, the lower limit AD value and upper limit AD value of the preset valid AD interval are read, and the difference AD value is read. The difference AD value is compared with the lower limit AD value and the upper limit AD value. When the difference AD value is not less than the lower limit AD value and not greater than the upper limit AD value, it is determined that the difference AD value falls into the preset valid AD interval. After determining that the difference AD value falls into the preset valid AD interval, the weight-AD mapping calibration coefficient is read, and the difference AD value is divided by the weight-AD mapping calibration coefficient to obtain the AD normalization ratio value. For example, when the preset valid AD interval is 0 to 200, the difference AD value is 96, and the weight-AD mapping calibration coefficient represents the AD change of 200 corresponding to the preset calibration weight span, the AD normalization ratio value is 96 / 200.
[0102] S903: Multiply the AD normalization ratio value by the preset calibration weight span to obtain the updated real-time weight value.
[0103] In this embodiment, the preset calibration weight span refers to the weight range parameter used to determine the weight-AD mapping calibration coefficient during the calibration stage. The preset calibration weight span and the weight-AD mapping calibration coefficient maintain a corresponding relationship. The preset calibration weight span is stored in the preset calibration parameters and is used to convert the AD normalization ratio value into a weight value.
[0104] Specifically, the AD normalization ratio and the preset calibration weight span are read, and the AD normalization ratio and the preset calibration weight span are multiplied to obtain the updated real-time weight value. When the AD normalization ratio is R and the preset calibration weight span is Wspan, the updated real-time weight value is R×Wspan. For example, when the AD normalization ratio is 0.48 and the preset calibration weight span is 100g, the updated real-time weight value is 48g, and when the AD normalization ratio is 0.02 and the preset calibration weight span is 100g, the updated real-time weight value is 2g.
[0105] In one embodiment, such as Figure 7 As shown, in step S902, namely, comparing the differential AD value with a preset valid AD interval, when the differential AD value falls within the preset valid AD interval, the process includes: S9021: Store the lower limit AD value and the upper limit AD value of the preset valid AD interval in the preset calibration parameters.
[0106] In this embodiment, the lower limit AD value of the interval refers to the lower boundary AD value corresponding to the preset valid AD interval, and the upper limit AD value of the interval refers to the upper boundary AD value corresponding to the preset valid AD interval.
[0107] Specifically, when generating the preset calibration parameters, the lower limit AD value and the upper limit AD value corresponding to the preset valid AD range are determined. In the preset calibration parameters, a lower limit storage item corresponding to the lower limit AD value and an upper limit storage item corresponding to the upper limit AD value are set for the preset valid AD range. The lower limit AD value is written to the lower limit storage item and the upper limit AD value is written to the upper limit storage item, so that the preset calibration parameters simultaneously contain the lower limit AD value and the upper limit AD value. For example, when the preset valid AD range is 0 to 200, 0 is written to the lower limit storage item and 200 is written to the upper limit storage item.
[0108] S9022: Read the lower limit AD value and the upper limit AD value of the interval based on the preset calibration parameters.
[0109] In this embodiment, reading refers to the operation of obtaining the lower limit AD value and the upper limit AD value of the interval corresponding to the preset valid AD interval from the preset calibration parameters.
[0110] Specifically, the lower limit storage item and the upper limit storage item corresponding to the preset valid AD interval in the preset calibration parameters are located, and the lower limit AD value of the interval is read from the lower limit storage item and the upper limit AD value of the interval is read from the upper limit storage item. The read lower limit AD value and upper limit AD value of the interval are used as the comparison boundary values for subsequent consistency comparison. For example, when the lower limit storage item record is 0 and the upper limit storage item record is 200, the lower limit AD value of the interval is read as 0 and the upper limit AD value of the interval is read as 200.
[0111] S9023: Compare the difference AD value with the lower limit AD value and the upper limit AD value of the interval. When the difference AD value is not less than the lower limit AD value and not greater than the upper limit AD value of the interval, determine that the difference AD value falls within the preset valid AD interval.
[0112] In this embodiment, falling into the preset valid AD interval means that the differential AD value is within the closed interval defined by the lower limit AD value and the upper limit AD value of the interval.
[0113] Specifically, the differential AD value, the lower limit AD value, and the upper limit AD value are read, and comparisons are performed between the differential AD value and the lower limit AD value, and between the differential AD value and the upper limit AD value. When the differential AD value is not less than the lower limit AD value and not greater than the upper limit AD value, a "falling in" condition is output, confirming that the differential AD value falls within the preset valid AD range. When the differential AD value is less than the lower limit AD value or greater than the upper limit AD value, a "not falling in" condition is output, confirming that the differential AD value does not fall within the preset valid AD range. For example, when the lower limit AD value is 0 and the upper limit AD value is 200, the differential AD value is 96, which satisfies the condition of not being less than 0 and not being greater than 200, thus confirming that the differential AD value falls within the preset valid AD range. The differential AD value is −4, which does not satisfy the condition of not being less than 0, thus confirming that the differential AD value does not fall within the preset valid AD range. The differential AD value is 220, which does not satisfy the condition of not being greater than 200, thus confirming that the differential AD value does not fall within the preset valid AD range.
[0114] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0115] In one embodiment, a creep compensation device for a strain gauge pressure sensor is provided, which corresponds one-to-one with the creep compensation method for a strain gauge pressure sensor described in the above embodiment. This creep compensation device includes a sampling conversion module, a weight conversion module, a stability determination module, a stability recording module, a difference calculation module, a flow rate calculation module, a flow rate determination module, a zero-point update module, a weight recalculation module, and a stability update module.
[0116] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is used as an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.
[0117] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.
Claims
1. A creep compensation method for a strain gauge pressure sensor, characterized in that, The creep compensation method for a strain gauge pressure sensor includes: Obtain the bridge circuit output sample value of the resistance strain gauge pressure sensor under loading state, perform analog-to-digital conversion on the bridge circuit output sample value to obtain the sampled AD value; The sampled AD values are converted into weight values based on preset calibration parameters to obtain real-time weight values. A continuous sampling sequence of real-time weight values is obtained under a preset sampling period. Stability determination processing is performed based on the continuous sampling sequence to obtain a weight stability indicator. When the weight stability indicator shows that the weight is stable and the real-time weight value meets the preset weight threshold, the current real-time weight value is recorded as the stable weight value. The weight difference is calculated by performing a difference calculation between the real-time weight value and the stable weight value. The flow rate is calculated based on the continuous sampling sequence and the preset sampling period to obtain the weight change flow rate. When the weight stability indicator shows that the weight is stable, the flow rate determination result is obtained based on the weight difference, the weight change flow rate and the preset threshold rule. The flow rate determination result includes the creep drift determination result and the actual change determination result. When the flow rate determination result is a creep drift determination result, the zero-point AD value and the weight-AD mapping calibration coefficient are determined based on the preset calibration parameters, the zero-point AD correction amount is determined based on the weight difference and the weight-AD mapping calibration coefficient, and the zero-point AD value is updated by adding or subtracting according to the sign of the weight difference to obtain the updated zero-point AD value. The weight conversion process is performed based on the sampled AD value, the updated zero-point AD value, and the weight-AD mapping calibration coefficient to obtain the updated real-time weight value; If the flow rate determination result is a true change determination result, then the stable weight value is updated based on the current real-time weight value to obtain the updated stable weight value.
2. The creep compensation method for a strain gauge pressure sensor according to claim 1, characterized in that, The process of calculating the flow rate based on a continuous sampling sequence and a preset sampling period to obtain the weight change flow rate includes: Obtain the first real-time weight value and the second real-time weight value corresponding to adjacent sampling times in a continuous sampling sequence; The weight change is obtained by performing differential calculation based on the first real-time weight value and the second real-time weight value. The weight change flow rate is obtained by performing a ratio calculation based on the weight change and the preset sampling period.
3. The creep compensation method for a strain gauge pressure sensor according to claim 2, characterized in that, The ratio calculation process includes: Divide the weight change by the preset sampling period to obtain the original value of the weight change flow rate; When the weight change is greater than zero, the original value of the weight change flow rate is determined as the original value of the positive weight change flow rate; when the weight change is less than zero, the original value of the weight change flow rate is determined as the original value of the negative weight change flow rate. Multiply the original value of the weight change velocity by the preset velocity scaling factor to obtain the velocity scale value. Round the velocity scale value to obtain the weight change velocity.
4. The creep compensation method for a strain gauge pressure sensor according to claim 1, characterized in that, When the flow velocity determination result is a creep drift determination result, the zero-point AD value and the weight-AD mapping calibration coefficient are determined based on preset calibration parameters. The zero-point AD correction amount is determined based on the weight difference and the weight-AD mapping calibration coefficient. The zero-point AD value is then updated by adding or subtracting according to the sign of the weight difference, resulting in the updated zero-point AD value, including: Under the condition that the absolute value of the weight difference is not less than the preset weight difference threshold and the weight change flow rate is within the preset slow change flow rate range, the weight difference is divided by the preset weight normalization benchmark value in the preset calibration parameters to obtain the weight normalization ratio value. Multiply the weight normalization ratio by the weight-AD mapping calibration coefficient to obtain the zero-point AD correction. The absolute value of the zero-point AD correction is compared with the preset correction step threshold in the preset calibration parameters. When the absolute value of the zero-point AD correction is greater than the preset correction step threshold, the preset correction step threshold is determined as the target zero-point AD correction. When the absolute value of the zero-point AD correction is not greater than the preset correction step threshold, the absolute value of the zero-point AD correction is determined as the target zero-point AD correction. When the weight difference is greater than zero, the target zero-point AD correction amount is added to the zero-point AD value to obtain the updated zero-point AD value. When the weight difference is less than zero, the target zero-point AD correction amount is subtracted from the zero-point AD value to obtain the updated zero-point AD value. When the weight difference is equal to zero, the zero-point AD value is determined as the updated zero-point AD value.
5. The creep compensation method for a strain gauge pressure sensor according to claim 4, characterized in that, The preset correction step threshold includes: The basic step threshold is determined based on preset calibration parameters, and the basic step threshold corresponds to the weight-AD mapping calibration coefficient; When the weight change velocity is within the preset slow change velocity range, the step weight coefficient is determined based on the interval position between the weight change velocity and the preset slow change velocity range. Multiply the base step threshold by the step weight coefficient to obtain the preset corrected step threshold.
6. The creep compensation method for a strain gauge pressure sensor according to claim 1, characterized in that, The weight conversion process, based on the sampled AD value, the updated zero-point AD value, and the weight-AD mapping calibration coefficient, yields the updated real-time weight value, including: Subtract the sampled AD value from the updated zero-point AD value to obtain the differential AD value; The differential AD value is compared with the preset valid AD range. When the differential AD value falls into the preset valid AD range, the differential AD value is divided by the weight-AD mapping calibration coefficient to obtain the AD normalization ratio value. The updated real-time weight value is obtained by multiplying the AD normalization ratio value by the preset calibration weight span.
7. The creep compensation method for a strain gauge pressure sensor according to claim 6, characterized in that, The step of comparing the differential AD value with a preset valid AD interval, and when the differential AD value falls within the preset valid AD interval, includes: Store the lower limit AD value and upper limit AD value of the preset valid AD interval in the preset calibration parameters; Read the lower limit AD value and the upper limit AD value of the interval based on the preset calibration parameters; The difference AD value is compared with the lower limit AD value and the upper limit AD value of the interval. When the difference AD value is not less than the lower limit AD value and not greater than the upper limit AD value of the interval, it is determined that the difference AD value falls into the preset valid AD interval.
8. A creep compensation device for a strain gauge pressure sensor, characterized in that, The strain gauge pressure sensor creep compensation device includes: The sampling conversion module is used to acquire the bridge output sampling value of the resistance strain gauge pressure sensor under loading conditions, and to perform analog-to-digital conversion on the bridge output sampling value to obtain the sampled AD value. The weight conversion module is used to perform weight conversion processing on the sampled AD value based on preset calibration parameters to obtain the real-time weight value. The stability determination module is used to obtain a continuous sampling sequence of real-time weight values under a preset sampling period, and perform stability determination processing based on the continuous sampling sequence to obtain a weight stability indicator. The stability recording module is used to record the current real-time weight value as a stable weight value when the weight stability flag indicates that the weight is stable and the real-time weight value meets the preset weight threshold. The difference calculation module is used to perform difference calculation processing based on the real-time weight value and the stable weight value to obtain the weight difference; The flow rate calculation module is used to perform flow rate calculation processing based on the continuous sampling sequence and the preset sampling period to obtain the flow rate of weight change. The flow rate determination module is used to determine the flow rate based on the weight difference, the flow rate of weight change, and a preset threshold rule when the weight stability indicator indicates that the weight is stable. The flow rate determination result includes the creep drift determination result and the actual change determination result. The zero-point update module is used to determine the zero-point AD value and the weight-AD mapping calibration coefficient based on preset calibration parameters when the flow rate determination result is a creep drift determination result. It also determines the zero-point AD correction amount based on the weight difference and the weight-AD mapping calibration coefficient, and performs addition and subtraction update processing on the zero-point AD value according to the sign of the weight difference to obtain the updated zero-point AD value. The weight recalculation module is used to perform weight conversion processing based on the sampled AD value, the updated zero-point AD value, and the weight-AD mapping calibration coefficient to obtain the updated real-time weight value. The stable update module is used to update the stable weight value based on the current real-time weight value if the flow rate determination result is a true change determination result, so as to obtain the updated stable weight value.
9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the strain gauge pressure sensor creep compensation method as described in any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the steps of the strain gauge pressure sensor creep compensation method as described in any one of claims 1 to 7.