Temperature drift calibration and calibration method of inductive sensor and storage medium
By using a temperature drift calibration and standardization method for inductive sensors, and by generating a temperature drift compensation lookup table using a high and low temperature chamber and a dynamic step size adjustment algorithm, the temperature drift problem of the sensor under dynamic temperature changes is solved, thereby improving the stability and consistency of the sensor and simplifying the production process.
Patent Information
- Application Number
- CN202511104900.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-07
- Publication Date
- 2025-11-04
AI Technical Summary
Existing inductive sensors are difficult to effectively compensate for temperature drift when faced with dynamic temperature changes, and traditional hardware compensation methods have complex manufacturing processes and poor product consistency.
A temperature drift calibration and calibration method using inductive sensors is adopted. By dividing the sensors into Class I and Class II, high and low temperature chambers are used for calibration and calibration respectively. A dynamic step size adjustment algorithm and a digital potentiometer are used to adjust the circuit resistance value to generate a temperature drift compensation lookup table. Combined with the compensation value calculation during the heating and cooling process, accurate temperature drift characteristics can be captured and personalized calibration can be achieved.
It improves the detection stability and consistency of the sensor across the entire temperature range, simplifies the production process, reduces the R&D cycle and technical requirements, and supports multiple calibrations after product assembly.
Smart Images

Figure CN120890355A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the field of temperature drift calibration, and particularly relates to a temperature drift calibration method for an inductive sensor and a storage medium. BACKGROUND
[0002] Temperature drift compensation has always been a problem in the production process of inductive sensors.
[0003] With the continuous improvement of industrial automation and intelligence, the requirement for the temperature drift of inductive sensors is getting higher and higher. The traditional inductive sensor generally uses a hardware compensation method, that is, a temperature compensation component such as a thermistor or an adjustable potentiometer is added to the circuit to adjust the sensing distance of the inductive sensor at different temperatures. This method requires high quality of the research and development personnel, and still often fails to achieve very satisfactory results. Not only is the research and development cycle long, but the production process is complex, the product scrap rate is high, and the product consistency is poor. SUMMARY
[0004] The application provides a temperature drift calibration method for an inductive sensor and a storage medium, which solves the technical problem that the prior art relies on hardware compensation and cannot cope with dynamic temperature changes.
[0005] To achieve the above-mentioned purpose, the application adopts the following technical solutions:
[0006] In a first aspect, a temperature drift calibration method for an inductive sensor is provided, comprising:
[0007] Dividing the to-be-calibrated sensor into a first type of sensor and a second type of sensor according to a preset proportion;
[0008] Placing the first type of sensor in a high-low temperature chamber after adjusting the distance between the first type of sensor and a target to a preset distance;
[0009] Adjusting the value of a digital potentiometer using a dynamic step adjustment algorithm every time the temperature value of the high-low temperature chamber is adjusted until the target is detected; the digital potentiometer is used to adjust the resistance value of the inductive sensor circuit, so that the target can be detected by the resonant circuit at the current temperature value;
[0010] Based on the same temperature value of the high-low temperature chamber and the recorded value of the digital potentiometer in the heating process and the cooling process, calculating the calibration compensation value of the digital potentiometer;
[0011] Generating a temperature drift compensation lookup table for the first type of sensor according to the calibration compensation value and the corresponding temperature value;
[0012] Adjusting the distance between the second type of sensor and the target to the preset distance, obtaining the current environmental temperature using a temperature sensor, and adjusting the value of the digital potentiometer until the target is detected;
[0013] The calibration compensation value of the digital potentiometer under the current environment temperature is calculated based on a calibration formula, and a calibration compensation value in the temperature drift compensation lookup table is updated according to the calibration compensation value, so as to obtain the temperature drift compensation lookup table of the second type sensor.
[0014] Based on the above technical solutions, in the temperature drift calibration and calibration method of the inductive sensor provided in the application, through temperature segmentation adjustment in the calibration stage, dynamic step adjustment and average compensation value calculation in the heating and cooling process, the temperature drift characteristics in different temperature intervals can be more accurately captured, and the problem that the traditional method is difficult to cope with dynamic temperature changes is solved; at the same time, the calibration stage is based on current environment temperature adjustment and calibration logic, which can eliminate the process deviation of a single product and effectively improve the consistency of the same type of product. In addition, the method combines calibration and calibration, calibration establishes a general compensation reference for the same type of product, and calibration is personalized adjustment for individuals, which not only shortens the research and development cycle and reduces the technical requirements for research and development personnel, but also supports multiple calibrations after product assembly is completed, simplifies the production process, improves the production efficiency, and finally realizes stable detection performance of the sensor in the full temperature range.
[0015] Further, the dynamic step adjustment algorithm is: ΔR=k×(T1-T2) 2 +b; wherein, ΔR represents the dynamic step of the digital potentiometer adjustment, T1 represents the temperature value of the last time in the high-low temperature chamber, T2 represents the current temperature value of the high-low temperature chamber, k represents the slope, b represents the bias, and k, b are coefficients calibrated in advance based on the material characteristics of the sensor through experiments.
[0016] Further, the calculation formula of the calibration compensation value is:
[0017] R comp =(R heat ×W heat +R cool ×W cool ) / (W heat +W cool ); wherein, R comp represents the calibration compensation value, R heat represents the digital potentiometer value recorded in the heating process, R cool represents the digital potentiometer value recorded in the cooling process, and W heat , W cool respectively represent weight coefficients determined according to the temperature change rate in the corresponding process.
[0018] Further, the calculation formula of the weight coefficient is: W heat =1 / (1+v heat ), W cool =1 / (1+v cool ); wherein, v heatrepresents the temperature change rate in the heating process, v cool represents the temperature change rate in the cooling process, and the calculation formula of the temperature change rate is: temperature change rate = |T1-T2| / Δt, Δt represents the unit time.
[0019] Further, the generation process of the temperature drift compensation lookup table comprises:
[0020] The digital potentiometer value is increased by a dynamic step until the target is detected for the first time; wherein the initial value of the digital potentiometer value is the digital potentiometer value recorded at the last temperature;
[0021] In the case where the target is detected for the first time, the digital potentiometer value is gradually reduced by 1 until the target cannot be detected, and then the last digital potentiometer value before the target cannot be detected and the current temperature value of the high-low temperature box are recorded;
[0022] Based on all the recorded temperature values, all the digital potentiometer values and the calculated calibration compensation values, the temperature drift compensation lookup table covering the preset temperature range is obtained in the order of temperature values from low to high.
[0023] Further, updating the calibration compensation values in the temperature drift compensation lookup table according to the calibration compensation values comprises:
[0024] The digital potentiometer value recorded at the current ambient temperature, at which the target is detected by the resonant circuit, is marked as the first digital potentiometer value;
[0025] From the temperature drift compensation lookup table, the calibration compensation value at the same value as the current ambient temperature is searched and marked as the second digital potentiometer value;
[0026] The difference ΔR between the first digital potentiometer value and the second digital potentiometer value is calculated;
[0027] The calibration compensation value ΔR of the digital potentiometer is calculated according to the calibration formula comp (T) : ΔR comp (T) = α × (ΔR) + β × (ΔR) 3 + γ × e (-δ×|ΔR|) , wherein α is a linear drift coefficient, β is an expansion coefficient, γ and δ are exponential decay coefficients, ΔR comp (T) represents the calibration compensation amount at the current ambient temperature T;
[0028] The calibration compensation values at different temperature values in the temperature drift compensation lookup table are added to the calibration compensation amount to obtain an updated temperature drift compensation lookup table.
[0029] Further, the coefficients in the calibration formula are solved by the following steps:
[0030] acquiring an ambient temperature by using a temperature sensor;
[0031] sending a temperature point calibration instruction to a micro control unit (MCU) by a port device configuration tool (PDCT) software and an IO-Link master;
[0032] After the MCU receives the temperature point calibration instruction, the MCU determines digital potentiometer values that can detect the target at multiple ambient temperature points, and obtains multiple calibration digital potentiometer values.
[0033] Solving an optimal coefficient based on the multiple calibration digital potentiometer values.
[0034] Further, the matrix equation for solving the optimal coefficient is: where ΔR i (i = 1, 2, 3, 4) represents a difference value between the i th ambient temperature point and the calibration digital potentiometer value of the i th ambient temperature point, and ΔR icomp (i = 1, 2, 3, 4) represents an ideal compensation value of the i th ambient temperature point.
[0035] The matrix equation is solved by using a Levenberg-Marquardt algorithm to obtain the optimal coefficients a, β, γ and δ.
[0036] Further, the temperature drift compensation lookup table is used to: when the inductive sensor is working, a micro control unit (MCU) inside the inductive sensor acquires a real-time ambient temperature by using a temperature sensor, calls a corresponding compensation value from the lookup table according to the real-time ambient temperature, and writes the compensation value into a digital potentiometer to adjust an inductive distance of the inductive sensor and offset temperature drift caused by temperature change.
[0037] In a second aspect, a temperature drift calibration and compensation device for an inductive sensor is provided, which includes: an inductive sensor, a communication host unit, an upper computer unit and a high-low temperature box unit, wherein
[0038] The inductive sensor is used to execute steps in a calibration stage and a calibration stage by using a built-in micro control unit, a temperature sensor, a digital potentiometer and a target.
[0039] The communication host unit is used to connect the inductive sensor and the upper computer unit to realize transmission of data and instructions.
[0040] The host computer unit is configured to run a port device configuration tool (PDCT) software, send a number of modes of sampling instruction, and a temperature point calibration instruction; wherein the number of modes of sampling instruction is configured to control the inductive sensor to enter a calibration stage, and record a temperature value and a digital potentiometer value; and the calibration instruction is configured to instruct the micro control unit to perform a solving process of an optimal coefficient in a calibration formula.
[0041] The high and low temperature box unit is configured to provide a preset temperature range environment in the calibration stage.
[0042] In a third aspect, the present application provides a temperature drift calibration and correction device for an inductive sensor, comprising: a processor and a storage medium; the storage medium comprises instructions, and the processor is configured to run the instructions to implement the method described in the first aspect and any possible implementation manner of the first aspect. The temperature drift calibration and correction device for the inductive sensor can be an electronic device or a chip in the electronic device.
[0043] In a fourth aspect, the present application provides a computer readable storage medium, and the computer readable storage medium stores instructions, when the instructions run on the temperature drift calibration and correction device for the inductive sensor, the temperature drift calibration and correction device for the inductive sensor executes the method described in the first aspect and any possible implementation manner of the first aspect.
[0044] In a fifth aspect, the present application provides a computer program product comprising instructions, when the computer program product runs on the temperature drift calibration and correction device for the inductive sensor, the temperature drift calibration and correction device for the inductive sensor executes the method described in the first aspect and any possible implementation manner of the first aspect.
[0045] The present application provides a temperature drift calibration and correction method for an inductive sensor and a storage medium, which can adapt to different temperature interval characteristics by dynamically adjusting the step size, calculate the average compensation by combining the compensation value and the temperature change law in the heating and cooling process, comprehensively consider the influence of temperature change, generate a compensation reference covering the full temperature range by detecting the target, ensure the accuracy of compensation, better cope with complex temperature characteristics by means of calibration logic and parameter solving of multiple environmental temperature points, improve the pertinence of calibration, use the compensation lookup table to call the corresponding compensation value in real time when the sensor works, dynamically adjust the induction distance, effectively offset the influence of temperature change, finally improve the detection stability and consistency of the sensor in different temperature environments, simplify the production and calibration process, reduce the technical requirements for operation, provide a universal reference for the same type of products and support personalized adjustment, and be suitable for a wider range of temperature scenarios.
[0046] It should be understood that the description of technical features, technical solutions, advantages or similar language in this application does not imply that all features and advantages can be realized in any single embodiment. On the contrary, it can be understood that the description of a feature or advantage means that the specific technical feature, technical solution or advantage is included in at least one embodiment. Therefore, the description of technical features, technical solutions or advantages in this specification does not necessarily refer to the same embodiment. Further, the technical features, technical solutions and advantages described in this embodiment can be combined in any appropriate manner. Those skilled in the art will understand that the embodiments can be implemented without one or more specific technical features, technical solutions or advantages of a specific embodiment. In other embodiments, additional technical features and advantages can be identified in specific embodiments that do not embody all embodiments. BRIEF DESCRIPTION OF DRAWINGS
[0047] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings required to be used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application, and those skilled in the art can obtain other drawings from these drawings without creating labor.
[0048] Figure 1 The flowchart of the temperature drift calibration and calibration method of the inductive sensor provided by the embodiments of the present application;
[0049] Figure 2 The flowchart of another temperature drift calibration and calibration method of the inductive sensor provided by the embodiments of the present application;
[0050] Figure 3 The flowchart of another temperature drift calibration and calibration method of the inductive sensor provided by the embodiments of the present application;
[0051] Figure 4 The structural schematic diagram of the temperature drift calibration and calibration device of the inductive sensor provided by the embodiments of the present application;
[0052] Figure 5 The circuit schematic diagram of the inductive sensor provided by the embodiments of the present application;
[0053] Figure 6 The measured result diagram of the inductive sensor before calibration at different temperatures for the same distance provided by the embodiments of the present application;
[0054] Figure 7 The measured result diagram of the inductive sensor after calibration at different temperatures for the same distance provided by the embodiments of the present application;
[0055] Figure 8A comparison chart of actual measurement results of the inductive sensor provided by the embodiment of the present application before and after calibration at different temperatures for the same distance. DETAILED DESCRIPTION
[0056] In the description of the present application, unless otherwise specified, " / " means "or", for example, A / B can mean A or B. "And / or" in this document is only a description of the relationship between the associated objects, which means that there can be three relationships, for example, A and / or B, which can mean that A exists alone, A and B exist together, and B exists alone. In addition, "at least one" means one or more, and "multiple" means two or more. "First", "second", and the like do not limit the quantity and execution order, and "first", "second", and the like do not necessarily mean different.
[0057] It should be noted that in the present application, "exemplary" or "for example" is used to mean example, illustration, or description. Any embodiment or design scheme described as "exemplary" or "for example" in the present application should not be interpreted as more preferred or more advantageous than other embodiments or design schemes. Rather, the use of "exemplary" or "for example" is intended to present the relevant concept in a specific manner.
[0058] To solve the technical problems in the prior art that the temperature drift compensation of the inductive sensor relies on hardware, is difficult to cope with nonlinear and dynamic temperature changes, and the calibration process in production is complex and the product consistency is poor, the embodiment of the present application provides a temperature drift calibration and calibration method for an inductive sensor, which comprises a calibration stage and a calibration stage; wherein,
[0059] The calibration stage comprises: placing the first type of inductive sensor and the target at a preset distance in a high-low temperature chamber after adjusting the target, and using a temperature sensor to obtain the temperature value of the high-low temperature chamber;
[0060] Each time the temperature value of the high-low temperature chamber is adjusted, a dynamic step adjustment algorithm is used to adjust the digital potentiometer value until the target is detected; the digital potentiometer is used to adjust the resistance value of the inductive sensor circuit, so that the target can be detected by the resonant circuit at the current temperature value;
[0061] Based on the same temperature value of the high-low temperature chamber and the recorded digital potentiometer value in the heating process and the cooling process, the calibration compensation value of the digital potentiometer is calculated;
[0062] According to the calibration compensation value and the corresponding temperature value, a temperature drift compensation lookup table of the first type of sensor is generated;
[0063] The calibration stage comprises: adjusting the second type of inductive sensor and the target to a preset distance, and using a temperature sensor to obtain the current ambient temperature;
[0064] Fix the current ambient temperature, adjust the digital potentiometer value until the target is detected;
[0065] The calibration compensation value of the digital potentiometer is calculated based on the calibration formula, and the calibration compensation value in the temperature drift compensation lookup table is updated according to the calibration compensation value, so as to obtain the temperature drift compensation lookup table of the second type sensor.
[0066] Based on this, the present application establishes a general compensation reference through calibration and realizes individual personalization adjustment through calibration, which can cope with dynamic temperature changes, simplifies the production process, improves product consistency, and supports multiple calibrations after product assembly.
[0067] As shown in Figure 2 The temperature drift calibration and calibration method of the inductive sensor provided by the embodiments of the present application comprises:
[0068] S0, divide the to-be-calibrated sensor into a first type sensor and a second type sensor according to a preset proportion.
[0069] Among them, the first type sensor represents a sensor calibrated by a high-low temperature box in the research and development stage, and the second type sensor represents a sensor calibrated by the temperature drift data of the calibrated sensor in the production stage.
[0070] Since the cost of sensor temperature drift calibration is high, if each product is calibrated for temperature drift, the production cost will be greatly increased, so a part of the sensors are extracted as the first type sensor according to the preset proportion to be comprehensively calibrated by the high-low temperature box, so as to obtain representative temperature drift basic data, and provide a reference benchmark for the batch calibration of the second type sensor, so as to reduce the overall production cost while ensuring the calibration accuracy.
[0071] The preset proportion is usually set according to the production scale, for example, if the production scale is large (such as thousands of products per time and above), a smaller proportion (such as 1% to 5%) is selected as the first type sensor in the research and development stage, and the detailed calibration of this part of the sensor is performed; if the production scale is small (such as hundreds of products per time), the proportion can be appropriately increased (such as 10% to 20%) to ensure that the temperature drift data of the first type sensor can more accurately reflect the characteristics of the batch of products, and to avoid that the calibration deviation of the second type sensor is too large due to insufficient sample size.
[0072] S1, place the first type inductive sensor and the target at a preset distance in the high-low temperature box, and adjust the digital potentiometer value by using a dynamic step adjustment algorithm every time the temperature value of the high-low temperature box is adjusted, until the target is detected.
[0073] The inductive sensor is based on a micro control unit (MCU), a temperature sensor, a digital potentiometer, a driving circuit, and a resonance circuit (also known as an LC oscillation circuit, which is composed of an inductor L and a capacitor C), and is used to detect the position change of a target such as metal; the high-low temperature box is used to provide an adjustable temperature environment to simulate different temperature conditions and calibrate the digital potentiometer value at different temperatures, and the temperature value is obtained through the temperature sensor; the digital potentiometer is used to adjust the resistance value of the inductive sensor circuit, which can be replaced by a digital-to-analog converter (DAC), a pulse width modulation (PWM) circuit, and the like, and the ultimate goal is to enable the target to be detected by the resonance circuit at the current temperature value.
[0074] In some implementations, the dynamic step adjustment algorithm is used to adjust the adjustment step of the digital potentiometer according to the temperature change amplitude, which can be adjusted according to the difference between the current temperature and the last temperature, so that a larger step is used to quickly approach the target value when the temperature change is large, and a smaller step is used to improve the adjustment accuracy when the temperature change is small.
[0075] It should be noted that the target is a detection object with a specific material (such as metal, a specific medium, etc.), which is used to simulate the object to be detected in the actual work of the sensor; when the resonance circuit detects the target, it means that the resistance value adjusted by the current digital potentiometer makes the sensor sensing distance adapt to the current temperature, and the relevant parameters can be recorded.
[0076] For example, after adjusting the distance between the inductive sensor and the metal target to 8 mm and placing it in the high-low temperature box, when the temperature of the high-low temperature box is adjusted from 25℃ to 30℃, the dynamic step adjustment algorithm determines the step to be 2 according to the temperature difference of 5℃, and the value of the digital potentiometer (or DAC) is adjusted, which is increased by 2 each time, until the resonance circuit detects the metal target.
[0077] S2, based on the same temperature value of the high-low temperature box in the heating process and the cooling process and the recorded digital potentiometer value, calculating the calibration compensation value of the digital potentiometer.
[0078] The calibration compensation value is the amount of circuit resistance adjustment required for the sensor to accurately detect the target at a specific temperature, and is the core data for generating a temperature drift compensation lookup table subsequently.
[0079] In some implementations, the calibration compensation value can be calculated by arithmetic mean, weighted mean, etc. according to the recorded digital potentiometer value in the heating process and the recorded digital potentiometer value in the cooling process.
[0080] It should be noted that the temperature drift characteristics of the sensor may differ during the heating and cooling processes at the same temperature. Combining both to calculate the calibration compensation value can more comprehensively reflect the real compensation demand at the temperature and improve the compensation accuracy.
[0081] For example, at 25℃, the digital potentiometer value recorded during the heating process is 100, and the digital potentiometer value recorded during the cooling process is 104. The arithmetic mean is used to calculate the calibration compensation value as (100+104) / 2=102.
[0082] S3. Generating a temperature drift compensation lookup table according to the calibration compensation value and the corresponding temperature value, and completing the temperature drift calibration stage.
[0083] The temperature drift compensation lookup table is used to store the mapping relationship between different temperatures and corresponding calibration compensation values. The compensation value at the current temperature can be quickly obtained by querying the table during subsequent sensor operation, without the need for real-time calculation.
[0084] In some implementations, the calibration compensation value at each temperature point can be sorted into a table, an array, or the like in the order of temperature from low to high (such as -40℃ to 90℃), and stored in the memory of the MCU. It can also be stored through the upper computer software (such as Port Device Configuration Tool, PDCT) and subsequently written into the sensor.
[0085] It should be noted that the temperature coverage range of the temperature drift compensation lookup table should be determined according to the actual working environment of the sensor. The accuracy of the table can be improved by increasing the temperature sampling points, and it is suitable for a wider temperature range.
[0086] S4. Adjusting the second type of inductive sensor and the target to a preset distance, and fixing the current environmental temperature, and adjusting the digital potentiometer value until the target is detected.
[0087] The calibration stage is to individually adjust the temperature drift compensation lookup table according to the process deviation of a single product to ensure the consistency of products of the same type.
[0088] In some implementations, the current environmental temperature can be obtained through the temperature sensor (such as temperature sensor chip, MCU built-in temperature sensor, negative temperature coefficient thermistor (NTC), positive temperature coefficient thermistor (PTC), etc.) built in the sensor; The way of adjusting the digital potentiometer (or its substitute device) can be the same as in the calibration stage, or the step strategy can be simplified according to actual needs.
[0089] It should be noted that the calibration phase can be carried out after the product is assembled, without the need for a high-low temperature box, and only the current ambient temperature is used, thereby simplifying the calibration process in production.
[0090] For example, in a room temperature 25℃ environment, the distance between the sensor and the target is adjusted to 8mm, the digital potentiometer value is adjusted, and the initial value is gradually increased until the resonant circuit detects the target, and the digital potentiometer value at this time is recorded as 105.
[0091] S5, calculating the calibration compensation value of the digital potentiometer based on the calibration formula, and updating the calibration compensation value in the temperature drift compensation lookup table to complete the calibration phase.
[0092] The calibration formula is a mathematical expression for calculating the deviation compensation of a single product relative to the calibration reference, which can be a linear formula (such as calibration compensation value = current detection value - calibration value), a nonlinear formula (such as containing a quadratic term, an exponential term, etc.), and the specific form can be set according to the temperature drift characteristics of the sensor.
[0093] In some implementations, the calibration compensation value can be written into the sensor through the host computer software (such as PDCT) combined with the communication protocol (such as IO-Link, RS485, Controller Area Network (CAN), Inter-Integrated Circuit (IIC), etc.), and the temperature drift compensation lookup table is automatically updated.
[0094] It should be noted that the updated temperature drift compensation lookup table can be applied in real time in the working process of the sensor, and supports multiple calibrations, which is convenient for subsequent product maintenance or precision adjustment.
[0095] For example, if the calibration compensation value in the temperature drift compensation lookup table at 25℃ is 102, the current detected digital potentiometer value is 105, the calibration formula is linear calculation, and the calibration compensation value is 105-102=3, then the calibration compensation value of all temperature points in the lookup table is increased by 3, and the updating is completed.
[0096] Based on the above technical solutions, the temperature drift calibration and calibration method of the inductive sensor provided by the present application can comprehensively cope with the temperature drift caused by temperature changes through the compensation value calculation in the calibration phase combined with the temperature rising and falling process; the calibration phase adjusts for individual deviation, effectively improving the consistency of products of the same type; the entire method does not require complex hardware compensation, reduces the technical requirements for researchers, shortens the research and development cycle, supports multiple calibrations after product assembly, simplifies the production process, and is suitable for a wider range of temperature scenarios and sensor types.
[0097] In a possible implementation of the embodiment of the present application, the calibration formula is combined with the temperature drift compensation lookup table to calculate the calibration compensation value of the digital potentiometer. Figure 1 For example,Figure 3 As shown in the above, the S1 can be implemented by the following S101, S102 and S103, which are described in detail as follows:
[0098] S101, adjust the inductive sensor and the target to a preset distance, and place them in a high-low temperature box together, connect the sensor with a communication host (such as an IO-Link host) and an upper computer (including PDCT software), initialize the temperature of the high-low temperature box and the dynamic step length algorithm parameters.
[0099] The preset distance needs to be determined according to the sensor model and the application scene, for example, the preset distance of the M12 non-level sensor can be set to 8 mm; the initial temperature of the high-low temperature box can be set to room temperature 25℃, and the subsequent adjustment range needs to cover the sensor working temperature range, such as -40℃ to 90℃.
[0100] It should be noted that the target material needs to be consistent with the actual detection object of the sensor (such as iron, copper and other metals), so as to avoid the detection threshold deviation caused by the material difference; the connection between the communication host and the sensor needs to be stable to prevent the data transmission interruption from affecting the step length adjustment logic.
[0101] For example, for the M12 non-level sensor for detecting iron material, the preset distance is set to 8 mm, the initial temperature of the high-low temperature box is 25℃, and the experiment shows that k = 0.005 (Ω / ℃ 2 ), b = 1 (Ω), that is, the dynamic step length formula is ΔR = 0.005 × (T1-T2) 2 + 1.
[0102] S102, adjust the high-low temperature box to the target temperature T2, and after the temperature is stable, calculate the adjustment step length ΔR based on the difference between the last temperature T1 and the current temperature T2 through the dynamic step length adjustment algorithm, gradually increase the digital potentiometer value, and judge in real time whether the resonant circuit detects the target.
[0103] The calculation formula of the dynamic step length adjustment algorithm is: ΔR = k × (T1-T2) 2 +b; wherein, ΔR represents the dynamic step length of the digital potentiometer adjustment, k represents the slope, b represents the bias, k and b are coefficients pre-calibrated based on the material characteristics of the sensor through experiments: select 3-5 typical temperature points (such as -40℃, 0℃, 25℃, 70℃, 90℃), test the optimal step length under different temperature differences, and solve k and b by fitting the relationship curve of ΔR and (T1-T2) 2 . Alternatively, the calibration of k and b can also use a machine learning model (such as linear regression) to optimize the parameters based on larger sample experimental data.
[0104] The adjustment interval of the target temperature T2 can be preset to 5℃, such as from 25℃ to 30℃, 35℃, and the like. The determination criterion of temperature stability is that the temperature fluctuation of the high and low temperature boxes is less than or equal to ±0.3℃ and lasts for 5 minutes. The unit of the dynamic step ΔR is the minimum adjustment unit of the digital potentiometer (such as 1 LSB, corresponding to a resistance adjustment amount of 0.1Ω), and the integer is obtained after rounding off. The detection state of the resonant circuit is fed back to the MCU through the sensor output signal, and the MCU is uploaded to the upper computer through the communication protocol (such as IO-Link).
[0105] In some implementations, the target temperature adjustment interval can be dynamically adjusted according to the temperature drift characteristics: the temperature drift severe interval (such as -20℃ to 0℃) is set to 2℃, and the temperature drift gentle interval (such as 20℃ to 50℃) is set to 10℃, so as to balance the data accuracy and efficiency.
[0106] It should be noted that the adjustment range of the digital potentiometer needs to cover the resistance compensation requirement of the sensor circuit (such as 0-1000 LSB), so as to avoid adjustment out of range due to step accumulation. If the target is not detected after 10 continuous adjustments, the digital potentiometer value is adjusted to zero, and the potentiometer value is gradually increased from zero with a dynamic step and detected. If the target is not detected after 50 continuous adjustments after adjusting to zero, it is checked whether the distance between the sensor and the target is deviated or the circuit is faulty.
[0107] For example, the temperature T1 on the high and low temperature box is 25℃, the current target temperature T2 is 30℃, and the temperature difference (T1-T2) 2 = 25℃ 2 is substituted into ΔR=0.005×25+1=2.25, and ΔR=2 is taken. The digital potentiometer value recorded at the last temperature is taken as the initial value of this adjustment, and 1 LSB is added each time. It is assumed that the resonant circuit detects the target when the adjustment is performed for the sixth time (the value is 512 LSB), a “detection” signal is fed back, and the value of the digital potentiometer at this time is recorded.
[0108] S103, after detecting the target for the first time, the temperature T2 is kept unchanged, the digital potentiometer value is gradually reduced by 1, and the last digital potentiometer value before the resonant circuit cannot detect the target (i.e. the critical value) and the current temperature T2 are recorded.
[0109] The purpose of reducing the digital potentiometer value is to determine the minimum digital potentiometer value at the current temperature at which the sensor can just detect the target, so as to avoid deviation of the detection distance due to overcompensation. The critical value record needs to be automatically stored through the PDCT software of the upper computer, and the format is “temperature T2-critical value R” (such as “30℃-511 LSB”).
[0110] It should be noted that the same temperature T2 needs to be repeated three times for the adjustment-recording process, and the average of the three critical values is taken as the effective data at this temperature to eliminate random interference; the recorded temperature and critical value will be used as the basis data for generating the subsequent temperature drift compensation lookup table.
[0111] For example, when the digital potentiometer value is 512 LSB in the first detection of the target in S102, it can still be detected when it is gradually reduced to 511 LSB with AR = 1, and it cannot be detected when it is reduced to 510 LSB, so the critical value is 511 LSB; after repeating three times, the average is 511 LSB, and "30℃-511LSB" is recorded.
[0112] Based on the above technical solution, S1 accurately records the critical value by dynamically adjusting the step size, which not only adaptively adjusts the adjustment efficiency of the digital potentiometer according to the temperature difference, but also ensures the accuracy of the compensation value through "increase-reduce" bidirectional verification, and provides reliable basis data for subsequent calibration compensation value calculation and temperature drift compensation lookup table generation, effectively solving the problem of low precision or poor efficiency of traditional fixed step adjustment in a nonlinear temperature drift scenario.
[0113] In a possible implementation manner of the embodiment of the present application, in combination with Figure 1 As shown in Figure 3 , the above S2 can be implemented by the following S201, S202 and S203, which will be described in detail below:
[0114] S201, extract the digital potentiometer value corresponding to the same target temperature T of the high and low temperature chamber in the heating process and the cooling process, and mark them as heating value R heat and cooling value R cool , respectively.
[0115] R heat is the critical digital potentiometer value recorded by S1 when the high and low temperature chamber is raised from low temperature to T; and R cool is the critical digital potentiometer value recorded by the same step when the high and low temperature chamber is lowered from high temperature to T.
[0116] In some implementation manners, the extraction of R heat and R cool can be automatically matched by the upper computer PDCT software to reduce the error of manual screening. Moreover, it is necessary to ensure that the relative position of the sensor and the target, the target material and other environmental parameters in the heating and cooling processes are completely consistent, so as to avoid the deviation of R heat and R cool caused by non-temperature drift itself; if the difference between R heat and R cool at the same temperature point exceeds the preset threshold (such as ±10%), the calibration experiment at this temperature point needs to be performed again.
[0117] S202, calculate the temperature change rate v of the heating process and the cooling process at the target temperature T heat cool , and solve the weight coefficient W based on the change rate heat cool .
[0118] Wherein, the calculation formula of the temperature change rate v is v = |T1-T2| / Δt, T1 is the last temperature point, T2=T is the current target temperature, and Δt is the unit time, usually 5 min; the weight coefficient is used to represent the reliability of the heating / cooling process data, and the calculation formula is W heat =1 / (1+v heat ), W cool =1 / (1+v cool ), the smaller the change rate (the slower the temperature change), the greater the weight.
[0119] In some implementations, Δt can be set to the same as the time required for the high and low temperature box temperature regulation to be stable, or the time interval for the temperature to rise from T1 to (or drop to) T, in minutes min.
[0120] For example, in the heating process, T1=25℃, T=30℃, and Δt=5min, then v heat =|25-30| / 5=1℃ / min, W heat =1 / (1+1)=0.5; in the cooling process, T1=35℃, T=30℃, and Δt=6min, then v cool =|35-30| / 6≈0.83℃ / min, Wcool=1 / (1+0.83)≈0.546.
[0121] S203, substitute R heat , R cool and the corresponding weight coefficient into the calibration compensation value formula to calculate the calibration compensation value R comp at the target temperature T.
[0122] Wherein, the calculation formula of the calibration compensation value is R comp =(R heat ×W heat +R cool ×W cool ) / (W heat +W cool ), which is used to integrate the characteristics of the heating and cooling processes to obtain a more reliable compensation reference value.
[0123] In some implementations, if the accuracy of extreme temperature points (such as -40℃ and 90℃) needs to be improved, the weight coefficient of the temperature point can be multiplied by a correction coefficient (such as 1.2); for the interval (such as 20℃-50℃) where the temperature drift curve is gentle, the calculation can be simplified as R comp = (R heat + R cool ) / 2 (i.e. equal weight), to improve efficiency.
[0124] It should be noted that the calculation result of R comp needs to be rounded (to match the adjustment accuracy of the digital potentiometer, such as LSB unit), and rounding or rounding down needs to be determined according to the characteristics of the sensor circuit; after the calculation is completed, the corresponding relationship between the temperature value T and the calibration compensation value R comp needs to be stored to prepare for subsequent generation of temperature drift compensation lookup table.
[0125] For example, based on the data of S201 and S202, R heat = 511LSB, R cool = 515LSB, W heat = 0.5, W cool = 0.546, then R comp = (511*0.5+515*0.546) / (0.5+0.546)≈(255.5+281.19) / 1.046≈536.69 / 1.046≈513LSB.
[0126] Based on the above technical solution, S2 effectively integrates the compensation characteristics under different temperature change trends by extracting the symmetric data of the temperature rise and fall process and introducing the temperature change rate weight, avoiding the one-sidedness of single temperature rise or fall data; the dynamic adjustment of the weight coefficient makes the data when the temperature changes gently (closer to steady state) have a higher proportion, further improving the accuracy of the calibration compensation value, and laying a foundation for subsequent generation of reliable temperature drift compensation lookup table in the full temperature range.
[0127] In a possible implementation of the embodiments of the present application, the above S3 can be implemented by the following S301 and S302, which are described in detail as follows:
[0128] S301, collect the calibration compensation values R comp and corresponding temperature values T of all target temperature points in the full temperature range, and establish an original data set.
[0129] Among them, the full temperature range needs to cover the design working interval of the sensor, such as -40℃-90℃; the interval of the target temperature points can be set according to actual needs, for example, set to 5℃ (such as -40℃, -35℃…90℃), to ensure that the data density can meet the accuracy requirements of subsequent use; the original data set is all T-R compKey-value pairs, these data are directly from the calibration phase of the measured record.
[0130] In some implementations, the temperature point interval can be adjusted according to the temperature drift sensitivity of the sensor. For the interval with obvious temperature drift change (such as the low temperature section -40℃-20℃), the interval can be reduced to 2℃, and for the interval with relatively flat temperature drift (such as the normal temperature section 20℃-50℃), the interval can be expanded to 10℃, to flexibly adapt to the characteristics of different temperature intervals; Data collection can be automatically completed by the upper computer PDCT software, and T and R of each temperature point are stored in real time and synchronously comp , to avoid manual recording errors.
[0131] It should be noted that the original data set needs to completely cover the preset temperature range; During the collection process, the experimental conditions such as the relative position of the sensor and the target and the temperature stability of the high and low temperature boxes need to be consistent to ensure the comparability of the data.
[0132] For example, for a M12 non-level sensor, the full temperature range is set to -40℃-90℃, with 27 temperature points at an interval of 5℃, and the R comp of each temperature point is obtained by S2 calculation.
[0133] S302, arrange the original data set in the order of temperature value from low to high, generate a temperature drift compensation lookup table and store it in the MCU memory built-in the sensor.
[0134] Among them, the lookup table format is a two-dimensional array Table[T i ]=R compi (i is the temperature point number), arranged in ascending order of temperature T, to facilitate fast retrieval when the sensor is working; The storage medium is the non-volatile memory (such as EEPROM) of the MCU, to ensure that the data is not lost after power failure; After storage is completed, the lookup table data is read through the IO-Link communication protocol to verify the data integrity, i.e. all temperature points have corresponding R comp values.
[0135] In some implementations, the lookup table can use a structured storage format (such as CSV format) to include temperature values, calibration compensation values, data collection times, etc. for easy subsequent tracing; For MCUs with limited storage capacity, data with minimal R comp change in consecutive temperature sections can be recorded together, such as when the Rcomp difference of the adjacent 5 temperature points is ≤1 LSB, only the starting and ending temperatures and the corresponding values are recorded, to save storage space.
[0136] It should be noted that the reading response time of the lookup table needs to meet the real-time detection requirements of the sensor; After storage, a temperature-compensation value corresponding table needs to be generated by the PDCT software to visually display the temperature drift compensation trend in the full temperature range.
[0137] Based on the above technical solution, S3 generates a lookup table by collecting full-temperature-zone calibration data and sorting by temperature, which completely retains the original information of temperature drift characteristics; the structured storage and fast retrieval characteristics of the lookup table enable the sensor to call corresponding compensation values in real time during operation, providing accurate basis for dynamically offsetting temperature drift.
[0138] In a possible implementation of the embodiment of the application, in combination with Figure 1 As shown in Figure 3 The above S4 can be implemented by the following S401 and S402, which are specifically described as follows:
[0139] S401, adjust the inductive sensor and the target to a preset distance (consistent with the calibration stage), place it in the current environment, connect the sensor with the IO-Link host and the upper computer running the PDCT software, and fix the temperature after the current environment temperature is stable.
[0140] The preset distance is calibrated by a conventional distance measuring tool to ensure that the error is within the allowable range; the current environment temperature is detected by the built-in temperature sensor of the sensor, without the need for a high-low temperature chamber, and directly using the natural environment or a simple constant temperature device.
[0141] It should be noted that the target material and position need to be consistent with the calibration stage to avoid affecting the consistency of detection.
[0142] S402, obtain the calibration compensation value corresponding to the current temperature from the temperature drift compensation lookup table as a starting point, adjust the digital potentiometer value at a fixed step, such as 1 LSB, until the resonant circuit detects the target for the first time, record the digital potentiometer value at this time, and obtain the first digital potentiometer value.
[0143] The calibration stage is for sensors that have not been calibrated, and the temperature drift compensation table of the first type of sensor is obtained to guide the calibration reference of the uncalibrated sensor, so as to realize the rapid calibration of the uncalibrated sensor in the production stage, without the need to repeat the high-low temperature chamber calibration process, which not only ensures the consistency of the calibration accuracy with the first type of sensor, but also greatly reduces the calibration cost and time cost in batch production, improves the production efficiency, and at the same time ensures the performance stability of the products in the same batch through unified reference data.
[0144] The adjustment direction of the digital inductor value is to gradually increase, which is consistent with the logic of the S1 calibration stage; the detection of the target is based on the output switch signal of the sensor.
[0145] Based on the above technical solution, in the calibration stage, without the need for complex temperature control equipment, the lookup table data in the calibration stage is directly called as a starting point to quickly obtain the actual compensation value of the individual sensor, which not only ensures the connection with the general reference, but also adapts to the individual process deviation,
[0146] In one possible implementation of the embodiments of this application, combined with Figure 1 ,like Figure 3 As shown, the above S5 can be implemented through the following S501, S502 and S503, which are explained in detail below:
[0147] S501. Determine the first digital potentiometer value R1 and the second digital potentiometer value R2 under the current ambient temperature, and calculate the difference between them ΔR.
[0148] Wherein, R1 is the "first digital potentiometer value" recorded in S4; R2 is the "calibration compensation value" corresponding to the current ambient temperature extracted from the temperature drift compensation lookup table; the difference ΔR = R1 - R2 is used to characterize the deviation between the individual sensor and the general reference.
[0149] S502. Calculate the calibration compensation value ΔR at the current ambient temperature T based on the calibration formula. comp (T);
[0150] The calibration formula is ΔR. comp (T): ΔR comp (T)=α×(ΔR)+β×(ΔR) 3 +γ×e (-δ×|ΔR|) α is the linear drift coefficient, used to characterize the linear compensation amount of individual deviations; β is the expansion coefficient, used to deal with higher-order compensation of nonlinear temperature drift; γ and Δ are exponential decay coefficients, used to suppress overcompensation of extreme deviations.
[0151] Each coefficient was determined through multi-temperature point calibration experiments, and the optimal coefficients were solved using the Levenberg-Marquardt algorithm, which may include the following steps:
[0152] (1) At the preset ambient temperature point, the ΔR of each temperature point is obtained through the calibration phase. i and the corresponding ideal compensation value ΔR i_comp ; where ΔR i This represents the difference between the calibration compensation value at the i-th ambient temperature point and the calibration digital potentiometer value at the i-th ambient temperature point. The preset key points must cover the entire operating temperature range of the sensor, such as -40℃, -20℃, 0℃, 25℃, 50℃, 85℃, 125℃, etc., and must include at least 4 points, with the number exceeding the number of coefficients to be determined. The ideal compensation value is the target compensation value that enables the sensor to achieve the required detection accuracy at this temperature, and is determined by measurement using high-precision experimental equipment or design requirements.
[0153] (2) Initialization parameters are set based on sensor material properties and experimental experience, with initial values for the coefficients. Specifically, α is initialized to ΔR. i_compThe slope of the linear fit with ΔR; β is initialized to 0 (assuming linearity first, and corrected in subsequent iterations); γ is initialized to a positive number, such as 0.1, reflecting the initial strength of the temperature drift saturation trend; δ is initialized to a positive number, such as 0.05, to control the decay rate of the exponential term.
[0154] (3) Define the objective function as "the sum of squared errors between the actual calculated value and the ideal value", that is:
[0155]
[0156] Where n is the number of temperature points, and i is the index of the i-th temperature point. The goal is to minimize J through iteration to obtain the optimal coefficients.
[0157] (4) Construct and calculate the Jacobian matrix, where the elements of the Jacobian matrix J (n×4 dimensions) are the partial derivatives of the objective function with respect to each coefficient:
[0158]
[0159] The iterative formula based on the Levenberg-Marquardt algorithm adjusts the coefficient vector t: θ = [α, β, γ, δ]. T θ k+1 =θ k -(J T J+λI) -1 J T e; where λ is the damping factor used to control iterative stability, initially set to 0.01, I is the identity matrix, and e is the error vector, and e i =ΔR i_comp - Calculated value.
[0160] If the objective function J decreases after iteration, the iteration is effective, and λ is decreased (e.g., λ = λ / 10). If J increases, the iteration is ineffective, and λ is increased (e.g., λ = λ × 10), and the parameters are backtracked to θ. k .
[0161] (5) Stop iteration when any of the following conditions are met:
[0162] The change in coefficient is less than the threshold: ||θ k+1 -θ k ||<10 -6 ;
[0163] The objective function value is less than the set precision: J < 10 -5 ;
[0164] The number of iterations has reached the upper limit (e.g., 100 times).
[0165] (6) Finally, the compensation effect of the optimal coefficient is verified by the temperature points not participating in the iterative optimization. If the error (deviation of the calculated value from the ideal value) is less than the sensor accuracy requirement, the coefficient is valid; otherwise, the data is re-collected or the initial value is adjusted to repeat the iteration.
[0166] For example, based on the experimental calibration, α = 0.9, β = 0.001, γ = 2, Δ = 0.1 are obtained, and ΔR = 4LSB is substituted, then ΔR comp (25℃) = 0.9x4 + 0.001x4 3 + 2x e (-0.1×4) ≈ 3.6 + 0.064 + 2x0.67 ≈ 3.6 + 0.064 + 1.34 ≈ 5.004LSB (rounded to 5LSB).
[0167] S503, add the calibration compensation value of all temperature points in the temperature drift compensation lookup table and ΔR comp (T) to generate an updated lookup table and store it in the MCU memory.
[0168] Wherein, the update logic is: for each temperature point T i in the lookup table, the new compensation value R' comp (T i ) = R comp (T i ) + ΔR comp (T) (T is the calibration environment temperature) ; after the update is completed, the integrity of all temperature point data is verified by the PDCT software.
[0169] For example, in the original lookup table, 25℃ R comp = 508LSB, 30℃ = 513LSB, 35℃ = 517LSB, after adding ΔR comp = 5LSB, it is updated to 25℃ = 513LSB, 30℃ = 518LSB, 35℃ = 522LSB.
[0170] Based on the above technical solution, S5 realizes the accurate fusion of general reference and individual characteristics through individual deviation calculation, nonlinear calibration formula compensation and full table update, which not only retains the full temperature zone compensation framework in the calibration stage, but also eliminates the individual differences caused by process deviation through calibration compensation value; the operation process is completed relying on software and communication protocol, supports multiple adjustments after product assembly, significantly improves the consistency of the same type of sensor, and solves the problem that traditional hardware compensation cannot adapt to individual differences.
[0171] For example Figures 2-5As shown, taking M12 non-flat detection distance of 8mm as an example, the temperature drift calibration process and effect of the present application are shown. Among them, M12 non-flat refers to an inductive sensor with a shell diameter of 12mm installed in a non-flat manner, and the non-flat installation manner refers to the installation form that the detection surface of the sensor is not flush with the surrounding metal mounting plate (or metal workpiece surface), but protrudes from the surface of the mounting plate.
[0172] As can be seen from the figure, before calibration, the detection distance of the sensor at different temperatures deviates greatly from the target distance, and with the change of temperature, the measured distance presents irregular fluctuation, because the traditional calibration process cannot cope with the process deviation after assembly, resulting in poor product consistency and unable to offset the nonlinear temperature drift caused by temperature change.
[0173] After calibration, through the calibration method of the present application, the detection distance of the sensor at each temperature point is closer to the target distance (i.e. 8mm), and the measured data shows that after calibration, the sensor can realize a temperature drift deviation of ±2% at room temperature (room temperature 25℃), and a temperature drift deviation of ±10% within the full temperature range (-25℃-70℃), indicating that the calibration effectively eliminates individual process deviation, and the stability of the detection distance at different temperatures is significantly improved.
[0174] In addition, the traditional calibration method is carried out in the production process, which needs to replace the resistor or laser resistance repair through complex process, not only the production efficiency is low, and after assembly, it cannot be calibrated again, resulting in poor product consistency, while the calibration method of the present application is carried out after the product is assembled, using PDCT host computer software combined with IO-Link communication protocol, by obtaining the digital potentiometer value of a temperature point, automatically adjusting the digital potentiometer value of all temperature points, without complex hardware compensation for each product, this way simplifies the production process, reduces the production cost, at the same time, through targeted individual calibration, the detection performance of the same type of product is more consistent, solving the problem of poor product consistency in traditional method.
[0175] Moreover, the hardware compensation method of the prior art is difficult to cope with nonlinear and dynamic temperature changes, while the present application method establishes a lookup table covering different temperatures through the temperature drift calibration stage, combined with individual adjustment in the calibration stage, which can adapt to the nonlinear characteristics of temperature change, from the calibrated data, whether in low temperature, room temperature or high temperature interval, the detection distance deviation is effectively controlled, proving that this method can accurately offset the influence of nonlinear temperature drift, compared with the traditional method, it has more extensive applicability and better compensation effect.
[0176] The above describes the scheme of the embodiments of the present application mainly from the perspective of device implementation. It can be understood that, in order to implement the above functions, each device, for example, the temperature drift calibration and calibration device of the inductive sensor, comprises at least one of the corresponding hardware structure and software module for executing each function. Those skilled in the art should easily realize that, in combination with the units and algorithm steps of each example described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a certain function is implemented in the form of hardware or computer software driven hardware depends on the specific application and design constraints of the technical scheme. The skilled person can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.
[0177] The embodiments of the present application can divide the functional units of the temperature drift calibration and calibration device of the inductive sensor according to the above method examples, for example, each functional unit can be divided according to each function, or two or more functions can be integrated in one processing unit. The above integrated unit can be implemented in the form of hardware or software functional unit. It should be noted that the division of units in the embodiments of the present application is illustrative, and is only a logical functional division. In actual implementation, there can be another division method.
[0178] In the case of using integrated units, Figure 5 A possible structure diagram of the temperature drift calibration and calibration device of the inductive sensor involved in the above embodiments is shown, which comprises a micro control unit, a communication host unit, a host computer unit, a high and low temperature box unit, and can also comprise a storage unit. Figure 5 The structure diagram shown can be used to illustrate the structure of the temperature drift calibration and calibration device of the inductive sensor involved in the above embodiments.
[0179] When Figure 5 When the structure diagram shown is used to illustrate the structure of the temperature drift calibration and calibration device of the inductive sensor involved in the above embodiments, the inductive sensor is used to execute each step in the calibration and calibration stage, the communication host unit is used to connect the sensor and the host computer and implement data and instruction transmission, the host computer unit is used to run related software and send instructions, the high and low temperature box unit is used to provide an environment with a preset temperature range in the calibration stage, and the storage unit is used to store process data and related tables.
[0180] For example, the inductive sensor comprises a micro control unit, a temperature sensor, a digital potentiometer and a target, and is used to execute specific steps in the calibration stage and the calibration stage;
[0181] A communication host unit is configured to connect the inductive sensor and the host computer unit, and ensure that data and instructions can be accurately transmitted.
[0182] The host computer unit is configured to run PDCT software, and send sampling mode instructions and calibration instructions to the sensor.
[0183] The high and low temperature chamber unit is configured to simulate different temperature environments in the calibration stage, and provide a preset temperature range.
[0184] The target detection unit is configured to detect whether there is a target by using a resonant circuit, and use the result as a basis for judging calibration and calibration.
[0185] The storage unit is configured to store the temperature drift compensation lookup table generated in the calibration process and the related data in the calibration process.
[0186] In a possible implementation, the storage unit is further configured to save response data of the sensor at different temperatures for subsequent review and analysis.
[0187] In a possible implementation, the host computer unit is further configured to receive and display and record the sensor data transmitted by the communication host unit; and the target detection unit is further configured to feed back the detected target signal to the micro control unit in real time, so as to timely adjust the operation steps.
[0188] The embodiments of the present application also provide a computer readable storage medium including instructions, which, when executed on a computer, cause the computer to perform any of the above methods.
[0189] The embodiments of the present application also provide a computer program product including instructions, which, when executed on a computer, cause the computer to perform any of the above methods.
[0190] The embodiments of the present application also provide a chip including a processor and an interface circuit, the interface circuit and the processor are coupled, the processor is configured to run a computer program or instructions to implement the above method, and the interface circuit is configured to communicate with other modules outside the chip.
[0191] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented using software programs, implementation can be, in whole or in part, in the form of a computer program product. This computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, computer instructions can be transmitted from one website, computer, server, or data center to another via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium accessible to a computer or a data storage device containing one or more servers, data centers, etc., that can be integrated with the medium. The available media can be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., DVDs), or semiconductor media (e.g., solid-state disks (SSDs)).
[0192] Although this application has been described herein in conjunction with various embodiments, those skilled in the art, by reviewing the accompanying drawings, the disclosure, and the appended claims, will understand and implement other variations of the disclosed embodiments in carrying out the claimed application. In the claims, the word "comprising" does not exclude other components or steps, and "a" or "an" does not exclude multiple instances. A single processor or other unit can implement several functions listed in the claims. While different dependent claims may recite certain measures, this does not mean that these measures cannot be combined to produce good results.
[0193] Although this application has been described in conjunction with specific features and embodiments, it is obvious that various modifications and combinations can be made thereto without departing from the spirit and scope of this application. Accordingly, this specification and drawings are merely exemplary illustrations of this application as defined by the appended claims, and are considered to cover any and all modifications, variations, combinations, or equivalents within the scope of this application. Clearly, those skilled in the art can make various alterations and modifications to this application without departing from the spirit and scope of this application. Thus, if such modifications and modifications of this application fall within the scope of the claims of this application and their equivalents, this application is also intended to include such modifications and modifications.
Claims
1. A method for calibrating and adjusting the temperature drift of an inductive sensor, characterized in that, include: The sensors to be calibrated are divided into Class I and Class II sensors according to a preset ratio; After adjusting the first type of sensor to a preset distance from the target, it was placed in a high and low temperature chamber; Each time the temperature value of the high and low temperature chamber is adjusted, a dynamic step size adjustment algorithm is used to adjust the value of the digital potentiometer until the target is detected; the digital potentiometer is used to adjust the resistance value of the inductive sensor circuit so that the target can be detected by the resonant circuit at the current temperature value. Based on the same temperature value of the high and low temperature chamber and the recorded digital potentiometer value during the heating and cooling processes, calculate the calibration compensation value of the digital potentiometer. A temperature drift compensation lookup table for the first type of sensor is generated based on the calibration compensation value and the corresponding temperature value. The second type of sensor is adjusted to a preset distance from the target, the current ambient temperature is obtained using a temperature sensor, and the value of the digital potentiometer is adjusted until the target is detected. The calibration compensation value of the digital potentiometer at the current ambient temperature is calculated based on the calibration formula, and the calibration compensation value in the temperature drift compensation lookup table is updated according to the calibration compensation value to obtain the temperature drift compensation lookup table for the second type of sensor.
2. The method for temperature drift calibration and verification of an inductive sensor according to claim 1, characterized in that, The dynamic step size adjustment algorithm is: ΔR = k × (T1 - T2) 2 +b; where ΔR represents the dynamic step size of the digital potentiometer adjustment, T1 represents the previous temperature value of the high and low temperature chamber, T2 represents the current temperature value of the high and low temperature chamber, k represents the slope, b represents the bias, and k and b are coefficients that are pre-calibrated experimentally based on the sensor material characteristics.
3. The method for temperature drift calibration and verification of an inductive sensor according to claim 1, characterized in that, The formula for calculating the calibration compensation value is: R comp =(R heat ×W heat +R cool ×W cool ) / (W heat +W cool ); where R comp R represents the calibration compensation value. heat R represents the digital potentiometer value recorded during the heating process. cool W represents the digital potentiometer value recorded during the cooling process. heat W cool These represent the weighting coefficients, which are determined based on the rate of temperature change in the corresponding process.
4. The method for temperature drift calibration and verification of an inductive sensor according to claim 3, characterized in that, The formula for calculating the weighting coefficient is: W heat =1 / (1+v) heat ), W cool =1 / (1+v) cool ); Among them, v heat v represents the rate of temperature change during the heating process. cool The temperature change rate during the cooling process is expressed as: Temperature change rate = |T1-T2| / Δt, where Δt represents the unit time.
5. The method for temperature drift calibration and verification of an inductive sensor according to claim 1, characterized in that, The process of generating the temperature drift compensation lookup table includes: The digital potentiometer value is increased in dynamic steps until the target is detected for the first time; wherein the initial value of the digital potentiometer value is the digital potentiometer value recorded at the previous temperature. If the target is detected for the first time, the value of the digital potentiometer is gradually reduced by 1 until the target can no longer be detected. Then, the previous value of the digital potentiometer when the target cannot be detected and the current temperature value of the high and low temperature chamber are recorded. Based on all recorded temperature values, all digital potentiometer values, and the calculated calibration compensation values, the values are arranged in ascending order to obtain a temperature drift compensation lookup table covering the preset temperature range.
6. The method for temperature drift calibration and verification of an inductive sensor according to claim 1, characterized in that, Update the calibration compensation value in the temperature drift compensation lookup table according to the calibration compensation value, including: Record the digital potentiometer value that causes the target to be detected by the resonant circuit at the current ambient temperature, and mark it as the first digital potentiometer value; From the temperature drift compensation lookup table, find the calibration compensation value that is the same as the current ambient temperature, and mark it as the second digital potentiometer value; Calculate the difference ΔR between the first digital potentiometer value and the second digital potentiometer value; Calculate the calibration compensation value ΔR of the digital potentiometer according to the calibration formula. comp (T): ΔR comp (T)=α×(ΔR)+β×(ΔR)3+γ×e (-δ×|ΔR|) Where α is the linear drift coefficient, β is the expansion coefficient, γ and δ are the exponential decay coefficients, and ΔR comp (T) represents the calibration compensation amount at the current ambient temperature T; The updated temperature drift compensation lookup table is obtained by adding the calibration compensation value and the calibration compensation amount at different temperature values in the temperature drift compensation lookup table.
7. The method for temperature drift calibration and verification of an inductive sensor according to claim 6, characterized in that, The coefficients in the calibration formula are solved through the following steps: Use a temperature sensor to obtain the ambient temperature; The temperature point calibration command is sent to the microcontroller unit (MCU) via the port device configuration tool PDCT software and the IO-Link host. After receiving the temperature calibration command, the MCU determines that the target's digital potentiometer value can be detected at multiple ambient temperature points, and obtains multiple calibration digital potentiometer values. The optimal coefficients are determined based on multiple calibrated digital potentiometer values.
8. The method for temperature drift calibration and verification of an inductive sensor according to claim 7, characterized in that, The matrix equation for solving the optimal coefficients based on multiple calibrated digital potentiometer values is as follows: Where, ΔR i (i = 1, 2, 3, 4) represents the difference between the calibration compensation value and the calibration digital potentiometer value at the i-th ambient temperature point, ΔR. icomp (i = 1, 2, 3, 4) represents the ideal compensation value for the i-th ambient temperature point; The matrix equation is solved iteratively using the Levenberg-Marquardt algorithm to obtain the optimal coefficients α, β, γ, and δ.
9. The method for temperature drift calibration and verification of an inductive sensor according to claim 1, characterized in that, The temperature drift compensation lookup table is used as follows: When the inductive sensor is working, the microcontroller unit (MCU) inside the inductive sensor obtains the real-time ambient temperature through the temperature sensor, retrieves the corresponding compensation value from the lookup table according to the real-time ambient temperature, and writes the compensation value into the digital potentiometer to adjust the sensing distance of the inductive sensor and offset the temperature drift caused by temperature changes.
10. A storage medium, characterized in that, The storage medium stores a computer program, which, when executed by a processor, implements the temperature drift calibration and standardization method for the inductive sensor according to any one of claims 1-9.