Calibration method of magnetostrictive displacement sensor based on temperature compensation
Through one-time calibration and temperature compensation model with preset resolution, linear interpolation and Adaboost algorithm are used to achieve high-precision measurement at different temperatures, solving the accuracy problem of traditional sensors under temperature changes, simplifying operations and improving the performance by 50% the above accuracy.
Patent Information
- Application Number
- CN202410871547.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-01
- Publication Date
- 2024-09-17
AI Technical Summary
It is difficult to guarantee the measurement accuracy of traditional magnetostrictive displacement sensors in different temperature environments. The existing technology requires frequent repeated calibration to correct the effects of temperature changes.
A magnetostrictive displacement sensor calibration method based on temperature compensation is adopted. Through a calibration with a preset resolution, the linear interpolation formula and temperature compensation model are used to calculate the position to be measured, and the temperature compensation function is fitted through the Adaboost integrated algorithm to achieve temperature Adaptive compensation.
High-precision measurement can be maintained in different temperature environments without recalibration. The sensor accuracy is improved by at least 50%, simplifying the operation process and solving the problem of traditional calibration being susceptible to environmental temperature drift.
Smart Images

Figure CN118654560A
Abstract
Description
Technical Field
[0001] The invention relates to the field of magnetostrictive displacement sensors, and in particular to a calibration method of magnetostrictive displacement sensors based on temperature compensation. Background Art
[0002] Magnetostrictive displacement sensors are widely used in the field of industrial automation. A calibration method for magnetostrictive displacement sensors relates to the field of industrial sensor measurement technology, which relies on the deformation of magnetostrictive materials to measure displacement.
[0003] Traditional magnetostrictive sensors use the interaction between the magnetic field generated by the waveguide wire and the magnetic field of the permanent magnet to transmit the electrical signal back to the MCU to compare with the preset calibration position to obtain the actual position. In order to ensure the repeatability of the sensor, the calibration position needs to be corrected in real time according to the on-site ambient temperature.
[0004] However, pre-calibration and changes in ambient temperature will affect the measurement accuracy of the sensor. Therefore, how to ensure the measurement accuracy within different calibration ranges under different temperature environments has become an urgent problem to be solved. At present, most sensors on the market use the pre-calibration method. For actual measurements within the calibration range and in environments with large temperature changes, the accuracy of the measurement results is still difficult to guarantee. Summary of the invention
[0005] In order to solve the above technical problems, the present invention provides a calibration method for a magnetostrictive displacement sensor based on temperature compensation, and the calibration method for a magnetostrictive displacement sensor based on temperature compensation comprises the following steps:
[0006] Step 1: calibrate the magnetostrictive displacement sensor according to a preset resolution to obtain a data set;
[0007] Step 2: Store the data set obtained in step 1 into the flash to obtain the calibration data value;
[0008] Step 3: Based on the calibration data value, the calibrated magnetostrictive displacement sensor is used to measure the position to be measured;
[0009] Step 4: For the position between the resolutions, a linear interpolation formula is used to calculate the position to be measured based on the calibration data value to obtain the measured distance of the position to be measured;
[0010] Step 5: Use the temperature compensation model to perform temperature compensation on the measured distance obtained in step 4 to obtain a calibrated measurement value after temperature compensation.
[0011] The calibration method of the magnetostrictive displacement sensor based on temperature compensation provided by the present invention may also have the following characteristics: in step 4, the linear interpolation formula is:
[0012]
[0013] Wherein, in the above formula: x is the point to be measured, V(x) is the distance to be measured of the point to be measured x, x1 and x2 are the known calibration points adjacent to the point to be measured x on the left and right, V1 is the actual measured value of the calibration point x1, and V2 is the actual measured value of the calibration point x2.
[0014] The calibration method of the magnetostrictive displacement sensor based on temperature compensation provided by the present invention may also have the following characteristics: in step 5, the expression formula of the temperature compensation model is:
[0015] V comp =V means +f(T)
[0016] In the above formula: V comp is the measured value after temperature compensation, V means is the uncompensated measurement average, and f(T) is the temperature compensation function.
[0017] The calibration method of the magnetostrictive displacement sensor based on temperature compensation provided by the present invention may also have the following feature: the temperature compensation function is a compensation function obtained by fitting using an integrated algorithm of adaboost.
[0018] The calibration method of the magnetostrictive displacement sensor based on temperature compensation provided by the present invention may also have the following characteristics: the fitting step of the temperature compensation function includes data collection, classifier selection, algorithm training and model combination.
[0019] The calibration method of the magnetostrictive displacement sensor based on temperature compensation provided by the present invention may also have the following feature: data collection is performed by integrating a temperature sensor in the magnetostrictive displacement sensor to collect the output value and actual position data of the magnetostrictive displacement sensor under different ambient temperatures.
[0020] The calibration method of the magnetostrictive displacement sensor based on temperature compensation provided by the present invention may also have the following feature: in step 1, the magnetostrictive displacement sensor is calibrated using a grating, and a data set is obtained through a fixed grating pitch of the grating.
[0021] The beneficial effects of the present invention are:
[0022] In the calibration method of the magnetostrictive displacement sensor based on temperature compensation of the present invention, the magnetostrictive displacement sensor is first calibrated once, and then the position of the actual magnetic block is calculated by linear interpolation, and then the calculated value is temperature compensated by the temperature compensation model, thereby solving the problem that the traditional calibration is easily affected by the ambient temperature drift, and temperature adaptive compensation can be performed without re-calibration. The calibration method does not require modification of the structure, simplifies user operation, and greatly improves the sensor accuracy by at least 50%.
[0023] In addition, the actual position of the magnetic block is calculated by a linear interpolation formula, and the actual position of the magnetic block is calculated by the position of the slope parameter and the offset parameter between the known calibration points, which can greatly improve the accuracy of the displacement measurement.
[0024] In addition, the temperature compensation function is fitted by the adaboost integrated algorithm, and the measurement data of the sensor is associated with the temperature of the measurement environment through a model. Then, the temperature compensation function is used to perform temperature compensation for the measurement value, thereby solving the problem of repeated calibration due to temperature changes in the prior art. Through a single calibration, the preset measurement accuracy can be achieved at different temperatures.
[0025] Furthermore, in step one, the magnetostrictive displacement sensor is calibrated using a grating, and a data set within a certain range is obtained through the grating pitch. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] Figure 1 is a flow chart of a calibration method of a magnetostrictive displacement sensor in this embodiment;
[0027] Figure 2 It is a flow chart of establishing a temperature compensation model in this embodiment. DETAILED DESCRIPTION
[0028] In order to make the technical problems, technical solutions and beneficial effects solved by the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0029] In this embodiment, the calibration method of the magnetostrictive displacement sensor based on temperature compensation is used to detect the position information of the actual magnetic block. The device for implementing the calibration method includes a magnetostrictive calibration device, a temperature sensor, a microcontroller, and a motor drive actuator. First, the magnetostrictive calibration test platform needs to be fixed with hardware tools so that it is tightly fixed with the motor motion mechanism and moves. During the dynamic movement, the output readings and corresponding positions of the sensor at different time points are recorded to form raw data.
[0030] Before the calibration method, a temperature sensor is integrated in the magnetostrictive displacement sensor to be calibrated, and then a dedicated temperature sensor is added to the circuit of the magnetostrictive sensor to record the current ambient temperature, and the temperature acquisition range is 30°C-120°C.
[0031] like Figure 1 As shown, the calibration method of the magnetostrictive displacement sensor based on temperature compensation includes the following steps:
[0032] Step 1: According to the preset resolution, the magnetostrictive displacement sensor is statically calibrated using a grating, and the grating with a grating pitch of 0.01 mm is calibrated for a range of 10 mm to obtain 1000 sets of data (1.01, 1.02, 1.03...) to form a data group;
[0033] Step 2: Store the data set obtained in step 1 into the flash to obtain the calibration data value;
[0034] Step 3: Based on the calibration data value, the calibrated magnetostrictive displacement sensor is used to measure the actual position of the magnetic block to be measured;
[0035] Step 4: When the actual position of the magnetic block is between the calibrated data, the position of the magnetic block is calculated using a linear interpolation formula, where the linear interpolation formula is:
[0036]
[0037] Wherein, in the above formula: x is the point to be measured, V(x) is the distance to be measured of the point to be measured x, x1 and x2 are the known calibration points adjacent to the point to be measured x on the left and right, V1 is the actual measured value of the calibration point x1, and V2 is the actual measured value of the calibration point x2;
[0038] Step 5: The measured distance obtained in step 4 is a measurement value without temperature compensation. Then, the measured distance obtained in step 4 is temperature compensated using a temperature compensation model to obtain a calibrated measurement value after temperature compensation. The temperature compensation model is:
[0039] V comp =V means +f(T)
[0040] In the above formula: V comp is the measured value after temperature compensation, that is, the measured distance of the measured point x calculated in step 4, V means is the uncompensated measurement average, and f(T) is the temperature compensation function.
[0041] Through the above calibration method, the actual distance value of the magnetic block after temperature compensation can be calculated by using linear interpolation and temperature compensation.
[0042] In addition, in the above calibration method, the temperature compensation function of f(T) is a compensation function obtained by fitting using the integrated algorithm of adaboost. Figure 2 As shown, the establishment of the temperature compensation function includes the following steps:
[0043] Step 1: Data collection: Collect a series of ambient temperature values and calibration values corresponding to magnetostriction at different ambient temperatures through a standard test bench. The data type is a tuple structure, such as <10℃, 1.00mm>, <15℃, 1.10mm>. According to the requirements of the range and resolution, the above collected data is used as a training set to build the model.
[0044] Step 2: Weak classifier selection: Use decision tree or linear regressor as weak classifier for fitting. In this embodiment, the selected base regressor is a linear regressor to fit the relationship between calibration values at different temperatures, the number of random forests is 50, the learning rate is set to 0.1, and the random seed is 42.
[0045] Step 3: Algorithm training: Use the Adaboost algorithm to train the selected weak classifier. The training set and test set are divided into 8:2. Use Python code to iteratively train the weak classifier and continuously adjust the weights of the samples on the training set to obtain better overall classification performance.
[0046] Step 4: Model combination: After training is completed, Adaboost generates a weight file for the random tree, which is used to predict new data by loading the serialized model weight file. This strong classifier will take into account the weights of all weak classifiers to improve the overall prediction performance.
[0047] Step 5: Model evaluation: Use 5-fold cross validation to evaluate the trained model to ensure its sufficient generalization ability on unseen data.
[0048] Based on the above steps to establish the temperature compensation function, the final result of the experiment is an MSE index of 0.005, which is twice as accurate as the 0.01 designed for the product.
[0049] According to the calibration method of the magnetostrictive displacement sensor based on temperature compensation in the above embodiment, the magnetostrictive displacement sensor is first calibrated once, and then the actual position of the magnetic block is calculated using linear interpolation, and then the calculated value is temperature compensated using the temperature compensation model, thereby solving the problem that the traditional calibration is easily affected by the ambient temperature drift, and temperature adaptive compensation can be performed without re-calibration. This calibration method does not require modification of the structure, simplifies user operation, and greatly improves the sensor accuracy by at least 50%.
[0050] In addition, the actual position of the magnetic block is calculated by a linear interpolation formula, and the actual position of the magnetic block is calculated by the position of the slope parameter and the offset parameter between the known calibration points, which can greatly improve the accuracy of existing displacement measurement.
[0051] In addition, the temperature compensation function is fitted by the adaboost integrated algorithm, and the measurement data of the sensor is associated with the temperature of the measurement environment through the model. Then, the temperature compensation function is used to perform temperature compensation for the measurement value, thereby solving the influence of the temperature change of the measurement environment on the measurement value. Through a one-time calibration, the preset measurement accuracy can be achieved at different temperatures.
[0052] Furthermore, in step one, the magnetostrictive displacement sensor is calibrated using a grating, and a data set within a certain range is obtained through the grating pitch.
[0053] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and the equivalent technology, the present application is also intended to include these modifications and variations.
Claims
1. A calibration method for a magnetostrictive displacement sensor based on temperature compensation, characterized in that: The following steps are involved: Step 1: calibrate the magnetostrictive displacement sensor according to a preset resolution to obtain a data set; Step 2: Store the data set obtained in step 1 into the flash to obtain the calibration data value; Step 3: Based on the calibration data value, using the calibrated magnetostrictive displacement sensor to measure the position to be measured; Step 4: For the position between the resolutions, a linear interpolation formula is used to calculate the position to be measured based on the calibration data value to obtain the measured distance of the position to be measured; Step 5: Use the temperature compensation model to perform temperature compensation on the measured distance obtained in step 4 to obtain a calibrated measurement value after temperature compensation.
2. The calibration method of the magnetostrictive displacement sensor based on temperature compensation according to claim 1, characterized in that: In step 4, the linear interpolation formula is: Wherein, in the above formula: x is the point to be measured, V(x) is the distance to be measured of the point to be measured x, x1 and x2 are the known calibration points adjacent to the point to be measured x on the left and right, V1 is the actual measured value of the calibration point x1, and V2 is the actual measured value of the calibration point x2.
3. The calibration method of the magnetostrictive displacement sensor based on temperature compensation according to claim 1, characterized in that: In step 5, the expression formula of the temperature compensation model is: V comp =V means +f(T) In the above formula: V comp is the measured value after temperature compensation, V means is the uncompensated measurement average, and f(T) is the temperature compensation function.
4. The calibration method of the magnetostrictive displacement sensor based on temperature compensation according to claim 3 is characterized in that: The temperature compensation function is a compensation function obtained by fitting using the integrated algorithm of adaboost.
5. The calibration method of the magnetostrictive displacement sensor based on temperature compensation according to claim 4, characterized in that: The fitting steps of the temperature compensation function include data collection, classifier selection, algorithm training and model combination.
6. The calibration method of the magnetostrictive displacement sensor based on temperature compensation according to claim 5, characterized in that: The data collection is performed by integrating a temperature sensor in the magnetostrictive displacement sensor to collect output values and actual position data of the magnetostrictive displacement sensor under different ambient temperatures.
7. The calibration method of the magnetostrictive displacement sensor based on temperature compensation according to claim 1, characterized in that: In step one, the magnetostrictive displacement sensor is calibrated using a grating, and a data set is obtained through a fixed grating pitch of the grating.
