Two-stage cascade pressure sensor temperature compensation method and device

CN122900762APending Publication Date: 2026-10-13SHENYANG ACAD OF INSTR SCI
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202611389890.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-09
Publication Date
2026-10-13

AI Technical Summary

Technical Problem

[0005]本申请提供一种两级级联的压力传感器温度补偿方法及装置,以解决物理模型与数据驱动模型无法互补融合的问题

Benefits of technology

[0016]由以上技术方案可知,本申请提供一种两级级联的压力传感器温度补偿方法及装置,通过在多个预设温度点和多个预设压力点上,对压力传感器执行多个完整压力循环,每个所述压力循环包括正行程升压和反行程降压过程,记录各采样点的压力传感器原始输出电压值、温度传感器输出温度值和对应标准压力值,构建包含温度、压力、行程方向和循环次数的多维标定数据集;对所述多维标定数据集进行预处理,包括对同一温度、同一压力、同一方向下的多次循环数据求取均值和标准差,进行异常值检测与剔除,并进行归一化处理;将温度范围划分为多个温度区间段,相邻所述温度区间段之间设置重叠区;在每个所述温度区间段内,分别对正行程数据和反行程数据独立拟合二元多项式曲面作为第一级补偿模型;所述拟合采用加权最小二乘法,权重设置为以每个标定点多次循环测量方差的倒数;对于所述重叠区内的数据点,采用相邻两段多项式预测值的加权平均实现平滑过渡;计算所述第一级补偿模型在每个标定点上的预测残差,所述预测残差为标准压力真实值与所述第一级补偿模型预测值之差;构建BP神经网络,以归一化后的所述压力传感器原始输出电压值、归一化后的所述温度传感器输出温度值、行程方向标志、归一化后的所述第一级补偿模型预测值和温度区间段编码向量作为网络输入,以所述预测残差作为网络输出目标进行训练,得到第二级残差补偿模型;在实际测量时,对传感器实时采集的每一组数据,先判定行程方向并选择对应的分段多项式模型进行第一级补偿,再将获得的第一级补偿值及辅助信息输入训练好的所述BP神经网络获得残差补偿量,最终压力输出为所述第一级补偿值与所述残差补偿量之和,解决物理模型与数据驱动模型无法互补融合的问题。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122900762A_ABST
    Figure CN122900762A_ABST
Patent Text Reader

Abstract

The application provides a two-stage cascade pressure sensor temperature compensation method and device, and relates to the field of pressure sensors; by constructing a multi-dimensional calibration data set, after preprocessing, the temperature range is divided into multiple interval segments with overlapping areas, and in each interval segment, the positive and negative stroke data are independently fitted with a binary polynomial surface using a weighted least squares method to form a first-stage compensation model, and the overlapping areas are smoothly transitioned using a weighted average; the prediction residuals of the first-stage compensation model at each calibration point are calculated, a BP neural network is constructed, the normalized sensor output, temperature, stroke direction, first-stage prediction value and temperature interval segment code are used as inputs, and the prediction residuals are used as a training target to train a second-stage residual compensation model; during measurement, the stroke direction is first determined and the corresponding segmented polynomial is called to perform first-stage compensation, and then the result is input into the neural network to obtain a residual compensation amount, thereby solving the problem that physical models and data-driven models cannot be complementarily fused.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of pressure sensor technology, and in particular to a method and apparatus for temperature compensation of a two-stage cascaded pressure sensor. Background Technology

[0002] Pressure sensors play a crucial sensing role in aerospace, industrial process control, automotive electronics, and medical devices. Taking silicon piezoresistive pressure sensors as an example, both their piezoresistive coefficient and carrier mobility are temperature-sensitive, causing significant drift in the sensor's zero point and sensitivity with temperature changes. Hysteresis and repeatability errors are further coupled with temperature drift, making high-precision pressure measurement over a wide temperature range a long-standing technical challenge in this field.

[0003] To address the aforementioned temperature-related errors, several known compensation schemes exist. Polynomial fitting methods use least-squares polynomials, bivariate surface methods, or response surface methods to fit the pressure-temperature relationship. One scheme employs a weighted fitting method with variance as the weight, reducing random errors through multiple calibrations and averaging, demonstrating good compensation for smoothing nonlinear temperature drift. Support Vector Machine (SVM) methods establish inverse SVM models for both loading and unloading, then use quadratic surface regression for temperature compensation, effectively handling hysteresis errors. Single neural network methods directly establish a black-box mapping from the pressure sensor's original output voltage value to the pressure value, achieving high compensation accuracy in areas with sufficient calibration data coverage. These schemes have been used to compensate for pressure sensor errors from different perspectives.

[0004] However, none of the aforementioned solutions simultaneously demonstrates the ability to handle temperature drift, hysteresis, and repeatability errors within a unified framework. Polynomial fitting methods are insufficient in compensating for hysteresis and repeatability errors; while support vector machines can handle hysteresis, they do not demonstrate modeling repeatability and incur high online computational overhead; single neural network methods exhibit poor physical interpretability and insufficient generalization in regions with sparse calibration data coverage. Furthermore, most known calibration schemes are single-cycle or single-period, failing to fully utilize the repeatability statistics inherent in multi-temperature cycle calibration. In particular, it is generally believed in the art that forward and reverse stroke separation modeling is sufficient to capture hysteresis, and further introducing residual learning layers would introduce unnecessary computational overhead and the risk of overparameterization. This technical bias has led to the long-term neglect of cascaded compensation architectures with synergistic potential. Therefore, how to simultaneously compensate for these multiple errors with acceptable embedded computational overhead within a collaborative framework of physical and data-driven models has become an urgent technical problem to be solved. Summary of the Invention

[0005] This application provides a two-stage cascaded pressure sensor temperature compensation method and device to solve the problem that physical models and data-driven models cannot be complementary and integrated.

[0006] The first aspect of this application provides a method for temperature compensation of a two-stage cascaded pressure sensor, comprising: At multiple preset temperature points and multiple preset pressure points, multiple complete pressure cycles are performed on the pressure sensor. Each pressure cycle includes a forward stroke pressurization process and a reverse stroke depressurization process. The original output voltage value of the pressure sensor, the output temperature value of the temperature sensor, and the corresponding standard pressure value of each sampling point are recorded to construct a multi-dimensional calibration dataset containing temperature, pressure, stroke direction, and number of cycles. The multidimensional calibration dataset is preprocessed, including calculating the mean and standard deviation of multiple cycles of data under the same temperature, pressure, and direction, detecting and removing outliers, and normalizing the data. The temperature range is divided into multiple temperature intervals, with overlapping areas between adjacent temperature intervals. Within each temperature interval, bivariate polynomial surfaces are independently fitted to the forward and reverse travel data as the first-level compensation model. The fitting uses a weighted least squares method, with the weights set as the reciprocal of the variance measured multiple times at each calibration point. For data points within the overlapping area, a weighted average of the predicted values ​​of two adjacent polynomial segments is used to achieve a smooth transition. Calculate the prediction residual of the first-level compensation model at each calibration point, where the prediction residual is the difference between the actual standard pressure value and the predicted value of the first-level compensation model. A BP neural network is constructed, with the normalized original output voltage value of the pressure sensor, the normalized output temperature value of the temperature sensor, the stroke direction mark, the normalized predicted value of the first-level compensation model, and the temperature interval encoding vector as network inputs, and the predicted residual as the network output target for training, to obtain the second-level residual compensation model. In actual measurement, for each set of data collected by the sensor in real time, the direction of travel is first determined and the corresponding piecewise polynomial model is selected for the first level of compensation. Then, the obtained first level compensation value and auxiliary information are input into the trained BP neural network to obtain the residual compensation amount. Finally, the pressure output is the sum of the first level compensation value and the residual compensation amount.

[0007] Optionally, the number of preset temperature points is not less than 5, the number of preset pressure points is not less than 6, and the number of cycles is not less than 3.

[0008] Optionally, the bivariate polynomial surface is a bivariate cubic polynomial; the overlap rate between adjacent temperature intervals is 10% to 25%; the weighted average weight of the overlapping area is determined based on the distance from the temperature of the data point to the boundary of the two adjacent segments.

[0009] Optionally, the structure of the BP neural network is as follows: the input layer includes neurons corresponding to the normalized original output voltage value of the pressure sensor, the normalized output temperature value of the temperature sensor, the travel direction indicator, the normalized predicted value of the first-level compensation model, and the temperature interval encoding vector; the temperature interval encoding vector is a one-hot encoding vector; the BP neural network includes at least one hidden layer, the activation function of the hidden layer is a hyperbolic tangent sigmoid function, and the activation function of the output layer is a linear function; training adopts the Levenberg-Marquardt algorithm, taking 10%–20% of the training data as the validation set, and stopping training and backtracking when the validation set error does not decrease for 4–8 consecutive iterations.

[0010] Optionally, the stroke direction determination method is as follows: maintain a sliding window and record the most recent original output voltage values ​​of multiple pressure sensors; calculate the linear regression slope within the window; determine the stroke as positive when the slope is greater than a preset positive threshold, determine the stroke as negative when the slope is less than a preset negative threshold, and maintain the direction determination result of the previous moment when the slope is between the preset positive threshold and the preset negative threshold.

[0011] Optionally, the method further includes: When the sensor characteristics drift, the weights of the output layer of the BP neural network are incrementally fine-tuned using newly acquired calibration samples, while keeping the weights of the hidden layers unchanged. When the fine-tuned cross-validation residual exceeds a preset threshold, a full joint fine-tuning alarm is triggered.

[0012] A second aspect of this application provides a two-stage cascaded pressure sensor temperature compensation device for implementing the two-stage cascaded pressure sensor temperature compensation method described in the first aspect, comprising: The high and low temperature test chamber is used to provide a controllable temperature environment. The chamber is equipped with mounting clamps that can simultaneously fix multiple pressure sensors to be calibrated and pressure connector through-wall interfaces. A multi-channel precision pressure controller that provides a standard pressure source and supports programmable pressure sequence output to automatically execute forward and reverse multi-cycle pressure control; The data acquisition and processing unit includes a multi-channel analog-to-digital converter module, a processor, and a non-volatile memory. The multi-channel analog-to-digital converter module is used to simultaneously acquire the raw output voltage value of the pressure sensor and the output temperature value of the temperature sensor. The processor is used to perform piecewise polynomial fitting calculations and BP neural network inference. The non-volatile memory is used to store polynomial coefficients and neural network weight parameters. The host computer calibration software runs on a personal computer and integrates calibration parameter configuration, data preprocessing, piecewise polynomial fitting, and BP neural network training functions; after training, the model parameters are downloaded to the non-volatile memory of the data acquisition and processing unit.

[0013] Optionally, the processor of the data acquisition and processing unit is a DSP processor or a heterogeneous processing core of FPGA and ARM; the resolution of the multi-channel analog-to-digital conversion module is not less than 24 bits and supports multi-channel synchronous sampling.

[0014] Optionally, the multi-channel precision pressure controller has at least four independent pressure output channels and supports parallel calibration of multiple sensors.

[0015] Optionally, the host computer calibration software independently performs data preprocessing, piecewise polynomial fitting, and BP neural network training steps for each pressure sensor to be calibrated, generates its own independent model parameters, and downloads the model parameters to the corresponding data acquisition and processing unit.

[0016] As can be seen from the above technical solutions, this application provides a two-stage cascaded pressure sensor temperature compensation method and device. By performing multiple complete pressure cycles on the pressure sensor at multiple preset temperature points and multiple preset pressure points, each pressure cycle includes a forward pressure increase and a reverse pressure decrease process. The original output voltage value of the pressure sensor, the output temperature value of the temperature sensor, and the corresponding standard pressure value are recorded at each sampling point, constructing a multi-dimensional calibration dataset containing temperature, pressure, stroke direction, and number of cycles. The multi-dimensional calibration dataset is preprocessed, including calculating the mean and standard deviation of multiple cycles of data under the same temperature, pressure, and direction, performing outlier detection and removal, and normalization. The temperature range is divided into multiple temperature intervals, with overlapping areas between adjacent temperature intervals. Within each temperature interval, a bivariate polynomial surface is independently fitted to the forward and reverse stroke data as the first-level compensation model. The fitting uses a weighted least squares method, with the weights set as the inverse of the variance of multiple cycles measured at each calibration point. For data points within the overlapping region, a weighted average of adjacent polynomial prediction values ​​is used to achieve a smooth transition. The prediction residual of the first-level compensation model at each calibration point is calculated, where the prediction residual is the difference between the actual standard pressure value and the predicted value of the first-level compensation model. A BP neural network is constructed, using the normalized original output voltage value of the pressure sensor, the normalized output temperature value of the temperature sensor, the stroke direction marker, the normalized predicted value of the first-level compensation model, and the temperature interval segment encoding vector as network inputs, and the prediction residual as the network output target for training, to obtain a second-level residual compensation model. In actual measurement, for each set of data collected by the sensor in real time, the stroke direction is first determined and the corresponding piecewise polynomial model is selected for first-level compensation. Then, the obtained first-level compensation value and auxiliary information are input into the trained BP neural network to obtain the residual compensation amount. Finally, the pressure output is the sum of the first-level compensation value and the residual compensation amount, solving the problem that the physical model and the data-driven model cannot complement and integrate. Attached Figure Description

[0017] To more clearly illustrate the technical solution of this application, the drawings used in the embodiments will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0018] Figure 1 This is a schematic flowchart of the pressure sensor temperature compensation method in the embodiments of this application; Figure 2 This is a schematic diagram of the multi-temperature cycle forward and reverse stroke calibration data acquisition in the embodiments of this application; Figure 3 This is a schematic diagram of the multidimensional calibration dataset structure in the embodiments of this application; Figure 4 This is a schematic diagram of piecewise polynomial surface fitting and smooth transition of overlapping temperature ranges in an embodiment of this application; Figure 5 This is a schematic diagram illustrating the principle of forward and reverse stroke separation modeling to compensate for hysteresis error in the embodiments of this application; Figure 6 This is a schematic diagram of the network structure of the BP neural network residual compensation model in the embodiments of this application; Figure 7 This is a schematic diagram of the two-level cascaded compensation online inference process in the embodiments of this application; Figure 8 This is a block diagram of the overall system composition of the pressure sensor temperature compensation device in the embodiments of this application. Detailed Implementation

[0019] The embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described below do not represent all embodiments consistent with this application. They are merely examples of systems and methods consistent with some aspects of this application.

[0020] To address the issue of the inability to complement and integrate physical models and data-driven models, see [link / reference]. Figures 1-8 This application provides a method for temperature compensation of a two-stage cascaded pressure sensor, comprising: S1: Perform multiple complete pressure cycles on the pressure sensor at multiple preset temperature points and multiple preset pressure points. Each pressure cycle includes a forward pressure increase and a reverse pressure decrease process. Record the original output voltage value of the pressure sensor, the output temperature value of the temperature sensor, and the corresponding standard pressure value at each sampling point to construct a multi-dimensional calibration dataset containing temperature, pressure, stroke direction, and number of cycles.

[0021] It should be understood that, see Figures 2-5In step S1, the number of preset temperature points M is no less than 5, covering the entire operating temperature range of the pressure sensor; the number of preset pressure points N is no less than 6, evenly distributed within the measurement range; and the number of cycles K is no less than 3. Specifically, for a diffused silicon piezoresistive pressure sensor, the temperature calibration points M=7, with values ​​of -39.8℃, -19.5℃, 0.3℃, 25.1℃, 50.6℃, 84.7℃, and 124.3℃ respectively; the pressure calibration points N=11, evenly distributed within the 0 to 40MPa range, with values ​​of 0MPa, 3.95MPa, 7.88MPa, 11.92MPa, 16.05MPa, 19.87MPa, 23.93MPa, 28.10MPa, 32.14MPa, 35.89MPa, and 39.92MPa respectively; and the number of cycles K=5. Step S1 specifically includes: placing the pressure sensor to be calibrated in a temperature-controlled environment and stabilizing the temperature control environment at the target temperature point T. i (i=1, 2, ..., M), where i represents the sequence number of the preset temperature point. The constant temperature holding time is no less than 30 minutes to ensure that the internal temperature of the sensor chip reaches sufficient thermal equilibrium with the ambient temperature. The thermal equilibrium criterion is that the temperature sensor reading change does not exceed ±0.05℃ within 5 consecutive minutes; at temperature T... i The following K complete pressure cycles are executed, each pressure cycle including a positive stroke pressurization process, i.e., the pressure rises from the lower limit P of the range. min Incrementing to the upper limit P of the range in fixed steps max At N preset pressure calibration points P j At points (j=1, 2, ..., N), where j represents the sequence number of the preset pressure point. After the pressure stabilizes, record the original output voltage value V of the pressure sensor. raw (i, j, k, forward stroke), and the reverse stroke pressure reduction process, i.e., the pressure decreases from the upper limit of the range P. max Decrease to the lower limit P of the range in fixed steps min At N preset pressure calibration points P j After the pressure stabilizes, record the original output voltage value V of the pressure sensor. raw (i, j, k, reverse stroke), where k represents the sequence number of the pressure cycle. Simultaneously, the temperature sensor output temperature value T(i, j, k, direction) corresponding to each sampling point is recorded, thus constructing a multidimensional dataset D={(T i P j dir m cycle k V raw T sensor )}, where dir m The set representing the direction of travel, dir m∈{forward stroke, reverse stroke}, where forward stroke is the pressurization process and reverse stroke is the depressurization process; cycle k Represents the loop number; T sensor This represents the temperature value output by the temperature sensor. The total sample size of the multidimensional dataset is M×N×2×K. The above V... raw The maximum value V max and minimum value V min Take the global maximum and global minimum values ​​of the raw output voltage of the pressure sensor under all cycles, all temperatures, and all pressure points in the calibration dataset; T sensor The maximum value T max and minimum value T min The global maximum and minimum values ​​of all temperature measurements in the calibration dataset are taken for normalization processing in subsequent step S2. The multi-temperature cycle forward and reverse calibration data acquisition provides a sufficient and complete data foundation for subsequent multi-dimensional error compensation. The entire calibration process is automated by the host computer calibration software. A complete 7-temperature-point calibration cycle takes approximately 12.5 hours. All original test logs, analog-to-digital converter (ADC) sampling data, and temperature chamber operation records have been archived for future reference.

[0022] S2: Preprocess the multidimensional calibration dataset, including calculating the mean and standard deviation of multiple cycles of data under the same temperature, pressure, and direction, detecting and removing outliers, and normalizing the data.

[0023] It should be noted that the preprocessing in step S2 specifically includes: cyclic statistics calculation, outlier detection and removal, and normalization. The cyclic statistics calculation is as follows: for the same temperature T... i At the same pressure point P j dir in the same direction m Calculate the mean V from K cycles of data. mean The model consists of two parts: (i, j, dir) and the standard deviation σ(i, j, dir), where dir represents the direction of travel. The standard deviation matrix σ(i, j, dir) has a dual purpose: first, as a quantitative measure of repeatability error for repeatability assessment; second, as a weighting basis for subsequent weighted fitting, so that data points with good repeatability, i.e., smaller σ, contribute more to the model.

[0024] Outlier detection and removal specifically involves: for each (T) i P j dir m Given a combination of measurements, calculate the median MAD of the K cyclic measurements for that combination. median Median Absolute Deviation (MAD) and Standardized Absolute Deviation (MAD), MAD = median(|x l-median(x)|), where x l Let x be the measurement value in the l-th cycle of this combination; median(x) is used to calculate the median of this set. If the measurement value x in a certain cycle is... l Satisfy |x l If -median(x)|>5×MAD, it is marked as an outlier. This multiple of 5 is an empirical threshold, which can be adaptively adjusted by those skilled in the art based on the sensor noise level within the range of 3~7. For example, at the calibration point of 35.89MPa during the third cycle at 84.7℃, the sensor output value deviated from the median of this combination by 6.2 times MAD, and was marked by the anomaly detection algorithm. After investigation, it was found to be caused by a momentary micro-leakage in the pressure tapping pipeline at high temperature. It was replaced with the median of the remaining 4 cycles using the method described above. A total of 2 outliers were detected and removed during the calibration process, and both were processed using this robust statistical method. The anomaly records have been archived in the original test log. The normalization process is as follows: the original output voltage value V of the pressure sensor is normalized. raw The temperature value T output by the temperature sensor is mapped to the interval [-1, 1] through a linear transformation, i.e., V norm =2×(V raw -V min ) / (V max -V min )-1,T norm =2×(TT min ) / (T max -T min )-1, where V max V min Take the global maximum and minimum values ​​of the raw output voltage at all cycles, temperature, and pressure points in the calibration dataset; T max T min Take the global maximum and minimum values ​​of all temperature measurements in the calibration dataset; V norm The normalized original output voltage value of the pressure sensor; T norm The normalized temperature sensor output temperature value. The predicted value P from the first-level compensation model. stage1 The same normalization rule is also applied, denoted as P. stage1,norm : P stage1,norm =2×(P stage1 -P stage1,min ) / (P stage1,max -P stage1,min -1; In the formula, P stage1,max P stage1,min These are the maximum and minimum predicted values ​​of the first-level compensation model across all calibrated sample points, used to unify the polynomial output to V. norm T normThe same [-1, 1] scale is used as one of the input features of the BP neural network.

[0025] The above preprocessing can eliminate the interference of abnormal data on model training and unify data of different dimensions to the same scale, which is beneficial to improving the accuracy and stability of subsequent polynomial fitting and neural network training.

[0026] S3: Divide the temperature range into multiple temperature intervals, and set an overlap area between adjacent temperature intervals; within each temperature interval, independently fit a bivariate polynomial surface as the first-level compensation model for the forward and reverse travel data; the fitting adopts the weighted least squares method, and the weight is set to the reciprocal of the variance of multiple cyclic measurements at each calibration point; for data points in the overlap area, the weighted average of the polynomial prediction values ​​of two adjacent segments is used to achieve a smooth transition.

[0027] It should be understood that, see Figure 4 In step S3, the bivariate polynomial surface is a bivariate cubic polynomial: P poly (V, T)=a0+a1V+a2T+a3VT+a4V 2 +a5T 2 +a6V 2 T+a7VT 2 +a8V 3 +a9T 3 Where V is the normalized original output voltage value of the pressure sensor, T is the normalized output temperature value of the temperature sensor, and a0 to a9 are 10 coefficients to be fitted. The overlap rate between adjacent temperature intervals is 10% to 25%. This range ensures that the adjacent segment models have sufficient data support in the transition region, while avoiding excessive overlap that would reduce the inter-segment discrimination. Specifically, the temperature range of -40℃ to 125℃ is divided into L=4 temperature intervals: interval 1 is [-40, 0]℃, interval 2 is [-10, 30]℃, interval 3 is [20, 60]℃, and interval 4 is [50, 125]℃, with an overlap width of 10℃ between adjacent segments. Those skilled in the art can calculate the overlap percentage based on the actual temperature range and the width of each segment to ensure that it is within the range of 10% to 25%. Within each temperature interval, a bivariate cubic polynomial is independently fitted to the forward and reverse stroke data to explicitly capture hysteresis. The fitting method uses weighted least squares, and the weight function is set as w(i,j,dir)=1 / σ. 2 (i, j, dir) means using the reciprocal of the variance of multiple cyclic measurements at each calibration point as the weight.

[0028] For data points where the temperature falls within two adjacent overlapping regions, the weighted average of the polynomial predictions from the two adjacent regions is used as the final output: P poly =λ·Ppoly,left +(1-λ)·P poly,right ; Where, the weight λ=d right / (d left +d right ), d left =TT left,boundary Let d be the distance from the temperature T at the data point to the right boundary of the left segment. right =T right,boundary -T represents the distance from the data point temperature T to the left boundary of the right segment. left,boundary T represents the right boundary temperature value of the left temperature range. right,boundary This represents the left boundary temperature value of the right temperature range.

[0029] When d left +d right When T = 0 (i.e., the extreme case where T is equal to both the left and right boundaries), let λ = 0.5; when the data point is located at the left boundary of the overlap region, λ = 1, and the left segment polynomial prediction value is used entirely; when the data point is located at the right boundary of the overlap region, λ = 0, and the right segment polynomial prediction value is used entirely; inside the overlap region, λ changes linearly with temperature, so that the weights transition continuously at the segment boundaries.

[0030] The first-level compensation output is P. stage1 =P poly (V, T, dir), where the stroke direction dir is determined by the actual pressure change trend during measurement. Through the above piecewise polynomial surface fitting, the main temperature-pressure characteristics of the sensor, including coarse-grained hysteresis behavior, can be captured using a physically interpretable polynomial model. Simultaneously, the smooth transition design of the overlapping region ensures the continuity and smoothness of the output between segments. Taking the positive stroke of segment 1 as an example, the weighted normal equation is solved in the normalized space (using SVD decomposition to ensure numerical stability), yielding the following coefficients: a0=0.0018, a1=0.9912, a2=-0.0156, a3=-0.0093, a4=-0.0019, a5=0.0008, a6=0.0004, a7=0.0003, a8=0.0015, a9=-0.0006. The goodness of fit R for this segment is... 2 =0.9998, with a maximum absolute residual of 0.094%FS (full scale). The fitting process for the reverse stroke and other temperature ranges is similar. The separation modeling effect of forward and reverse strokes is significant: at 25.1℃, the maximum difference (hysteresis width) between forward and reverse strokes is 0.183%FS, occurring at 19.87MPa; traditional averaging methods would cause residual errors of ±0.0915%FS to be dispersed in both directions, while the separation modeling method of this application retains complete information of forward and reverse strokes, providing an accurate hysteresis baseline for subsequent residual learning.

[0031] S4: Calculate the prediction residual of the first-level compensation model at each calibration point. The prediction residual is the difference between the actual standard pressure value and the predicted value of the first-level compensation model.

[0032] It should be noted that in step S4, the prediction residual of the first-level polynomial compensation model at each calibration data point is calculated: ΔP(i,j,dir,k) = P true (j)-P stage1 (i, j, dir), where P true (j) represents the actual pressure value applied by the standard pressure source. The residual ΔP here contains error components that the multinomial model failed to capture, including higher-order nonlinear components and hysteresis asymmetric residuals. Specifically, after the first-level compensation, the maximum absolute value of the residuals for 770 data points is 0.117%FS, the root mean square RMS value is 0.0387%FS, and the Jarque-Bera test p-value for the residual distribution is 0.002, indicating that there are still non-random systematic patterns in the residuals, thus verifying the necessity of introducing a second-level data-driven compensation.

[0033] S5: Construct a BP neural network, using the normalized original output voltage value of the pressure sensor, the normalized output temperature value of the temperature sensor, the stroke direction mark, the normalized first-level compensation model prediction value, and the temperature interval encoding vector as network inputs, and using the prediction residual as the network output target for training, to obtain the second-level residual compensation model.

[0034] It should be understood that, see Figure 6 In step S5, the structure of the BP neural network (Back Propagation Neural Network) is as follows: the input layer contains (4+L) neurons, each corresponding to the normalized original output voltage value V of the pressure sensor. norm The normalized temperature sensor output temperature value T norm 1. Travel direction indicator D (forward travel = +1, reverse travel = -1), 2. Normalized first-level compensation model prediction value P stage1 , normAnd an L-dimensional temperature interval segment encoding vector. The temperature interval segment encoding vector is a one-hot encoding vector, in which only the bit corresponding to the current temperature's segment is 1, and the rest are 0; when the temperature falls into the overlapping area, the corresponding bits of the two segments are each set to 0.5, and the rest are 0. Using one-hot encoding can avoid the problem of discontinuous output at segment boundaries caused by discrete integer input and the error measurement assumption implicit in ordinal encoding. Specifically, if L=4, the input layer has 8 neurons. The BP neural network contains at least one hidden layer. Preferably, the first hidden layer has 12 neurons, the second hidden layer has 8 neurons, and the activation function of the hidden layers is the hyperbolic tangent sigmoid function (tansig). The output layer has 1 neuron, and the activation function is a linear function (purelin). Training uses the Levenberg-Marquardt (LM) algorithm, the loss function is the mean squared error (MSE), and the training termination condition is when the MSE drops to 1×10. -6 The iteration count is typically 1000. Simultaneously, 10% to 20% (preferably 15%) of the training data is randomly allocated to a validation set, which does not participate in gradient updates. After each training iteration, the validation set error is calculated. If the validation set error does not decrease for six consecutive iterations (this number can be adjusted between 4 and 8 iterations depending on training stability), training is terminated and the model parameters with the smallest validation set error are reverted to prevent overfitting. Specifically, 655 samples (85%) are used for training, and 115 samples (15%) are used for validation. After 87 iterations, the training set MSE of the LM algorithm decreases to 8.73 × 10⁻⁶. -7 The validation set MSE decreased to 9.41 × 10⁻⁶. -7 In iterations 88 to 93, the validation set MSE failed to reach a new low for six consecutive iterations, triggering an early stop and reverting to the model from iteration 87 as the final BP network model. During training, independent samples from each iteration were retained instead of using only the cyclic mean, enabling the network to learn the conditional distribution pattern of the residuals across different iterations, thus more accurately estimating the conditional expectation of the residuals.

[0035] S6: In actual measurement, for each set of data collected by the sensor in real time, the direction of travel is first determined and the corresponding piecewise polynomial model is selected for the first-level compensation. Then, the obtained first-level compensation value and auxiliary information are input into the trained BP neural network to obtain the residual compensation amount. Finally, the pressure output is the sum of the first-level compensation value and the residual compensation amount.

[0036] It should be noted that in step S6, the method for determining the stroke direction is as follows: maintain a sliding window of length W, and record the most recent W original output voltage values ​​of the pressure sensors. The window length W is set according to W=f s ×T w Determined, where f s T represents the sampling rate (in Hz). wT represents the physical duration of the window. w The value is configured according to the measurement mode preset by the host computer: 0.5 seconds for conventional pressure measurement scenarios; 0.1 to 0.2 seconds for transient measurement scenarios such as impact pressure; and 2.0 seconds for slow pressure changes or quasi-static measurement scenarios. The specific method for determining the preset positive and negative thresholds for the linear regression slope within the calculation window is as follows: Under static conditions where there is no pressure change in the sensor (i.e., constant pressure), collect the original output voltage values ​​of the pressure sensor from no less than 1000 continuous sampling points, and calculate the standard deviation σ of this static sequence. static Set a preset positive threshold k pos =+c×σ static Preset negative threshold k neg =-c×σ static Where c is the threshold coefficient, preferably 3, which is set based on the empirical criterion of the statistical 3σ principle. Those skilled in the art can adjust it within the range of 2 to 4 according to the actual noise level. When the slope is greater than the preset positive threshold, it is determined to be a positive stroke (pressure increase); when it is less than the preset negative threshold, it is determined to be a reverse stroke (pressure decrease). When it is between the thresholds, the direction determination result of the previous moment is maintained. At the pressure inflection point (pressure increase to pressure decrease or vice versa), the slope of the first frame may be close to zero due to the mixing of positive and negative data within the window. Maintaining the previous direction state ensures the continuity of determination during the transition period. For transient measurement scenarios such as impact pressure, the physical time of the window can be reduced to 0.1 to 0.2 seconds; for slow pressure changes or quasi-static measurement scenarios, the physical time of the window can be extended to 2.0 seconds to improve the stability of direction determination. Specifically, taking the above-mentioned silicon piezoresistive pressure sensor as an example, the sampling rate f... s =1kHz, window length W=500, σ is calculated by collecting 1000 continuous sampling points under static conditions. static =0.00032mV, then the preset positive threshold k pos =+0.00096mV / sampling point, preset negative threshold k neg =-0.00096mV / sampling point; To facilitate engineering implementation and avoid frequent direction switching due to overly strict thresholds, the actual positive and negative thresholds used are +0.001mV / sampling point and -0.001mV / sampling point, respectively.

[0037] It should be understood that, see Figure 7 In the actual measurement and reasoning process of step S6, each set of raw data (V) collected by the sensor in real time is processed. meas T meas ), V meas T represents the raw voltage signal output by the sensor at the current temperature; meas Representative and V measThe system synchronously acquires real-time temperature values. First, the raw data measurements are normalized. Then, the direction of the sliding window movement is determined to identify whether the current movement is forward or reverse. Finally, the current temperature measurement value T is used as the basis for the analysis. meas The temperature range and overlap relationship determine the piecewise polynomial model to be used for the corresponding temperature range segment; then, (V meas,norm T meas,norm Substitute the bivariate cubic polynomial of the selected direction and temperature range in step S3 to calculate the first-level compensation value P. stage1 V meas,norm T represents the normalized voltage measurement value. meas,norm This represents the normalized temperature measurement value. If T meas If you fall into the overlapping area, press P. poly =λ·P poly,left +(1-λ)·P poly,right The weighted average method is used to fuse the polynomial prediction values ​​of two adjacent segments; then the BP input vector [V] is constructed. meas,norm T meas,norm D, P stage1,norm One-hot encoding (L) is input into a trained BP neural network, and forward propagation yields the residual compensation ΔP in the normalized space. pred,norm This refers to the residual compensation amount in the normalized space, with a numerical range of [-1, 1] and a physical meaning of the normalized proportion of the residual relative to the range span; then, through the inverse normalization formula ΔP... pred =ΔP pred,norm ×(P max -P min ) / 2 restored to physical space (where P max P min These are the upper and lower limits of the sensor's measurement range, respectively; ΔP pred (Representing the residual compensation in physical space), the formula only retains the scaling factor of the range span and does not superimpose the zero-point offset to match the zero-center distribution characteristics of the residual fluctuations around the true pressure; the final pressure output is P. final =P stage1 +ΔP pred .

[0038] Computational analysis of the two-stage inference (using a Cortex-M7@480MHz platform with instruction and data caches enabled) shows that: the first-stage polynomial computation (10-term summation, 20 floating-point multiplications and additions) takes 10–16 μs; the second-stage BP network forward propagation (200 multiplication-accumulation MAC operations) takes 78–112 μs; considering ADC sampling interrupt jitter (typical interrupt response delay 2–5 μs) and direct memory access (DMA) concurrent transfer overhead (1–3 μs), the total inference time fluctuates between 95 and 115 μs, meeting the real-time compensation requirements at a 1kHz sampling rate. Actual time consumption is affected by the following engineering variables: cache hit rate (related to code / data layout), DMA channel contention, interrupt nesting depth, and processor frequency temperature drift. The total number of model parameters is 1100 bytes when using one-hot encoding, requiring only KB-level non-volatile storage space.

[0039] In some embodiments, the number of preset temperature points is not less than 5, the number of preset pressure points is not less than 6, and the number of cycles is not less than 3.

[0040] Specifically, for the ceramic capacitive pressure sensor (0~1MPa, -20~85℃), the temperature calibration points M=5, with values ​​of -19.6℃, 5.8℃, 24.7℃, 54.3℃, and 84.2℃ respectively; the pressure calibration points N=9, uniformly distributed within the 0~1MPa range, with values ​​of 0MPa, 0.118MPa, 0.243MPa, 0.372MPa, 0.491MPa, 0.628MPa, 0.754MPa, 0.873MPa, and 0.996MPa respectively; and the number of cycles K=4. The specific values ​​of these parameters can be adaptively adjusted according to the sensor type, range, and accuracy requirements, and all are within the scope of protection of this application.

[0041] It should be noted that the more temperature and pressure points there are, the more complete the calibration data and the higher the compensation accuracy, but at the same time, the calibration time and computational cost will increase. The above values ​​achieve a reasonable balance between accuracy and efficiency.

[0042] In some embodiments, the bivariate polynomial surface is a bivariate cubic polynomial; the overlap rate between adjacent temperature intervals is 10% to 25%; the weighted average weight of the overlapping region is determined based on the distance from the temperature of the data point to the boundary of the two adjacent segments.

[0043] It should be understood that the specific form of a bivariate cubic polynomial is P poly (V, T)=a0+a1V+a2T+a3VT+a4V 2 +a5T 2 +a6V 2 T+a7VT 2 +a8V3 +a9T 3 Specifically, taking the positive travel of interval segment 1 as an example, the coefficients obtained in the normalized space are: a0=0.0018, a1=0.9912, a2=-0.0156, a3=-0.0093, a4=-0.0019, a5=0.0008, a6=0.0004, a7=0.0003, a8=0.0015, a9=-0.0006. The goodness of fit R for this segment is... 2 =0.9998, maximum residual absolute value 0.094%FS. The overlap rate between adjacent temperature intervals is 10% to 25%, preferably a fixed temperature overlap of 10℃. The weighted average weight of the overlapping area is λ=d. right / (d left +d right ), where d left =TT overlap,low d right =T overlap,high -T, T overlap,low T is the lower limit temperature of the overlap region. overlap,high The upper limit temperature of the overlapping region ensures a continuous transition of weights at the segment boundaries. For example, when the temperature point is within the overlapping region of 20–30℃ between interval segment 2 (-10–30℃) and interval segment 3 (20–60℃), the weights are calculated according to the above formula, and the predicted values ​​from the two polynomials are weighted and averaged. For ceramic capacitive pressure sensors, since the pressure-output relationship is closer to linear, the absolute values ​​of the cubic coefficients a8 and a9 in the bivariate cubic polynomial are usually less than 5 × 10⁻⁶. -4 However, it is still retained to capture the weak nonlinearity of the boundary region.

[0044] In some embodiments, the structure of the BP neural network is as follows: the input layer includes neurons corresponding to the normalized original output voltage value of the pressure sensor, the normalized output temperature value of the temperature sensor, the travel direction indicator, the normalized first-level compensation model prediction value, and the temperature interval encoding vector; the temperature interval encoding vector is a one-hot encoding vector; the BP neural network includes at least one hidden layer, the activation function of the hidden layer is a hyperbolic tangent sigmoid function, and the activation function of the output layer is a linear function; training adopts the Levenberg-Marquardt algorithm, taking 10%–20% of the training data as the validation set, and stopping training and backtracking when the validation set error does not decrease for 4–8 consecutive iterations.

[0045] It should be noted that in the structure of the BP neural network, the temperature interval encoding vector uses a one-hot encoding vector, and the input layer contains (4+L) neurons, where L is the number of temperature segments. Specifically, when L=4, the input layer has 8 neurons. The first hidden layer has 12 neurons, the second hidden layer has 8 neurons, and the activation function of the hidden layers is the hyperbolic tangent sigmoid function (tansig). The output layer has 1 neuron, and the activation function is a linear function (purelin). Training uses the Levenberg-Marquardt (LM) algorithm, which has fast convergence speed and good stability in training medium-sized neural networks. 10% to 20% of the samples are used as the validation set for early stopping to prevent overfitting, with 15% being the preferred validation set proportion. It should be noted that, as a simplified alternative implementation, on embedded platforms with limited storage resources, one-hot encoding can be replaced with scalar integer segment numbers l (with values ​​1, 2, ..., L). However, this alternative solution requires attention to the boundary cases where the temperatures are similar but the segment numbers are not continuous, and additional handling is needed for the output transition problem at the segment boundaries.

[0046] In some embodiments, the stroke direction determination method is as follows: maintain a sliding window and record the recent original output voltage values ​​of multiple pressure sensors; calculate the linear regression slope within the window; determine the stroke as positive when the slope is greater than a preset positive threshold, determine the stroke as negative when the slope is less than a preset negative threshold, and maintain the direction determination result of the previous moment when the slope is between the preset positive threshold and the preset negative threshold.

[0047] It should be understood that the method for determining the direction of travel is specifically as follows: maintain a sliding window of length W, where W = f s ×T w , where f s T represents the sampling rate (in Hz). w T represents the physical duration of the window. w The value is configured by the host computer according to the preset measurement mode: 0.5 seconds for normal scenarios, 0.1 to 0.2 seconds for transient scenarios such as impact pressure, and 2.0 seconds for slow pressure changes or quasi-static scenarios. The preset positive and negative thresholds are determined as follows: under static conditions with no pressure change at the sensor, the original output voltage values ​​of the pressure sensor are collected from no less than 1000 continuous sampling points, and the standard deviation σ of the static sequence is calculated. static Set a preset positive threshold k pos =+3×σ static Preset negative threshold k neg =-3×σ static Where coefficient 3 is the threshold setting coefficient based on the 3σ principle. Specifically, the sampling rate f s =1kHz, T w=0.5 seconds, then the window length W=500. Calculate the linear regression slope of the original output voltage value of the pressure sensor relative to the sampling point index within this window. When the slope is greater than a preset positive threshold, it is determined as positive stroke (pressure increase); when the slope is less than a preset negative threshold, it is determined as reverse stroke (pressure decrease); when the slope is between the preset positive and preset negative thresholds, it indicates that the pressure change is not significant or is in an inflection point region. At this time, the direction determination result of the previous moment is maintained, thereby avoiding frequent jumps in direction at pressure stabilization or inflection points. For transient measurement scenarios such as impact pressure, T can be... w Reduce the response time to 0.1–0.2 seconds to improve speed; for slow pressure changes or quasi-static measurement scenarios, T can be... w The time has been extended to 2.0 seconds to improve noise immunity and stability of direction determination.

[0048] In some embodiments, the method further includes: When sensor characteristics drift, the weights of the output layer of the BP neural network are incrementally fine-tuned using newly acquired calibration samples, while keeping the weights of the hidden layers unchanged. When the fine-tuned cross-validation residual exceeds a preset threshold, a full joint fine-tuning alarm is triggered.

[0049] The specific method for determining the preset threshold is as follows: based on the overall accuracy E during factory calibration. cal Based on this, a preset threshold E is set. threshold =3×E cal When the root mean square (RMS) value of the residuals exceeds E in cross-validation at no less than three different pressure points. threshold At that time, a full joint fine-tuning alarm is triggered.

[0050] It should be noted that when sensor characteristics drift and the overall accuracy degradation does not exceed three times the factory accuracy, the output layer weights of the BP neural network are incrementally fine-tuned using newly acquired calibration samples, while the hidden layer weights remain unchanged. Specifically, after 18 months of continuous service in an oilfield downhole environment, the overall accuracy of a silicon piezoresistive pressure sensor degraded to 0.176%FS, exceeding the 0.1%FS requirement. Using a portable calibrator, six calibration data points were collected at three pressure points (0MPa, 19.87MPa, 39.92MPa) and the current ambient temperature of 108.3℃, representing one cycle each of forward and reverse strokes. The P-value was calculated using the original polynomial model. stage1The corresponding residual ΔP was obtained. The weights of the two hidden layers of the BP network were fixed, and the output layer weights were fine-tuned 50 times using only the Stochastic Gradient Descent (SGD) algorithm (learning rate η=0.001). After the update, the overall accuracy recovered to 0.057%FS, close to the factory accuracy level, and the online update took only 0.31 seconds. If the "complete recalibration" method were used, the sensor would need to be retrieved from the well and returned to the laboratory, taking several days and causing production interruption. When the fine-tuned cross-validation residual exceeds the preset threshold E... threshold =3×E cal Time (e.g., factory-calibrated overall accuracy E) cal =0.1%FS, then E threshold =0.3%FS; if the residual RMS still exceeds 0.3%FS in cross-validation at ≥3 different pressure points, a full joint fine-tuning alarm is triggered, indicating that a full hidden layer joint fine-tuning or recalibration is required.

[0051] It should be noted that the effectiveness of this online adaptive update strategy is based on the assumption that sensor characteristic drift mainly manifests as a linear shift of the residual mode in the hidden layer feature space. In the following conditions, fine-tuning the output layer alone may not be sufficient to restore accuracy, requiring complete joint fine-tuning or recalibration of the hidden layers: (a) plastic deformation of the sensor's elastic diaphragm (e.g., irreversible mechanical deformation due to overload); (b) partial open or short circuit in the Wheatstone bridge circuit, resulting in a fundamentally nonlinear change in the output characteristics; (c) significant changes in the temperature dependence of the piezoresistive coefficient due to long-term high-temperature aging of the sensor chip. The above applicable boundaries should be verified through accelerated aging tests before actual deployment.

[0052] The following are the specific details of the compensation effect evaluation and ablation analysis: (a) Evaluation of the compensation effect, see Table 1.

[0053] Table 1: Evaluation results on independent test sets (-9.7℃ and 69.4℃, not involved in training)

[0054] Note: The overall accuracy is calculated using the full RSS synthesis method (taking the root sum of the four terms: nonlinearity, hysteresis, repeatability, and temperature drift). Verification: =0.0438%FS. The overall accuracy of 0.0438%FS on the independent test set is close to 0.0426%FS on the training set, verifying the model's good generalization ability.

[0055] (II) Ablation Experiments – Independent Contributions and Interaction Effects Table 2: Ablation Analysis Results

[0056] Key findings from the ablation analysis: (1) Synergistic effect rather than simple additive effect. The accuracy loss of experiment (e) (+100.0%) is much greater than the sum of the independent losses of experiments (b) and (d) (42.2%+10.3%=52.5%), exceeding it by 47.5 percentage points. The accuracy loss of experiment (f) (+133.8%) is much greater than the sum of the independent losses of experiments (b) and (c) (42.2%+18.3%=60.5%), exceeding it by 73.3 percentage points. This indicates that the forward and reverse stroke separation modeling is related to variance weighting and P stage1 Significant nonlinear synergistic effects exist between auxiliary inputs—after removing the separation modeling, the variance-weighted sum of P... stage1 The effect is significantly weakened because the hysteresis fuzziness error generated by merging modeling cannot be effectively compensated by either weighting or residual learning. This interaction effect constitutes an inseparable organic link between the various technical features of this application, verifying that this scheme is not a simple superposition of known technologies.

[0057] (2) Physical explanation of the synergistic effect. Separate modeling of forward and reverse strokes preserves complete hysteresis information; variance weighting automatically identifies and suppresses the adverse effects of high repeatability error regions on the model; P stage1 A polynomial-compensated "reference baseline" is provided for the BP network, enabling the network to focus on system patterns in the residuals. These three features form a progressive collaborative chain of "information retention → quality assessment → reference learning," the absence of any link in which the chain is broken. A common technical bias in the field is the belief that forward and reverse process separation modeling is sufficient to capture hysteresis, and that further introducing a residual learning layer would introduce unnecessary computational overhead and overparameterization risks. This bias stems from the computational resource constraints of traditional embedded platforms. However, the ablation experiments in this application demonstrate a synergistic effect of supersummarization between separation modeling and BP residual compensation, and the BP network inference time (78–112 μs) is entirely within the embedded real-time constraints (1 kHz sampling corresponds to a 1 ms period), thus overcoming the aforementioned technical bias.

[0058] (3) The core distinguishing technical features established as a result. Forward and reverse process separation modeling is the independent feature with the largest contribution weight (42.2%), and the interaction effect with variance weighting (47.5 percentage points higher than the independent feature) verifies that the combination of "multi-cycle standard deviation weighting + separation modeling" plays a key synergistic role in this application that is not revealed by related technologies.

[0059] (III) Rigorous comparison with the closest related technology (CN101858811B, SVM hysteresis inverse model + quadratic surface compensation) For objective comparison, the applicant reproduced the method on the same calibration dataset (the aforementioned 770 samples) and the same independent test sets (-9.7℃ and 69.4℃). The reproduction details are as follows: (i) ε-SVR models (RBF kernels) were trained for both forward and reverse travel, with kernel parameters γ and penalty coefficient C validated using 5-fold cross-validation. -8 ~2 8 The optimal parameters were determined by grid search within the range: γ=0.125, C=64, and ε=0.01. Here, ε represents the insensitive loss coefficient in the support vector regression model, used to define the maximum allowable error range between the predicted and true values. Errors within this range are not included in the loss function. (ii) After SVR training, temperature compensation was performed on the residuals after SVR compensation using a quadratic surface (bivariate quadratic polynomial). The surface coefficients were determined by least squares fitting. (iii) A total of 183 support vectors were generated during SVR training, accounting for 27.9% of the training samples (see Table 3).

[0060] Table 3: Comparison Results of the Closest Related Technologies Reproduced by the Applicant

[0061] Besides its superior accuracy, the method presented in this application offers orders of magnitude advantages in embedded real-time performance (approximately 17 times faster per inference cycle), and requires only about 1 / 11 of the space for model storage. This is thanks to the fixed forward propagation structure of the BP network, which avoids the inference complexity of SVM as the number of training samples increases. The comparative data above demonstrates that there are fundamental differences in the architectural logic (SVM inverse model + quadratic surface vs. piecewise polynomial surface + BP residual compensation) and processing paradigm (fully data-driven vs. physical model-first + data-driven compensation) of the two methods.

[0062] (iv) Comparison with pure BP neural network method (without first-order polynomial) To verify the advantages of a two-stage cascaded architecture over a single black-box model, a pure backpropagation neural network (with 3 neurons in the input layer: V) was trained on the same dataset. norm T norm D; Hidden layers 12-8; Output layer 1 neuron outputs P pred The training configuration is the same as above. Among them, P... pred This represents the pressure prediction value directly output by a pure BP neural network.

[0063] Table 4: Comparison results with the pure BP neural network method (without the first-order polynomial)

[0064] Key findings: The pure BP network achieves even higher accuracy than our application (0.0426%FS) in regions with sufficient training data coverage (0.026%FS on the training set). However, its accuracy degrades sharply to 0.073%FS (interpolation) and 0.421%FS (extrapolation) on independent test sets, exhibiting typical overfitting and insufficient generalization ability, which is an inherent defect of pure black-box models. In contrast, while the accuracy of our two-stage cascaded architecture on the training set does not exceed that of the pure BP network, it maintains stable high accuracy on both the interpolation test set (0.0438%FS) and the extrapolation test set (0.058%FS). This demonstrates the barrier effect of the physical model in providing a reliable baseline in the off-distribution region: when the BP network may exhibit large deviations in the extrapolation region due to the input distribution deviating from the training domain, the first-stage polynomial still retains a reliable compensation capability based on physical laws. The residual compensation of the BP network naturally approaches the mean level near the boundary of the training domain, avoiding a catastrophic impact on the overall output. This cascaded complementary effect is not present in a single BP network or a single polynomial model.

[0065] (v) Extrapolation capability verification To comprehensively evaluate the generalization reliability of this application, two extrapolation pilot tests were set outside the calibration temperature range [-40℃, 125℃]: -51.3℃ (low-temperature extrapolation) and 137.2℃ (high-temperature extrapolation), with one complete pressure cycle data collected for each. The combined extrapolation accuracy after two cascaded stages is 0.058%FS, which is only slightly degraded compared to the interpolation test set of 0.0438%FS, and significantly better than the extrapolation accuracy of only the first-level polynomial (0.137%FS) and the extrapolation accuracy of the pure BP network (0.421%FS). This result verifies the core advantage of the complementary integration of the physical model and the data-driven model in the extrapolation robustness of this application.

[0066] (vi) Examples of ceramic capacitive pressure sensors For ceramic capacitive pressure sensors (0~1MPa, -20~85℃), the same two-stage cascaded compensation method as in this embodiment is adopted, see [link to relevant documentation]. Figure 7 The specific calibration parameters are as follows: temperature calibration points M=5, with values ​​of -19.6℃, 5.8℃, 24.7℃, 54.3℃ and 84.2℃ respectively; pressure calibration points N=9, uniformly distributed within the 0~1MPa range; number of cycles K=4; number of temperature segments L=3, with an overlap zone of 10℃; the BP network structure is: input layer (4+3)=7 (unique thermal encoding), hidden layers 8-6, and output layer 1.

[0067] Table 5: Summary of Compensation Effects

[0068] Comprehensive accuracy verification: =0.0511%FS. This embodiment verifies the universal adaptability of the method of this application to different sensor types (piezoresistive → capacitive), different output forms (mV → 4-20mA), and different temperature ranges. The core error source of ceramic capacitive sensors differs from that of silicon piezoresistive sensors. Its hysteresis mainly stems from the elastic aftereffect of the ceramic diaphragm (rather than the temperature sensitivity of the piezoresistive coefficient of silicon), and the overall temperature drift is smaller than that of silicon piezoresistive sensors. The measured temperature drift before compensation is 1.53%FS (vs. 2.53%FS for silicon piezoresistive sensors), but the hysteresis / repeatability ratio is relatively higher. Therefore, in this embodiment, the forward and reverse stroke separation modeling contributes more to the accuracy improvement (ablation experiments show that it accounts for about 55% of the accuracy gain, compared to about 42% in the silicon piezoresistive embodiment).

[0069] (vii) Multi-sensor parallel calibration embodiment Eight identical sensors of the same model are simultaneously installed in the high and low temperature test chamber. The four independent channels of the multi-channel precision pressure controller are divided into two groups, with each group of two channels connected to four sensors via Y-type tee connectors. The data acquisition unit uses eight ADC channels to acquire data synchronously. The host computer calibration software independently runs the complete S2-S5 steps for each sensor, generating its own independent model parameters, which are then downloaded to the processing unit built into each sensor. Single-sensor serial calibration (7 temperature points) takes approximately 12.5 hours; parallel calibration of eight sensors takes approximately 14.2 hours, reducing the average calibration time per sensor to approximately 1.78 hours, an efficiency improvement of approximately 7 times. The actual bottleneck lies in the extended thermal equilibrium time of the multi-sensor fixture; the time required for simultaneous thermal equilibrium of eight sensors is approximately 1.4 to 1.8 times that of a single sensor (depending on the fixture's heat capacity and the chamber's convection efficiency).

[0070] See Figure 8 This application also provides a two-stage cascaded pressure sensor temperature compensation device in some embodiments, used to implement the two-stage cascaded pressure sensor temperature compensation method provided in the above embodiments, including: The high and low temperature test chamber is used to provide a controllable temperature environment. The chamber is equipped with mounting clamps that can simultaneously fix multiple pressure sensors to be calibrated and pressure connector through-wall interfaces. A multi-channel precision pressure controller that provides a standard pressure source and supports programmable pressure sequence output to automatically execute forward and reverse multi-cycle pressure control; The data acquisition and processing unit includes a multi-channel analog-to-digital converter module, a processor, and a non-volatile memory. The multi-channel analog-to-digital converter module is used to simultaneously acquire the raw output voltage value of the pressure sensor and the output temperature value of the temperature sensor. The processor is used to perform piecewise polynomial fitting calculations and BP neural network inference. The non-volatile memory is used to store polynomial coefficients and neural network weight parameters. The host computer calibration software runs on a personal computer and integrates calibration parameter configuration, data preprocessing, piecewise polynomial fitting, and BP neural network training functions. After training, the model parameters are downloaded to the non-volatile memory of the data acquisition and processing unit.

[0071] In some embodiments, the processor of the data acquisition and processing unit is a DSP processor or a heterogeneous processing core of FPGA and ARM; the resolution of the multi-channel analog-to-digital conversion module is not less than 24 bits, and it supports multi-channel synchronous sampling.

[0072] It should be understood that the heterogeneous processing cores of DSP (Digital Signal Processor) processors or FPGA (Field Programmable Gate Array) and ARM (Advanced RISC Machine) are used; the resolution of the multi-channel analog-to-digital converter module is no less than 24 bits, supporting multi-channel synchronous sampling. For example, the processor can be a microcontroller with a Cortex-M7 core or an FPGA+ARM heterogeneous system, and the multi-channel analog-to-digital converter module can use a 24-bit Σ-Δ ADC with a sampling rate range of 1SPS to 1kSPS (Samples Per Second), and each channel has an independent PGA (Programmable Gain Amplifier). These specific limitations enable the data acquisition and processing unit to meet the requirements of high-precision signal acquisition and real-time inference calculation, ensuring the real-time execution of the two-stage cascaded compensation method on the embedded end (e.g., a total inference time of 95 to 115 microseconds, meeting the 1kHz sampling rate requirement).

[0073] In some embodiments, the multi-channel precision pressure controller has at least four independent pressure output channels and supports parallel calibration of multiple sensors.

[0074] It should be understood that a multi-channel precision pressure controller can connect multiple sensors to be calibrated via independent channels. With the help of host computer calibration software, each sensor independently undergoes data preprocessing, piecewise multinomial fitting, and BP neural network training to generate its own independent model parameters. These model parameters are then downloaded to the corresponding data acquisition and processing unit. For example, eight sensors can be configured, divided into two groups using four independent channels. Each group connects four sensors via Y-type tee connectors, enabling parallel calibration of multiple sensors and significantly reducing the average calibration time. This design improves calibration efficiency in mass production while ensuring that each sensor obtains an independent compensation model that matches its individual characteristics, avoiding insufficient compensation due to individual sensor differences.

[0075] In some embodiments, the host computer calibration software independently runs data preprocessing, piecewise polynomial fitting, and BP neural network training steps for each pressure sensor to be calibrated, generates its own independent model parameters, and downloads the model parameters to the corresponding data acquisition and processing unit.

[0076] It should be understood that the independent operation of data preprocessing, piecewise polynomial fitting, and BP neural network training steps means that the calibration process of each sensor to be calibrated will not be affected by the calibration data of other sensors in the same batch. All data processing and model training are completed based on the original output data collected by the sensor at different temperatures and pressures. A unified general model parameter will not be directly applied; only multi-channel parallel synchronous processing is implemented in the calculation process. Piecewise polynomial fitting will first perform a coarse compensation for the pressure and temperature output based on the output characteristics of the sensor to obtain an initial compensation residual. Then, the BP neural network will perform a second fine compensation for the residual. The final model parameters will perfectly match the individual error characteristics of the sensor. After being downloaded and written to the corresponding data acquisition and processing unit, accurate error compensation can be achieved in the full temperature range and full measurement range, ensuring that each sensor can achieve consistent accuracy indicators after batch calibration.

[0077] As can be seen from the above technical solutions, the embodiments of this application provide a two-stage cascaded pressure sensor temperature compensation method and device. This involves performing multiple complete pressure cycles on the pressure sensor at multiple preset temperature points and multiple preset pressure points. Each pressure cycle includes a forward stroke pressurization process and a reverse stroke depressurization process. The original output voltage value of the pressure sensor, the output temperature value of the temperature sensor, and the corresponding standard pressure value are recorded at each sampling point, constructing a multi-dimensional calibration dataset containing temperature, pressure, stroke direction, and number of cycles. The multi-dimensional calibration dataset is preprocessed, including calculating the mean and standard deviation of multiple cycles of data under the same temperature, pressure, and direction, performing outlier detection and removal, and normalization. The temperature range is divided into multiple temperature intervals, with overlapping areas between adjacent temperature intervals. Within each temperature interval, a bivariate polynomial surface is independently fitted to the forward and reverse stroke data as the first-level compensation model. The fitting uses a weighted least squares method, with the weights set to the weights based on the number of cycles at each calibration point. The second-level residual compensation model is obtained by taking the reciprocal of the variance of the loop measurement; for data points in the overlapping area, a weighted average of the predicted values ​​of two adjacent polynomial segments is used to achieve a smooth transition; the prediction residual of the first-level compensation model at each calibration point is calculated, and the prediction residual is the difference between the true standard pressure value and the predicted value of the first-level compensation model; a BP neural network is constructed, with the normalized original output voltage value of the pressure sensor, the normalized output temperature value of the temperature sensor, the stroke direction mark, the predicted value of the first-level compensation model after normalization, and the temperature interval segment encoding vector as the network input, and the prediction residual as the network output target for training, to obtain the second-level residual compensation model; in actual measurement, for each set of data collected by the sensor in real time, the stroke direction is first determined and the corresponding piecewise polynomial model is selected for first-level compensation, and then the obtained first-level compensation value and auxiliary information are input into the trained BP neural network to obtain the residual compensation amount. Finally, the pressure output is the sum of the first-level compensation value and the residual compensation amount, which solves the problem that the physical model and the data-driven model cannot complement and integrate.

Claims

1. A method for temperature compensation of a two-stage cascaded pressure sensor, characterized in that, include: At multiple preset temperature points and multiple preset pressure points, multiple complete pressure cycles are performed on the pressure sensor. Each pressure cycle includes a forward stroke pressurization process and a reverse stroke depressurization process. The original output voltage value of the pressure sensor, the output temperature value of the temperature sensor, and the corresponding standard pressure value of each sampling point are recorded to construct a multi-dimensional calibration dataset containing temperature, pressure, stroke direction, and number of cycles. The multidimensional calibration dataset is preprocessed, including calculating the mean and standard deviation of multiple cycles of data under the same temperature, pressure, and direction, detecting and removing outliers, and normalizing the data. The temperature range is divided into multiple temperature intervals, with overlapping areas between adjacent temperature intervals. Within each temperature interval, bivariate polynomial surfaces are independently fitted to the forward and reverse travel data as the first-level compensation model. The fitting uses the weighted least squares method, with the weights set as the reciprocal of the variance measured multiple times at each calibration point. For data points within the overlapping area, a weighted average of the predicted values ​​of two adjacent polynomial segments is used to achieve a smooth transition. Calculate the prediction residual of the first-level compensation model at each calibration point, where the prediction residual is the difference between the actual standard pressure value and the predicted value of the first-level compensation model. A BP neural network is constructed, with the normalized original output voltage value of the pressure sensor, the normalized output temperature value of the temperature sensor, the stroke direction mark, the normalized predicted value of the first-level compensation model, and the temperature interval encoding vector as network inputs, and the predicted residual as the network output target for training, to obtain the second-level residual compensation model. In actual measurement, for each set of data collected by the sensor in real time, the direction of travel is first determined and the corresponding piecewise polynomial model is selected for the first level of compensation. Then, the obtained first level compensation value and auxiliary information are input into the trained BP neural network to obtain the residual compensation amount. Finally, the pressure output is the sum of the first level compensation value and the residual compensation amount.

2. The temperature compensation method for a two-stage cascaded pressure sensor according to claim 1, characterized in that, The number of preset temperature points is no less than 5, the number of preset pressure points is no less than 6, and the number of cycles is no less than 3.

3. The temperature compensation method for a two-stage cascaded pressure sensor according to claim 1, characterized in that, The bivariate polynomial surface is a bivariate cubic polynomial; the overlap rate between adjacent temperature intervals is 10% to 25%; the weighted average weight of the overlapping area is determined based on the distance from the temperature of the data point to the boundary of the two adjacent segments.

4. The temperature compensation method for a two-stage cascaded pressure sensor according to claim 1, characterized in that, The structure of the BP neural network is as follows: the input layer contains neurons corresponding to the normalized original output voltage value of the pressure sensor, the normalized output temperature value of the temperature sensor, the travel direction indicator, the normalized predicted value of the first-level compensation model, and the temperature interval encoding vector; the temperature interval encoding vector is a one-hot encoding vector; the BP neural network contains at least one hidden layer, the activation function of the hidden layer is a hyperbolic tangent sigmoid function, and the activation function of the output layer is a linear function; training adopts the Levenberg-Marquardt algorithm, taking 10%–20% of the training data as the validation set, and stopping training and backtracking when the validation set error does not decrease for 4–8 consecutive iterations.

5. The temperature compensation method for a two-stage cascaded pressure sensor according to claim 1, characterized in that, The method for determining the travel direction is as follows: maintain a sliding window and record the most recent original output voltage values ​​of multiple pressure sensors; Calculate the linear regression slope within the window; when the slope is greater than a preset positive threshold, it is determined to be a positive regression; when the slope is less than a preset negative threshold, it is determined to be a negative regression; when the slope is between the preset positive threshold and the preset negative threshold, the direction determination result of the previous moment is maintained.

6. The temperature compensation method for a two-stage cascaded pressure sensor according to claim 1, characterized in that, The method further includes: When the sensor characteristics drift, the weights of the output layer of the BP neural network are incrementally fine-tuned using newly acquired calibration samples, while keeping the weights of the hidden layers unchanged. When the fine-tuned cross-validation residual exceeds a preset threshold, a full joint fine-tuning alarm is triggered.

7. A two-stage cascaded pressure sensor temperature compensation device, used to implement the two-stage cascaded pressure sensor temperature compensation method according to any one of claims 1 to 6, characterized in that, include: The high and low temperature test chamber is used to provide a controllable temperature environment. The chamber is equipped with mounting clamps that can simultaneously fix multiple pressure sensors to be calibrated and pressure connector through-wall interfaces. A multi-channel precision pressure controller that provides a standard pressure source and supports programmable pressure sequence output to automatically execute forward and reverse multi-cycle pressure control; The data acquisition and processing unit includes a multi-channel analog-to-digital converter module, a processor, and a non-volatile memory; the multi-channel analog-to-digital converter module is used to simultaneously acquire the raw output voltage value of the pressure sensor and the output temperature value of the temperature sensor. The processor is used to perform piecewise polynomial fitting calculations and BP neural network inference; the non-volatile memory is used to store polynomial coefficients and neural network weight parameters. The host computer calibration software runs on a personal computer and integrates calibration parameter configuration, data preprocessing, piecewise polynomial fitting, and BP neural network training functions. After training is completed, the model parameters are downloaded to the non-volatile memory of the data acquisition and processing unit.

8. The two-stage cascaded pressure sensor temperature compensation device according to claim 7, characterized in that, The processor of the data acquisition and processing unit is a DSP processor or a heterogeneous processing core of FPGA and ARM; the resolution of the multi-channel analog-to-digital conversion module is not less than 24 bits and supports multi-channel synchronous sampling.

9. The two-stage cascaded pressure sensor temperature compensation device according to claim 7, characterized in that, The multi-channel precision pressure controller has at least four independent pressure output channels and supports parallel calibration of multiple sensors.

10. The two-stage cascaded pressure sensor temperature compensation device according to claim 7, characterized in that, The host computer calibration software independently performs data preprocessing, piecewise polynomial fitting, and BP neural network training steps for each pressure sensor to be calibrated, generating independent model parameters for each sensor, and then downloading the model parameters to the corresponding data acquisition and processing unit.

Citation Information

Patent Citations

  • Method for compensating signal of high-precision pressure sensor

    CN101858811B