A strain sensor temperature compensation method, device and readable storage medium
By optimizing the support vector regression machine model with the improved Grey Wolf optimization algorithm, the problem of lack of theoretical basis for parameter selection in temperature compensation of strain gauge sensors is solved, efficient and accurate temperature compensation is achieved, and the measurement accuracy and compensation effect of the sensor are improved.
Patent Information
- Application Number
- CN202410260514.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-07
- Publication Date
- 2025-09-26
- Estimated Expiration
- 2044-03-07
AI Technical Summary
The existing temperature compensation methods for strain sensors have the problems of high hardware compensation cost and low precision, and the lack of theoretical basis for the selection of support vector regression machine parameters in software compensation, resulting in poor temperature compensation effect and low precision.
The improved grey wolf optimization algorithm is used to optimize the support vector regression machine (IGWO-SVR) model. The experimental data are normalized, and the pre-trained IGWO-SVR model is used for temperature compensation. The kernel parameters and penalty coefficients are optimized to achieve nonlinear temperature compensation.
The online, efficient and accurate temperature compensation of the strain sensor is realized, which improves the measurement accuracy, reduces the calculation amount, and simplifies the data acquisition and calibration operations.
Smart Images

Figure CN118153427B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of temperature compensation of strain gauge sensors, and in particular relates to a method and device for nonlinear temperature compensation of strain gauge sensors and a readable storage medium. Background Art
[0002] In practical applications, strain gauge sensors are highly sensitive to ambient temperature, and temperature drift has become the most significant factor affecting their accuracy and reliability. Accurately and effectively compensating for temperature drift is crucial for improving strain gauge sensor measurement.
[0003] Existing temperature compensation methods include hardware and software. Hardware compensation methods struggle to achieve full compensation, are costly, and offer low accuracy, making them difficult to directly apply to other sensor models and types. Software compensation, however, offers greater flexibility, higher accuracy, and a relatively low cost compared to hardware compensation, making it the predominant compensation method. Software compensation methods are further categorized into linear and nonlinear methods. Linear methods primarily employ multivariate linear regression, which is simple and requires minimal computational resources. However, these methods treat the temperature variation of strain sensors as a linear process, which is inconsistent with reality and results in poor temperature compensation. Nonlinear methods primarily include neural networks and support vector machines. Neural networks offer excellent nonlinear prediction performance and high accuracy for strain sensor compensation. However, they have drawbacks such as large sample sizes, long learning times, and highly unstable results. Support vector regression (SVR) requires a smaller sample size and is therefore well-suited for strain sensor temperature compensation modeling. It can describe the temperature variation characteristics of strain sensors and achieve nonlinear temperature compensation. However, in practical applications, the selection of the penalty coefficient c and kernel parameter g of the support vector regression machine is mainly based on empirical methods and lacks a systematic theoretical basis. In addition, inappropriate parameters not only increase the complexity of SVR model training, but also reduce the generalization ability of SVR. Summary of the Invention
[0004] Purpose of the invention: In order to overcome the deficiencies in the prior art, the present invention provides a method, device and readable storage medium for nonlinear temperature compensation of a strain sensor, which can perform online, efficient and accurate temperature compensation on strain sensor data, improve the measurement accuracy of the strain sensor after temperature changes, and reduce the error of temperature drift.
[0005] Technical solution: In the first aspect, the present invention provides a nonlinear temperature compensation method for a strain gauge sensor, comprising:
[0006] Obtain experimental data samples;
[0007] Normalize the experimental data samples to obtain normalized data;
[0008] According to the normalized data, compensation processing is performed based on the pre-trained IGWO-SVR model to obtain the strain compensation value;
[0009] The training of the IGWO-SVR model includes:
[0010] The normalized data is made into training samples and test samples;
[0011] The model is trained according to the training samples to obtain a training model; and the training model is evaluated according to the test samples to obtain an IGWO-SVR model for compensation processing of the experimental data samples.
[0012] In a further embodiment, the method of obtaining the experimental data sample includes:
[0013] Real-time recording of experimental data of multiple temperature calibration and stress calibration cycles of the strain sensor temperature compensation experimental platform;
[0014] The experimental data under multiple temperature calibration and stress calibration cycles are prepared as experimental data samples;
[0015] Among them, the strain sensor temperature compensation experimental platform is built by strain sensors, temperature sensors and constant temperature chambers.
[0016] In a further embodiment, the method for constructing the strain sensor temperature compensation experimental platform is as follows:
[0017] Place the strain gauge sensor and temperature sensor combination into a constant temperature box;
[0018] Set the strain gauge range of the strain gauge sensor to 200-2000 kPa, and take a stress calibration point every 50 kPa. Set the temperature range of the thermostat to -15-50°C, and set the temperature calibration cycle to 5°C, so that a temperature calibration point of the temperature sensor is taken every 5°C, and the temperature calibration point is the operating temperature of the temperature sensor.
[0019] Among them, after each temperature calibration point is left to stand for 15 minutes, the strain sensor stress and the constant temperature box temperature are set to change, and the experimental data under multiple temperature calibration and stress calibration cycles are obtained. The experimental data include: the temperature sensor output voltage U T , the strain P applied to the strain sensor, the output voltage U of the strain sensor P .
[0020] In a further embodiment, the normalization expression is:
[0021]
[0022] Where x is the experimental data sample, x′ is the normalized data, ranging from [0,1], min(x) and max(x) are the minimum and maximum values of the sample data, respectively.
[0023] In a further embodiment, compensation processing is performed based on the normalized data and a pre-trained IGWO-SVR model to obtain a strain compensation value, including:
[0024] The strain gauge sensor output voltage U P And the temperature sensor output voltage U T Import the pre-trained IGWO-SVR model for temperature compensation fitting to obtain the strain compensation value;
[0025] According to the strain compensation value, the measurement error of the strain sensor due to temperature drift is eliminated.
[0026] In a further embodiment, model training is performed based on training samples to obtain a training model; and the training model is evaluated based on test samples to obtain an optimal IGWO-SVR model, including:
[0027] Substitute the training samples into the SVR model calculation to obtain the SVR model training parameters and predict the strain P of the strain sensor;
[0028] The IGWO algorithm is used to optimize the SVR model training parameters. The strain P of the predicted strain sensor is compared with the strain P of the calibrated strain sensor in the training sample to obtain the SVR model training parameters that meet the preset conditions.
[0029] The IGWO-SVR model is updated based on the SVR model training parameters that meet the preset conditions and the IGWO-SVR model is tested using a test sample to obtain a test strain value;
[0030] Substitute the test strain value into the maximum error value to calculate and obtain the IGWO-SVR model that meets the evaluation conditions;
[0031] The difference between the strain P of the predicted strain sensor associated with the SVR model training parameters that meet the preset conditions and the strain P of the calibrated strain sensor is smaller than the strain P of the predicted strain sensor associated with other SVR model training parameters.
[0032] In a further embodiment, the maximum error value includes: the maximum absolute error ΔP abs , maximum relative error ΔP xd ; The maximum absolute error ΔP abs , maximum relative error ΔP xd The expressions are:
[0033] ΔP abs=|PP 米 | max
[0034]
[0035] Where: P is the stress calibration value, P * is the stress compensation value.
[0036] In a further embodiment, preparing the normalized data into training samples and test samples includes:
[0037] The normalized data is divided into training samples and test samples in a ratio of 7:3; wherein, the training samples and test samples both include: the output voltage U T , strain sensor output voltage U P , the strain P applied to the strain sensor.
[0038] In a second aspect, the present invention provides a nonlinear temperature compensation device for a variable sensor, comprising:
[0039] Data acquisition module, used to obtain experimental data samples;
[0040] The data processing module is used to normalize the experimental data samples to obtain normalized data;
[0041] The compensation processing module is used to perform compensation processing based on the normalized data and the pre-trained IGWO-SVR model to obtain the strain compensation value;
[0042] The training of the IGWO-SVR model includes:
[0043] The normalized data is made into training samples and test samples;
[0044] The model is trained according to the training samples to obtain a training model; and the training model is evaluated according to the test samples to obtain an IGWO-SVR model for compensation processing of the experimental data samples.
[0045] In a third aspect, the present invention provides a computer-readable storage medium having a computer program / instruction stored thereon. When the computer program / instruction is executed by a processor, the steps of the above-mentioned strain sensor nonlinear temperature compensation method are implemented.
[0046] Beneficial effects: Compared with the prior art, the present invention has the following advantages:
[0047] By introducing the pre-trained IGWO-SVR model, the defects of the existing experimental data, such as the long training time for SVM and the inability to complete online temperature compensation of the strain sensor, are solved. The strain sensor data can be temperature compensated online, efficiently and accurately, thereby improving the measurement accuracy of the strain sensor.
[0048] In practical applications, the IGWO-SVR model is used to compensate the actual output data of the strain sensor, making data acquisition and calibration operations simpler. It not only reduces the amount of actual compensation calculations but also helps to ensure the effect, accuracy and engineering application of temperature compensation. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] Figure 1 FIG2 is a flow chart of a nonlinear temperature compensation method for a strain gauge sensor according to the present invention;
[0050] Figure 2 FIG2 is a schematic diagram of SVR modeling in the nonlinear temperature compensation method for a strain gauge sensor according to the present invention;
[0051] Figure 3 FIG2 is a schematic diagram of an improved gray wolf optimization algorithm in the nonlinear temperature compensation method for a strain gauge sensor according to the present invention;
[0052] Figure 4 FIG. 1 is an example diagram of data without temperature compensation according to the present invention;
[0053] Figure 5 Shown is a diagram showing an embodiment of the nonlinear temperature compensation method for a strain gauge sensor of the present invention. DETAILED DESCRIPTION
[0054] The technical solution of the present invention is described in detail below through the accompanying drawings and specific embodiments. It should be understood that the embodiments of the present invention and the specific features in the embodiments are detailed descriptions of the technical solution of the present invention, rather than limitations on the technical solution of the present invention. In the absence of conflict, the embodiments of the present invention and the technical features in the embodiments can be combined with each other.
[0055] The term "and / or" simply describes a relationship between related objects, indicating that three possible relationships exist. For example, "A and / or B" can mean: A exists alone, A and B exist simultaneously, or B exists alone. Additionally, the character " / " generally indicates an "or" relationship between the related objects.
[0056] Example 1
[0057] This embodiment introduces a nonlinear temperature compensation method for a strain gauge sensor, including:
[0058] Obtain experimental data samples;
[0059] Normalize the experimental data samples to obtain normalized data;
[0060] According to the normalized data, compensation processing is performed based on the pre-trained IGWO-SVR model to obtain the strain compensation value;
[0061] The training of the IGWO-SVR model includes:
[0062] The normalized data is made into training samples and test samples;
[0063] The model is trained according to the training samples to obtain a training model; and the training model is evaluated according to the test samples to obtain an IGWO-SVR model for compensation processing of the experimental data samples.
[0064] Preferably, the method for obtaining the experimental data sample includes:
[0065] Real-time recording of experimental data of multiple temperature calibration and stress calibration cycles of the strain sensor temperature compensation experimental platform;
[0066] The experimental data under multiple temperature calibration and stress calibration cycles are prepared as experimental data samples;
[0067] Among them, the strain sensor temperature compensation experimental platform is built by strain sensors, temperature sensors and constant temperature chambers.
[0068] In a further embodiment, the method for constructing the strain sensor temperature compensation experimental platform is as follows:
[0069] Place the strain gauge sensor and temperature sensor combination into a constant temperature box;
[0070] Set the strain gauge range of the strain gauge sensor to 200-2000 kPa, and take a stress calibration point every 25 kPa. Set the temperature range of the thermostat to -15-50°C, and set the temperature calibration cycle to 5°C, so that a temperature calibration point of the temperature sensor is taken every 5°C, and the temperature calibration point is the operating temperature of the temperature sensor.
[0071] Among them, after each temperature calibration point is left to stand for 15 minutes, the strain sensor stress and the constant temperature box temperature are set to change, and the experimental data under multiple temperature calibration and stress calibration cycles are obtained, including the temperature sensor output voltage U T , the strain P applied to the strain sensor, the output voltage U of the strain sensor P .
[0072] Preferably, the normalized expression is:
[0073]
[0074] Where x is the experimental data sample, x′ is the normalized data, ranging from [0,1], min(x) and max(x) are the minimum and maximum values of the sample data, respectively.
[0075] Preferably, compensation processing is performed based on the normalized data and the pre-trained IGWO-SVR model to obtain the strain compensation value, including:
[0076] The strain gauge sensor output voltage U P And the temperature sensor output voltage U T Import the pre-trained IGWO-SVR model for temperature compensation fitting to obtain the strain compensation value;
[0077] According to the strain compensation value, the measurement error of the strain sensor due to temperature drift is eliminated.
[0078] Preferably, model training is performed based on the training samples to obtain a training model; and the training model is evaluated based on the test samples to obtain an optimal IGWO-SVR model, including:
[0079] Substitute the training samples into the SVR model calculation to obtain the SVR model training parameters and predict the strain P of the strain sensor;
[0080] The IGWO algorithm is used to optimize the SVR model training parameters. The strain P of the predicted strain sensor is compared with the strain P of the calibrated strain sensor in the training sample to obtain the SVR model training parameters that meet the preset conditions.
[0081] The IGWO-SVR model is updated based on the SVR model training parameters that meet the preset conditions and the IGWO-SVR model is tested using a test sample to obtain a test strain value;
[0082] Substitute the test strain value into the maximum error value to calculate and obtain the IGWO-SVR model that meets the evaluation conditions;
[0083] The difference between the strain P of the predicted strain sensor associated with the SVR model training parameters that meet the preset conditions and the strain P of the calibrated strain sensor is less than the strain P of the predicted strain sensor associated with other SVR model training parameters;
[0084] In this embodiment, the SVR model adopts a support vector regression machine SVR to construct the support vector regression machine SVR.
[0085] Preferably, the normalized data is prepared as training samples and test samples, including:
[0086] The normalized data is divided into training samples and test samples in a ratio of 7:3; wherein, the training samples and test samples both include: the output voltage U T , strain sensor output voltage U P , the strain P applied to the strain sensor.
[0087] In this embodiment, the training samples are used to train the SVR model, such as Figure 2 The process shown is:
[0088] SVR is based on the input training sample U={(x1,y1),(x2,y2),…,(x n ,y n )} training model, where x i The temperature sensor outputs voltage U T , strain sensor output voltage U P Composed of input row vectors, y i is the value of the strain P applied to the strain sensor, x i and y i They correspond to the input vector and output value of the i-th sample respectively, and n is the number of training samples;
[0089] Let the hyperplane in n-dimensional space be W T x+b=0, where W=(W1, W2,…, W n ) is the normal vector, which determines the direction of the hyperplane, b is the displacement term, which determines the distance between the hyperplane and the origin, and is the number of training samples;
[0090] Let the normal vector of the n-dimensional hyperplane feature vector W be the positive distance and the opposite direction be the negative distance, y k Is a scalar. When the training sample point vector is at a positive distance from the hyperplane, y k =1, when the distance is in the negative direction, y k =-1;
[0091] Any training sample point V K ∈{V1,V2,…,V M The distance d from} to the hyperplane is:
[0092]
[0093]
[0094] Where: V K ∈{V1,V2,…,V M}, V K′ ∈{V1,V2,…,V M} is the training sample point vector farthest from the hyperplane, where M = C × D, C is the output voltage U of the temperature sensor T The number of, D is the output voltage U of the strain sensor P The number of .
[0095] During the training process, the SVR model uses nonlinear mapping Input training samples: U={(x1,y1),(x2,t2),…,(x n ,y n )}Mapping from low-dimensional space to high-dimensional space, the mathematical expression of this process is: The purpose of SVR regression training is to obtain the hyperplane W of the feature vector W T x + b = 0, so that the distance d from the training sample point to the hyperplane is as large as possible, so the above formula is equivalent to the optimization problem with constraints:
[0096]
[0097]
[0098] Where: i and ξ i * is the relaxation factor, representing the upper and lower bounds of the relaxation variables, and the ε insensitive loss factor, which is responsible for adjusting the complexity of the sample regression model and the sample fitting accuracy. is a nonlinear mapping function, and c is a penalty coefficient.
[0099] Using kernel function Introducing the duality principle and Lagrangian function, we get the dual problem:
[0100]
[0101]
[0102] Where α i and is the Lagrange multiplier; St is the constraint condition; n is the number of samples.
[0103] Solve α by the dual formula i and The final regression function is:
[0104]
[0105] Where y, f(x) is the regression function; K(x i , x j ) is the kernel function; b is the bias.
[0106] In view of the randomness of the actual working environment temperature of the strain sensor, the training sample data are randomly arranged to simulate the real scene.
[0107] In addition, if Figure 3 As shown in the figure, IGWO is used to find the parameters of SVR for optimization. The training samples U = {(x1, y1), (x2, y2), ..., (x n ,y n )} is used as the input data of the IGWO-SVR algorithm model, and the predicted strain value p* after temperature compensation is output. The improved gray wolf algorithm includes steps (a) to (c), and the optimized support vector regression machine specifically includes:
[0108] (a) Firstly, construct IGWO;
[0109] (a1) Social hierarchy of gray wolves: Initialize the positions of individual wolves in the wolf pack, where the positions of the most fit individuals α wolf, β wolf, and γ wolf are X respectively. α , X β and X γ As the highest social level of gray wolves, the alpha wolf is the core of the wolf pack and leads other levels of gray wolves in hunting activities.
[0110] (a2) Surrounding the prey. During the hunting process, the mathematical formula of the gray wolf's hunting behavior D is as follows:
[0111] D=|CX P (t)-X(t)|
[0112] X(t+1)=X P (t)-AD
[0113] A=2ar1-a
[0114] C=2r2
[0115] Where: t is the current iteration number; X p is the position vector of the target; X is the position vector of the gray wolf;
[0116] A and C are coefficient vectors, respectively, and the calculation formula is:
[0117] A=2ar1-a
[0118] C=2r2
[0119] Where: a is the convergence factor; r1 and r2 are random vectors between [0, 1]; ar1 is the product of the convergence factor and the random vector.
[0120] (a3) Hunting: During the hunting process, the wolf pack's search units will update their positions according to the three best solutions. The mathematical formula for the collective hunting behavior of gray wolves is:
[0121] D α =|C1X α -X|
[0122] D β =|C2X β -X|
[0123] D γ =|C3X γ -X|
[0124] X1=|X α -A1D α |
[0125] X2=|X β -A2D β |
[0126] X3=|X γ -A3D γ |
[0127]
[0128] Where: D α 、D β 、D γ are the distances between α, β, γ and other individuals; X α , X β 、X γ are the current positions of α, β, and γ respectively; C1, C2, and C3 are random vectors; X1, X2, and X3 are the approach processes of α, β, and γ wolves respectively; and X(t+1) is the initial position of the wolf in the next iteration.
[0129] (a4): Attack and search for prey. A takes values in the interval [-a, a]. When A<1, the wolf pack starts to attack the prey; when A>1, the wolf pack conducts a full-area search.
[0130] (b) Chaotic Optimization Algorithm Population Initialization: Chaotic sequences have good randomness, ergodicity, and regularity. The basic principle is to generate chaotic sequences between values [0, 1] through mapping relationships and transform them into the individual search space. The more uniform the distribution of the initial population in the space, the more conducive it is to the optimization process. Compared with other mappings, the Tent mapping has a more balanced sequence. The formula is as follows:
[0131]
[0132]
[0133] Where: is a chaotic sequence, μ∈(0,2] is a chaotic parameter, i is the number of populations, and j is the serial number of the chaotic variable.
[0134] (c) The normal cloud model is introduced as a wolf pack update mechanism during the gray wolf attack phase: The cloud model is a tool for achieving uncertain conversion between qualitative concepts and quantitative values. It can well describe the randomness and fuzziness of data. Among them, the normal cloud model is most consistent with the random probability distribution in nature.
[0135] Suppose there exists a set Q = {c}, where Q is the domain of a constant value c. For any element c in the fuzzy set A in the domain Q, there exists a random number μ with a stable tendency. A (c), called c to μ A (c) The membership degree of the cloud model fitting formula is as follows:
[0136]
[0137] E′ n ~N( E ,H e )
[0138] ξ=maxp(x)
[0139] Where: E x is the expected value parameter; E n is the entropy parameter; H e is the super entropy parameter; is the fitting correction; p(x) is the peak probability of the cloud droplet x probability distribution curve, f(x) is the cloud model fitting formula, is the fitting correction, E′ n is a normal random number, p(x) is the peak probability of the cloud droplet x probability distribution curve;
[0140] The distribution of random variables composed of all cloud droplets x on the universe Q is called the normal cloud model. The normal cloud model is composed of the expectation E x , Entropy E n and super entropy H e Characterization, expectation E x The most representative qualitative concept is the expectation of the prediction error in the domain distribution; entropy E n Indicates the uncertainty of the prediction error, that is, the amplitude fluctuation range of the error; super entropy H e is entropy E n The uncertainty measure of , which indicates the concentration of the prediction error, is calculated as follows:
[0141]
[0142]
[0143]
[0144]
[0145] Where: i is the sample number; n is the total number of samples; e i is the prediction error, S 2 is the sum of squares between the predicted value and the expected value;
[0146] The normal cloud generator is an algorithm that obeys the normal cloud model. Each time the generator runs, it generates a cloud droplet until the desired number of cloud droplets N is generated. d , the normal cloud generator formula is as follows:
[0147] X[x1, x2, ..., x Nd ]=Gnc(E x , E n , H e , N d )
[0148] After the tent mapping is introduced in the population initialization, the normal cloud model is used as the update mechanism of the wolf pack position, and the current optimal individual position is taken as the expected E x , the position update formula is as follows:
[0149] position′=Gnc(position best , E n , H e , N d )
[0150] Where position_best is the position of the current optimal individual;
[0151] By adjusting E n Update the distance range of the optimal individual position and adjust H e Control the dispersion of the wolf pack's position. According to the predation process of the wolf pack tracking, surrounding, and attacking, the wolf pack gradually approaches the position range of the prey, so E n and H e The value can be adaptively adjusted to:
[0152]
[0153] Where, E n is entropy, H e is the super entropy, ω∈(0,1) is a random number, t is the current iteration number, τ and ξ are positive integers, and maxiter is the maximum iteration number.
[0154] (4d) Improve the gray wolf optimization algorithm to optimize the support vector regression machine and establish the IGWO-SVR temperature compensation model: In order to solve the defect of SVR training with randomly given kernel parameters g and penalty coefficient c, IGWO is introduced into the SVR model training parameter optimization process, and the dynamic optimization feature is used to optimize SVR.
[0155] Initialize the parameters of the gray wolf algorithm, and randomly assign kernel parameters g and penalty coefficient c to the SVR for training. Use the mean square error to update the spatial position of the gray wolf, and retrain the kernel parameters g and penalty coefficient c by SVR. The object with the lowest mean square error is captured as prey, and the fitness value is continuously optimized until a global optimal solution that meets the conditions is obtained, that is, the optimal kernel parameters g and penalty coefficient c of the SVR model, forming an optimal temperature compensation model.
[0156] Preferably, the maximum error value includes: maximum absolute error ΔP abs , maximum relative error ΔP xd ; The maximum absolute error ΔP abs , maximum relative error ΔP xd The expressions are:
[0157] ΔP abs =|PP * | max
[0158]
[0159] Where: P is the stress calibration value, P * is the stress compensation value.
[0160] Example 2
[0161] Based on the same inventive concept as Example 1, this embodiment introduces a nonlinear temperature compensation device for a variable sensor, comprising:
[0162] Data acquisition module, used to obtain experimental data samples;
[0163] The data processing module is used to normalize the experimental data samples to obtain normalized data;
[0164] The compensation processing module is used to perform compensation processing based on the normalized data and the pre-trained IGWO-SVR model to obtain the strain compensation value;
[0165] The training of the IGWO-SVR model includes:
[0166] The normalized data is made into training samples and test samples;
[0167] The model is trained according to the training samples to obtain a training model; and the training model is evaluated according to the test samples to obtain an IGWO-SVR model for compensation processing of the experimental data samples.
[0168] like Figure 4 The data shown without temperature compensation has temperature drift and is inaccurate, such as Figure 5As shown in the figure, by applying stress to the strain sensor at {200, 225, …, 1975, 2000} (unit: kPa) under preset temperature conditions {-15, -10, …, 45, 50} (unit: °C) and then compensating the calibration experimental data using the IGWO-SVR model, data acquisition and calibration operations are simplified, which not only reduces the actual compensation calculation amount but also helps to ensure the effect, accuracy and engineering application of temperature compensation.
[0169] Example 3
[0170] Based on the same inventive concept as other embodiments, this embodiment introduces a computer-readable storage medium having a computer program / instruction stored thereon. When the computer program / instruction is executed by a processor, the steps of the following strain sensor nonlinear temperature compensation method are implemented.
[0171] Obtain experimental data samples;
[0172] Normalize the experimental data samples to obtain normalized data;
[0173] According to the normalized data, compensation processing is performed based on the pre-trained IGWO-SVR model to obtain the strain compensation value;
[0174] The training of the IGWO-SVR model includes:
[0175] The normalized data is made into training samples and test samples;
[0176] The model is trained according to the training samples to obtain a training model; and the training model is evaluated according to the test samples to obtain an IGWO-SVR model for compensation processing of the experimental data samples.
[0177] In summary, the present invention introduces a pre-trained IGWO-SVR model to address the drawbacks of existing experimental data, such as the long training time required for SVMs and the inability to perform online temperature compensation for strain gauge sensors. This model enables efficient and accurate online temperature compensation of strain gauge sensor data, improving strain gauge sensor measurement accuracy. Furthermore, by combining an insensitive loss function and a kernel function to construct a support vector regression machine (SVR), the learning speed is accelerated.
[0178] In practical applications, the IGWO-SVR model is used to compensate the actual output data of strain gauge sensors, simplifying data acquisition and calibration operations. This not only reduces the computational complexity of actual compensation but also helps ensure the effectiveness, accuracy, and engineering applicability of temperature compensation. To address the problems of the gray wolf optimization algorithm with randomly initialized populations and its tendency to fall into local optimal solutions, a chaotic factor optimization algorithm is introduced to initialize the gray wolf population, and a normal cloud model is used to improve the gray wolf optimization algorithm's tendency to fall into local optimal solutions. To address the problem that the selection of the penalty coefficient c and kernel parameter g of the support vector regression machine (SVR) is mainly based on empirical methods and lacks a systematic theoretical basis, an improved gray wolf optimization algorithm (IGWO) is used to optimize the penalty coefficient c and kernel parameter g of the support vector regression machine (SVR). A strain gauge sensor temperature compensation model based on IGWO-SVR is established.
[0179] It will be understood by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Thus, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0180] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowcharts and / or block diagrams, as well as combinations of processes and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowcharts and / or block diagrams. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0181] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0182] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0183] The embodiments of the present invention are described above in conjunction with the accompanying drawings, but the present invention is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present invention, ordinary technicians in this field can also make many forms without departing from the scope of protection of the purpose of the present invention and the claims, which are all protected by the present invention.
Claims
1. A nonlinear temperature compensation method for a strain gauge sensor, characterized in that: include: Obtain experimental data samples; Normalize the experimental data samples to obtain normalized data; According to the normalized data, compensation processing is performed based on the pre-trained IGWO-SVR model to obtain the strain compensation value; The training of the IGWO-SVR model includes: The normalized data is made into training samples and test samples; Perform model training based on the training samples to obtain a training model; and evaluate the training model based on the test samples to obtain an IGWO-SVR model for compensation processing of the experimental data samples; The model is trained based on the training samples to obtain the training model; and the training model is evaluated based on the test samples to obtain the optimal IGWO-SVR model, including: Import the training samples into the SVR model calculation to obtain the SVR model training parameters and predict the strain of the strain sensor ; The IGWO algorithm is used to optimize the SVR model training parameters, and the strain of the strain sensor is predicted. The strain of the calibrated strain gauge sensor in the training sample Compare and obtain the SVR model training parameters that meet the preset conditions; The IGWO-SVR model is updated based on the SVR model training parameters that meet the preset conditions and the IGWO-SVR model is tested using a test sample to obtain a test strain value; Substitute the test strain value into the maximum error value to calculate and obtain the IGWO-SVR model that meets the evaluation conditions; Among them, the SVR model training parameters that meet the preset conditions are associated with the predicted strain of the strain sensor The strain of the calibrated strain gauge sensor The difference is smaller than the strain of the strain sensor associated with the other SVR model training parameters. .
2. The nonlinear temperature compensation method for a strain gauge sensor according to claim 1, wherein: Methods for obtaining experimental data samples include: Real-time recording of experimental data of multiple temperature calibration and stress calibration cycles of the strain sensor temperature compensation experimental platform; The experimental data under multiple temperature calibration and stress calibration cycles are prepared as experimental data samples; Among them, the strain sensor temperature compensation experimental platform is built by strain sensors, temperature sensors and constant temperature chambers.
3. The nonlinear temperature compensation method for a strain gauge sensor according to claim 2, wherein: The construction method of the strain sensor temperature compensation experimental platform is as follows: Place the strain gauge sensor and temperature sensor combination into a constant temperature box; Set the strain gauge sensor range to , every Pick stress calibration points; set the temperature change range of the constant temperature box to , and set the temperature calibration cycle to , so that every Pick A temperature calibration point of a temperature sensor, and the temperature calibration point is the operating temperature of the temperature sensor; Each temperature calibration point is kept still Then, the strain sensor stress and the constant temperature box temperature are changed to obtain experimental data under multiple temperature calibration and stress calibration cycles. The experimental data include: temperature sensor output voltage , the strain applied to the strain sensor , strain gauge sensor output voltage .
4. The nonlinear temperature compensation method for a strain gauge sensor according to claim 1, wherein: The normalized expression is: ; Where, is the experimental data sample, is the normalized data, and the range is are the minimum and maximum values of the sample data respectively.
5. The nonlinear temperature compensation method for a strain gauge sensor according to claim 1, wherein: According to the normalized data, compensation processing is performed based on the pre-trained IGWO-SVR model to obtain the strain compensation value, including: The strain gauge sensor output voltage And temperature sensor output voltage Import the pre-trained IGWO-SVR model for temperature compensation fitting to obtain the strain compensation value; According to the strain compensation value, the measurement error of the strain sensor due to temperature drift is eliminated.
6. The nonlinear temperature compensation method for a strain gauge sensor according to claim 1, wherein: The maximum error values include: Maximum absolute error , the maximum relative error ; Among them, the maximum absolute error , maximum relative error The expressions are: ; Where: is the stress calibration value, is the stress compensation value.
7. The nonlinear temperature compensation method for a strain gauge sensor according to claim 1, wherein: The normalized data is used to make training samples and test samples, including: The normalized data is divided into training samples and test samples in a ratio of 7:3; wherein, the training samples and test samples include: the output voltage of the temperature sensor , strain gauge sensor output voltage , the strain applied to the strain sensor .
8. A nonlinear temperature compensation device for a variable sensor, characterized in that: include: Data acquisition module, used to obtain experimental data samples; The data processing module is used to normalize the experimental data samples to obtain normalized data; The compensation processing module is used to perform compensation processing based on the normalized data and the pre-trained IGWO-SVR model to obtain the strain compensation value; The training of the IGWO-SVR model includes: The normalized data is made into training samples and test samples; Perform model training based on the training samples to obtain a training model; and evaluate the training model based on the test samples to obtain an IGWO-SVR model for compensation processing of the experimental data samples; The model is trained based on the training samples to obtain the training model; and the training model is evaluated based on the test samples to obtain the optimal IGWO-SVR model, including: Import the training samples into the SVR model calculation to obtain the SVR model training parameters and predict the strain of the strain sensor ; The IGWO algorithm is used to optimize the SVR model training parameters, and the strain of the strain sensor is predicted. The strain of the calibrated strain gauge sensor in the training sample Compare and obtain the SVR model training parameters that meet the preset conditions; The IGWO-SVR model is updated based on the SVR model training parameters that meet the preset conditions and the IGWO-SVR model is tested using a test sample to obtain a test strain value; Substitute the test strain value into the maximum error value to calculate and obtain the IGWO-SVR model that meets the evaluation conditions; Among them, the SVR model training parameters that meet the preset conditions are associated with the predicted strain of the strain sensor The strain of the calibrated strain gauge sensor The difference is smaller than the strain of the strain sensor associated with the other SVR model training parameters. .
9. A computer-readable storage medium having a computer program / instruction stored thereon, characterized in that: When the computer program / instruction is executed by a processor, the steps of the nonlinear temperature compensation method for a strain gauge sensor described in any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Pressure sensor temperature compensation method based on improved grey wolf algorithm
CN114964571A